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
32 changes: 28 additions & 4 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -1,5 +1,29 @@
BasedOnStyle: Google
IndentWidth: 4
---
BasedOnStyle: LLVM
SortIncludes: false
TabWidth: 4
UseTab: Never
ColumnLimit: 80
IndentWidth: 4
ColumnLimit: 120
AllowShortFunctionsOnASingleLine: false
---
UseTab: ForIndentation
DerivePointerAlignment: false
PointerAlignment: Right
AlignConsecutiveMacros: true
AlignTrailingComments: true
AllowAllArgumentsOnNextLine: true
AllowAllConstructorInitializersOnNextLine: true
AllowAllParametersOfDeclarationOnNextLine: true
AlignAfterOpenBracket: Align
SpaceBeforeCpp11BracedList: true
SpaceBeforeCtorInitializerColon: true
SpaceBeforeInheritanceColon: true
SpacesInAngles: false
SpacesInCStyleCastParentheses: false
SpacesInConditionalStatement: false
AllowShortLambdasOnASingleLine: Inline
AllowShortLoopsOnASingleLine: false
AlwaysBreakTemplateDeclarations: Yes
IncludeBlocks: Regroup
Language: Cpp
AccessModifierOffset: -4
12 changes: 12 additions & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# This file contains a list of revisions that should be ignored by git blame.
# These are typically large formatting changes that don't provide meaningful
# information when looking at the history of a line.
#
# To use this file, run:
# git config blame.ignoreRevsFile .git-blame-ignore-revs
#
# Or for a one-time use:
# git blame --ignore-revs-file=.git-blame-ignore-revs <file>

# Large formatting change - add format check for code quality
95bbd61f6d5bf7927ec4b8123fc5b871616e4825
63 changes: 63 additions & 0 deletions .github/workflows/codequality.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: CodeQuality Check

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

jobs:
check-draft:
# We run all other jobs on PRs only if they are not draft PR
if: github.event_name != 'pull_request' || github.event.pull_request.draft == false
runs-on: ubuntu-22.04
steps:
- name: Preliminary checks on CI
run: echo "Event name is ${{ github.event_name }}"

format-check:
name: Format Check
runs-on: ubuntu-22.04
needs: check-draft

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

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

- name: Install formatting tools
shell: bash
run: |
sudo apt-get update -y -qq
sudo pip3 install 'clang_format==11.0.1' 'black>=24' cmake-format

- name: List Installed Packages
shell: bash
run: pip3 freeze

- name: Verify clang-format version
shell: bash
run: |
clang-format --version
clang-format --dump-config

- name: Verify black version
shell: bash
run: black --version

- name: Format Check
shell: bash
run: |
make format-check

- name: Show formatting differences (if any)
if: failure()
shell: bash
run: |
echo "Formatting check failed. Here are the differences:"
python3 scripts/format.py --all --check || true
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
format-check:
python3 scripts/format.py --all --check
format-fix:
python3 scripts/format.py --all --fix --noconfirm
Loading
Loading