Skip to content

Commit 12fed8d

Browse files
author
Mohammed Munir Abdi
authored
458: Markdown linter as a local npm script & Git Action execution (#503)
2 parents e6d555c + 717ec72 commit 12fed8d

17 files changed

+658
-393
lines changed

.github/workflows/linting.yaml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: Markdown Linter
2+
on: [pull_request, push]
3+
permissions:
4+
contents: read
5+
jobs:
6+
lint:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- name: Checkout markdown
10+
uses: actions/checkout@v4.2.0
11+
- name: Lint markdown
12+
uses: DavidAnson/markdownlint-cli2-action@v17
13+
continue-on-error: true
14+
with:
15+
config: '.markdownlint.yml'
16+
globs: |
17+
docs/*.md
18+
!examples/*.md

.markdownlint.yml

Lines changed: 140 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,140 @@
1+
default: false
2+
3+
# MD001/heading-increment : Heading levels should only increment by one level at a time : https://github.com/DavidAnson/markdownlint/blob/v0.33.0/doc/md001.md
4+
MD001: true
5+
6+
# MD003/heading-style : Heading style : https://github.com/DavidAnson/markdownlint/blob/v0.33.0/doc/md003.md
7+
MD003:
8+
style: "consistent"
9+
10+
# MD004/ul-style : Unordered list style : https://github.com/DavidAnson/markdownlint/blob/v0.33.0/doc/md004.md
11+
MD004:
12+
style: "consistent"
13+
14+
# MD005/list-indent : Inconsistent indentation for list items at the same level : https://github.com/DavidAnson/markdownlint/blob/v0.33.0/doc/md005.md
15+
MD005: true
16+
17+
# MD007/ul-indent : Unordered list indentation : https://github.com/DavidAnson/markdownlint/blob/v0.33.0/doc/md007.md
18+
MD007:
19+
indent: 4
20+
21+
# MD009/no-trailing-spaces : Trailing spaces : https://github.com/DavidAnson/markdownlint/blob/v0.33.0/doc/md009.md
22+
MD009: true
23+
24+
# MD010/no-hard-tabs : Hard tabs : https://github.com/DavidAnson/markdownlint/blob/v0.33.0/doc/md010.md
25+
MD010: true
26+
27+
# MD011/no-reversed-links : Reversed link syntax : https://github.com/DavidAnson/markdownlint/blob/v0.33.0/doc/md011.md
28+
MD011: true
29+
30+
# MD012/no-multiple-blanks : Multiple consecutive blank lines : https://github.com/DavidAnson/markdownlint/blob/v0.33.0/doc/md012.md
31+
MD012: true
32+
33+
# MD014/commands-show-output : Dollar signs used before commands without showing output : https://github.com/DavidAnson/markdownlint/blob/v0.33.0/doc/md014.md
34+
MD014: true
35+
36+
# MD018/no-missing-space-atx : No space after hash on atx style heading : https://github.com/DavidAnson/markdownlint/blob/v0.33.0/doc/md018.md
37+
MD018: true
38+
39+
# MD019/no-multiple-space-atx : Multiple spaces after hash on atx style heading : https://github.com/DavidAnson/markdownlint/blob/v0.33.0/doc/md019.md
40+
MD019: true
41+
42+
# MD020/no-missing-space-closed-atx : No space inside hashes on closed atx style heading : https://github.com/DavidAnson/markdownlint/blob/v0.33.0/doc/md020.md
43+
MD020: true
44+
45+
# MD021/no-multiple-space-closed-atx : Multiple spaces inside hashes on closed atx style heading : https://github.com/DavidAnson/markdownlint/blob/v0.33.0/doc/md021.md
46+
MD021: true
47+
48+
# MD022/blanks-around-headings : Headings should be surrounded by blank lines : https://github.com/DavidAnson/markdownlint/blob/v0.33.0/doc/md022.md
49+
MD022: true
50+
51+
# MD023/heading-start-left : Headings must start at the beginning of the line : https://github.com/DavidAnson/markdownlint/blob/v0.33.0/doc/md023.md
52+
MD023: true
53+
54+
# MD024/no-duplicate-heading : Multiple headings with the same content : https://github.com/DavidAnson/markdownlint/blob/v0.33.0/doc/md024.md
55+
MD024:
56+
siblings_only: true
57+
58+
# MD025/single-title/single-h1 : Multiple top-level headings in the same document : https://github.com/DavidAnson/markdownlint/blob/v0.33.0/doc/md025.md
59+
MD025: true
60+
61+
# MD026/no-trailing-punctuation : Trailing punctuation in heading : https://github.com/DavidAnson/markdownlint/blob/v0.33.0/doc/md026.md
62+
MD026: true
63+
64+
# MD027/no-multiple-space-blockquote : Multiple spaces after blockquote symbol : https://github.com/DavidAnson/markdownlint/blob/v0.33.0/doc/md027.md
65+
MD027: true
66+
67+
# MD028/no-blanks-blockquote : Blank line inside blockquote : https://github.com/DavidAnson/markdownlint/blob/v0.33.0/doc/md028.md
68+
MD028: true
69+
70+
# MD029/ol-prefix : Ordered list item prefix : https://github.com/DavidAnson/markdownlint/blob/v0.33.0/doc/md029.md
71+
MD029:
72+
style: "ordered"
73+
74+
# MD030/list-marker-space : Spaces after list markers : https://github.com/DavidAnson/markdownlint/blob/v0.33.0/doc/md030.md
75+
MD030:
76+
ul_single: 1
77+
ol_single: 1
78+
ul_multi: 3
79+
ol_multi: 2
80+
81+
# MD031/blanks-around-fences : Fenced code blocks should be surrounded by blank lines : https://github.com/DavidAnson/markdownlint/blob/v0.33.0/doc/md031.md
82+
MD031: true
83+
84+
# MD032/blanks-around-lists : Lists should be surrounded by blank lines : https://github.com/DavidAnson/markdownlint/blob/v0.33.0/doc/md032.md
85+
MD032: true
86+
87+
# MD034/no-bare-urls : Bare URL used : https://github.com/DavidAnson/markdownlint/blob/v0.33.0/doc/md034.md
88+
MD034: true
89+
90+
# MD035/hr-style : Horizontal rule style : https://github.com/DavidAnson/markdownlint/blob/v0.33.0/doc/md035.md
91+
MD035: true
92+
93+
# MD036/no-emphasis-as-heading : Emphasis used instead of a heading : https://github.com/DavidAnson/markdownlint/blob/v0.33.0/doc/md036.md
94+
MD036: true
95+
96+
# MD037/no-space-in-emphasis : Spaces inside emphasis markers : https://github.com/DavidAnson/markdownlint/blob/v0.33.0/doc/md037.md
97+
MD037: true
98+
99+
# MD038/no-space-in-code : Spaces inside code span elements : https://github.com/DavidAnson/markdownlint/blob/v0.33.0/doc/md038.md
100+
MD038: true
101+
102+
# MD039/no-space-in-links : Spaces inside link text : https://github.com/DavidAnson/markdownlint/blob/v0.33.0/doc/md039.md
103+
MD039: true
104+
105+
# MD042/no-empty-links : No empty links : https://github.com/DavidAnson/markdownlint/blob/v0.33.0/doc/md042.md
106+
MD042: true
107+
108+
# MD045/no-alt-text : Images should have alternate text (alt text) : https://github.com/DavidAnson/markdownlint/blob/v0.33.0/doc/md045.md
109+
MD045: true
110+
111+
# MD046/code-block-style : Code block style : https://github.com/DavidAnson/markdownlint/blob/v0.33.0/doc/md046.md
112+
MD046:
113+
style: "fenced"
114+
115+
# MD047/single-trailing-newline : Files should end with a single newline character : https://github.com/DavidAnson/markdownlint/blob/v0.33.0/doc/md047.md
116+
MD047: true
117+
118+
# MD048/code-fence-style : Code fence style : https://github.com/DavidAnson/markdownlint/blob/v0.33.0/doc/md048.md
119+
MD048:
120+
style: "backtick"
121+
122+
# MD049/emphasis-style : Emphasis style : https://github.com/DavidAnson/markdownlint/blob/v0.33.0/doc/md049.md
123+
MD049:
124+
style: "asterisk"
125+
126+
# MD050/strong-style : Strong style : https://github.com/DavidAnson/markdownlint/blob/v0.33.0/doc/md050.md
127+
MD050:
128+
style: "consistent"
129+
130+
# MD051/link-fragments : Link fragments should be valid : https://github.com/DavidAnson/markdownlint/blob/v0.33.0/doc/md051.md
131+
MD051: true
132+
133+
# MD053/link-image-reference-definitions : Link and image reference definitions should be needed : https://github.com/DavidAnson/markdownlint/blob/v0.33.0/doc/md053.md
134+
MD053: true
135+
136+
# MD054/link-image-style : Link and image style : https://github.com/DavidAnson/markdownlint/blob/v0.33.0/doc/md054.md
137+
MD054: true
138+
139+
# MD056/table-column-count : Table column count : https://github.com/DavidAnson/markdownlint/blob/v0.33.0/doc/md056.md
140+
MD056: true

docs/blogs.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,4 @@
1111
| 2021-08-23 | [Shepherding your Cloud Native “cattle” with Tornjak](https://medium.com/universal-workload-identity/shepherding-your-cloud-native-cattle-with-tornjak-eb0b9a7c96bc) | Introduction to Tornjak |
1212
| 2021-08-26 | [Open source workload identity management could help secure hybrid clouds](https://research.ibm.com/blog/tornjak-project-cncf) | IBM donates Tornjak to CNCF |
1313

14-
1514
[Tornjak Channel on Medium](https://medium.com/universal-workload-identity)

docs/config-tornjak-server.md

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
This document is a reference for the Tornjak server, and it follows the [SPIRE server config](https://github.com/spiffe/spire/blob/main/doc/spire_server.md). It includes information about plugin types, built-in plugins, the server configuration file, plugin configuration, and command line options for `tornjak-agent` commands.
44

55
## Contents
6+
67
- [Command line options](#command-line-options)
78
- [The Tornjak Config](#the-tornjak-config)
89
- [General Tornjak Server Configs](#general-tornjak-server-configs)
@@ -20,20 +21,22 @@ The following flags are available for all tornjak-agent commands:
2021
| `--tornjak-config` | Config file path for Tornjak agent | | true |
2122
| `--expandEnv` | If flag included, expand environment variables in Tornjak config | false | false |
2223

23-
Note these flags are passed in directly through the Tornjak container.
24+
Note these flags are passed in directly through the Tornjak container.
2425

2526
### `tornjak-backend serverinfo`
26-
Prints the SPIRE config and Tornjak config given.
27+
28+
Prints the SPIRE config and Tornjak config given.
2729

2830
### `tornjak-backend http`
2931

30-
Runs the tornjak server.
32+
Runs the tornjak server.
3133

3234
## The Tornjak Config
3335

34-
The Tornjak config that is passed in must follow a specific format. Examples of this format can be found [below](#sample-configuration-files). In general, it is split into the `server` section with [general Tornjak server configs](#general-tornjak-server-configs), and the `plugins` section.
36+
The Tornjak config that is passed in must follow a specific format. Examples of this format can be found [below](#sample-configuration-files). In general, it is split into the `server` section with [general Tornjak server configs](#general-tornjak-server-configs), and the `plugins` section.
3537

3638
## General Tornjak Server Configs
39+
3740
The server config will contain information for the two potential connections: HTTP and HTTPS. HTTPS can be configured to follow TLS or mTLS protocol. See below for sample configuration:
3841

3942
```hcl
@@ -42,7 +45,7 @@ server {
4245
spire_socket_path = "unix:///tmp/spire-server/private/api.sock" # socket to communicate with SPIRE server
4346
4447
http { # required block
45-
port = 10000 # if HTTP enabled, opens HTTP listen port at container port 10000
48+
port = 10000 # if HTTP enabled, opens HTTP listen port at container port 10000
4649
}
4750
4851
https { # optional, recommended block
@@ -55,11 +58,11 @@ server {
5558
}
5659
```
5760

58-
We have two connection types that are opened by the server simultaneously: HTTP and HTTPS. HTTP is always operational. The optional HTTPS connection is recommended for production use case. When HTTPS is configured, the HTTP connection will redirect to the HTTPS (port and service).
61+
We have two connection types that are opened by the server simultaneously: HTTP and HTTPS. HTTP is always operational. The optional HTTPS connection is recommended for production use case. When HTTPS is configured, the HTTP connection will redirect to the HTTPS (port and service).
5962

60-
Under the HTTPS block, the fields `port`, `cert`, and `key` are required to enable TLS connection. To enable the mutual TLS (mTLS), you must additionally include the `client_ca` field, so the verification can be done bi-directionally.
63+
Under the HTTPS block, the fields `port`, `cert`, and `key` are required to enable TLS connection. To enable the mutual TLS (mTLS), you must additionally include the `client_ca` field, so the verification can be done bi-directionally.
6164

62-
For examples on enabling TLS and mTLS connections, please see [our TLS and mTLS documentation](../sample-keys/README.md).
65+
For examples on enabling TLS and mTLS connections, please see [our TLS and mTLS documentation](../sample-keys/README.md).
6366

6467
## About Tornjak plugins
6568

@@ -79,7 +82,7 @@ Tornjak supports several different plugin types, each representing a different f
7982

8083
| Type | Name | Description |
8184
| ---- | ---- | ----------- |
82-
| DataStore | [sql]() | Default SQL storage for Tornjak metadata |
85+
| DataStore | SQL | Default SQL storage for Tornjak metadata |
8386
| Authenticator | [keycloak](/docs/plugin_server_authentication_keycloak.md) | Perform OIDC Discovery and extract roles from `realmAccess.roles` field |
8487
| Authorizer | [RBAC](/docs/plugin_server_authorization_rbac.md) | Check api permission based on user role and defined authorization logic |
8588

@@ -111,6 +114,5 @@ We have an extended configuration file with comments on each section found [here
111114

112115
## Further reading
113116

114-
* [Tornjak Agent Architecture Overview](https://github.com/spiffe/tornjak/blob/main/docs/tornjak-agent.md)
115-
* [Tornjak API Documentation](https://github.com/spiffe/tornjak/blob/main/docs/tornjak-ui-api-documentation.md)
116-
117+
- [Tornjak Agent Architecture Overview](https://github.com/spiffe/tornjak/blob/main/docs/tornjak-agent.md)
118+
- [Tornjak API Documentation](https://github.com/spiffe/tornjak/blob/main/docs/tornjak-ui-api-documentation.md)

docs/newEntry-json-format.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
## JSON Format for New Entry
2+
13
```json
24
{
35
"entries": [
@@ -38,4 +40,4 @@
3840
}
3941
]
4042
}
41-
```
43+
```

0 commit comments

Comments
 (0)