Skip to content

Commit

Permalink
add more linters
Browse files Browse the repository at this point in the history
  • Loading branch information
ben-manes committed Mar 24, 2024
1 parent 3d84225 commit dd8fc47
Show file tree
Hide file tree
Showing 6 changed files with 123 additions and 8 deletions.
3 changes: 2 additions & 1 deletion .github/actions/run-gradle/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Run Gradle
description: Sets up Gradle JDKs and runs Gradle
inputs:
arguments:
required: true
required: false
description: Gradle arguments
java:
required: true
Expand Down Expand Up @@ -83,6 +83,7 @@ runs:
gradle-home-cache-cleanup: true
gradle-home-cache-strict-match: true
- name: Run ${{ inputs.arguments }}
if: ${{ env.arguments != '' }}
env:
JAVA_HOME: ${{ steps.setup-gradle-jdk.outputs.path }}
ORG_GRADLE_PROJECT_org.gradle.java.installations.auto-download: 'false'
Expand Down
86 changes: 86 additions & 0 deletions .github/workflows/reviewdog.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
name: reviewdog
permissions: read-all
on: [ push, pull_request ]

jobs:
actionlint:
runs-on: ubuntu-latest
steps:
- name: Harden Runner
uses: step-security/harden-runner@63c24ba6bd7ba022e95695ff85de572c04a18142 # v2.7.0
with:
disable-sudo: true
egress-policy: block
allowed-endpoints: >
api.github.com:443
github.com:443
- uses: actions/checkout@v3
- name: Setup node/npm
uses: actions/setup-node@v1
with:
node-version: '*'

- name: actionlint
uses: reviewdog/action-actionlint@v1
with:
reporter: github-check
github_token: ${{ secrets.GITHUB_TOKEN }}

- name: alex
uses: reviewdog/action-alex@v1
with:
reporter: github-check
github_token: ${{ secrets.GITHUB_TOKEN }}

- name: detect-secrets
uses: reviewdog/action-detect-secrets@master
with:
reporter: github-check
github_token: ${{ secrets.GITHUB_TOKEN }}

- name: languagetool
uses: reviewdog/action-languagetool@v1
with:
reporter: github-check
github_token: ${{ secrets.GITHUB_TOKEN }}

- name: markdownlint
uses: reviewdog/action-markdownlint@v0
with:
reporter: github-check
github_token: ${{ secrets.GITHUB_TOKEN }}

- name: misspell
uses: reviewdog/action-misspell@v1
with:
locale: US
reporter: github-check
github_token: ${{ secrets.GITHUB_TOKEN }}

- name: install remark presets
shell: bash
run: npm install remark-preset-lint-recommended
- name: remark-lint
uses: reviewdog/action-remark-lint@v5
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
reporter: github-check

- name: shellcheck
uses: reviewdog/action-shellcheck@v1
with:
reporter: github-check
github_token: ${{ secrets.GITHUB_TOKEN }}

- name: shfmt
uses: reviewdog/action-nimlint@v1
with:
reporter: github-check
github_token: ${{ secrets.GITHUB_TOKEN }}

- name: textlint
uses: tsuyoshicho/action-textlint@v3
with:
reporter: github-check
textlint_flags: "**/*.md"
github_token: ${{ secrets.GITHUB_TOKEN }}
2 changes: 1 addition & 1 deletion .github/workflows/scorecards-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,13 @@ jobs:
api.osv.dev:443
api.securityscorecards.dev:443
bestpractices.coreinfrastructure.org:443
bestpractices.dev:443
fulcio.sigstore.dev:443
github.com:443
oss-fuzz-build-logs.storage.googleapis.com:443
rekor.sigstore.dev:443
sigstore-tuf-root.storage.googleapis.com:443
tuf-repo-cdn.sigstore.dev:443
www.bestpractices.dev:443
- name: Checkout code
uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2
with:
Expand Down
4 changes: 0 additions & 4 deletions .github/workflows/spelling.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,5 @@ jobs:
objects.githubusercontent.com:443
raw.githubusercontent.com:443
- uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2
- name: Install
run: curl -sfL https://raw.githubusercontent.com/golangci/misspell/master/install-misspell.sh | sh -s -- -b .
- name: Spell Check with Misspell
run: ./misspell -error .
- name: Spell Check with Typos
uses: crate-ci/typos@bcafd462cb07ef7ba57e34abf458fe20767e808b # v1.19.0
32 changes: 32 additions & 0 deletions .github/workflows/trivy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: trivy
permissions: read-all
on: [ push, pull_request ]

jobs:
trivy:
runs-on: ubuntu-20.04
permissions:
checks: write
actions: read
contents: read
security-events: write
steps:
- name: Harden Runner
uses: step-security/harden-runner@63c24ba6bd7ba022e95695ff85de572c04a18142 # v2.7.0
with:
disable-sudo: true
egress-policy: block
allowed-endpoints: >
api.github.com:443
github.com:443
- uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2
- name: Run Trivy vulnerability scanner
uses: aquasecurity/trivy-action@master
with:
scan-type: fs
format: sarif
output: trivy-results.sarif
- name: Upload Trivy scan results to GitHub Security tab
uses: github/codeql-action/upload-sarif@v2
with:
sarif_file: trivy-results.sarif
4 changes: 2 additions & 2 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[versions]
asm = "9.6"
asm = "9.7"
auto-value = "1.10.4"
awaitility = "4.2.1"
bcel = "6.8.2"
Expand Down Expand Up @@ -33,7 +33,7 @@ felix-framework = "7.0.5"
felix-scr = "2.2.10"
findsecbugs = "1.13.0"
flip-tables = "1.1.1"
forbidden-apis = "3.6"
forbidden-apis = "3.7"
google-java-format = "1.21.0"
guava = "33.1.0-jre"
guice = "6.0.0"
Expand Down

0 comments on commit dd8fc47

Please sign in to comment.