Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions .github/workflows/flake8.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Lint
on: [pull_request]

permissions:
contents: read

jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: '3.9'
- name: Install requirements
run: pip install flake8 pycodestyle
- name: Check syntax
# Stop the build if there are Python syntax errors or undefined names
run: flake8 --show-source

- name: Warnings
run: flake8
44 changes: 44 additions & 0 deletions .github/workflows/pyright.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Check types
on: [pull_request]
env:
NODE_VERSION: '18'
PYTHON_VERSION: '3.9'

permissions:
contents: read

jobs:
typecheck:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
id: gitcheckout
- uses: actions/setup-python@v2
with:
python-version: ${{ env.PYTHON_VERSION }}
- uses: actions/setup-node@v3
with:
node-version: ${{ env.NODE_VERSION }}
- name: Install python deps
id: pydepends
if: steps.gitcheckout.outcome == 'success'
run: |
python3 -m venv /home/runner/work/app
mkdir -p /home/runner/work/app/src/ckanext-gcnotify
cp -R . /home/runner/work/app/src/ckanext-gcnotify
source /home/runner/work/app/bin/activate
pip install --upgrade setuptools==70.0.0
pip install --upgrade pip==23.2.1
pip install -e 'git+https://github.com/open-data/ckan@canada-v2.10#egg=ckan' -r 'https://raw.githubusercontent.com/open-data/ckan/canada-v2.10/requirement-setuptools.txt' -r 'https://raw.githubusercontent.com/open-data/ckan/canada-v2.10/requirements.txt' -r 'https://raw.githubusercontent.com/open-data/ckan/canada-v2.10/dev-requirements.txt'
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
find /home/runner/work/app -name '*.pyc' -delete
- name: Install node deps
if: steps.pydepends.outcome == 'success'
run: |
cd /home/runner/work/app/src/ckanext-gcnotify
npm ci
- name: Check types
if: steps.pydepends.outcome == 'success'
run: |
cd /home/runner/work/app/src/ckanext-gcnotify
npx pyright
1 change: 1 addition & 0 deletions changes/6.changes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Refactor code to meet CKAN and Python coding standards.
Loading