Skip to content
This repository has been archived by the owner on Mar 8, 2024. It is now read-only.

Commit

Permalink
Merge pull request #1 from jpetrucciani/actions
Browse files Browse the repository at this point in the history
adding github actions, fixing prospector issues
  • Loading branch information
jpetrucciani authored Oct 10, 2019
2 parents 50d4034 + d365f72 commit d87fa9d
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 9 deletions.
29 changes: 29 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: test

on: [push, pull_request]

jobs:
archives:
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v1
- uses: jpetrucciani/archives-check@master
with:
path: 'archives/'
prospector:
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v1
- uses: jpetrucciani/prospector-check@master
mypy:
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v1
- uses: jpetrucciani/mypy-check@master
black:
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v1
- uses: jpetrucciani/black-check@master
with:
path: 'archives/'
7 changes: 5 additions & 2 deletions .prospector.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ ignore-patterns:
- (^|/)\..+
- .*\.html
- docs/.*
- extra/.*
- tmp\.py

pylint:
Expand All @@ -22,9 +23,9 @@ pylint:
- wrong-import-order

options:
max-args: 10
max-args: 20
max-locals: 100
max-returns: 6
max-returns: 10
max-branches: 50
max-statements: 180
max-parents: 10
Expand Down Expand Up @@ -67,11 +68,13 @@ pep257:
- D105
- D107
- D200
- D202
- D203
- D205
- D212
- D204
- D300
- D301
- D400
- D401
- D404
Expand Down
2 changes: 1 addition & 1 deletion archives/archives.py
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@ def archives(
verbose: bool,
include: str,
exclude: str,
format: str,
format: str, # pylint: disable=redefined-builtin
disable: str,
list_rules: bool,
list_tags: bool,
Expand Down
7 changes: 3 additions & 4 deletions archives/models/python.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,7 @@ def parse_elt(elt: Union[ast3.Name, ast3.Subscript]) -> str:
return "{}[{}]".format(
name, ", ".join(parse_elt(x) for x in value.elts) # type: ignore
)
else:
debug(value)
debug(value)
return ""


Expand Down Expand Up @@ -96,7 +95,7 @@ def __init__(self, doc_string: ast3.Expr, doc_type: Type) -> None:
self.value = doc_string.value.s.strip() # type: ignore
desc = Tags.DESC.regex.search(self.value)
ret = Tags.RETURN.regex.search(self.value)
cc = Tags.CC.regex.search(self.value)
cc = Tags.CC.regex.search(self.value) # pylint: disable=invalid-name
author = Tags.AUTHOR.regex.search(self.value)
todo = Tags.TODO.regex.search(self.value)

Expand All @@ -113,7 +112,7 @@ def __init__(self, doc_string: ast3.Expr, doc_type: Type) -> None:
self.links = {x: y for x, y in Tags.LINK.regex.findall(self.value)}
self.ret = ret[1] if ret else ""
self.author = author[1] if author else ""
self.cc = int(cc[1] if cc else -1)
self.cc = int(cc[1] if cc else -1) # pylint: disable=invalid-name

self.notes = [x for x in Tags.NOTE.regex.findall(self.value)]
self.warnings = [x for x in Tags.WARN.regex.findall(self.value)]
Expand Down
4 changes: 2 additions & 2 deletions archives/utils/files.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ def find_project_root(sources: Iterable[str]) -> Path:
if (directory / ".git").is_dir():
return directory

return directory
return directory # pylint: disable=undefined-loop-variable


def path_empty(src: Tuple[str], ctx: click.Context) -> None:
Expand Down Expand Up @@ -97,7 +97,7 @@ def decode_bytes(src: bytes) -> Tuple[str, str, str]:
if not lines:
return "", encoding, "\n"

newline = "\r\n" if b"\r\n" == lines[0][-2:] else "\n"
newline = "\r\n" if lines[0][-2:] == b"\r\n" else "\n"
srcbuf.seek(0)
with io.TextIOWrapper(srcbuf, encoding) as tiow:
return tiow.read(), encoding, newline

0 comments on commit d87fa9d

Please sign in to comment.