Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add markup scopes to themelint #3983

Closed
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
17 changes: 17 additions & 0 deletions xtask/src/themelint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,23 @@ fn get_rules() -> Vec<Require> {
// Check for visible cursor
Require::Existence(Rule::has_bg("ui.cursor.primary")),
Require::Existence(Rule::has_either("ui.cursor.match")),
// Markup scopes
Require::Existence(Rule::has_either("markup.heading.1")),
Require::Existence(Rule::has_either("markup.heading.2")),
Require::Existence(Rule::has_either("markup.heading.3")),
Require::Existence(Rule::has_either("markup.heading.4")),
Require::Existence(Rule::has_either("markup.heading.5")),
Require::Existence(Rule::has_either("markup.heading.6")),
Comment on lines +54 to +59
Copy link
Member

Choose a reason for hiding this comment

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

I think it's valid for a theme to only define markup.heading and not .marker or the .n for headings

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Defining markup.heading will make all these pass, but not defining it will force you to define everything.

Copy link
Contributor

Choose a reason for hiding this comment

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

If anything I think the error should be on markup.heading instead of .1... which is a bit misleading.

Require::Existence(Rule::has_either("markup.heading.marker")),
Require::Existence(Rule::has_either("markup.bold")),
Require::Existence(Rule::has_either("markup.italic")),
Require::Existence(Rule::has_either("markup.quote")),
Require::Existence(Rule::has_either("markup.list")),
Require::Existence(Rule::has_either("markup.link.label")),
Require::Existence(Rule::has_either("markup.link.url")),
Require::Existence(Rule::has_either("markup.link.text")),
Require::Existence(Rule::has_either("markup.raw.inline")),
Require::Existence(Rule::has_either("markup.raw.block")),
]
}

Expand Down