/format.js (cbfc512d1033ac292b7274e0b66a57c4a97d081b) (521 bytes) (mode 100755) (type blob)
#!/usr/bin/env node
const { exec, print, stagedFiles } = require("./base"),
files = stagedFiles();
const cFiles = files.filter((file) => file.match(/.*\.(h|hxx|c|cpp|cxx)$/));
if (cFiles.length) {
const command = `clang-format -i --style=Webkit ${cFiles.join(" ")}`;
print(command);
exec(command);
}
const jsFiles = files.filter((file) => file.match(/.*\.js$/));
if (jsFiles.length > 1) {
const params = jsFiles.join(" "),
command = `npx prettier --write ${params}`;
print(command);
exec(command);
}
Mode |
Type |
Size |
Ref |
File |
100644 |
blob |
14 |
c2658d7d1b31848c3b71960543cb0368e56cd4c7 |
.gitignore |
100644 |
blob |
57 |
53c96310c475eeabc923002d22b12481321a1a3c |
.huskyrc |
100644 |
blob |
150 |
24603bc84536c2ea2571127fd6d192f00b0d33df |
README.md |
100644 |
blob |
1982 |
2775b7af64daafde69cd3c4909a7cefef1b11263 |
base.js |
100644 |
blob |
117 |
dddb23dbee0d00f884f5122718c2430e1528d42a |
editorconfig |
100755 |
blob |
521 |
cbfc512d1033ac292b7274e0b66a57c4a97d081b |
format.js |
100644 |
blob |
442 |
325ff7dfe345aa3879d9cf8624dd83057e94d5d7 |
gitconfig |
100755 |
blob |
493 |
ffd346f7297c21f2d0618219ac790b247672d510 |
install.js |
100755 |
blob |
131 |
07861adc8555d0b77774349c4ca9736d913a3b52 |
installJrnl.js |
100755 |
blob |
339 |
245612d1bb394c3f09a1974556ae45fe02742420 |
lint.js |
100644 |
blob |
288 |
2a557c2fc756e429ab31d0eec89e98bd50618681 |
marks_bashrc |
100644 |
blob |
19146 |
6ab24c86ec741ab08a5ad069ecb912ef6430608b |
package-lock.json |
100644 |
blob |
443 |
d0443e7a229c67c59abbe01767eaca145fd95b7c |
package.json |
100755 |
blob |
392 |
feded203040f85876c03557e7032bee51a87db6a |
pre-commit.js |
100644 |
blob |
65 |
0ad6279abbb0afdfa9e4363f89e3ea9e9d837400 |
vimrc |
Hints:
Before first commit, do not forget to setup your git environment:
git config --global user.name "your_name_here"
git config --global user.email "your@email_here"
Clone this repository using HTTP(S):
git clone https://rocketgit.com/user/mucbuc/configs
Clone this repository using ssh (do not forget to upload a key first):
git clone ssh://rocketgit@ssh.rocketgit.com/user/mucbuc/configs
Clone this repository using git:
git clone git://git.rocketgit.com/user/mucbuc/configs
You are allowed to anonymously push to this repository.
This means that your pushed commits will automatically be transformed into a
merge request:
... clone the repository ...
... make some changes and some commits ...
git push origin main