Comments (23)
This project sets up hooks which will work when .git is in a parent directory
from pre-commit.
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.
👍
from pre-commit.
👍
from pre-commit.
@Swaagie Any thoughts on this? I'm neutral about it.
from pre-commit.
👍 I have different parts of the project in separate directories within a single repo, this will solve the issue.
from pre-commit.
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.
The only complication I can see, if I have multiple projects in a repository in subfolders that use pre-commit.
from pre-commit.
@tuhoojabotti That's why I'm suggesting opt-in through a field in the package.json
from pre-commit.
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.
👍
from pre-commit.
+1
from pre-commit.
+1
from pre-commit.
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.
@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.
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.
👍
from pre-commit.
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.
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.
+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.
+1!
from pre-commit.
👍
from pre-commit.
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)
- Add environment variable
- doesn't work with vue-cli v3.x HOT 1
- Error on windows commit (hook: line 49: : command not found) HOT 9
- Document how to turn this off permanently HOT 3
- install.js doesn't work with link file of .git.
- Question: Prevent pre-commit hook to continue on committing? HOT 5
- Does not find correct root. HOT 1
- Doesn't find git root when inside a submodule
- Commit f25888f doesnt seem to have been pushed to npm
- How to make pre-commit works just with npm ci?
- can't find any error detail HOT 1
- How to run pre-commit hook in docker container?
- make it compatible with yarn pnp
- [Bug] pre-commit don't work HOT 1
- pre-commit
- chmod 777 breaks CIS 6.1.10 (ensure no world writable files)
- [BUG] Install with --force Flag Overwrites pre-commit.old
- Is there any relationship with pre-commit.com?
- Package maintainance HOT 4
- pre-commit hook not working on macos
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pre-commit.