File tree Expand file tree Collapse file tree 5 files changed +42
-1
lines changed
Expand file tree Collapse file tree 5 files changed +42
-1
lines changed Original file line number Diff line number Diff line change 8282 error_classes : W,B
8383 only_warn : 1
8484
85+ run_action_with_extra_arguments :
86+ name : Test run action (extra arguments)
87+ runs-on : ubuntu-latest
88+ steps :
89+ - uses : actions/checkout@v2
90+ - uses : ./
91+ with :
92+ path : example_length
93+ extra_arguments : " --max-line-length 90"
94+
8595 codespell :
8696 name : Check for spelling errors
8797 runs-on : ubuntu-latest
Original file line number Diff line number Diff line change 9999 max_line_length: 90
100100```
101101
102-
103102### Parameter: only_warn
104103
105104Only warn about problems.
@@ -157,3 +156,18 @@ steps:
157156 with:
158157 warning_classes: W,B,D
159158```
159+
160+ ### Parameter: extra_arguments
161+
162+ Extra arguments to give to flake8.
163+ Useful when you need to give an argument this action otherwise doesn't supply (like ` --max-complexity ` , ` --hang-closing ` , ...).
164+
165+ This parameter is optional; by default it is empty.
166+
167+ ```
168+ steps:
169+ - uses: actions/checkout@v2
170+ - uses: TrueBrain/actions-flake8@v2
171+ with:
172+ extra_arguments: "--hang-closing"
173+ ```
Original file line number Diff line number Diff line change @@ -34,6 +34,10 @@ inputs:
3434 description : ' List of flake8 error classes to classify as Warning'
3535 required : false
3636 default : ' '
37+ extra_arguments :
38+ description : ' Extra arguments given to flake8'
39+ required : false
40+ default : ' '
3741runs :
3842 using : ' composite'
3943 steps :
6064 INPUT_PLUGINS : ${{ inputs.plugins }}
6165 INPUT_ERROR_CLASSES : ${{ inputs.error_classes }}
6266 INPUT_WARNING_CLASSES : ${{ inputs.warning_classes }}
67+ INPUT_EXTRA_ARGUMENTS : ${{ inputs.extra_arguments }}
6368branding :
6469 icon : ' code'
6570 color : ' blue'
Original file line number Diff line number Diff line change @@ -17,17 +17,27 @@ echo "::add-matcher::${ACTION_FOLDER}/flake8-matcher.json"
1717
1818# Create the flake8 arguments.
1919echo " Running flake8 on '${INPUT_PATH} ' with the following options:"
20+
2021command_args=" "
22+
2123echo " - ignoring: '${INPUT_IGNORE} '"
2224if [ " x${INPUT_IGNORE} " != " x" ]; then
2325 command_args=" ${command_args} --ignore ${INPUT_IGNORE} "
2426fi
27+
2528echo " - max line length: '${INPUT_MAX_LINE_LENGTH} '"
2629if [ " x${INPUT_MAX_LINE_LENGTH} " != " x" ]; then
2730 command_args=" ${command_args} --max-line-length ${INPUT_MAX_LINE_LENGTH} "
2831fi
32+
2933echo " - path: '${INPUT_PATH} '"
3034command_args=" ${command_args} ${INPUT_PATH} "
35+
36+ echo " - extra arguments: '${INPUT_EXTRA_ARGUMENTS} '"
37+ if [ " x${INPUT_EXTRA_ARGUMENTS} " != " x" ]; then
38+ command_args=" ${command_args} ${INPUT_EXTRA_ARGUMENTS} "
39+ fi
40+
3141echo " Resulting command: flake8 ${command_args} "
3242
3343# Run flake8.
Original file line number Diff line number Diff line change 1+ def line_that_will_be_way_too_long_but_not_long_enough_to_trigger_with_the_set_length ():
2+ pass
You can’t perform that action at this time.
0 commit comments