Skip to content

When possible, preserve config format on autoupdate - #583

Merged
asottile merged 2 commits into
masterfrom
autoupdate_reformatting
Aug 11, 2017
Merged

asottile merged 2 commits into
masterfrom
autoupdate_reformatting

Conversation

@asottile

Copy link
Copy Markdown
Member

No description provided.

@asottile
asottile force-pushed the autoupdate_reformatting branch from cabbf5e to 59c6df5 Compare August 11, 2017 01:43

@chriskuehl chriskuehl left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

looks awesome! i'm very excited to stop using git checkout -p so much.

i kinda wish we'd had this for the pre-commit 0.16 upgrade :P

return new_config


SHA_LINE_RE = re.compile(r'^(\s+)sha:(\s*)([^\s#]+)(.*)$', re.DOTALL)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

why using DOTALL here?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

>>> line
'        sha: v1.0.0\n'

so it matches the \n line ending

@asottile
asottile merged commit 478e90e into master Aug 11, 2017
@asottile
asottile deleted the autoupdate_reformatting branch August 11, 2017 02:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants