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

feat: Add rule typo suggestion feature #334

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

mrswastik-robot
Copy link

This PR enhances the unknown rule detection by suggesting the closest matching rule name when a typo is encountered in lint directives.

Fixes: #188

  • Adds a find_nearest_rule function using Levenshtein distance from the strsim crate
  • Modifies the unknown_rule diagnostic to suggest corrections (e.g., "SnackCase" → "SnakeCase")

Before submitting this PR, please make sure:

  • You have added a few sentences describing the PR here.
  • You have added yourself or the appropriate individual as the assignee.
  • You have added at least one relevant code reviewer to the PR.
  • Your code builds clean without any errors or warnings.
  • You have added tests (when appropriate).
  • You have updated the README or other documentation to account for these
    changes (when appropriate).
  • You have added an entry to the relevant CHANGELOG.md (see
    "keep a changelog" for more information).
  • Your commit messages follow the conventional commit style.

@@ -1,3 +1,11 @@
note[ShellCheck]: running `shellcheck` on command section
┌─ tests/lints/runtime-keys-wdl-1.1/source.wdl:8:5
Copy link
Member

Choose a reason for hiding this comment

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

This is because you ran the tests without shellcheck installed—you'll need to do that and rerun this test.

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.

Add a "did you mean <>?" fix to UnknownRule
2 participants