gitalias: add more rules

Summary:
 - add !command in correct sections to prevent mistakes
 - alphabetize
 - `diffs` for `diff --staged`
 - `prod` to quick deploy to `prod` branch for some repos.
 - `staash` for `stash -a`

also:
 - add `max_line_length: 80` to editorconfig
 - autofix `TXT1` rule for `.arclint`
 - `rerere.autoUpdate = tru` for `gitconfig`
 - add prettier
 - fix nfty.yml
 - add `.yamllint` config

Signed-off-by: Yongmin Hong <revi@omglol.email>

Test Plan: I think there isn't?

Reviewers: O1 revi & automations, revi

Reviewed By: O1 revi & automations, revi

Differential Revision: https://issuetracker.revi.xyz/D211
This commit is contained in:
revi 2024-06-08 16:25:13 +09:00
parent da1e5b8acb
commit d5b6e05a86
Signed by: revi
GPG key ID: 1EB4F6CEEA100E94
8 changed files with 90 additions and 17 deletions

View file

@ -29,7 +29,7 @@
"type": "text", "type": "text",
"text.max-line-length": 80, "text.max-line-length": 80,
"severity": { "severity": {
"1": "advice", "1": "autofix",
"2": "advice", "2": "advice",
"3": "advice", "3": "advice",
"5": "disabled" "5": "disabled"

View file

@ -4,8 +4,3 @@ backends:
- matrix - matrix
pushover: pushover:
user_key: [REDACTED] user_key: [REDACTED]
matrix:
url: "https://matrix.revi.xyz"
roomId: "#devops:revi.xyz"
userId: "REDACTED"
password: "REDACTED"

View file

@ -10,4 +10,5 @@ end_of_line = lf
indent_size = 2 indent_size = 2
indent_style = space indent_style = space
insert_final_newline = true insert_final_newline = true
max_line_length = 80
trim_trailing_whitespace = true trim_trailing_whitespace = true

View file

@ -2,26 +2,36 @@
# SPDX-License-Identifier: Apache-2.0 # SPDX-License-Identifier: Apache-2.0
[alias] [alias]
# some project uses `master` and some uses `main` for the default. # some project uses `master` and some uses `main` for the default.
# since their first two letters are both ma, use the last char. # since their first two letters are both ma, use the last char
acm = commit -a -s # which is either `r` for master or `n` for main.
# a-d
# a-l
# a-p
# a-w
aal = add * aal = add *
acm = commit -a -s
amend = commit --amend amend = commit --amend
amendss = commit --amend -S -s
amends = commit --amend -s amends = commit --amend -s
amendss = commit --amend -S -s
# arcd
# arcl
# arcp
# arcw
br = branch -v br = branch -v
brd = branch -d brd = branch -d
brD = branch -D brD = branch -D
cob = checkout -b cm = commit -s
cmt = commit -S -s
co = checkout co = checkout
cob = checkout -b
com = !echo 'ERROR: use cor for master, and con for main.' com = !echo 'ERROR: use cor for master, and con for main.'
comn = checkout main comn = checkout main
comr = checkout master comr = checkout master
cm = commit -s
cmt = commit -S -s
count = count-objects -vH count = count-objects -vH
diffs = diff --staged
fa = fetch --all fa = fetch --all
fup = fetch upstream
fo = fetch origin fo = fetch origin
fup = fetch upstream
graph = log --pretty=format:\"%h %s\" --graph graph = log --pretty=format:\"%h %s\" --graph
osync = !echo 'ERROR: use osyncr for master, and osyncm for main.' osync = !echo 'ERROR: use osyncr for master, and osyncm for main.'
osyncn = rebase origin/main osyncn = rebase origin/main
@ -29,17 +39,19 @@
po= !echo 'ERROR: use por for master, and pon for main.' po= !echo 'ERROR: use por for master, and pon for main.'
pon = push origin main pon = push origin main
por = push origin master por = push origin master
prod = !git checkout prod && git rebase origin/master && git push origin prod && git checkout master
st = status st = status
staash = stash -a
usync = !echo 'ERROR: use usyncr for master, and usyncn for main.' usync = !echo 'ERROR: use usyncr for master, and usyncn for main.'
usyncn = rebase upstream/main usyncn = rebase upstream/main
usyncr = rebase upstream/master usyncr = rebase upstream/master
# below are non-git command, signified via `!` in the comment # below are non-git command, signified via `!` in the comment
# https://issuetracker.revi.xyz/u/gitalias # https://issuetracker.revi.xyz/u/gitalias
arcd = !arc diff
a-d = !arc diff a-d = !arc diff
arcl = !arc land arcd = !arc diff
a-l = !arc land a-l = !arc land
arcp = !arc patch arcl = !arc land
a-p = !arc patch a-p = !arc patch
arcw = !arc work arcp = !arc patch
a-w = !arc work a-w = !arc work
arcw = !arc work

36
.yamllint Normal file
View file

@ -0,0 +1,36 @@
---
yaml-files:
- '*.yaml'
- '*.yml'
- '.yamllint'
rules:
anchors: enable
braces: enable
brackets: enable
colons: enable
commas: enable
comments:
level: warning
comments-indentation:
level: warning
document-end: disable
document-start: disable
empty-lines: enable
empty-values: disable
float-values: disable
hyphens: enable
indentation: enable
key-duplicates: enable
key-ordering: disable
line-length:
level: warning
new-line-at-end-of-file:
level: warning
new-lines: enable
octal-values: disable
quoted-strings: disable
trailing-spaces: enable
truthy:
level: warning

View file

@ -30,6 +30,7 @@
show = fuller show = fuller
[rerere] [rerere]
enabled = true enabled = true
autoUpdate = true
[sendemail] [sendemail]
from = 'Yongmin Hong <revi@omglol.email>' from = 'Yongmin Hong <revi@omglol.email>'
smtpserver = smtp.fastmail.com smtpserver = smtp.fastmail.com

25
package-lock.json generated
View file

@ -6,6 +6,9 @@
"": { "": {
"dependencies": { "dependencies": {
"jsonlint": "^1.6.3" "jsonlint": "^1.6.3"
},
"devDependencies": {
"prettier": "^3.3.1"
} }
}, },
"node_modules/ansi-styles": { "node_modules/ansi-styles": {
@ -70,6 +73,22 @@
"underscore": "~1.6.0" "underscore": "~1.6.0"
} }
}, },
"node_modules/prettier": {
"version": "3.3.1",
"resolved": "https://registry.npmjs.org/prettier/-/prettier-3.3.1.tgz",
"integrity": "sha512-7CAwy5dRsxs8PHXT3twixW9/OEll8MLE0VRPCJyl7CkS6VHGPSlsVaWTiASPTyGyYRyApxlaWTzwUxVNrhcwDg==",
"dev": true,
"license": "MIT",
"bin": {
"prettier": "bin/prettier.cjs"
},
"engines": {
"node": ">=14"
},
"funding": {
"url": "https://github.com/prettier/prettier?sponsor=1"
}
},
"node_modules/strip-ansi": { "node_modules/strip-ansi": {
"version": "0.1.1", "version": "0.1.1",
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-0.1.1.tgz", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-0.1.1.tgz",
@ -131,6 +150,12 @@
"underscore": "~1.6.0" "underscore": "~1.6.0"
} }
}, },
"prettier": {
"version": "3.3.1",
"resolved": "https://registry.npmjs.org/prettier/-/prettier-3.3.1.tgz",
"integrity": "sha512-7CAwy5dRsxs8PHXT3twixW9/OEll8MLE0VRPCJyl7CkS6VHGPSlsVaWTiASPTyGyYRyApxlaWTzwUxVNrhcwDg==",
"dev": true
},
"strip-ansi": { "strip-ansi": {
"version": "0.1.1", "version": "0.1.1",
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-0.1.1.tgz", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-0.1.1.tgz",

View file

@ -1,5 +1,8 @@
{ {
"dependencies": { "dependencies": {
"jsonlint": "^1.6.3" "jsonlint": "^1.6.3"
},
"devDependencies": {
"prettier": "^3.3.1"
} }
} }