Skip to content

Commit 94cc5d3

Browse files
committed
Close jwgmeligmeyling#9: adding a threshold parameter
step is marked as failure when threshold param is lower then current uploaded failures
1 parent efe5b40 commit 94cc5d3

9 files changed

Lines changed: 18087 additions & 25740 deletions

File tree

.eslintrc.json

Lines changed: 29 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"plugins": ["jest", "@typescript-eslint"],
3-
"extends": ["plugin:github/es6"],
3+
"extends": ["plugin:github/typescript"],
44
"parser": "@typescript-eslint/parser",
55
"parserOptions": {
66
"ecmaVersion": 9,
@@ -16,13 +16,38 @@
1616
"@typescript-eslint/no-require-imports": "error",
1717
"@typescript-eslint/array-type": "error",
1818
"@typescript-eslint/await-thenable": "error",
19-
"@typescript-eslint/ban-ts-ignore": "error",
19+
"@typescript-eslint/ban-ts-comment": [
20+
"error",
21+
{
22+
"ts-expect-error": "allow-with-description",
23+
"ts-ignore": true,
24+
"ts-nocheck": true,
25+
"ts-check": false,
26+
"minimumDescriptionLength": 5
27+
}
28+
],
2029
"camelcase": "off",
2130
"@typescript-eslint/camelcase": "off",
22-
"@typescript-eslint/class-name-casing": "error",
31+
"@typescript-eslint/consistent-type-assertions": "error",
2332
"@typescript-eslint/explicit-function-return-type": ["error", {"allowExpressions": true}],
2433
"@typescript-eslint/func-call-spacing": ["error", "never"],
25-
"@typescript-eslint/generic-type-naming": ["error", "^[A-Z][A-Za-z]*$"],
34+
"@typescript-eslint/naming-convention": [
35+
"error",
36+
{
37+
"selector": "variable",
38+
"format": ["camelCase", "UPPER_CASE"]
39+
},
40+
// {
41+
// "selector": "variable",
42+
// "modifiers": ["const"],
43+
// "format": ["UPPER_CASE"]
44+
// },
45+
{
46+
"selector": "typeParameter",
47+
"format": ["PascalCase"],
48+
"prefix": ["T"]
49+
}
50+
],
2651
"@typescript-eslint/no-array-constructor": "error",
2752
"@typescript-eslint/no-empty-interface": "error",
2853
"@typescript-eslint/no-explicit-any": "error",
@@ -32,15 +57,13 @@
3257
"@typescript-eslint/no-misused-new": "error",
3358
"@typescript-eslint/no-namespace": "error",
3459
"@typescript-eslint/no-non-null-assertion": "warn",
35-
"@typescript-eslint/no-object-literal-type-assertion": "error",
3660
"@typescript-eslint/no-unnecessary-qualifier": "error",
3761
"@typescript-eslint/no-unnecessary-type-assertion": "error",
3862
"@typescript-eslint/no-useless-constructor": "error",
3963
"@typescript-eslint/no-var-requires": "error",
4064
"@typescript-eslint/prefer-for-of": "warn",
4165
"@typescript-eslint/prefer-function-type": "warn",
4266
"@typescript-eslint/prefer-includes": "error",
43-
"@typescript-eslint/prefer-interface": "error",
4467
"@typescript-eslint/prefer-string-starts-ends-with": "error",
4568
"@typescript-eslint/promise-function-async": "error",
4669
"@typescript-eslint/require-array-sort-compare": "error",

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@ Optional. Title for the check run to create. Defaults to `SpotBugs Source Code A
2424
### `token`
2525
Optional. GitHub API access token. Defaults to `${{ github.token }}`, which is set by `actions/checkout@v2` minimally.
2626

27+
### `threshold`
28+
Optional. Configures the threshold when this job is marked as failed if to many finding. Defaults to `0`.
29+
2730
## Example usage
2831

2932
```yaml
@@ -117,3 +120,8 @@ $ npm test
117120

118121
...
119122
```
123+
124+
Before creating the PullRequest make sure you executed all
125+
```
126+
npm run all
127+
```

action.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ inputs:
2020
Also when generating a new PAT, select the least scopes necessary.
2121
[Learn more about creating and using encrypted secrets](https://help.github.com/en/actions/automating-your-workflow-with-github-actions/creating-and-using-encrypted-secrets)
2222
default: ${{ github.token }}
23+
threshold:
24+
description: 'Configures the threshold when this job is marked as failed if to many finding'
25+
default: 0
2326
runs:
2427
using: 'node12'
2528
main: 'dist/index.js'

0 commit comments

Comments
 (0)