Skip to content

Commit

Permalink
dev(hansbug): fix lint problems
Browse files Browse the repository at this point in the history
  • Loading branch information
HansBug committed May 7, 2023
1 parent f92ec96 commit 0d086d8
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 17 deletions.
13 changes: 5 additions & 8 deletions .github/workflows/lint.yml
Expand Up @@ -28,13 +28,10 @@ jobs:
sudo apt-get install -y tree make wget curl cloc graphviz
dot -V
python -m pip install --upgrade pip
pip install --upgrade flake8 setuptools wheel twine
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
if [ -f requirements-test.txt ]; then pip install -r requirements-test.txt; fi
pip install --upgrade setuptools wheel twine
pip install -r requirements.txt
pip install -r requirements-test.txt
pip install -r requirements-lint.txt
- name: Basic lint with flake8
run: |
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
flake8 ./plantumlcli --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Lint with flake8
run: |
flake8 ./plantumlcli
make flake
2 changes: 0 additions & 2 deletions .github/workflows/sync.yml
Expand Up @@ -2,8 +2,6 @@ name: Repository Sync

on:
push:
schedule:
- cron: '0 1 * * *'

jobs:
sync:
Expand Down
6 changes: 6 additions & 0 deletions Makefile
Expand Up @@ -46,3 +46,9 @@ docs:
$(MAKE) -C "${DOC_DIR}" build
pdocs:
$(MAKE) -C "${DOC_DIR}" prod

flake:
flake8 ./plantumlcli --count --select=E9,F63,F7,F82 --show-source --statistics
flake8 ./plantumlcli --count --exit-zero \
--max-complexity=10 --max-line-length=127 --statistics \
--per-file-ignores="__init__.py:F401"
5 changes: 3 additions & 2 deletions plantumlcli/entry/cli.py
Expand Up @@ -72,15 +72,16 @@ def validate_concurrency(ctx: Context, param: Option, value: int):
@click.option('-p', '--plantuml', envvar=PLANTUML_JAR_ENV, type=str, default=None,
help=f'Path of plantuml jar file (will load from ${{{PLANTUML_JAR_ENV}}} when not given).')
@click.option('-r', '--remote-host', envvar=PLANTUML_HOST_ENV, type=str, default=OFFICIAL_PLANTUML_HOST,
help=f'Remote host of the online plantuml editor (will load from ${{{PLANTUML_HOST_ENV}}} when not given).',
help=f'Remote host of the online plantuml editor '
f'(will load from ${{{PLANTUML_HOST_ENV}}} when not given).',
show_default=True)
@click.option('-L', '--use-local', is_flag=True, help='Use local plantuml only.')
@click.option('-R', '--use-remote', is_flag=True, help='Use remote plantuml only.')
@click.option('-c', '--check', is_flag=True, help='Check usable plantuml.')
@click.option('-u', '--url', is_flag=True, help='Print url of remote plantuml resource (ignore -L and -R).')
@click.option('--homepage-url', is_flag=True, help='Print url of remote plantuml editor (ignore -L, -R and -u).')
@click.option('-t', '--type', 'resource_type', default=PlantumlResourceType.PNG.name,
type=click.Choice(PlantumlResourceType.__members__.keys(), case_sensitive=False),
type=click.Choice(list(PlantumlResourceType.__members__.keys()), case_sensitive=False),
help='Type of plantuml resource.', show_default=True)
@click.option('-T', '--text', is_flag=True, help='Display text uml graph by stdout (ignore -t).')
@click.option('-o', '--output', type=str, multiple=True,
Expand Down
2 changes: 1 addition & 1 deletion plantumlcli/entry/general.py
Expand Up @@ -57,7 +57,7 @@ def print_check_info(check_type: PlantumlCheckType,
pass


def print_text_graph(plantuml: Plantuml, sources: Tuple[str], concurrency: int):
def print_text_graph(plantuml: Plantuml, sources: Tuple[str], concurrency: int): # noqa
"""
Print text graph of source codes
:param plantuml: plantuml object
Expand Down
6 changes: 2 additions & 4 deletions plantumlcli/utils/concurrent.py
Expand Up @@ -12,10 +12,8 @@ def _default_final_error_process(errors: List[Tuple[int, _Ti, Exception]]):
raise err


def linear_process(items: Iterable[_Ti],
process: Callable[[int, _Ti], _Tr],
post_process: Callable[[int, _Ti, _Tr], None],
concurrency: int = None,
def linear_process(items: Iterable[_Ti], process: Callable[[int, _Ti], _Tr], # noqa
post_process: Callable[[int, _Ti, _Tr], None], concurrency: int = None,
skip_once_error: bool = True,
final_error_process: Optional[Callable[[List[Tuple[int, _Ti, Exception]]], None]] = None):
concurrency = concurrency or cpu_count()
Expand Down

0 comments on commit 0d086d8

Please sign in to comment.