+
Skip to content
This repository was archived by the owner on Aug 31, 2023. It is now read-only.

Conversation

leops
Copy link
Contributor

@leops leops commented Jul 29, 2022

Summary

This PR modifies the RuleMeta trait and how it's implemented in the declare_rule: instead of having individual constants for each metadata field, the trait now uses a single const-constructible RuleMetadata struct. This struct takes all the required fields as arguments on its constructor, then allows optional fields to have a non-default value set through builder methods. This allows the declare_rule to only explicitly match on the require fields, then expand all additional rule properties into builder method calls on the metadata object. While implementing this I also made the trailing comma on rule properties mandatory, it should make future changes on rule metadata easier to read

Test Plan

This is a syntax level change with all the new code contained in constant expressions, so everything is checked at compile time

@leops leops requested a review from ematipico July 29, 2022 09:27
@leops leops requested a review from xunilrj as a code owner July 29, 2022 09:27
@leops leops requested a review from a team July 29, 2022 09:27
@leops leops temporarily deployed to aws July 29, 2022 09:27 Inactive
@github-actions
Copy link

@github-actions
Copy link

Parser conformance results on ubuntu-latest

js/262

Test result main count This PR count Difference
Total 45878 45878 0
Passed 44938 44938 0
Failed 940 940 0
Panics 0 0 0
Coverage 97.95% 97.95% 0.00%

jsx/babel

Test result main count This PR count Difference
Total 39 39 0
Passed 36 36 0
Failed 3 3 0
Panics 0 0 0
Coverage 92.31% 92.31% 0.00%

symbols/microsoft

Test result main count This PR count Difference
Total 5946 5946 0
Passed 395 395 0
Failed 5551 5551 0
Panics 0 0 0
Coverage 6.64% 6.64% 0.00%

ts/babel

Test result main count This PR count Difference
Total 588 588 0
Passed 519 519 0
Failed 69 69 0
Panics 0 0 0
Coverage 88.27% 88.27% 0.00%

ts/microsoft

Test result main count This PR count Difference
Total 16257 16257 0
Passed 12393 12393 0
Failed 3864 3864 0
Panics 0 0 0
Coverage 76.23% 76.23% 0.00%

@leops leops merged commit 93c8ad5 into main Jul 29, 2022
@leops leops deleted the feature/rule-meta-builder branch July 29, 2022 15:00
IWANABETHATGUY pushed a commit to IWANABETHATGUY/tools that referenced this pull request Aug 22, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载