conda-forge / conda-smithy

The tool for managing conda-forge feedstocks.
https://conda-forge.org/
BSD 3-Clause "New" or "Revised" License
151 stars 177 forks source link

linter "did you mean..." #813

Open CJ-Wright opened 6 years ago

CJ-Wright commented 6 years ago

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 commented 6 years ago

xref: https://github.com/conda-forge/cxxopts-feedstock/pull/6

CJ-Wright commented 6 years ago

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.