Skip to content

Commit 4920648

Browse files
authored
add pre-commit for easy linting/formatting! (#606)
* add pre-commit for easy linting/formatting! Signed-off-by: vsoch <[email protected]>
1 parent edecf40 commit 4920648

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+278
-213
lines changed

.all-contributorsrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,4 +133,4 @@
133133
}
134134
],
135135
"contributorsPerLine": 7
136-
}
136+
}

.circleci/config.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ install_podman: &install_podman
6565
wget -nv https://download.opensuse.org/repositories/devel:kubic:libcontainers:stable/xUbuntu_${VERSION_ID}/Release.key -O- | sudo apt-key add -
6666
sudo apt-get update -qq
6767
sudo apt-get -qq -y install podman
68-
68+
6969
install_dependencies: &install_dependencies
7070
name: install dependencies
7171
command: |-
@@ -87,7 +87,7 @@ install_dependencies: &install_dependencies
8787
8888
test_shpc: &test_shpc
8989
name: Test Singularity Registry HPC
90-
command: |-
90+
command: |-
9191
export PATH=~/conda/Python3/bin:$PATH
9292
python --version
9393
cd ~/repo

.github/CONTRIBUTING.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ This code is licensed under the MPL 2.0 [LICENSE](LICENSE).
44

55
# Contributing
66

7-
When contributing to Singularity Registry Global Client, it is
8-
important to properly communicate the gist of the contribution.
9-
If it is a simple code or editorial fix, simply explaining this
10-
within the GitHub Pull Request (PR) will suffice. But if this is a larger
7+
When contributing to Singularity Registry Global Client, it is
8+
important to properly communicate the gist of the contribution.
9+
If it is a simple code or editorial fix, simply explaining this
10+
within the GitHub Pull Request (PR) will suffice. But if this is a larger
1111
fix or Enhancement, it should be first discussed with the project
1212
leader or developers.
1313

@@ -29,8 +29,8 @@ all your interactions with the project members and users.
2929
4. The project's default copyright and header have been included in any new
3030
source files.
3131
5. All (major) changes to Singularity Registry must be documented in
32-
[docs](docs). If your PR changes a core functionality, please
33-
include clear description of the changes in your PR so that the docs
32+
[docs](docs). If your PR changes a core functionality, please
33+
include clear description of the changes in your PR so that the docs
3434
can be updated, or better, submit another PR to update the docs directly.
3535
6. If necessary, update the README.md.
3636
7. The pull request will be reviewed by others, and the final merge must be
@@ -102,7 +102,7 @@ an incident. Further details of specific enforcement policies may be posted
102102
separately.
103103

104104
Project maintainers, contributors and users who do not follow or enforce the
105-
Code of Conduct in good faith may face temporary or permanent repercussions
105+
Code of Conduct in good faith may face temporary or permanent repercussions
106106
with their involvement in the project as determined by the project's leader(s).
107107

108108
## Attribution

.github/ISSUE_TEMPLATE/documentation-or-tutorial-request.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,3 @@ name: Documentation or Tutorial Request
33
about: What can we explain better, or what issue did you find?
44

55
---
6-
7-

.github/ISSUE_TEMPLATE/question.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,3 @@ name: Question
33
about: What's on your mind?
44

55
---
6-
7-

.github/dev-requirements.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
pre-commit
2+
black
3+
isort
4+
flake8

.github/test-centos.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ jobs:
3434
touch changes.txt
3535
for container_yaml in $(git diff --name-only HEAD~$commits..HEAD .); do
3636
echo $container_yaml >> changes.txt
37-
done
37+
done
3838
cat changes.txt
3939
4040
- name: Update .bashrc

.github/workflows/main.yml

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,12 @@ on:
66
branches-ignore:
77
- main
88
- gh-pages
9-
- binoc/*
10-
- binoc/**
119

1210
jobs:
1311
formatting:
1412
runs-on: ubuntu-latest
1513
steps:
16-
- uses: actions/checkout@v1
14+
- uses: actions/checkout@v3
1715

1816
- name: Setup black linter
1917
run: conda create --quiet --name black pyflakes
@@ -23,15 +21,9 @@ jobs:
2321
with:
2422
files: ./docs/getting_started/ ./docs/index.rst
2523

26-
- name: Lint python code
24+
- name: Lint and format Python code
2725
run: |
2826
export PATH="/usr/share/miniconda/bin:$PATH"
2927
source activate black
30-
pip install black
31-
black --check shpc
32-
33-
- name: Check imports with pyflakes
34-
run: |
35-
export PATH="/usr/share/miniconda/bin:$PATH"
36-
source activate black
37-
find shpc/ -name '*.py' \! -name __init__.py \! -name shell.py -exec pyflakes \{\} \+
28+
pip install -r .github/dev-requirements.txt
29+
pre-commit run --all-files

.github/workflows/release.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
pip install setuptools wheel twine
2323
- name: Build and publish
2424
env:
25-
TWINE_USERNAME: ${{ secrets.PYPI_USER }}
25+
TWINE_USERNAME: ${{ secrets.PYPI_USER }}
2626
TWINE_PASSWORD: ${{ secrets.PYPI_PASS }}
2727
run: |
2828
export PATH="/usr/share/miniconda/bin:$PATH"

.github/workflows/test-container.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
uses: jitterbit/get-changed-files@b17fbb00bdc0c0f63fcf166580804b4d2cdc2a42
1717
with:
1818
format: 'json'
19-
19+
2020
test-recipes:
2121
needs:
2222
- changes
@@ -34,10 +34,10 @@ jobs:
3434
# Continue if we have a changed recipe file
3535
if [[ "${{ matrix.changed_recipe }}" = registry* ]]; then
3636
recipe_basename=$(basename "${{ matrix.changed_recipe }}")
37-
if [[ "${recipe_basename}" == "container.yaml" ]]; then
37+
if [[ "${recipe_basename}" == "container.yaml" ]]; then
3838
echo "keepgoing=true" >> $GITHUB_ENV
3939
fi
40-
fi
40+
fi
4141
4242
- name: Checkout
4343
if: ${{ env.keepgoing == 'true' }}

0 commit comments

Comments
 (0)