From 59192453ded5a9ca281d2828be8614a5e18c7c44 Mon Sep 17 00:00:00 2001 From: ecarton Date: Wed, 24 Jun 2020 14:47:49 -0400 Subject: [PATCH 1/7] testing --- fail.c | 3 --- test.txt | 1 - 2 files changed, 4 deletions(-) delete mode 100644 fail.c delete mode 100644 test.txt diff --git a/fail.c b/fail.c deleted file mode 100644 index 65ef279..0000000 --- a/fail.c +++ /dev/null @@ -1,3 +0,0 @@ -int main(){ - return 1; -} \ No newline at end of file diff --git a/test.txt b/test.txt deleted file mode 100644 index 5a1f992..0000000 --- a/test.txt +++ /dev/null @@ -1 +0,0 @@ -this is a dumy file \ No newline at end of file From 5f59b9dc8843aeb3794eafd82ceef44496e1ad41 Mon Sep 17 00:00:00 2001 From: ecarton Date: Wed, 24 Jun 2020 15:16:59 -0400 Subject: [PATCH 2/7] a commit to test --- something else.txt | 1 + something.txt | 1 + 2 files changed, 2 insertions(+) create mode 100644 something else.txt create mode 100644 something.txt diff --git a/something else.txt b/something else.txt new file mode 100644 index 0000000..1568806 --- /dev/null +++ b/something else.txt @@ -0,0 +1 @@ +more of the same \ No newline at end of file diff --git a/something.txt b/something.txt new file mode 100644 index 0000000..ccff4d3 --- /dev/null +++ b/something.txt @@ -0,0 +1 @@ +a test of commits and pushes \ No newline at end of file From a84acb973d5c31582ebbb76d8367005d2cc399e0 Mon Sep 17 00:00:00 2001 From: ecarton Date: Wed, 24 Jun 2020 15:19:12 -0400 Subject: [PATCH 3/7] a test commit --- README.md | 4 +++- something else.txt | 2 +- something.txt | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 64e4a1a..c2bd09e 100644 --- a/README.md +++ b/README.md @@ -7,4 +7,6 @@ includes a full workflow, with pre-processing (preparation of inputs), a forecast model, and post-processing. Details at: -https://github.com/ufs-community/ufs-mrweather-app/wiki \ No newline at end of file +https://github.com/ufs-community/ufs-mrweather-app/wiki + +a file change \ No newline at end of file diff --git a/something else.txt b/something else.txt index 1568806..ab1c9c2 100644 --- a/something else.txt +++ b/something else.txt @@ -1 +1 @@ -more of the same \ No newline at end of file +also a test \ No newline at end of file diff --git a/something.txt b/something.txt index ccff4d3..5e136f2 100644 --- a/something.txt +++ b/something.txt @@ -1 +1 @@ -a test of commits and pushes \ No newline at end of file +a file to test things \ No newline at end of file From a82e222e5ae655f4a054263f579738b0395e1e6c Mon Sep 17 00:00:00 2001 From: ecarton Date: Thu, 9 Jul 2020 18:36:28 -0400 Subject: [PATCH 4/7] fixed all linter errors --- .github/workflows/main.yml | 5 +++-- README.md | 4 +--- .../manic/externals_description.py | 22 +++++++++---------- manage_externals/manic/externals_status.py | 2 +- manage_externals/manic/repository.py | 2 +- manage_externals/manic/repository_svn.py | 1 + manage_externals/manic/sourcetree.py | 4 ++-- 7 files changed, 20 insertions(+), 20 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 576cbdf..692aace 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -6,5 +6,6 @@ jobs: name: test runs-on: ubuntu-latest steps: - - name: Build - run: docker build . \ No newline at end of file + + - name: lint + run: pylint "manage_externals/manic" \ No newline at end of file diff --git a/README.md b/README.md index c2bd09e..64e4a1a 100644 --- a/README.md +++ b/README.md @@ -7,6 +7,4 @@ includes a full workflow, with pre-processing (preparation of inputs), a forecast model, and post-processing. Details at: -https://github.com/ufs-community/ufs-mrweather-app/wiki - -a file change \ No newline at end of file +https://github.com/ufs-community/ufs-mrweather-app/wiki \ No newline at end of file diff --git a/manage_externals/manic/externals_description.py b/manage_externals/manic/externals_description.py index bd644c9..ae16893 100644 --- a/manage_externals/manic/externals_description.py +++ b/manage_externals/manic/externals_description.py @@ -17,6 +17,7 @@ from __future__ import unicode_literals from __future__ import print_function + import logging import os import os.path @@ -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: @@ -114,6 +115,13 @@ 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 @@ -121,7 +129,7 @@ def readlines(self): def readline(self, size=-1): """Format and return the next line or raise StopIteration""" try: - line = self.next() + line = self.iternext() except StopIteration: line = '' @@ -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. diff --git a/manage_externals/manic/externals_status.py b/manage_externals/manic/externals_status.py index d3d238f..90dab99 100644 --- a/manage_externals/manic/externals_status.py +++ b/manage_externals/manic/externals_status.py @@ -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 diff --git a/manage_externals/manic/repository.py b/manage_externals/manic/repository.py index ea4230f..50d6899 100644 --- a/manage_externals/manic/repository.py +++ b/manage_externals/manic/repository.py @@ -6,7 +6,7 @@ from .global_constants import EMPTY_STR -class Repository(object): +class Repository(): """ Class to represent and operate on a repository description. """ diff --git a/manage_externals/manic/repository_svn.py b/manage_externals/manic/repository_svn.py index 408ed84..eac35bb 100644 --- a/manage_externals/manic/repository_svn.py +++ b/manage_externals/manic/repository_svn.py @@ -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)) diff --git a/manage_externals/manic/sourcetree.py b/manage_externals/manic/sourcetree.py index b9c9c21..163572b 100644 --- a/manage_externals/manic/sourcetree.py +++ b/manage_externals/manic/sourcetree.py @@ -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 """ @@ -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 """ From 6988b4d782dbe79bcba0275dcbf12d3ae80fef96 Mon Sep 17 00:00:00 2001 From: ecarton Date: Thu, 9 Jul 2020 20:27:55 -0400 Subject: [PATCH 5/7] fixed all linter errors --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 692aace..5ab4f88 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,5 +1,5 @@ name: Greet Everyone -on: [push] +on: [push, pull_request] jobs: build: From 476476b473751bb0db498c3aed18f2d09c8a5c07 Mon Sep 17 00:00:00 2001 From: ecarton Date: Thu, 9 Jul 2020 20:33:32 -0400 Subject: [PATCH 6/7] correct name --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 5ab4f88..8b0fece 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,4 +1,4 @@ -name: Greet Everyone +name: Linter Check on: [push, pull_request] jobs: From ae8315dcd62bf1b94daa2b91b9ce2e04e0f1ef49 Mon Sep 17 00:00:00 2001 From: ecarton Date: Thu, 9 Jul 2020 20:38:51 -0400 Subject: [PATCH 7/7] fixed all linter errors --- .github/workflows/main.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 8b0fece..31dac23 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -6,6 +6,8 @@ jobs: name: test runs-on: ubuntu-latest steps: + - name: install linter + run: sudo apt install pylint - name: lint run: pylint "manage_externals/manic" \ No newline at end of file