Who lints the lints? #23
Comments
Similar discussion over here: dart-lang/linter#1553 |
You could put something in your presubmit if you like :) ... this is far from beautiful, could definitely be improved: LINTS=$(\
cat $(\
cat .packages | \
grep pedantic | \
sed -e 's#.*file://##')/analysis_options*.yaml | \
egrep '^ -' | \
sed -e 's# ##g' | \
sort -u; \
cat analysis_options.yaml | \
egrep '^ -' | \
sed -e 's# ##g');
if [[ $(echo $LINTS | \
tr ' ' '\n' | \
sort -u | \
wc -l) != $(echo $LINTS | \
tr ' ' '\n' | \
wc -l) ]]; then \
echo Redundant lint with pedantic.; exit 1; \
fi |
Ideally, I'd like the problems to be surfaced in the same manner as other lints. For me, that means the PROBLEMS panel in VS Code. Presubmits are a nice idea, but aren't portable. It's not uncommon for team members to use different operating systems and - in my experience at least - this makes the use of hooks untenable. |
Thanks @kentcb. I've opened a feature request on the linter here: dart-lang/linter#1588. Alternatively, we could do this in the analyzer but, as @bwilkerson points out, it may not be universally desired so a simple opt-in model may be best. Feel free to chime in with any additional thoughts there! |
Closed - refer to dart-lang/linter#1588 going forward. |
Vague title, but I couldn't resist it sorry.
Here's my situation: I want to use pedantic but I've also got quite a few extra lints that I want enabled. Some of those will almost certainly be included in pedantic itself at some point. Since the point of pedantic is to adhere to Google's standard, the lints I add are useful as a point of difference. However, nothing guarantees that they are a point of difference.
What's the guidance in this situation? It would be nice to know that if my lint configuration becomes redundant at some point (due to a newer pedantic release) that I would be notified, but it seems that this is not the case (I just tried adding a lint that pedantic has already enabled). Is my only recourse to manually pick through the lints I have enabled and see whether they're redundant? Seems finicky.
The text was updated successfully, but these errors were encountered: