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

☂ Improve linter test reliability and maintainability #58520

Closed
5 of 7 tasks
pq opened this issue Sep 27, 2021 · 0 comments
Closed
5 of 7 tasks

☂ Improve linter test reliability and maintainability #58520

pq opened this issue Sep 27, 2021 · 0 comments
Assignees
Labels
analyzer-linter Issues with the analyzer's support for the linter package area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion. area-meta Cross-cutting, high-level issues (for tracking many other implementation issues, ...). P3 A lower priority bug or feature request type-enhancement A request for a change that isn't a bug type-test

Comments

@pq
Copy link
Member

pq commented Sep 27, 2021

Our current approach to rule testing leans heavily on expectations being communicated in the source via special comments (e.g., // LINT). This works very well for the simple cases but has accumulated some technical debt over time.

  1. the test infrastructure cares only about the specific lint-under-test and discards all other diagnostics. This has caused a bunch of confusion over the years (see e.g., skip nullable iterables in avoid_function_literals_in_foreach_calls linter#2752 (comment)).
  2. when testing logic that depends on more than one compilation unit we take an integration test approach, spawning a process and expressing expectations in terms of expected CLI output -- this is slow, unwieldy to debug and brittle wrt to modifications (basically the trouble with golden files).

To get this under control, I'd like to consider a few changes:

@pq pq added type-test area-meta Cross-cutting, high-level issues (for tracking many other implementation issues, ...). labels Sep 27, 2021
@pq pq self-assigned this Sep 27, 2021
copybara-service bot referenced this issue Oct 5, 2021
Required for: https://github.com/dart-lang/linter/issues/2969

Change-Id: I74ea56145cf7e0dea2481e945f2e7810c3cffd9f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/215501
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
@pq pq added the P3 A lower priority bug or feature request label Nov 14, 2022
@srawlins srawlins added the type-enhancement A request for a change that isn't a bug label Mar 29, 2024
@devoncarew devoncarew added analyzer-linter Issues with the analyzer's support for the linter package area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion. labels Nov 19, 2024
@devoncarew devoncarew transferred this issue from dart-lang/linter Nov 19, 2024
@srawlins srawlins self-assigned this Dec 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
analyzer-linter Issues with the analyzer's support for the linter package area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion. area-meta Cross-cutting, high-level issues (for tracking many other implementation issues, ...). P3 A lower priority bug or feature request type-enhancement A request for a change that isn't a bug type-test
Projects
None yet
Development

No branches or pull requests

3 participants