forked from MDAnalysis/mdanalysis
-
Notifications
You must be signed in to change notification settings - Fork 0
155 lines (132 loc) · 3.6 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
152
153
154
155
name: "linters"
on:
push:
branches:
- develop
pull_request_target:
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
permissions:
# try to lock things down as much as possible
actions: read
checks: read
contents: read
deployments: read
discussions: read
id-token: none
issues: read
packages: read
pages: read
pull-requests: read
repository-projects: read
security-events: read
statuses: read
defaults:
run:
shell: bash -l {0}
jobs:
darker_lint:
if: |
github.repository == 'MDAnalysis/mdanalysis' &&
github.event_name == 'pull_request_target'
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.8
- name: setup_dependencies
run: |
pip install PyGithub
- 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: write-errors
env:
PR_NUM: ${{ env.PULL_NUMBER }}
GITHUB_TOKEN: ${{ github.token }}
run: |
echo ${{ steps.darker-main-code.outcome }}
echo ${{ steps.darker-test-code.outcome }}
python maintainer/ci/darker-outcomes.py --main_stat ${{ steps.darker-main-code.outcome }} \
--test_stat ${{ steps.darker-test-code.outcome }}
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.8
- 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.8
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/