Skip to content

Commit 77dbb2d

Browse files
committed
Add mypy errors test project
1 parent af6b760 commit 77dbb2d

File tree

7 files changed

+671
-2
lines changed

7 files changed

+671
-2
lines changed

.github/test_projects/mypy-errors/README.md

Whitespace-only changes.

.github/test_projects/mypy-errors/poetry.lock

Lines changed: 613 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
[project]
2+
name = "mypy-errors"
3+
version = "0.1.0"
4+
description = "Tests actions/analyze-project with a project that has mypy errors"
5+
authors = [
6+
{name = "Joel Dixon",email = "[email protected]"}
7+
]
8+
readme = "README.md"
9+
requires-python = ">=3.9,<4.0"
10+
dynamic = ["dependencies"]
11+
12+
[tool.poetry]
13+
packages = [{include = "test_project", from = "src"}]
14+
15+
[tool.poetry.group.lint.dependencies]
16+
ni-python-styleguide = ">=0.4.1"
17+
mypy = ">=1.0"
18+
pyright = { version = ">=1.1.400", extras = ["nodejs"] }
19+
20+
[tool.mypy]
21+
mypy_path = "."
22+
files = "."
23+
namespace_packages = true
24+
strict = true
25+
explicit_package_bases = true
26+
27+
[tool.pyright]
28+
include = ["src/", "tests/"]
29+
30+
[build-system]
31+
requires = ["poetry-core>=2.0.0,<3.0.0"]
32+
build-backend = "poetry.core.masonry.api"
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
"""Docstring required."""
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
"""Required docstring."""
2+
3+
4+
def foo(x: int, y: int):
5+
"""Required docstring."""
6+
print("Hello, world!")
7+
return x + y
8+
9+
10+
foo(1, 2)
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
"""Module docstring."""

.github/workflows/test_actions.yml

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -228,21 +228,33 @@ jobs:
228228
python-version: ${{ matrix.python-version }}
229229
- name: Set up Poetry
230230
uses: ./setup-poetry
231-
- name: Analyze Python Project
231+
- name: Analyze Valid Minimal
232232
uses: ./analyze-project
233233
id: minimal
234234
with:
235235
project-directory: ${{ github.workspace }}/.github/test_projects/minimal
236-
- name: Analyze Python Project
236+
- name: Analyze ni-python-styleguide Errors Project
237237
uses: ./analyze-project
238238
id: ni-python-styleguide-errors
239+
continue-on-error: true
239240
with:
240241
project-directory: ${{ github.workspace }}/.github/test_projects/ni-python-styleguide-errors
241242
- name: Error if the previous step didn't fail
242243
if: steps.ni-python-styleguide-errors.outcome != 'failure'
243244
run: |
244245
echo "::error title=Test Failure::The previous step did not fail as expected."
245246
exit 1
247+
- name: Analyze mypy Errors Project
248+
uses: ./analyze-project
249+
id: mypy-errors
250+
continue-on-error: true
251+
with:
252+
project-directory: ${{ github.workspace }}/.github/test_projects/mypy-errors
253+
- name: Error if the previous step didn't fail
254+
if: steps.mypy-errors.outcome != 'failure'
255+
run: |
256+
echo "::error title=Test Failure::The previous step did not fail as expected."
257+
exit 1
246258
247259
# This job is intended to combine the test results so we don't have to list
248260
# each matrix combination in the required status check settings. There are a

0 commit comments

Comments
 (0)