Closed jeraki closed 3 months ago
I've similar issue with phpcbf. I need to run it from project root. My phpcs/phpcbf are dockerised tools, so Absolute path doesn't exist inside the container.
I thought CWD would help with this, but it doesn't
formatters = {
phpcbf = {
cwd = require("conform.util").root_file({ ".editorconfig", "composer.json" }),
},
}
You can now use the variable $RELATIVE_FILEPATH
in formatter args and it will be a relative path to the file from the cwd.
Did you check existing requests?
Describe the feature
Is there a config option to have Conform send a file path relative to the working directory to the formatter? Or alternatively, is there an equivalent of the special
$FILEPATH
argument that will use a relative path?I see in
conform.runner.build_context
, it's usingvim.api.nvim_buf_get_name
, which returns the absolute path, so I'm guessing it's not possible to do this currently, in which case consider this a feature request!Provide background
When I use Conform to format Ruby code with RuboCop, it fails and this error is returned by RuboCop:
What is the significance of this feature?
strongly desired
Additional details
No response