aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/scripts
diff options
context:
space:
mode:
authorDylan Baker <dylan@pnwbakers.com>2022-09-02 14:43:12 -0700
committerXavier Claessens <xclaesse@gmail.com>2022-09-22 18:17:43 -0400
commitf5283dd63fc40211a935330973a69aa8105aa920 (patch)
treec3ea862cb3d08ffcbe8ddaea9d70a42d6ee445de /mesonbuild/scripts
parent3ef332e89a7050d0c03801099a0649e00c187278 (diff)
downloadmeson-f5283dd63fc40211a935330973a69aa8105aa920.zip
meson-f5283dd63fc40211a935330973a69aa8105aa920.tar.gz
meson-f5283dd63fc40211a935330973a69aa8105aa920.tar.bz2
pylint: enable global-statement
This does force a number of uses of `# pylint: disable` comments, but it also finds a couple of useless global uses and one place (in the previous commit) that an easy refactor removes the use of global. Global is a code smell, so forcing adding a comment to disable helps force developers to really consider if what they're doing is a good idea.
Diffstat (limited to 'mesonbuild/scripts')
-rw-r--r--mesonbuild/scripts/depfixer.py2
-rw-r--r--mesonbuild/scripts/meson_exe.py3
-rw-r--r--mesonbuild/scripts/symbolextractor.py2
3 files changed, 2 insertions, 5 deletions
diff --git a/mesonbuild/scripts/depfixer.py b/mesonbuild/scripts/depfixer.py
index e89efbb..e0090ac 100644
--- a/mesonbuild/scripts/depfixer.py
+++ b/mesonbuild/scripts/depfixer.py
@@ -470,7 +470,7 @@ def fix_jar(fname: str) -> None:
subprocess.check_call(['jar', 'ufm', fname, 'META-INF/MANIFEST.MF'])
def fix_rpath(fname: str, rpath_dirs_to_remove: T.Set[bytes], new_rpath: T.Union[str, bytes], final_path: str, install_name_mappings: T.Dict[str, str], verbose: bool = True) -> None:
- global INSTALL_NAME_TOOL
+ global INSTALL_NAME_TOOL # pylint: disable=global-statement
# Static libraries, import libraries, debug information, headers, etc
# never have rpaths
# DLLs and EXE currently do not need runtime path fixing
diff --git a/mesonbuild/scripts/meson_exe.py b/mesonbuild/scripts/meson_exe.py
index c8f2f3b..bb9d940 100644
--- a/mesonbuild/scripts/meson_exe.py
+++ b/mesonbuild/scripts/meson_exe.py
@@ -23,8 +23,6 @@ import locale
from .. import mesonlib
from ..backend.backends import ExecutableSerialisation
-options = None
-
def buildparser() -> argparse.ArgumentParser:
parser = argparse.ArgumentParser(description='Custom executable wrapper for Meson. Do not run on your own, mmm\'kay?')
parser.add_argument('--unpickle')
@@ -102,7 +100,6 @@ def run_exe(exe: ExecutableSerialisation, extra_env: T.Optional[T.Dict[str, str]
return 0
def run(args: T.List[str]) -> int:
- global options
parser = buildparser()
options, cmd_args = parser.parse_known_args(args)
# argparse supports double dash to separate options and positional arguments,
diff --git a/mesonbuild/scripts/symbolextractor.py b/mesonbuild/scripts/symbolextractor.py
index 8992e94..565b467 100644
--- a/mesonbuild/scripts/symbolextractor.py
+++ b/mesonbuild/scripts/symbolextractor.py
@@ -315,7 +315,7 @@ def gen_symbols(libfilename: str, impfilename: str, outfilename: str, cross_host
dummy_syms(outfilename)
def run(args: T.List[str]) -> int:
- global TOOL_WARNING_FILE
+ global TOOL_WARNING_FILE # pylint: disable=global-statement
options = parser.parse_args(args)
if len(options.args) != 4:
print('symbolextractor.py <shared library file> <import library> <output file>')