Skip to content

Check the whole project for kebab-case identifiers - #106

Open
saecki wants to merge 1 commit into
gh-actionfrom
kebab-case
Open

saecki wants to merge 1 commit into
gh-actionfrom
kebab-case

Conversation

@saecki

@saecki saecki commented Nov 19, 2026 •

Copy link
Copy Markdown
Member

Closes #91

I've tweaked the checks a little bit to allow for leading and trailing underscores. Let me know what you think of that.

@saecki
saecki added this pull request to stack #107 November 19, 2026 11:32
Comment thread tests/local/sixth/0.1.0/lib.typ Resolved
name = "first"
version = "0.1.0"
entrypoint = "lib.typ"
compiler = "0.13.1"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Is there a reason to include that change in this PR?

@saecki saecki Nov 20, 2026 •

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

The lint was previously tested on itemize, but it produced many kebab-case warnings and the snapshot got a bit noisy, so I removed it. Similarly for elembic, which tested the Typst in description lint.

Comment thread src/check/kebab_case.rs Outdated
/// SCREAMING-KEBAB-CASE.
fn is_recommended_binding_name(ident: &str) -> bool {
let ident = trim_underscores(ident);
is_lower_kebab_case(ident) || is_upper_kebab_case(ident) || is_upper_snake_case(ident)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I'm not 100% sure we should keep allowing UPPER_SNAKE_CASE. It seems more natural to write (at least for me), but it is also inconsistent with the general rule. With lint filtering, it would also be possible to write a regex to allow for it if really needed.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Yeah, I would also be fine with removing it. Maybe we should then also remove the leading and trailing underscore support? It seems easy enough two write something like allow-matches = ["_[a-z][a-z0-9]*(_[a-z0-9]+)*"]

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I disallowed UPPER_SNAKE_CASE

@saecki
saecki removed this pull request from stack #107 November 25, 2026 10:50
@saecki
saecki added this pull request to stack #110 November 25, 2026 10:50
@saecki
saecki removed this pull request from stack #110 November 25, 2026 10:53
@saecki
saecki changed the base branch from lint-categories to gh-action November 25, 2026 10:54
@saecki
saecki added this pull request to stack #112 November 25, 2026 10:54
@saecki
saecki marked this pull request as ready for review November 26, 2026 09:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

kebab-case: check exported modules recursively

2 participants