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
2 changes: 1 addition & 1 deletion .circleci/config.pkl
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ jobs {
}
new RunStep {
name = "Check licenses"
command = "bazel run --config=circleci //scripts:hawkeye -- check --fail-if-unknown"
command = "bazel run --config=circleci //tools/lint/hawkeye -- check --fail-if-unknown"
}
new RunStep {
name = "Gazelle"
Expand Down
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
command: bazel run --config=circleci buildifier
name: Buildifier lint
- run:
command: bazel run --config=circleci //scripts:hawkeye -- check --fail-if-unknown
command: bazel run --config=circleci //tools/lint/hawkeye -- check --fail-if-unknown
name: Check licenses
- run:
command: bazel run --config=circleci //:gazelle && git diff --exit-code
Expand Down
1 change: 1 addition & 0 deletions BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ filegroup(
buildifier_excludes = [
"./.git/*",
"./.ijwb/*",
"./.bazelbsp/*",
]

buildifier(
Expand Down
37 changes: 7 additions & 30 deletions MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -114,33 +114,10 @@ use_repo(
"build_bazel_bazel_8_2_1",
)

http_archive = use_repo_rule("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")

hawkeye_coordinates = [
{
"name": "hawkeye-aarch64-apple-darwin",
"url": "https://github.com/korandoru/hawkeye/releases/download/v6.0.2/hawkeye-aarch64-apple-darwin.tar.xz",
"sha256": "9f300ad84201e500c4eb09ed710239797d2a6a17de5b7c08e1d3af1704ca6bb7",
},
{
"name": "hawkeye-x86_64-apple-darwin",
"url": "https://github.com/korandoru/hawkeye/releases/download/v6.0.2/hawkeye-x86_64-apple-darwin.tar.xz",
"sha256": "6f8850adb9204b6218f4912fb987106a71fcd8d742ce20227697ddccc44cec38",
},
{
"name": "hawkeye-x86_64-unknown-linux-gnu",
"url": "https://github.com/korandoru/hawkeye/releases/download/v6.0.2/hawkeye-x86_64-unknown-linux-gnu.tar.xz",
"sha256": "d5b9d3cdb4293ac84fa27e5021c77b6c062c61071760ab05fcacfbec1ac14850",
},
]

[
http_archive(
name = coords["name"],
build_file = "//scripts:hawkeye.BUILD",
sha256 = coords["sha256"],
strip_prefix = coords["name"],
url = coords["url"],
)
for coords in hawkeye_coordinates
]
hawkeye = use_extension("//tools/lint/hawkeye:extensions.bzl", "hawkeye", dev_dependency = True)
use_repo(
hawkeye,
"hawkeye-aarch64-apple-darwin",
"hawkeye-x86_64-apple-darwin",
"hawkeye-x86_64-unknown-linux-gnu",
)
2 changes: 1 addition & 1 deletion licenserc.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
headerPath = "scripts/license-header.txt"
headerPath = "tools/lint/hawkeye/license-header.txt"

includes = [
"*.BUILD",
Expand Down
4 changes: 2 additions & 2 deletions scripts/BUILD.bazel → tools/lint/hawkeye/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@
You can check license files with:

```
bazel run //scripts:hawkeye -- check --fail-if-unknown
bazel run //tools/lint/hawkeye -- check --fail-if-unknown
```

You can update header comments with:

```
bazel run //scripts:hawkeye -- format --fail-if-unknown
bazel run //tools/lint/hawkeye -- format --fail-if-unknown
```
"""

Expand Down
47 changes: 47 additions & 0 deletions tools/lint/hawkeye/extensions.bzl
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# Copyright © 2025 Apple Inc. and the Pkl project authors. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

"""Hawkeye bzlmod extensions"""

load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")

HAWKEYE_COORDINATES = [
{
"name": "hawkeye-aarch64-apple-darwin",
"url": "https://github.com/korandoru/hawkeye/releases/download/v6.0.2/hawkeye-aarch64-apple-darwin.tar.xz",
"sha256": "9f300ad84201e500c4eb09ed710239797d2a6a17de5b7c08e1d3af1704ca6bb7",
},
{
"name": "hawkeye-x86_64-apple-darwin",
"url": "https://github.com/korandoru/hawkeye/releases/download/v6.0.2/hawkeye-x86_64-apple-darwin.tar.xz",
"sha256": "6f8850adb9204b6218f4912fb987106a71fcd8d742ce20227697ddccc44cec38",
},
{
"name": "hawkeye-x86_64-unknown-linux-gnu",
"url": "https://github.com/korandoru/hawkeye/releases/download/v6.0.2/hawkeye-x86_64-unknown-linux-gnu.tar.xz",
"sha256": "d5b9d3cdb4293ac84fa27e5021c77b6c062c61071760ab05fcacfbec1ac14850",
},
]

def _hawkeye_impl(_ctx):
for coords in HAWKEYE_COORDINATES:
http_archive(
name = coords["name"],
build_file = "//tools/lint/hawkeye:hawkeye.BUILD",
sha256 = coords["sha256"],
strip_prefix = coords["name"],
url = coords["url"],
)

hawkeye = module_extension(implementation = _hawkeye_impl)
File renamed without changes.
File renamed without changes.