diff --git a/.clang-tidy b/.clang-tidy new file mode 100644 index 0000000..b43782f --- /dev/null +++ b/.clang-tidy @@ -0,0 +1,5 @@ +--- +Checks: '*,-fuchsia-*,-google-*,-zircon-*,-abseil-*,-modernize-use-trailing-return-type,-llvm*, -hicpp-uppercase-literal-suffix, -readability-uppercase-literal-suffix' +WarningsAsErrors: '*' +HeaderFilterRegex: '' +FormatStyle: none diff --git a/CMakeLists.txt b/CMakeLists.txt index 06b1411..33aa204 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,4 +2,6 @@ cmake_minimum_required(VERSION 3.13) project(Test) -add_executable(TestApp source.cpp) +add_executable(TestApp source.cpp another_source.cpp) +target_include_directories(TestApp PUBLIC "lib") +target_compile_features(TestApp PRIVATE cxx_std_17) diff --git a/another_source.cpp b/another_source.cpp new file mode 100644 index 0000000..357b7a7 --- /dev/null +++ b/another_source.cpp @@ -0,0 +1,3 @@ +int do_nothing(int /*argc*/, char** /*argv*/){ + return 0; +} \ No newline at end of file diff --git a/file2.bin b/file2.bin new file mode 100644 index 0000000..5886953 Binary files /dev/null and b/file2.bin differ diff --git a/lib/some_include.hpp b/lib/some_include.hpp new file mode 100644 index 0000000..21054e8 --- /dev/null +++ b/lib/some_include.hpp @@ -0,0 +1,3 @@ +inline void func() { + int anotherUnused; +} \ No newline at end of file diff --git a/local.py b/local.py new file mode 100644 index 0000000..cd0abcf --- /dev/null +++ b/local.py @@ -0,0 +1,35 @@ +def get_lines_changed_from_patch(patch): + lines_changed = [] + lines = patch.split('\n') + + for line in lines: + # Example line @@ -43,6 +48,8 @@ + # ------------ ^ + if line.startswith("@@"): + # Example line @@ -43,6 +48,8 @@ + # ----------------------^ + idx_beg = line.index("+") + + # Example line @@ -43,6 +48,8 @@ + # ^--^ + idx_end = line[idx_beg:].index(",") + line_begin = int(line[idx_beg + 1 : idx_beg + idx_end]) + + idx_beg = idx_beg + idx_end + idx_end = line[idx_beg + 1 : ].index("@@") + + num_lines = int(line[idx_beg + 1 : idx_beg + idx_end]) + + print(f"Line begin={line_begin} Line end={line_begin + num_lines}") + lines_changed.append((line_begin, line_begin + num_lines)) + + return lines_changed + + +patch="@@ -0,0 +1,5 @@\n"\ +"+---\n"\ +"+Checks: '*,-fuchsia-*,-google-*,-zircon-*,-abseil-*,-modernize-use-trailing-return-type,-llvm*, -hicpp-uppercase-literal-suffix, -readability-uppercase-literal-suffix'\n"\ +"+WarningsAsErrors: '*'\n"\ +"+HeaderFilterRegex: ''\n"\ +"+FormatStyle: none\n" +get_lines_changed_from_patch(patch) diff --git a/single_line_file.hpp b/single_line_file.hpp new file mode 100644 index 0000000..f3b237b --- /dev/null +++ b/single_line_file.hpp @@ -0,0 +1 @@ +#include diff --git a/source.cpp b/source.cpp index fa2630d..9bb1b68 100644 --- a/source.cpp +++ b/source.cpp @@ -38,5 +38,7 @@ int main() { std::vector vec; std::cout << vec[10] << std::endl; // Out of bounds vector access + std::vector unusedvec; + return 0; } diff --git a/switch_compile_branch.py b/switch_compile_branch.py deleted file mode 100644 index 20e888f..0000000 --- a/switch_compile_branch.py +++ /dev/null @@ -1,16 +0,0 @@ - - -import argparse -import fileinput - -parser = argparse.ArgumentParser() -parser.add_argument("-br", "--branch", help="Compile Result branch name", required=True) -branch_name = parser.parse_args().branch - -with fileinput.input("./.github/workflows/test.yml", inplace=True) as file: - for line in file: - if line.strip().startswith("uses: JacobDomagala/CompileStatus@"): - print(f" uses: JacobDomagala/CompileStatus@{branch_name}") - else: - print(f"{line}", end='') - diff --git a/switch_sa_branch.py b/switch_sa_branch.py deleted file mode 100755 index 2291b8c..0000000 --- a/switch_sa_branch.py +++ /dev/null @@ -1,16 +0,0 @@ - - -import argparse -import fileinput - -parser = argparse.ArgumentParser() -parser.add_argument("-br", "--branch", help="StaticAnalysis branch name", required=True) -branch_name = parser.parse_args().branch - -with fileinput.input("./.github/workflows/test.yml", inplace=True) as file: - for line in file: - if line.strip().startswith("uses: JacobDomagala/StaticAnalysis@"): - print(f" uses: JacobDomagala/StaticAnalysis@{branch_name}") - else: - print(f"{line}", end='') -