Skip to content

Commit

Permalink
Close #9: adding a threshold parameter
Browse files Browse the repository at this point in the history
step is marked as failure when threshold param is lower then current
uploaded failures
  • Loading branch information
arolfes committed Feb 15, 2021
1 parent efe5b40 commit 51e2704
Show file tree
Hide file tree
Showing 9 changed files with 18,152 additions and 25,802 deletions.
35 changes: 29 additions & 6 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"plugins": ["jest", "@typescript-eslint"],
"extends": ["plugin:github/es6"],
"extends": ["plugin:github/typescript"],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": 9,
Expand All @@ -16,13 +16,38 @@
"@typescript-eslint/no-require-imports": "error",
"@typescript-eslint/array-type": "error",
"@typescript-eslint/await-thenable": "error",
"@typescript-eslint/ban-ts-ignore": "error",
"@typescript-eslint/ban-ts-comment": [
"error",
{
"ts-expect-error": "allow-with-description",
"ts-ignore": true,
"ts-nocheck": true,
"ts-check": false,
"minimumDescriptionLength": 5
}
],
"camelcase": "off",
"@typescript-eslint/camelcase": "off",
"@typescript-eslint/class-name-casing": "error",
"@typescript-eslint/consistent-type-assertions": "error",
"@typescript-eslint/explicit-function-return-type": ["error", {"allowExpressions": true}],
"@typescript-eslint/func-call-spacing": ["error", "never"],
"@typescript-eslint/generic-type-naming": ["error", "^[A-Z][A-Za-z]*$"],
"@typescript-eslint/naming-convention": [
"error",
{
"selector": "variable",
"format": ["camelCase", "UPPER_CASE"]
},
// {
// "selector": "variable",
// "modifiers": ["const"],
// "format": ["UPPER_CASE"]
// },
{
"selector": "typeParameter",
"format": ["PascalCase"],
"prefix": ["T"]
}
],
"@typescript-eslint/no-array-constructor": "error",
"@typescript-eslint/no-empty-interface": "error",
"@typescript-eslint/no-explicit-any": "error",
Expand All @@ -32,15 +57,13 @@
"@typescript-eslint/no-misused-new": "error",
"@typescript-eslint/no-namespace": "error",
"@typescript-eslint/no-non-null-assertion": "warn",
"@typescript-eslint/no-object-literal-type-assertion": "error",
"@typescript-eslint/no-unnecessary-qualifier": "error",
"@typescript-eslint/no-unnecessary-type-assertion": "error",
"@typescript-eslint/no-useless-constructor": "error",
"@typescript-eslint/no-var-requires": "error",
"@typescript-eslint/prefer-for-of": "warn",
"@typescript-eslint/prefer-function-type": "warn",
"@typescript-eslint/prefer-includes": "error",
"@typescript-eslint/prefer-interface": "error",
"@typescript-eslint/prefer-string-starts-ends-with": "error",
"@typescript-eslint/promise-function-async": "error",
"@typescript-eslint/require-array-sort-compare": "error",
Expand Down
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ Optional. Title for the check run to create. Defaults to `SpotBugs Source Code A
### `token`
Optional. GitHub API access token. Defaults to `${{ github.token }}`, which is set by `actions/checkout@v2` minimally.

### `threshold`
Optional. Configures the threshold when this job is marked as failed if to many finding. Defaults to `0`.

## Example usage

```yaml
Expand Down Expand Up @@ -117,3 +120,8 @@ $ npm test

...
```

Before creating the PullRequest make sure you executed all
```
npm run all
```
3 changes: 3 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ inputs:
Also when generating a new PAT, select the least scopes necessary.
[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)
default: ${{ github.token }}
threshold:
description: 'Configures the threshold when this job is marked as failed if to many finding'
default: 0
runs:
using: 'node12'
main: 'dist/index.js'
Expand Down
Loading

0 comments on commit 51e2704

Please sign in to comment.