Skip to content

Commit c8b200f

Browse files
committed
add noqa
1 parent 697f2c2 commit c8b200f

21 files changed

Lines changed: 45 additions & 44 deletions

File tree

examples/wheel/wheel_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -523,7 +523,7 @@ def test_minimal_data_files(self):
523523

524524
with zipfile.ZipFile(filename) as zf:
525525
self.assertAllEntriesHasReproducibleMetadata(zf)
526-
metadata_file = None
526+
metadata_file = None # noqa: F841
527527
self.assertEqual(
528528
zf.namelist(),
529529
[

python/bin/repl_stub.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@
1616
# Capture the globals from PYTHONSTARTUP so we can pass them on to the console.
1717
console_locals = globals().copy()
1818

19-
import code
20-
import rlcompleter
21-
import sys
19+
import code # noqa: E402
20+
import rlcompleter # noqa: E402
21+
import sys # noqa: E402
2222

2323

2424
class DynamicCompleter(rlcompleter.Completer):

python/private/py_console_script_gen.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ class EntryPointsParser(configparser.ConfigParser):
7272
optionxform = staticmethod(str)
7373

7474

75-
def _guess_entry_point(guess: str, console_scripts: dict[string, string]) -> str | None:
75+
def _guess_entry_point(guess: str, console_scripts: dict[string, string]) -> str | None: # noqa: F821
7676
for key, candidate in console_scripts.items():
7777
if guess == key:
7878
return candidate
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
# __path__ manipulation added by bazel-contrib/rules_python to support namespace pkgs.
2-
__path__ = __import__("pkgutil").extend_path(__path__, __name__)
2+
__path__ = __import__("pkgutil").extend_path(__path__, __name__) # noqa: F821

python/private/site_init_template.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,6 @@ def _setup_sys_path():
131131
"""Perform Bazel/binary specific sys.path setup."""
132132
_print_verbose("site init: initial sys.path:\n", "\n".join(sys.path))
133133
seen = set(sys.path)
134-
python_path_entries = []
135134

136135
def _maybe_add_path(path, reason):
137136
if path in seen:

python/private/stage2_bootstrap_template.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,11 +131,11 @@ def get_windows_path_with_unc_prefix(path):
131131
return path
132132

133133
# Lets start the unicode fun
134-
if path.startswith(unicode_prefix):
134+
if path.startswith(unicode_prefix): # noqa: F821
135135
return path
136136

137137
# os.path.abspath returns a normalized absolute path
138-
return unicode_prefix + os.path.abspath(path)
138+
return unicode_prefix + os.path.abspath(path) # noqa: F821
139139

140140

141141
def print_verbose(*args, mapping=None, values=None):

python/private/zipapp/zip_main_template.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,13 @@
2323
# TODO(#7091): Remove this hack when no longer necessary.
2424
del sys.path[0]
2525

26-
import os
27-
import shutil
28-
import stat
29-
import subprocess
30-
import tempfile
31-
import zipfile
32-
from os.path import basename, dirname, join, normpath
26+
import os # noqa: E402
27+
import shutil # noqa: E402
28+
import stat # noqa: E402
29+
import subprocess # noqa: E402
30+
import tempfile # noqa: E402
31+
import zipfile # noqa: E402
32+
from os.path import basename, dirname, join, normpath # noqa: E402
3333

3434
# runfiles-root-relative path
3535
_STAGE2_BOOTSTRAP = "%stage2_bootstrap%"

python/runfiles/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
from .runfiles import *
15+
from .runfiles import * # noqa: F403

sphinxdocs/sphinxdocs/private/sphinx_server.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ class DirectoryHandler(server.SimpleHTTPRequestHandler):
1919
def __init__(self, *args, **kwargs):
2020
super().__init__(directory=serve_directory, *args, **kwargs)
2121

22-
address = ("0.0.0.0", 8000)
22+
address = ("0.0.0.0", 8000) # noqa: F841
2323
# with server.ThreadingHTTPServer(address, DirectoryHandler) as (ip, port, httpd):
2424
with _start_server(DirectoryHandler, "0.0.0.0", 8000) as (ip, port, httpd):
2525

sphinxdocs/sphinxdocs/src/sphinx_bzl/bzl.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -462,7 +462,7 @@ def make_field(
462462
field_text = item[1][0].astext()
463463
parts = [p.strip() for p in field_text.split(",")]
464464
field_body = docutils_nodes.field_body()
465-
for _, is_last, part in _position_iter(parts):
465+
for _, is_last, part in _position_iter(parts): # noqa: F402
466466
node = self.make_xref(
467467
self.bodyrolename,
468468
self._body_domain or domain,
@@ -775,7 +775,7 @@ def make_xref(name, title=None):
775775
return obj_id
776776

777777
def _signature_add_object_type(self, sig_node: addnodes.desc_signature):
778-
if sig_object_type := self._get_signature_object_type():
778+
if sig_object_type := self._get_signature_object_type(): # noqa: F841
779779
sig_node += addnodes.desc_annotation("", self._get_signature_object_type())
780780
sig_node += addnodes.desc_sig_space()
781781

0 commit comments

Comments
 (0)