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: move to poetry + pre commit linting #117

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

Conversation

danisc23
Copy link

Description

This PR moves from pip requirements to poetry, this way we can ensure that everyone uses same python version and dependecies.

Also adds pre-commit for formatting and linting and be more compliant with code style

Details

  • Added pyproject.toml for poetry and remove requirements.txt
  • Added .pre-commit-config.yaml as this repository format and linting suite
  • Added a github action to check if a PR is compliant with pre-commit
  • Updated README.md
  • pre-commit fixed automatically most of the python and json files to be compliant with the codestyle

About pre-commit checks

General checks

  • Avoid users to commit changes in master (even locally)
  • Checks that JSON files are valid
  • Prettify JSON files (if needed)
  • Normalizes end of files and end of lines to avoid trailing whitespaces
  • Ensures that the PR doesn't include any line introduced for local debugging

Python Checks

  • Code is formatted automatically with black (codestyle), autoflake (remove unused imports and variables) and isort (import sorting)
  • Flake8 as general linter
  • Mypy for typing checks

* feat: add pre-commit and move to poetry

* fix: toggle github action in master

* remove vscode workspace
@danisc23
Copy link
Author

@mx0c I can't add you as a reviewer, but let me know if you have any question about this PR.

I only added one github action to check linting, but I think it's a good idea to open at least 2 more to ensure that a PR acomplish the following:

  • Run unit tests (need tests first 😄 ) -> With this we can check that every function still doing what we expect from them even if something is changed, also works very good as documentation 😃
  • A check that runs main.py without crashing -> The game is still working as expected in the PR
  • Linting (added in this PR) -> changed code is compliant with the repository codestyle

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.

None yet

1 participant