Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions emrun.py
Original file line number Diff line number Diff line change
Expand Up @@ -577,7 +577,7 @@ def shutdown(self):

# Processes HTTP request back to the browser.
class HTTPHandler(SimpleHTTPRequestHandler):
protocol_version = 'HTTP/1.1'
protocol_version = 'HTTP/1.1' # noqa: DC01

def send_head(self):
global page_last_served_time
Expand Down Expand Up @@ -663,13 +663,13 @@ def log_request(self, code):
if code != 200:
SimpleHTTPRequestHandler.log_request(self, code)

def log_message(self, format, *args):
def log_message(self, format, *args): # noqa: DC04
msg = '%s - - [%s] %s\n' % (self.address_string(), self.log_date_time_string(), format % args)
# Filter out 404 messages on favicon.ico not being found to remove noise.
if 'favicon.ico' not in msg:
sys.stderr.write(msg)

def do_POST(self):
def do_POST(self): # # noqa: DC04
global page_exit_code, have_received_messages

(_, _, path, query, _) = urlsplit(self.path)
Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ lint.select = [
"W",
"YTT",
]

lint.external = [ "D" ]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is this?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the prefix used for noqa decorators. They are mnemonics I guess so any error code starting in D relates to dead code.

lint.ignore = [
"B011", # See https://github.com/PyCQA/flake8-bugbear/issues/66
"B023",
Expand Down Expand Up @@ -110,4 +110,4 @@ module = ["psutil", "win32con", "win32gui", "win32process"]
ignore_missing_imports = true

[tool.deadcode]
exclude = ["out", "third_party", "test/third_party", "node_modules", "site/source/_themes", "site/source/conf.py"]
exclude = ["out", "cache", "third_party", "test/third_party", "node_modules", "site/source/_themes", "site/source/conf.py"]
2 changes: 1 addition & 1 deletion test/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -2274,7 +2274,7 @@ def end_headers(self):
self.send_header('Cache-Control', 'no-cache, no-store, must-revalidate')
return SimpleHTTPRequestHandler.end_headers(self)

def do_POST(self):
def do_POST(self): # noqa: DC04
urlinfo = urlparse(self.path)
query = parse_qs(urlinfo.query)
content_length = int(self.headers['Content-Length'])
Expand Down
2 changes: 1 addition & 1 deletion tools/ports/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -640,7 +640,7 @@ def get_libs(settings):
return ret


def add_cflags(args, settings): # noqa: U100
def add_cflags(args, settings):
"""Called during compile phase add any compiler flags (e.g -Ifoo) needed
by the selected ports. Can also add/change settings.

Expand Down
4 changes: 2 additions & 2 deletions tools/tempfiles.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,12 @@ def get_file(self, suffix):
The file will be deleted immediately once the 'with' block is exited.
"""
class TempFileObject:
def __enter__(self_):
def __enter__(self_): # noqa: DC02
self_.file = tempfile.NamedTemporaryFile(dir=self.tmpdir, suffix=suffix, delete=False)
self_.file.close() # NamedTemporaryFile passes out open file handles, but callers prefer filenames (and open their own handles manually if needed)
return self_.file.name

def __exit__(self_, _type, _value, _traceback):
def __exit__(self_, _type, _value, _traceback): # noqa: DC02
if not self.save_debug_files:
utils.delete_file(self_.file.name)
return TempFileObject()
Expand Down