Skip to content

Commit 42e4e8b

Browse files
authored
lint: add markdown linter (cometbft#5254)
1 parent 022b255 commit 42e4e8b

52 files changed

Lines changed: 513 additions & 413 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/linter.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Lint
2+
on:
3+
push:
4+
branches:
5+
- master
6+
paths:
7+
- "**.md"
8+
- "**.yml"
9+
- "**.yaml"
10+
pull_request:
11+
branches: [master]
12+
paths:
13+
- "**.md"
14+
15+
jobs:
16+
build:
17+
name: Super linter
18+
runs-on: ubuntu-latest
19+
steps:
20+
- name: Checkout Code
21+
uses: actions/checkout@v2
22+
- name: Lint Code Base
23+
uses: docker://github/super-linter:v3
24+
env:
25+
LINTER_RULES_PATH: .
26+
VALIDATE_ALL_CODEBASE: true
27+
DEFAULT_BRANCH: master
28+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
29+
VALIDATE_MD: true
30+
MARKDOWN_CONFIG_FILE: .markdownlint.yml
31+
VALIDATE_OPAENAPI: true
32+
VALIDATE_YAML: true

.markdownlint.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
default: true,
2+
MD007: { "indent": 4 }
3+
MD013: false
4+
MD024: { siblings_only: true }
5+
MD025: false
6+
MD033: { no-inline-html: false }
7+
no-hard-tabs: false
8+
whitespace: false

.markdownlintignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
docs/node_modules
2+
CHANGELOG.md
3+
docs/architecture/*
4+
crypto/secp256k1/internal/secp256k1/*
5+
scripts/*

CHANGELOG_PENDING.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
1-
## v0.34.0-rc4
1+
# v0.34.0-rc4
22

33
Special thanks to external contributors on this release:
44

55
Friendly reminder, we have a [bug bounty program](https://hackerone.com/tendermint).
66

7-
### BREAKING CHANGES:
7+
## BREAKING CHANGES
88

9-
### FEATURES:
9+
## FEATURES
1010

1111
- [privval] \#5239 Add `chainID` to requests from client.
1212

13-
### IMPROVEMENTS:
13+
## IMPROVEMENTS
1414

15-
### BUG FIXES:
15+
## BUG FIXES
1616

17-
- [blockchain] \#5249 Fix fast sync halt with initial height > 1 (@erikgrinaker)
17+
- [blockchain] \#5249 Fix fast sync halt with initial height > 1 (@erikgrinaker)

CODE_OF_CONDUCT.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
# The Tendermint Code of Conduct
2+
23
This code of conduct applies to all projects run by the Tendermint/COSMOS team and hence to tendermint.
34

45

56
----
67

78

89
# Conduct
10+
911
## Contact: [email protected]
1012

1113
* We are committed to providing a friendly, safe and welcoming environment for all, regardless of level of experience, gender, gender identity and expression, sexual orientation, disability, personal appearance, body size, race, ethnicity, age, religion, nationality, or other similar characteristic.
@@ -29,6 +31,7 @@ This code of conduct applies to all projects run by the Tendermint/COSMOS team a
2931

3032

3133
# Moderation
34+
3235
These are the policies for upholding our community’s standards of conduct. If you feel that a thread needs moderation, please contact the above mentioned person.
3336

3437
1. Remarks that violate the Tendermint/COSMOS standards of conduct, including hateful, hurtful, oppressive, or exclusionary remarks, are not allowed. (Cursing is allowed, but never targeting another user, and never in a hateful manner.)

CONTRIBUTING.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -115,14 +115,14 @@ There are two ways to generate your proto stubs.
115115

116116
### Installation Instructions
117117

118-
To install `protoc`, download an appropriate release (https://github.com/protocolbuffers/protobuf) and then move the provided binaries into your PATH (follow instructions in README included with the download).
118+
To install `protoc`, download an appropriate release (<https://github.com/protocolbuffers/protobuf>) and then move the provided binaries into your PATH (follow instructions in README included with the download).
119119

120120
To install `gogoproto`, do the following:
121121

122-
```
123-
$ go get github.com/gogo/protobuf/gogoproto
124-
$ cd $GOPATH/pkg/mod/github.com/gogo/[email protected] # or wherever go get installs things
125-
$ make install
122+
```sh
123+
go get github.com/gogo/protobuf/gogoproto
124+
cd $GOPATH/pkg/mod/github.com/gogo/[email protected] # or wherever go get installs things
125+
make install
126126
```
127127

128128
You should now be able to run `make proto-gen` from inside the root Tendermint directory to generate new files from proto files.
@@ -135,7 +135,7 @@ hacking Tendermint with the commands below.
135135
NOTE: In case you installed Vagrant in 2017, you might need to run
136136
`vagrant box update` to upgrade to the latest `ubuntu/xenial64`.
137137

138-
```
138+
```sh
139139
vagrant up
140140
vagrant ssh
141141
make test
@@ -218,7 +218,7 @@ If your change should be included in a minor release, please also open a PR agai
218218

219219
You can do this by cherry-picking your commit off master:
220220

221-
```
221+
```sh
222222
$ git checkout rc1/v0.33.5
223223
$ git checkout -b {new branch name}
224224
$ git cherry-pick {commit SHA from master}
@@ -232,7 +232,7 @@ After this, you can open a PR. Please note in the PR body if there were merge co
232232

233233
We follow the [Go style guide on commit messages](https://tip.golang.org/doc/contribute.html#commit_messages). Write concise commits that start with the package name and have a description that finishes the sentence "This change modifies Tendermint to...". For example,
234234

235-
```
235+
```sh
236236
cmd/debug: execute p.Signal only when p is not nil
237237

238238
[potentially longer description in the body]

DOCKER/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@ Official releases can be found [here](https://github.com/tendermint/tendermint/r
88

99
The Dockerfile for tendermint is not expected to change in the near future. The master file used for all builds can be found [here](https://raw.githubusercontent.com/tendermint/tendermint/master/DOCKER/Dockerfile).
1010

11-
Respective versioned files can be found https://raw.githubusercontent.com/tendermint/tendermint/vX.XX.XX/DOCKER/Dockerfile (replace the Xs with the version number).
11+
Respective versioned files can be found <https://raw.githubusercontent.com/tendermint/tendermint/vX.XX.XX/DOCKER/Dockerfile> (replace the Xs with the version number).
1212

1313
## Quick reference
1414

15-
- **Where to get help:** https://tendermint.com/
16-
- **Where to file issues:** https://github.com/tendermint/tendermint/issues
15+
- **Where to get help:** <https://tendermint.com/>
16+
- **Where to file issues:** <https://github.com/tendermint/tendermint/issues>
1717
- **Supported Docker versions:** [the latest release](https://github.com/moby/moby/releases) (down to 1.6 on a best-effort basis)
1818

1919
## Tendermint

PHILOSOPHY.md

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
1-
## Design goals
1+
# Design goals
22

33
The design goals for Tendermint (and the SDK and related libraries) are:
44

5-
* Simplicity and Legibility
6-
* Parallel performance, namely ability to utilize multicore architecture
7-
* Ability to evolve the codebase bug-free
8-
* Debuggability
9-
* Complete correctness that considers all edge cases, esp in concurrency
10-
* Future-proof modular architecture, message protocol, APIs, and encapsulation
5+
* Simplicity and Legibility
6+
* Parallel performance, namely ability to utilize multicore architecture
7+
* Ability to evolve the codebase bug-free
8+
* Debuggability
9+
* Complete correctness that considers all edge cases, esp in concurrency
10+
* Future-proof modular architecture, message protocol, APIs, and encapsulation
1111

1212

13-
### Justification
13+
## Justification
1414

1515
Legibility is key to maintaining bug-free software as it evolves toward more
1616
optimizations, more ease of debugging, and additional features.
@@ -44,7 +44,7 @@ become more complicated over time, and it becomes more and more difficult to
4444
assess the correctness of such a for-loop by visual inspection.
4545

4646

47-
### On performance
47+
## On performance
4848

4949
It doesn't matter whether there are alternative implementations that are 2x or
5050
3x more performant, when the software doesn't work, deadlocks, or if bugs
@@ -74,7 +74,7 @@ that works well enough, can be debugged and maintained, and can serve as a spec
7474
for future implementations.
7575

7676

77-
### On encapsulation
77+
## On encapsulation
7878

7979
In order to create maintainable, forward-optimizable software, it is critical
8080
to develop well-encapsulated objects that have well understood properties, and
@@ -92,12 +92,12 @@ and the rand.Rand struct. It's one single struct declaration that can be used
9292
in both concurrent and non-concurrent logic, and due to its well encapsulation,
9393
it's easy to get the usage of the mutex right.
9494

95-
#### example: rand.Rand:
95+
### example: rand.Rand
9696

9797
`The default Source is safe for concurrent use by multiple goroutines, but
9898
Sources created by NewSource are not`. The reason why the default
9999
package-level source is safe for concurrent use is because it is protected (see
100-
`lockedSource` in https://golang.org/src/math/rand/rand.go).
100+
`lockedSource` in <https://golang.org/src/math/rand/rand.go>).
101101

102102
But we shouldn't rely on the global source, we should be creating our own
103103
Rand/Source instances and using them, especially for determinism in testing.
@@ -120,7 +120,7 @@ clear what methods have what side effects, then there is something wrong about
120120
the design of abstractions that should be revisited.
121121

122122

123-
### On concurrency
123+
## On concurrency
124124

125125
In order for Tendermint to remain relevant in the years to come, it is vital
126126
for Tendermint to take advantage of multicore architectures. Due to the nature
@@ -131,24 +131,24 @@ design, especially when it comes to the reactor design, and also for RPC
131131
request handling.
132132

133133

134-
## Guidelines
134+
# Guidelines
135135

136136
Here are some guidelines for designing for (sufficient) performance and concurrency:
137137

138-
* Mutex locks are cheap enough when there isn't contention.
139-
* Do not optimize code without analytical or observed proof that it is in a hot path.
140-
* Don't over-use channels when mutex locks w/ encapsulation are sufficient.
141-
* The need to drain channels are often a hint of unconsidered edge cases.
142-
* The creation of O(N) one-off goroutines is generally technical debt that
138+
* Mutex locks are cheap enough when there isn't contention.
139+
* Do not optimize code without analytical or observed proof that it is in a hot path.
140+
* Don't over-use channels when mutex locks w/ encapsulation are sufficient.
141+
* The need to drain channels are often a hint of unconsidered edge cases.
142+
* The creation of O(N) one-off goroutines is generally technical debt that
143143
needs to get addressed sooner than later. Avoid creating too many
144144
goroutines as a patch around incomplete concurrency design, or at least be
145145
aware of the debt and do not invest in the debt. On the other hand, Tendermint
146146
is designed to have a limited number of peers (e.g. 10 or 20), so the creation
147147
of O(C) goroutines per O(P) peers is still O(C\*P=constant).
148-
* Use defer statements to unlock as much as possible. If you want to unlock sooner,
148+
* Use defer statements to unlock as much as possible. If you want to unlock sooner,
149149
try to create more modular functions that do make use of defer statements.
150150

151-
## Matras
151+
# Mantras
152152

153153
* Premature optimization kills
154154
* Readability is paramount

README.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@ Or [Blockchain](<https://en.wikipedia.org/wiki/Blockchain_(database)>), for shor
1111
[![Go version](https://img.shields.io/badge/go-1.14-blue.svg)](https://github.com/moovweb/gvm)
1212
[![Discord chat](https://img.shields.io/discord/669268347736686612.svg)](https://discord.gg/AzefAFd)
1313
[![license](https://img.shields.io/github/license/tendermint/tendermint.svg)](https://github.com/tendermint/tendermint/blob/master/LICENSE)
14-
[![](https://tokei.rs/b1/github/tendermint/tendermint?category=lines)](https://github.com/tendermint/tendermint)
14+
[![tendermint/tendermint](https://tokei.rs/b1/github/tendermint/tendermint?category=lines)](https://github.com/tendermint/tendermint)
1515
[![Sourcegraph](https://sourcegraph.com/github.com/tendermint/tendermint/-/badge.svg)](https://sourcegraph.com/github.com/tendermint/tendermint?badge)
1616

1717
| Branch | Tests | Coverage | Linting |
1818
| ------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------ | -------------------------------------------------------------------------- |
19-
| master | [![CircleCI](https://circleci.com/gh/tendermint/tendermint/tree/master.svg?style=shield)](https://circleci.com/gh/tendermint/tendermint/tree/master) <br /> ![Tests](https://github.com/tendermint/tendermint/workflows/Tests/badge.svg?branch=master) | [![codecov](https://codecov.io/gh/tendermint/tendermint/branch/master/graph/badge.svg)](https://codecov.io/gh/tendermint/tendermint) | ![Lint](https://github.com/tendermint/tendermint/workflows/Lint/badge.svg) |
19+
| master | [![CircleCI](https://circleci.com/gh/tendermint/tendermint/tree/master.svg?style=shield)](https://circleci.com/gh/tendermint/tendermint/tree/master) </br> ![Tests](https://github.com/tendermint/tendermint/workflows/Tests/badge.svg?branch=master) | [![codecov](https://codecov.io/gh/tendermint/tendermint/branch/master/graph/badge.svg)](https://codecov.io/gh/tendermint/tendermint) | ![Lint](https://github.com/tendermint/tendermint/workflows/Lint/badge.svg) |
2020

2121
Tendermint Core is Byzantine Fault Tolerant (BFT) middleware that takes a state transition machine - written in any programming language -
2222
and securely replicates it on many machines.
@@ -101,11 +101,11 @@ CHANGELOG even if they don't lead to MINOR version bumps:
101101
- config
102102
- node
103103
- libs
104-
- bech32
105-
- common
106-
- db
107-
- errors
108-
- log
104+
- bech32
105+
- common
106+
- db
107+
- errors
108+
- log
109109

110110
Exported objects in these packages that are not covered by the versioning scheme
111111
are explicitly marked by `// UNSTABLE` in their go doc comment and may change at any
@@ -139,7 +139,7 @@ For details about the blockchain data structures and the p2p protocols, see the
139139
[Tendermint specification](https://docs.tendermint.com/master/spec/).
140140

141141
For details on using the software, see the [documentation](/docs/) which is also
142-
hosted at: https://docs.tendermint.com/master/
142+
hosted at: <https://docs.tendermint.com/master/>
143143

144144
### Tools
145145

SECURITY.md

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Security
22

33
## Reporting a Bug
4+
45
As part of our [Coordinated Vulnerability Disclosure
56
Policy](https://tendermint.com/security), we operate a [bug
67
bounty](https://hackerone.com/tendermint).
@@ -21,6 +22,7 @@ If you follow these guidelines when reporting an issue to us, we commit to:
2122
* Work with you to understand, resolve and ultimately disclose the issue in a timely fashion
2223

2324
## Disclosure Process
25+
2426
Tendermint Core uses the following disclosure process:
2527

2628
1. Once a security report is received, the Tendermint Core team works to verify the issue and confirm its severity level using CVSS.
@@ -37,6 +39,7 @@ Tendermint Core uses the following disclosure process:
3739
This process can take some time. Every effort will be made to handle the bug in as timely a manner as possible, however it's important that we follow the process described above to ensure that disclosures are handled consistently and to keep Tendermint Core and its downstream dependent projects--including but not limited to Gaia and the Cosmos Hub--as secure as possible.
3840

3941
### Example Timeline
42+
4043
The following is an example timeline for the triage and response. The required roles and team members are described in parentheses after each task; however, multiple people can play each role and each person may play multiple roles.
4144

4245
#### > 24 Hours Before Release Time
@@ -54,6 +57,7 @@ The following is an example timeline for the triage and response. The required r
5457
4. Send emails to validators or other users (PARTNERSHIPS LEAD)
5558

5659
#### Release Time
60+
5761
1. Cut Tendermint releases for eligible versions (TENDERMINT ENG, TENDERMINT LEAD)
5862
2. Cut Cosmos SDK release for eligible versions (COSMOS ENG)
5963
3. Cut Gaia release for eligible versions (GAIA ENG)
@@ -64,26 +68,31 @@ The following is an example timeline for the triage and response. The required r
6468
8. Publish Security Advisory and CVE, if CVE has no sensitive information (ADMIN)
6569

6670
#### After Release Time
71+
6772
1. Write forum post with exploit details (TENDERMINT LEAD)
6873
2. Approve pay-out on HackerOne for submitter (ADMIN)
6974

7075
#### 7 Days After Release Time
76+
7177
1. Publish CVE if it has not yet been published (ADMIN)
7278
2. Publish forum post with exploit details (TENDERMINT ENG, TENDERMINT LEAD)
7379

7480
## Supported Releases
81+
7582
The Tendermint Core team commits to releasing security patch releases for both the latest minor release as well for the major/minor release that the Cosmos Hub is running.
7683

7784
If you are running older versions of Tendermint Core, we encourage you to upgrade at your earliest opportunity so that you can receive security patches directly from the Tendermint repo. While you are welcome to backport security patches to older versions for your own use, we will not publish or promote these backports.
7885

7986
## Scope
87+
8088
The full scope of our bug bounty program is outlined on our [Hacker One program page](https://hackerone.com/tendermint). Please also note that, in the interest of the safety of our users and staff, a few things are explicitly excluded from scope:
8189

8290
* Any third-party services
8391
* Findings from physical testing, such as office access
8492
* Findings derived from social engineering (e.g., phishing)
8593

8694
## Example Vulnerabilities
95+
8796
The following is a list of examples of the kinds of vulnerabilities that we’re most interested in. It is not exhaustive: there are other kinds of issues we may also be interested in!
8897

8998
### Specification
@@ -143,6 +152,3 @@ Attacks may come through the P2P network or the RPC layer:
143152

144153
* Core verification
145154
* Bisection/sequential algorithms
146-
147-
148-

0 commit comments

Comments
 (0)