Skip to content

Commit d28d012

Browse files
Merge pull request #433 from adamtheturtle/lint-once
Add language to fence
2 parents f791498 + c0824d3 commit d28d012

File tree

5 files changed

+41
-3
lines changed

5 files changed

+41
-3
lines changed

.travis.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,11 @@ sudo: false
22
language: python
33
python:
44
- '3.6'
5+
matrix:
6+
fast_finish: true
57
env:
68
matrix:
9+
- TEST_FILENAME=''
710
- TEST_FILENAME=test_add_target.py::TestActiveFlag
811
- TEST_FILENAME=test_add_target.py::TestApplicationMetadata
912
- TEST_FILENAME=test_add_target.py::TestContentTypes
@@ -48,9 +51,8 @@ install:
4851
- travis_retry npm install -g markdownlint-cli
4952
cache: pip
5053
before_script:
51-
- make lint
5254
- python ci/set_secrets_file.py
5355
script:
54-
- pytest --exitfirst -vvv tests/mock_vws/"$TEST_FILENAME" --cov=src --cov=tests
56+
- python ci/run_script.py
5557
after_success:
5658
- codecov

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ pip install --editable .[dev]
1414

1515
Insall `npm` dependencies for linting Markdown files:
1616

17-
```
17+
```sh
1818
npm install -g markdownlint-cli
1919
```
2020

ci/run_script.py

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
"""
2+
Run tests and linters on Travis CI.
3+
"""
4+
5+
import os
6+
import subprocess
7+
import sys
8+
from pathlib import Path
9+
10+
import pytest
11+
12+
13+
def run_test(test_filename: str) -> None:
14+
"""
15+
Run pytest with a given filename.
16+
"""
17+
path = Path('tests') / 'mock_vws' / test_filename
18+
result = pytest.main(
19+
[
20+
'-vvv',
21+
'--exitfirst',
22+
str(path),
23+
'--cov=src',
24+
'--cov=tests',
25+
]
26+
)
27+
sys.exit(result)
28+
29+
30+
if __name__ == '__main__':
31+
TEST_FILENAME = os.environ.get('TEST_FILENAME')
32+
if TEST_FILENAME:
33+
run_test(test_filename=TEST_FILENAME)
34+
else:
35+
subprocess.check_call(['make', 'lint'])

secrets.tar.enc

-1 KB
Binary file not shown.

spelling_private_dict.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ datetime
1111
decodable
1212
dev
1313
dict
14+
filename
1415
foo
1516
github
1617
greyscale

0 commit comments

Comments
 (0)