Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions .github/linters/.hadolint.yaml
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
3 changes: 3 additions & 0 deletions .github/linters/.shellcheckrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
shell=bash
disable=SC1101,SC1102
severity=error
55 changes: 55 additions & 0 deletions .github/linters/eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
import { defineConfig } from "eslint/config";
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" },
},
},
]);
32 changes: 32 additions & 0 deletions .github/workflows/code-linter.yml
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

1 change: 0 additions & 1 deletion build/src/prep.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ const path = require('path');
const asyncUtils = require('./utils/async');
const configUtils = require('./utils/config');
const handlebars = require('handlebars');
const mkdirp = require('mkdirp');
const scriptSHA = {};

const assetsPath = path.join(__dirname, '..', 'assets');
Expand Down
Loading