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

[ADD] file-not-used: pylint-odoo 6.0.x had this lint but was missed in the migration to pre-commit-hooks #74

Open
moylop260 opened this issue May 29, 2023 · 2 comments
Assignees
Labels
enhancement New feature or request

Comments

@moylop260
Copy link
Collaborator

moylop260 commented May 29, 2023

Related to OCA/pylint-odoo#393

The check file-not-used:

Should be migrated to odoo-pre-commit-hooks

But I think we only missed to migrated it

So, we need to start this migration now

Also, notice the new files neutralize.sql now are auto-detected from odoo:

And we need to add a new way to add excepted files (Maybe using the same way than pre-commit configuration uses)

Please, check what other checks we missed from issue OCA/pylint-odoo#393
Please, check what other files are auto-detected from odoo too

@moylop260 moylop260 added the enhancement New feature or request label May 29, 2023
@antonag32
Copy link
Contributor

Hooks here already have a config file, so we can add a key like file-not-used-whitelist that will exclude said files from creating errors. 🤔

@antonag32
Copy link
Contributor

I propose the following course of action for this issue:

  1. Use the config file oca_hooks.cfg to add a new parameter which states which files to ignore for this message
  2. While we are at it, add a new python file base_checker which holds data common to all checkers:
    1. enable/disabled messages
    2. module name
    3. manifest path
      This will be a minimal changes refactor just to plant the inheritance seed, it will also help tackle Add parameter, config, environment variable for pamaters of checks #39 by automatically giving config access to all checkers that inherit base_checker.

As for migrating the actual message, I think instead of doing it the old way we can just use a glob and we could also lint for not used static files now that they must be included in the assets section of the manifst file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants