-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
07921ed
commit c8befb3
Showing
10 changed files
with
235 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,24 @@ | ||
# So all sections are disabled by default | ||
Default.enabled = false | ||
PythonCheck.enabled = true | ||
DOCS.enabled = true | ||
|
||
[Default] | ||
[linecounting] | ||
bears = LineCountBear | ||
enabled = true | ||
files = *.py, bears/**/*.py, coalib/**/*.py, ./coala | ||
|
||
[PythonCheck] | ||
[default] | ||
enabled = false | ||
files = *.py, bears/**/*.py, coalib/**/*.py, ./coala | ||
[docs] | ||
enabled = true | ||
bears = SpaceConsistencyBear | ||
files = doc/**/*.md | ||
use_spaces = True | ||
[pythoncheck] | ||
enabled = true | ||
bears = SpaceConsistencyBear, LineLengthBear | ||
use_spaces = True | ||
max_line_length = 80 | ||
|
||
[LineCounting] | ||
bears = LineCountBear | ||
|
||
[TODOS] | ||
files = *.py, bears/**/*.py, coalib/**/*.py, ./coala | ||
[todos] | ||
bears = KeywordBear | ||
ci_keywords = \#TODO, \# TODO, \#FIXME, \# FIXME | ||
cs_keywords = | ||
ci_keywords, cs_keywords = TODO, FIXME | ||
enabled = true | ||
files = *.py, bears/**/*.py, coalib/**/*.py, ./coala | ||
|
||
[DOCS] | ||
bears = SpaceConsistencyBear | ||
files = doc/**/*.md | ||
use_spaces = True |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,4 +5,4 @@ | |
|
||
if __name__ == '__main__': | ||
app = coalaApp() | ||
app.run(sys.argv) | ||
app.run(sys.argv) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
from gi.repository import Gtk | ||
from gi.repository import GtkSource | ||
|
||
|
||
class LineRenderer(GtkSource.GutterRendererText): | ||
line_offset = 0 | ||
|
||
def __init__(self, start_line, *args, **kwargs): | ||
self.line_offset = start_line | ||
GtkSource.GutterRendererText.__init__(self, *args, **kwargs) | ||
|
||
def do_query_data(self, start, end, flags): | ||
self.props.text = str(start.get_line() + self.line_offset + 1) | ||
label = Gtk.Label() | ||
pango_layout = label.get_layout() | ||
pango_layout.set_text(self.props.text, len(self.props.text)) | ||
self.props.size = pango_layout.get_pixel_size()[0] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
from coalib.settings.ConfigurationGathering import gather_configuration | ||
from coalib.processes.Processing import execute_section | ||
from coalib.output.NullInteractor import NullInteractor | ||
|
||
|
||
def run_coala(): | ||
bear_results = {} | ||
yielded_results = None | ||
(sections, | ||
local_bears, | ||
global_bears, | ||
targets, | ||
interactor, | ||
log_printer) = gather_configuration() | ||
|
||
interactor = NullInteractor(log_printer) | ||
|
||
for section_name in sections: | ||
section = sections[section_name] | ||
if not section.is_enabled(targets): | ||
continue | ||
|
||
interactor.begin_section(section) | ||
results = execute_section(section=section, | ||
global_bear_list=global_bears[section_name], | ||
local_bear_list=local_bears[section_name], | ||
print_results=interactor.print_results, | ||
finalize=interactor.finalize, | ||
log_printer=log_printer) | ||
yielded_results = yielded_results or results[0] | ||
for file, result_list in results[1].items(): | ||
if file in bear_results: | ||
bear_results[file].extend(result_list) | ||
else: | ||
bear_results[file] = result_list | ||
|
||
for bear, result_list in results[2].items(): | ||
for result in result_list: | ||
if result.file in bear_results: | ||
bear_results[result.file].append(result) | ||
else: | ||
bear_results[result.file] = [result] | ||
return bear_results | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters