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

Option to allow passing absolute file paths #354

Open
Alexnortung opened this issue Sep 14, 2023 · 1 comment
Open

Option to allow passing absolute file paths #354

Alexnortung opened this issue Sep 14, 2023 · 1 comment
Labels
enhancement New feature or request

Comments

@Alexnortung
Copy link

currently we have the pass_filenames, but in certain cases it would be nice if the passed file names could be absolute paths.

Use case:
We have a monorepo with multiple projects that use prettier. If we use the predefined prettier hook, then it would not recognize the plugins that have been enabled prettier since they are installed in the node_modules folder in a nested folder.
So I tried creating a custom hook, but then the file names would be something like project/file-to-format instead of just file-to-format or /absolute/path/project/file-to-format.

pre-commit.hooks = {
  # prettier.enable = true;
  prettier-nextjs = {
    enable = true;
    name = "Prettier Next.js";
    files = "nextjs\/*";
    entry = "${pnpm}/bin/pnpm --dir nextjs exec prettier --write";
  };
};

In my case if the files could have an absolute path instead of a relative one it would solve my issue.

@domenkozar domenkozar added the enhancement New feature or request label Oct 8, 2023
@sandydoo
Copy link
Member

sandydoo commented May 2, 2024

Upstream issue: pre-commit/pre-commit#2621

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants