-
Notifications
You must be signed in to change notification settings - Fork 682
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
Optimize regular expression for postgres config parsing #1395
Conversation
9c313c6
to
1727005
Compare
d4085ce
to
cf26672
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @chris-rock , just one comment ;)
@@ -74,7 +74,10 @@ def read_content | |||
raw_conf = read_file(to_read[0]) | |||
@content += raw_conf | |||
|
|||
params = SimpleConfig.new(raw_conf).params | |||
opts = { | |||
assignment_re: /^\s*([^=]*?)\s*=\s*[']*\s*(.*?)\s*[']*\s*$/, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i'd change [']*
to [']?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it possible to have an empty assignment? vv
a =
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Haven't seen an empty assignment, but we should enable this. I'll update the unit tests accordingly.
a79e590
to
0578452
Compare
Signed-off-by: Christoph Hartmann <chris@lollyrock.com>
0578452
to
efab62e
Compare
lgtm 👍 +1 |
This PR optimizes the configuration parsing for PostgreSQL. Assuming we have the following configuration:
we need to parse the following types:
logging_collector = on
log_directory = 'pg_log'
This PR adapts to the regular expression to allow: