Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show infos when using dart_analyze linter #4237

Merged
merged 1 commit into from
Jun 24, 2022

Conversation

grlduarte
Copy link
Contributor

Currently the infos are not showed by ALE when working with Dart files.

  • Changed the linter command to use the argument --fatal-infos so that when there's one info it triggers ALE,
  • Updated the test routine.

Code snippet for testing:

// main.dart
class A {
  const A();
}

void accessA() {
  A a = new A();
}

@grlduarte grlduarte marked this pull request as ready for review June 22, 2022 21:40
\ },
\ ],
\ ale_linters#dart#dart_analyze#Handle(bufnr(''), [
\ 'Analyzing main.dart...',
\ ' error - main.dart:5:1 - Expected to find ''}'' - expected_token',
Copy link
Contributor

Choose a reason for hiding this comment

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

I think these changes should not affect the already exising tests. Please keep the previous tests and add the new ones.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done. Just had to remove the whitespaces before the warning message in the existing test. It seems now that the output right justifies the severity codes:

  error - main.dart:9:1 - Expected to find '}'. - expected_token
warning - main.dart:2:11 - The receiver can't be null, so the null-aware operator '?.' is unnecessary. Try replacing the operator '?.' with '.'. - invalid_null_aware_operator
   info - main.dart:8:3 - Dead code. Try removing the code, or fixing the code before it so that it can be reached. - d
ead_code

Copy link
Contributor

@hsanson hsanson left a comment

Choose a reason for hiding this comment

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

Looks good, thanks.

@hsanson hsanson merged commit 4a0d669 into dense-analysis:master Jun 24, 2022
cyyever pushed a commit to cyyever/ale that referenced this pull request Jul 11, 2022
cyyever pushed a commit to cyyever/ale that referenced this pull request Jul 11, 2022
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.

2 participants