diff --git a/.gitignore b/.gitignore index e00e44f..62f742b 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,5 @@ __pycache__/ src/.pdm-python src/htmlcov src/.env + +.env diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..8164ee6 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,7 @@ +repos: + - repo: https://github.com/pycqa/flake8 + rev: '6.1.0' # Use the latest stable version + hooks: + - id: flake8 + additional_dependencies: [] + args: [--config=tox.ini] # Use the same config as in CI \ No newline at end of file diff --git a/docs/questions-part2.md b/docs/questions-part2.md index 4f5dbb6..b56d3b3 100644 --- a/docs/questions-part2.md +++ b/docs/questions-part2.md @@ -9,3 +9,6 @@ # Answers - Part 2 ## Q2.1 Solution is to add a `rule` section to add condition to trigger the pipeline. It's what is implemented for the `docker-build` job. Another option is to use an `only` section to trigger the pipeline only if the change is made in a specific branch. It's what is implemented for the `pages` job. + +## Q2.3 +We can use a pre-commit that runs the linter before committing. This ensures that the code is linted before it is committed, which can help catch errors and improve code quality. However, this approach can be time-consuming and may require additional setup.