Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Python syntax checking: Replace not maintained pep8 by pycodestyle #3872

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/chrome/komodo/content/library/test/test_pylint.jsm
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@ TestPylint.prototype.setUp = function TestPylint_setUp() {
lint_python_with_standard_python: this.globalPrefs.getBooleanPref("lint_python_with_standard_python"),
lint_python3_with_standard_python: this.globalPrefs.getBooleanPref("lint_python3_with_standard_python"),
lint_python_with_pyflakes: this.globalPrefs.getBooleanPref("lint_python_with_pyflakes"),
lint_python_with_pep8: this.globalPrefs.getBooleanPref("lint_python_with_pep8"),
lint_python_with_pycodestyle: this.globalPrefs.getBooleanPref("lint_python_with_pycodestyle"),
lint_python_with_pychecker: this.globalPrefs.getBooleanPref("lint_python_with_pychecker"),
lint_python3_with_pyflakes3: this.globalPrefs.getBooleanPref("lint_python3_with_pyflakes3"),
lint_python3_with_pep83: this.globalPrefs.getBooleanPref("lint_python3_with_pep83"),
lint_python3_with_pycodestyle3: this.globalPrefs.getBooleanPref("lint_python3_with_pycodestyle3"),
lint_python3_with_pychecker3: this.globalPrefs.getBooleanPref("lint_python3_with_pychecker3")
};
this.origStringPrefs = {
Expand Down
8 changes: 4 additions & 4 deletions src/chrome/komodo/content/lint/lint.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,16 +113,16 @@ var global_pref_observer_topics = {
"pythonDefaultInterpreter" : PYTHON_LIST,
"python3DefaultInterpreter" : PYTHON3_LIST,
"lint_python_with_pylint" : PYTHON_LIST,
"lint_python_with_pep8" : PYTHON_LIST,
"lint_python_with_pycodestyle" : PYTHON_LIST,
"lint_python_with_pyflakes" : PYTHON_LIST,
"lint_python_with_standard_python" : PYTHON_LIST,
"lint_python3_with_standard_python" : PYTHON3_LIST,
"lint_python3_with_pylint3" : PYTHON3_LIST,
"lint_python3_with_pep83" : PYTHON3_LIST,
"lint_python3_with_pycodestyle3" : PYTHON3_LIST,
"lint_python3_with_pyflakes3" : PYTHON3_LIST,
"pylint_checking_rcfile" : PYTHON_LIST,
"pep8_checking_rcfile" : PYTHON_LIST,
"pep83_checking_rcfile" : PYTHON3_LIST,
"pycodestyle_checking_rcfile" : PYTHON_LIST,
"pycodestyle3_checking_rcfile" : PYTHON3_LIST,
"lint_python_with_pychecker" : PYTHON_LIST,
"pychecker_checking_rcfile" : PYTHON_LIST,
"phpDefaultInterpreter" : PHP_LIST,
Expand Down
84 changes: 42 additions & 42 deletions src/chrome/komodo/content/pref/pref-syntax-checking.js
Original file line number Diff line number Diff line change
Expand Up @@ -640,7 +640,7 @@ function python_setup() {
dialog.Python = {};
[
"lint_python_with_pychecker",
"lint_python_with_pep8",
"lint_python_with_pycodestyle",
"lint_python_with_pylint",
"lint_python_with_pyflakes",
"pychecker_browse_rcfile",
Expand All @@ -655,10 +655,10 @@ function python_setup() {
"pylint_checking_rcfile",
"pylint_failure",
"pylint_checking_vbox_rcfile",
"pep8_browse_rcfile",
"pep8_checking_rcfile",
"pep8_failure",
"pep8_checking_vbox_rcfile",
"pycodestyle_browse_rcfile",
"pycodestyle_checking_rcfile",
"pycodestyle_failure",
"pycodestyle_checking_vbox_rcfile",
"python_lintOption"
].forEach(function(name) {
dialog.Python[name] = document.getElementById(name);
Expand All @@ -669,10 +669,10 @@ function python_setup() {
getService(Components.interfaces.koIAppInfoEx);
var pythonExe = appInfoEx.executablePath;
var pylintStatusByExecutable = languageInfo.Python.pylintStatusByExecutable;
var pep8StatusByExecutable = languageInfo.Python.pep8StatusByExecutable;
var pycodestyleStatusByExecutable = languageInfo.Python.pycodestyleStatusByExecutable;
var pyflakesStatusByExecutable = languageInfo.Python.pyflakesStatusByExecutable;
if (!(pythonExe in pylintStatusByExecutable)
|| !(pythonExe in pep8StatusByExecutable)
|| !(pythonExe in pycodestyleStatusByExecutable)
|| !(pythonExe in pyflakesStatusByExecutable)) {
setTimeout(function() {
var res;
Expand All @@ -681,8 +681,8 @@ function python_setup() {
res = appInfoEx.haveModules(1, ['pylint']);
pylintStatusByExecutable[pythonExe] = res;
}
if (!(pythonExe in pep8StatusByExecutable)) {
pep8StatusByExecutable[pythonExe] = appInfoEx.haveModules(1, ['pep8']);
if (!(pythonExe in pycodestyleStatusByExecutable)) {
pycodestyleStatusByExecutable[pythonExe] = appInfoEx.haveModules(1, ['pycodestyle']);
}
if (!(pythonExe in pyflakesStatusByExecutable)) {
res = null;
Expand All @@ -709,7 +709,7 @@ languageSetup.Python = python_setup;
function pythonInfo() {
return {
pylintStatusByExecutable: {},
pep8StatusByExecutable: {},
pycodestyleStatusByExecutable: {},
pyflakesStatusByExecutable: {},

_updateFailureBox: function(failureNode, pythonExe, linterName) {
Expand Down Expand Up @@ -740,18 +740,18 @@ function pythonInfo() {
}
this.onTogglePylintChecking(checkbox);

// pep8
var checkbox = dialog.Python.lint_python_with_pep8;
var failureNode = dialog.Python.pep8_failure;
if (pythonExe && this.pep8StatusByExecutable[pythonExe]) {
// pycodestyle
var checkbox = dialog.Python.lint_python_with_pycodestyle;
var failureNode = dialog.Python.pycodestyle_failure;
if (pythonExe && this.pycodestyleStatusByExecutable[pythonExe]) {
failureNode.setAttribute("class", "pref_hide");
checkbox.disabled = false;
} else {
checkbox.checked = false;
checkbox.disabled = true;
this._updateFailureBox(failureNode, pythonExe, "pep8");
this._updateFailureBox(failureNode, pythonExe, "pycodestyle");
}
this.onTogglePep8Checking(checkbox);
this.onTogglePycodestyleChecking(checkbox);

// pyflakes
checkbox = dialog.Python.lint_python_with_pyflakes;
Expand Down Expand Up @@ -782,8 +782,8 @@ function pythonInfo() {
dialog.Python.pylint_checking_vbox_rcfile.collapsed = !checkbox.checked;
},

onTogglePep8Checking: function(checkbox) {
dialog.Python.pep8_checking_vbox_rcfile.collapsed = !checkbox.checked;
onTogglePycodestyleChecking: function(checkbox) {
dialog.Python.pycodestyle_checking_vbox_rcfile.collapsed = !checkbox.checked;
},

onTogglePycheckerChecking: function(checkbox) {
Expand Down Expand Up @@ -821,9 +821,9 @@ function pythonInfo() {
"Find a .pylintrc file");
},

loadPep8Rcfile: function() {
this.loadTextboxFromFilepicker("pep8_checking_rcfile",
"Find a pep8 config file");
loadPycodestyleRcfile: function() {
this.loadTextboxFromFilepicker("pycodestyle_checking_rcfile",
"Find a pycodestyle config file");
},

loadPycheckerRcFile: function() {
Expand All @@ -847,7 +847,7 @@ function python3_setup() {
[
"lint_python3_with_pychecker3",
"lint_python3_with_pylint3",
"lint_python3_with_pep83",
"lint_python3_with_pycodestyle3",
"lint_python3_with_pyflakes3",
"pychecker3_browse_rcfile",
"pychecker3_browse_wrapper_location",
Expand All @@ -861,10 +861,10 @@ function python3_setup() {
"pylint3_checking_rcfile",
"pylint3_failure",
"pylint3_checking_vbox_rcfile",
"pep83_browse_rcfile",
"pep83_checking_rcfile",
"pep83_failure",
"pep83_checking_vbox_rcfile",
"pycodestyle3_browse_rcfile",
"pycodestyle3_checking_rcfile",
"pycodestyle3_failure",
"pycodestyle3_checking_vbox_rcfile",
"python3_lintOption"
].forEach(function(name) {
dialog.Python3[name] = document.getElementById(name);
Expand All @@ -875,10 +875,10 @@ function python3_setup() {
getService(Components.interfaces.koIAppInfoEx);
var python3Exe = appInfoEx.executablePath;
var pylint3StatusByExecutable = languageInfo.Python3.pylint3StatusByExecutable;
var pep83StatusByExecutable = languageInfo.Python3.pep83StatusByExecutable;
var pycodestyle3StatusByExecutable = languageInfo.Python3.pycodestyle3StatusByExecutable;
var pyflakes3StatusByExecutable = languageInfo.Python3.pyflakes3StatusByExecutable;
if (!(python3Exe in pylint3StatusByExecutable)
|| !(python3Exe in pep83StatusByExecutable)
|| !(python3Exe in pycodestyle3StatusByExecutable)
|| !(python3Exe in pyflakes3StatusByExecutable)) {
setTimeout(function() {
var res;
Expand All @@ -887,8 +887,8 @@ function python3_setup() {
res = appInfoEx.haveModules(1, ['pylint']);
pylint3StatusByExecutable[python3Exe] = res;
}
if (!(python3Exe in pep83StatusByExecutable)) {
pep83StatusByExecutable[python3Exe] = appInfoEx.haveModules(1, ['pep8']);
if (!(python3Exe in pycodestyle3StatusByExecutable)) {
pycodestyle3StatusByExecutable[python3Exe] = appInfoEx.haveModules(1, ['pycodestyle']);
}
if (!(python3Exe in pyflakes3StatusByExecutable)) {
res = appInfoEx.haveModules(1, ['pyflakes']);
Expand All @@ -907,7 +907,7 @@ languageSetup.Python3 = python3_setup;
function python3Info() {
return {
pylint3StatusByExecutable: {},
pep83StatusByExecutable: {},
pycodestyle3StatusByExecutable: {},
pyflakes3StatusByExecutable: {},

_updateFailureBox: function(failureNode, python3Exe, linterName) {
Expand Down Expand Up @@ -938,18 +938,18 @@ function python3Info() {
}
this.onTogglePylint3Checking(checkbox);

// pep8
var checkbox = dialog.Python3.lint_python3_with_pep83;
var failureNode = dialog.Python3.pep83_failure;
if (python3Exe && this.pep83StatusByExecutable[python3Exe]) {
// pycodestyle
var checkbox = dialog.Python3.lint_python3_with_pycodestyle3;
var failureNode = dialog.Python3.pycodestyle3_failure;
if (python3Exe && this.pycodestyle3StatusByExecutable[python3Exe]) {
failureNode.setAttribute("class", "pref_hide");
checkbox.disabled = false;
} else {
checkbox.checked = false;
checkbox.disabled = true;
this._updateFailureBox(failureNode, python3Exe, "pep8");
this._updateFailureBox(failureNode, python3Exe, "pycodestyle");
}
this.onTogglePep83Checking(checkbox);
this.onTogglePycodestyle3Checking(checkbox);

// pyflakes3
checkbox = dialog.Python3.lint_python3_with_pyflakes3;
Expand Down Expand Up @@ -979,8 +979,8 @@ function python3Info() {
onTogglePylint3Checking: function(checkbox) {
dialog.Python3.pylint3_checking_vbox_rcfile.collapsed = !checkbox.checked;
},
onTogglePep83Checking: function(checkbox) {
dialog.Python3.pep83_checking_vbox_rcfile.collapsed = !checkbox.checked;
onTogglePycodestyle3Checking: function(checkbox) {
dialog.Python3.pycodestyle3_checking_vbox_rcfile.collapsed = !checkbox.checked;
},
onTogglePychecker3Checking: function(checkbox) {
var pychecker3Enabled = checkbox.checked;
Expand Down Expand Up @@ -1017,9 +1017,9 @@ function python3Info() {
"Find a .pylintrc file");
},

loadPep83Rcfile: function() {
this.loadTextboxFromFilepicker("pep83_checking_rcfile",
"Find a pep8 config file");
loadPycodestyle3Rcfile: function() {
this.loadTextboxFromFilepicker("pycodestyle3_checking_rcfile",
"Find a pycodestyle config file");
},

loadPychecker3RcFile: function() {
Expand Down
48 changes: 24 additions & 24 deletions src/chrome/komodo/content/pref/pref-syntax-checking.xul
Original file line number Diff line number Diff line change
Expand Up @@ -484,19 +484,19 @@
</vbox>
<separator class="thin"/>

<checkbox id="lint_python_with_pep8"
label="&pep8CheckingStatus.label;"
<checkbox id="lint_python_with_pycodestyle"
label="&pycodestyleCheckingStatus.label;"
pref="true"
oncommand="languageInfo.Python.onTogglePep8Checking(this);" />
<description id="pep8_failure" class="pref_hide" />
<vbox id="pep8_checking_vbox_rcfile" class="indentedPref01">
<label id="pep8_checking_rcfile_label"
control="pep8_checking_rcfile"
value="&pep8RCFileLocation.label;" />
<hbox id="pep8_checking_hbox_rcfile">
<textbox id="pep8_checking_rcfile" pref="true"
prefstring="pep8_checking_rcfile" flex="1"/>
<button id="pep8_browse_rcfile" label="&browse.label;" oncommand="languageInfo.Python.loadPep8Rcfile();"/>
oncommand="languageInfo.Python.onTogglePycodestyleChecking(this);" />
<description id="pycodestyle_failure" class="pref_hide" />
<vbox id="pycodestyle_checking_vbox_rcfile" class="indentedPref01">
<label id="pycodestyle_checking_rcfile_label"
control="pycodestyle_checking_rcfile"
value="&pycodestyleRCFileLocation.label;" />
<hbox id="pycodestyle_checking_hbox_rcfile">
<textbox id="pycodestyle_checking_rcfile" pref="true"
prefstring="pycodestyle_checking_rcfile" flex="1"/>
<button id="pycodestyle_browse_rcfile" label="&browse.label;" oncommand="languageInfo.Python.loadPycodestyleRcfile();"/>
</hbox>
</vbox>
<separator class="thin"/>
Expand Down Expand Up @@ -565,20 +565,20 @@
</hbox>
</vbox>
<separator class="thin"/>
<checkbox id="lint_python3_with_pep83"
label="&pep8CheckingStatus.label;"
<checkbox id="lint_python3_with_pycodestyle3"
label="&pycodestyleCheckingStatus.label;"
pref="true"
oncommand="languageInfo.Python3.onTogglePep83Checking(this);" />
<description id="pep83_failure" class="pref_hide" />
oncommand="languageInfo.Python3.onTogglePycodestyle3Checking(this);" />
<description id="pycodestyle3_failure" class="pref_hide" />

<vbox id="pep83_checking_vbox_rcfile" class="indentedPref01">
<label id="pep83_checking_rcfile_label"
control="pep83_checking_rcfile"
value="&pep8RCFileLocation.label;" />
<hbox id="pep83_checking_hbox_rcfile">
<textbox id="pep83_checking_rcfile" pref="true"
prefstring="pep83_checking_rcfile" flex="1"/>
<button id="pep83_browse_rcfile" label="&browse.label;" oncommand="languageInfo.Python3.loadPep83Rcfile();"/>
<vbox id="pycodestyle3_checking_vbox_rcfile" class="indentedPref01">
<label id="pycodestyle3_checking_rcfile_label"
control="pycodestyle3_checking_rcfile"
value="&pycodestyleRCFileLocation.label;" />
<hbox id="pycodestyle3_checking_hbox_rcfile">
<textbox id="pycodestyle3_checking_rcfile" pref="true"
prefstring="pycodestyle3_checking_rcfile" flex="1"/>
<button id="pycodestyle3_browse_rcfile" label="&browse.label;" oncommand="languageInfo.Python3.loadPycodestyle3Rcfile();"/>
</hbox>
</vbox>
<separator class="thin"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ savingKeyBindingsFailed=Attempt to save keybindings failed
AttemptSaveSharedServerInfoFailed=Attempt to save shared server info failed
The current Python instance X doesnt have X installed=The current Python instance,\n%S,\ndoesn't have %S installed.
The current Python3 instance X doesnt have X installed=The current Python3 instance,\n%S,\ndoesn't have %S installed.
Find a pep8 config file=Find a pep8 config file
Find a pycodestyle config file=Find a pycodestyle config file
Find a .pylintrc file=Find a .pylintrc file
Find a pychecker script=Find a pychecker script
Find a .pycheckrc file=Find a .pycheckrc file
Expand Down
4 changes: 2 additions & 2 deletions src/chrome/komodo/locale/en-US/pref/pref.dtd
Original file line number Diff line number Diff line change
Expand Up @@ -390,8 +390,8 @@ adding an additional caret at the clicked position.">
<!ENTITY properties.label "Properties">
<!ENTITY proportional.label "Proportional">
<!ENTITY pyflakesChecking.label "Pyflakes Checking">
<!ENTITY pep8CheckingStatus.label "Do pep8 Checking">
<!ENTITY pep8RCFileLocation.label "Location of pep8 config file to use">
<!ENTITY pycodestyleCheckingStatus.label "Do pycodestyle Checking">
<!ENTITY pycodestyleRCFileLocation.label "Location of pycodestyle config file to use">
<!ENTITY pylintCheckingStatus.label "Do Pylint Checking">
<!ENTITY pylintRCFileLocation.label "Location of .pylintrc file to use">
<!ENTITY pyPython.label ".py: Python">
Expand Down
Loading