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

[Backport][ipa-4-6] Teach pylint how our api works #2154

Closed
wants to merge 2 commits into from

Conversation

tiran
Copy link
Member

@tiran tiran commented Jul 13, 2018

This PR was opened automatically because PR #2152 was pushed to master and backport to ipa-4-6 is required.

pylint 2.0 is more strict and complains about several aspects of
ipalib.api. It turns out that AstroidBuilder.string_build() can be used
to easily teach pylint about object attributes and attribute values.
Although the assignment wouldn't work with the actual implementation,
the string builder assignments shows pylint the names and values of
members. It works without additional transformation.

See: https://pagure.io/freeipa/issue/7614
Signed-off-by: Christian Heimes <cheimes@redhat.com>
pylinti 2 is having a hard time to handle name mangled, magic attributes
correctly. Double under attributes like __d are internally renamed to
_Env__d. After multiple failed attempts, it was easier to just add more
pylint disable to the implementation.

pylint 2 also thinkgs that Env.server is defined much later or the env
doesn't have that member at all. Ignore the false warnings, too.

Signed-off-by: Christian Heimes <cheimes@redhat.com>
@tiran
Copy link
Member Author

tiran commented Jul 13, 2018

PR was ACKed automatically because this is backport of PR #2152. Wait for CI to finish before pushing. In case of questions or problems contact @tiran who is author of the original PR.

@tiran tiran added ack Pull Request approved, can be merged pushed Pull Request has already been pushed labels Jul 13, 2018
@tiran
Copy link
Member Author

tiran commented Jul 14, 2018

ipa-4-6:

  • 3269162 Teach pylint how our api works
  • 51ce233 Add pylint ignore to magic config.Env attributes

@tiran tiran closed this Jul 14, 2018
@tiran tiran deleted the backport_pr2152_ipa-4-6 branch March 29, 2019 09:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ack Pull Request approved, can be merged pushed Pull Request has already been pushed
Projects
None yet
1 participant