Skip to content
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

quality-of-life fixes: clang-format, clang-static-analyzer, pre-commit #351

Closed
wants to merge 30 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
3a33e92
fix(build): call AC_USE_SYSTEM_EXTENSIONS, AC_LANG([C])
Mar 11, 2024
9aeb73a
build: delete config.h, pass defines directly
May 13, 2024
9144be8
ci(pre-commit): introduce pre-commit
Feb 19, 2024
850113e
ci(pre-commit): add yamlfmt
May 13, 2024
3d8a9d1
nit: apply yamlfmt fixes to tree
May 13, 2024
f9f5348
ci(pre-commit): add actionlint
Feb 19, 2024
6ded8d1
fix: take actionlint fixes
May 13, 2024
0833b38
ci(pre-commit): introduce conventional commit hook
Feb 19, 2024
e640f43
ci(pre-commit): add eof/whitespace checks
Feb 19, 2024
a50ebf1
nit: apply eof/trailing whitespace fixes
May 13, 2024
afcee3e
ci(pre-commit): introduce shellcheck
Feb 19, 2024
9ee8973
fix: take shellcheck fixes on autogen.sh
May 13, 2024
3f6d6b0
ci(pre-commit): add mdformat
Feb 21, 2024
f9cbf3b
fix: take mdformat fixes
May 13, 2024
f34a7ae
ci(pre-commit): add include-what-you-use
May 12, 2024
0e2d51d
build: take iwyu fixes
May 13, 2024
c39432e
ci(clang-tidy): add basic clang-tidy config file.
Feb 25, 2024
82f8d59
ci(pre-commit): add clang tidy hook
May 13, 2024
a5b9a7e
fix: cast id to `signed long long' for ffsll
May 13, 2024
f39051a
fix: implicit conversions: fix rr thres
May 13, 2024
e713ba5
ci(pre-commit): add editorconfig
Feb 19, 2024
9bc5d2f
ci(github): run pre-commit on PRs
Feb 21, 2024
36de2e4
misc: add .git-blame-ignore-revs
May 13, 2024
3e83cd4
test: nit: null-initialize test member
Apr 25, 2024
29a2bf2
ci(github): distcheck: use github cache
May 13, 2024
faed91b
ci(github): rename config.log artifacts
May 13, 2024
7c4b02a
ci(github): expand matrix for latest cc
May 13, 2024
c6cdc1a
ci(github): add a configuration file for codechecker
May 13, 2024
e51fc10
ci(github): split codechecker to separate job
May 13, 2024
1ea28ea
ci(pre-commit): introduce clang-format
Feb 19, 2024
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: 9 additions & 8 deletions .ci/aws/aws_ofi_nccl_pr_ci.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
---
general:
timeout: 180
enable_live_log: true
timeout: 180
enable_live_log: true
cluster:
cluster_type: manual_cluster
cluster_type: manual_cluster
testing:
test_target: aws-ofi-nccl
test_type: pr
aws_ofi_nccl_build_type: debug
test_list:
- test_nccl_test
test_target: aws-ofi-nccl
test_type: pr
aws_ofi_nccl_build_type: debug
test_list:
- test_nccl_test
61 changes: 61 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
---
BasedOnStyle: Google
InsertNewlineAtEOF: true
LineEnding: LF
ColumnLimit: 100
TabWidth: 8
IndentWidth: 8
BracedInitializerIndentWidth: 8
ContinuationIndentWidth: 8
SpacesBeforeTrailingComments: 2
ReflowComments: true
IndentCaseLabels: false

BreakBeforeBraces: Linux
UseTab: ForContinuationAndIndentation
MaxEmptyLinesToKeep: 2
AlignOperands: Align
AllowAllArgumentsOnNextLine: false
BinPackArguments: false
BinPackParameters: false
AlignConsecutiveDeclarations: false
AlignConsecutiveAssignments: false

AlignTrailingComments:
Kind: Always
OverEmptyLines: 0
AlignConsecutiveShortCaseStatements:
Enabled: true
AcrossEmptyLines: true
AcrossComments: true
AlignCaseColons: false
AlignConsecutiveMacros:
Enabled: true
AcrossEmptyLines: true
AcrossComments: true

AlignConsecutiveBitFields:
Enabled: true
AcrossEmptyLines: true
AcrossComments: true

PointerAlignment: Right
ReferenceAlignment: Right
AllowShortFunctionsOnASingleLine: None
AllowShortIfStatementsOnASingleLine: false
AllowShortLoopsOnASingleLine: false
RemoveParentheses: MultipleParentheses
InsertBraces: true

SortIncludes: CaseSensitive
IncludeBlocks: Regroup
IncludeCategories:
# External dependencies at the top.
- Regex: ^([<].*[.]h[>])$
Priority: -50
SortPriority: -50

# local headers below them.
- Regex: ^(["].*[.]h["])$
Priority: -10
SortPriority: -10
53 changes: 53 additions & 0 deletions .clang-tidy
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
---
Checks:
- -*
- cert-dcl16-c
- optin-mpi-mpi-checker-c
- optin.core.EnumCastOutOfRange
- optin-performance-padding
- clang-analyzer-core*
- clang-analyzer-nullability*
- clang-analyzer-optin.core.EnumCastOutOfRange
- clang-analyzer-optin.performance.Padding
- clang-analyzer-security*
- clang-analyzer-unix*
- -clang-analyzer-security.insecureAPI*
- bugprone-*
- -bugprone-easily-swappable-parameters
- -bugprone-assignment-in-if-condition
- -bugprone-multi-level-implicit-pointer-conversion
- misc-const-correctness
- misc-static-assert
- misc-misplaced-const
- misc-redundant-expression
- misc-header-include-cycle
- misc-definitions-in-headers
#- misc-include-cleaner
- readability-avoid-const-params-in-decls
- readability-avoid-return-with-void-value
- readability-avoid-unconditional-preprocessor-if
- readability-braces-around-statements
- readability-const-return-type
- readability-const-return-type
- readability-duplicate-include
- readability-implicit-bool-conversion
- readability-inconsistent-declaration-parameter-name
- readability-misleading-indentation
- readability-misplaced-array-index
- readability-named-parameter
- readability-non-const-parameter
- readability-redundant-control-flow
- readability-redundant-declaration
- readability-redundant-inline-specifier
- readability-simplify-boolean-expr
- readability-simplify-subscript-expr
- readability-string-compare
- readability-suspicious-call-argument
- readability-uppercase-literal-suffix
WarningsAsErrors: true
FormatStyle: file
CheckOptions:
- key: readability-uppercase-literal-suffix.NewSuffixes
value: L;LL;LU;LLU
- key: misc-include-cleaner.IgnoreHeaders
value: include/nccl-headers/.*
19 changes: 19 additions & 0 deletions .ecrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"Version": "2.7.2",
"Verbose": false,
"Debug": false,
"IgnoreDefaults": false,
"SpacesAftertabs": true,
"NoColor": false,
"Exclude": [],
"AllowedContentTypes": [],
"PassedFiles": [],
"Disable": {
"EndOfLine": false,
"Indentation": false,
"InsertFinalNewline": false,
"TrimTrailingWhitespace": false,
"IndentSize": false,
"MaxLineLength": false
}
}
15 changes: 15 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
root = true

[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true

[*.md]
indent_style = space
indent_size = 1

[*.[ch]]
indent_style = tab
indent_size = 8
trim_trailing_whitespace = true
11 changes: 11 additions & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# build: take iwyu fixes
0e2d51dbd070df17cc5c3d1966a7c1f9e81b3a99

# fix: take mdformat fixes
f9cbf3b8914db0a8744456441cb57443388b7dfe

# nit: apply eof/trailing whitespace fixes
a50ebf1b5e1e12d7788a1a22a53f0d7e8c77b946

# nit: apply yamlfmt fixes to tree
3d8a9d1ffed34da06581ec2bd971f03d41dcb6ac
1 change: 0 additions & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,4 @@

*Description of changes:*


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
6 changes: 6 additions & 0 deletions .github/codechecker.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
analyzer:
- --disable=clang-diagnostic-unused-parameter
- --ignore=.github/codechecker_skips.txt
- --analyzer-config=clangsa:unroll-loops=true
- --report-hash=context-free-v2
3 changes: 3 additions & 0 deletions .github/codechecker_skips.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
-/tests/functional/*
-/tests/unit/*
-/include/nccl-headers/*/*
121 changes: 0 additions & 121 deletions .github/workflows/distcheck.yaml

This file was deleted.

Loading
Loading