-
Notifications
You must be signed in to change notification settings - Fork 4
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
Ensure README is synched with code #43
Ensure README is synched with code #43
Conversation
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 was thinking about how to solve this and was undecided whether to take the pre-commit hook approach (this one) or do it via a test suite which I've been meaning to work on next.
Happy to take this approach, as long as it doesn't grow to complex. It can be a bit vague to figure out why a commit just failed and what the pre-commit hooks just updated.
@lagru Do you have any suggestions for how we can resolve the regex issue with string literals in the toml file? |
Replacement strings used in regex substitution process backlash escapes including R"\\". So we need to expand these to R"\\\\" before [1]. [1] https://docs.python.org/3/library/re.html#re.sub
and pin paths relative to the scripts position. Should be a bit more robust.
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.
Co-authored-by: Lars Grüter <[email protected]>
.tools/readme.py
Outdated
with open(PROJECT_ROOT / "README.md") as fh: | ||
readme = fh.read() | ||
|
||
with open(PROJECT_ROOT / "src/changelist/default_config.toml") as fh: |
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.
nitpick: does windows like this? Or we shouldn't be bothered anyway?
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.
Do you mean the "/" vs "\" thing? I think abstracting that away is one of the ideas behind pathlib but I haven't used in much on a Windows system to be honest.
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.
Thanks @jarrodmillman!
331eaca
to
8b90a22
Compare
Following up on a suggestion by @bsipocz #30 (comment).
There is an issue with string literals in the toml file.
If this approach seems reasonable, we may want to do the same thing for: