-
-
Notifications
You must be signed in to change notification settings - Fork 169
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
ci(lint): add checks for variables #522
Conversation
You can go to the files tab and scroll all the way to the bottom to see the annotations this adds. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can replace this with JSON.stringify AFAIK, output on my end still looked fine
My primary concern is that this output won't be understandable since it doesn't match what you see for each variable in the CSS file (i.e. not the
|
what about just saying
so you actually have something to copy; it'd be a few hardcoded strings but only for light/dark flavors, or flavor, + accent. Also we should probably default to mauve instead of sapphire since that is what all other UI stuff of big ports defaults to. |
Hmm, I've given this some thought and take a look at the lint annotations now. I think they are very readable, however I didn't make it "copyable" because often it was very hard to tell what was actually wrong with what you had.
This would probably be a separate follow up PR since I'm just going off of the template but yeah sounds good. |
I just meant if the assertions against
|
Yeah I implemented that and it didn't look right. It seems like being able to copy it would be the easiest but it was frustrating because it was difficult to figure out why what you had was wrong. |
It doesn't matter why its wrong, we literally know what string should be there from the template |
In my opinion understanding why the linter is yelling at you is pretty important. |
For the boilerplate header, the "why" isn't actually important. It's the same for every single userstyle. For any non-experienced contributors (who are the real targets / likely recipients of these lints), it's important to be concise and precise. With a JSON log, you must manually inspect it, interpret what it means, and apply those changes. This is difficult. There is little correlation between the JSON output and the original Stylus header, which makes understanding / fixing the problem at hand significantly harder, and will overall increase friction between potential contributors and mantainers. On the topic of interpretation, without colour the diff is extremely hard to read. This is exacerbated by the fact that this lint will often fail for very subtle copy errors (as you showed in the example). With the problem source of this lint (copy errors) in mind, it only makes sense to directly inform readers that this is the case.
Lints are for contributors, not maintainers, so we should cater to them. |
If you look at the current lint annotations you will see that the JSON output is no longer in use.
From what I can gather it seems like people prefer to know what they did wrong though. I expect a contributor might compare what the linter suggests to what they have, and it is usually a very subtle difference and likely frustrating as they don't understand what they had wrong - I implemented that as Winston had suggested earlier and that's how I felt ahah. For context, this is what the lint annotations look as of right now:
Maybe a combination of "suggest what they should have" and "tell them precisely what the issue is" would be best?
|
I don't see why we need to be this specific. The contributor does not need to care what is actually wrong, it's a boilerplate. If it were lints in code they wrote, absolutely we should be specific. This is not the case, however. As for your latter suggestion, I'm not sure why we'd duplicate the information? Above details why they don't need specifics, just the general case. |
Alright. I've made the changes, please check the lint annotations now and tell me what you think :) |
Looks good now I think, just one question there! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can revisit refactoring this to be nicer at some point in the future, but it works, and isn't terribly big, so not a huge deal.
So now the question is how we resolve the lint errors. Separate follow up PR? Some of the errors are about userstyles that only have a single |
2 questions:
|
Yep, but I think it would be confusing to warnings on files unrelated to your own PR lol. But yes, not failing.
Uhh I think the consensus is it should always be set. Some people (such as me, occasionally) like to toggle their system theme and have that theme matched everywhere else. It wouldn't be a problem for people who don't change their system theme, and even then they can just set both |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A PR to fix the warnings seems like a good next step after merging this 👍
This is some atrocious code and probably isn't worth adding this mess but I thought I'd give linting variables a try.