Support multiple linting rules
Description of changes:
- Updated interactive and auto-fix mode to support multiple linting rules. The main technical complexity with supporting multiple rules is that as we apply fixes to the script, older linter findings become stale and would need to be 'refreshed'. We avoid this problem by linting the script one-rule-at-a-time.
- Updated
Base64BinaryFormatRuleso that it does not requirefile://prefix in an argument value to trigger a detection. It now flags all AWS CLI commands. - Added
PaginationRulethat flags all AWS CLI commands, and adds--no-cli-paginateas a fix. - Replaced
ScriptLinterclass with utility functions. Updated their interface to let callers pass in their own AST. - Added save and exit mode.
- Added tests for save-and-exit mode and the new
PaginationRule. - Misc. refactoring for maintainability/readability.
Description of tests:
- Ran and passed all tests.
- Manually tested the tool in interactive and auto-fix mode on the example script, and verified correct behavior.
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.
Codecov Report
:white_check_mark: All modified and coverable lines are covered by tests.
:white_check_mark: Project coverage is 93.33%. Comparing base (7854fa9) to head (d90bfde).
:warning: Report is 1 commits behind head on upgrade-linting-tool.
Additional details and impacted files
@@ Coverage Diff @@
## upgrade-linting-tool #9859 +/- ##
=====================================================
Coverage 93.33% 93.33%
=====================================================
Files 209 209
Lines 16807 16807
=====================================================
Hits 15687 15687
Misses 1120 1120
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
:rocket: New features to boost your workflow:
- :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
Just a note, the pagination linting rule should actually be based around the --no-cli-pager argument instead of the --no-paginate argument. This will be addressed in a follow-up PR, I already have the fix staged locally with the next round of changes.