Skip to content

Commit

Permalink
Merge pull request #668 from swrlab/dev/deps-linter
Browse files Browse the repository at this point in the history
chore: update dependencies / refact: swap super-linter for repo-specific config
  • Loading branch information
frytg authored Jan 7, 2025
2 parents 59c91f2 + 516b1ed commit 15d9fc2
Show file tree
Hide file tree
Showing 39 changed files with 1,693 additions and 680 deletions.
2 changes: 1 addition & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ charset = utf-8
end_of_line = lf
indent_style = tab
indent_size = 8
print_width = 120
max_line_length = 120
trim_trailing_whitespace = true
insert_final_newline = true

Expand Down
3 changes: 0 additions & 3 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
# set google login
GCP_PROJECT_ID=my-project
GOOGLE_APPLICATION_CREDENTIALS=./keys/gcp.json

ARD_AUTH=user:pass
ARD_DELIVER_API=https://deliver-test.ard.de/organization-service/
10 changes: 0 additions & 10 deletions .github/linters/gitleaks.toml

This file was deleted.

11 changes: 0 additions & 11 deletions .github/linters/hadolint.yaml

This file was deleted.

6 changes: 0 additions & 6 deletions .github/linters/jscpd.json

This file was deleted.

13 changes: 0 additions & 13 deletions .github/linters/terrascan.yaml

This file was deleted.

7 changes: 0 additions & 7 deletions .github/linters/yamllint.yaml

This file was deleted.

186 changes: 11 additions & 175 deletions .github/workflows/linter.yml
Original file line number Diff line number Diff line change
@@ -1,192 +1,28 @@
name: Linter

on:
workflow_call:
inputs:
install-all:
description: 'Install dependencies using `install-all`'
required: false
type: boolean
default: false
use-bun:
description: 'Use Bun instead of yarn'
required: false
type: boolean
default: false
generate-keys:
description: 'Whether to run command for dummy key generation'
required: false
type: boolean
default: false
log-level:
description: 'Which log level to use for `super-linter`'
required: false
type: string
default: 'VERBOSE'
validate-all-codebase:
description: 'Whether to run validation on all files'
required: false
type: boolean
default: true
javascript-es-config-file:
description: 'Path to the ESLint configuration file'
required: false
type: string
default: '/eslint.config.mjs'

