rokucommunity / bslint

A linter for BrightScript and BrighterScript.
MIT License
27 stars 14 forks source link

Rules for checking color value formats #89

Closed charlie-abbott-deltatre closed 9 months ago

charlie-abbott-deltatre commented 1 year ago

Would be a good addition to have the ability to check if color formatting is consistent, as defined in XML, BRS, BS, JSON files.

Could also check that the classic Roku cert requirement around broadcast safe colors is followed. - 6.4 the channel using only broadcast-safe colors

TwitchBronBron commented 1 year ago

I think a good first pass at this would be to enforce all of your suggestions exclusively in xml files. (perhaps also for m.top.someColorField assignments since those are pretty easy to detect)

Finding the correct locations in brs/bs/json files may be more difficult. For example, consider this code:

'this has nothing to do with colors
bitFlags = 0x00000001 and 0x00000003

Longer-term, when we can do proper type tracking, then we could start to enforce these things when assigning to component fields.

disc7 commented 11 months ago

Opened a WIP PR https://github.com/rokucommunity/bslint/pull/94/files

I wonder if with your bitFlags example, if it's possible to include exceptions, by line or example?

disc7 commented 9 months ago

We can close this, @TwitchBronBron 😎

TwitchBronBron commented 9 months ago

Sure! Closed by #89