Skip to content

Commit cb66c99

Browse files
authored
chore: add markdownlint to lint commands (cosmos#9353)
* add markdownlint config * update make lint commands * update markdownlint config * run make lint-fix * fix empty link * resuse docker container * run lint-fix * do not echo commands Co-authored-by: ryanchrypto <[email protected]>
1 parent b56e1a1 commit cb66c99

File tree

147 files changed

+806
-771
lines changed

Some content is hidden

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

147 files changed

+806
-771
lines changed

.markdownlint.json

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"default": true,
3+
"MD001": false,
4+
"MD004": false,
5+
"MD007": { "indent": 4 },
6+
"MD013": false,
7+
"MD024": { "siblings_only": true },
8+
"MD025": false,
9+
"MD026": { "punctuation": ".,;:" },
10+
"MD029": false,
11+
"MD033": false,
12+
"MD034": false,
13+
"MD036": false,
14+
"MD040": false,
15+
"MD041": false,
16+
"no-hard-tabs": false
17+
}

.markdownlintignore

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
CHANGELOG.md
2+
docs/core/proto-docs.md
3+
docs/node_modules

CONTRIBUTING.md

+30-30
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
# Contributing
22

33
- [Contributing](#contributing)
4-
- [Architecture Decision Records (ADR)](#architecture-decision-records-adr)
5-
- [Pull Requests](#pull-requests)
6-
- [Process for reviewing PRs](#process-for-reviewing-prs)
7-
- [Updating Documentation](#updating-documentation)
8-
- [Forking](#forking)
9-
- [Dependencies](#dependencies)
10-
- [Protobuf](#protobuf)
11-
- [Testing](#testing)
12-
- [Branching Model and Release](#branching-model-and-release)
13-
- [PR Targeting](#pr-targeting)
14-
- [Development Procedure](#development-procedure)
15-
- [Pull Merge Procedure](#pull-merge-procedure)
16-
- [Release Procedure](#release-procedure)
17-
- [Point Release Procedure](#point-release-procedure)
18-
- [Code Owner Membership](#code-owner-membership)
4+
- [Architecture Decision Records (ADR)](#architecture-decision-records-adr)
5+
- [Pull Requests](#pull-requests)
6+
- [Process for reviewing PRs](#process-for-reviewing-prs)
7+
- [Updating Documentation](#updating-documentation)
8+
- [Forking](#forking)
9+
- [Dependencies](#dependencies)
10+
- [Protobuf](#protobuf)
11+
- [Testing](#testing)
12+
- [Branching Model and Release](#branching-model-and-release)
13+
- [PR Targeting](#pr-targeting)
14+
- [Development Procedure](#development-procedure)
15+
- [Pull Merge Procedure](#pull-merge-procedure)
16+
- [Release Procedure](#release-procedure)
17+
- [Point Release Procedure](#point-release-procedure)
18+
- [Code Owner Membership](#code-owner-membership)
1919

2020
Thank you for considering making contributions to Cosmos-SDK and related
2121
repositories!
@@ -80,12 +80,12 @@ All PRs require two Reviews before merge (except docs changes, or variable name-
8080

8181
- `LGTM` without an explicit approval means that the changes look good, but you haven't pulled down the code, run tests locally and thoroughly reviewed it.
8282
- `Approval` through the GH UI means that you understand the code, documentation/spec is updated in the right places, you have pulled down and tested the code locally. In addition:
83-
- You must also think through anything which ought to be included but is not
84-
- You must think through whether any added code could be partially combined (DRYed) with existing code
85-
- You must think through any potential security issues or incentive-compatibility flaws introduced by the changes
86-
- Naming must be consistent with conventions and the rest of the codebase
87-
- Code must live in a reasonable location, considering dependency structures (e.g. not importing testing modules in production code, or including example code modules in production code).
88-
- if you approve of the PR, you are responsible for fixing any of the issues mentioned here and more
83+
- You must also think through anything which ought to be included but is not
84+
- You must think through whether any added code could be partially combined (DRYed) with existing code
85+
- You must think through any potential security issues or incentive-compatibility flaws introduced by the changes
86+
- Naming must be consistent with conventions and the rest of the codebase
87+
- Code must live in a reasonable location, considering dependency structures (e.g. not importing testing modules in production code, or including example code modules in production code).
88+
- if you approve of the PR, you are responsible for fixing any of the issues mentioned here and more
8989
- If you sat down with the PR submitter and did a pairing review please note that in the `Approval`, or your PR comments.
9090
- If you are only making "surface level" reviews, submit any notes as `Comments` without adding a review.
9191

@@ -229,10 +229,10 @@ should be targeted against the release candidate branch.
229229
- Create the release candidate branch `rc/v*` (going forward known as **RC**)
230230
and ensure it's protected against pushing from anyone except the release
231231
manager/coordinator
232-
- **no PRs targeting this branch should be merged unless exceptional circumstances arise**
232+
- **no PRs targeting this branch should be merged unless exceptional circumstances arise**
233233
- On the `RC` branch, prepare a new version section in the `CHANGELOG.md`
234-
- All links must be link-ified: `$ python ./scripts/linkify_changelog.py CHANGELOG.md`
235-
- Copy the entries into a `RELEASE_CHANGELOG.md`, this is needed so the bot knows which entries to add to the release page on github.
234+
- All links must be link-ified: `$ python ./scripts/linkify_changelog.py CHANGELOG.md`
235+
- Copy the entries into a `RELEASE_CHANGELOG.md`, this is needed so the bot knows which entries to add to the release page on github.
236236
- Kick off a large round of simulation testing (e.g. 400 seeds for 2k blocks)
237237
- If errors are found during the simulation testing, commit the fixes to `master`
238238
and create a new `RC` branch (making sure to increment the `rcN`)
@@ -314,22 +314,21 @@ have had acted maliciously or grossly negligent, code-owner privileges may be
314314
stripped with no prior warning or consent from the member in question.
315315
316316
Other potential removal criteria:
317-
* Missing 3 scheduled meetings results in ICF evaluating whether the member should be
317+
318+
* Missing 3 scheduled meetings results in ICF evaluating whether the member should be
318319
removed / replaced
319-
* Violation of Code of Conduct
320+
* Violation of Code of Conduct
320321
321322
Earning this privilege should be considered to be no small feat and is by no
322323
means guaranteed by any quantifiable metric. It is a symbol of great trust of
323324
the community of this project.
324325
325-
326326
## Concept & Release Approval Process
327327
328328
The process for how Cosmos SDK maintainers take features and ADRs from concept to release
329329
is broken up into three distinct stages: **Strategy Discovery**, **Concept Approval**, and
330330
**Implementation & Release Approval**
331331
332-
333332
### Strategy Discovery
334333
335334
* Develop long term priorities, strategy and roadmap for the SDK
@@ -356,6 +355,7 @@ the current state of its discussion.
356355
357356
If an ADR is taking longer than 4 weeks to reach a final conclusion, the **Concept Approval Committee**
358357
should convene to rectify the situation by either:
358+
359359
- unanimously setting a new time bound period for this ADR
360360
- making changes to the Concept Approval Process (as outlined here)
361361
- making changes to the members of the Concept Approval Committee
@@ -378,8 +378,8 @@ Members must:
378378
* Be active contributors to the SDK, and furthermore should be continuously making substantial contributions
379379
to the project's codebase, review process, documentation and ADRs
380380
* Have stake in the Cosmos SDK project, represented by:
381-
* Being a client / user of the Comsos SDK
382-
* "[giving back](https://www.debian.org/social_contract)" to the software
381+
* Being a client / user of the Comsos SDK
382+
* "[giving back](https://www.debian.org/social_contract)" to the software
383383
* Delegate representation in case of vacation or absence
384384
385385
Code owners need to maintain participation in the process, ideally as members of **Concept Approval Committee**

Makefile

+7
Original file line numberDiff line numberDiff line change
@@ -327,11 +327,18 @@ benchmark:
327327
### Linting ###
328328
###############################################################################
329329

330+
containerMarkdownLintImage=tmknom/markdownlint
331+
containerMarkdownLint=cosmos-sdk-markdownlint
332+
containerMarkdownLintFix=cosmos-sdk-markdownlint-fix
333+
330334
lint:
331335
golangci-lint run --out-format=tab
336+
@if docker ps -a --format '{{.Names}}' | grep -Eq "^${containerMarkdownLint}$$"; then docker start -a $(containerMarkdownLint); else docker run --name $(containerMarkdownLint) -i -v "$(CURDIR):/work" $(containerMarkdownLintImage); fi
332337

333338
lint-fix:
334339
golangci-lint run --fix --out-format=tab --issues-exit-code=0
340+
@if docker ps -a --format '{{.Names}}' | grep -Eq "^${containerMarkdownLintFix}$$"; then docker start -a $(containerMarkdownLintFix); else docker run --name $(containerMarkdownLintFix) -i -v "$(CURDIR):/work" $(containerMarkdownLintImage) . --fix; fi
341+
335342
.PHONY: lint lint-fix
336343

337344
format:

README.md

+1-4
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,6 @@ parent:
4040
<img alt="Lint Satus" src="https://github.com/cosmos/cosmos-sdk/workflows/Lint/badge.svg" />
4141
</div>
4242

43-
44-
45-
4643
The Cosmos-SDK is a framework for building blockchain applications in Golang.
4744
It is being used to build [`Gaia`](https://github.com/cosmos/gaia), the first implementation of the Cosmos Hub.
4845

@@ -65,7 +62,7 @@ The Cosmos Hub application, `gaia`, has moved to its [own repository](https://gi
6562

6663
## Interblockchain Communication (IBC)
6764

68-
The IBC module for the SDK has moved to its [own repository](https://github.com/cosmos/ibc-go). Go there to build and integrate with the IBC module.
65+
The IBC module for the SDK has moved to its [own repository](https://github.com/cosmos/ibc-go). Go there to build and integrate with the IBC module.
6966

7067
## Starport
7168

SECURITY.md

+5-3
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ the code.
5151

5252
- HD key derivation, local and Ledger, and all key-management functionality
5353
- Side-channel attack vectors with our implementations
54-
- e.g. key exfiltration based on time or memory-access patterns when decrypting privkey
54+
- e.g. key exfiltration based on time or memory-access patterns when decrypting privkey
5555

5656
## Disclosure Process
5757

@@ -73,6 +73,7 @@ This process can take some time. Every effort is made to handle the bug in as ti
7373
### Disclosure Communications
7474

7575
Communications to partners usually include the following details:
76+
7677
1. Affected version or versions
7778
1. New release version
7879
1. Impact on user funds
@@ -81,13 +82,14 @@ Communications to partners usually include the following details:
8182
1. Potential required actions if an adverse condition arises during the security release process
8283

8384
An example notice looks like:
85+
8486
```
8587
Dear Cosmos SDK partners,
8688
87-
A critical security vulnerability has been identified in Cosmos SDK vX.X.X.
89+
A critical security vulnerability has been identified in Cosmos SDK vX.X.X.
8890
User funds are NOT at risk; however, the vulnerability can result in a chain halt.
8991
90-
This notice is to inform you that on [[**March 1 at 1pm EST/6pm UTC**]], we will be releasing Cosmos SDK vX.X.Y to fix the security issue.
92+
This notice is to inform you that on [[**March 1 at 1pm EST/6pm UTC**]], we will be releasing Cosmos SDK vX.X.Y to fix the security issue.
9193
We ask all validators to upgrade their nodes ASAP.
9294
9395
If the chain halts, validators with sufficient voting power must upgrade and come online for the chain to resume.

STABLE_RELEASES.md

+20-17
Original file line numberDiff line numberDiff line change
@@ -52,13 +52,13 @@ To smoothen the update to the latest stable release, the SDK includes a set of C
5252
### What qualifies as a Stable Release Update (SRU)
5353

5454
* **High-impact bugs**
55-
* Bugs that may directly cause a security vulnerability.
56-
* *Severe regressions* from a Cosmos-SDK's previous release. This includes all sort of issues
55+
* Bugs that may directly cause a security vulnerability.
56+
* *Severe regressions* from a Cosmos-SDK's previous release. This includes all sort of issues
5757
that may cause the core packages or the `x/` modules unusable.
58-
* Bugs that may cause **loss of user's data**.
58+
* Bugs that may cause **loss of user's data**.
5959
* Other safe cases:
60-
* Bugs which don't fit in the aforementioned categories for which an obvious safe patch is known.
61-
* Relatively small yet strictly non-breaking changes that introduce forward-compatible client
60+
* Bugs which don't fit in the aforementioned categories for which an obvious safe patch is known.
61+
* Relatively small yet strictly non-breaking changes that introduce forward-compatible client
6262
features to smoothen the migration to successive releases.
6363

6464
### What does not qualify as SRU
@@ -71,27 +71,29 @@ To smoothen the update to the latest stable release, the SDK includes a set of C
7171

7272
Pull requests that fix bugs that fall in the following categories do not require a **Stable Release Exception** to be granted to be included in a stable point-release:
7373

74-
* **Severe regressions**.
75-
* Bugs that may cause **client applications** to be **largely unusable**.
76-
* Bugs that may cause **state corruption or data loss**.
77-
* Bugs that may directly or indirectly cause a **security vulnerability**.
74+
* **Severe regressions**.
75+
* Bugs that may cause **client applications** to be **largely unusable**.
76+
* Bugs that may cause **state corruption or data loss**.
77+
* Bugs that may directly or indirectly cause a **security vulnerability**.
7878

7979
## What pull requests will NOT be automatically included in stable point-releases
8080

8181
As rule of thumb, the following changes will **NOT** be automatically accepted into stable point-releases:
8282

83-
* **State machine changes**.
84-
* **Client application's code-breaking changes**, i.e. changes that prevent client applications to *build without modifications* to the client application's source code.
83+
* **State machine changes**.
84+
* **Client application's code-breaking changes**, i.e. changes that prevent client applications to *build without modifications* to the client application's source code.
8585

8686
In some circumstances, PRs that don't meet the aforementioned criteria might be raised and asked to be granted a *Stable Release Exception*.
8787

8888
## Stable Release Exception - Procedure
8989

9090
1. Check that the bug is either fixed or not reproducible in `master`. It is, in general, not appropriate to release bug fixes for stable releases without first testing them in `master`. Please apply the label [0.42 «Stargate»](https://github.com/cosmos/cosmos-sdk/labels/0.42%20LTS%20%28Stargate%29) to the issue.
9191
2. Add a comment to the issue and ensure it contains the following information (see the bug template below):
92-
* **[Impact]** An explanation of the bug on users and justification for backporting the fix to the stable release.
93-
* A **[Test Case]** section containing detailed instructions on how to reproduce the bug.
94-
* A **[Regression Potential]** section with a clear assessment on how regressions are most likely to manifest as a result of the pull request that aims to fix the bug in the target stable release.
92+
93+
* **[Impact]** An explanation of the bug on users and justification for backporting the fix to the stable release.
94+
* A **[Test Case]** section containing detailed instructions on how to reproduce the bug.
95+
* A **[Regression Potential]** section with a clear assessment on how regressions are most likely to manifest as a result of the pull request that aims to fix the bug in the target stable release.
96+
9597
3. **Stable Release Managers** will review and discuss the PR. Once *consensus* surrounding the rationale has been reached and the technical review has successfully concluded, the pull request will be merged in the respective point-release target branch (e.g. `release/v0.42.x`) and the PR included in the point-release's respective milestone (e.g. `0.42.5`).
9698

9799
### Stable Release Exception - Bug template
@@ -119,9 +121,10 @@ according to the [stable release policy](#stable-release-policy) and [release pr
119121
Decisions are made by consensus.
120122

121123
Their responsibilites include:
122-
* Driving the Stable Release Exception process.
123-
* Approving/rejecting proposed changes to a stable release series.
124-
* Executing the release process of stable point-releases in compliance with the [Point Release Procedure](CONTRIBUTING.md).
124+
125+
* Driving the Stable Release Exception process.
126+
* Approving/rejecting proposed changes to a stable release series.
127+
* Executing the release process of stable point-releases in compliance with the [Point Release Procedure](CONTRIBUTING.md).
125128

126129
The Stable Release Managers are appointed by the Interchain Foundation. Currently residing Stable Release Managers:
127130

contrib/githooks/README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
Installation:
44

55
```
6-
$ git config core.hooksPath contrib/githooks
6+
git config core.hooksPath contrib/githooks
77
```
88

99
## pre-commit
@@ -14,8 +14,8 @@ that all the aforementioned commands are installed and available
1414
in the user's search `$PATH` environment variable:
1515

1616
```
17-
$ go get golang.org/x/tools/cmd/goimports
18-
$ go get github.com/golangci/misspell/cmd/misspell@master
17+
go get golang.org/x/tools/cmd/goimports
18+
go get github.com/golangci/misspell/cmd/misspell@master
1919
```
2020

2121
It also runs `go mod tidy` and `golangci-lint` if available.

contrib/rosetta/README.md

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ This directory contains the files required to run the rosetta CI. It builds `sim
55
## docker-compose.yaml
66

77
Builds:
8+
89
- cosmos-sdk simapp node, with prefixed data directory, keys etc. This is required to test historical balances.
910
- faucet is required so we can test construction API, it was literally impossible to put there a deterministic address to request funds for
1011
- rosetta is the rosetta node used by rosetta-cli to interact with the cosmos-sdk app

cosmovisor/README.md

+8-5
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ if there was an error.
2828

2929
## Data Folder Layout
3030

31-
`$DAEMON_HOME/cosmovisor` is expected to belong completely to `cosmovisor` and
31+
`$DAEMON_HOME/cosmovisor` is expected to belong completely to `cosmovisor` and
3232
subprocesses that are controlled by it. The folder content is organised as follows:
3333

3434
```
@@ -66,6 +66,7 @@ directory layout:
6666
## Usage
6767

6868
The system administrator admin is responsible for:
69+
6970
* installing the `cosmovisor` binary and configure the host's init system (e.g. `systemd`, `launchd`, etc) along with the environmental variables appropriately;
7071
* installing the `genesis` folder manually;
7172
* installing the `upgrades/<name>` folders manually.
@@ -95,19 +96,21 @@ valid format to specify a download in such a message:
9596

9697
1. Store an os/architecture -> binary URI map in the upgrade plan info field
9798
as JSON under the `"binaries"` key, eg:
99+
98100
```json
99101
{
100102
"binaries": {
101103
"linux/amd64":"https://example.com/gaia.zip?checksum=sha256:aec070645fe53ee3b3763059376134f058cc337247c978add178b6ccdfb0019f"
102104
}
103105
}
104106
```
107+
105108
2. Store a link to a file that contains all information in the above format (eg. if you want
106109
to specify lots of binaries, changelog info, etc without filling up the blockchain).
107110

108111
e.g. `https://example.com/testnet-1001-info.json?checksum=sha256:deaaa99fda9407c4dbe1d04bd49bab0cc3c1dd76fa392cd55a9425be074af01e`
109112

110-
This file contained in the link will be retrieved by [go-getter](https://github.com/hashicorp/go-getter)
113+
This file contained in the link will be retrieved by [go-getter](https://github.com/hashicorp/go-getter)
111114
and the `"binaries"` field will be parsed as above.
112115

113116
If there is no local binary, `DAEMON_ALLOW_DOWNLOAD_BINARIES=on`, and we can access a canonical url for the new binary,
@@ -120,7 +123,7 @@ or hijacks the DNS. go-getter will always ensure the downloaded file matches the
120123
is provided. go-getter will also handle unpacking archives into directories (so these download links should be
121124
a zip of all data in the `bin` directory).
122125

123-
To properly create a checksum on linux, you can use the `sha256sum` utility. e.g.
126+
To properly create a checksum on linux, you can use the `sha256sum` utility. e.g.
124127
`sha256sum ./testdata/repo/zip_directory/autod.zip`
125128
which should return `29139e1381b8177aec909fab9a75d11381cab5adf7d3af0c05ff1c9c117743a7`.
126129
You can also use `sha512sum` if you like longer hashes, or `md5sum` if you like to use broken hashes.
@@ -174,13 +177,13 @@ Submit a software upgrade proposal:
174177
```
175178
./build/simd tx gov submit-proposal software-upgrade test1 --title "upgrade-demo" --description "upgrade" --from validator --upgrade-height 100 --deposit 10000000stake --chain-id test --keyring-backend test -y
176179
```
177-
180+
178181
Query the proposal to ensure it was correctly broadcast and added to a block:
179182

180183
```
181184
./build/simd query gov proposal 1
182185
```
183-
186+
184187
Submit a `Yes` vote for the upgrade proposal:
185188

186189
```

0 commit comments

Comments
 (0)