Increase buffer size to 1 << 16
Also improve camel case script
This commit is contained in:
@@ -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<std::unique_ptr<Connection>,
|
||||
WaitStrategy::WaitIfUpstreamIdle, 1, 2>
|
||||
pipeline{kLogSize};
|
||||
pipeline{lg_size};
|
||||
std::thread stage0Thread;
|
||||
std::vector<std::thread> finalStageThreads;
|
||||
|
||||
|
||||
@@ -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,6 +108,14 @@ def check_snake_case_violations(filepath, check_new_only=True):
|
||||
"([a-z0-9])([A-Z])", r"\1_\2", camel_case_name
|
||||
).lower()
|
||||
|
||||
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,
|
||||
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user