Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .chronus/changes/fix-pylint-2024-09-12-2024-8-12-16-9-4.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
changeKind: fix
packages:
- "@azure-tools/typespec-python"
---

Fix "line-too-long" for property of model
Original file line number Diff line number Diff line change
Expand Up @@ -261,9 +261,10 @@ def declare_property(prop: Property) -> str:
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))
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there is 4 spaces indentation so original line length limit 120 - 4 = 116

else ""
)
return f"{generated_code}{type_ignore}{pylint_disable}"
Expand Down