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

Improve to insert validate methods #74

Merged
merged 1 commit into from
Sep 24, 2019

Conversation

koxudaxi
Copy link
Owner

@koxudaxi koxudaxi commented Sep 22, 2019

The PR improves to insert validate methods.

PyCharm inserts method template when you type def name( in a class definition.
the method template has self or cls signature. PyCharm detects method type like classmethod and staticmethod.

PyCharm inserts self on validator methods.
Unfortunately, pydantic's validator method is classmethod.
The reason is validator methods don't have @classmethod decorator.

Also, The PR add inset the text , . because validators need any argument.

Screen Capture

Kapture 2019-09-23 at 4 35 36

@codecov
Copy link

codecov bot commented Sep 22, 2019

Codecov Report

Merging #74 into master will decrease coverage by 6.75%.
The diff coverage is 0%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master      #74      +/-   ##
============================================
- Coverage     77.69%   70.93%   -6.76%     
  Complexity       83       83              
============================================
  Files             7        8       +1     
  Lines           399      437      +38     
  Branches        140      152      +12     
============================================
  Hits            310      310              
- Misses           27       65      +38     
  Partials         62       62
Impacted Files Coverage Δ Complexity Δ
...xi/pydantic/PydanticTypedValidatorMethodHandler.kt 0% <0%> (ø) 0 <0> (?)

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 e96f56d...fa34b69. Read the comment docs.

@koxudaxi koxudaxi merged commit 3051b1d into master Sep 24, 2019
@koxudaxi koxudaxi deleted the improve_to_insert_validate_method branch September 24, 2019 04:31
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.

1 participant