Skip to content

Conversation

ssbarnea
Copy link
Member

@ssbarnea ssbarnea commented Jun 26, 2025

This change will require custom rule users to update their rules to use the new API.

Renames made:

  • matchyaml -> match_file
  • matchtask -> match_task
  • matchtasks -> match_tasks
  • matcherror -> match_error
  • matchvar -> match_var
  • matchdir -> match_dir
  • create_matcherror -> create_match_error

This change also improves how we run cspell in order to automatically sort the dictionary and to remove unused entries.

That idea came while reviewing #4662 with @shatakshiiii and realizing that the incorrect historical naming made the development of the new rule harder.

@ssbarnea ssbarnea requested a review from a team as a code owner June 26, 2025 17:20
@ssbarnea ssbarnea added the major label Jun 26, 2025
@ssbarnea ssbarnea changed the title Renamed rule class methods (naming convention) breaking: Renamed rule class methods (naming convention) Jun 26, 2025
Copy link
Contributor

@cidrblock cidrblock left a comment

Choose a reason for hiding this comment

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

Can we leave a fall back to the old call is place with warning that the API is changing? I'm not sure how many people have custom rules, but we can't just break it in a single release.

@ssbarnea
Copy link
Member Author

Can we leave a fall back to the old call is place with warning that the API is changing? I'm not sure how many people have custom rules, but we can't just break it in a single release.

Based on https://sourcegraph.com/search?q=context%3Aglobal+lang%3Apython+AnsibleLintRule+-repo%3Aansible%2Fansible-lint&patternType=keyword&sm=0&expanded= I think we can (obviously with an update to the correct versioning, not as a patch level version change.)

Renames
- matchyaml -> match_file
- matchtask -> match_task
- matchtasks -> match_tasks
- matcherror -> match_error
- matchvar -> match_var
- matchdir -> match_dir
- create_matcherror -> create_match_error
@cidrblock
Copy link
Contributor

Can we leave a fall back to the old call is place with warning that the API is changing? I'm not sure how many people have custom rules, but we can't just break it in a single release.

Based on https://sourcegraph.com/search?q=context%3Aglobal+lang%3Apython+AnsibleLintRule+-repo%3Aansible%2Fansible-lint&patternType=keyword&sm=0&expanded= I think we can (obviously with an update to the correct versioning, not as a patch level version change.)

I love sourcegraph. Unfortunately, it wouldn't be able to see any rules internal to an enterprise.

@ssbarnea ssbarnea marked this pull request as draft July 10, 2025 14:19
@ssbarnea ssbarnea removed the major label Sep 4, 2025
Copy link

github-actions bot commented Sep 4, 2025

Label error. Requires exactly 1 of: breaking, build, chore, ci, docs, feat, fix, perf, refactor, style, test. Found: . Follow https://www.conventionalcommits.org to get auto-labeling to work correctly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: In Progress
Development

Successfully merging this pull request may close these issues.

2 participants