GithubHelp home page GithubHelp logo

Comments (23)

TheWolfNL avatar TheWolfNL commented on August 22, 2024 9

This project sets up hooks which will work when .git is in a parent directory

from pre-commit.

ai avatar ai commented on August 22, 2024 3

We need this fix in my project with lint-staged.

I think it is very important for big projects with monorepo, when you have client/ and server/ subdirs.

@3rd-Eden how I can help with this issue?

from pre-commit.

villelahdenvuo avatar villelahdenvuo commented on August 22, 2024

👍

from pre-commit.

davidchase avatar davidchase commented on August 22, 2024

👍

from pre-commit.

3rd-Eden avatar 3rd-Eden commented on August 22, 2024

@Swaagie Any thoughts on this? I'm neutral about it.

from pre-commit.

roman01la avatar roman01la commented on August 22, 2024

👍 I have different parts of the project in separate directories within a single repo, this will solve the issue.

from pre-commit.

3rd-Eden avatar 3rd-Eden commented on August 22, 2024

I guess we could make this functionality opt-in by specifying the max depth that we can search for a .git folder.

from pre-commit.

villelahdenvuo avatar villelahdenvuo commented on August 22, 2024

The only complication I can see, if I have multiple projects in a repository in subfolders that use pre-commit.

from pre-commit.

3rd-Eden avatar 3rd-Eden commented on August 22, 2024

@tuhoojabotti That's why I'm suggesting opt-in through a field in the package.json

from pre-commit.

villelahdenvuo avatar villelahdenvuo commented on August 22, 2024

Yeah, I don't see an issue with that, but would it be possible to run the pre-commit hooks of all packages in sub folders? For example if I have a package.json file for both my back-end and front-end I would like to run both pre-commit hooks before allowing commit.

from pre-commit.

metaman avatar metaman commented on August 22, 2024

👍

from pre-commit.

katmai7 avatar katmai7 commented on August 22, 2024

+1

from pre-commit.

trevordmiller avatar trevordmiller commented on August 22, 2024

+1

from pre-commit.

kosmotaur avatar kosmotaur commented on August 22, 2024

Happy to give it a shot and create a PR. Could I get a hint please which part of the code to start with?

EDIT: not going to do that, was easier to just change my directory structure 😜

from pre-commit.

3rd-Eden avatar 3rd-Eden commented on August 22, 2024

@kosmotaur Probably the installation script of this module: https://github.com/observing/pre-commit/blob/master/install.js#L23-L28 as it checks if the parent folder has .git

from pre-commit.

shaharmor avatar shaharmor commented on August 22, 2024

Btw, when using git submodules there will be a text file named .git in the same folder that will have a relative path inside to where the submodule real .git folder is.

Maybe this should be checked as well

from pre-commit.

medeeiros avatar medeeiros commented on August 22, 2024

👍

from pre-commit.

fabricemathis avatar fabricemathis commented on August 22, 2024

Hello, we suffer from the same issue here, and I would like to know if there is some kind of improvement to come (like the opt-in suggested by @3rd-Eden) ?

from pre-commit.

jacobangel avatar jacobangel commented on August 22, 2024

This would be a great feature, especially for use with mono-repo projects like Lerna. Is there any plans to merge #55, or ways we can pitch in?

from pre-commit.

fabm22 avatar fabm22 commented on August 22, 2024

+1 Has this been addressed somehow ?

Also, yes, to avoid any cross-OS issues a simple solution I guess would be to put a file calle .git-repo or something at the root where the node_modules folder is which would point to the root of the .git repo and simply fail if not found...

from pre-commit.

JakeCooper avatar JakeCooper commented on August 22, 2024

+1!

from pre-commit.

Alex-Sokolov avatar Alex-Sokolov commented on August 22, 2024

👍

from pre-commit.

nico-onmap avatar nico-onmap commented on August 22, 2024

I have a .git that's in a parent directory and it seems it's not detected by pre-commit which siletely fails when I installed it.

I tried creating a fake .git/hooks directory in the child directory where I run the npm installation and it works then.

Reading the comments I thought this was fixed?

from pre-commit.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.