Skip to content

Commit bab5f9f

Browse files
committed
Lint our own configs
1 parent 62f9351 commit bab5f9f

2 files changed

Lines changed: 95 additions & 86 deletions

File tree

.github/workflows/pythonapp.yml

Lines changed: 50 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -3,56 +3,56 @@
33
name: SpeechBrain toolkit CI
44

55
# Runs on pushes to master and all pull requests
6-
on:
7-
push:
8-
branches: [master]
9-
pull_request:
6+
on: # yamllint disable-line rule:truthy
7+
push:
8+
branches: [master]
9+
pull_request:
1010

1111
jobs:
12-
linters:
13-
name: Linters
14-
runs-on: ubuntu-latest
15-
steps:
16-
- uses: actions/checkout@v2
17-
- name: Set up Python 3.7
18-
uses: actions/setup-python@v1
19-
with:
20-
python-version: 3.7
21-
- name: Lint dependencies
22-
run: |
23-
python -m pip install --upgrade pip
24-
pip install -r lint-requirements.txt
25-
- name: Show errors separately
26-
uses: samuelmeuli/lint-action@v1
27-
with:
28-
github_token: ${{ secrets.github_token }}
29-
# Enable linters
30-
black: true
31-
flake8: true
32-
- name: Run lint again for error code
33-
run: |
34-
flake8 . --count --show-source --statistics
35-
black --check --diff .
12+
linters:
13+
name: Linters
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v2
17+
- name: Set up Python 3.7
18+
uses: actions/setup-python@v1
19+
with:
20+
python-version: 3.7
21+
- name: Lint dependencies
22+
run: |
23+
python -m pip install --upgrade pip
24+
pip install -r lint-requirements.txt
25+
- name: Show errors separately
26+
uses: samuelmeuli/lint-action@v1
27+
with:
28+
github_token: ${{ secrets.github_token }}
29+
# Enable linters
30+
black: True
31+
flake8: True
32+
- name: Run lint again for error code
33+
run: |
34+
flake8 . --count --show-source --statistics
35+
black --check --diff .
3636
37-
unittests:
38-
name: Unit Tests
39-
runs-on: ubuntu-latest
40-
steps:
41-
- uses: actions/checkout@v2
42-
- name: Set up Python 3.7
43-
uses: actions/setup-python@v1
44-
with:
45-
python-version: 3.7
46-
- name: Install libsndfile
47-
run: |
48-
sudo apt-get install -y libsndfile1
49-
- name: Full dependencies
50-
run: |
51-
pip install -r requirements.txt
52-
pip install --editable .
53-
- name: Unittests with pytest
54-
run: |
55-
pytest tests
56-
- name: Doctests with pytest
57-
run: |
58-
pytest --doctest-modules speechbrain
37+
unittests:
38+
name: Unit Tests
39+
runs-on: ubuntu-latest
40+
steps:
41+
- uses: actions/checkout@v2
42+
- name: Set up Python 3.7
43+
uses: actions/setup-python@v1
44+
with:
45+
python-version: 3.7
46+
- name: Install libsndfile
47+
run: |
48+
sudo apt-get install -y libsndfile1
49+
- name: Full dependencies
50+
run: |
51+
pip install -r requirements.txt
52+
pip install --editable .
53+
- name: Unittests with pytest
54+
run: |
55+
pytest tests
56+
- name: Doctests with pytest
57+
run: |
58+
pytest --doctest-modules speechbrain

.pre-push-config.yaml

Lines changed: 45 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,49 @@
11
repos:
2-
- repo: local
3-
hooks:
4-
- id: flake8-lint
5-
name: flake8-lint
6-
entry: flake8 . --count --show-source --statistics
7-
language: python
8-
pass_filenames: false
9-
always_run: true
10-
require_serial: false
2+
- repo: local
3+
hooks:
4+
- id: flake8-lint
5+
name: flake8-lint
6+
entry: flake8 . --count --show-source --statistics
7+
language: python
8+
pass_filenames: False
9+
always_run: True
10+
require_serial: False
1111

12-
- repo: local
13-
hooks:
14-
- id: black-lint
15-
name: black-lint
16-
entry: black --check --diff .
17-
language: python
18-
pass_filenames: false
19-
always_run: true
20-
require_serial: false
12+
- repo: local
13+
hooks:
14+
- id: black-lint
15+
name: black-lint
16+
entry: black --check --diff .
17+
language: python
18+
pass_filenames: False
19+
always_run: True
20+
require_serial: False
2121

22-
- repo: local
23-
hooks:
24-
- id: unittests
25-
name: unittests
26-
entry: pytest tests
27-
language: python
28-
pass_filenames: false
29-
always_run: true
30-
require_serial: false
22+
- repo: local
23+
hooks:
24+
- id: unittests
25+
name: unittests
26+
entry: pytest tests
27+
language: python
28+
pass_filenames: False
29+
always_run: True
30+
require_serial: False
3131

32-
- repo: local
33-
hooks:
34-
- id: doctests
35-
name: doctests
36-
entry: pytest --doctest-modules speechbrain
37-
language: python
38-
pass_filenames: false
39-
always_run: true
40-
require_serial: false
32+
- repo: local
33+
hooks:
34+
- id: doctests
35+
name: doctests
36+
entry: pytest --doctest-modules speechbrain
37+
language: python
38+
pass_filenames: False
39+
always_run: True
40+
require_serial: False
41+
42+
- repo: https://github.com/adrienverge/yamllint
43+
rev: v1.23.0
44+
hooks:
45+
- id: yamllint
46+
entry: yamllint .
47+
pass_filenames: False
48+
always_run: True
49+
require_serial: False

0 commit comments

Comments
 (0)