Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add pre-commit config and isort to ci style check #18

Merged
merged 5 commits into from
Mar 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/requirements/style.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
black==23.12.0
flake8==6.1.0
isort[colors]==5.13.2
7 changes: 4 additions & 3 deletions .github/workflows/style.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ jobs:
run: |
pip install -r .github/workflows/requirements/style.txt

- name: Lint and Format Check with Flake8 and Black
- name: Lint and style checks with black, isort, and flake8
run: |
black --diff --check .
flake8 gantry/
black --diff --check gantry
isort --diff --check gantry
flake8 gantry
16 changes: 16 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
repos:
- repo: https://github.com/psf/black
rev: 23.12.0
hooks:
- id: black

- repo: https://github.com/pycqa/flake8
rev: 6.1.0
hooks:
- id: flake8

- repo: https://github.com/pycqa/isort
rev: 5.13.2
hooks:
- id: isort
name: isort (python)
11 changes: 11 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
[project]
name = "gantry"
version = "0.0.1"
description = "A Dynamic Resource Allocation System for Spack CI and Kubernetes"
license = "Apache-2.0 OR MIT"
requires-python = ">= 3.11"
authors = [
{name = "Caetano Melone", email = "[email protected]"},
{name = "Alec Scott", email = "[email protected]"},
]

[tool.isort]
profile = "black"
skip_gitignore = true
Expand Down
2 changes: 1 addition & 1 deletion spack.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ spack:
- py-coverage
- py-flake8
- py-black
- py-isort
- "py-isort[email protected]:"
- py-aiosqlite
- sqlite
view: true
Expand Down
Loading