Skip to content

linter "did you mean..." #813

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

Open
CJ-Wright opened this issue Jun 21, 2018 · 2 comments
Open

linter "did you mean..." #813

CJ-Wright opened this issue Jun 21, 2018 · 2 comments

Comments

@CJ-Wright
Copy link
Member

For some of the lints it would be helpful if the linter suggested the valid name.
Eg. for unexpected subsection name we could use a spell check algorithm to find the most likely spelling candidate (eg patch -> patches).

@CJ-Wright
Copy link
Member Author

xref: conda-forge/cxxopts-feedstock#6

@CJ-Wright
Copy link
Member Author

Basic idea
If https://github.com/conda-forge/conda-smithy/blob/master/conda_smithy/lint_recipe.py#L264 calculate the distance between the bad subsection and the expected subsections maybe using https://github.com/conda-forge/python-levenshtein-feedstock and if it is less than a threshold add a bit to the error asking if they meant one of the expected subsections.

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

No branches or pull requests

1 participant