diff --git a/.clang-tidy b/.clang-tidy index 99d867ab4..171995702 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -1,6 +1,5 @@ --- -Checks: '-*,google-*,clang-analyzer-*,-clang-analyzer-security.insecureAPI.*,cppcoreguidelines-*,-cppcoreguidelines-avoid-magic-numbers,-cppcoreguidelines-pro-bounds-*,openmp-*,performance-*,portability-*,modernize-*,-modernize-use-trailing-*' -WarningsAsErrors: '*,-google-readability-*,-google-explicit-constructor,-modernize-*,modernize-avoid-c-arrays,-performance-move-const-arg,-performance-noexcept-move-constructor,-performance-unnecessary-value-param,-cppcoreguidelines-init-variables,-cppcoreguidelines-pro-*,-cppcoreguidelines-owning-memory,-clang-analyzer-cplusplus.Move' -HeaderFilterRegex: '' -AnalyzeTemporaryDtors: false -FormatStyle: '{ BasedOnStyle: Google, UseTab: Never, IndentWidth: 4, TabWidth: 4, AllowShortIfStatementsOnASingleLine: false, IndentCaseLabels: true, ColumnLimit: 80, AccessModifierOffset: -3, AlignConsecutiveMacros: true }' +Checks: "-*,google-*,clang-analyzer-*,-clang-analyzer-security.insecureAPI.*,cppcoreguidelines-*,-cppcoreguidelines-avoid-magic-numbers,-cppcoreguidelines-pro-bounds-*,openmp-*,performance-*,portability-*,modernize-*,-modernize-use-trailing-*" +WarningsAsErrors: "*,-google-readability-*,-google-explicit-constructor,-modernize-*,modernize-avoid-c-arrays,-performance-move-const-arg,-performance-noexcept-move-constructor,-performance-unnecessary-value-param,-cppcoreguidelines-init-variables,-cppcoreguidelines-pro-*,-cppcoreguidelines-owning-memory,-clang-analyzer-cplusplus.Move" +HeaderFilterRegex: "" +FormatStyle: "{ BasedOnStyle: Google, UseTab: Never, IndentWidth: 4, TabWidth: 4, AllowShortIfStatementsOnASingleLine: false, IndentCaseLabels: true, ColumnLimit: 80, AccessModifierOffset: -3, AlignConsecutiveMacros: true }" diff --git a/.github/workflows/approved-label.yml b/.github/workflows/approved-label.yml index 9ce4225cb..0f58a1659 100644 --- a/.github/workflows/approved-label.yml +++ b/.github/workflows/approved-label.yml @@ -2,6 +2,8 @@ on: pull_request_review name: Add "approved" label when approved permissions: pull-requests: write + issues: write + jobs: add_label: name: Add "approved" label when approved diff --git a/.github/workflows/awesome_workflow.yml b/.github/workflows/awesome_workflow.yml index 473d79406..a9fe27f50 100644 --- a/.github/workflows/awesome_workflow.yml +++ b/.github/workflows/awesome_workflow.yml @@ -9,7 +9,7 @@ jobs: name: Code Formatter runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v7 with: fetch-depth: 0 - uses: actions/setup-python@v4 diff --git a/scripts/file_linter.py b/scripts/file_linter.py index cfa98a4b9..f26fbfea0 100644 --- a/scripts/file_linter.py +++ b/scripts/file_linter.py @@ -5,15 +5,28 @@ import sys print("Python {}.{}.{}".format(*sys.version_info)) # Python 3.8 with open("git_diff.txt") as in_file: modified_files = sorted(in_file.read().splitlines()) - print("{} files were modified.".format(len(modified_files))) + print(f"{len(modified_files)} files were modified.") - cpp_exts = tuple(".c .c++ .cc .cpp .cu .cuh .cxx .h .h++ .hh .hpp .hxx".split()) + cpp_exts = ( + ".c", + ".c++", + ".cc", + ".cpp", + ".cu", + ".cuh", + ".cxx", + ".h", + ".h++", + ".hh", + ".hpp", + ".hxx", + ) cpp_files = [file for file in modified_files if file.lower().endswith(cpp_exts)] print(f"{len(cpp_files)} C++ files were modified.") if not cpp_files: sys.exit(0) - subprocess.run( + _ = subprocess.run( [ "clang-tidy", "--fix", @@ -26,7 +39,7 @@ with open("git_diff.txt") as in_file: text=True, stderr=subprocess.STDOUT, ) - subprocess.run( + _ = subprocess.run( ["clang-format", "-i", "-style=file", *cpp_files], check=True, text=True,