very_good_analysis icon indicating copy to clipboard operation
very_good_analysis copied to clipboard

Automated Checking of Deprecated Lint Rules

Open tomarra opened this issue 1 year ago • 1 comments

We found the JSON file that has all the information we need, https://github.com/dart-lang/site-www/blob/17ccab9e54d0166753c088651a98a5b6e78c1078/src/_data/linter_rules.json#L1764

Make a weekly action that checks that file against our lint list to look for deprecated or removed items and opens a GitHub Issue so it can be triaged and then the worked on.

We don't fully know when the JSON file gets updated (probably on Dart version releases) so we should be mostly up to date but maybe not ahead of stable releases.

tomarra avatar Oct 30 '24 14:10 tomarra

A few updates regarding progress with this issue:

  • There is now a workflow named bot_update_exclusions.yaml that will run daily and create a PR whenever the exclusion table needs to be updated. See an example PR https://github.com/VeryGoodOpenSource/very_good_analysis/pull/134.

The exclusion table will be require an update whenever there are new lint rules (since those will be added with a the default exclusion reason "Not specified"),.

  • There is now a script named bin/inspect.dart that inspects if there are deprecated rules being used in a given version of Very Good Analysis.

In terms of next steps, I'm thinking we should:

  • Rename bin/inspect.dart to bin/analyze.dart to analyze the lint rules sanity and fail if there are deprecated rules being used in the latest version.
  • Update the bin/inspect.dart to have the --version argument be optional and default to the latest available Very Good Analysis
  • Create a new bin/update.dart script that will:
    • Create a new analysis option file
    • Update new analysis option file to be the latest
    • Update the exclusion reason table
    • Remove deprecated rules if any and update their reasons
  • Update the workflow to use the analyze script to also check if there are actionable changes in VGA and create an update PR using the changes from the update.dart script
  • Rename the workflow from bot_update_exclusions.yaml to bot_vga_updater.yaml

alestiago avatar Jan 02 '25 16:01 alestiago

@matiasleyba are we good closing this issue or is it pending functionality to do so?

marcossevilla avatar Sep 08 '25 12:09 marcossevilla

@matiasleyba are we good closing this issue or is it pending functionality to do so?

yes, we can close it

matiasleyba avatar Sep 08 '25 13:09 matiasleyba