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

ansible-test unused-import pylint rule to be enabled #34

Closed
mattclay opened this issue Feb 4, 2023 · 1 comment
Closed

ansible-test unused-import pylint rule to be enabled #34

mattclay opened this issue Feb 4, 2023 · 1 comment

Comments

@mattclay
Copy link

mattclay commented Feb 4, 2023

The pylint rule unused-import will be enabled for collections running devel sanity tests on Monday, February 13th.

This change is expected to report many errors (hundreds) on large collections. Most collections should expect at least a few errors. Due to the expected impact, advance notice is being given of this change.

Most reported errors will be easily resolved by removing the reported import(s). As a temporary measure, they can be added to the collection's tests/ignore-2.15.txt file:

plugins/modules/something.py pylint:unused-import 

However, there may be cases where the import must be kept. This is most likely in code providing compatibility between Python versions. In such cases, using an inline ignore is recommended instead:

import something  # pylint: disable=unused-import

The PR for this change can be found here: ansible/ansible#79912

@ansible-collections ansible-collections locked as resolved and limited conversation to collaborators Feb 4, 2023
@felixfontein
Copy link
Contributor

ansible/ansible#79912 has been merged, i.e. the pylint rule is now active when using ansible-test from ansible-core's devel branch.

@mattclay mattclay closed this as completed Apr 2, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants