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

Linter Checking #2

Open
wants to merge 7 commits 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
11 changes: 7 additions & 4 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
name: Greet Everyone
on: [push]
name: Linter Check
on: [push, pull_request]

jobs:
build:
name: test
runs-on: ubuntu-latest
steps:
- name: Build
run: docker build .
- name: install linter
run: sudo apt install pylint

- name: lint
run: pylint "manage_externals/manic"
3 changes: 0 additions & 3 deletions fail.c

This file was deleted.

22 changes: 11 additions & 11 deletions manage_externals/manic/externals_description.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
from __future__ import unicode_literals
from __future__ import print_function


import logging
import os
import os.path
Expand Down Expand Up @@ -103,7 +104,7 @@ def read_externals_description_file(root_dir, file_name):

return externals_description

class LstripReader(object):
class LstripReader():
"LstripReader formats .gitmodules files to be acceptable for configparser"
def __init__(self, filename):
with open(filename, 'r') as infile:
Expand All @@ -114,14 +115,21 @@ def __init__(self, filename):
for line in lines:
self._lines.append(line.lstrip())

def iternext(self):
"""Return the next line or raise StopIteration"""
if self._index >= self._num_lines:
raise StopIteration

self._index = self._index + 1
return self._lines[self._index - 1]
def readlines(self):
"""Return all the lines from this object's file"""
return self._lines

def readline(self, size=-1):
"""Format and return the next line or raise StopIteration"""
try:
line = self.next()
line = self.iternext()
except StopIteration:
line = ''

Expand All @@ -135,16 +143,8 @@ def __iter__(self):
self._index = 0
return self

def next(self):
"""Return the next line or raise StopIteration"""
if self._index >= self._num_lines:
raise StopIteration

self._index = self._index + 1
return self._lines[self._index - 1]

def __next__(self):
return self.next()
return self.iternext()

def git_submodule_status(repo_dir):
"""Run the git submodule status command to obtain submodule hashes.
Expand Down
2 changes: 1 addition & 1 deletion manage_externals/manic/externals_status.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
from .global_constants import VERBOSITY_VERBOSE, VERBOSITY_DUMP


class ExternalStatus(object):
class ExternalStatus():
"""Class to represent the status of a given source repository or tree.

Individual repositories determine their own status in the
Expand Down
2 changes: 1 addition & 1 deletion manage_externals/manic/repository.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from .global_constants import EMPTY_STR


class Repository(object):
class Repository():
"""
Class to represent and operate on a repository description.
"""
Expand Down
1 change: 1 addition & 0 deletions manage_externals/manic/repository_svn.py
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,7 @@ def xml_status_is_dirty(svn_output):
is_dirty = False
try:
xml_status = ET.fromstring(svn_output)
# pylint: disable=broad-except
except BaseException:
fatal_error(
"SVN returned invalid XML message {}".format(svn_output))
Expand Down
4 changes: 2 additions & 2 deletions manage_externals/manic/sourcetree.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
from .global_constants import EMPTY_STR, LOCAL_PATH_INDICATOR
from .global_constants import VERBOSITY_VERBOSE

class _External(object):
class _External():
"""
_External represents an external object inside a SourceTree
"""
Expand Down Expand Up @@ -264,7 +264,7 @@ def _create_externals_sourcetree(self):
self._externals_sourcetree = SourceTree(externals_root, externals)
os.chdir(cwd)

class SourceTree(object):
class SourceTree():
"""
SourceTree represents a group of managed externals
"""
Expand Down
1 change: 1 addition & 0 deletions something else.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
also a test
1 change: 1 addition & 0 deletions something.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
a file to test things
1 change: 0 additions & 1 deletion test.txt

This file was deleted.