From 85410bd8dcecb450c4f99365bf8dfe5071c8bd5d Mon Sep 17 00:00:00 2001 From: "Tiffany Chang (tic)" Date: Tue, 14 Sep 2021 14:14:56 +0000 Subject: [PATCH] [IMP] developer/howtos: encourage linters more There have been complaints of newbies not setting up their linters therefore let's emphasize their use/setup more in the tutorial and hope for the best. Part-of: odoo/documentation#1146 --- content/developer/howtos/rdtraining/02_setup.rst | 12 ++++++++++++ .../developer/howtos/rdtraining/16_guidelines_pr.rst | 6 +++--- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/content/developer/howtos/rdtraining/02_setup.rst b/content/developer/howtos/rdtraining/02_setup.rst index 1f851b39a..f14e3c237 100644 --- a/content/developer/howtos/rdtraining/02_setup.rst +++ b/content/developer/howtos/rdtraining/02_setup.rst @@ -337,6 +337,18 @@ For Python, we use PEP8 with these options ignored: For JavaScript, we use ESLint and you can find a `configuration file example here`_. +If you do not know how to set up a linter: + +- `Here is an explanation of how to set up a Python linter in VSCode `_. There are multiple + linter options you are free to choose from, but `Flake8 `_ is a popular choice. +- To setup ESLint in VSCode, you must download the `ESLint extension`_ and follow its instructions + for installing ESLint. Don't forget to create and set up the `.eslintrc` file to follow the + configuration file mentioned above. +- Another useful VSCode plugin is `Trailing Spaces`_ to quickly notice trailing spaces while + you're working. + +.. _Trailing Spaces: https://marketplace.visualstudio.com/items?itemName=shardulm94.trailing-spaces +.. _ESLint extension: https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint .. _configuration file example here: https://github.com/odoo/odoo/wiki/Javascript-coding-guidelines#use-a-linter .. _VSCode: https://code.visualstudio.com/ .. _VSCodium: https://vscodium.com/ diff --git a/content/developer/howtos/rdtraining/16_guidelines_pr.rst b/content/developer/howtos/rdtraining/16_guidelines_pr.rst index 63c7a17d0..2879e8558 100644 --- a/content/developer/howtos/rdtraining/16_guidelines_pr.rst +++ b/content/developer/howtos/rdtraining/16_guidelines_pr.rst @@ -18,9 +18,9 @@ to improve the quality of the Odoo Apps code. .. exercise:: Polish your code. - Refactor your code to respect the coding guidelines. Don't forget to respect the module - structure, the variable names, the method name convention, the model attribute order and the - xml ids. + Refactor your code to respect the coding guidelines. Don't forget to run your linter and + respect the module structure, the variable names, the method name convention, the model + attribute order and the xml ids. Your first Pull Request (PR) ============================