-
Notifications
You must be signed in to change notification settings - Fork 888
Add linters in images repository #1786
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
0d42723
Add linters in images repository
Kaniska244 6915e6c
Update .github/workflows/code-linter.yml
Kaniska244 c56d35b
Update .github/linters/.hadolint.yaml
Kaniska244 cbcb196
Merge branch 'main' into new-linter-setup
Kaniska244 c2caada
Remove unused variable
Kaniska244 dc1f82e
Updating the GitHub Token to the expected PAT in images repo
Kaniska244 3789d85
Setting pull request summary flag to diable summary on the PR
Kaniska244 5d10c04
Setting MULTI_STATUS as false
Kaniska244 798b5a7
Changed the workflow and job name.
Kaniska244 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| --- | ||
| ########################## | ||
| ## Hadolint config file ## | ||
| ########################## | ||
| failure-threshold: "error" | ||
| ignored: | ||
| - DL4001 # Ignore wget and curl in same file | ||
| - DL4006 # ignore pipefail as we don't want to add layers | ||
| - DL3018 # Allow unpinned OS package versions (see DL3008 note for APT) | ||
| - DL3013 # Allow unpinned pip package versions; versions are managed outside the Dockerfile | ||
| - DL3003 # Ignore workdir so we don't add layers | ||
| - SC2016 # ignore as its interpreted later | ||
| - DL3044 # Ignore using env in env | ||
| - DL3008 # Ignore pinned versions check for APT | ||
| - SC3020 # Ignore POSIX check of the shorthand redirection(&>) | ||
| - SC2283 # Remove spaces around = to assign and this is not needed |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| shell=bash | ||
| disable=SC1101,SC1102 | ||
| severity=error | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,55 @@ | ||
| import { defineConfig } from "eslint/config"; | ||
Kaniska244 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| import { FlatCompat } from "@eslint/eslintrc"; | ||
| import js from "@eslint/js"; | ||
| import globals from "globals"; | ||
| import jsoncParser from "jsonc-eslint-parser"; | ||
|
|
||
| const compat = new FlatCompat(); | ||
|
|
||
| export default defineConfig([ | ||
| js.configs.recommended, | ||
|
|
||
| { | ||
| files: ["**/*.js", "**/*.cjs"], | ||
| languageOptions: { | ||
| ecmaVersion: 2021, | ||
| sourceType: "script", | ||
| globals: { | ||
| ...globals.node, | ||
| }, | ||
| }, | ||
| rules: { | ||
| "no-undef": "error", | ||
| }, | ||
| }, | ||
|
|
||
| { | ||
| files: ["build/src/prep.js"], | ||
| languageOptions: { | ||
| globals: { scriptLibraryPathInRepo: "readonly" }, | ||
| }, | ||
| }, | ||
|
|
||
| { | ||
| files: ["build/src/push.js"], | ||
| rules: { | ||
| "no-useless-escape": "off", | ||
| }, | ||
| }, | ||
|
|
||
| { | ||
| files: ["build/src/utils/async.js"], | ||
| rules: { | ||
| "no-redeclare": ["error", { builtinGlobals: false }], | ||
| }, | ||
| }, | ||
|
|
||
| ...compat.extends("plugin:jsonc/recommended-with-jsonc"), | ||
| { | ||
| files: ["**/*.json"], | ||
| languageOptions: { | ||
| parser: jsoncParser, | ||
| parserOptions: { jsonSyntax: "JSONC" }, | ||
Kaniska244 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| }, | ||
| }, | ||
| ]); | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| name: JSON, shell, javascript and Dockerfile linter | ||
|
|
||
| on: | ||
| push: | ||
| branches: | ||
| - main | ||
| pull_request: | ||
|
|
||
| jobs: | ||
| code-linter-steps: | ||
| name: JSON, shell, javascript and Dockerfile linter | ||
| runs-on: ubuntu-latest | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| with: | ||
| fetch-depth: 0 | ||
|
|
||
| - uses: super-linter/super-linter/slim@v8 | ||
| env: | ||
| MULTI_STATUS : false | ||
| ENABLE_GITHUB_PULL_REQUEST_SUMMARY_COMMENT: false | ||
| BASH_SEVERITY: error | ||
| VALIDATE_ALL_CODEBASE: true | ||
| DEFAULT_BRANCH: main | ||
| FILTER_REGEX_INCLUDE: '(^|.*/)(src/.*|build/.*\.js|Dockerfile)$' | ||
| FILTER_REGEX_EXCLUDE: '(^|.*/)src/.*/test-project(/.*)?$' | ||
| VALIDATE_DOCKERFILE_HADOLINT: true | ||
| VALIDATE_JAVASCRIPT_ES: true | ||
| VALIDATE_JSON: true | ||
| VALIDATE_BASH: true | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.