-
-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #71 from nox1134/issue-68
Use pre-commit CI to automatically fix code style issues
- Loading branch information
Showing
4 changed files
with
117 additions
and
38 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
name: Static Analysis | ||
|
||
on: | ||
pull_request: | ||
push: | ||
branches: [main] | ||
workflow_dispatch: | ||
|
||
jobs: | ||
job: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
|
||
# https://github.com/actions/setup-python | ||
- name: Install Python 3.11 | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: '3.11' | ||
|
||
- name: Install Python dependencies | ||
run: | | ||
pip install --upgrade pip | ||
pip install black 'black[jupyter]' flake8 isort | ||
pip install pre-commit | ||
# https://github.com/actions/checkout | ||
- name: Checkout quantifying | ||
uses: actions/checkout@v4 | ||
with: | ||
path: quantifying | ||
|
||
- name: pre-commit | ||
run: pre-commit run --show-diff-on-failure --color=always --all-files | ||
working-directory: ./quantifying |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
# See https://pre-commit.com for more information | ||
# See https://pre-commit.com/hooks.html for more hooks | ||
default_language_version: | ||
python: python3.11 | ||
|
||
ci: | ||
autofix_commit_msg: | | ||
[pre-commit.ci] auto fixes from pre-commit.com hooks | ||
for more information, see https://pre-commit.ci | ||
autofix_prs: true | ||
autoupdate_branch: '' | ||
autoupdate_commit_msg: '[pre-commit.ci] pre-commit autoupdate' | ||
autoupdate_schedule: weekly | ||
skip: [] | ||
submodules: false | ||
|
||
repos: | ||
|
||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v4.1.0 | ||
hooks: | ||
- id: check-added-large-files | ||
- id: check-ast | ||
- id: check-case-conflict | ||
- id: check-docstring-first | ||
- id: check-executables-have-shebangs | ||
- id: check-json | ||
- id: check-merge-conflict | ||
- id: check-toml | ||
- id: check-yaml | ||
- id: destroyed-symlinks | ||
#- id: end-of-file-fixer | ||
#- id: mixed-line-ending | ||
# args: | ||
# - --fix=no | ||
#- id: trailing-whitespace | ||
|
||
- repo: local | ||
hooks: | ||
- id: black | ||
name: "Black" | ||
entry: black | ||
language: system | ||
types: ["file", "python", "text"] | ||
|
||
- id: flake8 | ||
name: "Flake8" | ||
entry: flake8 | ||
language: system | ||
types: ["file", "python", "text"] | ||
|
||
- id: isort | ||
name: "isort" | ||
entry: isort --filter-files | ||
language: system | ||
types: ["file", "python", "text"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters