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

Linting improvements #39

Merged
merged 5 commits into from
Sep 30, 2019
Merged
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
1 change: 1 addition & 0 deletions bork/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import os
from pathlib import Path
import sys

import toml

from . import builder
Expand Down
2 changes: 1 addition & 1 deletion bork/builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import subprocess
import sys
# Slight kludge so we can have a function named zipapp().
import zipapp as Zipapp
import zipapp as Zipapp # noqa: N812

import pep517.build

Expand Down
12 changes: 4 additions & 8 deletions bork/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from . import download as _download
from . import release as _release
from . import run as _run
from . import DOWNLOAD_SOURCES
from . import DOWNLOAD_SOURCES # noqa: I100


DOWNLOAD_SOURCES_STR = ' '.join(DOWNLOAD_SOURCES)
Expand All @@ -28,23 +28,19 @@ def clean():
_clean()


# pylint: disable=redefined-outer-name
# NOTE: It's okay to redefine `release` in download(), since it doesn't
# use release().

@cli.command()
@click.option('--files', default='*.pyz',
help='Comma-separated list of filenames to download. Supports '
'wildcards (* = everything, ? = any single character).')
@click.option('--directory', default='downloads',
help='Directory to save files in. Created if missing.')
@click.argument('package', nargs=1)
@click.argument('release', nargs=1, default='latest')
def download(files, directory, package, release):
@click.argument('release_tag', nargs=1, default='latest')
def download(files, directory, package, release_tag):
# NOTE: We change the order of the arguments here, to move away from
# what makes sense on a CLI interface to what makes sense in a
# Python interface.
_download(package, release, files, directory)
_download(package, release_tag, files, directory)

# pylint: enable=redefined-outer-name

Expand Down
1 change: 1 addition & 0 deletions bork/pypi.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from twine.cli import dispatch as twine_upload

from .asset_manager import download_assets
from .filesystem import find_files
from .pypi_api import get_download_info
Expand Down
10 changes: 6 additions & 4 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ linting =
flake8==3.7.8
flake8-bugbear==19.8.0
flake8-commas==2.0.0
flake8-docstrings==1.4.0
# pydocstyle is pinned due to https://gitlab.com/pycqa/flake8-docstrings/issues/36
pydocstyle==4.0.1
flake8-docstrings==1.5.0
flake8-import-order
pep8-naming
pylint==2.4.1

testing =
Expand All @@ -50,7 +50,7 @@ console_scripts =
bork = bork.cli:main

[flake8]
select = C,E,F,W,B,B9
select = C,E,F,I,N,W,B,B9
max-line-length = 85
exclude =
.eggs,
Expand All @@ -60,3 +60,5 @@ exclude =
build,
dist,
venv

import-order-style = google