From 57763970f963f7acad536b2f536d786ad459b53e Mon Sep 17 00:00:00 2001 From: GotthardG <51994228+GotthardG@users.noreply.github.com> Date: Mon, 16 Dec 2024 10:33:12 +0100 Subject: [PATCH] refining ci pipeline --- .gitlab-ci.yml | 4 ++-- .pre-commit-config.yaml | 12 ++++++++++++ 2 files changed, 14 insertions(+), 2 deletions(-) create mode 100644 .pre-commit-config.yaml diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 5b46208..2d8fbca 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -30,8 +30,8 @@ lint: stage: test script: - source $VIRTUAL_ENV/bin/activate - - pip install flake8 - - flake8 backend/ # Run linting for code quality + - pip install pre-commit # Install pre-commit in the CI environment + - pre-commit run --all-files # Run all pre-commit hooks on the entire codebase deploy: stage: deploy diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..db6b68c --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,12 @@ +repos: + - repo: https://github.com/psf/black + rev: 23.7.0 # Use the latest stable version + hooks: + - id: black + args: [--check, --diff] + + - repo: https://github.com/pycqa/flake8 + rev: 6.1.0 # Use the latest stable version + hooks: + - id: flake8 + args: [] \ No newline at end of file