Skip to content

Commit

Permalink
Fix-up PyLint and Ruff warnings
Browse files Browse the repository at this point in the history
For a long time we have all python files installed in standard
locations, no need to apply sys.path hacks, and irritate linters with a
wrong import order.

Bumping the max lines/file limit, as (I personally think) these limits
only irritate contributing people (who often do not have time or the
mandate for major refactoring).
  • Loading branch information
praiskup committed Sep 12, 2024
1 parent 16ab638 commit 351737f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 14 deletions.
22 changes: 9 additions & 13 deletions mock/py/mock.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,23 +61,13 @@

# pylint: disable=import-error
from functools import partial

# our imports
from mockbuild import config
from mockbuild import util
from mockbuild.constants import MOCKCONFDIR, PYTHONDIR, VERSION
from mockbuild.constants import MOCKCONFDIR, VERSION
from mockbuild.file_downloader import FileDownloader
from mockbuild.mounts import BindMountPoint, FileSystemMountPoint

# import all mockbuild.* modules after this.
sys.path.insert(0, PYTHONDIR)

# set up basic logging until config file can be read
FORMAT = "%(levelname)s: %(message)s"
logging.basicConfig(format=FORMAT, level=logging.WARNING)
log = logging.getLogger()

# our imports
# pylint: disable=wrong-import-position

import mockbuild.backend
from mockbuild.backend import Commands
from mockbuild.buildroot import Buildroot
Expand All @@ -89,6 +79,12 @@
import mockbuild.uid
from mockbuild.scrub_all import scrub_all_chroots

# set up basic logging until config file can be read
FORMAT = "%(levelname)s: %(message)s"
logging.basicConfig(format=FORMAT, level=logging.WARNING)
log = logging.getLogger()


signal_names = {1: "SIGHUP",
13: "SIGPIPE",
15: "SIGTERM"
Expand Down
2 changes: 1 addition & 1 deletion mock/pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ max-public-methods=20
max-line-length=120

# Maximum number of lines in a module
max-module-lines=1000
max-module-lines=2000

# String used as indentation unit. This is usually " " (4 spaces) or "\t" (1
# tab).
Expand Down

0 comments on commit 351737f

Please sign in to comment.