You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CODE_OF_CONDUCT.md
+18-6Lines changed: 18 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,9 @@
2
2
3
3
## Our Pledge
4
4
5
-
In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.
5
+
In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project
6
+
and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression,
7
+
level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.
6
8
7
9
## Our Standards
8
10
@@ -24,19 +26,29 @@ Examples of unacceptable behavior by participants include:
24
26
25
27
## Our Responsibilities
26
28
27
-
Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior.
29
+
Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate
30
+
and fair corrective action in response to any instances of unacceptable behavior.
28
31
29
-
Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.
32
+
Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues,
33
+
and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors
34
+
that they deem inappropriate, threatening, offensive, or harmful.
30
35
31
36
## Scope
32
37
33
-
This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.
38
+
This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community.
39
+
Examples of representing a project or community include using an official project e-mail address, posting via an official social media account,
40
+
or acting as an appointed representative at an online or offline event.
41
+
Representation of a project may be further defined and clarified by project maintainers.
34
42
35
43
## Enforcement
36
44
37
-
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at minko@gechev.io. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.
45
+
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at [minko@gechev.io](mailto:minko@gechev.io).
46
+
The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances.
47
+
The project team is obligated to maintain confidentiality with regard to the reporter of an incident.
48
+
Further details of specific enforcement policies may be posted separately.
38
49
39
-
Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.
50
+
Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+6-3Lines changed: 6 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -16,11 +16,14 @@ Prerequisites:
16
16
17
17
## Submitting a Pull Request
18
18
19
-
All submissions, including submissions by project members, require review. We use GitHub pull requests for this purpose. See our [developer guide](DEVELOPING.md) for instructions on building the project.
19
+
All submissions, including submissions by project members, require review. We use GitHub pull requests for this purpose.
20
+
See our [developer guide](DEVELOPING.md) for instructions on building the project.
20
21
21
-
Pull requests (fixes, new features, tests) are a great way to contribute to the project and help us make it better. Ideally, try to keep your PRs as focused as possible and keep your commits atomic and readable.
22
+
Pull requests (fixes, new features, tests) are a great way to contribute to the project and help us make it better.
23
+
Ideally, try to keep your PRs as focused as possible and keep your commits atomic and readable.
22
24
23
-
To avoid disappointment when working on a PR, please ask us first in case someone else is already working on a PR for a change you wished to make. It's always a good idea to file an issue before starting work on a PR unless it's for something minor (such as a typo fix).
25
+
To avoid disappointment when working on a PR, please ask us first in case someone else is already working on a PR for a change you wished to make.
26
+
It's always a good idea to file an issue before starting work on a PR unless it's for something minor (such as a typo fix).
24
27
25
28
We greatly appreciate any attention to tests. These help us validate that new work continues to function as expected over time.
Copy file name to clipboardExpand all lines: DEVELOPING.md
+37-7Lines changed: 37 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,13 +6,15 @@ This document explains how to build, test, and develop features for revive.
6
6
7
7
Clone the project:
8
8
9
-
```
9
+
```bash
10
10
git clone git@github.com:mgechev/revive.git
11
11
cd revive
12
12
```
13
+
13
14
## Build
14
15
15
16
In order to build the project run:
17
+
16
18
```bash
17
19
make build
18
20
```
@@ -33,14 +35,17 @@ This will output debug information to `stderr` and to the log file `revive.log`
33
35
34
36
If you want to develop a new rule, follow as an example the already existing rules in the [rule package](https://github.com/mgechev/revive/tree/master/rule).
35
37
36
-
Each rule needs to implement the `lint.Rule` interface:
38
+
Each rule needs to implement the `lint.Rule` interface:
39
+
37
40
```go
38
41
typeRuleinterface {
39
42
Name() string
40
43
Apply(*File, Arguments) []Failure
41
44
}
42
45
```
46
+
43
47
All rules with a configuration must implement `lint.ConfigurableRule` interface:
48
+
44
49
```go
45
50
typeConfigurableRuleinterface {
46
51
Configure(Arguments) error
@@ -49,9 +54,10 @@ type ConfigurableRule interface {
49
54
50
55
The `Arguments` type is an alias of the type `[]any`. The arguments of the rule are passed from the configuration file.
51
56
52
-
####Example
57
+
### Example
53
58
54
-
Let's suppose we have developed a rule called `BanStructNameRule` which disallow us to name a structure with a given identifier. We can set the banned identifier by using the TOML configuration file:
59
+
Let's suppose we have developed a rule called `BanStructNameRule` which disallow us to name a structure with a given identifier.
60
+
We can set the banned identifier by using the TOML configuration file:
55
61
56
62
```toml
57
63
[rule.ban-struct-name]
@@ -61,10 +67,10 @@ Let's suppose we have developed a rule called `BanStructNameRule` which disallow
61
67
With the snippet above we:
62
68
63
69
- Enable the rule with the name `ban-struct-name`. The `Name()` method of our rule should return a string that matches `ban-struct-name`.
64
-
- Configure the rule with the argument `Foo`. The list of arguments will be passed to `Apply(*File, Arguments)` together with the target file we're linting currently.
65
-
66
-
A sample rule implementation can be found [here](/rule/argument_limit.go).
70
+
- Configure the rule with the argument `Foo`.
71
+
The list of arguments will be passed to `Apply(*File, Arguments)` together with the target file we're linting currently.
67
72
73
+
A sample rule implementation can be [found here](/rule/argument_limit.go).
68
74
69
75
## Development of formatters
70
76
@@ -78,3 +84,27 @@ type Formatter interface {
78
84
Name() string
79
85
}
80
86
```
87
+
88
+
## Lint
89
+
90
+
### Lint Markdown files
91
+
92
+
We are using [markdownlint](https://github.com/DavidAnson/markdownlint) for checking Markdown files.
0 commit comments