Repository: spyder-ide/spyder

Issue:
Change output of code analysis to show the full names of the pylint messages
<!--- **PLEASE READ:** When submitting here, please ensure you've completed the following checklist and checked the boxes to confirm. Issue reports without it may be closed. Thanks! --->

### Issue Report Checklist

* [ ] Searched the [issues page](https://github.com/spyder-ide/spyder/issues?q=is%3Aissue) for similar reports
* [ ] Read the relevant sections of the [Spyder Troubleshooting Guide](https://github.com/spyder-ide/spyder/wiki/Troubleshooting-Guide-and-FAQ) and followed its advice
* [ ] Reproduced the issue after updating with ``conda update spyder`` (or ``pip``, if not using Anaconda)
* [ ] Could not reproduce inside ``jupyter qtconsole`` (if console-related)
* [ ] Tried basic troubleshooting (if a bug/error)
    * [ ] Restarted Spyder
    * [ ] Reset preferences with ``spyder --reset``
    * [ ] Reinstalled the latest version of [Anaconda](https://www.anaconda.com/download/)
    * [ ] Tried the other applicable steps from the Troubleshooting Guide
* [ ] Completed the **Problem Description**, **Steps to Reproduce** and **Version** sections below


## Problem Description
 We should change the output of the code analysis to show full names of the messages as they are clearer to read when used for message control in the code, and using the numeric versions for that purpose is deprecated. E.g. pointless-statement for W0104.


### What steps reproduce the problem?

1. 
2. 
3. 

### What is the expected output? What do you see instead?



### Paste Traceback/Error Below (if applicable)
<!--- Copy from error dialog or View > Panes > Internal Console --->

```python-traceback

PASTE TRACEBACK HERE

```

## Versions
<!--- You can get this information from Help > About Spyder...
or (if Spyder won't launch) the "conda list" command
from the Anaconda Prompt/Terminal/command line. --->

* Spyder version: 
* Python version: 
* Qt version: 
* PyQt version: 
* Operating System name/version: 

### Dependencies
<!--- Please go to the menu entry Help > Dependencies,
press the Copy to clipboard button and paste below --->

```
PASTE DEPENDENCIES HERE
```



Discussion:
@CAM-Gerlach can you help us fix this please?
@juanis2112 Sure thing!

Resolving patch:
diff --git a/setup.py b/setup.py
--- a/setup.py
+++ b/setup.py
@@ -223,7 +223,7 @@ def run(self):
     'pickleshare>=0.4',
     'psutil>=5.3',
     'pygments>=2.0',
-    'pylint>=0.25',
+    'pylint>=1.0',
     'pyqt5<5.13;python_version>="3"',
     'pyqtwebengine<5.13;python_version>="3"',
     'python-language-server[all]>=0.31.9,<0.32.0',
diff --git a/spyder/dependencies.py b/spyder/dependencies.py
--- a/spyder/dependencies.py
+++ b/spyder/dependencies.py
@@ -46,7 +46,7 @@
 PICKLESHARE_REQVER = '>=0.4'
 PSUTIL_REQVER = '>=5.3'
 PYGMENTS_REQVER = '>=2.0'
-PYLINT_REQVER = '>=0.25'
+PYLINT_REQVER = '>=1.0'
 PYLS_REQVER = '>=0.31.9;<0.32.0'
 PYXDG_REQVER = '>=0.26'
 PYZMQ_REQVER = '>=17'
diff --git a/spyder/plugins/pylint/widgets/pylintgui.py b/spyder/plugins/pylint/widgets/pylintgui.py
--- a/spyder/plugins/pylint/widgets/pylintgui.py
+++ b/spyder/plugins/pylint/widgets/pylintgui.py
@@ -94,13 +94,19 @@ def refresh(self):
                    ima.icon('error'), self.results['E:']))
         for title, icon, messages in results:
             title += ' (%d message%s)' % (len(messages),
-                                          's' if len(messages)>1 else '')
+                                          's' if len(messages) > 1 else '')
             title_item = QTreeWidgetItem(self, [title], QTreeWidgetItem.Type)
             title_item.setIcon(0, icon)
             if not messages:
                 title_item.setDisabled(True)
             modules = {}
-            for module, lineno, message, msg_id in messages:
+            for message_data in messages:
+                # If message data is legacy version without message_name
+                if len(message_data) == 4:
+                    message_data = tuple(list(message_data) + [None])
+
+                module, lineno, message, msg_id, message_name = message_data
+
                 basename = osp.splitext(osp.basename(self.filename))[0]
                 if not module.startswith(basename):
                     # Pylint bug
@@ -128,10 +134,18 @@ def refresh(self):
                 else:
                     parent = title_item
                 if len(msg_id) > 1:
-                    text = "[%s] %d : %s" % (msg_id, lineno, message)
-                else:
-                    text = "%d : %s" % (lineno, message)
-                msg_item = QTreeWidgetItem(parent, [text], QTreeWidgetItem.Type)
+                    if not message_name:
+                        message_string = "{msg_id} "
+                    else:
+                        message_string = "{msg_id} ({message_name}) "
+
+                message_string += "line {lineno}: {message}"
+
+                message_string = message_string.format(
+                    msg_id=msg_id, message_name=message_name,
+                    lineno=lineno, message=message)
+                msg_item = QTreeWidgetItem(
+                    parent, [message_string], QTreeWidgetItem.Type)
                 msg_item.setIcon(0, ima.icon('arrow'))
                 self.data[id(msg_item)] = (modname, lineno)
 
@@ -351,27 +365,22 @@ def start(self):
         self.output = ''
         self.error_output = ''
 
-        plver = PYLINT_VER
-        if plver is not None:
-            p_args = ['-m', 'pylint', '--output-format=text']
-            if plver.split('.')[0] == '0':
-                p_args += ['-i', 'yes']
-            else:
-                # Option '-i' (alias for '--include-ids') was removed in pylint
-                # 1.0
-                p_args += ["--msg-template='{msg_id}:{line:3d},"
-                           "{column}: {obj}: {msg}"]
+        if PYLINT_VER is not None:
+            pylint_args = [
+                '-m', 'pylint', '--output-format=text',
+                '--msg-template='
+                "'{msg_id}:{symbol}:{line:3d},{column}: {msg}'"]
 
         pylintrc_path = self.get_pylintrc_path(filename=filename)
         if pylintrc_path is not None:
-            p_args += ['--rcfile={}'.format(pylintrc_path)]
+            pylint_args += ['--rcfile={}'.format(pylintrc_path)]
 
-        p_args += [filename]
+        pylint_args.append(filename)
         processEnvironment = QProcessEnvironment()
         processEnvironment.insert("PYTHONIOENCODING", "utf8")
         self.process.setProcessEnvironment(processEnvironment)
 
-        self.process.start(sys.executable, p_args)
+        self.process.start(sys.executable, pylint_args)
 
         running = self.process.waitForStarted()
         self.set_running_state(running)
@@ -412,7 +421,7 @@ def finished(self, exit_code, exit_status):
         results = {'C:': [], 'R:': [], 'W:': [], 'E:': []}
         txt_module = '************* Module '
 
-        module = '' # Should not be needed - just in case something goes wrong
+        module = ''  # Should not be needed - just in case something goes wrong
         for line in self.output.splitlines():
             if line.startswith(txt_module):
                 # New module
@@ -421,20 +430,36 @@ def finished(self, exit_code, exit_status):
             # Supporting option include-ids: ('R3873:' instead of 'R:')
             if not re.match(r'^[CRWE]+([0-9]{4})?:', line):
                 continue
-            i1 = line.find(':')
-            if i1 == -1:
-                continue
-            msg_id = line[:i1]
-            i2 = line.find(':', i1+1)
-            if i2 == -1:
-                continue
-            line_nb = line[i1+1:i2].strip()
-            if not line_nb:
-                continue
-            line_nb = int(line_nb.split(',')[0])
-            message = line[i2+1:]
-            item = (module, line_nb, message, msg_id)
-            results[line[0]+':'].append(item)
+            items = {}
+            idx_0 = 0
+            idx_1 = 0
+            key_names = ["msg_id", "message_name", "line_nb", "message"]
+            for key_idx, key_name in enumerate(key_names):
+                if key_idx == len(key_names) - 1:
+                    idx_1 = len(line)
+                else:
+                    idx_1 = line.find(":", idx_0)
+
+                if idx_1 < 0:
+
+                    break
+                item = line[(idx_0):idx_1]
+
+                if not item:
+
+                    break
+
+                if key_name == "line_nb":
+
+                    item = int(item.split(',')[0])
+
+                items[key_name] = item
+
+                idx_0 = idx_1 + 1
+            else:
+                pylint_item = (module, items["line_nb"], items["message"],
+                               items["msg_id"], items["message_name"])
+                results[line[0] + ':'].append(pylint_item)
 
         # Rate
         rate = None


Test patch: