fix_lint was an alias for tidy_tcl (tclfmt only), so developers
who ran it before pushing were still surprised by tclint CI
failures like line-length.
Replace the alias with a script that delegates to tcl_tidy.sh
and tcl_lint_test.sh (DRY), shows git status, and exits with
a clear error if lint violations remain unfixed.
Update docs with POLA rationale and naming convention for
umbrella and per-language targets.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
The settings are already visible in tclint.toml itself (DRY),
and the listed exclusions were already stale.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
Document the new Bazel lint targets, usage, configuration, how to
add new linters, and planned additions (clang-tidy, clang-format,
ruff, buildifier, shellcheck, doc checks, duplicate ID checks).
Explain why Bazel is the right tool for managing linter dependencies:
hermetic, version-pinned, reproducible across dev machines and CI.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
For users who wish to add their own code to OpenROAD the exa module acts
as an example with
- Tcl & Python APIs with unit tests
- Debug graphics
Signed-off-by: Matt Liberty <mliberty@precisioninno.com>
Running clang-tidy is very slow and time consuming. We're already
running it as part of pull requests to incrementally point out
issues, but sometimes it would be good to see an overall summary
or simply a way to figure out which clang-tidy checks make
sense to keep.
This adds a new script to etc/ to allow running clang-tidy
in parallel, while also caching the results. So subsequent
runs only need to process files that have changed.
For simplicity, this script is written in C++, but it can
be invoked as a script as it is self-compiling. So it is
as simple as running
```
/bin/sh etc/run-clang-tidy-cached.cc
```
(or, with the executable bit set, you can invoke it
even simpler as `etc/run-clang-tidy-cached.cc`)
Note: The first time, before there is a cache built, this will
take a while.
This will generate two outputs
* `OpenRoad_clang-tidy.summary` tallies up all findings
and sorts them top first. This also allows to also
easily see if there are clang-tidy rules that we might
not be so interested in.
* `OpenRoad_clang-tidy.out` contains all the findings in
one file. This is neat to just put in the editor as
'compile output' and step through the results.
(Personally, I use 'cat OpenRoad_clang-tidy.out' as
`compile-command` in emacs, then it is simple to step
from issue to issue).
Since clang-tidy needs the compilation database, it is first
necessary to run `cmake` and make the comnpilation database
available in the toplevel directory (it not already):
```
ln -s build/compile_commands.json .
```
Here is a sample of the summary output running this
script over all files.
```
Details: OpenRoad_clang-tidy.out
Summary: OpenRoad_clang-tidy.summary
---- Summary ----
2339 [modernize-use-nullptr]
1360 [modernize-use-default-member-init]
609 [readability-else-after-return]
549 [performance-avoid-endl]
464 [modernize-use-override]
451 [modernize-macro-to-enum]
391 [readability-inconsistent-declaration-parameter-name]
356 [modernize-use-using]
351 [readability-redundant-casting]
343 [clang-analyzer-security.insecureAPI.strcpy]
327 [modernize-deprecated-headers]
304 [clang-diagnostic-error]
262 [performance-enum-size]
252 [performance-unnecessary-value-param]
242 [bugprone-suspicious-string-compare]
211 [google-runtime-int]
176 [readability-avoid-const-params-in-decls]
153 [modernize-use-emplace]
152 [google-readability-namespace-comments]
129 [modernize-use-equals-default]
117 [clang-analyzer-deadcode.DeadStores]
108 [google-build-using-namespace]
91 [modernize-use-bool-literals]
88 [readability-braces-around-statements]
87 [readability-const-return-type]
84 [bugprone-multi-level-implicit-pointer-conversion]
82 [readability-redundant-member-init]
78 [bugprone-implicit-widening-of-multiplication-result]
73 [bugprone-switch-missing-default-case]
70 [bugprone-reserved-identifier]
67 [misc-unused-using-decls]
64 [google-default-arguments]
62 [readability-redundant-declaration]
60 [bugprone-assignment-in-if-condition]
60 [modernize-loop-convert]
48 [readability-suspicious-call-argument]
46 [clang-analyzer-unix.Malloc]
...long tail...
```
The script is maintained in https://github.com/hzeller/dev-tools
and just copied as-is to etc/ with the only change to run the local
clang-format and change the start directory in the configuration
direction to be `src/`.
Signed-off-by: Henner Zeller <h.zeller@acm.org>
Also, remove harmful setup instructions:
"sudo etc/DependencyInstaller.sh" will install things into
/usr/local that e.g. messes up your cmake if you are
on Ubuntu.
Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>