Skip to content
Open
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
4 changes: 3 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,9 @@ repos:
name: license header check (hawkeye)
entry: hawkeye check --config licenserc.toml
language: system
types_or: [rust, python, shell]
# One tag per extension family in licenserc.toml's `includes`; a type
# missing here means an edit touching only that type never runs the hook.
types_or: [rust, python, shell, powershell, markdown]
pass_filenames: false
groups: [local-tools] # runs in the dedicated `license-headers` CI job (hawkeye action)

Expand Down
14 changes: 14 additions & 0 deletions install.ps1
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
# Copyright © Advanced Micro Devices, Inc., or its affiliates.
#
# SPDX-License-Identifier: MIT

# This file must stay BOM-less, so the "add a BOM" rule is suppressed for it.
# The documented install path is `irm <url> | iex`, which hands the parser a
# string rather than a file: a byte order mark survives into that string, the
# parser glues it onto the first token, and the param() block below silently
# stops being the script's first statement. All nine parameters then vanish,
# with zero parse errors to show for it. The cost of staying BOM-less is that
# Windows PowerShell 5.1 decodes this file as the ANSI codepage and renders the
# © above as mojibake -- a cosmetic blemish in a comment, which is the cheaper
# of the two failures. Do not "fix" this by adding a BOM.
[Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')]
param(
[Parameter(Position = 0)]
[string] $Channel = $env:ROCM_CLI_CHANNEL,
Expand Down
8 changes: 8 additions & 0 deletions licenserc.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ includes = [
"**/*.py",
"**/*.sh",
"**/*.md",
"**/*.ps1",
]

excludes = [
Expand All @@ -27,3 +28,10 @@ excludes = [
[[rules]]
extensions = ["md"]
style_out = "xml"

## hawkeye has no built-in comment syntax for .ps1: without this rule the file is
## reported `unsupported` and silently skipped (exit 0), so `includes` alone would
## not enforce anything.
[[rules]]
extensions = ["ps1"]
style_out = "script"
Loading