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

Enable map configurations (config v2). #610

Merged
merged 2 commits into from
Sep 7, 2017
Merged

Enable map configurations (config v2). #610

merged 2 commits into from
Sep 7, 2017

Conversation

asottile
Copy link
Member

@asottile asottile commented Sep 5, 2017

This resolves #414

I've also added the following to aid in migration:

  • pre-commit migrate-config
    • attempts to intelligently upgrade the configuration to the new map format
  • pre-commit autoupdate - by default calls migrate_config(...)

For now I have opted to not issue a deprecation warning, I'll follow up with that in a later release.

@asottile
Copy link
Member Author

asottile commented Sep 6, 2017

This is mostly ready for review, I need to make migrate-config handle yaml that looks like this:

---
-   repo: ...
    ...

And should probably handle this case better:

current

+repos:
 # this is a pre-commit config
 -   repo: ...
     ...

better

 # this is a pre-commit config
+repos:
 -   repo: ...
     ...

@asottile
Copy link
Member Author

asottile commented Sep 6, 2017

Now handles both of those cases!

Copy link
Member

@chriskuehl chriskuehl left a comment

Choose a reason for hiding this comment

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

nice!

CONFIG_SCHEMA = schema.Map(
'Config', None,

schema.RequiredRecurse('repos', schema.Array(CONFIG_REPO_DICT)),
Copy link
Member

Choose a reason for hiding this comment

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

weird blank line?

Copy link
Member Author

Choose a reason for hiding this comment

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

this matches the other ones in the file, I plan to add more keys here so it'll look more natural eventually

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.

Configuration v2
2 participants