Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(utility): modify "AttrsMixin" as a workaround for pylint errors #580

Merged
merged 1 commit into from
May 19, 2021

Conversation

AChenQ
Copy link
Collaborator

@AChenQ AChenQ commented May 19, 2021

attr() returns Field as the class variables value, using type hint
as the real type of variables.
pylint use Field as the variable type, so it will report the following
errors

E0237: Assigning to attribute 'box2d' not defined in class slots (assigning-non-slot)
E1101: Instance of 'Field' has no 'box3d' member (no-member)

do the following as a workaround for pylint errors

  • remove __slot__ for E0237
  • add __getattr__ function for E1101

related issue:
pylint-dev/pylint#4341

@AChenQ AChenQ requested a review from linjiX as a code owner May 19, 2021 12:53
@coveralls
Copy link

coveralls commented May 19, 2021

Pull Request Test Coverage Report for Build 856999174

  • 1 of 2 (50.0%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.02%) to 80.804%

Changes Missing Coverage Covered Lines Changed/Added Lines %
tensorbay/utility/attr.py 1 2 50.0%
Totals Coverage Status
Change from base Build 856903199: -0.02%
Covered Lines: 4243
Relevant Lines: 5251

💛 - Coveralls

@AChenQ AChenQ changed the title refactor(utility): modify "AttrsMixin" to skip pylint error refactor(utility): modify "AttrsMixin" as a workaround for pylint May 19, 2021
@AChenQ AChenQ force-pushed the attrs_plint branch 2 times, most recently from 05bb74b to 0b8756e Compare May 19, 2021 13:24
@AChenQ AChenQ changed the title refactor(utility): modify "AttrsMixin" as a workaround for pylint refactor(utility): modify "AttrsMixin" as a workaround for pylint errors May 19, 2021
`attr()` returns `Field` as the class variables value, using type hint
as the real type of variables.
pylint use `Field` as the variable type, so it will report the following
errors

`E0237: Assigning to attribute 'box2d' not defined in class slots
(assigning-non-slot)`
`E1101: Instance of 'Field' has no 'box3d' member (no-member)`

do the following as a workaround for pylint errors
* remove `__slot__` for E0237
* add `__getattr__` function for E1101

related issue:
pylint-dev/pylint#4341

PR Closed: Graviti-AI#580
@AChenQ AChenQ merged commit 5236d2b into Graviti-AI:main May 19, 2021
@AChenQ AChenQ deleted the attrs_plint branch May 19, 2021 13:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants