Skip to content

Commit

Permalink
gitignore and pre-commit added
Browse files Browse the repository at this point in the history
  • Loading branch information
venkatajagannath committed May 29, 2024
1 parent 2269646 commit 8286ad7
Show file tree
Hide file tree
Showing 3 changed files with 106 additions and 0 deletions.
9 changes: 9 additions & 0 deletions .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,15 @@ jobs:
run: |
python -m pip install --upgrade pip
pip install build
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Test with pytest
run: |
pytest
- name: Build package
run: python -m build
- name: Publish package
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.DS_Store
96 changes: 96 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
repos:
- repo: local
hooks:
- id: check-env-file
name: Check if .env file is empty
entry: bash -c 'FILE=dev/.env; if [ -s "$FILE" ]; then echo "$FILE is not empty. Please remove its content."; exit 1; fi'
language: system
types: [file]
pass_filenames: false
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
hooks:
- id: check-added-large-files
- id: check-merge-conflict
- id: check-toml
- id: check-yaml
args:
- --unsafe
- id: debug-statements
- id: end-of-file-fixer
- id: mixed-line-ending
- id: pretty-format-json
args: ["--autofix"]
- id: trailing-whitespace
- repo: https://github.com/codespell-project/codespell
rev: v2.3.0
hooks:
- id: codespell
name: Run codespell to check for common misspellings in files
language: python
types: [text]
args:
- --exclude-file=tests/sample/manifest_model_version.json
- --skip=**/manifest.json,**.min.js
- -L connexion,aci
- repo: https://github.com/pre-commit/pygrep-hooks
rev: v1.10.0
hooks:
- id: rst-backticks
- id: python-check-mock-methods
- repo: https://github.com/Lucas-C/pre-commit-hooks
rev: v1.5.5
hooks:
- id: remove-crlf
- id: remove-tabs
exclude: ^docs/make.bat$|^docs/Makefile$|^dev/dags/dbt/jaffle_shop/seeds/raw_orders.csv$
- repo: https://github.com/asottile/pyupgrade
rev: v3.15.2
hooks:
- id: pyupgrade
args:
- --py37-plus
- --keep-runtime-typing
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.4.5
hooks:
- id: ruff
args:
- --fix
- repo: https://github.com/psf/black
rev: 24.4.2
hooks:
- id: black
args: ["--config", "./pyproject.toml"]
- repo: https://github.com/asottile/blacken-docs
rev: 1.16.0
hooks:
- id: blacken-docs
alias: black
additional_dependencies: [black>=22.10.0]
- repo: https://github.com/pre-commit/mirrors-mypy
rev: "v1.10.0"

hooks:
- id: mypy
name: mypy-python
args: [--config-file, "./pyproject.toml"]
additional_dependencies:
[
types-PyYAML,
types-attrs,
attrs,
types-requests,
types-python-dateutil,
apache-airflow,
]
files: ^anyscale_provider

ci:
autofix_commit_msg: 🎨 [pre-commit.ci] Auto format from pre-commit.com hooks
autoupdate_commit_msg: ⬆ [pre-commit.ci] pre-commit autoupdate
skip:
- mypy # build of https://github.com/pre-commit/mirrors-mypy:types-PyYAML,types-attrs,attrs,types-requests,
#types-python-dateutil,[email protected] for python@python3 exceeds tier max size 250MiB: 262.6MiB

0 comments on commit 8286ad7

Please sign in to comment.