docs: fix typos ()

This commit is contained in:
ccoVeille 2024-05-28 01:47:17 +02:00 committed by GitHub
parent f7387361f7
commit dea416b534
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
13 changed files with 24 additions and 24 deletions
docs/src/docs
pkg
commands
config
golinters
gci
nolintlint/internal
printers
scripts
gen_github_action_config
website/expand_templates
test

@ -24,7 +24,7 @@ Left menu is configured in `src/config/sidebar.yml`.
## Articles ## Articles
Articles are located in `src/docs/` in `*.mdx` files. [MDX](https://mdxjs.com/getting-started/gatsby) is markdown Articles are located in `src/docs/` in `*.mdx` files. [MDX](https://mdxjs.com/getting-started/gatsby) is Markdown
allowing to use `React` components. allowing to use `React` components.
## Templating ## Templating

@ -45,20 +45,20 @@ Push your branch to your `golangci-lint` fork and open a pull request against th
## Pull request checks ## Pull request checks
First, please, accept [CLA](https://gist.github.com/jirfag/26a39fd375da84b2d5ad4296fecb0668) - [cla assistant](https://cla-assistant.io/) will make a comment on the pull request about it. First, please, accept [CLA](https://gist.github.com/jirfag/26a39fd375da84b2d5ad4296fecb0668) - [CLA assistant](https://cla-assistant.io/) will make a comment on the pull request about it.
Also, we run a few checks in CI by using GitHub actions, you can see them [here](https://github.com/golangci/golangci-lint/blob/master/.github/workflows/pr.yml). Also, we run a few checks in CI by using GitHub Actions, you can see them [here](https://github.com/golangci/golangci-lint/blob/master/.github/workflows/pr.yml).
## New releases ## New releases
First, see [our versioning policy](/product/roadmap/#versioning-policy). First, see [our versioning policy](/product/roadmap/#versioning-policy).
To make a new release create a tag `vx.y.z`. Don't forget to add zero patch version for a new minor release, e.g. `v1.99.0`. To make a new release create a tag `vx.y.z`. Don't forget to add zero patch version for a new minor release, e.g. `v1.99.0`.
A GitHub action [workflow](https://github.com/golangci/golangci-lint/blob/master/.github/workflows/tag.yml) will start building and publishing release after that. A GitHub Action [workflow](https://github.com/golangci/golangci-lint/blob/master/.github/workflows/tag.yml) will start building and publishing release after that.
After making a release you need to update: After making a release you need to update:
1. GitHub [action config](https://github.com/golangci/golangci-lint/blob/master/assets/github-action-config.json) by running: 1. GitHub [Action config](https://github.com/golangci/golangci-lint/blob/master/assets/github-action-config.json) by running:
```sh ```sh
make assets/github-action-config.json make assets/github-action-config.json
``` ```

@ -48,7 +48,7 @@ An example linter can be found at [here](https://github.com/golangci/example-plu
If you're looking for instructions on how to configure your own custom linter, they can be found further down. If you're looking for instructions on how to configure your own custom linter, they can be found further down.
1. If the project you want to lint does not have one already, copy the [.golangci.yml](https://github.com/golangci/golangci-lint/blob/master/.golangci.yml) to the root directory. 1. If the project you want to lint does not have one already, copy the [.golangci.yml](https://github.com/golangci/golangci-lint/blob/master/.golangci.yml) to the root directory.
2. Adjust the yaml to appropriate `linters-settings.custom` entries as so: 2. Adjust the YAML to appropriate `linters-settings.custom` entries as so:
```yaml title=.golangci.yml ```yaml title=.golangci.yml
linters-settings: linters-settings:
custom: custom:

@ -36,7 +36,7 @@ curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/insta
# or install it into ./bin/ # or install it into ./bin/
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s {.LatestVersion} curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s {.LatestVersion}
# In alpine linux (as it does not come with curl by default) # In Alpine Linux (as it does not come with curl by default)
wget -O- -nv https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s {.LatestVersion} wget -O- -nv https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s {.LatestVersion}
golangci-lint --version golangci-lint --version
@ -62,7 +62,7 @@ On Windows, you can run the above commands with Git Bash, which comes with [Git
Golangci-lint is available inside the majority of the package managers. Golangci-lint is available inside the majority of the package managers.
### MacOS ### macOS
#### Brew #### Brew
@ -76,8 +76,8 @@ brew install golangci-lint
brew upgrade golangci-lint brew upgrade golangci-lint
``` ```
Note: Previously we used a [homebrew tap](https://github.com/golangci/homebrew-tap). We recommend using official formula instead of the tap, but sometimes the most recent release Note: Previously we used a [Homebrew tap](https://github.com/golangci/homebrew-tap). We recommend using official formula instead of the tap, but sometimes the most recent release
isn't immediately available via homebrew core due to manual updates that need to occur from homebrew core maintainers. In this case, the tap formula, which is updated automatically, isn't immediately available via Homebrew core due to manual updates that need to occur from Homebrew core maintainers. In this case, the tap formula, which is updated automatically,
can be used to install the latest version of `golangci-lint`: can be used to install the latest version of `golangci-lint`:
```sh ```sh
@ -85,10 +85,10 @@ brew tap golangci/tap
brew install golangci/tap/golangci-lint brew install golangci/tap/golangci-lint
``` ```
#### Macports #### MacPorts
It can also be installed through [macports](https://www.macports.org/) It can also be installed through [MacPorts](https://www.macports.org/)
The macports installation mode is community driven, and not officially maintained by golangci team. The MacPorts installation mode is community driven, and not officially maintained by golangci team.
```sh ```sh
sudo port install golangci-lint sudo port install golangci-lint

@ -50,7 +50,7 @@ The following plugins support `golangci-lint`:
## Shell Completion ## Shell Completion
`golangci-lint` can generate bash, fish, powershell, and zsh completion files. `golangci-lint` can generate Bash, fish, PowerShell, and Zsh completion files.
### macOS ### macOS

@ -674,7 +674,7 @@ func computeBinarySalt(version string) ([]byte, error) {
func computeConfigSalt(cfg *config.Config) ([]byte, error) { func computeConfigSalt(cfg *config.Config) ([]byte, error) {
lintersSettingsBytes, err := yaml.Marshal(cfg.LintersSettings) lintersSettingsBytes, err := yaml.Marshal(cfg.LintersSettings)
if err != nil { if err != nil {
return nil, fmt.Errorf("failed to json marshal config linter settings: %w", err) return nil, fmt.Errorf("failed to JSON marshal config linter settings: %w", err)
} }
configData := bytes.NewBufferString("linters-settings=") configData := bytes.NewBufferString("linters-settings=")

@ -9,7 +9,7 @@ import (
"github.com/ldez/gomoddirectives" "github.com/ldez/gomoddirectives"
) )
// Config encapsulates the config data specified in the golangci-lint yaml config file. // Config encapsulates the config data specified in the golangci-lint YAML config file.
type Config struct { type Config struct {
cfgDir string // The directory containing the golangci-lint config file. cfgDir string // The directory containing the golangci-lint config file.

@ -194,7 +194,7 @@ func diffFormattedFilesToArray(paths []string, cfg gcicfg.Config, diffs *[]strin
}) })
} }
// Code bellow this comment is borrowed and modified from gci. // Code below this comment is borrowed and modified from gci.
// https://github.com/daixiang0/gci/blob/4725b0c101801e7449530eee2ddb0c72592e3405/pkg/config/config.go // https://github.com/daixiang0/gci/blob/4725b0c101801e7449530eee2ddb0c72592e3405/pkg/config/config.go
var defaultOrder = map[string]int{ var defaultOrder = map[string]int{

@ -15,7 +15,7 @@ func hash(data []byte) []byte {
} }
``` ```
In the above case, nolint directives are present but the user has no idea why this is being done or which linter In the above case, nolint directives are present, but the user has no idea why this is being done or which linter
is being suppressed (in this case, gosec recommends against use of md5). `nolintlint` can require that the code provide an explanation, which might look as follows: is being suppressed (in this case, gosec recommends against use of md5). `nolintlint` can require that the code provide an explanation, which might look as follows:
```Go ```Go
@ -26,6 +26,6 @@ func hash(data []byte) []byte {
} }
``` ```
`nolintlint` can also identify cases where you may have written `// nolint`. Finally `nolintlint`, can also enforce that you `nolintlint` can also identify cases where you may have written `// nolint`. Finally, `nolintlint`, can also enforce that you
use the machine-readable nolint directive format `//nolint:all` and that you mention what linter is being suppressed, as shown above when we write `//nolint:gosec`. use the machine-readable nolint directive format `//nolint:all` and that you mention what linter is being suppressed, as shown above when we write `//nolint:gosec`.

@ -14,7 +14,7 @@ type GitHubAction struct {
w io.Writer w io.Writer
} }
// NewGitHubAction output format outputs issues according to GitHub actions. // NewGitHubAction output format outputs issues according to GitHub Action.
// Deprecated // Deprecated
func NewGitHubAction(w io.Writer) *GitHubAction { func NewGitHubAction(w io.Writer) *GitHubAction {
return &GitHubAction{w: w} return &GitHubAction{w: w}

@ -225,7 +225,7 @@ func fetchAllReleases(ctx context.Context) ([]release, error) {
for { for {
err := client.Query(ctx, &q, vars) err := client.Query(ctx, &q, vars)
if err != nil { if err != nil {
return nil, fmt.Errorf("failed to fetch releases page from github: %w", err) return nil, fmt.Errorf("failed to fetch releases page from GitHub: %w", err)
} }
releases := q.Repository.Releases releases := q.Repository.Releases
allReleases = append(allReleases, releases.Nodes...) allReleases = append(allReleases, releases.Nodes...)

@ -66,7 +66,7 @@ func processDoc(path string, replacements map[string]string, madeReplacements ma
nextContent := content nextContent := content
nextContent = strings.ReplaceAll(nextContent, fmt.Sprintf("{.%s}", key), replacement) nextContent = strings.ReplaceAll(nextContent, fmt.Sprintf("{.%s}", key), replacement)
// Yaml formatter in mdx code section makes extra spaces, need to match them too. // YAML formatter in mdx code section makes extra spaces, need to match them too.
nextContent = strings.ReplaceAll(nextContent, fmt.Sprintf("{ .%s }", key), replacement) nextContent = strings.ReplaceAll(nextContent, fmt.Sprintf("{ .%s }", key), replacement)
if nextContent != content { if nextContent != content {

@ -113,7 +113,7 @@ func decodeYamlFile(filename string) (any, error) {
var m any var m any
err = yaml.NewDecoder(yamlFile).Decode(&m) err = yaml.NewDecoder(yamlFile).Decode(&m)
if err != nil { if err != nil {
return nil, fmt.Errorf("[%s] yaml decode: %w", filename, err) return nil, fmt.Errorf("[%s] YAML decode: %w", filename, err)
} }
return m, nil return m, nil