datamodel-code-generator icon indicating copy to clipboard operation
datamodel-code-generator copied to clipboard

Strings in the generated models are not compatible with black formatter

Open pawelrubin opened this issue 3 years ago • 4 comments

Is your feature request related to a problem? Please describe. Strings in the generated models are single-quoted, which is incompatible with black formatter.

Describe the solution you'd like Double quotes are the default.

Describe alternatives you've considered There is a configuration option for which quotes to use.

pawelrubin avatar Mar 21 '22 10:03 pawelrubin

Hi @pawelrubin The code generator supports the config files for balck. If you have your preferred option then please set it in the file.

https://koxudaxi.github.io/datamodel-code-generator/formatting/

koxudaxi avatar Apr 16 '22 17:04 koxudaxi

The black formatter does not allow the configuration of string quoting.

pawelrubin avatar Apr 17 '22 17:04 pawelrubin

Hello! I need this option so much, because I use datamodel-codegen without --output option (due to the specifics of my task, i create python module myself). And so i have quotes conflict.

nesb1 avatar Aug 08 '22 09:08 nesb1

PR https://github.com/koxudaxi/datamodel-code-generator/pull/818

nesb1 avatar Aug 08 '22 09:08 nesb1