Skip to content

Commit

Permalink
fix all pre-commit errors
Browse files Browse the repository at this point in the history
  • Loading branch information
hofbi committed Dec 8, 2024
1 parent 8eba8b8 commit ad6d72d
Show file tree
Hide file tree
Showing 11 changed files with 30 additions and 22 deletions.
3 changes: 0 additions & 3 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,6 @@ jobs:
steps:
- uses: actions/checkout@v4
- uses: pre-commit/[email protected]

# For branch protection settings, this job provides a "stable" name that can be used to gate PR merges
# on "all matrix jobs were successful".
conclusion:
Expand All @@ -152,14 +151,12 @@ jobs:
if: always()
steps:
- uses: technote-space/workflow-conclusion-action@45ce8e0eb155657ab8ccf346ade734257fd196a5 # v3.0.3

# Note: possible conclusion values:
# https://github.com/technote-space/workflow-conclusion-action/blob/main/src/constant.ts
- name: report success
if: ${{ env.WORKFLOW_CONCLUSION == 'success' }}
working-directory: /tmp
run: echo ${{ env.WORKFLOW_CONCLUSION }} && exit 0

- name: report failure
if: ${{ env.WORKFLOW_CONCLUSION == 'failure' }}
working-directory: /tmp
Expand Down
2 changes: 1 addition & 1 deletion .shellcheckrc
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ enable=quote-safe-variables
# Turn on warnings for unassigned uppercase variables
enable=check-unassigned-uppercase

#enable=require-variable-braces
#enable=require-variable-braces
1 change: 1 addition & 0 deletions .typos.toml
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
[default.extend-identifiers]
MODULEs = "MODULEs" # Else it becomes MODULEEs
HashiCorp = "HashiCorp"
12 changes: 8 additions & 4 deletions e2e/smoke/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -121,9 +121,6 @@ go_test(
name = "test_preserve_mtime",
size = "small",
srcs = ["test_preserve_mtime.go"],
deps = [
"@io_bazel_rules_go//go/tools/bazel:go_default_library",
],
data = [
"d",
":copy_directory_mtime_case",
Expand All @@ -135,5 +132,12 @@ go_test(
# bazel test :test_preserve_mtime # This test should pass
# touch d/1 # Update the mtime, in the CI environment this is done with the SCM integration.
# bazel test :test_preserve_mtime # This test now fails
tags = ["no-remote", "external", "manual"],
tags = [
"external",
"manual",
"no-remote",
],
deps = [
"@io_bazel_rules_go//go/tools/bazel:go_default_library",
],
)
2 changes: 1 addition & 1 deletion e2e/smoke/MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ local_path_override(
)

bazel_dep(name = "bazel_skylib", version = "1.7.1", dev_dependency = True)
bazel_dep(name = "rules_go", version = "0.50.1", repo_name = "io_bazel_rules_go", dev_dependency = True)
bazel_dep(name = "rules_go", version = "0.50.1", dev_dependency = True, repo_name = "io_bazel_rules_go")
14 changes: 7 additions & 7 deletions e2e/smoke/test_preserve_mtime.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,36 +26,36 @@ func mtime(path string) (time.Time, error) {

func (r runfilePath) osPath() (string, error) {
dirPath, err := bazel.Runfile(r.runfileDir)
if err != nil{
if err != nil {
return "", err
}
parts := append([]string{dirPath}, r.subPaths...)
return filepath.Join(parts...), nil
}

func TestPreserveMTime(t *testing.T) {
cases := map[string]struct{
cases := map[string]struct {
original runfilePath
copied runfilePath
copied runfilePath
}{
"copy_directory": {
original: runfilePath{
runfileDir: "d",
subPaths: []string{"1"},
subPaths: []string{"1"},
},
copied: runfilePath{
runfileDir: "copy_directory_mtime_out",
subPaths: []string{"1"},
subPaths: []string{"1"},
},
},
"copy_to_directory": {
original: runfilePath{
runfileDir: "d",
subPaths: []string{"1"},
subPaths: []string{"1"},
},
copied: runfilePath{
runfileDir: "copy_to_directory_mtime_out",
subPaths: []string{"d", "1"},
subPaths: []string{"d", "1"},
},
},
}
Expand Down
2 changes: 1 addition & 1 deletion lib/private/tar.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ def _is_unused_inputs_enabled(attr):
return False
if attr.compute_unused_inputs == -1:
return attr._compute_unused_inputs_flag[BuildSettingInfo].value

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

def _is_unprunable(file):
Expand Down
2 changes: 1 addition & 1 deletion lib/tests/expand_template/index.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!DOCTYPE html>
<!doctype html>
<html>
<head>
<script src="index.ts"></script>
Expand Down
10 changes: 8 additions & 2 deletions lib/tests/transitions/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -137,15 +137,21 @@ platform_transition_test(
name = "transitioned_go_test_x86_64",
binary = ":test_transition_test",
# only run this test on an x86_64 host
target_compatible_with = [] if sorted(HOST_CONSTRAINTS) == ["@platforms//cpu:x86_64", "@platforms//os:linux"] else ["@platforms//:incompatible"],
target_compatible_with = [] if sorted(HOST_CONSTRAINTS) == [
"@platforms//cpu:x86_64",
"@platforms//os:linux",
] else ["@platforms//:incompatible"],
target_platform = "x86_64_linux",
)

platform_transition_test(
name = "transitioned_go_test_arm64",
binary = ":test_transition_test",
# only run this test on an x86_64 host
target_compatible_with = [] if sorted(HOST_CONSTRAINTS) == ["@platforms//cpu:aarch64", "@platforms//os:linux"] else ["@platforms//:incompatible"],
target_compatible_with = [] if sorted(HOST_CONSTRAINTS) == [
"@platforms//cpu:aarch64",
"@platforms//os:linux",
] else ["@platforms//:incompatible"],
target_platform = "arm64_linux",
)

Expand Down
2 changes: 1 addition & 1 deletion tools/lint/vale/config/vocabularies/engineering/accept.txt
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ rebase
mutex
hotfix
oncall
poisioning
poisoning
statefulness
teardown
toolchain
Expand Down
2 changes: 1 addition & 1 deletion tools/lint/vale/config/vocabularies/engineering/reject.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
bar
bar

0 comments on commit ad6d72d

Please sign in to comment.