2

The following is an example of how my flycheck errors show up on emacs:

Method name "createQATask" doesn't conform to 
'[a-z_][a-z0-9_]{2,30}$' pattern [invalid-name]

Here are the checkers I’m running (checked through C-c ! v):

Syntax checkers for buffer __manifest__.py in python-mode:

First checker to run:

  python-flake8
    - may enable:         yes
    - executable:         Found at /usr/bin/python3
    - configuration file: Not found
    - `flake8' module:    Found at "/home/devdesk4/.local/lib/python3.5/site-packages/flake8/__init__.py"
    - next checkers:      python-pylint, python-mypy

Checkers that may run as part of the first checker's chain:

  python-pylint
    - may enable:         yes
    - executable:         Found at /usr/bin/python3
    - configuration file: Found at "/home/devdesk4/.pylintrc"
    - `pylint' module:    Found at "/home/devdesk4/.local/lib/python3.5/site-packages/pylint/__init__.py"
    - next checkers:      python-mypy

Checkers that could run if selected:

  python-pycompile  select
    - may enable:    yes
    - executable:    Found at /usr/bin/python3
    - next checkers: python-mypy

I’ve tried disabling python-pylint’s configuration file, but the behavior still remains. I’ve also tried a minimal .emacs configuration which only contained the following:

(setq package-archives                                                                                                                                                        
      '(("gnu" . "http://elpa.gnu.org/packages/")                                                                                                                             
        ("marmalade" . "http://marmalade-repo.org/packages/")                                                                                                                 
        ("melpa" . "http://melpa.milkbox.net/packages/")                                                                                                                      
        ("melpa-stable" . "https://stable.melpa.org/packages/")))

(use-package flycheck
  :ensure t
  :init
  (global-flycheck-mode t))

Are those symbols (", ') not being displayed properly, or is this some sort of default flycheck configuration that I can override?

April 25, 2020 Update (Possible Solution)

Weirdly, I executed pip install --upgrade pylint just to check if I really had the latest version of pylint, and it upgraded from 2.3.0 to 2.4.4, and that fixed the issue.

However, this solution conflicts with using https://pypi.org/project/pylint-odoo/, because it reverts me back to version 2.3.0 which has those html-escape sequences.

Same-day update

It’s confirmed to be an upstream bug in Pylint.

zhaqenl
  • 21
  • 4
  • 1
    Since links can become unusable, it is best to include a summary of the link content here directly. The image can be uploaded to SO and inlined. In this case, it would be better to type the message in a code block. Code blocks are created by indenting with 4 spaces. See how I edited the question. – HackerBoss Apr 12 '20 at 15:36
  • Is this something from your code or is it in Emacs itself? In other words, do you see this if you start Emacs using `emacs -Q` (no init file) and you then load Flycheck etc.? If so, then consider reporting it as a bug or feature request, using `M-x report-emacs-bug`. If not, bisect your init file to find the culprit. – Drew Apr 12 '20 at 17:11
  • @HackerBoss I agree, that’s better! :) @Drew How would I go about enabling `flycheck` inside an `emacs -Q` buffer? Nothing comes up when running `M-x` then typing `flycheck`. – zhaqenl Apr 13 '20 at 01:16
  • `emacs -Q` starts with no user configuration. It's a blank slate, and it's as close as possible to a common starting point. You can execute whatever commands in e.g. the scratch buffer needed to reproduce the problem, and thus provide us with a minimal example. – jpkotta Apr 14 '20 at 17:56
  • @jpkotta Yeah, I noticed nothing’s enabled inside it. Although, how would I enable `flycheck` inside? It seems like my installation of `flycheck` isn’t being read while in this mode. – zhaqenl Apr 15 '20 at 12:18
  • 1
    Probably do whatever your init.el does. If you don't know how it works (e.g. you're using spacemacs or similar), add the directory flycheck is in to `load-path`, and `(require 'flycheck)`. – jpkotta Apr 15 '20 at 16:34

1 Answers1

0

The following is an example of how my flycheck errors show up on emacs:

Method name "createQATask" doesn't conform to '[a-z_][a-z0-9_]{2,30}$' pattern [invalid-name]

The linter evidentially believes it should be producing HTML output.

By the looks of it you are running all of python-flake8, python-pylint, and python-mypy. I suggest that you firstly test them one at a time to establish which one is producing that output, and then look at the documentation for that tool to find out how to prevent it from generating HTML.

Community
  • 1
  • 1
phils
  • 71,335
  • 11
  • 153
  • 198
  • I disabled every checker except for `python-pylint` via `M-x flycheck-disable-checker`, and it seems like it’s the culprit. However, running `pylint` command manually on the file produces the following output: `wizards/create_qa.py:32:4: C0103: Method name "createQATask" doesn't conform to '[a-z_][a-z0-9_]{2,30}$' pattern (invalid-name)` which is how I would want `flycheck` to display the message inside an emacs buffer. – zhaqenl Apr 24 '20 at 15:46
  • http://pylint.pycqa.org/en/1.6.0/run.html#command-line-options says: "`--output-format=` Select output format (text, html, custom)." – phils Apr 24 '20 at 20:37
  • I’m on PyLint version 2.3.0, and reading the changelogs for `pylint` makes it seem to me that the `html` `output-format` option has been deprecated. Testing this via setting `output-format` to `html` in my `~/.pylintrc` confirms this, since running `pylint` on a python file errors out: `pylint.exceptions.InvalidReporterError: html`. Setting it to `colorized` has the expected behavior, though (and displays the symbols mentioned in the question correctly), but still doesn’t display the symbols correctly when using pylint with flycheck. – zhaqenl Apr 25 '20 at 01:22
  • Ah, sorry, the docs I looked at seemed like they were showing me the latest version. Have you checked how flycheck is invoking pylint yet? – phils Apr 25 '20 at 02:04