You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Buildifier looks for .buildifier.json starting from the current directory and traversing up to the workspace root. However, the paths specified in .buildifier.json for Tables and AddTables are used "as-is," which can lead to issues when running buildifier from a subdirectory.
If buildifier is run from the root directory (buildifier -r .), there is no issue.
If buildifier is run from the foo subdirectory (cd foo && buildifier), the following error occurs:
buildifier: failed to parse .buildifier-tables.json for -add_tables: open .buildifier-tables.json: The system cannot find the file specified.
In this case, buildifier successfully finds .buildifier.json, but cannot locate the .buildifier-tables.json file, even though it is in the same directory as .buildifier.json.
Examples:
I have created an example project to demonstrate the problem and validate a solution. You can find it here:
Buildifier should be able to find .buildifier-tables.json regardless of the directory from which it is run, or it should provide a way to resolve this issue without requiring a full path to the file.
The text was updated successfully, but these errors were encountered:
Description:
Buildifier
looks for.buildifier.json
starting from the current directory and traversing up to the workspace root. However, the paths specified in.buildifier.json
forTables
andAddTables
are used "as-is," which can lead to issues when runningbuildifier
from a subdirectory.Example project structure:
.buildifier.json
content:Steps to reproduce:
buildifier
is run from theroot
directory (buildifier -r .
), there is no issue.buildifier
is run from thefoo
subdirectory (cd foo && buildifier
), the following error occurs:buildifier
successfully finds.buildifier.json
, but cannot locate the.buildifier-tables.json
file, even though it is in the same directory as.buildifier.json
.Examples:
I have created an example project to demonstrate the problem and validate a solution. You can find it here:
Expected behavior:
Buildifier
should be able to find.buildifier-tables.json
regardless of the directory from which it is run, or it should provide a way to resolve this issue without requiring a full path to the file.The text was updated successfully, but these errors were encountered: