Skip to content

ci(lint): validate name metadata - #402

Merged
nekowinston merged 4 commits into
catppuccin:mainfrom
uncenter:feat/lint-metadata-name
Dec 14, 2023
Merged

ci(lint): validate name metadata#402
nekowinston merged 4 commits into
catppuccin:mainfrom
uncenter:feat/lint-metadata-name

Conversation

@uncenter

Copy link
Copy Markdown
Member

No description provided.

Comment thread scripts/lint/metadata.ts Outdated
@isabelroses

Copy link
Copy Markdown
Member

This should probably also validate other @'s in the userstyles meta block too. For example using @license outside will also create an error.

@uncenter

Copy link
Copy Markdown
Member Author

I think you misunderstand. This lints the actual value of @name. I think what you are suggesting is to make sure there aren't other @name/@<usercss-metadata-variable> outside of the meta block?

@uncenter

uncenter commented Dec 14, 2023

Copy link
Copy Markdown
Member Author

Screenshot 2023-12-14 at 07 17 05 (Arc)

Other than the first two (different issue - fixed in #399), this is working as expected. Verifies that the name provided in the userstyles.yml file matches the actual userstyle's name. WhatsApp Web has an extra space, others have capitalization issues or differ in some way. Might want to make it clear that one of the names isn't necessarily better but just that they don't match?

@isabelroses

Copy link
Copy Markdown
Member

I think you misunderstand. This lints the actual value of @name. I think what you are suggesting is to make sure there aren't other @name/@<usercss-metadata-variable> outside of the meta block?

ohhh that makes sense, thanks for informing me

@uncenter

Copy link
Copy Markdown
Member Author

I think you misunderstand. This lints the actual value of @name. I think what you are suggesting is to make sure there aren't other @name/@<usercss-metadata-variable> outside of the meta block?

ohhh that makes sense, thanks for informing me

Np. Not a bad idea though, but this PR (and the linter in general) will in a way let us know if @name (or other vars) is/are used elsewhere since that will be flagged when parsed incorrectly.

@uncenter
uncenter marked this pull request as ready for review December 14, 2023 12:26
Comment thread scripts/lint/metadata.ts Outdated
@uncenter

Copy link
Copy Markdown
Member Author

Semi-dependent on #399 btw.

@nekowinston

nekowinston commented Dec 14, 2023

Copy link
Copy Markdown
Contributor

Semi-dependent on #399 btw.

in the sense of it throwing warnings until that PR is merged? Or are there other blockers?

@uncenter

uncenter commented Dec 14, 2023

Copy link
Copy Markdown
Member Author

Yep, just that there is an issue with the usercss-meta package where if you have @name (or any @<variable> from the meta block) anywhere outside of the meta block (lengthy conversation about it), it messes up the parsing. We fixed it in #399 since it was relevant there.

@nekowinston nekowinston left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM then, don't really care about the warnings showing up for the next few commits.

@uncenter

uncenter commented Dec 14, 2023

Copy link
Copy Markdown
Member Author

There are some legitimate issues raised by the linter with the addition of this PR though. Should I fix them here or in a separate PR after this merges?

@uncenter
uncenter requested a review from nekowinston December 14, 2023 16:34
@nekowinston

Copy link
Copy Markdown
Contributor

Sure, let's go for the mass ping again 馃槄

@github-actions github-actions Bot added anilist AniList chess.com Chess.com github GitHub hacker-news Hacker News hoppscotch Hoppscotch lichess Lichess reddit Reddit whatsapp-web WhatsApp Web wikiwand Wikiwand labels Dec 14, 2023
@nekowinston
nekowinston merged commit 5bb6f6d into catppuccin:main Dec 14, 2023
@@ -1,5 +1,5 @@
/* ==UserStyle==
@name Lichess Catppuccin
@name lichess Catppuccin

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 think we should make the name uppercase in userstyles.yml (and here), see #346 (comment) for the conversation from a while back

@@ -1,5 +1,5 @@
/* ==UserStyle==
@name Wikiwand Catppuccin

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.

Actually we need to change userstyles.yml here as well:
Screenshot 2023-12-14 at 11 46 00 (Arc)

@uncenter

Copy link
Copy Markdown
Member Author

Bruh-

@uncenter uncenter mentioned this pull request Dec 14, 2023
2 tasks
@uncenter
uncenter deleted the feat/lint-metadata-name branch December 14, 2023 16:57
@uncenter

Copy link
Copy Markdown
Member Author

@nekowinston is there a reason we are using esm.sh for type-fest but the npm: modifier for other NPM packages?

@nekowinston

nekowinston commented Dec 14, 2023

Copy link
Copy Markdown
Contributor

Yeah, type-fest is already in cache since our deno-lib uses ESM imports.

@uncenter

Copy link
Copy Markdown
Member Author

Ohhh right neat.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

anilist AniList chess.com Chess.com github GitHub hacker-news Hacker News hoppscotch Hoppscotch lichess Lichess reddit Reddit whatsapp-web WhatsApp Web wikiwand Wikiwand

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants