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

Added composite validator. #183

Closed

Conversation

yeraydiazdiaz
Copy link

@yeraydiazdiaz yeraydiazdiaz commented May 9, 2017

Hi there,

first of all thank you for attrs, it's truly a joy to use.

I just wanted to contribute this composite validator I wrote that's been useful for me, hopefully it makes sense for you too.

Pull Request Check List

This is just a reminder about the most common mistakes. Please make sure that you tick all appropriate boxes. But please read our contribution guide at least once, it will save you unnecessary review cycles!

  • Added tests for changed code.
  • New features have been added to our Hypothesis testing strategy.
  • Updated documentation for changed code.
  • Documentation in .rst files is written using semantic newlines.
  • Changed/added classes/methods/functions have appropriate versionadded, versionchanged, or deprecated directives.
  • Changes (and possible deprecations) are documented in CHANGELOG.rst.

If you have any questions to any of the points above, just submit and ask! This checklist is here to help you, not to deter you from contributing!

Yeray Diaz Diaz added 2 commits May 9, 2017 20:18
@codecov
Copy link

codecov bot commented May 9, 2017

Codecov Report

Merging #183 into master will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@          Coverage Diff          @@
##           master   #183   +/-   ##
=====================================
  Coverage     100%   100%           
=====================================
  Files           8      8           
  Lines         546    558   +12     
  Branches      121    124    +3     
=====================================
+ Hits          546    558   +12
Impacted Files Coverage Δ
src/attr/validators.py 100% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b79a49e...8e7d846. Read the comment docs.

@hynek
Copy link
Member

hynek commented May 10, 2017

I think that use case is already handled by 17.1’s support for passing lists for validators aka #138?

(yes, I really need to get 17.1 out :'()

@yeraydiazdiaz
Copy link
Author

Yep, you're right, passing a list to validator does the exact same thing on master. I'll keep an eye out for 17.1. Thanks 👍

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