Skip to content

Commit

Permalink
Setup pre-commit with useful plugins
Browse files Browse the repository at this point in the history
  • Loading branch information
jcpunk committed Mar 26, 2024
1 parent 8e52306 commit 47bdd83
Show file tree
Hide file tree
Showing 4 changed files with 55 additions and 0 deletions.
1 change: 1 addition & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
8e52306f85582ea626aa3e745547542d35ddae53
14 changes: 14 additions & 0 deletions .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: pre-commit

on:
pull_request:
push:
branches: [main]

jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v3
- uses: pre-commit/[email protected]
25 changes: 25 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
repos:
- repo: "https://github.com/pre-commit/pre-commit-hooks"
rev: v4.1.0
hooks:
- id: check-ast
- id: check-docstring-first
- id: check-merge-conflict
- id: end-of-file-fixer
- id: mixed-line-ending
- id: trailing-whitespace
- id: check-toml
- repo: "https://github.com/pycqa/isort"
rev: 5.11.5
hooks:
- id: isort
- repo: "https://github.com/psf/black"
rev: 22.3.0
hooks:
- id: black
- repo: "https://github.com/asottile/pyupgrade"
rev: v3.15.1
hooks:
- id: pyupgrade
args:
- "--py39-plus"
15 changes: 15 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@

[tool.black]
line-length = 120
target-version = ['py39']

[tool.isort]
src_paths = ["osgpkitools", "tests"]
py_version = 39
profile = "black"
line_length = 120
combine_star = "True"
order_by_type = "True"
dedup_headings = "True"
lines_between_types = 1
force_alphabetical_sort_within_sections = "True"

0 comments on commit 47bdd83

Please sign in to comment.