-
Notifications
You must be signed in to change notification settings - Fork 147
Clean-up + add hygiene checks #463
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
base: main
Are you sure you want to change the base?
Changes from all commits
7f2606a
cbd4dff
813c390
222e0ad
a9c935b
3e733dc
d881610
67278e0
2336ec2
91f87c2
a9d47e8
cd3f193
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,59 @@ | ||
| # SPDX-FileCopyrightText: Copyright 2026 Arm Limited and affiliates. | ||
| # | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| name: Hygiene | ||
|
|
||
| on: | ||
| push: | ||
| branches: [main] | ||
| pull_request: | ||
| types: [opened, synchronize, reopened] | ||
| workflow_dispatch: | ||
|
|
||
| #* Stop stale workflows when pull requests are updated: https://stackoverflow.com/a/70972844 | ||
| #* Does not apply to the main branch. | ||
| concurrency: | ||
| group: ${{ github.workflow }}-${{ github.ref }} | ||
| cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} | ||
|
|
||
| # Declare default permissions as read only. | ||
| permissions: read-all | ||
|
|
||
| jobs: | ||
| hygiene: | ||
| runs-on: ah-ubuntu_24_04-c7g_2x-50 | ||
| steps: | ||
| - name: Checkout Tool-Solutions | ||
| uses: actions/checkout@v6.0.2 | ||
|
|
||
| - name: Set up Python | ||
| uses: actions/setup-python@v6.0.0 | ||
| with: | ||
| python-version: "3.12" | ||
|
|
||
| - name: Install hygiene tooling | ||
| run: | | ||
| python -m pip install --user --no-cache-dir pre-commit==4.5.1 reuse==6.2.0 | ||
| echo "$HOME/.local/bin" >> "$GITHUB_PATH" | ||
|
|
||
| - name: Run whole-repo whitespace check | ||
| run: pre-commit run trailing-whitespace --all-files | ||
|
|
||
| - name: Run safe whole-repo pre-commit checks | ||
| run: | | ||
| set -euo pipefail | ||
| pre-commit run end-of-file-fixer --all-files | ||
| pre-commit run mixed-line-ending --all-files | ||
| pre-commit run check-merge-conflict --all-files | ||
| pre-commit run check-case-conflict --all-files | ||
| pre-commit run check-symlinks --all-files | ||
| pre-commit run check-json --all-files | ||
| pre-commit run check-yaml --all-files | ||
| pre-commit run check-added-large-files --all-files | ||
| pre-commit run check-executables-have-shebangs --all-files | ||
| pre-commit run check-shebang-scripts-are-executable --all-files | ||
| pre-commit run ruff-check --all-files | ||
|
|
||
| - name: Run whole-repo REUSE lint | ||
| run: reuse lint | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -43,7 +43,8 @@ WORKDIR /home/$DOCKER_USER | |
| ENV PATH="/home/$DOCKER_USER/.local/bin:${PATH}" | ||
|
|
||
| # Install uv for quicker package installations (installed to ~/.local/bin with --user) | ||
| RUN python -m pip install --user uv==0.9.29 | ||
| ENV UV_NO_CACHE=1 | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I understand not wanting to cache in the docker build phase to avoid releasing extra blobs, but I think it may be inconvenient for the user to find that uv doesn't cache (given that it is such a useful feature of uv!). Can we instead set this on each run command (or unset at the end of the build)?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hmm, I'm setting the environment variable during the |
||
| RUN python -m pip install --no-cache-dir --user uv==0.9.29 | ||
|
|
||
| # Create virtual environment with uv | ||
| RUN uv venv /home/$DOCKER_USER/.venv | ||
|
|
||
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,7 @@ | ||
| # SPDX-FileCopyrightText: Copyright 2025 Arm Limited and affiliates. | ||
| # SPDX-FileCopyrightText: Copyright 2025, 2026 Arm Limited and affiliates. | ||
| # | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| tensorflow/ | ||
| results/ | ||
| *.whl | ||
| *.whl |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -13,7 +13,6 @@ | |
| import zipfile | ||
|
|
||
| import numpy as np | ||
| import yaml | ||
| from tqdm import tqdm | ||
|
|
||
| import tensorflow as tf | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why can't we just run the whole set in one
pre-commitcommand?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because of the
reuse annotatehooks; they should only apply to changed files. Otherwise copyright headers of files that haven't actually been touched will be updated. By itself this shouldn't be a problem since we're not committing files in the CI but it will still cause the hygiene CI to fail (erroneously)