You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am looking to specify error-level as error, implying that the analyzer should only fail in the event that an "error" is found. However, it is still failing to commit when a "warning" is found.
Here is my configuration in the pubspec.yaml file:
I then made a change to a file that does have a linter warning present (the variable _authHandler is not used), and tried to commit.
Because this is just a warning, and not an error, I should be allowed to commit.
After running git commit -m "dummy commit", this is what my terminal shows:
git commit -m "dummy commit"
✅ Accepted file lib/services/org_chart_service.dart
🔎 Running analyze...
warning - lib/services/org_chart_service.dart:13:21 - The value of the field '_authHandler' isn't used. Try removing the field, or using it. - unused_field
1 issue(s) found.
❌ Completed analyze, found problems
So, it seems to me that the error-level config is not actually respecting the value that is being passed in, and always falls back on the default of "info".
The text was updated successfully, but these errors were encountered:
I tried to reproduce the issue, and I think the problem lies in how the tool handles analyzer results. Currently, it ignores the exit code and simply checks if lints are present. This was done to enable scan-mode: staged, as the analyzer tool itself cannot be instructed to only scan parts of the project. However, as it seems, it will still print out warning, even if they are marked as non fatal.
This leaves me with 2 options: Remove the error-level completely or remove the scan-mode completely, as we can't do both. I personally would tend more to removing the scan-mode, as it is already artificial (because not natively supported by the dart analyzer) and has led to problems in the past (as changes in staged code might be error free, but could very well cause problems in other files).
I will notify you, once the updated version was released.
I am looking to specify
error-level
aserror
, implying that the analyzer should only fail in the event that an "error" is found. However, it is still failing to commit when a "warning" is found.Here is my configuration in the
pubspec.yaml
file:I then made a change to a file that does have a linter warning present (the variable
_authHandler
is not used), and tried to commit.Because this is just a warning, and not an error, I should be allowed to commit.
After running
git commit -m "dummy commit"
, this is what my terminal shows:So, it seems to me that the
error-level
config is not actually respecting the value that is being passed in, and always falls back on the default of "info".The text was updated successfully, but these errors were encountered: