chatie / git-scripts Goto Github PK
View Code? Open in Web Editor NEWGit Hooks Integration for Chatie Projects
Home Page: https://npmjs.com/package/@chatie/git-scripts
License: Apache License 2.0
Git Hooks Integration for Chatie Projects
Home Page: https://npmjs.com/package/@chatie/git-scripts
License: Apache License 2.0
We seem to rarely use tags, and npm version
in the push hook will create new tags by default. And tags only exist in the local record and will not be uploaded to the remote repo. The tags are displayed in the git log, which is annoying.
So I think tag should not be created in push hook.
The --no-git-tag-version
flag can be added to npm version
to skip creating tags.
问题原因:^在window是特殊字符。
解决方法:git reset –hard HEAD”^”或git reset –hard “HEAD^”或git reset –hard HEAD~1
如果你git log只有一个提交,会出现:fatal: ambiguous argument 'HEAD~1': unknown revision or path not in the working tree. Use '--' to separate paths from revisions, like this: 'git <command> [<revision>...] -- [<file>...]'
Line 62 in 67b2522
refer to:
✘ binsee@shanmudeMBP15 > ~/CodeWork/puppet-xp > > fix-git-scripts ± > git push
[Step-1] Checking last commit...
[Step-2] Checking lint...
Error:
------------------------------------------
------------------------------------------
Failed to exec pre-push hook script
error: 无法推送一些引用到 'github.com:binsee/puppet-xp.git'
Running npm lint fails with no error message
✘ binsee@shanmudeMBP15 > ~/CodeWork/puppet-xp > > fix-git-scripts ± > npm run lint
> [email protected] lint
> npm run lint:es && npm run lint:ts && npm run lint:md
> [email protected] lint:es
> eslint "src/**/*.ts" "tests/**/*.spec.ts" --ignore-pattern tests/fixtures/
=============
WARNING: You are currently running a version of TypeScript which is not officially supported by @typescript-eslint/typescript-estree.
You may find that it works just fine, or you may not.
SUPPORTED TYPESCRIPT VERSIONS: >=3.3.1 <4.5.0
YOUR TYPESCRIPT VERSION: 4.5.5
Please only submit bug reports when using the officially supported version.
=============
> [email protected] lint:ts
> tsc --isolatedModules --noEmit
examples/ding-dong-bot.ts:113:5 - error TS2339: Property 'talkerId' does not exist on type 'MessagePayload'.
113 talkerId,
~~~~~~~~
src/puppet-xp.ts:307:7 - error TS2322: Type '{ id: string; roomId: string; talkerId: string; text: string; timestamp: number; toId: string; type: PUPPET.type.Message.Unknown | PUPPET.type.Message.Audio | PUPPET.type.Message.Contact | ... 4 more ... | PUPPET.type.Message.Video; }' is not assignable to type 'MessagePayload'.
Object literal may only specify known properties, and 'talkerId' does not exist in type 'MessagePayload'.
307 talkerId,
~~~~~~~~
Found 2 errors.
✘ binsee@shanmudeMBP15 > ~/CodeWork/puppet-xp > > fix-git-scripts ± > npm run lint:ts
> [email protected] lint:ts
> tsc --isolatedModules --noEmit
examples/ding-dong-bot.ts:113:5 - error TS2339: Property 'talkerId' does not exist on type 'MessagePayload'.
113 talkerId,
~~~~~~~~
src/puppet-xp.ts:307:7 - error TS2322: Type '{ id: string; roomId: string; talkerId: string; text: string; timestamp: number; toId: string; type: PUPPET.type.Message.Unknown | PUPPET.type.Message.Audio | PUPPET.type.Message.Contact | ... 4 more ... | PUPPET.type.Message.Video; }' is not assignable to type 'MessagePayload'.
Object literal may only specify known properties, and 'talkerId' does not exist in type 'MessagePayload'.
307 talkerId,
~~~~~~~~
Found 2 errors.
✘ binsee@shanmudeMBP15 > ~/CodeWork/puppet-xp > > fix-git-scripts ± > npm run lint:ts > /dev/null
So, error message for tsc --isolatedModules --noEmit
not output to stderr, but output to stdout.
We need to be compatible with the message output to stdout when stderr has no message.
🚨 You need to enable Continuous Integration on Greenkeeper branches of this repository. 🚨
To enable Greenkeeper, you need to make sure that a commit status is reported on all branches. This is required by Greenkeeper because it uses your CI build statuses to figure out when to notify you about breaking changes.
Since we didn’t receive a CI status on the greenkeeper/initial
branch, it’s possible that you don’t have CI set up yet. We recommend using Travis CI, but Greenkeeper will work with every other CI service as well.
If you have already set up a CI for this repository, you might need to check how it’s configured. Make sure it is set to run on all new branches. If you don’t want it to run on absolutely every branch, you can whitelist branches starting with greenkeeper/
.
Once you have installed and configured CI on this repository correctly, you’ll need to re-trigger Greenkeeper’s initial pull request. To do this, please click the 'fix repo' button on account.greenkeeper.io.
~/puppet-xp test ± git push
node:internal/modules/cjs/loader:936
throw err;
^
Error: Cannot find module '../package.json'
Require stack:
- ~/puppet-xp/node_modules/@chatie/git-scripts/dist/bin/pre-push.js
at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)
at Function.Module._load (node:internal/modules/cjs/loader:778:27)
at Module.require (node:internal/modules/cjs/loader:1005:19)
at require (node:internal/modules/cjs/helpers:102:18)
at Object.<anonymous> (~/puppet-xp/node_modules/@chatie/git-scripts/dist/bin/pre-push.js:48:24)
at Module._compile (node:internal/modules/cjs/loader:1103:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1155:10)
at Module.load (node:internal/modules/cjs/loader:981:32)
at Function.Module._load (node:internal/modules/cjs/loader:822:12)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:77:12) {
code: 'MODULE_NOT_FOUND',
requireStack: [
'/Users/binsee/CodeWork/puppet-xp/node_modules/@chatie/git-scripts/dist/bin/pre-push.js'
]
}
Failed to exec pre-push hook script
error: failed to push some refs to 'github.com:binsee/puppet-xp.git'
RxJS has a very nice error message to let users know how to skip the pre-push
hook, so do us.
husky > commit-msg hook failed (add --no-verify to bypass)
$ git commit -m 'fixx(fromEvent): clean fromEvent.ts code to make sure its clean'
husky > pre-commit (node v16.3.0)
✔ Preparing...
✔ Running tasks...
✔ Applying modifications...
✔ Cleaning up...
husky > commit-msg (node v16.3.0)
INVALID COMMIT MSG: "fixx" is not allowed type ! Valid types are: feat, fix, docs, style, refactor, perf, test, build, ci, chore, revert
fixx(fromEvent): clean fromEvent.ts code to make sure its clean
husky > commit-msg hook failed (add --no-verify to bypass)
CC @lucifer1004
In some projects, lint is problematic. And it may not be repaired in a short time, then push will be block.
E.g. #29
It would be useful to have a SKIP_LINT=1
option to skip lint checks.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.