Skip to content

[linter] don't allow people to alias #23324

Closed
@iscai-msft

Description

When SDK writers alias model names to rename the generated code, i.e. from ._generated import AuthenticationTypeEnum as DatasourceAuthenticationType, this breaks apiview, sphinx documentation, and does not show up well for end users

MicrosoftTeams-image (1)

We should look through the __init__ files and raise an error if the aliased name is included in the __all__ (it's ok if internal models are aliased) and ensure there is no x as x importing.

We want to see how many aliasing issues we are running into.

In terms of mitigation for aliasing cases (thanks @lmazuel ):

  1. If handwritten code: don't do it, you don't need it
  2. If rename generated: use directive
  3. Else: talk to Johan/Anna

Metadata

Assignees

Labels

ClientThis issue points to a problem in the data-plane of the library.EngSysThis issue is impacting the engineering system.P1pylint

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions