From ca8befdfb6b98e59b2a2d1d65070c6e66a858ae1 Mon Sep 17 00:00:00 2001 From: Fernandez Ludovic Date: Sat, 4 May 2024 02:36:06 +0200 Subject: [PATCH] doc: improve options documentation --- README.md | 32 ++++++++++++++++++++++++-------- 1 file changed, 24 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index b33532660f..abe55b532c 100644 --- a/README.md +++ b/README.md @@ -100,7 +100,9 @@ You will also likely need to add the following `.gitattributes` file to ensure t ## Options -`version`: (required) The version of golangci-lint to use. +### `version` + +(required) The version of golangci-lint to use. * When `install-mode` is `binary` (default) the value can be v1.2 or v1.2.3 or `latest` to use the latest version. * When `install-mode` is `goinstall` the value can be v1.2.3, `latest`, or the hash of a commit. @@ -111,7 +113,9 @@ with: # ... ``` -`install-mode`: (optional) The mode to install golangci-lint. +### `install-mode` + +(optional) The mode to install golangci-lint. It can be `binary` or `goinstall`. The default value is `binary`. @@ -122,7 +126,9 @@ with: # ... ``` -`only-new-issues`: (optional) Show only new issues. +### `only-new-issues` + +(optional) Show only new issues. If you are using `merge_group` event (merge queue) you should add the option `fetch-depth: 0` to `actions/checkout` step. The default value is `false`. @@ -133,7 +139,9 @@ with: # ... ``` -`working-directory`: (optional) working directory, useful for monorepos. +### `working-directory` + +(optional) working directory, useful for monorepos. ```yml uses: golangci/golangci-lint-action@v5 @@ -142,7 +150,9 @@ with: # ... ``` -`skip-cache`: (optional) If set to `true`, then all caching functionality will be completely disabled, +### `skip-cache` + +(optional) If set to `true`, then all caching functionality will be completely disabled, takes precedence over all other caching options. The default value is `false`. @@ -153,7 +163,9 @@ with: # ... ``` -`skip-save-cache`: (optional) If set to `true`, caches will not be saved, but they may still be restored, required `skip-cache: false`. +### `skip-save-cache` + +(optional) If set to `true`, caches will not be saved, but they may still be restored, required `skip-cache: false`. The default value is `false`. ```yml @@ -163,7 +175,9 @@ with: # ... ``` -`annotations`: (optional) To enable/disable GitHub Action annotations. +### `annotations` + +(optional) To enable/disable GitHub Action annotations. If disabled (`false`), the output format(s) will follow the golangci-lint configuration file and use the same default as golangci-lint (i.e. `colored-line-number`). https://golangci-lint.run/usage/configuration/#output-configuration The default value is `true`. @@ -175,7 +189,9 @@ with: # ... ``` -`args`: (optional) golangci-lint command line arguments. +### `args` + +(optional) golangci-lint command line arguments. Note: By default, the `.golangci.yml` file should be at the root of the repository. The location of the configuration file can be changed by using `--config=`