Contributors mailing list archives
Re: pybowler conforance refactoringby
Moises, I updated it to be a little more aggressive than your implementation, including the string argument position you implemented:
Maybe the query selectors + fluent API is a little easier to work with, than methods of growing complexity,
on the other side, the query grammar has it's learning curve...
Overall the script is quite neat, now...
On Fri, Jul 26, 2019 at 8:03 PM David Arnold <firstname.lastname@example.org> wrote:
Moises, does your routine detect this?
field_name[:-4] if field_name.endswith('_ids') else
field_name[:-3] if field_name.endswith('_id') else field_nameI couldn't find it...On Fri, Jul 26, 2019 at 6:27 PM David Arnold <email@example.com> wrote:Hi Moises,The real use case is to get a huge codebase conformant to OCA styling.With pybowler, you just run the script and it walkes you through the diffs to keep or discard.It is not suitable for checking or code linting, it's a safe (!) refactoring tool at it's core.A code migration from one API version to another can be entirely scripted. And as you see, the basic semantics of such fixers are not even complicated.+- 2 days of research on python grammars gets you going.I plan to incorporate such refactoring snippets in DockeryOdoo, once I get a better grip on it.pylint-odoo is already running on a language server protocol (LSP) server. Yes it's Microsoft open source ;-)Best Regards,David A.El vie., 26 jul. 2019, 6:17 p.m., Moises Lopez <firstname.lastname@example.org> escribió:Hi David,If I understood correctly your script is creating the same pylint-odoo check:- https://github.com/OCA/pylint-odoo/blob/b0eb55f4fd1b3c72b82972d79ccfeb0d69642010/pylint_odoo/checkers/no_modules.py#L213-L217But using https://pybowler.ioIt is allowing auto modify code fixing the convention checkFor me, It looks great!I have created a time ago a similar tool using autoflake8:But after a while I didn't use it since that I know the conventions and my editor is making a mark where I have a convention detail.Then, I don't know if really is a good idea duplicate pylint and pylint-odoo checks to auto-fixing.Using VIM I have created the following configuration:let g:syntastic_python_checkers = ['pylint', 'flake8']
let g:syntastic_python_pylint_args = '--rcfile=mqt/travis/cfg/travis_run_pylint_vim.cfg'(see attached image)You can configured it for pycharm and other IDEsWhat do you think?El vie., 26 jul. 2019 a las 10:17, David Arnold (<email@example.com>) escribió:Hi All,Out of bare exitement, I wanted to share with you my first pybowler conformance refactoringLet's build a library for pylint-odoo so people can get an actual chance to apply it on a legacy codebase.Best Regards,David A.--