Skip to content

Commit 8780a50

Browse files
dave-tuckerastoycos
authored andcommitted
.github: Add markdownlint
This adds a linter to catch common markdown formatting errors. The linter used is markdownlint-cli2 which is available on all platforms and has an associated Github Action to automate these checks in CI. Configuration is checked in at .markdownlint-cli2.yaml. You may run the check locally using `markdownlint-cli2`. Or you may install the extension for VSCode: DavidAnson.vscode-markdownlint Signed-off-by: Dave Tucker <[email protected]>
1 parent 33b2e45 commit 8780a50

File tree

8 files changed

+77
-59
lines changed

8 files changed

+77
-59
lines changed

.github/workflows/ci.yml

+5-1
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,12 @@ jobs:
3535

3636
- name: Check C formatting
3737
run: git ls-files -- '*.c' '*.h' | xargs clang-format --dry-run --Werror
38+
39+
- name: Check Markdown
40+
uses: DavidAnson/markdownlint-cli2-action@v9
3841

39-
- run: taplo fmt --check
42+
- name: Check TOML formatting
43+
run: taplo fmt --check
4044

4145
- name: Check formatting
4246
run: cargo fmt --all -- --check

.markdownlint-cli2.yaml

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
config:
2+
no-duplicate-heading: false
3+
4+
globs:
5+
- "**/*.md"
6+
ignores:
7+
- "target/**/*"
8+
- "xtask/libbpf/**/*"

CODE_OF_CONDUCT.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -115,14 +115,14 @@ the community.
115115
## Attribution
116116

117117
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
118-
version 2.0, available at
119-
https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
118+
version 2.0, available [here][covenant-2-0].
120119

