Merge branch 'feat/8-Q2.3'

feat: Add answer for Q2.3 and configure pre-commit with flake8

See merge request Klagarge/mse2425-grp09!12
This commit is contained in:
2025-04-14 12:51:04 +00:00
3 changed files with 12 additions and 0 deletions

2
.gitignore vendored
View File

@@ -7,3 +7,5 @@ __pycache__/
src/.pdm-python
src/htmlcov
src/.env
.env

7
.pre-commit-config.yaml Normal file
View File

@@ -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

View File

@@ -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.