Repository: spyder-ide/spyder

Issue:
"Real-time code style analysis" checkbox in Prefs > Editor > Introspection checks for pep8, not pycodestyle
## Description of your problem

In examining the code relevant to #5770 I noticed the following apparent bug, which I was able to reproduce cleanly in actual use. The "Real-time code style analysis" checkbox apparently in both `master` and `3.x` checks for the presence of `pep8` (`is_pep8 = get_checker_executable("pep8")`) and not `pycodestyle`; the former is not listed in requirements.txt for Spyder in either branch, and thus the user cannot enable `pep8` checking unless they separately install `pep8` for `get_checker_executable` to find it, even though Spyder's real time code style checking is now done by `pycodestyle`, not `pep8` anymore.

To verify this was an actual issue in real world use, I modified the relevant line in the file [plugins/editor.py](https://github.com/spyder-ide/spyder/blob/8397cfbc4acc0803fb0570c9bca7e529435203f3/spyder/plugins/editor.py) in a build forked from the `master` branch to read `get_checker_executable("pycodestyle")`. With the installation of the default requirements.txt into a fresh enviroment, i.e. `pycodestyle` and not , the option's checkbox was disabled in the GUI, but if I enabled in manually in the preferences file, code style checking worked fine. Conversely, when I removed pycodestyle and installed pep8, the checkbox was enabled, but checking was not performed if it was checked. 

Therefore, either I'm missing something (quite possible), or the line should be checking for "pycodestyle" and not "pep8" to fix the issue. This problem doesn't happen by default in Spyder 3.2.x installed with full fat Anaconda as it includes both packages, but is likely to be an issue for those with miniconda, custom/conda-env github dev installs, or installed using pip that don't otherwise happen to have pep8 installed as code style checking will erroneously disable itself.

**What steps will reproduce the problem?**

1. Create a a fresh conda-env (or virtualenv)
2.  Install requirements from requirements.txt
3. Open spyder, go to preferences and try to enable code style analysis

**What is the expected output? What do you see instead?**

Checkbox is enabled, style checking works if pycodestyle installed; inverse if not.

Checkbox greyed out; style checking works if manually enabled. If pycodestyle uninstalled and pep8 installed, checkbox enabled but checking does not work.

**Please provide any additional information below**


## Versions and main components

* Spyder Version: 3.2.5, 4.0 dev (master)
* Python Version: 3.6.3
* Qt Version: 5.6.2
* PyQt Version: 5.6
* Operating system: Win 8.1 Pro x64


## Dependencies

Default specified in `requirements.txt`, or otherwise as specified above.


Discussion:
@CAM-Gerlach, thanks for reporting.

@dalthviz, the change should be pretty easy.

Resolving patch:
diff --git a/spyder/plugins/editor.py b/spyder/plugins/editor.py
--- a/spyder/plugins/editor.py
+++ b/spyder/plugins/editor.py
@@ -246,7 +246,8 @@ def enable_tabwidth_spin(index):
         pep8_label = QLabel(_("<i>(Refer to the {} page)</i>").format(pep_url))
         pep8_label.setOpenExternalLinks(True)
         is_pyflakes = codeanalysis.is_pyflakes_installed()
-        is_pep8 = codeanalysis.get_checker_executable('pep8') is not None
+        is_pep8 = codeanalysis.get_checker_executable(
+                'pycodestyle') is not None
         pyflakes_box = newcb(_("Real-time code analysis"),
                       'code_analysis/pyflakes', default=True,
                       tip=_("<p>If enabled, Python source code will be analyzed "


Test patch: