Skip to content

Commit

Permalink
Merge pull request #432 from ccoVeille/typos-suggestion
Browse files Browse the repository at this point in the history
chore: fix typos and style
  • Loading branch information
rhysd committed Jun 7, 2024
2 parents 543d4bd + f5d12aa commit ec17fff
Show file tree
Hide file tree
Showing 12 changed files with 34 additions and 34 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
36 changes: 18 additions & 18 deletions docs/checks.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
<a name="check-missing-required-duplicate-keys"></a>
Expand All @@ -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]
Expand All @@ -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]
| ^~~~~~~~~~~~~
Expand All @@ -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.
Expand Down Expand Up @@ -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, ...

<a name="check-type-check-expression"></a>
## Type checks for expression syntax in `${{ }}`
Expand All @@ -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
Expand Down Expand Up @@ -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()`).
Expand Down Expand Up @@ -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.

<a name="check-contextual-step-object"></a>
## Contextual typing for `steps.<step_id>` objects
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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.

Expand Down Expand Up @@ -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]
| ^~~~
Expand Down Expand Up @@ -1925,19 +1925,19 @@ 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:
| ^~~~~
```

[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.

<a name="check-hardcoded-credentials"></a>
Expand Down Expand Up @@ -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.

Expand Down Expand Up @@ -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.<job_id>.env` but it is
Some contexts are only available in some places. For example, `env` context is not available at `jobs.<job_id>.env`, but it is
available at `jobs.<job_id>.steps.env`.

Similarly, some status functions are special since they limit where they can be called. For example, `success()`, `failure()`,
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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.
Expand Down
8 changes: 4 additions & 4 deletions docs/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions docs/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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/

Expand Down Expand Up @@ -428,7 +428,7 @@ or if you'd like a specific version:
trunk check enable [email protected]
```

or modify `.trunk/trunk.yaml` in your repo to contain:
or modify `.trunk/trunk.yaml` in your repository to contain:

```yaml
lint:
Expand Down
2 changes: 1 addition & 1 deletion linter.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
2 changes: 1 addition & 1 deletion rule_expression.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion rule_matrix.go
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion testdata/err/workflow_dispatch_input_types.yaml
Original file line number Diff line number Diff line change
@@ -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:
Expand Down
2 changes: 1 addition & 1 deletion testdata/err/workflow_dispatch_type_check_inputs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion testdata/ok/workflow_call_with_strategy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:
push:

jobs:
ReuseableMatrixJobForDeployment:
ReusableMatrixJobForDeployment:
strategy:
matrix:
target: [dev, stage, prod]
Expand Down

0 comments on commit ec17fff

Please sign in to comment.