Skip to content

Commit

Permalink
fix trailing whitespaces
Browse files Browse the repository at this point in the history
  • Loading branch information
mfederowicz committed Oct 26, 2023
1 parent 8dbd587 commit a36d112
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 11 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -125,14 +125,14 @@ Since the default behavior of `revive` is compatible with `golint`, without prov
`revive` supports a `-config` flag whose value should correspond to a TOML file describing which rules to use for `revive`'s linting. If not provided, `revive` will try to use a global config file (assumed to be located at `$HOME/revive.toml`). Otherwise, if no configuration TOML file is found then `revive` uses a built-in set of default linting rules.

### Docker
A volume needs to be mounted to share the current repository with the container.
A volume needs to be mounted to share the current repository with the container.
Please refer to the [bind mounts Docker documentation](https://docs.docker.com/storage/bind-mounts/)

```bash
docker run -v "$(pwd)":/var/<repository> ghcr.io/mgechev/revive:v1.1.2-next -config /var/<repository>/revive.toml -formatter stylish ./var/kidle/...
```

- `-v` is for the volume
- `-v` is for the volume
- `ghcr.io/mgechev/revive:v1.1.2-next ` is the image name and its version corresponding to `revive` command
- The provided flags are the same as the binary usage.

Expand Down Expand Up @@ -628,11 +628,11 @@ With the snippet above we:
A sample rule implementation can be found [here](/rule/argument-limit.go).

#### Using `revive` as a library
If a rule is specific to your use case
If a rule is specific to your use case
(i.e. it is not a good candidate to be added to `revive`'s rule set) you can add it to your own linter using `revive` as linting engine.

The following code shows how to use `revive` in your own application.
In the example only one rule is added (`myRule`), of course, you can add as many as you need to.
In the example only one rule is added (`myRule`), of course, you can add as many as you need to.
Your rules can be configured programmatically or with the standard `revive` configuration file.
The full rule set of `revive` is also actionable by your application.

Expand Down
6 changes: 3 additions & 3 deletions RULES_DESCRIPTIONS.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ List of all available rules.
- [error-naming](#error-naming)
- [error-return](#error-return)
- [error-strings](#error-strings)
- [errorf](#errorf)
- [errorf](#errorf)
- [exported](#exported)
- [file-header](#file-header)
- [flag-parameter](#flag-parameter)
Expand Down Expand Up @@ -851,8 +851,8 @@ _Description_: This rule warns when [initialism](https://github.com/golang/go/wi

_Configuration_: This rule accepts two slices of strings and one optional slice with single map with named parameters.
(it's due to TOML hasn't "slice of any" and we keep backward compatibility with previous config version)
First slice is a whitelist and second one is a blacklist of initialisms.
In map, you can add "upperCaseConst=true" parameter to allow `UPPER_CASE` for `const`
First slice is a whitelist and second one is a blacklist of initialisms.
In map, you can add "upperCaseConst=true" parameter to allow `UPPER_CASE` for `const`
By default, the rule behaves exactly as the alternative in `golint` but optionally, you can relax it (see [golint/lint/issues/89](https://github.com/golang/lint/issues/89))

Example:
Expand Down
2 changes: 1 addition & 1 deletion config/testdata/enableAllBut2.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ enableAllRules = true
[rule.exported]
disabled=true
[rule.cyclomatic]
disabled=true
disabled=true
2 changes: 1 addition & 1 deletion testdata/confusing-results.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ func getfoo() (int, int, error) { // MATCH /unnamed results of the same type may

}

func getBar(a, b int) (int, error, int) {
func getBar(a, b int) (int, error, int) {
}

func Getbaz(a string, b int) (int, float32, string, string) { // MATCH /unnamed results of the same type may be confusing, consider using named results/
Expand Down
2 changes: 1 addition & 1 deletion testdata/duplicated-imports.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package fixtures

import(
"crypto/md5"
"crypto/md5"
"strings"
_ "crypto/md5" // MATCH /Package "crypto/md5" already imported/
str "strings" // MATCH /Package "strings" already imported/
Expand Down
2 changes: 1 addition & 1 deletion testdata/golint/error-strings.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ func g(x int) error {
err = fmt.Errorf("Newlines are really fun\n") // MATCH /error strings should not be capitalized or end with punctuation or a newline/
err = errors.New(`too much stuff.`) // MATCH /error strings should not be capitalized or end with punctuation or a newline/
err = errors.New("This %d is too low", x) // MATCH /error strings should not be capitalized or end with punctuation or a newline/

// Non-regression test for issue #610
d.stack.Push(from)

Expand Down

0 comments on commit a36d112

Please sign in to comment.