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
1 change: 0 additions & 1 deletion .clang-format
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
---
---
Language: Cpp
BasedOnStyle: Microsoft
AccessModifierOffset: -4
Expand Down
20 changes: 4 additions & 16 deletions .github/workflows/format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,24 +13,12 @@ jobs:
runs-on: ubuntu-24.04

steps:
- uses: actions/checkout@v4
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

- name: Set up Python
uses: actions/setup-python@v5
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
with:
python-version: '3.10'

- name: Install Development Dependencies
run: pip install -r requirements-dev.txt

- name: Installing Component-specific Dependencies
run: pip install -r assembler_tools/hec-assembler-tools/requirements.txt

- name: Install Apt Dependencies
run: sudo apt install -y clang-format-14

- name: Fetch main branch for diff
run: git fetch origin main

- name: Run pre-commit on changed files only
run: pre-commit run --from-ref origin/main --to-ref HEAD
- name: Run pre-commit
uses: pre-commit/action@2c7b3805fd2a0fd8c1884dcaebf91fc102a13ecd # v3.0.1
87 changes: 29 additions & 58 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# SPDX-License-Identifier: Apache-2.0

default_language_version:
# force all unspecified python hooks to run python3
# force all unspecified python hooks to run python3.10
python: python3.10
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
Expand All @@ -15,6 +15,7 @@ repos:
- id: check-yaml
args:
- --allow-multiple-documents
- id: fix-byte-order-marker
- repo: https://github.com/crate-ci/typos
rev: v1.33.1 # Updated 2025/06
hooks:
Expand All @@ -28,75 +29,45 @@ repos:
name: insert-license-shell
files: \.(sh|py)$
args:
- --license-filepath
# defaults to: LICENSE.txt
- HEADER
- --license-filepath=HEADER
- --use-current-year
- --allow-past-years
- --detect-license-in-X-top-lines=10
- --fuzzy-ratio-cut-off=50
- --remove-header
- id: insert-license
name: insert-license-cpp
files: \.(c|cc|cxx|cpp|h|hpp|hxx|inl|h.in)$
args:
- --license-filepath
# defaults to: LICENSE.txt
- HEADER
- --comment-style
- // # defaults to: #
- --license-filepath=HEADER
- --comment-style=//
- --use-current-year
- --allow-past-years
- --detect-license-in-X-top-lines=10
- --fuzzy-ratio-cut-off=50
- --remove-header
- id: remove-tabs
name: remove-tabs
files: \.(py)$
args: [--whitespaces-count, '4']
- repo: https://github.com/psf/black-pre-commit-mirror
rev: 25.1.0 # Updated 2025/06
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.8.4
hooks:
- id: black
language_version: python3.10
- id: ruff
args: [--fix] # Automatically fix issues when possible
- id: ruff-format # Replaces black
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.16.0 # Last checked 2025/06
hooks:
- id: mypy
language: system
exclude: >-
^(assembler_tools/hec-assembler-tools/assembler/common/run_config\.py|
*assembler_tools/hec-assembler-tools/assembler/instructions/|
*assembler_tools/hec-assembler-tools/assembler/memory_model/|
*assembler_tools/hec-assembler-tools/assembler/stages/asm_scheduler\.py|
*assembler_tools/hec-assembler-tools/assembler/stages/scheduler\.py|
*assembler_tools/hec-assembler-tools/debug_tools/main\.py|
*assembler_tools/hec-assembler-tools/debug_tools/xinst_timing_check/|
*assembler_tools/hec-assembler-tools/he_as\.py|
*assembler_tools/hec-assembler-tools/assembler/spec_config/isa_spec.py)
args: ["--follow-imports=skip", "--install-types", "--non-interactive"]
- repo: local
pass_filenames: false
- repo: https://github.com/pre-commit/mirrors-clang-format
rev: "v18.1.2"
hooks:
- id: clang-format
exclude_types: [json] # skip *.json and *.JSON
args: ["--style=file"]
- repo: https://github.com/cpplint/cpplint
rev: "2.0.2"
hooks:
- id: pylint
name: pylint
entry: pylint
language: system
types: [python]
exclude: >-
^(assembler_tools/hec-assembler-tools/assembler/common/run_config\.py|
*assembler_tools/hec-assembler-tools/assembler/instructions/|
*assembler_tools/hec-assembler-tools/assembler/memory_model/|
*assembler_tools/hec-assembler-tools/assembler/stages/asm_scheduler\.py|
*assembler_tools/hec-assembler-tools/assembler/stages/scheduler\.py|
*assembler_tools/hec-assembler-tools/debug_tools/main\.py|
*assembler_tools/hec-assembler-tools/debug_tools/xinst_timing_check/|
*assembler_tools/hec-assembler-tools/he_as\.py|
*assembler_tools/hec-assembler-tools/assembler/spec_config/isa_spec.py)
args:
- -rn # Only display messages
- -sn # Don't display the score
- --source-roots=p-isa_tools/kerngen,assembler_tools/hec-assembler-tools
- id: clang-format-14
name: clang-format-14
entry: clang-format-14
language: system
files: \.(c|cc|cxx|cpp|h|hpp|hxx|inl)$
args: ["-i", "--style=file"]
- id: cpplint
name: cpplint
entry: cpplint
language: system
files: \.(c|cc|cxx|cpp|h|hpp|hxx)$
args:
- --recursive
- --filter=-build/c++17
27 changes: 0 additions & 27 deletions .pylintrc

This file was deleted.

5 changes: 5 additions & 0 deletions .typos.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,8 @@
# variation of params
parms = "parms"
bload = "bload"

[files]
extend-exclude = [
"requirements-dev.txt",
]
2 changes: 1 addition & 1 deletion HEADER
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
Copyright (C) 2025 Intel Corporation
Copyright (C) {year} Intel Corporation
SPDX-License-Identifier: Apache-2.0
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Copyright (C) 2025 Intel Corporation
# SPDX-License-Identifier: Apache-2.0

import os


def makeUniquePath(path: str) -> str:
"""
Returns a unique, normalized, and absolute version of the given file path.
Expand Down
Loading