Skip to content

Commit

Permalink
Bug 1811850 - [lint] Fix ruff errors resulting from new configuration…
Browse files Browse the repository at this point in the history
…, r=webdriver-reviewers,perftest-reviewers,whimboo,sparky,firefox-build-system-reviewers,ahochheiden

# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D172359
  • Loading branch information
ahal committed Mar 17, 2023
1 parent e1fc7a1 commit b54314c
Show file tree
Hide file tree
Showing 112 changed files with 161 additions and 81 deletions.
1 change: 1 addition & 0 deletions js/src/gdb/mozilla/ExecutableAllocator.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"""

import gdb

import mozilla.prettyprinters
from mozilla.prettyprinters import pretty_printer, ptr_pretty_printer

Expand Down
1 change: 1 addition & 0 deletions js/src/gdb/mozilla/GCCellPtr.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
# Pretty-printers for GCCellPtr values.

import gdb

import mozilla.prettyprinters
from mozilla.prettyprinters import pretty_printer

Expand Down
1 change: 1 addition & 0 deletions js/src/gdb/mozilla/Interpreter.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
# Pretty-printers for InterpreterRegs.

import gdb

import mozilla.prettyprinters as prettyprinters

prettyprinters.clear_module_printers(__name__)
Expand Down
1 change: 1 addition & 0 deletions js/src/gdb/mozilla/IonGraph.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import time

import gdb

import mozilla.prettyprinters
from mozilla.prettyprinters import pretty_printer

Expand Down
1 change: 1 addition & 0 deletions js/src/gdb/mozilla/JSObject.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import re

import gdb

import mozilla.prettyprinters as prettyprinters
from mozilla.CellHeader import get_header_ptr
from mozilla.jsval import JSValue
Expand Down
1 change: 1 addition & 0 deletions js/src/gdb/mozilla/JSString.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
# Pretty-printers for SpiderMonkey strings.

import gdb

import mozilla.prettyprinters
from mozilla.CellHeader import get_header_length_and_flags
from mozilla.prettyprinters import ptr_pretty_printer
Expand Down
1 change: 1 addition & 0 deletions js/src/gdb/mozilla/autoload.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
print("If they cause trouble, type: disable pretty-printer .* SpiderMonkey")

import gdb.printing

import mozilla.ExecutableAllocator

# Import the pretty-printer modules. As a side effect, loading these
Expand Down
1 change: 1 addition & 0 deletions js/src/gdb/mozilla/jsop.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

import gdb
import gdb.types

import mozilla.prettyprinters
from mozilla.prettyprinters import pretty_printer, ptr_pretty_printer

Expand Down
1 change: 1 addition & 0 deletions js/src/gdb/mozilla/jsval.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

import gdb
import gdb.types

import mozilla.prettyprinters
from mozilla.prettyprinters import pretty_printer

Expand Down
1 change: 1 addition & 0 deletions js/src/gdb/mozilla/unwind.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import gdb
import gdb.types
from gdb.FrameDecorator import FrameDecorator

from mozilla.JSObject import get_function_name, get_function_script
from mozilla.prettyprinters import TypeCache

Expand Down
1 change: 1 addition & 0 deletions python/gdbpp/gdbpp/enumset.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
# file, You can obtain one at http://mozilla.org/MPL/2.0/.

import gdb

from gdbpp import GeckoPrettyPrinter


Expand Down
1 change: 1 addition & 0 deletions python/gdbpp/gdbpp/owningthread.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
# file, You can obtain one at http://mozilla.org/MPL/2.0/.

import gdb

from gdbpp import GeckoPrettyPrinter


Expand Down
1 change: 1 addition & 0 deletions python/gdbpp/gdbpp/thashtable.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
# file, You can obtain one at http://mozilla.org/MPL/2.0/.

import gdb

from gdbpp import GeckoPrettyPrinter


Expand Down
2 changes: 1 addition & 1 deletion python/mach/mach/test/test_site.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import os
from unittest import mock

import pytest as pytest
import pytest
from buildconfig import topsrcdir
from mozunit import main

Expand Down
1 change: 1 addition & 0 deletions python/mozbuild/.ruff.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ src = [
# Treat direct imports in the test modules as first party.
"mozpack/test",
"mozbuild/test",
]

[isort]
known-first-party = ["mozbuild"]
1 change: 1 addition & 0 deletions python/mozbuild/mozbuild/compilation/codecomplete.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
from mozbuild.shellutil import quote as shell_quote
from mozbuild.shellutil import split as shell_split


# Instropection commands.


Expand Down
2 changes: 1 addition & 1 deletion python/mozbuild/mozbuild/configure/options.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ def __new__(cls, origin="unknown"):
return super(NegativeOptionValue, cls).__new__(cls, origin=origin)

def __init__(self, origin="unknown"):
return super(NegativeOptionValue, self).__init__(origin=origin)
super(NegativeOptionValue, self).__init__(origin=origin)


class InvalidOptionError(Exception):
Expand Down
7 changes: 5 additions & 2 deletions python/mozbuild/mozbuild/mach_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,12 @@
from voluptuous import All, Boolean, Required, Schema

import mozbuild.settings # noqa need @SettingsProvider hook to execute
from mozbuild.base import BinaryNotFoundException, BuildEnvironmentNotFoundException
from mozbuild.base import (
BinaryNotFoundException,
BuildEnvironmentNotFoundException,
MozbuildObject,
)
from mozbuild.base import MachCommandConditions as conditions
from mozbuild.base import MozbuildObject
from mozbuild.util import MOZBUILD_METRICS_PATH

here = os.path.abspath(os.path.dirname(__file__))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@
import unittest

from buildconfig import topsrcdir
from common import ConfigureTestSandbox, ensure_exe_extension, fake_short_path
from mozpack import path as mozpath
from mozunit import MockedOpen, main
from six import StringIO

from common import ConfigureTestSandbox, ensure_exe_extension, fake_short_path
from mozbuild.configure import ConfigureError, ConfigureSandbox
from mozbuild.shellutil import quote as shell_quote
from mozbuild.util import exec_
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@

import mozpack.path as mozpath
from buildconfig import topsrcdir
from common import ConfigureTestSandbox
from mozunit import main
from six import StringIO
from test_toolchain_helpers import FakeCompiler

from common import ConfigureTestSandbox
from mozbuild.util import exec_


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.

from common import BaseConfigureTest, ConfigureTestSandbox
from mozunit import main

from common import BaseConfigureTest, ConfigureTestSandbox
from mozbuild.util import ReadOnlyNamespace, exec_, memoized_property


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@
import os

import six
from common import BaseConfigureTest
from mozboot.util import MINIMUM_RUST_VERSION
from mozpack import path as mozpath
from mozunit import main
from six import StringIO
from test_toolchain_helpers import CompilerResult, FakeCompiler, PrependFlags

from common import BaseConfigureTest
from mozbuild.configure.util import Version
from mozbuild.util import ReadOnlyNamespace, memoize

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
import os

from buildconfig import topsrcdir
from common import BaseConfigureTest
from mozpack import path as mozpath
from mozunit import MockedOpen, main

from common import BaseConfigureTest
from mozbuild.configure.options import InvalidOptionError


Expand Down
2 changes: 1 addition & 1 deletion python/mozbuild/mozbuild/test/configure/test_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@

import six
from buildconfig import topsrcdir
from common import ConfigureTestSandbox
from mozpack import path as mozpath
from mozunit import main
from six import StringIO

from common import ConfigureTestSandbox
from mozbuild.configure import ConfigureSandbox
from mozbuild.configure.util import (
ConfigureOutputHandler,
Expand Down
2 changes: 1 addition & 1 deletion python/mozbuild/mozbuild/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,7 @@ def __init__(self, iterable=None, **kwargs):
raise ValueError("List can only be created from other list instances.")

self._kwargs = kwargs
return super(List, self).__init__(iterable)
super(List, self).__init__(iterable)

def extend(self, l):
if not isinstance(l, list):
Expand Down
3 changes: 2 additions & 1 deletion python/mozbuild/mozpack/chrome/flags.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@
from collections import OrderedDict

import six
from mozpack.errors import errors
from packaging.version import Version

from mozpack.errors import errors


class Flag(object):
"""
Expand Down
5 changes: 3 additions & 2 deletions python/mozbuild/mozpack/chrome/manifest.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,12 @@
import os
import re

import mozpack.path as mozpath
import six
from six.moves.urllib.parse import urlparse

import mozpack.path as mozpath
from mozpack.chrome.flags import Flags
from mozpack.errors import errors
from six.moves.urllib.parse import urlparse


class ManifestEntry(object):
Expand Down
3 changes: 2 additions & 1 deletion python/mozbuild/mozpack/copier.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@
import sys
from collections import Counter, OrderedDict, defaultdict

import mozpack.path as mozpath
import six

import mozpack.path as mozpath
from mozpack.errors import errors
from mozpack.files import BaseFile, Dest

Expand Down
10 changes: 5 additions & 5 deletions python/mozbuild/mozpack/files.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,17 @@
from tarfile import TarFile, TarInfo
from tempfile import NamedTemporaryFile, mkstemp

import mozpack.path as mozpath
import six
from jsmin import JavascriptMinify
from mozpack.chrome.manifest import ManifestEntry, ManifestInterfaces
from mozpack.errors import ErrorMessage, errors
from mozpack.executables import elfhack, is_executable, may_elfhack, may_strip, strip
from mozpack.mozjar import JarReader

import mozbuild.makeutil as makeutil
import mozpack.path as mozpath
from mozbuild.preprocessor import Preprocessor
from mozbuild.util import FileAvoidWrite, ensure_unicode, memoize
from mozpack.chrome.manifest import ManifestEntry, ManifestInterfaces
from mozpack.errors import ErrorMessage, errors
from mozpack.executables import elfhack, is_executable, may_elfhack, may_strip, strip
from mozpack.mozjar import JarReader

try:
import hglib
Expand Down
3 changes: 2 additions & 1 deletion python/mozbuild/mozpack/manifests.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@
import json
from contextlib import contextmanager

import mozpack.path as mozpath
import six

import mozpack.path as mozpath

from .files import (
AbsoluteSymlinkFile,
ExistingFile,
Expand Down
2 changes: 1 addition & 1 deletion python/mozbuild/mozpack/mozjar.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
from io import BytesIO, UnsupportedOperation
from zipfile import ZIP_DEFLATED, ZIP_STORED

import mozpack.path as mozpath
import six

import mozpack.path as mozpath
from mozbuild.util import ensure_bytes

JAR_STORED = ZIP_STORED
Expand Down
6 changes: 3 additions & 3 deletions python/mozbuild/mozpack/packager/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,10 @@
import re
from collections import deque

import mozpack.path as mozpath
import six

import mozpack.path as mozpath
from mozbuild.preprocessor import Preprocessor
from mozpack.chrome.manifest import (
Manifest,
ManifestBinaryComponent,
Expand All @@ -20,8 +22,6 @@
)
from mozpack.errors import errors

from mozbuild.preprocessor import Preprocessor


class Component(object):
"""
Expand Down
3 changes: 2 additions & 1 deletion python/mozbuild/mozpack/packager/formats.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.

from six.moves.urllib.parse import urlparse

import mozpack.path as mozpath
from mozpack.chrome.manifest import (
Manifest,
Expand All @@ -14,7 +16,6 @@
from mozpack.copier import FileRegistry, FileRegistrySubtree, Jarrer
from mozpack.errors import errors
from mozpack.files import ManifestFile
from six.moves.urllib.parse import urlparse

"""
Formatters are classes receiving packaging instructions and creating the
Expand Down
3 changes: 2 additions & 1 deletion python/mozbuild/mozpack/packager/l10n.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,10 @@
import json
import os

import mozpack.path as mozpath
import six
from createprecomplete import generate_precomplete

import mozpack.path as mozpath
from mozpack.chrome.manifest import (
Manifest,
ManifestChrome,
Expand Down
3 changes: 2 additions & 1 deletion python/mozbuild/mozpack/packager/unpack.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

import codecs

from six.moves.urllib.parse import urlparse

import mozpack.path as mozpath
from mozpack.chrome.manifest import (
ManifestEntryWithRelPath,
Expand All @@ -16,7 +18,6 @@
from mozpack.mozjar import JarReader
from mozpack.packager import SimplePackager
from mozpack.packager.formats import FlatFormatter
from six.moves.urllib.parse import urlparse


class UnpackFinder(BaseFinder):
Expand Down
Loading

0 comments on commit b54314c

Please sign in to comment.