-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add precommit and run on all files (#1541)
* Add precommit * Use pre-commit * Run precommit * Add EOL
- Loading branch information
1 parent
951cd74
commit 1c68964
Showing
94 changed files
with
365 additions
and
322 deletions.
There are no files selected for viewing
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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
[flake8] | ||
ignore = | ||
ignore = | ||
# E*** / W*** pycodestyle codes | ||
# whitespace before ',' | ||
E203, | ||
|
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
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
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
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
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
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 |
---|---|---|
|
@@ -6,7 +6,7 @@ on: | |
branches: | ||
- develop | ||
pull_request: | ||
workflow_dispatch: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
trivy: | ||
|
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 |
---|---|---|
|
@@ -87,11 +87,7 @@ jobs: | |
#---------------------------------------------- | ||
# check formatting | ||
#---------------------------------------------- | ||
- name: Code formatting with black | ||
run: | | ||
# ran only on certain files for now | ||
# add here when checked | ||
poetry run black schematic tests schematic_api --check | ||
- uses: pre-commit/[email protected] | ||
|
||
#---------------------------------------------- | ||
# type checking/enforcement | ||
|
@@ -121,7 +117,7 @@ jobs: | |
SYNAPSE_ACCESS_TOKEN: ${{ secrets.SYNAPSE_ACCESS_TOKEN }} | ||
SERVICE_ACCOUNT_CREDS: ${{ secrets.SERVICE_ACCOUNT_CREDS }} | ||
run: > | ||
poetry run pytest --durations=0 --cov-append --cov-report=term --cov-report=html:htmlcov | ||
poetry run pytest --durations=0 --cov-append --cov-report=term --cov-report=html:htmlcov | ||
--cov-report=xml:coverage.xml --cov=schematic/ --reruns 4 -n 8 tests/unit; | ||
#---------------------------------------------- | ||
|
@@ -151,7 +147,7 @@ jobs: | |
LOGGING_EXPORT_FORMAT: ${{ vars.LOGGING_EXPORT_FORMAT }} | ||
TRACING_SERVICE_NAME: ${{ vars.TRACING_SERVICE_NAME }} | ||
LOGGING_SERVICE_NAME: ${{ vars.LOGGING_SERVICE_NAME }} | ||
SERVICE_INSTANCE_ID: ${{ github.head_ref || github.ref_name }} | ||
SERVICE_INSTANCE_ID: ${{ github.head_ref || github.ref_name }} | ||
run: > | ||
poetry run pytest --durations=0 --cov-append --cov-report=term --cov-report=html:htmlcov --cov-report=xml:coverage.xml --cov=schematic/ | ||
-m "not (rule_benchmark or single_process_execution)" --reruns 4 -n 8 --ignore=tests/unit | ||
|
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 |
---|---|---|
|
@@ -180,4 +180,4 @@ manifests/* | |
https:* | ||
|
||
# schematic config file | ||
config.yml | ||
config.yml |
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 |
---|---|---|
@@ -1,21 +1,68 @@ | ||
repos: | ||
# Using this mirror lets us use mypyc-compiled black, which is about 2x faster | ||
# This is recommended by psf/black: https://github.com/psf/black/blob/main/.pre-commit-hooks.yaml | ||
- repo: https://github.com/psf/black-pre-commit-mirror | ||
rev: 23.7.0 | ||
hooks: | ||
- id: black | ||
# It is recommended to specify the latest version of Python | ||
# supported by your project here, or alternatively use | ||
# pre-commit's default_language_version, see | ||
# https://pre-commit.com/#top_level-default_language_version | ||
language_version: python3.10 | ||
files: ^(tests|schematic|schematic_api)/ | ||
|
||
- repo: https://github.com/pycqa/isort | ||
rev: 5.13.2 | ||
hooks: | ||
- id: isort | ||
name: isort (python) | ||
files: ^(tests|schematic|schematic_api)/ | ||
args: ["--profile", "black", "--filter-files"] | ||
exclude: "^docs/conf.py|^docs/build/" | ||
|
||
repos: | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v4.4.0 | ||
hooks: | ||
- id: trailing-whitespace | ||
- id: check-added-large-files | ||
- id: check-ast | ||
# - id: check-json | ||
- id: check-merge-conflict | ||
- id: check-xml | ||
- id: check-yaml | ||
exclude: ^mkdocs\.yml$ | ||
- id: debug-statements | ||
- id: end-of-file-fixer | ||
- id: requirements-txt-fixer | ||
- id: mixed-line-ending | ||
args: ["--fix=auto"] # replace 'auto' with 'lf' to enforce Linux/Mac line endings or 'crlf' for Windows | ||
|
||
# - repo: https://github.com/astral-sh/ruff-pre-commit | ||
# rev: "v0.0.270" | ||
# hooks: | ||
# - id: ruff | ||
|
||
# - repo: https://github.com/pycqa/isort | ||
# rev: 5.13.2 | ||
# hooks: | ||
# - id: isort | ||
# name: isort (python) | ||
|
||
- repo: https://github.com/psf/black | ||
rev: 23.12.1 | ||
hooks: | ||
- id: black | ||
language_version: python3 | ||
|
||
# - repo: https://github.com/PyCQA/bandit | ||
# rev: 1.7.5 | ||
# hooks: | ||
# - id: bandit | ||
# args: ["-c", "pyproject.toml"] | ||
# additional_dependencies: ["bandit[toml]"] | ||
# - repo: https://github.com/asottile/blacken-docs | ||
# rev: v1.12.0 | ||
# hooks: | ||
# - id: blacken-docs | ||
# additional_dependencies: [black] | ||
|
||
# - repo: https://github.com/pre-commit/mirrors-mypy | ||
# rev: 'v1.0.1' | ||
# hooks: | ||
# - id: mypy | ||
# additional_dependencies: [pydantic~=1.10] | ||
|
||
# Checks for missing docstrings | ||
# - repo: https://github.com/econchick/interrogate | ||
# rev: 1.5.0 | ||
# hooks: | ||
# - id: interrogate | ||
# exclude: ^(docs/conf.py|setup.py|tests) | ||
# args: [--config=pyproject.toml] | ||
|
||
# finds dead python code | ||
# - repo: https://github.com/jendrikseipp/vulture | ||
# rev: 'v2.7' | ||
# hooks: | ||
# - id: vulture |
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 |
---|---|---|
@@ -1,2 +1,2 @@ | ||
[MAIN] | ||
load-plugins=pylint.extensions.docparams | ||
load-plugins=pylint.extensions.docparams |
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
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
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
Oops, something went wrong.