From a57c3292ec70249799cc2e1511e534c2fecf99ca Mon Sep 17 00:00:00 2001 From: jennypng <63012604+JennyPng@users.noreply.github.com> Date: Mon, 20 Jul 2026 11:10:23 -0700 Subject: [PATCH 1/3] pylintrc update --- .../eng/scripts/ci/config/pylintrc | 38 +++++++++++++++++-- 1 file changed, 34 insertions(+), 4 deletions(-) diff --git a/packages/typespec-python/eng/scripts/ci/config/pylintrc b/packages/typespec-python/eng/scripts/ci/config/pylintrc index 387021335f..ac3277b39b 100644 --- a/packages/typespec-python/eng/scripts/ci/config/pylintrc +++ b/packages/typespec-python/eng/scripts/ci/config/pylintrc @@ -1,52 +1,82 @@ [MASTER] py-version=3.10 -ignore-patterns=test_*,conftest,setup +ignore-patterns=test\_\*,conftest,setup reports=no # PYLINT DIRECTORY BLACKLIST. -ignore=_generated,samples,examples,test,tests,doc,.tox,generated_samples + +ignore=\_generated,samples,examples,test,tests,doc,.tox,generated_samples [MESSAGES CONTROL] # Add enable for useless disables + enable=useless-suppression # For all codes, run 'pylint --list-msgs' or go to 'https://pylint.readthedocs.io/en/latest/reference_guide/features.html' + # locally-disabled: Warning locally suppressed using disable-msg + # cyclic-import: because of https://github.com/PyCQA/pylint/issues/850 + # too-many-arguments: Due to the nature of the CLI many commands have large arguments set which reflect in large arguments set in corresponding methods. + # too-many-lines: Due to code generation many files end up with too many lines. + +# no-cross-package-private-import: The guideline checker does not resolve relative + +# imports (it ignores the import level), so legitimate same-package relative imports + +# like `from ...operations._operations import ...` in generated async code are + +# misreported as cross-package private imports. + # Let's black deal with bad-continuation -disable=missing-docstring,locally-disabled,fixme,cyclic-import,too-many-arguments,invalid-name,duplicate-code,too-few-public-methods,consider-using-f-string,super-with-arguments,redefined-builtin,import-outside-toplevel,client-suffix-needed,unnecessary-dunder-call,unnecessary-ellipsis,disallowed-name,consider-using-max-builtin,unknown-option-value,file-needs-copyright-header,too-many-positional-arguments + +disable=missing-docstring,locally-disabled,fixme,cyclic-import,too-many-arguments,invalid-name,duplicate-code,too-few-public-methods,consider-using-f-string,super-with-arguments,redefined-builtin,import-outside-toplevel,client-suffix-needed,unnecessary-dunder-call,unnecessary-ellipsis,disallowed-name,consider-using-max-builtin,unknown-option-value,file-needs-copyright-header,too-many-positional-arguments,no-cross-package-private-import [FORMAT] max-line-length=120 [VARIABLES] -# Tells whether we should check for unused import in __init__ files. + +# Tells whether we should check for unused import in **init** files. + init-import=yes [DESIGN] + # Maximum number of locals for function / method body + max-locals=25 + # Maximum number of branch for function / method body + max-branches=20 + # Maximum number of instance attributes for class + max-attributes=10 + # Maximum number of ancestors + max-parents=15 [SIMILARITIES] min-similarity-lines=10 [BASIC] + # Naming hints based on PEP 8 (https://www.python.org/dev/peps/pep-0008/#naming-conventions). + # Consider these guidelines and not hard rules. Read PEP 8 for more details. # The invalid-name checker must be **enabled** for these hints to be used. + include-naming-hint=yes # keep short; underscores are discouraged + module-naming-style=snake_case const-naming-style=UPPER_CASE class-naming-style=PascalCase From dfe21ce300a4354e79f7388621010451ed8b1875 Mon Sep 17 00:00:00 2001 From: jennypng <63012604+JennyPng@users.noreply.github.com> Date: Mon, 20 Jul 2026 11:15:41 -0700 Subject: [PATCH 2/3] undo formatting --- .../eng/scripts/ci/config/pylintrc | 32 ++----------------- 1 file changed, 3 insertions(+), 29 deletions(-) diff --git a/packages/typespec-python/eng/scripts/ci/config/pylintrc b/packages/typespec-python/eng/scripts/ci/config/pylintrc index ac3277b39b..606db7dc19 100644 --- a/packages/typespec-python/eng/scripts/ci/config/pylintrc +++ b/packages/typespec-python/eng/scripts/ci/config/pylintrc @@ -1,82 +1,56 @@ [MASTER] py-version=3.10 -ignore-patterns=test\_\*,conftest,setup +ignore-patterns=test_*,conftest,setup reports=no # PYLINT DIRECTORY BLACKLIST. - -ignore=\_generated,samples,examples,test,tests,doc,.tox,generated_samples +ignore=_generated,samples,examples,test,tests,doc,.tox,generated_samples [MESSAGES CONTROL] # Add enable for useless disables - enable=useless-suppression # For all codes, run 'pylint --list-msgs' or go to 'https://pylint.readthedocs.io/en/latest/reference_guide/features.html' - # locally-disabled: Warning locally suppressed using disable-msg - # cyclic-import: because of https://github.com/PyCQA/pylint/issues/850 - # too-many-arguments: Due to the nature of the CLI many commands have large arguments set which reflect in large arguments set in corresponding methods. - # too-many-lines: Due to code generation many files end up with too many lines. - # no-cross-package-private-import: The guideline checker does not resolve relative - # imports (it ignores the import level), so legitimate same-package relative imports - # like `from ...operations._operations import ...` in generated async code are - # misreported as cross-package private imports. - # Let's black deal with bad-continuation - disable=missing-docstring,locally-disabled,fixme,cyclic-import,too-many-arguments,invalid-name,duplicate-code,too-few-public-methods,consider-using-f-string,super-with-arguments,redefined-builtin,import-outside-toplevel,client-suffix-needed,unnecessary-dunder-call,unnecessary-ellipsis,disallowed-name,consider-using-max-builtin,unknown-option-value,file-needs-copyright-header,too-many-positional-arguments,no-cross-package-private-import [FORMAT] max-line-length=120 [VARIABLES] - -# Tells whether we should check for unused import in **init** files. - +# Tells whether we should check for unused import in __init__ files. init-import=yes [DESIGN] - # Maximum number of locals for function / method body - max-locals=25 - # Maximum number of branch for function / method body - max-branches=20 - # Maximum number of instance attributes for class - max-attributes=10 - # Maximum number of ancestors - max-parents=15 [SIMILARITIES] min-similarity-lines=10 [BASIC] - # Naming hints based on PEP 8 (https://www.python.org/dev/peps/pep-0008/#naming-conventions). - # Consider these guidelines and not hard rules. Read PEP 8 for more details. # The invalid-name checker must be **enabled** for these hints to be used. - include-naming-hint=yes # keep short; underscores are discouraged - module-naming-style=snake_case const-naming-style=UPPER_CASE class-naming-style=PascalCase From c28c843c3375baaa42691764cfd0eadd671abfee Mon Sep 17 00:00:00 2001 From: jennypng <63012604+JennyPng@users.noreply.github.com> Date: Mon, 20 Jul 2026 11:16:59 -0700 Subject: [PATCH 3/3] chronus --- .chronus/changes/updatepylintrc-2026-6-20-11-16-52.md | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 .chronus/changes/updatepylintrc-2026-6-20-11-16-52.md diff --git a/.chronus/changes/updatepylintrc-2026-6-20-11-16-52.md b/.chronus/changes/updatepylintrc-2026-6-20-11-16-52.md new file mode 100644 index 0000000000..8860e38129 --- /dev/null +++ b/.chronus/changes/updatepylintrc-2026-6-20-11-16-52.md @@ -0,0 +1,7 @@ +--- +changeKind: internal +packages: + - "@azure-tools/typespec-python" +--- + +Disable no-cross-package-private-import pylint check \ No newline at end of file