From c23288b873b96ace3163cfbc078e3caaf359bc5c Mon Sep 17 00:00:00 2001 From: Alexis Chatillon <46956548+Sancretor@users.noreply.github.com> Date: Wed, 29 Apr 2020 12:08:55 +0200 Subject: [PATCH 1/2] Change import for compatibility with Pylint 2.5.0 --- README.md | 1 + checkers/cnes_checker.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index d92e1cd..16bb0d7 100644 --- a/README.md +++ b/README.md @@ -26,6 +26,7 @@ cnes-pylint-extension checks the following metrics : - Version 2.0 - compatible pylint 1.6 - Version 3.0 - compatible pylint 1.7.4 and 1.9.1 - Version 4.0 - compatible pylint 2.1.1 +- Version 5.0 - compatible pylint 2.5.0 # To use these checkers: diff --git a/checkers/cnes_checker.py b/checkers/cnes_checker.py index 079fb4d..4884154 100644 --- a/checkers/cnes_checker.py +++ b/checkers/cnes_checker.py @@ -26,7 +26,7 @@ from pylint.checkers import BaseChecker, BaseTokenChecker from pylint.checkers.utils import check_messages from pylint.checkers.raw_metrics import get_type -from pylint.utils import WarningScope +from pylint.constants import WarningScope import tokenize From fdf3efaf6d24efecea290d6e26edeb9124746584 Mon Sep 17 00:00:00 2001 From: Alexis Chatillon <46956548+Sancretor@users.noreply.github.com> Date: Tue, 5 May 2020 14:52:05 +0200 Subject: [PATCH 2/2] Update CNS Pylint extension documentation --- README.md | 28 +++++++++++++++++++++++++--- 1 file changed, 25 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 16bb0d7..f924428 100644 --- a/README.md +++ b/README.md @@ -30,6 +30,28 @@ cnes-pylint-extension checks the following metrics : # To use these checkers: -- Add the 'checkers/' subdirectory to your PYTHONPATH -- Add the line "load-plugins=cnes_checker" to the [MASTER] section of your .pylintrc - or add "--load-plugins=cnes_checker" to your command line in order to activate them +## Install Pylint + +`pip install pylint==2.5.0` + +## Install CNES Pylint extension checkers + +Download the project's code source then add the checkers subdirectory to your PYTHONPATH : + +``` +unzip cnes-pylint-extension.zip +cd cnes-pylint-extension +echo export PYTHONPATH=$PYTHONPATH:$PWD/checkers >> ~/.bashrc +source ~/.bashrc +``` + +To enable Pylint to use the extension, you need to edit your pylintrc file, and add "cnes_checker" to the plugins list. +``` +[MASTER] +load-plugins=cnes_checker +... +``` + +Pylint is now able to use the extension. + +Otherwise, add `--load-plugins=cnes_checker` to your pylint command line in order to activate it.