From d5b6e05a86d0af78ee8943a013cb6b0484c3f92c Mon Sep 17 00:00:00 2001 From: Yongmin Hong Date: Sat, 8 Jun 2024 16:25:13 +0900 Subject: [PATCH] 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 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 --- .arclint | 2 +- .config/ntfy/ntfy.yml | 5 ----- .editorconfig | 1 + .gitaliases | 34 +++++++++++++++++++++++----------- .yamllint | 36 ++++++++++++++++++++++++++++++++++++ default.gitconfig | 1 + package-lock.json | 25 +++++++++++++++++++++++++ package.json | 3 +++ 8 files changed, 90 insertions(+), 17 deletions(-) create mode 100644 .yamllint diff --git a/.arclint b/.arclint index a810ced..4a9c614 100644 --- a/.arclint +++ b/.arclint @@ -29,7 +29,7 @@ "type": "text", "text.max-line-length": 80, "severity": { - "1": "advice", + "1": "autofix", "2": "advice", "3": "advice", "5": "disabled" diff --git a/.config/ntfy/ntfy.yml b/.config/ntfy/ntfy.yml index 262c3ee..ff30803 100644 --- a/.config/ntfy/ntfy.yml +++ b/.config/ntfy/ntfy.yml @@ -4,8 +4,3 @@ backends: - matrix pushover: user_key: [REDACTED] -matrix: - url: "https://matrix.revi.xyz" - roomId: "#devops:revi.xyz" - userId: "REDACTED" - password: "REDACTED" \ No newline at end of file diff --git a/.editorconfig b/.editorconfig index 6c712a4..e5bc88b 100644 --- a/.editorconfig +++ b/.editorconfig @@ -10,4 +10,5 @@ end_of_line = lf indent_size = 2 indent_style = space insert_final_newline = true +max_line_length = 80 trim_trailing_whitespace = true diff --git a/.gitaliases b/.gitaliases index fc75864..8ae5049 100644 --- a/.gitaliases +++ b/.gitaliases @@ -2,26 +2,36 @@ # SPDX-License-Identifier: Apache-2.0 [alias] # some project uses `master` and some uses `main` for the default. -# since their first two letters are both ma, use the last char. - acm = commit -a -s +# since their first two letters are both ma, use the last char +# which is either `r` for master or `n` for main. +# a-d +# a-l +# a-p +# a-w aal = add * + acm = commit -a -s amend = commit --amend - amendss = commit --amend -S -s amends = commit --amend -s + amendss = commit --amend -S -s +# arcd +# arcl +# arcp +# arcw br = branch -v brd = branch -d brD = branch -D - cob = checkout -b + cm = commit -s + cmt = commit -S -s co = checkout + cob = checkout -b com = !echo 'ERROR: use cor for master, and con for main.' comn = checkout main comr = checkout master - cm = commit -s - cmt = commit -S -s count = count-objects -vH + diffs = diff --staged fa = fetch --all - fup = fetch upstream fo = fetch origin + fup = fetch upstream graph = log --pretty=format:\"%h %s\" --graph osync = !echo 'ERROR: use osyncr for master, and osyncm for main.' osyncn = rebase origin/main @@ -29,17 +39,19 @@ po= !echo 'ERROR: use por for master, and pon for main.' pon = push origin main por = push origin master + prod = !git checkout prod && git rebase origin/master && git push origin prod && git checkout master st = status + staash = stash -a usync = !echo 'ERROR: use usyncr for master, and usyncn for main.' usyncn = rebase upstream/main usyncr = rebase upstream/master # below are non-git command, signified via `!` in the comment # https://issuetracker.revi.xyz/u/gitalias - arcd = !arc diff a-d = !arc diff - arcl = !arc land + arcd = !arc diff a-l = !arc land - arcp = !arc patch + arcl = !arc land a-p = !arc patch - arcw = !arc work + arcp = !arc patch a-w = !arc work + arcw = !arc work diff --git a/.yamllint b/.yamllint new file mode 100644 index 0000000..0ac25f2 --- /dev/null +++ b/.yamllint @@ -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 diff --git a/default.gitconfig b/default.gitconfig index 9286c62..252b1e6 100644 --- a/default.gitconfig +++ b/default.gitconfig @@ -30,6 +30,7 @@ show = fuller [rerere] enabled = true + autoUpdate = true [sendemail] from = 'Yongmin Hong ' smtpserver = smtp.fastmail.com diff --git a/package-lock.json b/package-lock.json index 7d47b7d..1aad557 100644 --- a/package-lock.json +++ b/package-lock.json @@ -6,6 +6,9 @@ "": { "dependencies": { "jsonlint": "^1.6.3" + }, + "devDependencies": { + "prettier": "^3.3.1" } }, "node_modules/ansi-styles": { @@ -70,6 +73,22 @@ "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": { "version": "0.1.1", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-0.1.1.tgz", @@ -131,6 +150,12 @@ "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": { "version": "0.1.1", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-0.1.1.tgz", diff --git a/package.json b/package.json index 18b0682..d4c361a 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,8 @@ { "dependencies": { "jsonlint": "^1.6.3" + }, + "devDependencies": { + "prettier": "^3.3.1" } }