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 option --use-double-quotes #818

Merged
merged 1 commit into from
Aug 11, 2022
Merged

added option --use-double-quotes #818

merged 1 commit into from
Aug 11, 2022

Conversation

nesb1
Copy link
Contributor

@nesb1 nesb1 commented Aug 8, 2022

Hello! Datamodel-codegen is a great utility. But i need so much double quotes in generated code because I use datamodel-codegen without --output option (due to the specifics of my task, i create python module myself) and i can`t specify skip-string-normalization using black config. And so i have quotes conflict.

For backward compability double-quotes by default is False.

docs/formatting.md Outdated Show resolved Hide resolved
datamodel_code_generator/parser/openapi.py Outdated Show resolved Hide resolved
@nesb1
Copy link
Contributor Author

nesb1 commented Aug 10, 2022

@koxudaxi review please:)

@nesb1 nesb1 changed the title added option --double-quotes added option --use-double-quotes Aug 11, 2022
@nesb1 nesb1 requested a review from pawelrubin August 11, 2022 09:42
@codecov
Copy link

codecov bot commented Aug 11, 2022

Codecov Report

Merging #818 (de3c5a8) into master (e9b6edf) will not change coverage.
The diff coverage is 100.00%.

@@             Coverage Diff             @@
##            master      #818     +/-   ##
===========================================
  Coverage   100.00%   100.00%             
===========================================
  Files           11        21     +10     
  Lines         1020      2509   +1489     
  Branches       201       556    +355     
===========================================
+ Hits          1020      2509   +1489     
Flag Coverage Δ
unittests 99.92% <99.89%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
datamodel_code_generator/model/__init__.py 100.00% <ø> (ø)
datamodel_code_generator/__init__.py 100.00% <100.00%> (ø)
datamodel_code_generator/__main__.py 100.00% <100.00%> (ø)
datamodel_code_generator/format.py 100.00% <100.00%> (ø)
datamodel_code_generator/http.py 100.00% <100.00%> (ø)
datamodel_code_generator/imports.py 100.00% <100.00%> (ø)
datamodel_code_generator/model/base.py 100.00% <100.00%> (ø)
datamodel_code_generator/model/enum.py 100.00% <100.00%> (ø)
...atamodel_code_generator/model/pydantic/__init__.py 100.00% <100.00%> (ø)
...amodel_code_generator/model/pydantic/base_model.py 100.00% <100.00%> (ø)
... and 18 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@koxudaxi koxudaxi merged commit 4ed2336 into koxudaxi:master Aug 11, 2022
@koxudaxi
Copy link
Owner

@nesb1 @pawelrubin
I have released the PR as 0.13.1
Thank you very much 🙇

@luminoso
Copy link

luminoso commented Sep 9, 2022

Does this work when providing options via pyproject.toml ?

like so:

[tool.datamodel-codegen]
use-double-quotes = true

Can someone confirm that it isn't working? For me it is reacting to cli arguments only.

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.

4 participants