Skip to content

Use current directory to resolve includes#24

Merged
jparise merged 1 commit intomainfrom
include-paths
Aug 3, 2021
Merged

Use current directory to resolve includes#24
jparise merged 1 commit intomainfrom
include-paths

Conversation

@jparise
Copy link
Copy Markdown
Collaborator

@jparise jparise commented Aug 3, 2021

We were previously using the including file's name, which I mistakenly
thought was the thrift compiler's behavior. We instead need to add the
current directory as the first search path to match thrift.

This change also adds support for absolute paths and makes consistent
use of the path/filepath package for better cross-platform support.

We were previously using the including file's name, which I mistakenly
thought was the `thrift` compiler's behavior. We instead need to add the
current directory as the first search path to match `thrift`.

This change also adds support for absolute paths and makes consistent
use of the `path/filepath` package for better cross-platform support.
@jparise jparise added the bug Something isn't working label Aug 3, 2021
@jparise jparise merged commit 89668b1 into main Aug 3, 2021
@jparise jparise deleted the include-paths branch August 3, 2021 19:01
jparise added a commit that referenced this pull request Aug 27, 2021
This reverts part of the changes introduced in #24: we want to include
the file's directory in our search path, not the process's current
working directory.

In fixing this, I realized that we can simply build the list of search
directories once as part of the linting context. This further simplifies
the downstream code while also making this less error prone.
jparise added a commit that referenced this pull request Aug 27, 2021
This reverts part of the changes introduced in #24: we want to include
the file's directory in our search path, not the process's current
working directory.

In fixing this, I realized that we can simply build the list of search
directories once as part of the linting context. This further simplifies
the downstream code while also making this less error prone.
Tiny-Box pushed a commit to Tiny-Box/thriftcheck that referenced this pull request Feb 22, 2023
We were previously using the including file's name, which I mistakenly
thought was the `thrift` compiler's behavior. We instead need to add the
current directory as the first search path to match `thrift`.

This change also adds support for absolute paths and makes consistent
use of the `path/filepath` package for better cross-platform support.
Tiny-Box pushed a commit to Tiny-Box/thriftcheck that referenced this pull request Feb 22, 2023
This reverts part of the changes introduced in pinterest#24: we want to include
the file's directory in our search path, not the process's current
working directory.

In fixing this, I realized that we can simply build the list of search
directories once as part of the linting context. This further simplifies
the downstream code while also making this less error prone.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant