diff --git a/src/http_handler.hpp b/src/http_handler.hpp index a3a7242..4247399 100644 --- a/src/http_handler.hpp +++ b/src/http_handler.hpp @@ -152,11 +152,10 @@ struct HttpHandler : ConnectionHandler { static int onMessageComplete(llhttp_t *parser); private: - static constexpr int kFinalStageThreads = 2; - static constexpr int kLogSize = 12; + static constexpr int lg_size = 16; StaticThreadPipeline, WaitStrategy::WaitIfUpstreamIdle, 1, 2> - pipeline{kLogSize}; + pipeline{lg_size}; std::thread stage0Thread; std::vector finalStageThreads; diff --git a/tools/check_snake_case.py b/tools/check_snake_case.py index bcd2f72..13e6fe8 100755 --- a/tools/check_snake_case.py +++ b/tools/check_snake_case.py @@ -42,6 +42,7 @@ def get_modified_lines(filepath): def check_snake_case_violations(filepath, check_new_only=True): """Check for camelCase violations in C++ code.""" violations = [] + seen_violations = {} # key: (file, line, col), value: camelCase name # Get modified lines if checking new code only modified_lines = get_modified_lines(filepath) if check_new_only else None @@ -107,17 +108,25 @@ def check_snake_case_violations(filepath, check_new_only=True): "([a-z0-9])([A-Z])", r"\1_\2", camel_case_name ).lower() - violations.append( - { - "file": filepath, - "line": line_num, - "column": match.start(1) + 1, - "type": violation_type, - "camelCase": camel_case_name, - "snake_case": snake_case, - "context": line.strip(), - } - ) + key = (filepath, line_num, match.start(1) + 1) + + # Only add if we haven't seen this exact violation before + if ( + key not in seen_violations + or seen_violations[key] != camel_case_name + ): + seen_violations[key] = camel_case_name + violations.append( + { + "file": filepath, + "line": line_num, + "column": match.start(1) + 1, + "type": violation_type, + "camelCase": camel_case_name, + "snake_case": snake_case, + "context": line.strip(), + } + ) return violations @@ -145,11 +154,9 @@ def main(): violations = check_snake_case_violations(filepath, args.check_new_code_only) if violations: - print(f"\n❌ {filepath}:") for v in violations: - print( - f" Line {v['line']}:{v['column']} - {v['type']} '{v['camelCase']}' should be '{v['snake_case']}'" - ) + print(f"\n❌ {filepath}:{v['line']}:{v['column']}") + print(f" {v['type']} '{v['camelCase']}' should be '{v['snake_case']}'") print(f" Context: {v['context']}") total_violations += len(violations)