diff --git a/.ci-pre-commit-config.yaml b/.ci-pre-commit-config.yaml new file mode 100644 index 0000000..7eb4e3f --- /dev/null +++ b/.ci-pre-commit-config.yaml @@ -0,0 +1,20 @@ +repos: + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v2.3.0 + hooks: + - id: check-yaml + - id: end-of-file-fixer + - id: trailing-whitespace + exclude: "^comet/core/migrations/.*" + + - repo: https://github.com/astral-sh/ruff-pre-commit + rev: v0.0.291 + hooks: + - id: ruff + exclude: "^comet/core/migrations/.*" + + - repo: https://github.com/pycqa/isort + rev: 5.12.0 + hooks: + - id: isort + exclude: "^comet/core/migrations/.*" diff --git a/.flake8 b/.flake8 new file mode 100644 index 0000000..bbeec9d --- /dev/null +++ b/.flake8 @@ -0,0 +1,5 @@ +[flake8] +max-line-length = 88 +extend-ignore = E203, E266, E501, W503 +max-complexity = 18 +select = B,C,E,F,W,T4,B9 diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml new file mode 100644 index 0000000..e4f4860 --- /dev/null +++ b/.github/workflows/pre-commit.yml @@ -0,0 +1,16 @@ +name: pre-commit + +on: + pull_request: + push: + branches: [main] + +jobs: + pre-commit: + runs-on: blacksmith-4vcpu-ubuntu-2204 + steps: + - uses: actions/checkout@v3 + - uses: useblacksmith/setup-python@v6 + - uses: pre-commit/action@v3.0.0 + with: + extra_args: --all-files --config .ci-pre-commit-config.yaml diff --git a/.gitignore b/.gitignore index fab6dd1..e1cbebc 100644 --- a/.gitignore +++ b/.gitignore @@ -5,4 +5,5 @@ __pycache__/ env/ .env/ venv/ -.DS_STORE \ No newline at end of file +.DS_STORE +.pre-commit-config.yaml