forked from materialsproject/pymatgen
-
Notifications
You must be signed in to change notification settings - Fork 0
47 lines (44 loc) · 1.54 KB
/
pmg-lint.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
name: Pymatgen linting
on: [push, pull_request]
jobs:
build:
runs-on: ubuntu-latest
strategy:
max-parallel: 4
matrix:
python-version: [3.7]
steps:
- uses: actions/checkout@v1
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
- name: Lint with pycodestyle
run: |
pip install pycodestyle --upgrade
pycodestyle pymatgen
- name: Lint with mypy
run: |
pip install mypy --upgrade
mypy pymatgen
- name: Lint with flake8
run: |
pip install flake8 --upgrade
# stop the build if there are Python syntax errors or undefined names
flake8 --count --show-source --statistics pymatgen
# exit-zero treats all errors as warnings.
flake8 --count --exit-zero --max-complexity=20 --statistics pymatgen
- name: Lint with pylint
run: |
pip install --upgrade "pylint!=2.5"
export MODIFIED_FILES=`git diff --diff-filter=ACMRTUXB --name-only HEAD v2019.9.16 | grep -E 'pymatgen.*\.(py)$' | sed '/test_/d' | tr '\n' ' '`
echo "Linting $MODIFIED_FILES"
# stop the build if there are Python syntax errors or undefined names
pylint --exit-zero pymatgen/core/periodic_table.py $MODIFIED_FILES
- name: Lint with pydoctstyle
run: |
pip install pydocstyle --upgrade
pydocstyle --count pymatgen