Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .ls-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ ls:
.dir: regex:\.?[a-z0-9]+(-[a-z0-9]+)*
.md: regex:[a-z0-9]*([._][a-z0-9]+)* | regex:(README|CONTRIBUTING|CHANGELOG|AGENTS|CLAUDE|SKILL|CONTENT_LICENSE)
.yaml: regex:[a-z0-9]*([._][a-z0-9]+)* | regex:pnpm-(lock|workspace)
.yml: regex:[a-z0-9]+(-[a-z0-9]+)*

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: The new .yml rule now applies to every *.yml file in the repo, not just workflow files. That includes the dot-prefixed .ls-lint.yml and .commitlintrc.yml. The regex [a-z0-9]+(-[a-z0-9]+)* can't match a leading dot. If ls-lint picks .yml as the extension for those files, it checks the names .ls-lint and .commitlintrc and the ls_lint pre-commit hook fails. Before this change, .yml files fell through to .*, whose [._] prefix allows a leading dot, and .dir already allows one with \.?. I couldn't run ls-lint here to confirm, so please run ls_lint locally. If it fails, a fix that keeps kebab-case:

Suggested change
.yml: regex:[a-z0-9]+(-[a-z0-9]+)*
.yml: regex:\.?[a-z0-9]+(-[a-z0-9]+)*

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Refuting with a local run: ls_lint passes on this commit (bb5cc6d), including the dot-prefixed .ls-lint.yml and .commitlintrc.yml; the lefthook pre-commit ls-lint job also passed when the commit was created. ls-lint takes the extension from the last dot after the leading dot, so a dot-prefixed file is checked as ls-lint / commitlintrc, which match the kebab-case regex. Before this change the same job failed on external-links.yml, so the rule is exercised. No change needed.

.*: regex:[a-z0-9]*([._][a-z0-9]+)*

ignore:
Expand Down
2 changes: 1 addition & 1 deletion src/external_links_workflow.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { readFileSync } from "node:fs";
import { expect, test } from "vitest";

const workflow = readFileSync(
new URL("../.github/workflows/external_links.yml", import.meta.url),
new URL("../.github/workflows/external-links.yml", import.meta.url),
"utf8",
);

Expand Down
Loading