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

Update parse.py #9

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Update parse.py #9

wants to merge 1 commit into from

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