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
17 changes: 2 additions & 15 deletions .github/workflows/pytorch.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,6 @@
# *******************************************************************************
# Copyright 2025 Arm Limited and affiliates.
# SPDX-License-Identifier: Apache-2.0
#
# 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
# SPDX-FileCopyrightText: Copyright 2025 Arm Limited and affiliates.
#
# http://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.
# *******************************************************************************
# SPDX-License-Identifier: Apache-2.0

name: "Build and test PyTorch"

Expand Down
17 changes: 2 additions & 15 deletions .github/workflows/tensorflow.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,6 @@
# *******************************************************************************
# Copyright 2025 Arm Limited and affiliates.
# SPDX-License-Identifier: Apache-2.0
#
# 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
# SPDX-FileCopyrightText: Copyright 2025 Arm Limited and affiliates.
#
# http://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.
# *******************************************************************************
# SPDX-License-Identifier: Apache-2.0

name: "Build and test Tensorflow"

Expand Down
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# SPDX-FileCopyrightText: Copyright 2025 Arm Limited and affiliates.
#
# SPDX-License-Identifier: Apache-2.0

ao/
venv*/
__pycache__/
Expand Down
60 changes: 60 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# SPDX-FileCopyrightText: Copyright 2025 Arm Limited and affiliates.
#
# SPDX-License-Identifier: Apache-2.0

fail_fast: false

repos:
- repo: local
hooks:
# Python/YAML/shell: use hash comments (no --multi-line)
- id: reuse-annotate-current-year-python-yaml-shell-files
name: REUSE Annotate (Python add current year, merge)
language: python
additional_dependencies: [reuse==6.2.0]
entry: reuse annotate
args:
- --merge-copyrights
- --license
- Apache-2.0
- --copyright
- Arm Limited and affiliates.
- --copyright-prefix
- spdx-string
- --style
- python
pass_filenames: true
files: '(\.gitignore|\.dockerignore|requirements\.txt|bash_profile|Dockerfile|\.(py|yml|yaml|sh|bash))$'
stages: [ pre-commit ]

# JSON/Markdown/welcome.txt: use sidecar .license files
- id: reuse-annotate-current-year-json-and-md
name: REUSE Annotate (JSON/Markdown/welcome.txt sidecar fallback add current year, merge)
language: python
additional_dependencies: [reuse==6.2.0]
entry: reuse annotate
args:
- --merge-copyrights
- --license
- Apache-2.0
- --copyright
- Arm Limited and affiliates.
- --copyright-prefix
- spdx-string
- --fallback-dot-license
pass_filenames: true
files: '(welcome\.txt|\.(json|md))$'
stages: [ pre-commit ]

- repo: https://github.com/fsfe/reuse-tool
rev: v6.2.0
hooks:
- id: reuse-lint-file
stages: [ pre-commit ]
name: "REUSE Compliant Copyright and License"

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v6.0.0
hooks:
- id: trailing-whitespace
stages: [ pre-commit ]
115 changes: 115 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
<!--
SPDX-FileCopyrightText: Copyright 2025 Arm Limited and affiliates.

SPDX-License-Identifier: Apache-2.0
-->

# CONTRIBUTING

Thank you for your interest in contributing to ML Tool Solutions.
This document describes the recommended development workflow, coding standards, and how to use the repository's automated tooling, particularly the pre-commit hooks that enforce SPDX/REUSE compliance, formatting checks, and other quality gates.

We welcome contributions through GitHub Pull Requests.
Please read this guide before submitting changes.

## Development Workflow

### Fork, Branch, and Submit a PR

1. Fork the repository.
2. Create a feature branch:

```bash
git checkout -b my-feature
```

3. Make changes.
4. Ensure all automated checks (pre-commit hooks) pass locally.
5. Submit a pull request on GitHub.

All PRs must have:

- A clear description of the change.
- Passing CI checks.
- SPDX/REUSE-compliant licensing metadata (handled automatically by the hooks).
- Clean commits or a tidy commit history.

## Pre-Commit Hooks (IMPORTANT)

This repository uses `pre-commit` to automatically enforce:

- SPDX/REUSE-compliant license and copyright notices
- Correct SPDX headers and/or sidecar `.license` files
- `reuse-lint` checks on modified files
- Trailing whitespace cleanup

These hooks ensure all contributions meet licensing and formatting requirements before changes are committed.

### Install `pre-commit`

You only need to do this once per machine:

```bash
pip install pre-commit
pre-commit install
```

This installs the git hooks so they run automatically before each commit.

Verify installation:

```bash
pre-commit --version
```

### Typical Contributor Workflow with Hooks

1. Modify files.
2. Stage your changes:

```bash
git add .
```

3. Commit:

```bash
git commit -m "..."
```

4. The hooks run automatically. If they fail:
- Inspect the changed files (`git diff`)
- Apply fixes
- Stage again
- Re-run:

```bash
pre-commit run --all-files
```

5. Push once everything passes:

```bash
git push
```

## Licensing Requirements (SPDX/REUSE)

This project follows the [REUSE specification](https://reuse.software).

Every file must contain:

- An SPDX license identifier
- `SPDX-FileCopyrightText` statements

For formats where inline headers are not appropriate (e.g., binaries, JSON), use sidecar .license files.
The pre-commit hooks manage most of this automatically.

## Coding Conventions

- Keep scripts POSIX-compatible unless necessary.
- Use SPDX headers based on examples already in the repository.

## Contact Us

If you have questions, comments, and/or suggestions? Please raise an [issue](https://github.com/ARM-software/Tool-Solutions/issues/new/choose).
Loading