Commit 5412625
Allow overriding is_enabled property via config for trait linters
Summary:
# Context
For linters based on [traits](https://whatsapp.github.io/erlang-language-platform/docs/contributing/linters/linter-traits/) we can customize their behaviour via config. Here we extend the configuration mechanism we already use for `severity` and other properties to the `is_enabled` flag. This mechanism will eventually supersede the `enabled_lints` and `disabled_lints` [configuration properties](https://whatsapp.github.io/erlang-language-platform/docs/get-started/configure-project/elp-lint-toml/#enabled_lints).
# Why having a new way to enable and disable linters?
Currently, the `.elp_lint.toml` allows users to specify which linters are enabled or disabled. But the configuration file works in a very counter-intuitive way: say a linter is "disabled by default". To enable it, a user cannot simply add it to the `enabled_list`, since that would cause **only that linter** to run. A user would need to add all available linters to the config, which is clearly not a maintainable solution.
By supporting an override mechanism, it will be possible to - for example - have the following configuration:
```
[linters.my_linter]
enabled = true
```
Which would keep the *enabled* status for all other linters to their default value, ensuring `my_linter` is enabled.
# This diff
This diff introduces the new overriding mechanism. We still keep it undocumented, until all linters are migrated to use a trait.
Reviewed By: TheGeorge
Differential Revision: D85055745
fbshipit-source-id: f84d203c380a45dcbafae5d09dc9141d42a12e911 parent dab22ff commit 5412625
1 file changed
+62
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
550 | 550 | | |
551 | 551 | | |
552 | 552 | | |
| 553 | + | |
| 554 | + | |
| 555 | + | |
| 556 | + | |
| 557 | + | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
| 561 | + | |
| 562 | + | |
| 563 | + | |
553 | 564 | | |
554 | 565 | | |
555 | 566 | | |
| |||
1129 | 1140 | | |
1130 | 1141 | | |
1131 | 1142 | | |
| 1143 | + | |
| 1144 | + | |
| 1145 | + | |
| 1146 | + | |
| 1147 | + | |
1132 | 1148 | | |
1133 | 1149 | | |
1134 | 1150 | | |
| |||
1213 | 1229 | | |
1214 | 1230 | | |
1215 | 1231 | | |
| 1232 | + | |
| 1233 | + | |
1216 | 1234 | | |
1217 | 1235 | | |
1218 | 1236 | | |
| |||
3486 | 3504 | | |
3487 | 3505 | | |
3488 | 3506 | | |
| 3507 | + | |
3489 | 3508 | | |
3490 | 3509 | | |
3491 | 3510 | | |
| |||
3527 | 3546 | | |
3528 | 3547 | | |
3529 | 3548 | | |
| 3549 | + | |
3530 | 3550 | | |
3531 | 3551 | | |
3532 | 3552 | | |
| |||
3567 | 3587 | | |
3568 | 3588 | | |
3569 | 3589 | | |
| 3590 | + | |
3570 | 3591 | | |
3571 | 3592 | | |
3572 | 3593 | | |
| |||
3608 | 3629 | | |
3609 | 3630 | | |
3610 | 3631 | | |
| 3632 | + | |
3611 | 3633 | | |
3612 | 3634 | | |
3613 | 3635 | | |
| |||
3644 | 3666 | | |
3645 | 3667 | | |
3646 | 3668 | | |
| 3669 | + | |
| 3670 | + | |
| 3671 | + | |
| 3672 | + | |
| 3673 | + | |
| 3674 | + | |
| 3675 | + | |
| 3676 | + | |
| 3677 | + | |
| 3678 | + | |
| 3679 | + | |
| 3680 | + | |
| 3681 | + | |
| 3682 | + | |
| 3683 | + | |
| 3684 | + | |
| 3685 | + | |
| 3686 | + | |
| 3687 | + | |
| 3688 | + | |
| 3689 | + | |
| 3690 | + | |
| 3691 | + | |
| 3692 | + | |
| 3693 | + | |
| 3694 | + | |
| 3695 | + | |
| 3696 | + | |
| 3697 | + | |
| 3698 | + | |
| 3699 | + | |
| 3700 | + | |
| 3701 | + | |
| 3702 | + | |
| 3703 | + | |
| 3704 | + | |
| 3705 | + | |
| 3706 | + | |
| 3707 | + | |
| 3708 | + | |
3647 | 3709 | | |
0 commit comments