Skip to content

Commit bb80721

Browse files
cclaussjbitton
andauthored
GitHub Action to lint Python code (#50)
* GitHub Action to lint Python code * flake8 --max-line-length=120 * Fix codespell to match #51 #51 * Update lint_python.yml * Ignore failing pytests * pytest --ignore-glob * python -m unittest discover * Update lint_python.yml * pip install ffmpeg SoundFile torchvision * sudo apt-get install python3-magic * Update .github/workflows/lint_python.yml Co-authored-by: Joanna Bitton <joanna.bitton@gmail.com> * Update .github/workflows/lint_python.yml Co-authored-by: Joanna Bitton <joanna.bitton@gmail.com> * apt-get install ffmpeg python3-soundfile * sudo apt-get update * Allow unittests to fail * tests.py -> test.py * Update lint_python.yml * pip install pyre-check * Fix pyre * brew install watchman * pyre init * pyre --source-directory . --noninteractive check * Two Actions: lint_python and test_python * Two Actions: lint_python and test_python * Two Actions: lint_python and test_python * Two Actions: lint_python and test_python * Rebase * Rename transforms_unit_tests.py to transforms_unit_test.py * pip install pyre-check * Rename functional_unit_tests.py to functional_unit_test.py * pytest --durations=10 . Co-authored-by: Joanna Bitton <joanna.bitton@gmail.com>
1 parent d40fe1e commit bb80721

File tree

15 files changed

+42
-2
lines changed

15 files changed

+42
-2
lines changed

.github/workflows/lint_python.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: lint_python
2+
on:
3+
pull_request:
4+
branches: main
5+
push:
6+
branches: main
7+
jobs:
8+
lint_python:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v2
12+
- uses: actions/setup-python@v2
13+
- run: pip install bandit black codespell flake8 isort pyre-check pytest pyupgrade safety
14+
- run: bandit --recursive --skip B101,B301,B303,B311,B403 .
15+
- run: black --check . || true
16+
- run: codespell --ignore-words-list="tha" --skip="*/text_tests,*/misspelling.json"
17+
- run: flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
18+
- run: flake8 . --count --exit-zero --max-complexity=15 --max-line-length=90 --show-source --statistics
19+
- run: isort --check-only --profile black . || true
20+
- run: shopt -s globstar && pyupgrade --py36-plus **/*.py || true
21+
- run: safety check

.github/workflows/test_python.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: test_python
2+
on:
3+
pull_request:
4+
branches: main
5+
push:
6+
branches: main
7+
jobs:
8+
test_python:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v2
12+
- uses: actions/setup-python@v2
13+
- run: sudo apt-get update
14+
- run: sudo apt-get install --fix-missing ffmpeg python3-soundfile
15+
- run: pip install pyre-check pytest torchvision
16+
- run: pip install -e .
17+
- run: brew install watchman # ~2 minutes
18+
- run: pyre --source-directory "." --noninteractive check || true
19+
- run: pytest --durations=10 .
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

augly/tests/text_tests/transforms_unit_tests.py renamed to augly/tests/text_tests/transforms_unit_test.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ def are_equal_metadata(
4141
return True
4242

4343

44-
4544
class TransformsTextUnitTest(unittest.TestCase):
4645
def test_import(self) -> None:
4746
try:
File renamed without changes.

0 commit comments

Comments
 (0)