Skip to content

Commit

Permalink
black#8
Browse files Browse the repository at this point in the history
  • Loading branch information
ricardobranco777 committed Sep 8, 2023
1 parent 3af5fc5 commit 620f6a4
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 4 deletions.
8 changes: 8 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,14 @@ jobs:
run: |
make flake8
continue-on-error: true
- name: mypy
run: |
make mypy
continue-on-error: true
- name: black
run: |
make black
continue-on-error: true
- name: pylint
run: |
make pylint
6 changes: 5 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
FILES=bugme.py

.PHONY: all
all: flake8 pylint mypy
all: flake8 pylint mypy black

.PHONY: flake8
flake8:
Expand All @@ -14,3 +14,7 @@ pylint:
.PHONY: mypy
mypy:
@mypy --disable-error-code=attr-defined $(FILES)

.PHONY: black
black:
@black $(FILES)
12 changes: 9 additions & 3 deletions bugme.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@
CREDENTIALS_FILE = os.path.expanduser("~/creds.json")


def dateit(date: Union[str, datetime], time_format: str = "%a %b %d %H:%M:%S %Z %Y") -> str:
def dateit(
date: Union[str, datetime], time_format: str = "%a %b %d %H:%M:%S %Z %Y"
) -> str:
"""
Return date in desired format
"""
Expand Down Expand Up @@ -67,7 +69,9 @@ def get_item(string: str) -> Union[Item, None]:
if url.hostname.startswith("git"):
return Item(
host=url.hostname,
repo=os.path.dirname(os.path.dirname(url.path.replace("/-/", "/"))).lstrip("/"),
repo=os.path.dirname(
os.path.dirname(url.path.replace("/-/", "/"))
).lstrip("/"),
issue_id=int(os.path.basename(url.path)),
)
if url.hostname.startswith("bugzilla"):
Expand Down Expand Up @@ -230,7 +234,9 @@ def get_item(self, item: Item) -> Union[Item, None]:
Get Gitlab issue
"""
try:
info = self.client.projects.get(item.repo, lazy=True).issues.get(item.item_id)
info = self.client.projects.get(item.repo, lazy=True).issues.get(
item.item_id
)
except GitlabError as exc:
logging.error("Gitlab: %s: get_issue(%s): %s", self.url, item.item_id, exc)
return None
Expand Down

0 comments on commit 620f6a4

Please sign in to comment.