Fix "line-too-long" for property of model (#2837)
* fix line-too-long for property of model * changelog
This commit is contained in:
Родитель
2b29fe0655
Коммит
1670cc63aa
|
@ -0,0 +1,7 @@
|
|||
---
|
||||
changeKind: fix
|
||||
packages:
|
||||
- "@azure-tools/typespec-python"
|
||||
---
|
||||
|
||||
Fix "line-too-long" for property of model
|
|
@ -261,9 +261,10 @@ class DpgModelSerializer(_ModelSerializer):
|
|||
else ""
|
||||
)
|
||||
generated_code = f'{prop.client_name}: {prop.type_annotation()} = {field}({", ".join(args)})'
|
||||
# there is 4 spaces indentation so original line length limit 120 - 4 = 116
|
||||
pylint_disable = (
|
||||
" # pylint: disable=line-too-long"
|
||||
if len(generated_code) <= 120 < (len(generated_code) + len(type_ignore))
|
||||
if len(generated_code) <= 116 < (len(generated_code) + len(type_ignore))
|
||||
else ""
|
||||
)
|
||||
return f"{generated_code}{type_ignore}{pylint_disable}"
|
||||
|
|
Загрузка…
Ссылка в новой задаче