Skip to content

Conversation

@webwarrior-ws
Copy link
Contributor

Print number of enabled/total/disabled rules in config before linting.

@webwarrior-ws
Copy link
Contributor Author

Note that the hints are counted as single rule.

@knocte
Copy link
Collaborator

knocte commented Jan 28, 2026

Why is the total 96 instead of 94? (Last rule added was FL0094)

@webwarrior-ws
Copy link
Contributor Author

webwarrior-ws commented Jan 28, 2026

Why is the total 96 instead of 94? (Last rule added was FL0094)

Hints are counted as one rule.

Also there is a field ignoreFiles which gets counted but should not.

I wonder if it's better to only include fields that have type Option<RuleConfig<'T>>.

@knocte
Copy link
Collaborator

knocte commented Jan 28, 2026

Sorry I'm not a fan of the Reflection approach to count all rules. If you're already not needing reflection to count the enabled rules, why not use the logic that must be filtering the rules by config.Enabled or not (which end up in LoadedRules type) to get a total from there?

@webwarrior-ws
Copy link
Contributor Author

Sorry I'm not a fan of the Reflection approach to count all rules. If you're already not needing reflection to count the enabled rules, why not use the logic that must be filtering the rules by config.Enabled or not (which end up in LoadedRules type) to get a total from there?

Because LoadedRules include only enabled rules. Information about any disabled rules is lost in the process of creating it. And I'm hesitant to make any major changes in Configuration.fs because it will mess up with PRs that are currently open but haven't been merged yet.

@knocte
Copy link
Collaborator

knocte commented Jan 29, 2026

Information about any disabled rules is lost in the process of creating it

I'm asking you to modify that process so that it is not lost anymore.

And I'm hesitant to make any major changes in Configuration.fs because it will mess up with PRs that are currently open but haven't been merged yet.

Please don't.

@knocte
Copy link
Collaborator

knocte commented Jan 29, 2026

Hints are counted as one rule.
Also there is a field ignoreFiles which gets counted but should not.

We also have to take in account that rule NonPublicValuesNames was removed, so when I said 94 above, I meant 93.

@knocte
Copy link
Collaborator

knocte commented Jan 29, 2026

Please don't.

I meant, do not be hesitant please. A change to just count things is not going to be very disruptive; fixing conflicts later should be very easy.

@webwarrior-ws
Copy link
Contributor Author

@knocte Changed how rules are counted. The final result is 95 rules, because deleted rule is still included in all rules list (but raises an exception when enabled) and Hints are counted as one rule.

@knocte
Copy link
Collaborator

knocte commented Jan 29, 2026

Let's squash commits into 1.

Print number of enabled/total/disabled rules in config
before linting.
@webwarrior-ws
Copy link
Contributor Author

Let's squash commits into 1.

Squashed.

@knocte knocte merged commit e8a2d2b into fsprojects:master Jan 29, 2026
8 checks passed
@knocte
Copy link
Collaborator

knocte commented Jan 29, 2026

See how much simpler & cleaner the code of this PR is now without reflection? We have to be careful about needlessly growing the complexity of the codebase.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants