Skip to content

Commit 15f5670

Browse files
authored
Merge pull request #4 from max-models/3-static-analysis-with-isort-and-black
Updated the CI pipeline, added static analysis (only black and isort has to pass). Added some templates
2 parents cb2498a + 2f3d221 commit 15f5670

File tree

4 files changed

+125
-8
lines changed

4 files changed

+125
-8
lines changed
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
---
2+
name: Bug report
3+
about: Create a report to help us improve
4+
title: ''
5+
labels: ''
6+
assignees: ''
7+
8+
---
9+
10+
**Describe the bug**
11+
12+
...
13+
14+
**To Reproduce**
15+
16+
...
17+
18+
**Expected behavior**
19+
20+
...
21+
22+
**Proposed solution**
23+
24+
...
25+
26+
**Additional context**
27+
28+
...
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
---
2+
name: Feature request
3+
about: Suggest an idea for this project
4+
title: ''
5+
labels: ''
6+
assignees: ''
7+
8+
---
9+
10+
**Describe the feature**
11+
12+
...
13+
14+
15+
**Proposed implementation**
16+
17+
...
18+
19+
**Additional context**
20+
21+
...

.github/workflows/ci_pipeline.yml

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,39 @@
1-
name: Python CI
1+
name: Testing
22

33
on:
44
push:
55
branches:
66
- main
7+
- devel
78
pull_request:
89
branches:
910
- main
11+
- devel
1012

1113
jobs:
1214
test:
1315
runs-on: ubuntu-latest
14-
16+
# strategy:
17+
# matrix:
18+
# python-version: ['3.12']
1519
steps:
1620
- name: Check out the code
1721
uses: actions/checkout@v3
1822

19-
- name: Set up Python
20-
uses: actions/setup-python@v4
21-
with:
22-
python-version: '3.x' # Specify the Python version, e.g., '3.8'
23+
# - name: Set up Python
24+
# uses: actions/setup-python@v4
25+
# with:
26+
# python-version: ${{ matrix.python-version }}
2327

24-
- name: Install dependencies
28+
- name: Install python dependencies
2529
run: |
2630
python -m pip install --upgrade pip
2731
pip install .
2832
33+
- name: Inspect maxplotlib arguments
34+
run: |
35+
maxplotlib -h
36+
2937
- name: Run tests
3038
run: |
31-
pytest # or replace with your testing command
39+
pytest .
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
name: Static analysis
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- devel
8+
pull_request:
9+
branches:
10+
- main
11+
- devel
12+
13+
jobs:
14+
static-analysis:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- name: Checkout the code
18+
uses: actions/checkout@v4
19+
20+
- name: Download and run cloc
21+
run: |
22+
curl -s https://raw.githubusercontent.com/AlDanial/cloc/master/cloc > cloc
23+
chmod +x cloc
24+
./cloc --version
25+
./cloc $(git ls-files)
26+
27+
- name: Code formatting with black
28+
run: |
29+
pip install black
30+
pip install "black[jupyter]"
31+
black --check src/
32+
33+
- name: Code formatting with isort
34+
run: |
35+
pip install isort
36+
isort --check src/
37+
38+
- name: Code formatting with prospector
39+
continue-on-error: true
40+
run: |
41+
pip install mypy
42+
mypy src/
43+
44+
- name: Code formatting with prospector
45+
continue-on-error: true
46+
run: |
47+
pip install prospector
48+
prospector src/
49+
50+
- name: Code formatting with ruff
51+
continue-on-error: true
52+
run: |
53+
pip install ruff
54+
ruff check src/
55+
56+
- name: Code formatting with pylint
57+
continue-on-error: true
58+
run: |
59+
pip install pylint
60+
pylint src/

0 commit comments

Comments
 (0)