Skip to content

Commit

Permalink
Try fix tidy errors
Browse files Browse the repository at this point in the history
  • Loading branch information
tgross35 committed Jun 24, 2024
1 parent 8bf7ae6 commit f78090e
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 8 deletions.
1 change: 0 additions & 1 deletion .clang-tidy
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
Checks: "clang-diagnostic-*,clang-analyzer-*,cppcoreguidelines-*,modernize-*,-modernize-use-trailing-return-type"
WarningsAsErrors: true
HeaderFilterRegex: ""
AnalyzeTemporaryDtors: false
FormatStyle: google
2 changes: 1 addition & 1 deletion bindings/debug.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ int main(int argc, char **argv) {

// Build a syntax tree based on source code stored in a string.
TSTree *tree = ts_parser_parse_string(parser, NULL, data, file_size);
TSNode root_node = ts_tree_root_node(tree);
// TSNode root_node = ts_tree_root_node(tree);
// assert(ts_node_child_count(root_node) > 0);

// Free all of the heap-allocated memory.
Expand Down
2 changes: 1 addition & 1 deletion justfile
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ _lint-min: _clone-repo-tree-sitter configure-compile-database
git ls-files '**.c' | \
grep -v 'parser\.c' | \
grep -v 'bindings/python' | \
xargs -IFNAME sh -c 'echo "\nchecking file FNAME" && clang-tidy FNAME'
xargs -IFNAME sh -c 'echo "\nchecking file FNAME" && clang-tidy --std=c11 FNAME'

# Run the linter for JS, C, Cargo, and Python. Requires clang-tidy, clippy, and ruff.
lint: _lint-min
Expand Down
10 changes: 5 additions & 5 deletions src/scanner.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,18 +25,18 @@
#ifdef DEBUG_PRINT
#define dbg_print(...) \
do { \
fprintf(stderr, " \033[96;1mparse: \033[0m"); \
fprintf(stderr, __VA_ARGS__); \
fprintf_s(stderr, " \033[96;1mparse: \033[0m"); \
fprintf_s(stderr, __VA_ARGS__); \
} while (0)
#else
#define dbg_print(...)
#endif

#define panic(...) \
do { \
fprintf(stderr, "panic at %s:%d: ", __FILE_NAME__, __LINE__); \
fprintf(stderr, __VA_ARGS__); \
fprintf(stderr, "\n"); \
fprintf_s(stderr, "panic at %s:%d: ", __FILE_NAME__, __LINE__); \
fprintf_s(stderr, __VA_ARGS__); \
fprintf_s(stderr, "\n"); \
exit(1); \
} while (0);

Expand Down

0 comments on commit f78090e

Please sign in to comment.