From 64aeea034ec5e6b7d3365e3a0517dba44bdc939f Mon Sep 17 00:00:00 2001 From: Luca Comellini Date: Sun, 14 Apr 2024 17:31:33 -0700 Subject: [PATCH] Add linters --- .editorconfig | 13 +++++++++++++ .github/workflows/lint.yml | 25 ++++++++++++++++++++++++- .markdownlint-cli2.yaml | 18 ++++++++++++++++++ README.md | 34 +++++++++++++++++----------------- 4 files changed, 72 insertions(+), 18 deletions(-) create mode 100644 .editorconfig create mode 100644 .markdownlint-cli2.yaml diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..302cfc4 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,13 @@ +root = true + +[*] +charset = utf-8 +end_of_line = lf +insert_final_newline = true +trim_trailing_whitespace = true +indent_size = 4 +indent_style = tab + +[*.{md,yml,yaml}] +indent_size = 2 +indent_style = space diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 40ba23f..36aac7f 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -7,7 +7,6 @@ on: - main jobs: - lint: runs-on: ubuntu-latest steps: @@ -18,3 +17,27 @@ jobs: npm run format-check - run: | npm run lint + + actionlint: + name: Actionlint + runs-on: ubuntu-22.04 + steps: + - name: Checkout Repository + uses: actions/checkout@v4 + + - uses: reviewdog/action-actionlint@v1 + with: + actionlint_flags: -shellcheck "" + + markdown-lint: + name: Markdown Lint + runs-on: ubuntu-22.04 + steps: + - name: Checkout Repository + uses: actions/checkout@v4 + + - uses: DavidAnson/markdownlint-cli2-action@v16 + with: + config: .markdownlint-cli2.yaml + globs: '**/*.md' + fix: false diff --git a/.markdownlint-cli2.yaml b/.markdownlint-cli2.yaml new file mode 100644 index 0000000..5f4aea4 --- /dev/null +++ b/.markdownlint-cli2.yaml @@ -0,0 +1,18 @@ +# Rule configuration. +# For rule descriptions and how to fix: https://github.com/DavidAnson/markdownlint/tree/main#rules--aliases +config: + ul-style: + style: dash + no-duplicate-heading: + siblings_only: true + line-length: + line_length: 500 + code_blocks: false + tables: false + +# Define glob expressions to ignore +ignores: + - '.github/**' + +# Fix any fixable errors +fix: true diff --git a/README.md b/README.md index b84a164..07b22aa 100644 --- a/README.md +++ b/README.md @@ -33,35 +33,35 @@ jobs: with: minor-label: 'enhancement' major-label: 'change' - ``` ## Inputs -| Name | Type | Description | -| --- | --- | --- | -| `github-token` | `string` | The GitHub token to use for the release. (default `github.token`) | -| `minor-label` | `string` | The label to use for minor releases. (default `enhancement`) | -| `major-label` | `string` | The label to use for major releases. (default `change`) | -| `notes-header` | `string` | The header to use for the release notes. | -| `notes-footer` | `string` | The footer to use for the release notes. | -| `variables` | `list` | A list of variables to use in the header and footer. | -| `publish` | `boolean` | Whether to publish the release. (default `false`) | +| Name | Type | Description | +| -------------- | --------- | ----------------------------------------------------------------- | +| `github-token` | `string` | The GitHub token to use for the release. (default `github.token`) | +| `minor-label` | `string` | The label to use for minor releases. (default `enhancement`) | +| `major-label` | `string` | The label to use for major releases. (default `change`) | +| `notes-header` | `string` | The header to use for the release notes. | +| `notes-footer` | `string` | The footer to use for the release notes. | +| `variables` | `list` | A list of variables to use in the header and footer. | +| `publish` | `boolean` | Whether to publish the release. (default `false`) | ## Outputs -| Name | Type | Description | -| --- | --- | --- | -| `version` | `string` | The version number of the next release. | -| `previous-version` | `string` | The version number of the previous release. | -| `release-id` | `string` | The ID of the next release. | -| `release-notes` | `string` | The release notes of the next release. | -| `release-url` | `string` | The URL of the next release. | +| Name | Type | Description | +| ------------------ | -------- | ------------------------------------------------------------------------------------ | +| `version` | `string` | The version number of the next release. | +| `previous-version` | `string` | The version number of the previous release. | +| `release-id` | `string` | The ID of the next release. | +| `release-notes` | `string` | The release notes of the next release. | +| `release-url` | `string` | The URL of the next release. | | `release-sections` | `string` | A JSON output containing the release sections and the pull requests in each section. | ## Header and Footer The header and footer have four special placeholders that will be replaced with the version number of the next release: + - `{{version}}` will be replaced with the version number of the next release. - `{{version-number}}` will be replaced with the version number of the next release without the `v` prefix. - `{{previous-version}}` will be replaced with the version number of the previous release.