Skip to content

Commit 354ea5a

Browse files
committed
Add linting for markdown files (nginx#883)
Problem: The markdown files in the repo are not linted. Solution: Add markdownlint-cli2 to pre-commit and github workflow.
1 parent 3b4123a commit 354ea5a

37 files changed

+780
-462
lines changed

.github/workflows/lint.yml

+12
Original file line numberDiff line numberDiff line change
@@ -76,3 +76,15 @@ jobs:
7676
- uses: reviewdog/action-actionlint@7485c2136bd093d2317a854c72910eebaee35238 # v1.37.1
7777
with:
7878
actionlint_flags: -shellcheck ""
79+
80+
markdown-lint:
81+
name: Markdown Lint
82+
runs-on: ubuntu-22.04
83+
steps:
84+
- name: Checkout Repository
85+
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
86+
87+
- uses: DavidAnson/markdownlint-cli2-action@8f3516061301755c97ff833a8e933f09282cc5b5 # v11.0.0
88+
with:
89+
config: ${{ github.workspace }}/.markdownlint-cli2.yaml
90+
globs: '**/*.md'

.markdownlint-cli2.yaml

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Rule configuration.
2+
# For rule descriptions and how to fix: https://github.com/DavidAnson/markdownlint/tree/main#rules--aliases
3+
config:
4+
ul-style:
5+
style: dash
6+
no-hard-tabs: false
7+
no-multiple-blanks: false
8+
line-length:
9+
line_length: 120
10+
code_blocks: false
11+
tables: false
12+
blanks-around-headers: false
13+
no-duplicate-heading:
14+
siblings_only: true
15+
no-inline-html: false
16+
no-bare-urls: false
17+
no-emphasis-as-heading: false
18+
first-line-h1: false
19+
code-block-style: false
20+
21+
# Define glob expressions to ignore
22+
ignores:
23+
- ".github/"

.pre-commit-config.yaml

+8-1
Original file line numberDiff line numberDiff line change
@@ -48,5 +48,12 @@ repos:
4848
- id: golangci-lint
4949
args: [--new-from-patch=/tmp/diff.patch]
5050

51+
# Rules are in .markdownlint-cli2.yaml file
52+
# See https://github.com/DavidAnson/markdownlint/blob/main/doc/Rules.md for rule descriptions
53+
- repo: https://github.com/DavidAnson/markdownlint-cli2
54+
rev: v0.8.1
55+
hooks:
56+
- id: markdownlint-cli2-fix
57+
5158
ci:
52-
skip: [golang-diff, golangci-lint, prettier]
59+
skip: [golang-diff, golangci-lint, prettier, markdownlint-cli2-fix]

CHANGELOG.md

+94-59
Large diffs are not rendered by default.

CODE_OF_CONDUCT.md

+10-10
Original file line numberDiff line numberDiff line change
@@ -16,21 +16,21 @@ appearance, race, religion, or sexual identity and orientation.
1616
Examples of behavior that contributes to creating a positive environment
1717
include:
1818

19-
* Using welcoming and inclusive language
20-
* Being respectful of differing viewpoints and experiences
21-
* Gracefully accepting constructive criticism
22-
* Focusing on what is best for the community
23-
* Showing empathy towards other community members
19+
- Using welcoming and inclusive language
20+
- Being respectful of differing viewpoints and experiences
21+
- Gracefully accepting constructive criticism
22+
- Focusing on what is best for the community
23+
- Showing empathy towards other community members
2424

2525
Examples of unacceptable behavior by participants include:
2626

27-
* The use of sexualized language or imagery and unwelcome sexual attention or
27+
- The use of sexualized language or imagery and unwelcome sexual attention or
2828
advances
29-
* Trolling, insulting/derogatory comments, and personal or political attacks
30-
* Public or private harassment
31-
* Publishing others' private information, such as a physical or electronic
29+
- Trolling, insulting/derogatory comments, and personal or political attacks
30+
- Public or private harassment
31+
- Publishing others' private information, such as a physical or electronic
3232
address, without explicit permission
33-
* Other conduct which could reasonably be considered inappropriate in a
33+
- Other conduct which could reasonably be considered inappropriate in a
3434
professional setting
3535

3636
## Our Responsibilities

CONTRIBUTING.md

+12-12
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,16 @@
33
The following is a set of guidelines for contributing to NGINX Kubernetes Gateway. We really appreciate that you are
44
considering contributing!
55

6-
#### Table Of Contents
6+
## Table Of Contents
77

88
[Ask a Question](#ask-a-question)
99

1010
[Getting Started](#getting-started)
1111

1212
[Contributing](#contributing)
1313

14-
* [Issues and Discussions](#issues-and-discussions)
15-
* [Development Guide](#development-guide)
14+
- [Issues and Discussions](#issues-and-discussions)
15+
- [Development Guide](#development-guide)
1616

1717
[Code of Conduct](CODE_OF_CONDUCT.md)
1818

@@ -33,15 +33,15 @@ Follow our [Installation Instructions](/docs/installation.md) to get the NGINX K
3333

3434
### Project Structure
3535

36-
* NGINX Kubernetes Gateway is written in Go and uses the open source NGINX software as the data plane.
37-
* The project follows a standard Go project layout
38-
* The main code is found at `cmd/gateway/`
39-
* The internal code is found at `internal/`
40-
* Build files for Docker are found under `build/`
41-
* Deployment yaml files are found at `deploy/`
42-
* External APIs, clients, and SDKs can be found under `pkg/`
43-
* We use [Go Modules](https://github.com/golang/go/wiki/Modules) for managing dependencies.
44-
* We use [Ginkgo](https://onsi.github.io/ginkgo/) and [Gomega](https://onsi.github.io/gomega/) for our BDD style unit
36+
- NGINX Kubernetes Gateway is written in Go and uses the open source NGINX software as the data plane.
37+
- The project follows a standard Go project layout
38+
- The main code is found at `cmd/gateway/`
39+
- The internal code is found at `internal/`
40+
- Build files for Docker are found under `build/`
41+
- Deployment yaml files are found at `deploy/`
42+
- External APIs, clients, and SDKs can be found under `pkg/`
43+
- We use [Go Modules](https://github.com/golang/go/wiki/Modules) for managing dependencies.
44+
- We use [Ginkgo](https://onsi.github.io/ginkgo/) and [Gomega](https://onsi.github.io/gomega/) for our BDD style unit
4545
tests.
4646

4747
## Contributing

ISSUE_LIFECYCLE.md

+8-10
Original file line numberDiff line numberDiff line change
@@ -7,25 +7,24 @@ lifecycle.)
77

88
1. New issue created by community member.
99

10-
1110
2. Assign issue owner: All new issues are assigned an owner on the NGINX engineering team. This owner shepherds the
1211
issue through the subsequent stages in the issue lifecycle.
1312

14-
1513
3. Determine issue type: This is done with automation where possible, and manually by the owner where necessary. The
1614
associated label is applied to the issue.
17-
#### Possible Issue Types
18-
`needs more info`: The owner should use the issue to request information from the creator. If we don't receive the
19-
needed information within 7 days, automation closes the issue.
2015

21-
`bug`: The implementation of a feature is not correct.
16+
Possible Issue Types:
2217

23-
`enhancement`: An enhancement, tackling technical debt, documentation changes, or improving existing features.
18+
- `needs more info`: The owner should use the issue to request information from the creator. If we don't receive the
19+
needed information within 7 days, automation closes the issue.
2420

25-
`enhancement-proposal`: Enhancements that require an [Enhancement Proposal](/docs/proposals/README.md).
21+
- `bug`: The implementation of a feature is not correct.
2622

27-
`question`: The owner converts the issue to a github discussion and engages the creator.
23+
- `enhancement`: An enhancement, tackling technical debt, documentation changes, or improving existing features.
2824

25+
- `enhancement-proposal`: Enhancements that require an [Enhancement Proposal](/docs/proposals/README.md).
26+
27+
- `question`: The owner converts the issue to a github discussion and engages the creator.
2928

3029
4. Determine milestone: The owner, in collaboration with the wider team (product management & engineering), determines
3130
what milestone to attach to an issue. Generally, milestones correspond to product releases - however there are two
@@ -43,7 +42,6 @@ lifecycle.)
4342

4443
`backlog` issues can be labeled by the owner as `help wanted` and/or `good first issue` as appropriate.
4544

46-
4745
5. Promotion of `backlog candidate` issue to `backlog` issue: If an issue labelled `backlog candidate` receives more
4846
than 30 upvotes within 60 days, we promote the issue by applying the `backlog` label. While issues promoted in this
4947
manner have not been committed to a particular release, we welcome PRs from the community on them.

README.md

+51-28
Original file line numberDiff line numberDiff line change
@@ -1,73 +1,93 @@
1-
[![OpenSSF Scorecard](https://api.securityscorecards.dev/projects/github.com/nginxinc/nginx-kubernetes-gateway/badge)](https://api.securityscorecards.dev/projects/github.com/nginxinc/nginx-kubernetes-gateway) [![FOSSA Status](https://app.fossa.com/api/projects/custom%2B5618%2Fgithub.com%2Fnginxinc%2Fnginx-kubernetes-gateway.svg?type=shield)](https://app.fossa.com/projects/custom%2B5618%2Fgithub.com%2Fnginxinc%2Fnginx-kubernetes-gateway?ref=badge_shield)
1+
[![OpenSSF Scorecard](https://api.securityscorecards.dev/projects/github.com/nginxinc/nginx-kubernetes-gateway/badge)](https://api.securityscorecards.dev/projects/github.com/nginxinc/nginx-kubernetes-gateway)
2+
[![FOSSA Status](https://app.fossa.com/api/projects/custom%2B5618%2Fgithub.com%2Fnginxinc%2Fnginx-kubernetes-gateway.svg?type=shield)](https://app.fossa.com/projects/custom%2B5618%2Fgithub.com%2Fnginxinc%2Fnginx-kubernetes-gateway?ref=badge_shield)
23

34
# NGINX Kubernetes Gateway
45

5-
NGINX Kubernetes Gateway is an open-source project that provides an implementation of the [Gateway API](https://gateway-api.sigs.k8s.io/) using [NGINX](https://nginx.org/) as the data plane. The goal of this project is to implement the core Gateway APIs -- `Gateway`, `GatewayClass`, `HTTPRoute`, `TCPRoute`, `TLSRoute`, and `UDPRoute` -- to configure an HTTP or TCP/UDP load balancer, reverse-proxy, or API gateway for applications running on Kubernetes. NGINX Kubernetes Gateway is currently under development and supports a subset of the Gateway API.
6+
NGINX Kubernetes Gateway is an open-source project that provides an implementation of
7+
the [Gateway API](https://gateway-api.sigs.k8s.io/) using [NGINX](https://nginx.org/) as the data plane. The goal of
8+
this project is to implement the core Gateway APIs -- `Gateway`, `GatewayClass`, `HTTPRoute`, `TCPRoute`, `TLSRoute`,
9+
and `UDPRoute` -- to configure an HTTP or TCP/UDP load balancer, reverse-proxy, or API gateway for applications running
10+
on Kubernetes. NGINX Kubernetes Gateway is currently under development and supports a subset of the Gateway API.
611

7-
For a list of supported Gateway API resources and features, see the [Gateway API Compatibility](docs/gateway-api-compatibility.md) doc.
12+
For a list of supported Gateway API resources and features, see
13+
the [Gateway API Compatibility](docs/gateway-api-compatibility.md) doc.
814

9-
> Warning: This project is actively in development (beta feature state) and should not be deployed in a production environment.
10-
> All APIs, SDKs, designs, and packages are subject to change.
15+
> Warning: This project is actively in development (beta feature state) and should not be deployed in a
16+
> production environment. All APIs, SDKs, designs, and packages are subject to change.
1117
1218
Learn about our [design principles](/docs/developer/design-principles.md) and [architecture](/docs/architecture.md).
1319

1420
## Getting Started
1521

1622
1. [Quick Start on a kind cluster](docs/running-on-kind.md).
1723
2. [Install](docs/installation.md) NGINX Kubernetes Gateway.
18-
3. [Build](docs/building-the-image.md) an NGINX Kubernetes Gateway container image from source or use a pre-built image available on [GitHub Container Registry](https://github.com/nginxinc/nginx-kubernetes-gateway/pkgs/container/nginx-kubernetes-gateway).
24+
3. [Build](docs/building-the-image.md) an NGINX Kubernetes Gateway container image from source or use a pre-built image
25+
available
26+
on [GitHub Container Registry](https://github.com/nginxinc/nginx-kubernetes-gateway/pkgs/container/nginx-kubernetes-gateway).
1927
4. Deploy various [examples](examples).
2028

2129
## NGINX Kubernetes Gateway Releases
2230

23-
We publish NGINX Kubernetes Gateway releases on GitHub. See our [releases page](https://github.com/nginxinc/nginx-kubernetes-gateway/releases).
31+
We publish NGINX Kubernetes Gateway releases on GitHub. See
32+
our [releases page](https://github.com/nginxinc/nginx-kubernetes-gateway/releases).
2433

2534
The latest release is [0.5.0](https://github.com/nginxinc/nginx-kubernetes-gateway/releases/tag/v0.5.0).
2635

27-
The edge version is useful for experimenting with new features that are not yet published in a release. To use, choose the *edge* version built from the [latest commit](https://github.com/nginxinc/nginx-kubernetes-gateway/commits/main) from the main branch.
36+
The edge version is useful for experimenting with new features that are not yet published in a release. To use, choose
37+
the *edge* version built from the [latest commit](https://github.com/nginxinc/nginx-kubernetes-gateway/commits/main)
38+
from the main branch.
2839

2940
To use NGINX Kubernetes Gateway, you need to have access to:
30-
* An NGINX Kubernetes Gateway image.
31-
* Installation manifests.
32-
* Documentation and examples.
41+
42+
- An NGINX Kubernetes Gateway image.
43+
- Installation manifests.
44+
- Documentation and examples.
3345

3446
It is important that the versions of those things above match.
3547

36-
The table below summarizes the options regarding the images, manifests, documentation and examples and gives your links to the correct versions:
48+
The table below summarizes the options regarding the images, manifests, documentation and examples and gives your links
49+
to the correct versions:
3750

38-
| Version | Description | Image | Installation Manifests | Documentation and Examples |
39-
|-|-|-|-|-|
40-
| Latest release | For experimental use | Use the 0.5.0 image from [GitHub](https://github.com/nginxinc/nginx-kubernetes-gateway/pkgs/container/nginx-kubernetes-gateway) | [Manifests](https://github.com/nginxinc/nginx-kubernetes-gateway/tree/v0.5.0/deploy). | [Documentation](https://github.com/nginxinc/nginx-kubernetes-gateway/tree/v0.5.0/docs). [Examples](https://github.com/nginxinc/nginx-kubernetes-gateway/tree/v0.5.0/examples). |
41-
| Edge| For experimental use and latest features | Use the edge image from [GitHub](https://github.com/nginxinc/nginx-kubernetes-gateway/pkgs/container/nginx-kubernetes-gateway) | [Manifests](https://github.com/nginxinc/nginx-kubernetes-gateway/tree/main/deploy). | [Documentation](https://github.com/nginxinc/nginx-kubernetes-gateway/tree/main/docs). [Examples](https://github.com/nginxinc/nginx-kubernetes-gateway/tree/main/examples). |
51+
| Version | Description | Image | Installation Manifests | Documentation and Examples |
52+
|----------------|------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
53+
| Latest release | For experimental use | Use the 0.5.0 image from [GitHub](https://github.com/nginxinc/nginx-kubernetes-gateway/pkgs/container/nginx-kubernetes-gateway) | [Manifests](https://github.com/nginxinc/nginx-kubernetes-gateway/tree/v0.5.0/deploy). | [Documentation](https://github.com/nginxinc/nginx-kubernetes-gateway/tree/v0.5.0/docs). [Examples](https://github.com/nginxinc/nginx-kubernetes-gateway/tree/v0.5.0/examples). |
54+
| Edge | For experimental use and latest features | Use the edge image from [GitHub](https://github.com/nginxinc/nginx-kubernetes-gateway/pkgs/container/nginx-kubernetes-gateway) | [Manifests](https://github.com/nginxinc/nginx-kubernetes-gateway/tree/main/deploy). | [Documentation](https://github.com/nginxinc/nginx-kubernetes-gateway/tree/main/docs). [Examples](https://github.com/nginxinc/nginx-kubernetes-gateway/tree/main/examples). |
4255

4356
## Technical Specifications
4457

4558
The following table lists the software versions NGINX Kubernetes Gateway supports.
4659

4760
| NGINX Kubernetes Gateway | Gateway API | Kubernetes | NGINX OSS |
48-
|-|-|-|-|
49-
| Edge | 0.7.1 | 1.21+ | 1.25.x *|
50-
| 0.5.0 | 0.7.1 | 1.21+ | 1.25.x *|
51-
| 0.4.0 | 0.7.1 | 1.21+ | 1.25.x *|
52-
| 0.3.0 | 0.6.2 | 1.21+ | 1.23.x *|
53-
| 0.2.0 | 0.5.1 | 1.21+ | 1.21.x *|
54-
| 0.1.0 | 0.5.0 | 1.19+ | 1.21.3 |
61+
|--------------------------|-------------|------------|-----------|
62+
| Edge | 0.7.1 | 1.21+ | 1.25.x * |
63+
| 0.5.0 | 0.7.1 | 1.21+ | 1.25.x * |
64+
| 0.4.0 | 0.7.1 | 1.21+ | 1.25.x * |
65+
| 0.3.0 | 0.6.2 | 1.21+ | 1.23.x * |
66+
| 0.2.0 | 0.5.1 | 1.21+ | 1.21.x * |
67+
| 0.1.0 | 0.5.0 | 1.19+ | 1.21.3 |
5568

56-
\*the installation manifests use the minor version of NGINX container image (e.g. 1.25) and the patch version is not specified. This means that the latest available patch version is used.
69+
\*the installation manifests use the minor version of NGINX container image (e.g. 1.25) and the patch version is not
70+
specified. This means that the latest available patch version is used.
5771

5872
## SBOM (Software Bill of Materials)
5973

6074
We generate SBOMs for the binaries and the Docker image.
6175

6276
### Binaries
6377

64-
The SBOMs for the binaries are available in the releases page. The SBOMs are generated using [syft](https://github.com/anchore/syft) and are available in SPDX format.
78+
The SBOMs for the binaries are available in the releases page. The SBOMs are generated
79+
using [syft](https://github.com/anchore/syft) and are available in SPDX format.
6580

6681
### Docker Images
6782

68-
The SBOM for the Docker image is available in the [GitHub Container](https://github.com/nginxinc/nginx-kubernetes-gateway/pkgs/container/nginx-kubernetes-gateway) repository. The SBOM is generated using [syft](https://github.com/anchore/syft) and stored as an attestation in the image manifest.
83+
The SBOM for the Docker image is available in
84+
the [GitHub Container](https://github.com/nginxinc/nginx-kubernetes-gateway/pkgs/container/nginx-kubernetes-gateway)
85+
repository. The SBOM is generated using [syft](https://github.com/anchore/syft) and stored as an attestation in the
86+
image manifest.
87+
88+
For example to retrieve the SBOM for `linux/amd64` and analyze it using [grype](https://github.com/anchore/grype) you
89+
can run the following command:
6990

70-
For example to retrieve the SBOM for `linux/amd64` and analyze it using [grype](https://github.com/anchore/grype) you can run the following command:
7191
```shell
7292
docker buildx imagetools inspect ghcr.io/nginxinc/nginx-kubernetes-gateway:edge --format '{{ json (index .SBOM "linux/amd64").SPDX }}' | grype
7393
```
@@ -76,11 +96,14 @@ docker buildx imagetools inspect ghcr.io/nginxinc/nginx-kubernetes-gateway:edge
7696

7797
We’d like to hear your feedback! If you experience issues with our Gateway Controller, please [open a bug][bug] in
7898
GitHub. If you have any suggestions or enhancement requests, please [open an idea][idea] on GitHub discussions. You can
79-
contact us directly via [email protected] or on the [NGINX Community Slack][slack] in the `#nginx-kubernetes-gateway`
99+
contact us directly via [email protected] or on the [NGINX Community Slack][slack] in
100+
the `#nginx-kubernetes-gateway`
80101
channel.
81102

82103
[bug]:https://github.com/nginxinc/nginx-kubernetes-gateway/issues/new?assignees=&labels=&projects=&template=bug_report.md&title=
104+
83105
[idea]:https://github.com/nginxinc/nginx-kubernetes-gateway/discussions/categories/ideas
106+
84107
[slack]: https://nginxcommunity.slack.com/channels/nginx-kubernetes-gateway
85108

86109
## Contributing

0 commit comments

Comments
 (0)