Skip to content

Commit 624c6ad

Browse files
authored
Jts contrib and linting fixes (#6494)
* feat(ci): improve linting configuration for instruction files - Add GitHub-flavored Markdown support with remark-gfm - Create generic Vale config (.vale-instructions.ini) for instruction files - Use pattern-based file inclusion instead of explicit file lists - Mount repository to /workdir in remark-lint container to preserve node_modules Changes: - Add remark-gfm to .ci/remark-lint/package.json - Create .remarkrc.yaml at repository root for instruction files - Update content/.remarkrc.yaml to include remark-gfm - Create .vale-instructions.ini for generic writing rules - Update compose.yaml: mount repo to /workdir (preserves /app/node_modules) - Update lefthook.yml: use glob patterns for uppercase .md files and .github/**/*.md - Update DOCS-CONTRIBUTING.md: remove empty CONTRIBUTING.md directory reference Benefits: - Automatic inclusion of new instruction files without config updates - Pattern matching for uppercase .md files (DOCS-*.md, CLAUDE.md, etc.) - Coverage for .github/, .claude/, api-docs/ directories - GFM features: tables, task lists, strikethrough, autolinks, footnotes - Separate linting rules for instruction files vs product documentation feat(lint): separate remark-lint auto-fix for instructions vs report-only for content - Split lint-markdown into two hooks: - lint-markdown-instructions: Auto-fixes README, DOCS-*.md, .github/**, .claude/** - lint-markdown-content: Reports issues in content/**, api-docs/** without modifying - Changed remark-lint volume mount from read_only: true to read_only: false - Instruction files now behave like Prettier (auto-fix + stage) - Content files report errors and block commits until manually fixed * chore(instructions): Add content/shared details, husky/lefthook updates
1 parent 56c173e commit 624c6ad

File tree

11 files changed

+112
-26
lines changed

11 files changed

+112
-26
lines changed

.ci/remark-lint/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"license": "MIT",
44
"devDependencies": {
55
"remark-cli": "12.0.1",
6+
"remark-gfm": "4.0.1",
67
"remark-preset-lint-consistent": "6.0.0",
78
"remark-preset-lint-markdown-style-guide": "6.0.0",
89
"remark-preset-lint-recommended": "7.0.0",

.ci/vale/styles/.vale-config/1-Hugo.ini

Lines changed: 0 additions & 10 deletions
This file was deleted.

.husky/_/pre-commit

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,9 @@ call_lefthook()
3333
then
3434
"$dir/node_modules/lefthook/bin/index.js" "$@"
3535

36+
elif go tool lefthook -h >/dev/null 2>&1
37+
then
38+
go tool lefthook "$@"
3639
elif bundle exec lefthook -h >/dev/null 2>&1
3740
then
3841
bundle exec lefthook "$@"
@@ -42,12 +45,21 @@ call_lefthook()
4245
elif pnpm lefthook -h >/dev/null 2>&1
4346
then
4447
pnpm lefthook "$@"
45-
elif swift package plugin lefthook >/dev/null 2>&1
48+
elif swift package lefthook >/dev/null 2>&1
4649
then
47-
swift package --disable-sandbox plugin lefthook "$@"
50+
swift package --build-path .build/lefthook --disable-sandbox lefthook "$@"
4851
elif command -v mint >/dev/null 2>&1
4952
then
5053
mint run csjones/lefthook-plugin "$@"
54+
elif uv run lefthook -h >/dev/null 2>&1
55+
then
56+
uv run lefthook "$@"
57+
elif mise exec -- lefthook -h >/dev/null 2>&1
58+
then
59+
mise exec -- lefthook "$@"
60+
elif devbox run lefthook -h >/dev/null 2>&1
61+
then
62+
devbox run lefthook "$@"
5163
else
5264
echo "Can't find lefthook in PATH"
5365
fi

.husky/_/pre-push

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,9 @@ call_lefthook()
3333
then
3434
"$dir/node_modules/lefthook/bin/index.js" "$@"
3535

36+
elif go tool lefthook -h >/dev/null 2>&1
37+
then
38+
go tool lefthook "$@"
3639
elif bundle exec lefthook -h >/dev/null 2>&1
3740
then
3841
bundle exec lefthook "$@"
@@ -42,12 +45,21 @@ call_lefthook()
4245
elif pnpm lefthook -h >/dev/null 2>&1
4346
then
4447
pnpm lefthook "$@"
45-
elif swift package plugin lefthook >/dev/null 2>&1
48+
elif swift package lefthook >/dev/null 2>&1
4649
then
47-
swift package --disable-sandbox plugin lefthook "$@"
50+
swift package --build-path .build/lefthook --disable-sandbox lefthook "$@"
4851
elif command -v mint >/dev/null 2>&1
4952
then
5053
mint run csjones/lefthook-plugin "$@"
54+
elif uv run lefthook -h >/dev/null 2>&1
55+
then
56+
uv run lefthook "$@"
57+
elif mise exec -- lefthook -h >/dev/null 2>&1
58+
then
59+
mise exec -- lefthook "$@"
60+
elif devbox run lefthook -h >/dev/null 2>&1
61+
then
62+
devbox run lefthook "$@"
5163
else
5264
echo "Can't find lefthook in PATH"
5365
fi

.husky/_/prepare-commit-msg

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,9 @@ call_lefthook()
3333
then
3434
"$dir/node_modules/lefthook/bin/index.js" "$@"
3535

36+
elif go tool lefthook -h >/dev/null 2>&1
37+
then
38+
go tool lefthook "$@"
3639
elif bundle exec lefthook -h >/dev/null 2>&1
3740
then
3841
bundle exec lefthook "$@"
@@ -42,12 +45,21 @@ call_lefthook()
4245
elif pnpm lefthook -h >/dev/null 2>&1
4346
then
4447
pnpm lefthook "$@"
45-
elif swift package plugin lefthook >/dev/null 2>&1
48+
elif swift package lefthook >/dev/null 2>&1
4649
then
47-
swift package --disable-sandbox plugin lefthook "$@"
50+
swift package --build-path .build/lefthook --disable-sandbox lefthook "$@"
4851
elif command -v mint >/dev/null 2>&1
4952
then
5053
mint run csjones/lefthook-plugin "$@"
54+
elif uv run lefthook -h >/dev/null 2>&1
55+
then
56+
uv run lefthook "$@"
57+
elif mise exec -- lefthook -h >/dev/null 2>&1
58+
then
59+
mise exec -- lefthook "$@"
60+
elif devbox run lefthook -h >/dev/null 2>&1
61+
then
62+
devbox run lefthook "$@"
5163
else
5264
echo "Can't find lefthook in PATH"
5365
fi

.remarkrc.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
settings:
2+
bullet: "-"
3+
4+
plugins:
5+
# GitHub-flavored Markdown support (tables, task lists, strikethrough, etc.)
6+
- remark-gfm
7+
- remark-frontmatter
8+
# Check that markdown is consistent (list items have the same indentation)
9+
- remark-preset-lint-consistent

.vale-instructions.ini

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
StylesPath = .ci/vale/styles
2+
3+
MinAlertLevel = warning
4+
5+
# Use general technical writing packages
6+
Packages = write-good
7+
8+
[*.md]
9+
# Base styles focused on clarity and consistency
10+
BasedOnStyles = Vale, write-good
11+
12+
# Disable style rules that are too opinionated for instruction files
13+
Vale.Spelling = NO

DOCS-CONTRIBUTING.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,10 @@ docs-v2 contains a `./.vscode/settings.json` that configures the following exten
120120

121121
### Style Guidelines
122122

123+
#### Content Guidelines
124+
125+
Content follows Google Developer Documentation Style Guide and YouTube API documentation patterns with a few InfluxData-specific adaptations.
126+
123127
#### Markdown
124128

125129
Most docs-v2 documentation content uses [Markdown](https://en.wikipedia.org/wiki/Markdown).

compose.yaml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -511,17 +511,18 @@ services:
511511
remark-lint:
512512
container_name: remark-lint
513513
build:
514-
context: .
514+
context: .
515515
dockerfile: .ci/Dockerfile.remark
516516
profiles:
517517
- lint
518518
volumes:
519+
# Mount repository to /workdir to avoid overwriting /app/ node_modules
520+
# Remark will receive paths like /workdir/content/file.md or /workdir/README.md
521+
# Writable mount allows auto-fixing instruction files (README.md, DOCS-*.md, etc.)
519522
- type: bind
520-
source: ./content
521-
target: /app/content
522-
- type: bind
523-
source: ./CONTRIBUTING.md
524-
target: /app/CONTRIBUTING.md
523+
source: .
524+
target: /workdir
525+
read_only: false
525526
volumes:
526527
test-content:
527528
cloud-tmp:

content/.remarkrc.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ settings:
44
plugins:
55
# Before you can configure plugins for remark here, you need to add them to
66
# the `devDependencies` in the `package.json` file--for CI: `/.ci/app/package.json`.
7+
- remark-gfm
78
- remark-frontmatter
89
- remark-lint-frontmatter-schema
910
- remark-lint-no-shell-dollars

0 commit comments

Comments
 (0)