Migrate pep8 to pycodestyle
This commit is contained in:
parent
9b9965094e
commit
94bf501cf3
|
@ -19,7 +19,7 @@ lint:coding-guideline:
|
||||||
image: 'registry.gitlab.com/danielsiepmann/neotags:latest'
|
image: 'registry.gitlab.com/danielsiepmann/neotags:latest'
|
||||||
stage: test
|
stage: test
|
||||||
script:
|
script:
|
||||||
- pep8 .
|
- pycodestyle --show-source --show-pep8 .
|
||||||
|
|
||||||
test:
|
test:
|
||||||
image: 'registry.gitlab.com/danielsiepmann/neotags:latest'
|
image: 'registry.gitlab.com/danielsiepmann/neotags:latest'
|
||||||
|
|
|
@ -5,4 +5,4 @@ LABEL Description="This image should provide environment to lint neotags" Vendor
|
||||||
|
|
||||||
# Install dependencies
|
# Install dependencies
|
||||||
RUN pip install --upgrade pip
|
RUN pip install --upgrade pip
|
||||||
RUN pip install --no-cache-dir pep8 pynvim pyfakefs==3.1
|
RUN pip install --no-cache-dir pycodestyle==2.5.0 pynvim pyfakefs==3.1
|
||||||
|
|
|
@ -36,11 +36,11 @@ class NeotagsPlugin(object):
|
||||||
self.debug('Triggered for "%s"' % filename)
|
self.debug('Triggered for "%s"' % filename)
|
||||||
|
|
||||||
pwd = self.nvim.funcs.execute('pwd').strip()
|
pwd = self.nvim.funcs.execute('pwd').strip()
|
||||||
relative_filename = filename.replace(pwd, '').lstrip('\/')
|
relative_filename = filename.replace(pwd, '').lstrip(r'\/')
|
||||||
|
|
||||||
try:
|
try:
|
||||||
tags_file = self.get_tags_file(filename)
|
tags_file = self.get_tags_file(filename)
|
||||||
except:
|
except BaseException:
|
||||||
self.error(
|
self.error(
|
||||||
'Could not determine tags file to update for "%s"' % (
|
'Could not determine tags file to update for "%s"' % (
|
||||||
filename
|
filename
|
||||||
|
@ -53,7 +53,7 @@ class NeotagsPlugin(object):
|
||||||
self.strip_existing_tags(tags_file, relative_filename)
|
self.strip_existing_tags(tags_file, relative_filename)
|
||||||
self.generate_tags(tags_file, relative_filename)
|
self.generate_tags(tags_file, relative_filename)
|
||||||
self.debug('Tags updated for "%s"' % filename)
|
self.debug('Tags updated for "%s"' % filename)
|
||||||
except:
|
except BaseException:
|
||||||
self.error(
|
self.error(
|
||||||
'Failed to update tags for "%s", reason: %s' % (
|
'Failed to update tags for "%s", reason: %s' % (
|
||||||
filename, traceback.format_exc()
|
filename, traceback.format_exc()
|
||||||
|
|
|
@ -7,6 +7,7 @@ import os
|
||||||
|
|
||||||
from python3.neotags import NeotagsPlugin
|
from python3.neotags import NeotagsPlugin
|
||||||
|
|
||||||
|
|
||||||
class TestNeotagsPlugin(fake_filesystem_unittest.TestCase):
|
class TestNeotagsPlugin(fake_filesystem_unittest.TestCase):
|
||||||
|
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
|
@ -149,5 +150,6 @@ class TestNeotagsPlugin(fake_filesystem_unittest.TestCase):
|
||||||
with open(tags_file) as f, open(expected_tags_file) as e:
|
with open(tags_file) as f, open(expected_tags_file) as e:
|
||||||
self.assertEqual(e.read(), f.read())
|
self.assertEqual(e.read(), f.read())
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
unittest.main()
|
unittest.main()
|
||||||
|
|
Loading…
Reference in a new issue