From 3932142aa49bda5bbc783994e14deb97bcc68a4c Mon Sep 17 00:00:00 2001 From: Rick Chen Date: Thu, 15 Aug 2024 21:03:36 -0700 Subject: [PATCH 1/2] new checks --- .ci-pre-commit-config.yaml | 35 ++++++++++++++++++++++++++++++++ .flake8 | 5 +++++ .github/workflows/pre-commit.yml | 16 +++++++++++++++ .gitignore | 3 ++- 4 files changed, 58 insertions(+), 1 deletion(-) create mode 100644 .ci-pre-commit-config.yaml create mode 100644 .flake8 create mode 100644 .github/workflows/pre-commit.yml diff --git a/.ci-pre-commit-config.yaml b/.ci-pre-commit-config.yaml new file mode 100644 index 0000000..7f54216 --- /dev/null +++ b/.ci-pre-commit-config.yaml @@ -0,0 +1,35 @@ +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/.*' + +- repo: https://github.com/djlint/djLint + rev: v1.34.1 + hooks: + - id: djlint-reformat-jinja + files: theme + +- repo: local + hooks: + - id: prettier + name: prettier + language: node + entry: prettier --write + additional_dependencies: ["prettier"] + files: '.*.js$' 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 From 46ebf58bd09fa68d10ac9575811064f7e7290b70 Mon Sep 17 00:00:00 2001 From: Rick Chen Date: Thu, 15 Aug 2024 21:07:28 -0700 Subject: [PATCH 2/2] remove js --- .ci-pre-commit-config.yaml | 49 +++++++++++++------------------------- 1 file changed, 17 insertions(+), 32 deletions(-) diff --git a/.ci-pre-commit-config.yaml b/.ci-pre-commit-config.yaml index 7f54216..7eb4e3f 100644 --- a/.ci-pre-commit-config.yaml +++ b/.ci-pre-commit-config.yaml @@ -1,35 +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/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/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/.*' - -- repo: https://github.com/djlint/djLint - rev: v1.34.1 - hooks: - - id: djlint-reformat-jinja - files: theme - -- repo: local - hooks: - - id: prettier - name: prettier - language: node - entry: prettier --write - additional_dependencies: ["prettier"] - files: '.*.js$' + - repo: https://github.com/pycqa/isort + rev: 5.12.0 + hooks: + - id: isort + exclude: "^comet/core/migrations/.*"