Skip to content

Commit 63efee6

Browse files
committed
tidy round1
1 parent 0a8a86d commit 63efee6

328 files changed

Lines changed: 2945 additions & 3356 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.clang-tidy

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
Checks: >
2+
clang-diagnostic-*,
3+
clang-analyzer-*,
4+
-clang-analyzer-core.NonNullParamChecker,
5+
-clang-analyzer-core.CallAndMessage,
6+
-clang-analyzer-core.uninitialized.UndefReturn,
7+
-clang-analyzer-cplusplus.NewDeleteLeaks,
8+
-clang-analyzer-optin.performance.Padding,
9+
readability-*,
10+
-readability-identifier-naming,
11+
-readability-braces-around-statements,
12+
-readability-convert-member-functions-to-static,
13+
-readability-else-after-return,
14+
-readability-function-cognitive-complexity,
15+
-readability-inconsistent-ifelse-braces,
16+
-readability-identifier-length,
17+
-readability-implicit-bool-conversion,
18+
-readability-isolate-declaration,
19+
-readability-magic-numbers,
20+
-readability-make-member-function-const,
21+
-readability-math-missing-parentheses,
22+
-readability-named-parameter,
23+
-readability-qualified-auto,
24+
-readability-redundant-access-specifiers,
25+
-readability-simplify-boolean-expr,
26+
-readability-static-definition-in-anonymous-namespace,
27+
-readability-suspicious-call-argument,
28+
-readability-uppercase-literal-suffix,
29+
-readability-use-anyofallof,
30+
google-*,
31+
-google-readability-avoid-underscore-in-googletest-name,
32+
-google-readability-braces-around-statements,
33+
-google-readability-casting,
34+
-google-readability-todo,
35+
-google-runtime-references,
36+
-google-explicit-constructor,
37+
performance-*,
38+
-performance-enum-size,
39+
bugprone-*,
40+
-bugprone-branch-clone,
41+
-bugprone-easily-swappable-parameters,
42+
-bugprone-exception-escape,
43+
-bugprone-macro-parentheses,
44+
-bugprone-move-forwarding-reference,
45+
-bugprone-narrowing-conversions,
46+
-bugprone-suspicious-missing-comma,
47+
-bugprone-throwing-static-initialization,
48+
modernize-*,
49+
-modernize-avoid-bind,
50+
-modernize-avoid-c-arrays,
51+
-modernize-concat-nested-namespaces,
52+
-modernize-macro-to-enum,
53+
-modernize-pass-by-value,
54+
-modernize-raw-string-literal,
55+
-modernize-return-braced-init-list,
56+
-modernize-use-auto,
57+
-modernize-use-nodiscard,
58+
-modernize-use-trailing-return-type,
59+
-modernize-use-transparent-functors,
60+
misc-*,
61+
-misc-const-correctness,
62+
-misc-no-recursion,
63+
-misc-non-private-member-variables-in-classes,
64+
-misc-redundant-expression,
65+
-misc-unused-parameters,
66+
-misc-use-anonymous-namespace,
67+
-misc-use-internal-linkage,
68+
-misc-include-cleaner
69+
70+
# Only report diagnostics in headers under this tree (app/, include/sta/, build-generated
71+
# headers, etc.).
72+
# Excludes system and third-party paths such as /opt/local/include.
73+
HeaderFilterRegex: '.*/(app|cmake|dcalc|graph|liberty|network|parasitics|power|sdc|sdf|search|spice|tcl|util|verilog|include/sta|build/include/sta)/.*'
74+
75+
# Bison-generated parser headers (build/{Liberty,Verilog,...}Parse.hh); gzstream (e.g. util/gzstream.hh).
76+
ExcludeHeaderFilterRegex: '.*/(gzstream\.h(?:h)?|(?:Liberty|Verilog|Sdf|Spef|Saif|LibExpr)Parse\.hh)$'
77+
FormatStyle: none

.cursor/rules/cpp-coding-standards.mdc

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,29 @@ alwaysApply: false
3131

