Skip to content

Commit

Permalink
CI: Make the CI Great Again
Browse files Browse the repository at this point in the history
  • Loading branch information
gmuloc committed Jan 12, 2023
1 parent 64f19e8 commit 5ff4ce5
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 12 deletions.
10 changes: 6 additions & 4 deletions .github/workflows/pull-request-management.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,26 +8,28 @@ jobs:
name: Run pylint
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- name: Setup Python
uses: actions/setup-python@v3
with:
python-version: 3.10
python-version: "3.10"
- name: Install dependencies
run: pip install tox tox-gh-actions
- name: "Run lint"
run: tox -e lint
type:
name: Run pylint
name: Run mypy
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- name: Setup Python
uses: actions/setup-python@v3
with:
python-version: 3.10
python-version: "3.10"
- name: Install dependencies
run: pip install tox tox-gh-actions
- name: "Run mypy"
run: tox -e mypy
run: tox -e type
tox:
name: Run pytest for supported Python versions
runs-on: ubuntu-20.04
Expand Down
3 changes: 2 additions & 1 deletion tests/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -410,9 +410,10 @@ def test_run_stdin(capsys):
run_return_value = run(["--log", "--stdin"])
patched_stdin.isatty.assert_called_once()
captured = capsys.readouterr()
normalized_string = " ".join(captured.out.split())
matches = re.search(
ONE_ERROR_REGEX,
captured.out,
normalized_string,
re.MULTILINE,
)
assert matches is not None
Expand Down
12 changes: 5 additions & 7 deletions tests/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,11 +129,9 @@ def j2lint_default_rules_string():


ONE_ERROR_REGEX = (
r"────────────────────────────── JINJA2 LINT ERRORS ──────────────────────────────\n"
r"📄 .*.j2\n"
r"└── (.*.j2):1 Jinja \n"
r" statement should have a single space before and after: '{% statement %}' \n"
r" \(jinja-statements-single-space\)\n"
r"\n"
r"Jinja2 linting finished with 1 error\(s\) and 0 warning\(s\)\n"
r"────────────────────────────── JINJA2 LINT ERRORS ────────────────────────────── "
r"📄 .*.j2 "
r"└── (.*.j2):1 Jinja statement should have a single space before and "
r"after: '{% statement %}' \(jinja-statements-single-space\) "
r"Jinja2 linting finished with 1 error\(s\) and 0 warning\(s\)"
)

0 comments on commit 5ff4ce5

Please sign in to comment.