-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #16 from craabreu/linter
Added linting workflow
- Loading branch information
Showing
16 changed files
with
891 additions
and
575 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
name: Linter | ||
|
||
on: | ||
push: | ||
branches: | ||
- "main" | ||
pull_request: | ||
branches: | ||
- "main" | ||
|
||
jobs: | ||
linter: | ||
name: Linter | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
os: [ubuntu-latest] | ||
python-version: ["3.10"] | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Additional info about the build | ||
shell: bash | ||
run: | | ||
uname -a | ||
df -h | ||
ulimit -a | ||
# More info on options: https://github.com/marketplace/actions/provision-with-micromamba | ||
- uses: mamba-org/provision-with-micromamba@main | ||
with: | ||
environment-file: devtools/conda-envs/lint_env.yaml | ||
environment-name: linter | ||
channels: conda-forge,defaults | ||
extra-specs: | | ||
python=${{ matrix.python-version }} | ||
- name: Install package | ||
# conda setup requires this special shell | ||
shell: bash -l {0} | ||
run: | | ||
python -m pip install . --no-deps | ||
micromamba list | ||
- name: Run flake8 | ||
shell: bash -l {0} | ||
run: flake8 --ignore=E203,W503 ufedmm/ | ||
|
||
- name: Run black | ||
shell: bash -l {0} | ||
run: black --line-length 100 --diff --color ufedmm/ | ||
|
||
- name: Run isort | ||
shell: bash -l {0} | ||
run: isort --check-only ufedmm/ | ||
|
||
# - name: Run pylint | ||
# shell: bash -l {0} | ||
# run: pylint --rcfile=devtools/linters/pylintrc ufedmm/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
name: linter | ||
channels: | ||
- conda-forge | ||
dependencies: | ||
# Base depends | ||
- python | ||
- pip | ||
- numpy | ||
- openmm | ||
- pandas | ||
- pyyaml | ||
- scipy | ||
|
||
# Linting | ||
- flake8 | ||
- black | ||
- isort | ||
# - pylint |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
[MAIN] | ||
|
||
ignored-modules=openmm.unit | ||
ignore=_version.py | ||
|
||
[DESIGN] | ||
|
||
max-locals=25 # Maximum number of local variables for function/method body | ||
|
||
[MESSAGES CONTROL] | ||
|
||
disable = unexpected-keyword-arg, # Avoids false-positives with Context.getState method | ||
too-many-arguments | ||
|
||
[FORMAT] | ||
|
||
good-names=i,j,k,m,n,_,v,x,y,z |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#!/usr/bin/env bash | ||
set -e -v | ||
isort ./ufedmm | ||
black --line-length 100 ./ufedmm | ||
flake8 --ignore=E203,W503 ./ufedmm | ||
# pylint --rcfile=devtools/linters/pylintrc ./ufedmm |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.