3232
- C++ source: `.cc`
3333
- C++ headers: `.hh`
34+
35+
## Include order
36+
37+
Sort `#include` lines **lexicographically by the path inside** `<>`
38+
or `""` (case-sensitive). Separate **groups** with a single blank line.
39+
40+
### Translation units (`*.cc`)
41+
42+
1. **Primary header(s)** for this file only:
43+
- `#include "Stem.hh"` where `Stem` matches the basename of the `.cc` file (e.g. `Foo.cc` → `Foo.hh`).
44+
- If the file uses a paired private header, include `#include "StemPvt.hh"` **immediately after** `Stem.hh` (e.g. `MakeTimingModel.cc` → `MakeTimingModel.hh` then `MakeTimingModelPvt.hh`).
45+
- Do **not** pull in other headers just because their names share a prefix with `Stem` (e.g. `SearchClass.hh` is not a “primary” include for `Search.cc`; it belongs in the project group below).
46+
47+
2. **System / standard library** headers: `#include <...>` lines, sorted alphabetically.
48+
49+
3. **All other project** headers: `#include "..."` lines, sorted alphabetically (including `search/Crpr.hh`-style paths and includes from `liberty/`, etc.).
50+
51+
If a **comment or special block** intentionally splits the include list (e.g. a third-party note before `#include "cudd.h"`), keep that structure; sort only within each contiguous run of `#include` lines unless merging groups is clearly safe.
52+
53+
### Headers (`*.hh`)
54+
55+
After `#pragma once` (and the file’s license block, if present):
56+
57+
1. **System** `#include <...>` lines, sorted alphabetically.
58+
59+
2. **Project** `#include "..."` lines, sorted alphabetically.

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# OpenSTA, Static Timing Analyzer
2-
# Copyright (c) 2025, Parallax Software, Inc.
2+
# Copyright (c) 2026, Parallax Software, Inc.
33
#
44
# This program is free software: you can redistribute it and/or modify
55
# it under the terms of the GNU General Public License as published by

app/StaMain.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,4 +148,4 @@ unencode(const char *inits[])
148148
return unencoded;
149149
}
150150

151-
} // namespace
151+
} // namespace sta

dcalc/ArcDcalcWaveforms.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,4 +83,4 @@ ArcDcalcWaveforms::inputWaveform(ArcDcalcArg &dcalc_arg,
8383
return Waveform();
8484
}
8585

86-
} // namespace
86+
} // namespace sta

dcalc/ArcDcalcWaveforms.hh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,5 +51,5 @@ protected:
5151
const StaState *sta);
5252
};
5353

54-
} // namespace
54+
} // namespace sta
5555

dcalc/ArcDelayCalc.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ ArcDcalcArg::ArcDcalcArg(const Pin *in_pin,
135135
const Pin *drvr_pin,
136136
Edge *edge,
137137
const TimingArc *arc,
138-
const Slew in_slew,
138+
Slew in_slew,
139139
float load_cap,
140140
const Parasitic *parasitic) :
141141
in_pin_(in_pin),
@@ -305,4 +305,4 @@ ArcDcalcResult::setLoadSlew(size_t load_idx,
305305
load_slews_[load_idx] = load_slew;
306306
}
307307

308-
} // namespace
308+
} // namespace sta

dcalc/Arnoldi.hh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,4 +86,4 @@ struct timing_table
8686
float in_slew;
8787
};
8888

89-
} // namespace
89+
} // namespace sta

dcalc/ArnoldiDelayCalc.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1488,4 +1488,4 @@ ArnoldiDelayCalc::ar1_ceff_delay(delay_work *D,
14881488
}
14891489
}
14901490

1491-
} // namespace
1491+
} // namespace sta

dcalc/ArnoldiDelayCalc.hh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,4 @@ class StaState;
3232
ArcDelayCalc *
3333
makeArnoldiDelayCalc(StaState *sta);
3434

35-
} // namespace
35+
} // namespace sta

0 commit comments

Comments
 (0)