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

Resolve absolute path to operatorsFile #117

Merged
merged 1 commit into from
Dec 8, 2023
Merged

Resolve absolute path to operatorsFile #117

merged 1 commit into from
Dec 8, 2023

Conversation

natefaubion
Copy link
Owner

Fixes #115

Custom operatorsFile configs in .tidyrc were not resolving correctly. Previously we were using relative dir operatorsFile, but if operatorsFile was a relative path (which is the common case), then the behavior of relative is to treat operatorsFile as relative to cwd initially (I think it's an error that relative is typed as a pure function). Thus, this only works (reduntantly) if cwd is the same as the .tidyrc.json parent directory.

We should be using resolve [ dir ] instead to get an absoute path.

Fixes #115

Custom `operatorsFile` configs in .tidyrc were not resolving correctly.
Previously we were using `relative dir operatorsFile`, but if
`operatorsFile` was a relative path (which is the common case), then the
behavior of `relative` is to treat `operatorsFile` as relative to
`cwd` initially (I think it's an error that `relative` is typed as a pure
function). Thus, this only works (reduntantly) if `cwd` is the same as the
`.tidyrc.json` parent directory.

We should be using `resolve [ dir ]` instead to get an absoute path.
@natefaubion natefaubion merged commit 4630755 into main Dec 8, 2023
1 check passed
@natefaubion natefaubion deleted the nf/fix-115 branch December 8, 2023 17:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Incorrect resolving of operatorsFile path
1 participant