Replies: 3 comments
-
There's two other options that might make sense: If I do We could track this with a priority system, which could either be explicit in the linters, or bundle-based, e.g. enum PRIORITIES: int {
VIA_BUILTIN_BUNDLE = 0,
VIA_THIRD_PARTY_BUNDLE = 1,
SPECIFIC_LINTER_REQUESTED = 2
}; ... or, if we take a There would still be the potential for unresolvable conflicts via this system. |
Beta Was this translation helpful? Give feedback.
-
Warnings vs errorsI think we should always do hard errors - having a warning on every run IMO shouldn't be considered acceptable. Warn-and-continue indicates that:
IMO conflict resolution should end in 'this is definitely the right thing to do', or "I don't know", and the best thing to do for "I don't know" is hard-fail. |
Beta Was this translation helpful? Give feedback.
-
Manual resolutiona.k.a. warning/error suppression: Perhaps |
Beta Was this translation helpful? Give feedback.
-
copying from #287 (comment)
to explain further, the idea is to add a new
Linter::getConflicts(): vec<classname<Linter >>
method, this method will return a list of linters that should be disabled if the current linter is enabled.example:
assume
company/company-hack-linters
package providesCompany\Linter\CamelCaseEnumMemberssLinter::class
linter.This linter ensures that all enum members are using CamelCase ( such as
Permission::Read
instead ofPermission:READ
), this linter would be conflicting with the hhast builtin linterFacebook\HHAST\ShoutCaseEnumMembersLinter::class
( it'sgetConficlits()
method returnsvec[Facebook\HHAST\ShoutCaseEnumMembersLinter::class]
).If #423 is implemented, there's two ways to configure linters ( can be discussed in there ).
If we go with option (2), it would make sense for hhast to throw an exception, if a linter conflicts with another linter in the list, the end user would than have to manually remove
Facebook\HHAST\ShoutCaseEnumMembersLinter::class
from their configuration.If we go with option (1), the better approach would be for hhast to resolve the conflict automatically, but also log the linters that were disabled through this process in stderr.
e.g:
how conflict resolution happens, which linter takes priority when multiple linters conflict with each other, is up for discussion.
Beta Was this translation helpful? Give feedback.
All reactions