Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: Fix no-else-after-return #988

Merged
merged 1 commit into from
Dec 4, 2024
Merged
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
14 changes: 6 additions & 8 deletions lib/private/tar.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -170,12 +170,12 @@ def _is_unused_inputs_enabled(attr):
"""
if attr.compute_unused_inputs == 1:
return True
elif attr.compute_unused_inputs == 0:
if attr.compute_unused_inputs == 0:
return False
elif attr.compute_unused_inputs == -1:
if attr.compute_unused_inputs == -1:
return attr._compute_unused_inputs_flag[BuildSettingInfo].value
else:
fail("Unexpected `compute_unused_inputs` value: {}".format(attr.compute_unused_inputs))

fail("Unexpected `compute_unused_inputs` value: {}".format(attr.compute_unused_inputs))

def _is_unprunable(file):
# Some input files cannot be pruned because their name will be misinterpreted by Bazel when reading the unused_inputs_list.
Expand Down Expand Up @@ -345,8 +345,7 @@ def _tar_impl(ctx):
_unused_inputs_file = depset([unused_inputs_file]),
),
]
else:
return default_info
return default_info

def _mtree_line(file, type, content = None, uid = "0", gid = "0", time = "1672560000", mode = "0755"):
spec = [
Expand All @@ -368,8 +367,7 @@ def _mtree_line(file, type, content = None, uid = "0", gid = "0", time = "167256
def _to_rlocation_path(file, workspace):
if file.short_path.startswith("../"):
return file.short_path[3:]
else:
return workspace + "/" + file.short_path
return workspace + "/" + file.short_path

def _vis_encode(filename):
# TODO(#794): correctly encode all filenames by using vis(3) (or porting it)
Expand Down
Loading