Skip to content

Commit

Permalink
add error tests for pyflakes rule
Browse files Browse the repository at this point in the history
  • Loading branch information
rhysd committed Apr 10, 2024
1 parent 9892fa4 commit c138c7d
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 0 deletions.
1 change: 1 addition & 0 deletions testdata/err/pyflakes_job_default_shell.out
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/test\.yaml:9:9: pyflakes reported issue in this script: .+ \[pyflakes\]/
9 changes: 9 additions & 0 deletions testdata/err/pyflakes_job_default_shell.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
on: push
jobs:
job-level:
runs-on: ubuntu-latest
defaults:
run:
shell: python
steps:
- run: print(unknown_var)
3 changes: 3 additions & 0 deletions testdata/err/pyflakes_step_shell.out
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/test\.yaml:7:9: pyflakes reported issue in this script: .+ \[pyflakes\]/
/test\.yaml:10:9: pyflakes reported issue in this script: .+ \[pyflakes\]/
/test\.yaml:13:9: pyflakes reported issue in this script: .+ \[pyflakes\]/
14 changes: 14 additions & 0 deletions testdata/err/pyflakes_step_shell.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
on: push
jobs:
step-level:
runs-on: ubuntu-latest
steps:
# Lint check failed. The error is output to stdout (#411)
- run: print(unknown_var)
shell: python
# Syntax check failed. The error is output to stderr (#411)
- run: print(
shell: python
# Check custom shell
- run: print(unknown_var)
shell: 'python {0}'
1 change: 1 addition & 0 deletions testdata/err/pyflakes_workflow_default_shell.out
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/test\.yaml:11:9: pyflakes reported issue in this script: .+ \[pyflakes\]/
11 changes: 11 additions & 0 deletions testdata/err/pyflakes_workflow_default_shell.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
on: push

defaults:
run:
shell: python

jobs:
job-level:
runs-on: ubuntu-latest
steps:
- run: print(unknown_var)

0 comments on commit c138c7d

Please sign in to comment.