121120
Community Impact Guidelines were inspired by [Mozilla's code of conduct
122121
enforcement ladder](https://github.com/mozilla/diversity).
123122

124123
[homepage]: https://www.contributor-covenant.org
124+
[covenant-2-0]: https://www.contributor-covenant.org/version/2/0/code_of_conduct
125125

126-
For answers to common questions about this code of conduct, see the FAQ at
127-
https://www.contributor-covenant.org/faq. Translations are available at
128-
https://www.contributor-covenant.org/translations.
126+
For answers to common questions about this code of conduct, see the
127+
[FAQ](https://www.contributor-covenant.org/faq). Translations are available
128+
[here](https://www.contributor-covenant.org/translations).

CONTRIBUTING.md

+27-21
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,16 @@ version of aya you're using and which version of the linux kernel.
1717

1818
If you find an API that is not documented, unclear or missing examples, please
1919
file an issue. If you make changes to the documentation, please read
20-
https://doc.rust-lang.org/rustdoc/how-to-write-documentation.html and make sure
21-
your changes conform to the format outlined here
22-
https://doc.rust-lang.org/rustdoc/how-to-write-documentation.html#documenting-components.
20+
[How To Write Documentation] and make sure your changes conform to the
21+
format outlined in [Documenting Components].
2322

24-
If you want to make changes to the Aya Book, see the readme in the book repo
25-
https://github.com/aya-rs/book.
23+
[How To Write Documentation]: https://doc.rust-lang.org/rustdoc/how-to-write-documentation.html
24+
[Documenting Components]: https://doc.rust-lang.org/rustdoc/how-to-write-documentation.html#documenting-components
25+
26+
If you want to make changes to the Aya Book, see the readme in the
27+
[book repository].
28+
29+
[book repository]: https://github.com/aya-rs/book
2630

2731
## Fixing bugs and implementing new features
2832

@@ -31,7 +35,11 @@ helps us avoid duplicating work. If your work includes publicly visible changes,
3135
make sure those are properly documented as explained in the section above.
3236

3337
### Running tests
34-
Run the unit tests with `cargo test`. See [Aya Integration Tests](https://github.com/aya-rs/aya/blob/main/test/README.md) regarding running the integration tests.
38+
39+
Run the unit tests with `cargo test`. See [Aya Integration Tests] regarding
40+
running the integration tests.
41+
42+
[Aya Integration Tests]: https://github.com/aya-rs/aya/blob/main/test/README.md
3543

3644
### Commits
3745

@@ -45,21 +53,19 @@ change, please squash those together before asking for a review.
4553
A good commit message should describe what changed and why.
4654

4755
1. The first line should:
48-
49-
* contain a short description of the change (preferably 50 characters or less,
50-
and no more than 72 characters)
51-
* be entirely in lowercase with the exception of proper nouns, acronyms, and
52-
the words that refer to code, like function/variable names
53-
* be prefixed with the name of the sub crate being changed
54-
55-
Examples:
56-
57-
* aya: handle reordered functions
58-
* aya-bpf: SkSkbContext: add ::l3_csum_replace
59-
60-
2. Keep the second line blank.
61-
3. Wrap all other lines at 72 columns (except for long URLs).
62-
4. If your patch fixes an open issue, you can add a reference to it at the end
56+
- Contain a short description of the change (preferably 50 characters or less,
57+
and no more than 72 characters)
58+
- Be entirely in lowercase with the exception of proper nouns, acronyms, and
59+
the words that refer to code, like function/variable names
60+
- Be prefixed with the name of the sub crate being changed
61+
62+
Examples:
63+
- `aya: handle reordered functions`
64+
- `aya-bpf: SkSkbContext: add ::l3_csum_replace`
65+
66+
1. Keep the second line blank.
67+
1. Wrap all other lines at 72 columns (except for long URLs).
68+
1. If your patch fixes an open issue, you can add a reference to it at the end
6369
of the log. Use the `Fixes: #` prefix and the issue number. For other
6470
references use `Refs: #`. `Refs` may include multiple issues, separated by a
6571
comma.

README.md

+11-10
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
[![Build status][build-badge]][build-url]
66
[![Book][book-badge]][book-url]
77

8-
98
[crates-badge]: https://img.shields.io/crates/v/aya.svg?style=for-the-badge&logo=rust
109
[crates-url]: https://crates.io/crates/aya
1110
[license-badge]: https://img.shields.io/badge/license-MIT%2FApache--2.0-blue?style=for-the-badge
@@ -27,8 +26,8 @@
2726

2827
[![Discord][discord-badge]][chat-url] [![Awesome][awesome-badge]][awesome-aya]
2928

30-
Join [the conversation on Discord][chat-url] to discuss anything related to Aya, or discover
31-
and contribute to a list of [Awesome Aya][awesome-aya] projects.
29+
Join [the conversation on Discord][chat-url] to discuss anything related to Aya
30+
or discover and contribute to a list of [Awesome Aya][awesome-aya] projects.
3231

3332
[discord-badge]: https://img.shields.io/badge/Discord-chat-5865F2?style=for-the-badge&logo=discord
3433
[chat-url]: https://discord.gg/xHW2cb2N6G
@@ -38,7 +37,7 @@ and contribute to a list of [Awesome Aya][awesome-aya] projects.
3837
## Overview
3938

4039
eBPF is a technology that allows running user-supplied programs inside the Linux
41-
kernel. For more info see https://ebpf.io/what-is-ebpf.
40+
kernel. For more info see [What is eBBF](https://ebpf.io/what-is-ebpf).
4241

4342
Aya is an eBPF library built with a focus on operability and developer
4443
experience. It does not rely on [libbpf] nor [bcc] - it's built from the ground
@@ -70,9 +69,8 @@ Some of the major features provided include:
7069

7170
### Example
7271

73-
Aya supports a large chunk of the eBPF API. The following example shows how to use a
74-
`BPF_PROG_TYPE_CGROUP_SKB` program with aya:
75-
72+
Aya supports a large chunk of the eBPF API. The following example shows how to
73+
use a `BPF_PROG_TYPE_CGROUP_SKB` program with aya:
7674

7775
```rust
7876
use std::fs::File;
@@ -97,12 +95,15 @@ ingress.attach(cgroup, CgroupSkbAttachType::Ingress)?;
9795
## Contributing
9896

9997
Please see the [contributing guide](https://github.com/aya-rs/aya/blob/main/CONTRIBUTING.md).
98+
10099
## License
101100

102-
Aya is distributed under the terms of either the [MIT license] or the [Apache License] (version
103-
2.0), at your option.
101+
Aya is distributed under the terms of either the [MIT license] or the
102+
[Apache License] (version 2.0), at your option.
104103

105-
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in this crate by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.
104+
Unless you explicitly state otherwise, any contribution intentionally submitted
105+
for inclusion in this crate by you, as defined in the Apache-2.0 license, shall
106+
be dual licensed as above, without any additional terms or conditions.
106107

107108
[MIT license]: https://github.com/aya-rs/aya/blob/main/LICENSE-MIT
108109
[Apache license]: https://github.com/aya-rs/aya/blob/main/LICENSE-APACHE

aya/README.md

+12-11
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,10 @@
55
![Build status][build-badge]
66
[![Book][book-badge]][book-url]
77

8-
98
[crates-badge]: https://img.shields.io/crates/v/aya.svg?style=for-the-badge&logo=rust
109
[crates-url]: https://crates.io/crates/aya
1110
[license-badge]: https://img.shields.io/badge/license-MIT%2FApache--2.0-blue?style=for-the-badge
12-
[build-badge]: https://img.shields.io/github/workflow/status/aya-rs/aya/build-aya?style=for-the-badge&logo=github
11+
[build-badge]: https://img.shields.io/github/actions/workflow/status/aya-rs/aya/build-aya.yml?branch=main&style=for-the-badge
1312
[book-badge]: https://img.shields.io/badge/read%20the-book-9cf.svg?style=for-the-badge&logo=mdbook
1413
[book-url]: https://aya-rs.dev/book
1514

@@ -26,8 +25,8 @@
2625

2726
[![Discord][discord-badge]][chat-url] [![Awesome][awesome-badge]][awesome-aya]
2827

29-
Join [the conversation on Discord][chat-url] to discuss anything related to Aya, or discover
30-
and contribute to a list of [Awesome Aya][awesome-aya] projects.
28+
Join [the conversation on Discord][chat-url] to discuss anything related to Aya
29+
or discover and contribute to a list of [Awesome Aya][awesome-aya] projects.
3130

3231
[discord-badge]: https://img.shields.io/badge/Discord-chat-5865F2?style=for-the-badge&logo=discord
3332
[chat-url]: https://discord.gg/xHW2cb2N6G
@@ -37,7 +36,7 @@ and contribute to a list of [Awesome Aya][awesome-aya] projects.
3736
## Overview
3837

3938
eBPF is a technology that allows running user-supplied programs inside the Linux
40-
kernel. For more info see https://ebpf.io/what-is-ebpf.
39+
kernel. For more info see [What is eBBF](https://ebpf.io/what-is-ebpf).
4140

4241
Aya is an eBPF library built with a focus on operability and developer
4342
experience. It does not rely on [libbpf] nor [bcc] - it's built from the ground
@@ -69,9 +68,8 @@ Some of the major features provided include:
6968

7069
### Example
7170

72-
Aya supports a large chunk of the eBPF API. The following example shows how to use a
73-
`BPF_PROG_TYPE_CGROUP_SKB` program with aya:
74-
71+
Aya supports a large chunk of the eBPF API. The following example shows how to
72+
use a `BPF_PROG_TYPE_CGROUP_SKB` program with aya:
7573

7674
```rust
7775
use std::fs::File;
@@ -96,12 +94,15 @@ ingress.attach(cgroup, CgroupSkbAttachType::Ingress)?;
9694
## Contributing
9795

9896
Please see the [contributing guide](https://github.com/aya-rs/aya/blob/main/CONTRIBUTING.md).
97+
9998
## License
10099

101-
Aya is distributed under the terms of either the [MIT license] or the [Apache License] (version
102-
2.0), at your option.
100+
Aya is distributed under the terms of either the [MIT license] or the
101+
[Apache License] (version 2.0), at your option.
103102

104-
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in this crate by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.
103+
Unless you explicitly state otherwise, any contribution intentionally submitted
104+
for inclusion in this crate by you, as defined in the Apache-2.0 license, shall
105+
be dual licensed as above, without any additional terms or conditions.
105106

106107
[MIT license]: https://github.com/aya-rs/aya/blob/main/LICENSE-MIT
107108
[Apache license]: https://github.com/aya-rs/aya/blob/main/LICENSE-APACHE

bpf/aya-bpf-cty/README.md

+4-5
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,16 @@
1+
# `cty`
2+
13
[![crates.io](https://img.shields.io/crates/v/cty.svg)](https://crates.io/crates/cty)
24
[![crates.io](https://img.shields.io/crates/d/cty.svg)](https://crates.io/crates/cty)
35

4-
# `cty`
5-
66
> Type aliases to C types like c_int for use with bindgen
77
88
## License
99

1010
Licensed under either of
1111

12-
- Apache License, Version 2.0 ([LICENSE-APACHE](LICENSE-APACHE) or
13-
http://www.apache.org/licenses/LICENSE-2.0)
14-
- MIT license ([LICENSE-MIT](LICENSE-MIT) or http://opensource.org/licenses/MIT)
12+
- Apache License, Version 2.0 [LICENSE-APACHE](./LICENSE-APACHE) or
13+
- MIT license [LICENSE-MIT](./LICENSE-MIT)
1514

1615
at your option.
1716

test/README.md

+5-6
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
Aya Integration Tests
2-
=====================
1+
# Aya Integration Tests
32

43
The aya integration test suite is a set of tests to ensure that
54
common usage behaviours work on real Linux distros
@@ -19,13 +18,13 @@ From the root of this repository:
1918

2019
### Native
2120

22-
```
21+
```bash
2322
cargo xtask integration-test local
2423
```
2524

2625
### Virtualized
2726

28-
```
27+
```bash
2928
cargo xtask integration-test vm
3029
```
3130

@@ -41,5 +40,5 @@ Tests should follow these guidelines:
4140
constants in `integration-test/src/lib.rs` using `include_bytes_aligned!`.
4241
- Tests should be added to `integration-test/tests`.
4342
- You may add a new module, or use an existing one.
44-
- Test functions should not return `anyhow::Result<()>` since this produces errors without stack
45-
traces. Prefer to `panic!` instead.
43+
- Test functions should not return `anyhow::Result<()>` since this produces
44+
errors without stack traces. Prefer to `panic!` instead.

0 commit comments

Comments
 (0)