forked from MDAnalysis/mdanalysis
-
Notifications
You must be signed in to change notification settings - Fork 0
151 lines (126 loc) · 3.52 KB
/
linters.yaml
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
name: "linters"
on:
pull_request:
branches:
- develop
concurrency:
# Probably overly cautious group naming.
# Commits to develop/master will cancel each other, but PRs will only cancel
# commits within the same PR
group: "${{ github.ref }}-${{ github.head_ref }}-${{ github.workflow }}"
cancel-in-progress: true
defaults:
run:
shell: bash -l {0}
jobs:
darker_lint:
if: "github.repository == 'MDAnalysis/mdanalysis'"
runs-on: ubuntu-latest
permissions:
pull-requests: write
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-python@v4
with:
python-version: 3.9
- name: darker-main-code
id: darker-main-code
uses: akaihola/[email protected]
continue-on-error: true
with:
version: "~=1.6.1"
options: "--check --diff --color"
src: "./package/MDAnalysis"
revision: "HEAD^"
lint: "flake8"
- name: darker-test-code
id: darker-test-code
uses: akaihola/[email protected]
continue-on-error: true
with:
version: "~=1.6.1"
options: "--check --diff --color"
src: "./testsuite/MDAnalysisTests"
revision: "HEAD^"
lint: "flake8"
- name: get-pr-info
uses: actions/github-script@v6
with:
script:
const prNumber = context.payload.number;
core.exportVariable('PULL_NUMBER', prNumber);
- name: save-status
env:
MAIN: ${{ steps.darker-main-code.outcome }}
TEST: ${{ steps.darker-test-code.outcome }}
shell: python
run: |
import os
import json
from pathlib import Path
Path('./darker_results/').mkdir(exist_ok=True)
d = {
'main_stat': os.environ['MAIN'],
'test_stat': os.environ['TEST'],
'PR_NUM': os.environ['PULL_NUMBER'],
'RUN_ID': os.environ['GITHUB_RUN_ID'],
}
with open('darker_results/status.json', 'w') as f:
json.dump(d, f)
- name: check-json
run: cat darker_results/status.json
- name: upload-status
uses: actions/upload-artifact@v3
with:
name: darkerlint
path: darker_results/
retention-days: 1
pylint_check:
if: "github.repository == 'MDAnalysis/mdanalysis'"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: 3.9
- name: install
run: |
python -m pip install pylint
- name: pylint
env:
PYLINTRC: package/.pylintrc
run: |
pylint package/MDAnalysis && pylint testsuite/MDAnalysisTests
mypy :
if: "github.repository == 'MDAnalysis/mdanalysis'"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: setup_miniconda
uses: conda-incubator/setup-miniconda@v2
with:
python-version: 3.9
auto-update-conda: true
channel-priority: flexible
channels: conda-forge, bioconda
add-pip-as-python-dependency: true
use-mamba: true
miniforge-variant: Mambaforge
architecture: x64
- name: install_deps
uses: ./.github/actions/setup-deps
with:
mamba: true
full-deps: true
numpy: numpy=1.21.0
- name: install
run: |
python -m pip install mypy
- name: "Run mypy"
run: |
mypy package/MDAnalysis/