🎉Thank you so much for taking the time to contribute🎉
Before trying to help please tell us what's wrong. Please check if there is an open issue with your problem. If there isn't one, create one
If you want to contribute code you will need to:
This project uses Poetry for package managment
Clone the repository and run inside it:
curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python # Install poetry on your machine
poetry install # Create a new enviroment and install the development requirements
poetry shell # Activate
run pre-commit install # Install pre-commit hooks
New smells are implented in a new file in good_smell/smells
, by creating a class that inherits good_smell/lint_smell.py
.
After implementing the methods add the class to the list implemented_smells
in good_smell/smells/__init__.py
If you're new to parsing and transforming ASTs, green tree snakes is a great guide to the basics.
Inside the relevant file in the tests/examples
dir (Or a new), the tests are formatted like this
#:<Test description>
#<Comma-seperated list of warning symbols emmited> or "None"
<Python code emitting the smells>
# ==>
<Python code after fixing the smell>
# END
See the example file for an example
Activate your virtual enviroment and run
pytest
To run a specific test run
pytest -k <Test description>