Skip to content

Commit 60ac362

Browse files
authored
Merge pull request #6 from open-data/changes/linting
CKAN Coding Standards
2 parents 15ebfcc + eff1b33 commit 60ac362

File tree

11 files changed

+365
-159
lines changed

11 files changed

+365
-159
lines changed

.github/workflows/flake8.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: Lint
2+
on: [pull_request]
3+
4+
permissions:
5+
contents: read
6+
7+
jobs:
8+
lint:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v2
12+
- uses: actions/setup-python@v2
13+
with:
14+
python-version: '3.9'
15+
- name: Install requirements
16+
run: pip install flake8 pycodestyle
17+
- name: Check syntax
18+
# Stop the build if there are Python syntax errors or undefined names
19+
run: flake8 --show-source
20+
21+
- name: Warnings
22+
run: flake8

.github/workflows/pyright.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: Check types
2+
on: [pull_request]
3+
env:
4+
NODE_VERSION: '18'
5+
PYTHON_VERSION: '3.9'
6+
7+
permissions:
8+
contents: read
9+
10+
jobs:
11+
typecheck:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v2
15+
id: gitcheckout
16+
- uses: actions/setup-python@v2
17+
with:
18+
python-version: ${{ env.PYTHON_VERSION }}
19+
- uses: actions/setup-node@v3
20+
with:
21+
node-version: ${{ env.NODE_VERSION }}
22+
- name: Install python deps
23+
id: pydepends
24+
if: steps.gitcheckout.outcome == 'success'
25+
run: |
26+
python3 -m venv /home/runner/work/app
27+
mkdir -p /home/runner/work/app/src/ckanext-gcnotify
28+
cp -R . /home/runner/work/app/src/ckanext-gcnotify
29+
source /home/runner/work/app/bin/activate
30+
pip install --upgrade setuptools==70.0.0
31+
pip install --upgrade pip==23.2.1
32+
pip install -e 'git+https://github.com/ckan/ckan@master#egg=ckan' -r 'https://raw.githubusercontent.com/ckan/ckan/master/requirements.txt' -r 'https://raw.githubusercontent.com/ckan/ckan/master/dev-requirements.txt'
33+
pip install -e /home/runner/work/app/src/ckanext-gcnotify/. -r /home/runner/work/app/src/ckanext-gcnotify/requirements.txt -r /home/runner/work/app/src/ckanext-gcnotify/dev-requirements.txt
34+
pip install --upgrade setuptools==44.1.0
35+
find /home/runner/work/app -name '*.pyc' -delete
36+
- name: Install node deps
37+
if: steps.pydepends.outcome == 'success'
38+
run: |
39+
cd /home/runner/work/app/src/ckanext-gcnotify
40+
npm ci
41+
- name: Check types
42+
if: steps.pydepends.outcome == 'success'
43+
run: |
44+
cd /home/runner/work/app/src/ckanext-gcnotify
45+
npx pyright

changes/6.changes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Refactor code to meet CKAN and Python coding standards.

0 commit comments

Comments
 (0)