diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3318b28..6b911ca 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -20,7 +20,7 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - pip install flake8 + pip install -r requirements/ci.txt - name: Lint run: | # Stop the build if there are Python syntax errors or undefined names diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..6437d71 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,10 @@ +repos: +- repo: https://github.com/PyCQA/flake8 + rev: 7.3.0 + hooks: + - id: flake8 + name: flake8-syntax + args: [--count, '--select=E9,F63,F7,F82', --show-source, --statistics, --builtins="_"] + - id: flake8 + name: flake8-style + args: [--count, --max-complexity=10, --max-line-length=88, --statistics] diff --git a/Makefile b/Makefile index bef5d7f..2567e34 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ .PHONY: generate-deps generate-deps: - flatpak_pip_generator --build-isolation --requirements-file=requirements.txt -o python-dependencies --runtime=org.gnome.Sdk/x86_64/master \ No newline at end of file + flatpak_pip_generator --build-isolation --requirements-file=requirements/base.txt -o python-dependencies --runtime=org.gnome.Sdk/x86_64/master \ No newline at end of file diff --git a/requirements.txt b/requirements/base.txt similarity index 100% rename from requirements.txt rename to requirements/base.txt diff --git a/requirements/ci.txt b/requirements/ci.txt new file mode 100644 index 0000000..3930480 --- /dev/null +++ b/requirements/ci.txt @@ -0,0 +1 @@ +flake8 diff --git a/requirements/local.txt b/requirements/local.txt new file mode 100644 index 0000000..2692044 --- /dev/null +++ b/requirements/local.txt @@ -0,0 +1,3 @@ +-r base.txt +pre_commit +flake8