Plugin for gedit that allow flake8 integration
author: | Sébastien CHAZALLET <s.chazallet@gmail.com> |
---|---|
organization: | InsPyration EURL |
copyright: | Copyright © InsPyration EURL <www.inspyration.org> |
license: | GPL 3 <http://www.gnu.org/licenses/gpl.html> |
version: | 0.1 |
Module used to manage the results of flake8 :
> 1. get them instead of print them ; > 2. format them ;
This module works with Python2 and Python3
author: | Sébastien CHAZALLET <s.chazallet@gmail.com> |
---|---|
organization: | InsPyration EURL |
copyright: | Copyright © InsPyration EURL <www.inspyration.org> |
license: | GPL 3 <http://www.gnu.org/licenses/gpl.html> |
version: | 0.1 |
Function used to extract useful informations from flake8 results
Parameters: | warnings (str) – Warnings generated by flake8 |
---|---|
Return type: | list |
Returns: | list of (code:str, line:int, col:int, description:str) |
>>> result = _format_flake8_results(
... '''stdin:1:10: E901 SyntaxError: unexpected EOF while parsing
... stdin:2:1: E901 TokenError: EOF in multi-line statement''')
>>> for r in result:
... print r
...
(' e901', 1, 10, 'SyntaxError: unexpected EOF while parsing')
(' e901', 2, 1, 'TokenError: EOF in multi-line statement')
Function used to redirect printed to returned value
Parameters: | action (function) – Called function that we intercept prints |
---|---|
Return type: | str |
Returns: | all that was printed by the call of action |
>>> def do():
... print('Hello World')
...
>>> result = _intercept_printed(do)
>>> print(result)
Hello World
Function used to return the printed result of flake8 check_code function
>>> result = check_code_with_flake8("a = 42")
>>> print(result)
>>> result = check_code_with_flake8("a = f(42")
>>> print(result)
stdin:1:10: E901 SyntaxError: unexpected EOF while parsing
stdin:2:1: E901 TokenError: EOF in multi-line statement
Main module of the Plugin for gedit that allow flake8 integration
author: | Sébastien CHAZALLET <s.chazallet@gmail.com> |
---|---|
organization: | InsPyration EURL |
copyright: | Copyright © InsPyration EURL <www.inspyration.org> |
license: | GPL 3 <http://www.gnu.org/licenses/gpl.html> |
version: | 0.1 |
Main module of the gedit flake8 plugin
Initialize plugin
Parameters: | action (function) – Called function that we intercept prints |
---|---|
Return type: | None |
Activate the plugin
Parameters: | self (GeditFlake8WindowActivatable) – Current plugin |
---|---|
Return type: | None |
Action when a user want to configure the plugin
Parameters: | self (GeditFlake8WindowActivatable) – Current plugin |
---|---|
Return type: | GeditFlake8ConfigWidget |
Returns: | a configuration widget |
Deactivate the plugin
Parameters: | self (GeditFlake8WindowActivatable) – Current plugin |
---|---|
Return type: | None |
Allow to activate the plugin only if the document is python code If the document is a new document, it hasto be saved or the language of the document has to be set.
Parameters: | self (GeditFlake8WindowActivatable) – Current plugin |
---|---|
Return type: | None |
The user ask to check code source : 1check there is a doc and the doc is python code 2use flake8 3put flake8 results into the tree and activate it
Parameters: |
|
---|---|
Return type: | None |
Module managing the tree and all stuff around it
author: | Sébastien CHAZALLET <s.chazallet@gmail.com> |
---|---|
organization: | InsPyration EURL |
copyright: | Copyright © InsPyration EURL <www.inspyration.org> |
license: | GPL 3 <http://www.gnu.org/licenses/gpl.html> |
version: | 0.1 |
Tree inside gedit side panel containing all flake8 warnings
Configure tree columns, tree selection and add it to side panel
Parameters: |
|
---|---|
Return type: | None |
show the tree in the side panel
Parameters: | self (GeditFlake8Tree) – Current tree |
---|---|
Return type: | None |
When a tree line is selected, go to the file linked line
Parameters: |
|
---|---|
Return type: | None |
Module used to define how to manage settings and their persistence
author: | Sébastien CHAZALLET <s.chazallet@gmail.com> |
---|---|
organization: | InsPyration EURL |
copyright: | Copyright © InsPyration EURL <www.inspyration.org> |
license: | GPL 3 <http://www.gnu.org/licenses/gpl.html> |
version: | 0.1 |
Allow to manage local settings and it persistent storage
Initialize Settings Manager
Parameters: | self (SettingsManager) – Current manager |
---|---|
Return type: | None |
list of weak references to the object (if defined)
Get the user defined complexity parameter
Parameters: | self (SettingsManager) – Current manager |
---|---|
Return type: | int |
Returns: | complexity |
Allow to share information about key used to store complexity
Parameters: | self (SettingsManager) – Current manager |
---|---|
Return type: | str |
Returns: | name of the complexity key |
Allow to share information about keys used to store ignore list
Parameters: | self (SettingsManager) – Current manager |
---|---|
Return type: | list of tuple of str |
Returns: | list of (ignore key, ignore label) |
Allow to share information about keys used to store ignore list
Parameters: | self (SettingsManager) – Current manager |
---|---|
Return type: | list of str |
Returns: | list of ignore keys |
Get the user defined warning keys to ignore
Parameters: | self (SettingsManager) – Current manager |
---|---|
Return type: | list of str |
Returns: | list of warning keys |
Answer to “Is tag in ignore list ?” question
Parameters: |
|
---|---|
Return type: | bool |
Returns: | True if the key is in ignore list, False otherwise |
Pull operation update local settings from persistent storage
Parameters: | self (SettingsManager) – Current manager |
---|---|
Return type: | None |
Module used to configure plugin from an easy-to-use widget
author: | Sébastien CHAZALLET <s.chazallet@gmail.com> |
---|---|
organization: | InsPyration EURL |
copyright: | Copyright © InsPyration EURL <www.inspyration.org> |
license: | GPL 3 <http://www.gnu.org/licenses/gpl.html> |
version: | 0.1 |
This plugin is under active development.