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

GixyBear.py: add GixyBear #2745

Closed
wants to merge 1 commit into from
Closed
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
2 changes: 2 additions & 0 deletions bear-requirements.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,8 @@ npm_requirements:
write-good:
version: ~0.9.1
pip_requirements:
Gixy:
version: ~0.1.20
HTTPolice:
version: ~=0.5.2
aenum:
Expand Down
10 changes: 10 additions & 0 deletions bears/general/GixyBear.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
from coalib.bearlib.abstractions.Linter import linter
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code does not comply to PEP8.

Origin: PEP8Bear, Section: all.autopep8.

The issue can be fixed by applying the following patch:

--- a/tmp/tmpt_yx8rpp/bears/general/GixyBear.py
+++ b/tmp/tmpt_yx8rpp/bears/general/GixyBear.py
@@ -1,4 +1,5 @@
 from coalib.bearlib.abstractions.Linter import linter
+
 
 @linter(executable='gixy',
         output_format='corrected',



@linter(executable='gixy',
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

E302 expected 2 blank lines, found 1

Origin: PycodestyleBear (E302), Section: all.autopep8.

output_format='regex',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this only says which mode the bear is in. you need to write the regex. see the linter bear docs. it has a tutorial which covers this.

result_message='done')
class GixyBear:
@staticmethod
def create_arguments(filename, file, config_file):
return '--', filename
22 changes: 22 additions & 0 deletions tests/general/GixyBearTest.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
from queue import Queue

from bears.general.GixyBear import GixyBear
from coalib.testing.LocalBearTestHelper import LocalBearTestHelper
from coalib.results.Result import Result
from coalib.settings.Section import Section

file = '1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n'
jayvdb marked this conversation as resolved.
Show resolved Hide resolved


class TooManyLinesBearTest(LocalBearTestHelper):
jayvdb marked this conversation as resolved.
Show resolved Hide resolved

def setUp(self):
self.uut = GixyBear(Section('name'), Queue())

def test_run(self):
self.check_results(
self.uut,
file,
[Result.from_values('GixyBear',
'done',
file)])