33set -euo pipefail
44export JOB_NAME=linters
55
6- # shellcheck source-path =SCRIPTDIR/..
6+ # shellcheck source=SCRIPTDIR/tools/setup-bazel.sh
77source .buildkite/tools/setup-bazel.sh
88
99set -x
1010globalErr=0
1111
1212echo " ~~~ Checking build files"
13- if ! ./tools/scripts/format_build_files.sh -t > buildifier; then
13+ if ! ./tools/scripts/format_build_files.sh -t & > buildifier; then
1414 globalErr=1
1515 echo " ^^^ +++"
1616 buildkite-agent annotate --context tools/scripts/format_build_files.sh --style error --append < buildifier
1717fi
1818
1919echo " ~~~ Checking c++ formatting"
20- if ! ./tools/scripts/format_cxx.sh -td & > format_cxx; then
20+ if ! ./tools/scripts/format_cxx.sh -t & > format_cxx; then
2121 globalErr=1
2222 echo " ^^^ +++"
2323 buildkite-agent annotate --context tools/scripts/format_cxx.sh --style error --append < format_cxx
2424fi
2525
2626echo " ~~~ Checking that the compilation db builds"
27- if ! ./tools/scripts/build_compilation_db.sh > compdb; then
27+ if ! ./tools/scripts/build_compilation_db.sh & > compdb; then
2828 globalErr=1
2929 echo " ^^^ +++"
3030 buildkite-agent annotate --context tools/scripts/build_compilation_db.sh --style error --append < compdb
3131fi
3232
33- echo " ~~~ Checking compilation db targets"
34- if ! ./tools/scripts/generate_compdb_targets.sh -t & > compdb-targets; then
35- globalErr=1
36- echo " ^^^ +++"
37- buildkite-agent annotate --context tools/scripts/generate_compdb_targets.sh --style error --append < compdb-targets
38- fi
33+ # Skip this because bazel query is failing due to third-party stuff
34+ # echo "~~~ Checking compilation db targets"
35+ # if ! ./tools/scripts/generate_compdb_targets.sh -t &> compdb-targets; then
36+ # globalErr=1
37+ # echo "^^^ +++"
38+ # buildkite-agent annotate --context tools/scripts/generate_compdb_targets.sh --style error --append < compdb-targets
39+ # fi
3940
4041echo " ~~~ Linting uses of \` using namespace std\` "
4142if ! ./tools/scripts/check_using_namespace_std.sh & > std_check; then
@@ -58,59 +59,6 @@ if ! ./tools/scripts/lint_sh.sh -t &> lint_sh; then
5859 buildkite-agent annotate --context tools/scripts/lint_sh.sh --style error --append < lint_sh
5960fi
6061
61- echo " ~~~ Checking markdown formatting"
62- if ! ./tools/scripts/format_website.sh -t & > format_website; then
63- globalErr=1
64- echo " ^^^ +++"
65- buildkite-agent annotate --context tools/scripts/format_website.sh --style error --append < format_website
66- fi
67-
68- echo " ~~~ Checking protoc dependency"
69- ./bazel query " somepath(//main:sorbet, @com_google_protobuf//:protoc)" 2> /dev/null > protoc_dependency
70- if [ " $( wc -l protoc_dependency) " -ne 0 ]; then
71- globalErr=1
72- echo " ^^^ +++"
73- cat >> protoc_dependency << EOF
74-
75- There is a path to @com_google_protobuf//:protoc from //main:sorbet
76- Please remove it, as this represents a substantial regression in compile times.
77- EOF
78- buildkite-agent annotate --context " path to @com_google_protobuf//:protoc" --style error --append < protoc_dependency
79- fi
80-
81- if grep -n -r ' ^ \w*\.md' website & > lint_docusaurus_md; then
82- globalErr=1
83- echo " ^^^ +++"
84- buildkite-agent annotate --context " Docusaurus Link Reference Definitions" --style error --append << EOF
85- These markdown files have link reference definitions which split onto multiple lines.
86-
87- Prettier insists on splitting long link reference definitions onto multiple lines,
88- but Docusaurus fails to linkify these definitions.
89-
90- Rewrite these link reference definitions to be inline links to avoid broken links:
91-
92- \`\`\`
93- $( < lint_docusaurus_md)
94- \`\`\`
95- EOF
96- fi
97-
98- echo " ~~~ Checking the vscode extension"
99- pushd vscode_extension
100- yarn install
101- if ! yarn lint --output-file=yarn_lint; then
102- globalErr=1
103- echo " ^^^ +++"
104- buildkite-agent annotate --context ' yarn lint' --style error --append << EOF
105- There were eslint errors in vscode_extension/. Fix with:
106-
107- cd vscode_extension && yarn lint --fix
108-
109- $( < yarn_lint)
110- EOF
111- fi
112- popd
113-
11462echo " ~~~"
11563if [ " $globalErr " -ne 0 ]; then
11664 exit $globalErr
0 commit comments