Skip to content

Commit

Permalink
Use common naming convention for files
Browse files Browse the repository at this point in the history
Dashes separate filename elements, while corresponding
tests are separated from the rest with _test.cc

Since file is renamed, use `git log --follow` to get
more history.
  • Loading branch information
hzeller committed Nov 23, 2024
1 parent ca2bc19 commit 6acd488
Show file tree
Hide file tree
Showing 1,155 changed files with 143,926 additions and 143,919 deletions.
7 changes: 7 additions & 0 deletions .github/bin/check-potential-problems.sh
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,13 @@ if [ $? -eq 0 ]; then
EXIT_CODE=1
fi

find common verilog -name "*.h" -o -name "*.cc" | grep _ | grep -v _test
if [ $? -eq 0 ]; then
echo "::error:: File naming-convention for c++ files is to use dashes as separator with underscore only in test files; e.g. foo-bar_test.cc"
echo
EXIT_CODE=1
fi

# bazelbuild/rules_python is broken as it downloads a dynamically
# linked pre-built binary - This makes it _very_ platform specific.
# This should either compile Python from scratch or use the local system Python.
Expand Down
92 changes: 46 additions & 46 deletions common/analysis/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ cc_library(

cc_library(
name = "lint-rule-status",
srcs = ["lint_rule_status.cc"],
hdrs = ["lint_rule_status.h"],
srcs = ["lint-rule-status.cc"],
hdrs = ["lint-rule-status.h"],
deps = [
":citation",
"//common/strings:line-column-map",
Expand All @@ -46,7 +46,7 @@ cc_library(

cc_library(
name = "lint-rule",
hdrs = ["lint_rule.h"],
hdrs = ["lint-rule.h"],
deps = [
":lint-rule-status",
"@com_google_absl//absl/status",
Expand All @@ -57,17 +57,17 @@ cc_library(
genlex(
name = "command-file-lex",
src = "command_file.lex",
out = "command_file.yy.cc",
out = "command-file.yy.cc",
)

cc_library(
name = "command-file-lexer",
srcs = [
"command_file.yy.cc",
"command_file_lexer.cc",
"command-file.yy.cc",
"command-file-lexer.cc",
],
hdrs = [
"command_file_lexer.h",
"command-file-lexer.h",
],
copts = select({
"@platforms//os:windows": [],
Expand All @@ -87,8 +87,8 @@ cc_library(

cc_library(
name = "violation-handler",
srcs = ["violation_handler.cc"],
hdrs = ["violation_handler.h"],
srcs = ["violation-handler.cc"],
hdrs = ["violation-handler.h"],
deps = [
":lint-rule-status",
"//common/strings:diff",
Expand All @@ -104,7 +104,7 @@ cc_library(
cc_test(
name = "command-file-lexer_test",
size = "small",
srcs = ["command_file_lexer_test.cc"],
srcs = ["command-file-lexer_test.cc"],
deps = [
":command-file-lexer",
"//common/lexer:lexer-test-util",
Expand All @@ -119,8 +119,8 @@ cc_test(

cc_library(
name = "lint-waiver",
srcs = ["lint_waiver.cc"],
hdrs = ["lint_waiver.h"],
srcs = ["lint-waiver.cc"],
hdrs = ["lint-waiver.h"],
deps = [
":command-file-lexer",
"//common/strings:comment-utils",
Expand All @@ -145,8 +145,8 @@ cc_library(

cc_library(
name = "file-analyzer",
srcs = ["file_analyzer.cc"],
hdrs = ["file_analyzer.h"],
srcs = ["file-analyzer.cc"],
hdrs = ["file-analyzer.h"],
deps = [
"//common/lexer",
"//common/lexer:token-stream-adapter",
Expand All @@ -167,8 +167,8 @@ cc_library(
cc_library(
name = "linter-test-utils",
testonly = 1,
srcs = ["linter_test_utils.cc"],
hdrs = ["linter_test_utils.h"],
srcs = ["linter-test-utils.cc"],
hdrs = ["linter-test-utils.h"],
deps = [
":lint-rule-status",
"//common/text:token-info",
Expand All @@ -185,8 +185,8 @@ cc_library(
cc_library(
name = "syntax-tree-search-test-utils",
testonly = 1,
srcs = ["syntax_tree_search_test_utils.cc"],
hdrs = ["syntax_tree_search_test_utils.h"],
srcs = ["syntax-tree-search-test-utils.cc"],
hdrs = ["syntax-tree-search-test-utils.h"],
deps = [
":syntax-tree-search",
"//common/lexer:lexer-test-util",
Expand All @@ -201,8 +201,8 @@ cc_library(

cc_library(
name = "line-linter",
srcs = ["line_linter.cc"],
hdrs = ["line_linter.h"],
srcs = ["line-linter.cc"],
hdrs = ["line-linter.h"],
deps = [
":line-lint-rule",
":lint-rule-status",
Expand All @@ -214,7 +214,7 @@ cc_library(
cc_library(
name = "line-linter-test-utils",
testonly = 1,
hdrs = ["line_linter_test_utils.h"],
hdrs = ["line-linter-test-utils.h"],
deps = [
":line-lint-rule",
":line-linter",
Expand All @@ -228,7 +228,7 @@ cc_library(

cc_library(
name = "line-lint-rule",
hdrs = ["line_lint_rule.h"],
hdrs = ["line-lint-rule.h"],
deps = [
":lint-rule",
"@com_google_absl//absl/strings:string_view",
Expand All @@ -237,8 +237,8 @@ cc_library(

cc_library(
name = "syntax-tree-linter",
srcs = ["syntax_tree_linter.cc"],
hdrs = ["syntax_tree_linter.h"],
srcs = ["syntax-tree-linter.cc"],
hdrs = ["syntax-tree-linter.h"],
deps = [
":lint-rule-status",
":syntax-tree-lint-rule",
Expand All @@ -253,7 +253,7 @@ cc_library(
cc_library(
name = "syntax-tree-linter-test-utils",
testonly = 1,
hdrs = ["syntax_tree_linter_test_utils.h"],
hdrs = ["syntax-tree-linter-test-utils.h"],
deps = [
":lint-rule-status",
":linter-test-utils",
Expand All @@ -267,7 +267,7 @@ cc_library(

cc_library(
name = "syntax-tree-lint-rule",
hdrs = ["syntax_tree_lint_rule.h"],
hdrs = ["syntax-tree-lint-rule.h"],
deps = [
":lint-rule",
"//common/text:concrete-syntax-leaf",
Expand All @@ -279,8 +279,8 @@ cc_library(

cc_library(
name = "syntax-tree-search",
srcs = ["syntax_tree_search.cc"],
hdrs = ["syntax_tree_search.h"],
srcs = ["syntax-tree-search.cc"],
hdrs = ["syntax-tree-search.h"],
deps = [
"//common/analysis/matcher",
"//common/analysis/matcher:bound-symbol-manager",
Expand All @@ -294,8 +294,8 @@ cc_library(

cc_library(
name = "text-structure-linter",
srcs = ["text_structure_linter.cc"],
hdrs = ["text_structure_linter.h"],
srcs = ["text-structure-linter.cc"],
hdrs = ["text-structure-linter.h"],
deps = [
":lint-rule-status",
":text-structure-lint-rule",
Expand All @@ -308,7 +308,7 @@ cc_library(
cc_library(
name = "text-structure-linter-test-utils",
testonly = 1,
hdrs = ["text_structure_linter_test_utils.h"],
hdrs = ["text-structure-linter-test-utils.h"],
deps = [
":lint-rule-status",
":linter-test-utils",
Expand All @@ -322,7 +322,7 @@ cc_library(

cc_library(
name = "text-structure-lint-rule",
hdrs = ["text_structure_lint_rule.h"],
hdrs = ["text-structure-lint-rule.h"],
deps = [
":lint-rule",
"//common/text:text-structure",
Expand All @@ -332,8 +332,8 @@ cc_library(

cc_library(
name = "token-stream-linter",
srcs = ["token_stream_linter.cc"],
hdrs = ["token_stream_linter.h"],
srcs = ["token-stream-linter.cc"],
hdrs = ["token-stream-linter.h"],
deps = [
":lint-rule-status",
":token-stream-lint-rule",
Expand All @@ -345,7 +345,7 @@ cc_library(
cc_library(
name = "token-stream-linter-test-utils",
testonly = 1,
hdrs = ["token_stream_linter_test_utils.h"],
hdrs = ["token-stream-linter-test-utils.h"],
deps = [
":lint-rule-status",
":linter-test-utils",
Expand All @@ -359,7 +359,7 @@ cc_library(

cc_library(
name = "token-stream-lint-rule",
hdrs = ["token_stream_lint_rule.h"],
hdrs = ["token-stream-lint-rule.h"],
deps = [
":lint-rule",
"//common/text:token-info",
Expand All @@ -368,7 +368,7 @@ cc_library(

cc_test(
name = "lint-rule-status_test",
srcs = ["lint_rule_status_test.cc"],
srcs = ["lint-rule-status_test.cc"],
deps = [
":lint-rule-status",
"//common/text:concrete-syntax-tree",
Expand All @@ -383,7 +383,7 @@ cc_test(

cc_test(
name = "lint-waiver_test",
srcs = ["lint_waiver_test.cc"],
srcs = ["lint-waiver_test.cc"],
deps = [
":lint-waiver",
"//common/strings:line-column-map",
Expand All @@ -399,7 +399,7 @@ cc_test(

cc_test(
name = "file-analyzer_test",
srcs = ["file_analyzer_test.cc"],
srcs = ["file-analyzer_test.cc"],
deps = [
":file-analyzer",
"//common/strings:line-column-map",
Expand All @@ -415,7 +415,7 @@ cc_test(

cc_test(
name = "linter-test-utils_test",
srcs = ["linter_test_utils_test.cc"],
srcs = ["linter-test-utils_test.cc"],
deps = [
":lint-rule-status",
":linter-test-utils",
Expand All @@ -429,7 +429,7 @@ cc_test(

cc_test(
name = "line-linter_test",
srcs = ["line_linter_test.cc"],
srcs = ["line-linter_test.cc"],
deps = [
":line-lint-rule",
":line-linter",
Expand All @@ -443,7 +443,7 @@ cc_test(

cc_test(
name = "syntax-tree-linter_test",
srcs = ["syntax_tree_linter_test.cc"],
srcs = ["syntax-tree-linter_test.cc"],
deps = [
":lint-rule-status",
":syntax-tree-lint-rule",
Expand All @@ -463,7 +463,7 @@ cc_test(

cc_test(
name = "syntax-tree-search_test",
srcs = ["syntax_tree_search_test.cc"],
srcs = ["syntax-tree-search_test.cc"],
deps = [
":syntax-tree-search",
"//common/analysis/matcher:matcher-builders",
Expand All @@ -478,7 +478,7 @@ cc_test(

cc_test(
name = "syntax-tree-search-test-utils_test",
srcs = ["syntax_tree_search_test_utils_test.cc"],
srcs = ["syntax-tree-search-test-utils_test.cc"],
deps = [
":syntax-tree-search",
":syntax-tree-search-test-utils",
Expand All @@ -493,7 +493,7 @@ cc_test(

cc_test(
name = "text-structure-linter_test",
srcs = ["text_structure_linter_test.cc"],
srcs = ["text-structure-linter_test.cc"],
deps = [
":lint-rule-status",
":text-structure-lint-rule",
Expand All @@ -509,7 +509,7 @@ cc_test(

cc_test(
name = "token-stream-linter_test",
srcs = ["token_stream_linter_test.cc"],
srcs = ["token-stream-linter_test.cc"],
deps = [
":lint-rule-status",
":token-stream-lint-rule",
Expand Down
Loading

0 comments on commit 6acd488

Please sign in to comment.