Skip to content

Update parse.py#9

Open
wbbigdave wants to merge 1 commit intom-chrome:masterfrom
wbbigdave:master
Open

Update parse.py#9
wbbigdave wants to merge 1 commit intom-chrome:masterfrom
wbbigdave:master

Conversation

@wbbigdave
Copy link

Switched the group order for rule_pattern, so that the group "raw" is processed with the preceeding #. In the previous order, a disabled rule would not be commented out in the "raw" rule string, and would have to be added manually.

Switched the group order for rule_pattern, so that the group "raw" is processed with the preceeding #. In the previous order, a disabled rule would not be commented out in the "raw" rule string, and would have to be added manually.
Copy link
Author

@wbbigdave wbbigdave left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Specifically switched the ordering of these Rregex groups. In the old system, the raw rule dropped the comment # because it was matched by the first group. This mean, that if you stored the rule in a database or similar, then the raw rule had to be ammended on output in order to remain commented out of the file. This quick change means that the rule is still parsed correctly, but the raw rule retains the #, and the enabled flag is also still maintained.

@m-chrome
Copy link
Owner

@wbbigdave, thank you for contribution. Pull master branch in your fork, that CI jobs can be run in PR. And your change fail some tests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants