This is an automated email from the ASF dual-hosted git repository.
wave pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/petri-site.git
The following commit(s) were added to refs/heads/master by this push:
new a2d12d8 Add flake8 Python linting as a GitHub Action
new 2602021 Merge pull request #19 from jbampton/add-flake8
a2d12d8 is described below
commit a2d12d8c33ad4699ed72c79613d95a7bafc3552b
Author: John Bampton <[email protected]>
AuthorDate: Wed Mar 17 04:00:50 2021 +1000
Add flake8 Python linting as a GitHub Action
---
.github/workflows/lint.yml | 21 +++++++++++++++++++++
README.md | 3 ++-
pelicanconf.py | 2 +-
3 files changed, 24 insertions(+), 2 deletions(-)
diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml
index 2931e17..284d98b 100644
--- a/.github/workflows/lint.yml
+++ b/.github/workflows/lint.yml
@@ -3,6 +3,27 @@ name: Lint
on: [pull_request]
jobs:
+ flake8:
+ name: Flake8
+ runs-on: ubuntu-latest
+ strategy:
+ matrix:
+ python-version: [3.8]
+ steps:
+ - uses: actions/checkout@v2
+ - name: Set up Python ${{ matrix.python-version }}
+ uses: actions/setup-python@v2
+ with:
+ python-version: ${{ matrix.python-version }}
+ - name: Install dependencies
+ run: |
+ python -m pip install --upgrade pip
+ pip install flake8
+ if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
+ - name: Lint with flake8
+ run: |
+ # stop the build if there are Python syntax errors or undefined names
+ flake8 . --count --ignore=E201,F401 --show-source --statistics
markdownlint:
runs-on: ${{ matrix.os }}
strategy:
diff --git a/README.md b/README.md
index f2ce743..975c93f 100644
--- a/README.md
+++ b/README.md
@@ -31,7 +31,8 @@ CSS frameworks available are:
Additional testing with GitHub Actions:
-- [lint](.github/workflows/lint.yml) -- GitHub Action Workflow
+- [Lint](.github/workflows/lint.yml) -- GitHub Action Workflow
+- [Flake8](https://flake8.pycqa.org/en/latest/) - Flake8: Your Tool For Style
Guide Enforcement
- [markdownlint](https://github.com/DavidAnson/markdownlint) -- using
[markdownlint-cli](https://github.com/igorshubovych/markdownlint-cli) - Node.js
style checker and lint tool for Markdown/CommonMark files
- [misspell](https://github.com/client9/misspell) -- Golang library to correct
commonly misspelled English words quickly
- [yamllint](https://yamllint.readthedocs.io/en/stable/) -- a linter for YAML
files
diff --git a/pelicanconf.py b/pelicanconf.py
index 6fca6bc..19bcf55 100644
--- a/pelicanconf.py
+++ b/pelicanconf.py
@@ -22,8 +22,8 @@
from __future__ import unicode_literals
from datetime import date
-import sys
import os
+import sys
AUTHOR = u'Petri Community'
SITENAME = u'Apache Petri'