Skip to content

Conversation

@webwarrior-ws
Copy link
Contributor

@webwarrior-ws webwarrior-ws commented Jan 5, 2026

Treat config file specified using "--lint-config" as partial config (contains only configs that should be overridden; rules not specified in it use default values).

Supersedes #711

Closes #488

@knocte
Copy link
Collaborator

knocte commented Jan 5, 2026

CI is red.

Also, this PR should change docs: docs/content/how-tos/rule-configuration.md (see the part added in PR489)

@knocte
Copy link
Collaborator

knocte commented Jan 5, 2026

Let's add one last commit to this PR: a config file that will just contain the typePrefixing rule with mode=Strict. This will be in a directory where SelfCheck runs. The rule will of course also removed from excludedRules var in this same commit.

@knocte
Copy link
Collaborator

knocte commented Jan 5, 2026

mode=Strict

Sorry, mode=Always

@knocte
Copy link
Collaborator

knocte commented Jan 5, 2026

Ensure ignoring a hint from config works
Add regression test for deeper issue

Wrong order of commits, test should be added first before making it pass.

@webwarrior-ws
Copy link
Contributor Author

Ensure ignoring a hint from config works
Add regression test for deeper issue

Wrong order of commits, test should be added first before making it pass.

Reordered the commits. Put tests first.

@knocte
Copy link
Collaborator

knocte commented Jan 5, 2026

And remove --partial-config flag. Configs will now be always partial.

Given this commit, then I guess PR title needs to be updated.

webwarrior-ws and others added 7 commits January 5, 2026 13:20
Implemented partial configs and added tests for combining
configs.
Added command line option "--partial-config" that when
used, treats config file specified using "--lint-config"
as partial config (contains only configs that should be
overriden; rules not specified in it use default values).
Co-authored-by: webwarrior-ws <reg@webwarrior.ws>
And remove --partial-config flag. Configs will now be always
partial.
By using camelCase rule name name in config instead of
PascalCase (camelCase is proper rule naming scheme in
fsharplint.json).
To reflect change in how config is applied.
Co-authored-by: webwarrior-ws <reg@webwarrior.ws>
When combining configs, if both base and overriding configs
have Hints config, combine `add` and `ignore` arrays in
HintConfig objects instead of totally overriding base hint
config by overriding one.

Also actually use `ignore` array to filter out available hints
when flattening config. Before, `ignore` was not used at all.

Fixes fsprojects#466
@webwarrior-ws webwarrior-ws changed the title Added option to use partial config Use partial config Jan 5, 2026
Configuration.combineConfigs defaultConfig partialConfig |> Ok
| Error(_) as err -> err
with
| ex -> Error (string ex)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@webwarrior-ws why are you swallowing the exception here? (BTW, is string ex the same as ex.ToString()?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@webwarrior-ws why are you swallowing the exception here? (BTW, is string ex the same as ex.ToString()?

That is what original code was doing (catching exception and putting it into Error). I assume it was done because Configuration.loadConfig can throw an exception but getConfig returns Result, and so is not expected to throw.

string ex is the same as ex.ToString().

@knocte knocte changed the title Use partial config Partial configuration Jan 5, 2026
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.

Documentation says nothing about fsharplint.json file

2 participants