Skip to content
Closed
Show file tree
Hide file tree
Changes from all 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
50 changes: 50 additions & 0 deletions .github/workflows/reviewdog.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Linting
on: [pull_request]

jobs:
flake8:
name: run-flake8
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Set up Python 3
uses: actions/setup-python@v1
with:
python-version: 3.8

- name: Install linters
run: pip3 install -r requirements/testing/flake8.txt

- name: Set up reviewdog
run: |
mkdir -p $HOME/bin && curl -sfL https://raw.githubusercontent.com/reviewdog/reviewdog/master/install.sh| sh -s -- -b $HOME/bin
echo ::add-path::$HOME/bin
- name: Run reviewdog
env:
REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
flake8 | reviewdog -f=pep8 -name=flake8 -reporter=github-check

cppcheck:
name: run-cppcheck
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Install linters
run: |
sudo apt update
sudo apt install -qq cppcheck
cppcheck --version

- name: Set up reviewdog
run: |
mkdir -p $HOME/bin && curl -sfL https://raw.githubusercontent.com/reviewdog/reviewdog/master/install.sh| sh -s -- -b $HOME/bin
echo ::add-path::$HOME/bin
- name: Run reviewdog
env:
REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
cppcheck --quiet --template="{file}:{line}:{column}: {id}: {message}" src/ |& reviewdog -f=pep8 -name=cppcheck -reporter=github-check -tee
# cppcheck --quiet --template="{file}:{line}:{column}: {id}: {message}" extern/ |& reviewdog -f=pep8 -name=cppcheck -reporter=github-check -level=warning
26 changes: 6 additions & 20 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,17 +62,9 @@ env:
- NO_AT_BRIDGE=1 # Necessary for GTK3 interactive test.
- OPENBLAS_NUM_THREADS=1
- PYTHONFAULTHANDLER=1
- RUN_PYTEST=1
- RUN_FLAKE8=

matrix:
include:
- name: flake8
python: 3.6
env:
- RUN_PYTEST=
- RUN_FLAKE8=1
- EXTRAREQS='-r requirements/testing/travis_flake8.txt'
- python: 3.6
env:
- PINNEDVERS='-c requirements/testing/travis36minver.txt'
Expand Down Expand Up @@ -165,13 +157,13 @@ install:

# Set flag in a delayed manner to avoid issues with installing other packages
- |
if [[ $TRAVIS_OS_NAME != 'osx' ]] && [[ $RUN_PYTEST == 1 ]]; then
if [[ $TRAVIS_OS_NAME != 'osx' ]]; then
export CPPFLAGS=--coverage
fi
- |
python -mpip install -ve . # Install Matplotlib.
- |
if [[ $TRAVIS_OS_NAME != 'osx' ]] && [[ $RUN_PYTEST == 1 ]]; then
if [[ $TRAVIS_OS_NAME != 'osx' ]]; then
unset CPPFLAGS
fi

Expand All @@ -184,16 +176,10 @@ script:
# Each script we want to run need to go in its own section and the program
# you want to fail travis needs to be the last thing called.
- |
if [[ $RUN_PYTEST == 1 ]]; then
# The number of processes is hardcoded (-n2), because using too many
# causes the Travis VM to run out of memory (since so many copies of
# inkscape and ghostscript are running at the same time).
python -mpytest -raR --maxfail=50 --timeout=300 --durations=25 --cov-report= --cov=lib -n2 --log-level=DEBUG
fi
- |
if [[ $RUN_FLAKE8 == 1 ]]; then
flake8 --statistics && echo "Flake8 passed without any issues!"
fi
# The number of processes is hardcoded (-n2), because using too many
# causes the Travis VM to run out of memory (since so many copies of
# inkscape and ghostscript are running at the same time).
python -mpytest -raR --maxfail=50 --timeout=300 --durations=25 --cov-report= --cov=lib -n2 --log-level=DEBUG

before_cache: |
rm -rf $HOME/.cache/matplotlib/tex.cache
Expand Down
5 changes: 5 additions & 0 deletions requirements/testing/flake8.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Extra pip requirements for the GitHub Actions flake8 build

flake8>=3.7
pydocstyle<4.0
flake8-docstrings
5 changes: 0 additions & 5 deletions requirements/testing/travis_flake8.txt

This file was deleted.