microsoft / microsoft/typespec
[Bug]: [Python] Emitted code failed linting
- Dominant language
- Java
- Stars
- 5.9k
- Forks
- 394
- Avg merge
- 1d 23h
- Merged PRs (30d)
- 104
Description
### Describe the bug
Emitted code in the confidentialledger SDK failed linting due to the use of type() over isinstance()
### Reproduction
The file that failed the linting is https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/confidentialledger/azure-confidentialledger-certificate/azure/confidentialledger/certificate/_utils/model_base.py. Line numbers 820, 823 and 829 failed linting.
Link to the failed build https://dev.azure.com/azure-sdk/public/_build/results?buildId=6714589&view=results
### Checklist
- [x] Follow our [Code of Conduct](https://github.com/microsoft/typespec/blob/main/CODE_OF_CONDUCT.md)
- [x] Check that there isn't already an issue that request the same bug to avoid creating a duplicate.
- [x] Check that this is a concrete bug. For Q&A open a [GitHub Discussion](https://github.com/Microsoft/typespec/discussions).
- [x] The provided reproduction is a [minimal reproducible example](https://stackoverflow.com/help/minimal-reproducible-example) of the bug.
Contributor guide
Research direction
Open sdk/confidentialledger/azure-confidentialledger-certificate/azure/confidentialledger/certificate/_utils/model_base.py and inspect lines 820, 823, and 829 alongside the linked failed build. Update the flagged type checks to satisfy the lint rule, then rerun the relevant linting or build validation; done means the emitted code passes linting.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Activity status
- Active
- Clarity
- Clearly specified
- Newbie friendliness
- 85/100