Skip to content

Commit 60e5f8e

Browse files
CopilotMalcolmnixon
andcommitted
Add code quality checks with cspell, markdownlint, and yamllint
Co-authored-by: Malcolmnixon <1863707+Malcolmnixon@users.noreply.github.com>
1 parent 75548c2 commit 60e5f8e

File tree

5 files changed

+99
-0
lines changed

5 files changed

+99
-0
lines changed

.cspell.json

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
{
2+
"version": "0.2",
3+
"language": "en",
4+
"words": [
5+
"SPDX",
6+
"SpdxModel",
7+
"DemaConsulting",
8+
"SBOM",
9+
"sbom",
10+
"dotnet",
11+
"NuGet",
12+
"nuget",
13+
"spdx",
14+
"deserializer",
15+
"serializer",
16+
"Dema",
17+
"workflow",
18+
"workflows",
19+
"yamllint",
20+
"markdownlint",
21+
"cspell",
22+
"Copilot",
23+
"opencover",
24+
"OpenCover"
25+
],
26+
"ignorePaths": [
27+
"**/*.spdx.json",
28+
"**/bin/**",
29+
"**/obj/**",
30+
"**/.git/**",
31+
"**/node_modules/**",
32+
"**/*.nupkg",
33+
"**/*.snupkg"
34+
]
35+
}

.github/workflows/build_on_push.yaml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,29 @@ on:
88
- cron: '0 17 * * 1'
99

1010
jobs:
11+
code-quality:
12+
name: Code Quality
13+
runs-on: ubuntu-latest
14+
permissions:
15+
contents: read # To read repository contents
16+
steps:
17+
- name: Checkout
18+
uses: actions/checkout@v6
19+
20+
- name: Check Spelling
21+
uses: streetsidesoftware/cspell-action@v8
22+
23+
- name: Check Markdown
24+
uses: DavidAnson/markdownlint-cli2-action@v22
25+
with:
26+
globs: '**/*.md'
27+
28+
- name: Check YAML
29+
uses: ibiqlik/action-yamllint@v3
30+
with:
31+
file_or_dir: .
32+
config_file: .yamllint.yaml
33+
1134
build-windows:
1235
name: Build Windows
1336
permissions:

.markdownlint.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"default": true,
3+
"MD003": { "style": "atx" },
4+
"MD007": { "indent": 2 },
5+
"MD013": { "line_length": 120 },
6+
"MD033": false,
7+
"MD041": false
8+
}

.yamllint.yaml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
---
2+
# yamllint configuration for SpdxModel
3+
# This configuration defines the rules for YAML file linting
4+
5+
extends: default
6+
7+
rules:
8+
# Allow 'on:' in GitHub Actions workflows (not a boolean value)
9+
truthy:
10+
allowed-values: ['true', 'false', 'on', 'off']
11+
check-keys: true
12+
13+
# Allow longer lines for URLs and complex expressions
14+
line-length:
15+
max: 120
16+
level: error
17+
18+
# Ensure proper indentation
19+
indentation:
20+
spaces: 2
21+
indent-sequences: true
22+
23+
# Ensure proper comment formatting
24+
comments:
25+
min-spaces-from-content: 2

AGENTS.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,13 @@ The project uses several code quality and analysis tools:
8484
- CodeQL for security analysis
8585
- All code changes must pass static analysis checks
8686

87+
* **Linting and Code Quality**:
88+
- `cspell` for spell checking (configured in `.cspell.json`)
89+
- `markdownlint-cli2` for Markdown file linting (configured in `.markdownlint.json`)
90+
- `yamllint` for YAML file linting (configured in `.yamllint.yaml`)
91+
- Code quality checks run automatically in CI pipeline
92+
- Run locally: `npx cspell lint "**/*.md"`, `npx markdownlint-cli2 "**/*.md"`, `yamllint .`
93+
8794
* **Editor Configuration**:
8895
- `.editorconfig` defines consistent code style rules
8996
- Ensure your editor respects EditorConfig settings
@@ -122,6 +129,7 @@ The project uses several code quality and analysis tools:
122129

123130
* All changes are validated by GitHub Actions CI
124131
* CI pipeline includes:
132+
- Code quality checks (spell checking, Markdown linting, YAML linting)
125133
- Building on multiple .NET versions (8, 9, 10)
126134
- Running all unit tests
127135
- Code coverage collection

0 commit comments

Comments
 (0)