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

Non imported nor empty Python files are not failing #177

Open
oscarolar opened this issue Mar 1, 2021 · 3 comments
Open

Non imported nor empty Python files are not failing #177

oscarolar opened this issue Mar 1, 2021 · 3 comments
Assignees

Comments

@oscarolar
Copy link

oscarolar commented Mar 1, 2021

This file https://git.vauxoo.com/absa/absa/-/blob/12.0/absa/controllers/test.py

was introduced in this commit: https://git.vauxoo.com/absa/absa/-/commit/37bba8c3c2c642b419efb306209e40a0c9a954ca

but the pipelines were all green: https://git.vauxoo.com/absa/absa/-/pipelines/116399 (excepting odoo_warnings but there was no reference at the file there)

seems to me that it should throw a couple of Pylint errors, something like:

  • "File declared but not imported"
  • "Empty Python file with no effect"
@moylop260
Copy link

@antonag32

Consider exceptions for test*/, migrations/* script*/

and consider use the lineno to 1 in order to be able to disable with comment # pylint: disable=...

@moylop260
Copy link

@antonag32

There is a hook to check large files:

Maybe, it could be done using a similar way to check empty ones

But I'm thinking about valid empty ones since __init__.py could be a valid empty since it is used to define a python package for a folder

Are there other ones?

Also, I don't think it should be only for python files (similar to large files)

Could you create a new PR/issue to discuss it in, please?

@antonag32
Copy link

Sounds nice. I was working on the Odoo part which involves ensuring python files are imported in __init__.py. I have created the issue in pre-commit-hooks, and already have a POC here: https://github.com/antonag32/pre-commit-hooks/commit/bb25e7f42a8d5555db73f20c781b28d6ea6e0048

antonag32 added a commit to vauxoo-dev/pylint-odoo that referenced this issue Jun 1, 2023
Fixes Vauxoo#177

This new check looks for python files (modules) which are not referenced
anywhere in the codebase, making  them useless.
antonag32 added a commit to vauxoo-dev/pylint-odoo that referenced this issue Jun 2, 2023
Fixes Vauxoo#177

This new check looks for python files (modules) which are not referenced
anywhere in the codebase, making  them useless.
antonag32 added a commit to vauxoo-dev/pylint-odoo that referenced this issue Jun 2, 2023
Fixes Vauxoo#177

This new check looks for python files (modules) which are not referenced
anywhere in the codebase, making  them useless.
antonag32 added a commit to vauxoo-dev/pylint-odoo that referenced this issue Jun 2, 2023
Fixes Vauxoo#177

This new check looks for python files (modules) which are not referenced
anywhere in the codebase, making  them useless.
antonag32 added a commit to vauxoo-dev/pylint-odoo that referenced this issue Jun 2, 2023
Fixes Vauxoo#177

This new check looks for python files (modules) which are not referenced
anywhere in the codebase, making  them useless.
antonag32 added a commit to vauxoo-dev/pylint-odoo that referenced this issue Jun 2, 2023
Fixes Vauxoo#177

This new check looks for python files (modules) which are not referenced
anywhere in the codebase, making  them useless.
antonag32 added a commit to vauxoo-dev/pylint-odoo that referenced this issue Jun 2, 2023
Fixes Vauxoo#177

This new check looks for python files (modules) which are not referenced
anywhere in the codebase, making  them useless.
antonag32 added a commit to vauxoo-dev/pylint-odoo that referenced this issue Jun 13, 2023
Fixes Vauxoo#177

This new check looks for python files (modules) which are not referenced
anywhere in the codebase, making  them useless.
antonag32 added a commit to vauxoo-dev/pylint-odoo that referenced this issue Jun 13, 2023
Fixes Vauxoo#177

This new check looks for python files (modules) which are not referenced
anywhere in the codebase, making  them useless.
antonag32 added a commit to vauxoo-dev/pylint-odoo that referenced this issue Feb 14, 2024
This new check looks for python files (modules) which are not referenced
anywhere in the codebase, making  them useless.

Closes Vauxoo#177.
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

No branches or pull requests

3 participants