env:
CSS_FILE_NAME: /.stylelintrc.json
DEFAULT_BRANCH: main
DOCKERFILE_HADOLINT_FILE_NAME: /.utils/.github/linters/hadolint.yaml
EDITORCONFIG_FILE_NAME: /.editorconfig
FILTER_REGEX_EXCLUDE: .*(ati-smarttag.js|skycons.js|.github/workflows/*|docs/ARCHITECTURE/*|traffic/sftp/*|tmp/*|.mp3|.php|.gpg|.drawio|demo.ejs)
IGNORE_GITIGNORED_FILES: true
JAVASCRIPT_DEFAULT_STYLE: prettier
JAVASCRIPT_ES_CONFIG_FILE: ${{ inputs.javascript-es-config-file }}
JSCPD_CONFIG_FILE: /.utils/.github/linters/jscpd.json
KUBERNETES_KUBEVAL_OPTIONS: --ignore-missing-schemas
LINTER_RULES_PATH: /
# options: ERROR, WARN, NOTICE, VERBOSE, DEBUG or TRACE
LOG_LEVEL: ${{ inputs.log-level }}
MARKDOWN_CONFIG_FILE: /.markdownlint.yaml
NODE_VERSION: 20
TERRAFORM_TERRASCAN_CONFIG_FILE: /.utils/.github/linters/terrascan.yaml
VALIDATE_ALL_CODEBASE: ${{ inputs.validate-all-codebase }}
VALIDATE_ANSIBLE: false
VALIDATE_ARM: false
# VALIDATE_BASH: true
# VALIDATE_BASH_EXEC: true
VALIDATE_CPP: false
VALIDATE_CLANG_FORMAT: false
VALIDATE_CLOJURE: false
VALIDATE_CLOUDFORMATION: false
VALIDATE_COFFEESCRIPT: false
VALIDATE_CSHARP: false
VALIDATE_CSS: false
VALIDATE_DART: false
# VALIDATE_DOCKERFILE_HADOLINT: true
# VALIDATE_EDITORCONFIG: true
# VALIDATE_ENV: true
VALIDATE_GHERKIN: false
# VALIDATE_GITHUB_ACTIONS: true
# VALIDATE_GITLEAKS: true
VALIDATE_GO: false
VALIDATE_GOOGLE_JAVA_FORMAT: false
VALIDATE_GROOVY: false
# VALIDATE_HTML: true
VALIDATE_JAVA: false
# VALIDATE_JAVASCRIPT_ES: true
# VALIDATE_JAVASCRIPT_STANDARD: true
# VALIDATE_JSCPD: true
# VALIDATE_JSON: true
# VALIDATE_JSX: true
VALIDATE_KOTLIN: false
VALIDATE_KOTLIN_ANDROID: false
# VALIDATE_KUBERNETES_KUBEVAL: true
VALIDATE_LATEX: false
VALIDATE_LUA: false
# VALIDATE_MARKDOWN: true
# VALIDATE_NATURAL_LANGUAGE: true
VALIDATE_OPENAPI: false
VALIDATE_PERL: false
VALIDATE_PHP: false
VALIDATE_PHP_BUILTIN: false
VALIDATE_PHP_PHPCS: false
VALIDATE_PHP_PHPSTAN: false
VALIDATE_PHP_PSALM: false
# VALIDATE_POWERSHELL: true
VALIDATE_PROTOBUF: false
VALIDATE_PYTHON: false
VALIDATE_PYTHON_BLACK: false
VALIDATE_PYTHON_FLAKE8: false
VALIDATE_PYTHON_ISORT: false
VALIDATE_PYTHON_MYPY: false
VALIDATE_PYTHON_PYLINT: false
VALIDATE_R: false
VALIDATE_RAKU: false
VALIDATE_RUBY: false
VALIDATE_RUST_2015: false
VALIDATE_RUST_2018: false
VALIDATE_RUST_2021: false
VALIDATE_RUST_CLIPPY: false
VALIDATE_SCALAFMT: false
VALIDATE_SHELL_SHFMT: false
VALIDATE_SNAKEMAKE_LINT: false
VALIDATE_SNAKEMAKE_SNAKEFMT: false
VALIDATE_STATES: false
VALIDATE_SQL: false
VALIDATE_SQLFLUFF: false
VALIDATE_TEKTON: false
# VALIDATE_TERRAFORM_TERRASCAN: true
# VALIDATE_TERRAFORM_TFLINT: true
VALIDATE_TERRAGRUNT: false
# VALIDATE_TSX: true
# VALIDATE_TYPESCRIPT_ES: true
# VALIDATE_TYPESCRIPT_STANDARD: true
# VALIDATE_XML: true
# VALIDATE_YAML: true
YAML_CONFIG_FILE: /.utils/.github/linters/yamllint.yaml
workflow_dispatch:
pull_request:

jobs:
build:
name: Lint Code Base
runs-on: ubuntu-latest-4-cores
timeout-minutes: 90
permissions:
contents: read
statuses: write
lint:
runs-on: ubuntu-latest
steps:
- name: 👀 Checkout repository
uses: actions/checkout@v4
with:
persist-credentials: true

- name: 👀 Checkout utils into subfolder
- name: 👀 Checkout Code
uses: actions/checkout@v4
with:
persist-credentials: false
repository: swrlab/node-utils
ref: 'main'
path: '.utils'

- name: 🏗 Install Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}

- name: 🛠 Setup Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: latest

- name: 📦 Enable Corepack
run: corepack enable

- name: 🛠 Use Bun (if `use-bun`)
if: inputs.use-bun == true
run: bun install

- name: 📦 Install Dependencies (if `install:all`)
if: inputs.install-all == true
run: yarn -v && yarn && yarn install:all

- name: 📦 Install Dependencies (if `install`)
if: inputs.install-all != true && inputs.use-bun != true
run: yarn install

- name: 🔑 Generate dummy keys (via yarn)
if: inputs.generate-keys == true && inputs.use-bun != true
run: yarn keys:generate

- name: 🔑 Generate dummy keys (via bun)
if: inputs.generate-keys == true && inputs.use-bun == true
run: bun run keys:generate
- name: 📦 Install Dependencies
run: bun install --frozen-lockfile

- name: 📚 Lint Code Base
uses: docker://github/super-linter:v4
with:
context: .
cache-from: type=gha
cache-to: type=gha,mode=max
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: bun run lint

- name: 📚 Run Tests
run: bun run test
35 changes: 0 additions & 35 deletions .markdownlint.yaml

This file was deleted.

20 changes: 0 additions & 20 deletions .stylelintrc.json

This file was deleted.

3 changes: 0 additions & 3 deletions .yarnrc.yml

This file was deleted.

Loading

0 comments on commit 15d9fc2

Please sign in to comment.