Fix syntax highlighting for bash scripts (#1151)
Fix syntax highlighting for bash scripts by changing language from bash to sh in triple-backtick blocks: ```bash -> ```sh. Some of these blocks had command output or prompt as part of the listening which formatted in odd ways, e.g. colouring every occurrence of the word "for" or "help" in purple. With the sh language specification these wrong colours are gone, so use it.
This commit is contained in:
parent
7c2871c596
commit
ba6476a608
@ -247,7 +247,7 @@ type Issue struct {
|
|||||||
|
|
||||||
We have an abstraction of `result.Processor` to postprocess found issues:
|
We have an abstraction of `result.Processor` to postprocess found issues:
|
||||||
|
|
||||||
```bash
|
```sh
|
||||||
$ tree -L 1 ./pkg/result/processors/
|
$ tree -L 1 ./pkg/result/processors/
|
||||||
./pkg/result/processors/
|
./pkg/result/processors/
|
||||||
├── autogenerated_exclude.go
|
├── autogenerated_exclude.go
|
||||||
@ -299,7 +299,7 @@ A processor can hide issues (`nolint`, `exclude`) or change issues (`path_shorte
|
|||||||
|
|
||||||
We have an abstraction for printint found issues.
|
We have an abstraction for printint found issues.
|
||||||
|
|
||||||
```bash
|
```sh
|
||||||
$ tree -L 1 ./pkg/printers/
|
$ tree -L 1 ./pkg/printers/
|
||||||
./pkg/printers/
|
./pkg/printers/
|
||||||
├── checkstyle.go
|
├── checkstyle.go
|
||||||
|
@ -52,7 +52,7 @@ Netlify deploys the website to production after merging anything to a `master` b
|
|||||||
|
|
||||||
Run:
|
Run:
|
||||||
|
|
||||||
```bash
|
```sh
|
||||||
npm install
|
npm install
|
||||||
npm run start
|
npm run start
|
||||||
```
|
```
|
||||||
@ -68,7 +68,7 @@ But we can add a new linter and need to change a documentation to list the linte
|
|||||||
|
|
||||||
To do it run
|
To do it run
|
||||||
|
|
||||||
```bash
|
```sh
|
||||||
go run ./scripts/expand_website_templates/main.go -only-state
|
go run ./scripts/expand_website_templates/main.go -only-state
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -20,7 +20,7 @@ Fork and clone [golangci-lint](https://github.com/golangci/golangci-lint) reposi
|
|||||||
|
|
||||||
A good way of making sure everything is all right is running the following:
|
A good way of making sure everything is all right is running the following:
|
||||||
|
|
||||||
```bash
|
```sh
|
||||||
make build
|
make build
|
||||||
./golangci-lint run -v
|
./golangci-lint run -v
|
||||||
```
|
```
|
||||||
@ -29,7 +29,7 @@ make build
|
|||||||
|
|
||||||
When you are satisfied with the changes, we suggest you run:
|
When you are satisfied with the changes, we suggest you run:
|
||||||
|
|
||||||
```bash
|
```sh
|
||||||
$ make test
|
$ make test
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -62,12 +62,12 @@ 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:
|
||||||
|
|
||||||
```bash
|
```sh
|
||||||
make assets/github-action-config.json
|
make assets/github-action-config.json
|
||||||
```
|
```
|
||||||
|
|
||||||
2. The latest version in documentation on our website:
|
2. The latest version in documentation on our website:
|
||||||
|
|
||||||
```bash
|
```sh
|
||||||
make expand_website_templates
|
make expand_website_templates
|
||||||
```
|
```
|
||||||
|
@ -48,7 +48,7 @@ We measure peak memory usage (RSS) by tracking of processes RSS every 5 ms.
|
|||||||
|
|
||||||
We compare golangci-lint and gometalinter in default mode, but explicitly enable all linters because of small differences in the default configuration.
|
We compare golangci-lint and gometalinter in default mode, but explicitly enable all linters because of small differences in the default configuration.
|
||||||
|
|
||||||
```bash
|
```sh
|
||||||
$ golangci-lint run --no-config --issues-exit-code=0 --timeout=30m \
|
$ golangci-lint run --no-config --issues-exit-code=0 --timeout=30m \
|
||||||
--disable-all --enable=deadcode --enable=gocyclo --enable=golint --enable=varcheck \
|
--disable-all --enable=deadcode --enable=gocyclo --enable=golint --enable=varcheck \
|
||||||
--enable=structcheck --enable=maligned --enable=errcheck --enable=dupl --enable=ineffassign \
|
--enable=structcheck --enable=maligned --enable=errcheck --enable=dupl --enable=ineffassign \
|
||||||
|
@ -8,13 +8,13 @@ Slice options (e.g. list of enabled/disabled linters) are combined from the comm
|
|||||||
|
|
||||||
To see a list of enabled by your configuration linters:
|
To see a list of enabled by your configuration linters:
|
||||||
|
|
||||||
```bash
|
```sh
|
||||||
golangci-lint linters
|
golangci-lint linters
|
||||||
```
|
```
|
||||||
|
|
||||||
## Command-Line Options
|
## Command-Line Options
|
||||||
|
|
||||||
```bash
|
```sh
|
||||||
golangci-lint run -h
|
golangci-lint run -h
|
||||||
{.RunHelpText}
|
{.RunHelpText}
|
||||||
```
|
```
|
||||||
|
@ -26,7 +26,7 @@ It's highly recommended to install a specific version of golangci-lint available
|
|||||||
|
|
||||||
Here is the recommended way to install golangci-lint {.LatestVersion}:
|
Here is the recommended way to install golangci-lint {.LatestVersion}:
|
||||||
|
|
||||||
```bash
|
```sh
|
||||||
# binary will be $(go env GOPATH)/bin/golangci-lint
|
# binary will be $(go env GOPATH)/bin/golangci-lint
|
||||||
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin {.LatestVersion}
|
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin {.LatestVersion}
|
||||||
|
|
||||||
@ -48,14 +48,14 @@ and is constantly being improved. For any problems with `golangci-lint`, check o
|
|||||||
|
|
||||||
You can also install a binary release on macOS using [brew](https://brew.sh/):
|
You can also install a binary release on macOS using [brew](https://brew.sh/):
|
||||||
|
|
||||||
```bash
|
```sh
|
||||||
brew install golangci/tap/golangci-lint
|
brew install golangci/tap/golangci-lint
|
||||||
brew upgrade golangci/tap/golangci-lint
|
brew upgrade golangci/tap/golangci-lint
|
||||||
```
|
```
|
||||||
|
|
||||||
### Docker
|
### Docker
|
||||||
|
|
||||||
```bash
|
```sh
|
||||||
docker run --rm -v $(pwd):/app -w /app golangci/golangci-lint:{.LatestVersion} golangci-lint run -v
|
docker run --rm -v $(pwd):/app -w /app golangci/golangci-lint:{.LatestVersion} golangci-lint run -v
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -63,7 +63,7 @@ docker run --rm -v $(pwd):/app -w /app golangci/golangci-lint:{.LatestVersion} g
|
|||||||
|
|
||||||
Go source installations are supported for the two most recent Go releases.
|
Go source installations are supported for the two most recent Go releases.
|
||||||
|
|
||||||
```bash
|
```sh
|
||||||
go get github.com/golangci/golangci-lint/cmd/golangci-lint@{.LatestVersion}
|
go get github.com/golangci/golangci-lint/cmd/golangci-lint@{.LatestVersion}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -4,7 +4,7 @@ title: Linters
|
|||||||
|
|
||||||
To see a list of supported linters and which linters are enabled/disabled:
|
To see a list of supported linters and which linters are enabled/disabled:
|
||||||
|
|
||||||
```bash
|
```sh
|
||||||
golangci-lint help linters
|
golangci-lint help linters
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -4,19 +4,19 @@ title: Quick Start
|
|||||||
|
|
||||||
To run golangci-lint execute:
|
To run golangci-lint execute:
|
||||||
|
|
||||||
```bash
|
```sh
|
||||||
golangci-lint run
|
golangci-lint run
|
||||||
```
|
```
|
||||||
|
|
||||||
It's an equivalent of executing:
|
It's an equivalent of executing:
|
||||||
|
|
||||||
```bash
|
```sh
|
||||||
golangci-lint run ./...
|
golangci-lint run ./...
|
||||||
```
|
```
|
||||||
|
|
||||||
You can choose which directories and files to analyze:
|
You can choose which directories and files to analyze:
|
||||||
|
|
||||||
```bash
|
```sh
|
||||||
golangci-lint run dir1 dir2/... dir3/file1.go
|
golangci-lint run dir1 dir2/... dir3/file1.go
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -24,14 +24,14 @@ Directories are NOT analyzed recursively. To analyze them recursively append `/.
|
|||||||
|
|
||||||
GolangCI-Lint can be used with zero configuration. By default the following linters are enabled:
|
GolangCI-Lint can be used with zero configuration. By default the following linters are enabled:
|
||||||
|
|
||||||
```bash
|
```sh
|
||||||
$ golangci-lint help linters
|
$ golangci-lint help linters
|
||||||
{.LintersCommandOutputEnabledOnly}
|
{.LintersCommandOutputEnabledOnly}
|
||||||
```
|
```
|
||||||
|
|
||||||
and the following linters are disabled by default:
|
and the following linters are disabled by default:
|
||||||
|
|
||||||
```bash
|
```sh
|
||||||
$ golangci-lint help linters
|
$ golangci-lint help linters
|
||||||
...
|
...
|
||||||
{.LintersCommandOutputDisabledOnly}
|
{.LintersCommandOutputDisabledOnly}
|
||||||
@ -39,6 +39,6 @@ $ golangci-lint help linters
|
|||||||
|
|
||||||
Pass `-E/--enable` to enable linter and `-D/--disable` to disable:
|
Pass `-E/--enable` to enable linter and `-D/--disable` to disable:
|
||||||
|
|
||||||
```bash
|
```sh
|
||||||
golangci-lint run --disable-all -E errcheck
|
golangci-lint run --disable-all -E errcheck
|
||||||
```
|
```
|
||||||
|
Loading…
x
Reference in New Issue
Block a user