From cc26d7c5b82b432f95c872d8c5777422e9a770c4 Mon Sep 17 00:00:00 2001 From: Daniel Freytag Date: Tue, 9 Aug 2022 15:01:52 +0200 Subject: [PATCH] chore: update linting docs --- .github/workflows/linter.yml | 8 +------ docs/LINTING.md | 44 ++++++++++++++++++++++++++++++++++++ 2 files changed, 45 insertions(+), 7 deletions(-) create mode 100644 docs/LINTING.md diff --git a/.github/workflows/linter.yml b/.github/workflows/linter.yml index e321344..0949152 100644 --- a/.github/workflows/linter.yml +++ b/.github/workflows/linter.yml @@ -20,11 +20,6 @@ on: required: false type: string default: 'VERBOSE' - skip-checkout: - description: 'Whether to skip repository checkout in this workflow' - required: false - type: boolean - default: false env: CSS_FILE_NAME: /.stylelintrc.json @@ -129,7 +124,6 @@ jobs: statuses: write steps: - name: 👀 Checkout repository - if: inputs.skip-checkout != true uses: actions/checkout@v3 with: persist-credentials: false @@ -139,7 +133,7 @@ jobs: with: persist-credentials: false repository: swrlab/node-utils - ref: 'dev/prettier-upgrade' + ref: 'main' path: '.utils' - name: ⛺️ Install Node.js diff --git a/docs/LINTING.md b/docs/LINTING.md new file mode 100644 index 0000000..d6a3e6b --- /dev/null +++ b/docs/LINTING.md @@ -0,0 +1,44 @@ +# Super Linter for SWR Audio Lab + +To simplify linting, this repository contains a template, that can be used by all SWR Audio Lab projects. + +- [Super Linter for SWR Audio Lab](#super-linter-for-swr-audio-lab) + - [Super Linter](#super-linter) + - [Usage](#usage) + - [Configuration](#configuration) + +## Super Linter + +The used linter of choice here is `super-linter`, which bundles a lot of different projects. Some that are really not needed are disabled in the config. + +Super Linter: [github.com/github/super-linter](https://github.com/github/super-linter) + +## Usage + +Simply create a file `.github/workflows/linter.yml`: + +```yaml +name: Linter + +on: + workflow_dispatch: + pull_request: + +jobs: + lint: + uses: swrlab/node-utils/.github/workflows/linter.yml + with: + install-all: true + generate-keys: true +``` + +This uses GitHub's re-usable Actions workflow and call the template using the provided input variables: + +- `install-all` - If `true` it will use `yarn install:all` instead of `yarn install` to trigger a custom script. + This is useful, if the repository has multiple sub-folders that all need to be installed +- `generate-keys` - If `true` will call `yarn keys:generate` to run a custom script for dummy key creation. +- `log-level` - One of the follorwing: `ERROR`, `WARN`, `NOTICE`, `VERBOSE`, `DEBUG` or `TRACE`; defaults to `VERBOSE`. + +## Configuration + +To prevent copying configuration files to every repository, all `super-linter` options are included in this one ([`.github/linters`](./../.github/linters/)) and get cloned into every run.