Verified Commit 8af87f91 authored by Andrej Shadura's avatar Andrej Shadura
Browse files

Add flake8/isort configuration and fix warnings



Signed-off-by: Andrej Shadura's avatarAndrej Shadura <andrew.shadura@collabora.co.uk>
parent 14ee2c0b
......@@ -2,7 +2,8 @@
import osc.cmdln as cmdln
import osc_plugin_dput
import osc_plugin_dput # noqa: F401
@cmdln.option('--maintained-in-git', action='store_true',
help='add MAINTAINED_IN_GIT.txt')
......@@ -32,6 +33,6 @@ def do_dput(self, subcmd, opts, *args):
# in older versions of osc, this ends up in the class namespace (!)
if hasattr(self, "osc_plugin_dput"):
osc_plugin_dput = self.osc_plugin_dput
osc_plugin_dput = self.osc_plugin_dput # noqa: F811
osc_plugin_dput.do_dput(self, subcmd, opts, *args)
from .main import do_dput
from .main import do_dput # noqa: F401
......@@ -3,14 +3,15 @@
from __future__ import print_function
import os
from pathlib import Path
from tempfile import TemporaryDirectory
from urllib.request import HTTPError
import osc.conf as conf
import osc.core
from osc.oscerr import WrongArgs, OscIOError
from osc.oscerr import OscIOError, WrongArgs
from debian.deb822 import Changes, Dsc
from tempfile import TemporaryDirectory
from pathlib import Path
from urllib.request import HTTPError
def get_objects_from_file(filename):
......
......@@ -21,3 +21,39 @@ packages = find:
install_requires =
osc >= 0.167.1
python-debian
[flake8]
doctests = yes
exclude = .git,build,__pycache__
ignore = E121,E123,E126,E133,E226,E241,E242,E704,E501,E301,E261,E127,E128,W391,W503,W504
# https://pep8.readthedocs.org/en/latest/intro.html#error-codes
# These are ignored by default:
# - E121: continuation line under-indented for hanging indent
# - E123: closing bracket does not match indentation of opening bracket's line
# - E126: continuation line over-indented for hanging indent
# - E133: closing bracket does not match visual indentation
# - E226: missing whitespace around arithmetic operator
# - E241: multiple spaces after ','
# - E242: tab after ','
# - E704: multiple statements on one line (def)
# These were added because PEP-8 allows exceptions, but pep8 doesn't:
# - E501: line too long
# - E301: expected 1 blank line, found 0
# - E261: at least two spaces before inline comment
# - E127: continuation line over-indented for visual indent
# - E128: continuation line under-indented for visual indent
# - W391: blank line at end of file
# These were added because PEP-8 is wrong sometimes
# - W503: line break before binary operator
# - W504: line break after binary operator
[isort]
# from X import (
# a,
# b,
# )
multi_line_output = 3
include_trailing_comma = true
lines_after_imports = 2
reverse_relative = true
default_section = THIRDPARTY
#!/usr/bin/env python
import os
from setuptools import setup
setup(
data_files = [
data_files=[
(os.path.join('lib', 'osc-plugins'), ['dput.py']),
]
)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment