openstyles / stylus

Stylus - Userstyles Manager
https://add0n.com/stylus.html
GNU General Public License v3.0
5.35k stars 302 forks source link

[Bugs] Wrong error reported, or error in error reporting (2pcs) #1753

Closed paponius closed 6 months ago

paponius commented 6 months ago

Bugs Report

Bugs Description

Dialog/status message given to the user on an error in a Style code is wrong/erroneous.

Expected:
1) "Minimal/maximal value is not a ..."
but always getting: "default value is not a ..."
2) saying there is an error in the regex.
instead: possibly sowing real error while checking the regex?

Screenshots

Screenshot 2024-03-07 005325

Screenshot 2024-03-07 010724

Screenshot 2024-03-07 010748

CSS Code

/* ==UserStyle==
@name           ? - Mar 2024
@namespace      github.com/paponius/userstyles
@version        0.0.9
@preprocessor   uso
                                       [default, min, max, step, units]
@var range    divWidth  "div width"    [100, 10, 1005, 10, "px"]
@var number   adOpacity "Ad opacity"   [100, 15, 1000, 10]

==/UserStyle== */

@-moz-document regexp("example.(com") {

}

System Information

N/A

Additional Context

I think I did it again. These are actually two issues. Related only marginally, by the fact they are both just wrongly reported errors.

And the third is a question/request, is there a definition for the ==UserStyle== meta block? can we make one?
Is it OK to use a comment text without leading @ in side the metadata block, as in the sample above?

tophf commented 6 months ago

~I can't reproduce the regex error, I see Unterminated group example.(com~ Ah, I didn't test in Firefox.

tophf commented 6 months ago

definition

See https://github.com/openstyles/stylus/wiki/Writing-UserCSS

paponius commented 6 months ago

So this was relevant after all. Sorry for bad reporting.

System Information

N/A

definition for the ==UserStyle== meta block See https://github.com/openstyles/stylus/wiki/Writing-UserCSS I meant a technical one. There were many Style stores in past. And more will probably come.

It would be good to have a strict definition what should be expected of data in the userstyle metadata block.
And as you are now leading the project, you can create a wiki page and lay down some rules.
So new stores, or existing one know what to expect in metadata. And also that Authors will not fail the specs and have their Style being refused by some future Store.

Also, to add new ideas and fix flaws.

tophf commented 6 months ago

I don't understand, please provide an example/link for "a strict definition".