diff --git a/.clang-format b/.clang-format deleted file mode 100644 index b4723621..00000000 --- a/.clang-format +++ /dev/null @@ -1,161 +0,0 @@ -# yamllint disable-line rule:document-start ---- -ColumnLimit: 100 -IndentWidth: 4 -# yamllint disable-line rule:document-start ---- -Language: "Cpp" -AccessModifierOffset: -4 -AlignAfterOpenBracket: "BlockIndent" -AlignArrayOfStructures: "None" -AlignConsecutiveAssignments: "None" -AlignConsecutiveBitFields: "None" -AlignConsecutiveDeclarations: "None" -AlignConsecutiveMacros: "None" -AlignEscapedNewlines: "DontAlign" -AlignOperands: "Align" -AlignTrailingComments: - Kind: "Never" -AllowAllArgumentsOnNextLine: false -AllowAllParametersOfDeclarationOnNextLine: false -AllowBreakBeforeNoexceptSpecifier: "OnlyWithParen" -AllowShortBlocksOnASingleLine: "Always" -AllowShortCaseLabelsOnASingleLine: false -AllowShortCompoundRequirementOnASingleLine: true -AllowShortEnumsOnASingleLine: false -AllowShortFunctionsOnASingleLine: "Inline" -AllowShortIfStatementsOnASingleLine: "Never" -AllowShortLambdasOnASingleLine: "All" -AllowShortLoopsOnASingleLine: false -AllowShortNamespacesOnASingleLine: false -AlwaysBreakBeforeMultilineStrings: false -BinPackArguments: false -BinPackParameters: false -BitFieldColonSpacing: "Both" -BraceWrapping: - AfterCaseLabel: false - AfterClass: false - AfterControlStatement: "MultiLine" - AfterEnum: false - AfterFunction: false - AfterNamespace: false - AfterExternBlock: false - AfterStruct: false - AfterUnion: false - BeforeCatch: false - BeforeElse: false - BeforeLambdaBody: false - BeforeWhile: false - IndentBraces: false - SplitEmptyFunction: false - SplitEmptyNamespace: false - SplitEmptyRecord: false -BreakAfterAttributes: "Never" -BreakAfterReturnType: "Automatic" -BreakBeforeBinaryOperators: "All" -BreakBeforeBraces: "Custom" -BreakBeforeConceptDeclarations: "Always" -BreakBeforeInlineASMColon: "OnlyMultiline" -BreakBeforeTernaryOperators: true -BreakBinaryOperations: "Never" -BreakConstructorInitializers: "BeforeColon" -BreakFunctionDefinitionParameters: false -BreakInheritanceList: "BeforeColon" -BreakStringLiterals: true -BreakTemplateDeclarations: "Yes" -CompactNamespaces: true -ConstructorInitializerIndentWidth: 8 -ContinuationIndentWidth: 8 -Cpp11BracedListStyle: true -DerivePointerAlignment: false -DisableFormat: false -EmptyLineAfterAccessModifier: "Never" -EmptyLineBeforeAccessModifier: "LogicalBlock" -FixNamespaceComments: true -IncludeBlocks: "Regroup" -IndentAccessModifiers: false -IndentCaseBlocks: false -IndentCaseLabels: true -IndentExportBlock: true -IndentExternBlock: "Indent" -IndentGotoLabels: false -IndentPPDirectives: "BeforeHash" -IndentRequiresClause: false -IndentWrappedFunctionNames: false -InsertBraces: true -InsertNewlineAtEOF: true -IntegerLiteralSeparator: - Binary: 4 - BinaryMinDigits: 4 - Decimal: 3 - DecimalMinDigits: 5 - Hex: 4 - HexMinDigits: 4 -KeepEmptyLines: - AtEndOfFile: true - AtStartOfBlock: false - AtStartOfFile: false -KeepFormFeed: false -LambdaBodyIndentation: "Signature" -LineEnding: "LF" -MainIncludeChar: "Quote" -MaxEmptyLinesToKeep: 1 -NamespaceIndentation: "None" -PPIndentWidth: -1 -PackConstructorInitializers: "CurrentLine" -PenaltyBreakOpenParenthesis: 25 -PenaltyBreakBeforeFirstCallParameter: 25 -PenaltyReturnTypeOnItsOwnLine: 100 -PointerAlignment: "Left" -QualifierAlignment: "Custom" -QualifierOrder: - - "static" - - "friend" - - "inline" - # constexpr west as explained in https://www.youtube.com/watch?v=z6s6bacI424 - - "constexpr" - - "type" - - "const" - - "volatile" -ReferenceAlignment: "Pointer" -ReflowComments: "Always" -RemoveBracesLLVM: false -RemoveEmptyLinesInUnwrappedLines: true -RemoveSemicolon: true -RequiresClausePosition: "OwnLine" -RequiresExpressionIndentation: "OuterScope" -SeparateDefinitionBlocks: "Always" -ShortNamespaceLines: 0 -SortIncludes: "CaseInsensitive" -SortUsingDeclarations: "Lexicographic" -SpaceAfterCStyleCast: false -SpaceAfterLogicalNot: false -SpaceAfterTemplateKeyword: true -SpaceAroundPointerQualifiers: "Default" -SpaceBeforeAssignmentOperators: true -SpaceBeforeCaseColon: false -SpaceBeforeCpp11BracedList: false -SpaceBeforeCtorInitializerColon: true -SpaceBeforeInheritanceColon: true -SpaceBeforeParens: "ControlStatements" -SpaceBeforeRangeBasedForLoopColon: true -SpaceBeforeSquareBrackets: false -SpaceInEmptyBlock: false -SpacesBeforeTrailingComments: 2 -SpacesInAngles: false -SpacesInContainerLiterals: false -SpacesInLineCommentPrefix: - Minimum: 1 - Maximum: -1 -SpacesInParens: "Custom" -SpacesInParensOptions: - ExceptDoubleParentheses: false - InConditionalStatements: false - InCStyleCasts: false - InEmptyParentheses: false - Other: false -SpacesInSquareBrackets: false -Standard: "Latest" -TabWidth: 4 -UseTab: "Never" -WrapNamespaceBodyWithEmptyLines: "Never" diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 7a6cd054..03156859 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -47,6 +47,17 @@ jobs: shell: "bash" run: "npm install -g @go-task/cli" + - name: "Install uv" + shell: "bash" + run: |- + curl \ + --fail \ + --location \ + --silent \ + --show-error \ + https://astral.sh/uv/0.8.4/install.sh \ + | sh + - name: "Build and run unit tests" run: "task test:run-${{matrix.build_type}}" diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml index 3fce50c4..b4353cac 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/lint.yaml @@ -33,5 +33,25 @@ jobs: - name: "Install task" run: "npm install -g @go-task/cli" + - name: "Install uv" + shell: "bash" + run: |- + curl \ + --fail \ + --location \ + --silent \ + --show-error \ + https://astral.sh/uv/0.8.4/install.sh \ + | sh + + # We use clang for linting so CMake doesn't generate compile_commands.json with any gcc + # specific flags that would confuse clang-tidy. + - if: "matrix.os == 'ubuntu-24.04'" + name: "Install clang." + run: |- + curl https://apt.llvm.org/llvm.sh | sudo bash -s -- 20 + sudo ln -s /usr/bin/clang-20 /usr/local/bin/cc + sudo ln -s /usr/bin/clang++-20 /usr/local/bin/c++ + - name: "Run lint task" run: "task lint:check" diff --git a/README.md b/README.md index 5732d569..d54302cd 100644 --- a/README.md +++ b/README.md @@ -90,6 +90,7 @@ Requirements: * [fmt] >= 8.0.1 * [GSL] >= 4.0.0 * [Task] >= 3.38 +* [uv] >= 0.7.10 To build and install the project to `$HOME/.local`: @@ -153,45 +154,15 @@ is set to true and unit tests are built. Before submitting a PR, ensure you've run our linting tools and either fixed any violations or suppressed the warning. -### Requirements - -We currently support running our linting tools on Linux and macOS. If you're developing on another -OS, you can submit a [feature request][feature-req]. If you can't run the linting workflows -locally, you can enable and run the [lint] workflow in your fork. - -To run the linting tools, besides commonly installed tools like `tar`, you'll need: - -* [clang-tidy] -* `md5sum` -* Python 3.8 or newer -* python3-venv -* [Task] - -### Setup - -```shell -./tools/init.sh -``` - ### Running the linters -Currently, `clang-tidy` has to be run manually: - -```shell -find src tests \ - -type f \ - \( -iname "*.cpp" -o -iname "*.hpp" \) \ - -print0 | \ - xargs -0 clang-tidy --config-file .clang-tidy -p build -``` - -To report all errors run: +To report all errors, run: ```shell task lint:check ``` -To fix cpp errors, and report yaml errors, run: +To automatically fix any supported format or linting errors, run: ```shell task lint:fix @@ -217,9 +188,8 @@ The following are issues we're aware of and working on: [bug-report]: https://github.com/y-scope/log-surgeon/issues/new?assignees=&labels=bug&template=bug-report.yaml [Catch2]: https://github.com/catchorg/Catch2/tree/devel -[clang-tidy]: https://clang.llvm.org/extra/clang-tidy/ [feature-req]: https://github.com/y-scope/log-surgeon/issues/new?assignees=&labels=enhancement&template=feature-request.yaml [fmt]: https://github.com/fmtlib/fmt [GSL]: https://github.com/microsoft/GSL -[lint]: https://github.com/y-scope/log-surgeon/blob/main/.github/workflows/lint.yaml [Task]: https://taskfile.dev/ +[uv]: https://docs.astral.sh/uv diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index b8a1e204..05b9cd31 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -1,6 +1,13 @@ cmake_minimum_required(VERSION 3.22.1) project(log-surgeon-examples) +set(CMAKE_EXPORT_COMPILE_COMMANDS + ON + CACHE BOOL + "Enable/Disable output of compile commands during generation." + FORCE +) + if (NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) set(default_build_type "Release") message(STATUS "No build type specified. Setting to '${default_build_type}'.") diff --git a/examples/buffer-parser.cpp b/examples/buffer-parser.cpp index fc2ce987..d6e7fe12 100644 --- a/examples/buffer-parser.cpp +++ b/examples/buffer-parser.cpp @@ -14,7 +14,7 @@ using namespace std; using namespace log_surgeon; -auto process_logs(string& schema_path, string const& input_path) -> void { +auto process_logs(string const& schema_path, string const& input_path) -> void { BufferParser parser{schema_path}; optional loglevel_id{parser.get_variable_id("loglevel")}; if (false == loglevel_id.has_value()) { @@ -91,11 +91,10 @@ auto process_logs(string& schema_path, string const& input_path) -> void { } auto main(int argc, char* argv[]) -> int { - if (int err{check_input(argc, argv)}; 0 != err) { + std::vector const args(argv + 1, argv + argc); + if (int const err{check_input(args)}; 0 != err) { return err; } - string schema_path{argv[1]}; - string input_path{argv[2]}; - process_logs(schema_path, input_path); + process_logs(args[0], args[1]); return 0; } diff --git a/examples/common.cpp b/examples/common.cpp index adb3cbb6..094762b5 100644 --- a/examples/common.cpp +++ b/examples/common.cpp @@ -1,30 +1,31 @@ #include "common.hpp" +#include #include -#include #include #include #include #include +#include using namespace std; using namespace log_surgeon; -auto check_input(int argc, char* argv[]) -> int { +auto check_input(std::vector const& args) -> int { int ret{0}; - if (3 != argc) { + if (2 != args.size()) { ret = 1; - cout << "Not enough arguments." << endl; - } else if (filesystem::path f{argv[1]}; false == filesystem::exists(f)) { + cout << "Not enough arguments.\n"; + } else if (filesystem::path const f{args[0]}; false == filesystem::exists(f)) { ret = 2; - cout << "Schema file does not exist." << endl; - } else if (filesystem::path f{argv[2]}; false == filesystem::exists(f)) { + cout << "Schema file does not exist.\n"; + } else if (filesystem::path const f{args[1]}; false == filesystem::exists(f)) { ret = 3; - cout << "Input file does not exist." << endl; + cout << "Input file does not exist.\n"; } if (0 != ret) { - cout << "usage: " << endl; + cout << "usage: \n"; } return ret; } @@ -45,5 +46,5 @@ auto print_timestamp_loglevel(LogEventView const& event, uint32_t loglevel_id) - cout << ", loglevel:"; cout << loglevel->to_string_view(); } - cout << endl; + cout << "\n"; } diff --git a/examples/common.hpp b/examples/common.hpp index 69e0468f..f66a5cb5 100644 --- a/examples/common.hpp +++ b/examples/common.hpp @@ -1,12 +1,13 @@ #ifndef COMMON_HPP #define COMMON_HPP +#include #include #include #include -auto check_input(int argc, char* argv[]) -> int; +auto check_input(std::vector const& args) -> int; auto print_timestamp_loglevel(log_surgeon::LogEventView const& event, uint32_t loglevel_id) -> void; diff --git a/examples/reader-parser.cpp b/examples/reader-parser.cpp index 71a5a3da..5f896e9a 100644 --- a/examples/reader-parser.cpp +++ b/examples/reader-parser.cpp @@ -13,7 +13,7 @@ using namespace std; using namespace log_surgeon; -auto process_logs(string& schema_path, string const& input_path) -> void { +auto process_logs(string const& schema_path, string const& input_path) -> void { ReaderParser parser{schema_path}; optional loglevel_id{parser.get_variable_id("loglevel")}; if (false == loglevel_id.has_value()) { @@ -60,11 +60,10 @@ auto process_logs(string& schema_path, string const& input_path) -> void { } auto main(int argc, char* argv[]) -> int { - if (int err{check_input(argc, argv)}; 0 != err) { + std::vector const args(argv + 1, argv + argc); + if (int const err{check_input(args)}; 0 != err) { return err; } - string schema_path{argv[1]}; - string input_path{argv[2]}; - process_logs(schema_path, input_path); + process_logs(args[0], args[1]); return 0; } diff --git a/lint-requirements.txt b/lint-requirements.txt index c2fcb6f6..e812cd91 100644 --- a/lint-requirements.txt +++ b/lint-requirements.txt @@ -1,2 +1,3 @@ clang-format>=20.1 +clang-tidy>=20.1 yamllint>=1.35.1 diff --git a/taskfiles/lint.yaml b/taskfiles/lint.yaml index d7466419..ed17b635 100644 --- a/taskfiles/lint.yaml +++ b/taskfiles/lint.yaml @@ -1,56 +1,168 @@ version: "3" includes: + examples: + internal: true + taskfile: "examples.yaml" + log-surgeon: + internal: true + taskfile: "log-surgeon.yaml" utils: internal: true taskfile: "../tools/yscope-dev-utils/exports/taskfiles/utils/utils.yaml" vars: + # General linting variables G_LINT_VENV_DIR: "{{.G_BUILD_DIR}}/lint-venv" + G_UTILS_CONFIGS_DIR: "{{.ROOT_DIR}}/tools/yscope-dev-utils/exports/lint-configs" + + # Root paths for source files + G_LOG_SURGEON_ROOT_PATHS: + - "{{.ROOT_DIR}}/src" + - "{{.ROOT_DIR}}/tests" + G_EXAMPLES_ROOT_PATHS: + - "{{.ROOT_DIR}}/examples" + + # Anchors for `sources` fields + G_EXAMPLES_SOURCES: &examples_sources + - "{{.ROOT_DIR}}/.clang-tidy" + - "{{.ROOT_DIR}}/examples/.clang-format" + - "{{.ROOT_DIR}}/examples/**/*" + - "{{.TASKFILE}}" + G_LOG_SURGEON_SOURCES: &log_surgeon_sources + - "{{.ROOT_DIR}}/.clang-format" + - "{{.ROOT_DIR}}/.clang-tidy" + - "{{.ROOT_DIR}}/src/**/*" + - "{{.ROOT_DIR}}/tests/**/*" + - "{{.TASKFILE}}" tasks: check: cmds: - - task: "cpp-check" - - task: "yaml-check" + - task: "check-cpp" + - task: "check-yaml" - fix: + check-cpp: cmds: - - task: "cpp-fix" - - task: "yaml-fix" + - task: "check-cpp-format-examples" + - task: "check-cpp-format-log-surgeon" + - task: "check-cpp-static-examples" + - task: "check-cpp-static-log-surgeon" - cpp-check: - sources: &cpp_source_files - - "{{.TASKFILE}}" - - ".clang-format" - - "examples/**/*.cpp" - - "examples/**/*.h" - - "examples/**/*.hpp" - - "examples/**/*.tpp" - - "src/**/*.cpp" - - "src/**/*.h" - - "src/**/*.hpp" - - "src/**/*.tpp" - - "tests/**/*.cpp" - - "tests/**/*.h" - - "tests/**/*.hpp" - - "tests/**/*.tpp" + check-cpp-format-examples: + cmds: + - task: "cpp-format-examples" + vars: + FLAGS: ["--dry-run"] + + check-cpp-format-log-surgeon: + cmds: + - task: "cpp-format-log-surgeon" + vars: + FLAGS: ["--dry-run"] + + check-cpp-static-examples: + # NOTE: We alias the fix task until we determine which clang-tidy fixes can be applied safely. + aliases: ["fix-cpp-static-examples"] + vars: + BUILD_DIR: "{{.G_EXAMPLES_DEBUG_BUILD_DIR}}" + sources: *examples_sources + deps: + - "cpp-lint-configs" + - task: "examples:generate" + vars: + BUILD_DIR: "{{.BUILD_DIR}}" + BUILD_TYPE: "debug" + - "venv" cmds: - - task: "cpp" + - task: "utils:cpp-lint:clang-tidy-find" vars: - FLAGS: "--dry-run" + EXCLUDE_PATTERNS: + - "buffer-parser.cpp" + - "intersect-test.cpp" + - "reader-parser.cpp" + FLAGS: + - "--config-file '{{.G_UTILS_CONFIGS_DIR}}/.clang-tidy'" + - "-p '{{.BUILD_DIR}}'" + OUTPUT_DIR: "{{.G_BUILD_DIR}}/lint-clang-tidy" + ROOT_PATHS: + ref: ".G_EXAMPLES_ROOT_PATHS" + VENV_DIR: "{{.G_LINT_VENV_DIR}}" - cpp-fix: - sources: *cpp_source_files + check-cpp-static-log-surgeon: + # NOTE: We alias the fix task until we determine which clang-tidy fixes can be applied safely. + aliases: ["fix-cpp-static-log-surgeon"] + vars: + BUILD_DIR: "{{.G_LOG_SURGEON_DEBUG_BUILD_DIR}}" + sources: *log_surgeon_sources + deps: + - "cpp-lint-configs" + - task: "log-surgeon:generate" + vars: + BUILD_DIR: "{{.BUILD_DIR}}" + BUILD_TYPE: "debug" + - "venv" cmds: - - task: "cpp" + - task: "utils:cpp-lint:clang-tidy-find" vars: - FLAGS: "-i" + EXCLUDE_PATTERNS: + - "log_surgeon/Buffer.hpp" + - "log_surgeon/BufferParser.cpp" + - "log_surgeon/BufferParser.hpp" + - "log_surgeon/Constants.hpp" + - "log_surgeon/FileReader.cpp" + - "log_surgeon/FileReader.hpp" + - "log_surgeon/finite_automata/Dfa.hpp" + - "log_surgeon/finite_automata/DfaState.hpp" + - "log_surgeon/finite_automata/Nfa.hpp" + - "log_surgeon/finite_automata/RegexAST.hpp" + - "log_surgeon/finite_automata/RegisterOperation.hpp" + - "log_surgeon/finite_automata/UnicodeIntervalTree.tpp" + - "log_surgeon/Lalr1Parser.hpp" + - "log_surgeon/Lalr1Parser.tpp" + - "log_surgeon/Lexer.hpp" + - "log_surgeon/Lexer.tpp" + - "log_surgeon/LogEvent.cpp" + - "log_surgeon/LogEvent.hpp" + - "log_surgeon/LogParser.cpp" + - "log_surgeon/LogParser.hpp" + - "log_surgeon/LogParserOutputBuffer.cpp" + - "log_surgeon/Parser.tpp" + - "log_surgeon/parser_types.cpp" + - "log_surgeon/parser_types.hpp" + - "log_surgeon/ParserAst.hpp" + - "log_surgeon/ParserInputBuffer.cpp" + - "log_surgeon/ParserInputBuffer.hpp" + - "log_surgeon/Reader.hpp" + - "log_surgeon/ReaderParser.cpp" + - "log_surgeon/ReaderParser.hpp" + - "log_surgeon/Schema.cpp" + - "log_surgeon/SchemaParser.cpp" + - "log_surgeon/SchemaParser.hpp" + - "log_surgeon/Token.cpp" + - "log_surgeon/Token.hpp" + - "log_surgeon/utils.hpp" + - "test-buffer-parser.cpp" + - "test-dfa.cpp" + - "test-lexer.cpp" + - "test-nfa.cpp" + - "test-regex-ast.cpp" + - "test-schema.cpp" + FLAGS: + - "--config-file '{{.G_UTILS_CONFIGS_DIR}}/.clang-tidy'" + - "-p '{{.BUILD_DIR}}'" + INCLUDE_FILENAME_PATTERNS: + - "*.cpp" + - "*.h" + - "*.hpp" + - "*.tpp" + OUTPUT_DIR: "{{.G_BUILD_DIR}}/lint-clang-tidy" + ROOT_PATHS: + ref: ".G_LOG_SURGEON_ROOT_PATHS" + VENV_DIR: "{{.G_LINT_VENV_DIR}}" - yaml: - aliases: - - "yaml-check" - - "yaml-fix" + check-yaml: + aliases: ["fix-yaml"] deps: ["venv"] cmds: - |- @@ -65,20 +177,75 @@ tasks: taskfiles/docs.yaml \ {{.TASKFILE}} - cpp: + fix: + cmds: + - task: "fix-cpp" + - task: "fix-yaml" + + fix-cpp: + cmds: + - task: "fix-cpp-format-examples" + - task: "fix-cpp-format-log-surgeon" + - task: "fix-cpp-static-examples" + - task: "fix-cpp-static-log-surgeon" + + fix-cpp-format-examples: + cmds: + - task: "cpp-format-examples" + vars: + FLAGS: ["-i"] + + fix-cpp-format-log-surgeon: + cmds: + - task: "cpp-format-log-surgeon" + vars: + FLAGS: ["-i"] + + cpp-lint-configs: + internal: true + cmd: "{{.ROOT_DIR}}/tools/yscope-dev-utils/exports/lint-configs/symlink-cpp-lint-configs.sh" + + cpp-format-examples: internal: true + label: "{{.TASK}}:{{.FLAGS}}" requires: vars: ["FLAGS"] - deps: ["venv"] + sources: *examples_sources + deps: + - "cpp-lint-configs" + - "venv" cmds: - - |- - . "{{.G_LINT_VENV_DIR}}/bin/activate" - find src examples tests \ - -type f \ - \( -iname "*.cpp" -o -iname "*.h" -o -iname "*.hpp" -o -iname "*.tpp" \) \ - ! -path "examples/*build*/*" \ - -print0 | \ - xargs -0 clang-format {{.FLAGS}} -Werror + - task: "utils:cpp-lint:clang-format" + vars: + FLAGS: + ref: ".FLAGS" + ROOT_PATHS: + ref: ".G_EXAMPLES_ROOT_PATHS" + VENV_DIR: "{{.G_LINT_VENV_DIR}}" + + cpp-format-log-surgeon: + internal: true + label: "{{.TASK}}:{{.FLAGS}}" + requires: + vars: + - "FLAGS" + sources: *log_surgeon_sources + deps: + - "cpp-lint-configs" + - "venv" + cmds: + - task: "utils:cpp-lint:clang-format" + vars: + FLAGS: + ref: ".FLAGS" + INCLUDE_FILENAME_PATTERNS: + - "*.cpp" + - "*.h" + - "*.hpp" + - "*.tpp" + ROOT_PATHS: + ref: ".G_LOG_SURGEON_ROOT_PATHS" + VENV_DIR: "{{.G_LINT_VENV_DIR}}" venv: internal: true @@ -86,9 +253,9 @@ tasks: CHECKSUM_FILE: "{{.G_BUILD_DIR}}/{{.TASK | replace \":\" \"#\"}}.md5" OUTPUT_DIR: "{{.G_LINT_VENV_DIR}}" sources: + - "{{.ROOT_DIR}}/lint-requirements.txt" - "{{.ROOT_DIR}}/taskfile.yaml" - "{{.TASKFILE}}" - - "{{.ROOT_DIR}}/lint-requirements.txt" generates: ["{{.CHECKSUM_FILE}}"] run: "once" deps: diff --git a/tools/init.sh b/tools/init.sh deleted file mode 100755 index d22bf78b..00000000 --- a/tools/init.sh +++ /dev/null @@ -1,21 +0,0 @@ -#!/usr/bin/env bash - -# Exit on any error -set -e - -# Error on undefined variable -set -u - -repo_dir="$(git rev-parse --show-toplevel)" -clang_tidy_config_src_relative_to_repo="tools/yscope-dev-utils/lint-configs/.clang-tidy" - -clang_tidy_config_src="${repo_dir}/${clang_tidy_config_src_relative_to_repo}" -clang_tidy_config_dst="${repo_dir}/.clang-tidy" -if [ ! -e "$clang_tidy_config_dst" ]; then - ln -s "$clang_tidy_config_src_relative_to_repo" "$clang_tidy_config_dst" -else - if [ "$(readlink -f "$clang_tidy_config_dst")" != "$(readlink -f "$clang_tidy_config_src")" ]; - then - echo "Unexpected clang-tidy config at $clang_tidy_config_dst" - fi -fi diff --git a/tools/yscope-dev-utils b/tools/yscope-dev-utils index 76aecbd6..b965f19f 160000 --- a/tools/yscope-dev-utils +++ b/tools/yscope-dev-utils @@ -1 +1 @@ -Subproject commit 76aecbd6d0db6e2078005431946b5c2e716c4291 +Subproject commit b965f19f3e11c548f32bf7ab8e28ff38906be018