diff --git a/CHANGELOG.md b/CHANGELOG.md index 726cf5a01..693471dda 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -666,7 +666,7 @@ - Allow workflow calls are available in matrix jobs. See [the official announcement](https://github.blog/changelog/2022-08-22-github-actions-improvements-to-reusable-workflows-2/) for more details. ([#197](https://github.com/rhysd/actionlint/issues/197)) ```yaml jobs: - ReuseableMatrixJobForDeployment: + ReusableMatrixJobForDeployment: strategy: matrix: target: [dev, stage, prod] diff --git a/README.md b/README.md index a122ad37f..1966b16b2 100644 --- a/README.md +++ b/README.md @@ -123,7 +123,7 @@ See [the usage document](docs/usage.md) for more details. source, a download script (for CI), supports by several package managers are available. - [Usage](docs/usage.md): How to use `actionlint` command locally or on GitHub Actions, the online playground, an official Docker image, and integrations with reviewdog, Problem Matchers, super-linter, pre-commit, VS Code. -- [Configuration](docs/config.md): How to configure actionlint behavior. Currently the labels of self-hosted runners and the +- [Configuration](docs/config.md): How to configure actionlint behavior. Currently, the labels of self-hosted runners and the configuration variables can be set. - [Go API](docs/api.md): How to use actionlint as Go library. - [References](docs/reference.md): Links to resources. diff --git a/docs/README.md b/docs/README.md index 8dc8ce973..29fa59487 100644 --- a/docs/README.md +++ b/docs/README.md @@ -6,7 +6,7 @@ Documents source, a download script (for CI) are available. - [Usage](usage.md): How to use `actionlint` command locally or on GitHub Actions, the online playground, an official Docker image, and integrations with reviewdog, Problem Matchers, super-linter, pre-commit. -- [Configuration](config.md): How to configure actionlint behavior. Currently only labels of self-hosted runners can be +- [Configuration](config.md): How to configure actionlint behavior. Currently, only labels of self-hosted runners can be configured. - [Go API](api.md): How to use actionlint as Go library. - [References](reference.md): Links to resources. diff --git a/docs/checks.md b/docs/checks.md index 96aebe8ea..daa7a9a68 100644 --- a/docs/checks.md +++ b/docs/checks.md @@ -85,7 +85,7 @@ the workflow run fail. actionlint can detect unexpected keys while parsing workflow syntax and report them as an error. -Key names are basically case sensitive (though some specific key names are case insensitive). This check is useful to catch +Key names are basically case-sensitive (though some specific key names are case-insensitive). This check is useful to catch case-sensitivity mistakes. @@ -98,7 +98,7 @@ on: push jobs: test: strategy: - # ERROR: Matrix name is duplicated. These keys are case insensitive + # ERROR: Matrix name is duplicated. These keys are case-insensitive matrix: version_name: [v1, v2] VERSION_NAME: [V1, V2] @@ -114,7 +114,7 @@ test.yaml:3:3: "runs-on" section is missing in job "test" [syntax-check] | 3 | test: | ^~~~~ -test.yaml:8:9: key "version_name" is duplicated in "matrix" section. previously defined at line:7,col:9. note that key names are case insensitive [syntax-check] +test.yaml:8:9: key "version_name" is duplicated in "matrix" section. previously defined at line:7,col:9. note that key names are case-insensitive [syntax-check] | 8 | VERSION_NAME: [V1, V2] | ^~~~~~~~~~~~~ @@ -124,7 +124,7 @@ test.yaml:8:9: key "version_name" is duplicated in "matrix" section. previously Some mappings must include specific keys. For example, job mappings must include `runs-on:` and `steps:`. -And duplicate keys are not allowed. In workflow syntax, comparing some keys is **case insensitive**. For example, the job ID +And duplicate keys are not allowed. In workflow syntax, comparing some keys is **case-insensitive**. For example, the job ID `test` in lower case and the job ID `TEST` in upper case are not able to exist in the same workflow. actionlint checks these missing required keys and duplicate keys while parsing, and reports an error. @@ -246,7 +246,7 @@ test.yaml:13:38: unexpected end of input while parsing object property dereferen [Playground](https://rhysd.github.io/actionlint#eJx1jTEOwjAMRfeewoqQUgptxZoDMHCLJLJwIYor7LBUvTsNrHT48pfekz9nB3MRah4cxDUAiqL1ArxKlp43XkLJWvrkK/siUZzlZwH01XSAkRjsYVnAEKbEBtbV7ikXOG35L5gqKN+Ec0te6DollNZ23Zg4Pu0Zao0+Eo72uP0weyP3SamEAd+YdahjH8ffRDM=) actionlint lexes and parses expression in `${{ }}` following [the expression syntax document][expr-doc]. It can detect -many syntax errors like invalid characters, missing parens, unexpected end of input, ... +many syntax errors like invalid characters, missing parentheses, unexpected end of input, ... ## Type checks for expression syntax in `${{ }}` @@ -266,7 +266,7 @@ checker. | Strict object | Object whose properties are strictly typed | `{prop1: T1, prop2: T2}` | | Map object | Object who has specific type values like `env` context | `{string => T}` | -Type check by actionlint is more strict than GitHub Actions runtime. +Type check by actionlint is stricter than GitHub Actions runtime. - Only `any` and `number` are allowed to be converted to string implicitly - Implicit conversion to `number` is not allowed @@ -327,7 +327,7 @@ echo '${{ toJSON(github.event) }}' ``` There are two object types internally. One is an object which is strict for properties, which causes a type error when trying to -access unknown properties. And another is an object which is not strict for properties, which allows to access unknown properties. +access unknown properties. And another is an object which is not strict for properties, which allows accessing unknown properties. In the case, accessing unknown property is typed as `any`. When the type check cannot be done statically, the type is deduced to `any` (e.g. return type of `toJSON()`). @@ -443,7 +443,7 @@ The semantics checker can properly handle that In addition, `format()` function has a special check for placeholders in the first parameter which represents the formatting string. -Note that context names and function names are case insensitive. For example, `toJSON` and `toJson` are the same function. +Note that context names and function names are case-insensitive. For example, `toJSON` and `toJson` are the same function. ## Contextual typing for `steps.` objects @@ -799,7 +799,7 @@ However, comparisons between some types are actually meaningless: actionlint checks operands of comparison operators and reports errors in these cases. -There are some additional surprising behaviors, but actioonlint allows them not to cause false positives as much as possible. +There are some additional surprising behaviors, but actionlint allows them not to cause false positives as much as possible. - `0 == null`, `'0' == null`, `false == null` are true since they are implicitly converted to `0 == 0` - `'0' == false` and `0 == false` are true due to the same reason as above @@ -878,7 +878,7 @@ steps: if: ${{ matrix.os == 'windows-latest' }} ``` -The 'Show file content' script is only run by `pwsh` due to `matrix.os == 'windows-latest'` guard. However actionlint does not +The 'Show file content' script is only run by `pwsh` due to `matrix.os == 'windows-latest'` guard. However, actionlint does not know that. It checks the script with shellcheck and it'd probably cause a false-positive (due to file separator). This kind of false positives can be avoided by showing the shell name explicitly. It is also better in terms of maintenance of the workflow. @@ -1146,7 +1146,7 @@ jobs: Output: ``` -test.yaml:4:18: job ID "BAR" duplicates in "needs" section. note that job ID is case insensitive [job-needs] +test.yaml:4:18: job ID "BAR" duplicates in "needs" section. note that job ID is case-insensitive [job-needs] | 4 | needs: [bar, BAR] | ^~~~ @@ -1925,11 +1925,11 @@ jobs: Output: ``` -test.yaml:10:13: step ID "STEP_ID" duplicates. previously defined at line:7,col:13. step ID must be unique within a job. note that step ID is case insensitive [id] +test.yaml:10:13: step ID "STEP_ID" duplicates. previously defined at line:7,col:13. step ID must be unique within a job. note that step ID is case-insensitive [id] | 10 | id: STEP_ID | ^~~~~~~ -test.yaml:12:3: key "TEST" is duplicated in "jobs" section. previously defined at line:3,col:3. note that key names are case insensitive [syntax-check] +test.yaml:12:3: key "TEST" is duplicated in "jobs" section. previously defined at line:3,col:3. note that key names are case-insensitive [syntax-check] | 12 | TEST: | ^~~~~ @@ -1937,7 +1937,7 @@ test.yaml:12:3: key "TEST" is duplicated in "jobs" section. previously defined a [Playground](https://rhysd.github.io/actionlint#eJzLz7NSKCgtzuDKyk8qtuJSUChJLS4B0QoKRaV5xbr5QPnSpNK8klLdnESQHFiquCS1oBiiSkFBF6TSSiE1OSNfQT0jNScnXx0qo6CQmWIFVhyfmYJNdVJlKqra4BDXgHhPF6BYiGtwCE3cAQCKgUNq) -Job IDs and step IDs in each jobs must be unique. IDs are compared in case insensitive. actionlint checks all job IDs +Job IDs and step IDs in each jobs must be unique. IDs are compared in case-insensitive. actionlint checks all job IDs and step IDs, and reports errors when some IDs duplicate. @@ -2019,7 +2019,7 @@ test.yaml:7:7: environment variable name "FOO BAR" is invalid. '&', '=' and spac [Playground](https://rhysd.github.io/actionlint#eJzLz7NSKCgtzuDKyk8qtuJSUChJLS4B0QoKRaV5xbr5QPnSpNK8klLdnESQHFgqNa8MokZBwc3f39bJMchKIS0/HyGkgCJUXJJaUAzToAsy2EohNTkjX0E9IzUnJ18dAPhYJMc=) `=` must not be included in environment variable names. And `&` and spaces should not be included in them. In almost all -cases they are mistakes and they may cause some issues on using them in shell since they have special meaning in shell syntax. +cases they are mistakes, and they may cause some issues on using them in shell since they have special meaning in shell syntax. actionlint checks environment variable names are correct in `env:` configuration. @@ -2604,7 +2604,7 @@ test.yaml:24:33: calling function "success" is not allowed here. "success" is on [Playground](https://rhysd.github.io/actionlint#eJx9jkEOgjAURPc9xSxM1AUcoBvjwqVuPAGUr6DQkv5flRDvLhVRExO7aWbmTTvOarSBS6XIXrQCduvtRsOXHRdKnVzO0RRiiTfA4jOhYzcqoMnEV7dJAUXlyYjz3ccCEsz6HsdKypCnV+fPh9pdcb//ID5YSz4VatopHixO3LAy5MFKSOosjnlGr8XxjKvjE4OZRjX1WajlCUu+O/97r781yJQO830whphXT5ZHsVgO8PxNVwf9SR5WsV7P) -Some contexts are only available in some places. For example, `env` context is not available at `jobs..env` but it is +Some contexts are only available in some places. For example, `env` context is not available at `jobs..env`, but it is available at `jobs..steps.env`. Similarly, some status functions are special since they limit where they can be called. For example, `success()`, `failure()`, @@ -2718,7 +2718,7 @@ test.yaml:26:13: if: condition "${{ github.event_name == 'push' }} && ${{ github [Playground](https://rhysd.github.io/actionlint#eJy1j00OgjAQhfec4oUYusIDNGHlQQzoIDW2JXTqBrm7FP8wJogaV5PJ+/K9GWskau+qKNrbwskIYHIcJtB441LbA77whn16yEM2RI6pdhcKSAMpQZvKQqys1oqh3KClrbhCgColFm2LneLKF0s6kuG1yTUhyyACLdB1nztP9w1T7t/E/zg8fi9FPEcLttC5Ms/6KXOS3OKGykc4lnzROOOfvnhEvZb3zBmiAMLK) Evaluation of `${{ }}` at `if:` condition is tricky. When the expression in `${{ }}` is evaluated to boolean value and there is -no extra characters around the `${{ }}`, the condition is evaluated to the boolean value. Otherwise the condition is treated as +no extra characters around the `${{ }}`, the condition is evaluated to the boolean value. Otherwise, the condition is treated as string hence it is **always** evaluated to `true`. It means that multi-line string must not be used at `if:` condition (`if: |`) because the condition is always evaluated to true. @@ -2832,7 +2832,7 @@ actionlint checks metadata files used in workflows and reports errors when they - Icon color at `color:` in `branding:` section is correct. Supported icon colors are white, yellow, blue, green, orange, red, purple, or gray-dark. -actionlint checks action metadata files which are used by workflows. Currently it is not supported to specify `action.yml` +actionlint checks action metadata files which are used by workflows. Currently, it is not supported to specify `action.yml` directly via command line arguments. Note that `steps` in Composite action's metadata is not checked at this point. It will be supported in the future. diff --git a/docs/install.md b/docs/install.md index 22dd9922d..a37d3cf6d 100644 --- a/docs/install.md +++ b/docs/install.md @@ -7,7 +7,7 @@ This document describes how to install [actionlint](../docs). ### [Chocolatey](https://chocolatey.org/) -[`actionlint` package][chocolatey] is available in the community repo: +[`actionlint` package][chocolatey] is available in the community repository: ```powershell choco install actionlint @@ -23,7 +23,7 @@ scoop install actionlint ### [Winget](https://learn.microsoft.com/en-us/windows/package-manager/) -[`actionlint` package][winget] is available in the winget-pkgs repo: +[`actionlint` package][winget] is available in the winget-pkgs repository: ```powershell winget install actionlint @@ -33,7 +33,7 @@ winget install actionlint ### [Arch Linux](https://archlinux.org/) -[`actionlint` package][archlinux] is available in the official repo: +[`actionlint` package][archlinux] is available in the official repository: ```sh pacman -S actionlint @@ -70,7 +70,7 @@ nix-env -iA nixpkgs.actionlint brew install actionlint ``` -Alternatively rhysd/actionlint repository also provides its own Homebrew package, which is automatically updated on new release. +Alternatively, rhysd/actionlint repository also provides its own Homebrew package, which is automatically updated on new release. If you prefer it, tap the repository before running `brew install`. ```sh diff --git a/docs/usage.md b/docs/usage.md index 6e769fd6c..d09b5ef9a 100644 --- a/docs/usage.md +++ b/docs/usage.md @@ -176,7 +176,7 @@ line is 21, col is 20, message is "property \"platform\" is not defined in objec In `{{ }}` placeholder, input can be piped and action can be used to transform texts. In above example, the message is piped with `|` and transformed with `printf "%q"`. -Note that special characters escaped with back slash like `\n` in the format string are automatically unespcaed. +Note that special characters escaped with backslash like `\n` in the format string are automatically unescaped. ### Exit status @@ -255,7 +255,7 @@ jobs: ## Online playground -Thanks to WebAssembly, actionlint playground is available on your browser. It never sends any data to outside of your browser. +Thanks to WebAssembly, actionlint playground is available on your browser. It never sends any data to outside your browser. https://rhysd.github.io/actionlint/ @@ -428,7 +428,7 @@ or if you'd like a specific version: trunk check enable actionlint@1.7.1 ``` -or modify `.trunk/trunk.yaml` in your repo to contain: +or modify `.trunk/trunk.yaml` in your repository to contain: ```yaml lint: diff --git a/linter.go b/linter.go index 0d440f73d..b438f4445 100644 --- a/linter.go +++ b/linter.go @@ -497,7 +497,7 @@ func (l *Linter) check( var cfg *Config if l.defaultConfig != nil { - // `-config-file` option has higher prioritiy than repository config file + // `-config-file` option has higher priority than repository config file cfg = l.defaultConfig } else if project != nil { cfg = project.Config() diff --git a/rule_expression.go b/rule_expression.go index 3c874e077..7365e6ca7 100644 --- a/rule_expression.go +++ b/rule_expression.go @@ -781,7 +781,7 @@ func (rule *RuleExpression) checkSemanticsOfExprNode(expr ExprNode, line, col in if workflowKey != "" { ctx, sp := WorkflowKeyAvailability(workflowKey) if len(ctx) == 0 { - rule.Debug("No context avaiability was found for workflow key %q", workflowKey) + rule.Debug("No context availability was found for workflow key %q", workflowKey) } c.SetContextAvailability(ctx) c.SetSpecialFunctionAvailability(sp) diff --git a/rule_matrix.go b/rule_matrix.go index 2abc97e9f..178ee5ba9 100644 --- a/rule_matrix.go +++ b/rule_matrix.go @@ -70,7 +70,7 @@ func (rule *RuleMatrix) checkDuplicateInRow(row *MatrixRow) { } func isYAMLValueSubset(v, sub RawYAMLValue) bool { - // When the filter side is dynamically contructed with some expression, it is not possible to statically check if the filter + // When the filter side is dynamically constructed with some expression, it is not possible to statically check if the filter // matches the value. To avoid false positives, assume such filter always matches to the value. (#414) // ``` // matrix: diff --git a/testdata/err/workflow_dispatch_input_types.yaml b/testdata/err/workflow_dispatch_input_types.yaml index 2583ebcab..51777c728 100644 --- a/testdata/err/workflow_dispatch_input_types.yaml +++ b/testdata/err/workflow_dispatch_input_types.yaml @@ -1,5 +1,5 @@ name: Test for workflow_dispatch input types (part1) -# Note: Maxium number of inputs is 10. Continues to workflow_dispatch_input_types_2.yaml +# Note: Maximum number of inputs is 10. Continues to workflow_dispatch_input_types_2.yaml # https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#providing-inputs on: workflow_dispatch: diff --git a/testdata/err/workflow_dispatch_type_check_inputs.yaml b/testdata/err/workflow_dispatch_type_check_inputs.yaml index eeee87580..67903d6d2 100644 --- a/testdata/err/workflow_dispatch_type_check_inputs.yaml +++ b/testdata/err/workflow_dispatch_type_check_inputs.yaml @@ -19,7 +19,7 @@ jobs: test: runs-on: ubuntu-latest steps: - # Unkown input name + # Unknown input name - run: echo "${{ inputs.select }}" - run: echo "${{ github.event.inputs.select }}" # Bool value is not available for object key diff --git a/testdata/ok/workflow_call_with_strategy.yaml b/testdata/ok/workflow_call_with_strategy.yaml index 7b78ff128..b23a36e77 100644 --- a/testdata/ok/workflow_call_with_strategy.yaml +++ b/testdata/ok/workflow_call_with_strategy.yaml @@ -9,7 +9,7 @@ on: push: jobs: - ReuseableMatrixJobForDeployment: + ReusableMatrixJobForDeployment: strategy: matrix: target: [dev, stage, prod]