Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Have a simple way to run all checks (even optional ones) #321

Closed
kivra-pauoli opened this issue Sep 6, 2023 · 8 comments · Fixed by #330
Closed

Have a simple way to run all checks (even optional ones) #321

kivra-pauoli opened this issue Sep 6, 2023 · 8 comments · Fixed by #330

Comments

@kivra-pauoli
Copy link
Contributor

Is your feature request related to a problem? Please describe

I'm always frustrated when I have to study a static analysis tool to understand all its possibilities (and I don't think we're listing what rules we run by default 😢).

Describe the solution you'd like

Something like an atom all in elvis.config to indicate "run all rules". This would then be overwritten by the specific rules that are configured in that same file.

Describe alternatives you've considered

Reading through elvis_core and figuring out (as releases come out) which rules are "by default" and which ones aren't.

Additional Context

N/A.

@elbrujohalcon
Copy link
Member

I'm not against the idea, but… not all rules can be applied to all files. That's why we have rulesets. Maybe what we need is better ruleset documentation.

@elbrujohalcon
Copy link
Member

elbrujohalcon commented Sep 6, 2023

Maybe we can create new rulesets, like erl_files_all_rules, hrl_files_all_rules, etc… Including all rules in them…
And now that we're at it, we can also create erl_files_minimal, hrl_files_minimal, etc… with just the rules that had like 90%+ agreement/support from the community… 🤔

@kivra-pauoli
Copy link
Contributor Author

That's why we have rulesets

Sure, but still there are some rules that aren't applied by default: that's what I was aiming at.

It can even be something like

[#{ dirs => ["apps/*/src/**", "src/**"],
    filter => "*.erl",
    ruleset => erl_files,
    apply => all | minimal | ... },
 #{ dirs => ["."],
    filter => "rebar.config",
    ruleset => rebar_config,
    apply => all | minimal | ... },
 #{ dirs => ["."],
    filter => "elvis.config",
    ruleset => elvis_config,
    apply => all | minimal | ... }]

@elbrujohalcon
Copy link
Member

elbrujohalcon commented Sep 6, 2023

I would still prefer multiple rulesets (and good docs about them) instead of an apply parameter. Remember that people can define their own rulesets… I don't want them to have to add stuff to them to differentiate all, minimal, etc… and, conversely, I don't relly want to have code that deals with rulesets that have flavours, and also rulesets that don't.

@kivra-pauoli
Copy link
Contributor Author

Ok, sure, that makes sense.

So the goal would be to have (for starters) ..._all_rules rulesets that would run (in their already defined scopes) all the implemented rules.

I don't wanna think about minimal or other scopes now, since that'd probably involve some kind of survey to understand what people actually disable from the default rules. 😆

@elbrujohalcon
Copy link
Member

That is correct.

@elbrujohalcon
Copy link
Member

Maybe we can call it erl_files_strict 🤔

@kivra-pauoli
Copy link
Contributor Author

I'm looking at the differences between erl_files and hrl_files. I'm thinking about creating a common function (in elvis_rulesets) to hold common rules, and then maybe two other functions, erl_rules and hrl_rules (internal), so it's easier to group. But then again, we also have beam_files so don't know how easy it'll be to find common ground/group it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants