Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add check for #include of header file without path #1976

Open
meheff opened this issue Mar 5, 2025 · 1 comment · May be fixed by #1984
Open

Add check for #include of header file without path #1976

meheff opened this issue Mar 5, 2025 · 1 comment · May be fixed by #1984
Assignees
Labels
🧑‍🌾 gardener To be handed off to the next build gardener PR flow Problems related to the submission of PRs to the Google repo.

Comments

@meheff
Copy link
Collaborator

meheff commented Mar 5, 2025

From #1972

#include of file without directory:

#include "c_api_vast.h"
@meheff meheff added the PR flow Problems related to the submission of PRs to the Google repo. label Mar 5, 2025
@hzeller
Copy link
Member

hzeller commented Mar 5, 2025

In the CI, We need a script like

#!/bin/sh
find xls -name "*.h" -o -name "*.cc"  \
   | xargs egrep -n '#include "[^/]*"' \
   | egrep -v "synth_only|linenoise|%s|xls_fixed|xls_int"
if [ $? -eq 0 ]; then
  echo "::error:: always use a fully qualified name for #includes"
  exit 1 
fi

It would then generate an output like this

xls/public/c_api.cc:51:#include "c_api_vast.h"
::error:: always use a fully qualified name for #includes

The ::error:: makes it look highlighted in the CI log.

@hzeller hzeller added the 🧑‍🌾 gardener To be handed off to the next build gardener label Mar 5, 2025
@cdleary cdleary self-assigned this Mar 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🧑‍🌾 gardener To be handed off to the next build gardener PR flow Problems related to the submission of PRs to the Google repo.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants