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

Validate syntaxes #172

Open
teoli2003 opened this issue Feb 7, 2018 · 2 comments
Open

Validate syntaxes #172

teoli2003 opened this issue Feb 7, 2018 · 2 comments
Labels
help wanted If you know something about this topic, we would love your help! idle Issues and pull requests with no activity for three months.

Comments

@teoli2003
Copy link
Contributor

Hi!

Properties and selector syntaxes make use of lower-level syntaxes.

Unless they are "basic" types (that has their own page on MDN), these lower-level syntax are defined in syntaxes.json (and so on, recursively)

It is fastidious and error-prone to be sure not to forget one of these lower-level syntaxes definition. It is also complex for the reviewers to spot them.

We should write a test, run by ci that detect this.

@teoli2003 teoli2003 added the help wanted If you know something about this topic, we would love your help! label Feb 7, 2018
@lahmatiy
Copy link
Contributor

lahmatiy commented Feb 7, 2018

I have long wanted to add syntax validation using CSSTree into test script. Currently CSSTree supports CSS Values and Units module grammar. However some syntaxes (e.g. selectors, at-rules etc) has extended grammar (i.e. uses tokens that are not defined by V&U module) and can't be parsed by CSSTree at the moment. There are two options:

  • improve CSSTree to be able process all the syntaxes, but that's need a time – don't know when it happen
  • add a validation but use a blacklist for a bad syntaxes – that's not an ideal solution, but most syntaxes can be validated right now

What do you think? Are there other options how to do this?

@wbamberg
Copy link
Contributor

I think this would be great, and had been wondering the same thing. My preference would be your second option. Even simpler, could we just validate properties (and their dependent syntax)? Just that would be really useful.

@github-actions github-actions bot added the idle Issues and pull requests with no activity for three months. label Jan 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted If you know something about this topic, we would love your help! idle Issues and pull requests with no activity for three months.
Projects
None yet
Development

No branches or pull requests

3 participants