Commit Graph

41 Commits

Author SHA1 Message Date
6d72003446 fix(lint): fix all sonarcloud detected issues (#279)
* fix(ci): replace broad permissions with specific scopes in workflows

Replace read-all/write-all with minimum required permission scopes
across all GitHub Actions workflows to follow the principle of least
privilege (SonarCloud rule githubactions:S8234).

* fix(shell): use [[ instead of [ for conditional tests

Replace single brackets with double brackets in bash conditional
expressions across 14 files (28 changes). All scripts use bash
shebangs so [[ is safe everywhere (SonarCloud rule shelldre:S7688).

* fix(shell): add explicit return statements to functions

Add return 0 as the last statement in ~46 shell functions across
17 files that previously relied on implicit return codes
(SonarCloud rule shelldre:S7682).

* fix(shell): assign positional parameters to local variables

Replace direct $1/$2/$3 usage with named local variables in _log(),
msg(), msg_err(), msg_done(), msg_run(), msg_ok(), and array_diff()
(SonarCloud rule shelldre:S7679).

* fix(python): replace dict() constructor with literal

Use {} instead of dict() for empty dictionary initialization
(SonarCloud rule python:S7498).

* fix(shell): fix husky shebang and tolerate npm outdated exit code

* docs(shell): add function docstring comments

* fix(shell): fix heredoc indentation in x-sonarcloud

* feat(python): add ruff linter and formatter configuration

* fix(ci): align megalinter config with biome, ruff, and shfmt settings

* fix(ci): disable black and yaml-prettier in megalinter config

* chore(ci): update ruff-pre-commit to v0.15.0 and fix hook name

* fix(scripts): check for .git dir before skipping clone in install-fonts

* fix(shell): address code review issues in scripts and shared.sh

- Guard wezterm show-keys failure in create-wezterm-keymaps.sh
- Stop masking git failures with return 0 in install-cheat-purebashbible.sh
- Add missing shared.sh source in install-xcode-cli-tools.sh
- Replace exit 1 with return 1 in sourced shared.sh

* fix(scripts): address code review and security findings

- Guard wezterm show-keys failure in create-wezterm-keymaps.sh
- Stop masking git failures with return 0 in install-cheat-purebashbible.sh
- Add missing shared.sh source in install-xcode-cli-tools.sh
- Replace exit 1 with return 1 in sourced shared.sh
- Remove shell=True subprocess calls in x-git-largest-files.py

* style(shell): apply shfmt formatting and add args to pre-commit hook

* fix(python): suppress bandit false positives in x-git-largest-files

* fix(python): add nosemgrep suppression for check_output call

* feat(format): add prettier for YAML formatting

Install prettier, add .prettierrc.json config (200-char width, 2-space
indent, LF endings), .prettierignore, yarn scripts (lint:prettier,
fix:prettier, format:yaml), and pre-commit hook scoped to YAML files.

* style(yaml): apply prettier formatting

* fix(scripts): address remaining code review findings

- Python: use list comprehension to filter empty strings instead of
  slicing off the last element
- create-wezterm-keymaps: write to temp file and mv for atomic updates
- install-xcode-cli-tools: fix shellcheck source directive path

* fix(python): sort imports alphabetically in x-git-largest-files

* fix(lint): disable PYTHON_ISORT in MegaLinter, ruff handles it

* chore(git): add __pycache__ to gitignore

* fix(python): rename ambiguous variable l to line (E741)

* style: remove trailing whitespace and blank lines

* style(fzf): apply shfmt formatting

* style(shell): apply shfmt formatting

* docs(plans): add design documents

* style(docs): add language specifier to fenced code block

* feat(lint): add markdown-table-formatter to dev tooling

Add markdown-table-formatter as a dev dependency with yarn scripts
(lint:md-table, fix:md-table) and a local pre-commit hook to
automatically format markdown tables on commit.
2026-02-07 19:01:02 +02:00
083d30a0c3 fix(scripts): fix shared.sh guard logic and echo -e portability
- shared.sh: simplify guard logic, remove misleading warning message,
  use ${VAR:-} pattern to avoid unbound variable error
- install-cheat-purebashbible.sh: replace echo -e with printf for
  POSIX portability
2026-02-05 22:55:27 +02:00
cf7ca2109f feat: add bats tests, docs (#139)
* fix(test): ensure bats file list uses xargs

* docs(readme): use yarn for testing instructions

* fix(test): ensure pipelines fail properly

* docs(alias): fix table header

---------

Signed-off-by: Ismo Vuorinen <ismo@ivuorinen.net>
2025-06-30 04:30:06 +03:00
a8a473a46d chore: shfmt, cleanup 2024-12-28 18:59:09 +02:00
d585d61537 chore(config): tweaks to configs and scripts 2024-11-22 17:54:37 +02:00
1f2ca90ca5 feat!: refactor base, config, dfm and scripts 2024-07-23 03:43:12 +03:00
adecceda7a chore(scripts): eval scripts/shared.sh 2024-07-17 10:04:16 +03:00
7bc7921a17 chore: rename scripts/shared 2024-07-17 09:39:57 +03:00
f8987818b8 chore(asdf): cleanup 2024-07-08 10:15:48 +03:00
c754746b9f chore(scripts): extract oh-my-posh screenshotter 2024-06-25 01:24:44 +03:00
df5cab6a88 fix(scripts): some typoes in scripts/shared.sh 2024-06-25 01:23:22 +03:00
b7c9d4851a chore(scripts): mkd -> x-mkd 2023-11-13 09:28:15 +02:00
4699233d46 chore(shell): touching the paths again, no regrats 2023-11-13 09:25:58 +02:00
4572c42eea feat: x-path-* as scripts, run other changes 2023-11-01 14:45:03 +02:00
e6f3aae287 fix(shell): rework shell config for more stability 2023-10-02 08:39:07 +03:00
4b45c89a90 fix(shell): change how shell detection works 2023-09-29 15:52:16 +03:00
56ae0e1e1c feat(scripts): have is now x-have script 2023-09-29 14:51:20 +03:00
3d753fe08c feat(scripts): x-load-configs is now a script 2023-09-29 14:50:05 +03:00
31423c30b9 fix(scripts): have now uses which -s 2023-09-28 18:17:29 +03:00
fbdd2c7448 fix(shell): fixed zsh/bash config loading 2023-09-28 17:53:09 +03:00
0aff4784b1 feat(scripts): msgr helper script 2023-09-28 17:13:44 +03:00
a87b33b8c2 chore(shell): make everything bit faster 2023-09-27 10:38:10 +03:00
05aa4ba092 feat(scripts): use bkt for command caching 2023-09-19 02:23:03 +03:00
31e04ce865 fix(lint): added missing shfmt, linted files 2023-08-31 09:55:00 +03:00
a103fbddbe feat(tools): moved x-dc & few others to shared.sh 2023-08-15 12:10:36 +03:00
4e2ee377f2 chore(config): zsh env settings reworking 2023-07-27 14:19:37 +03:00
d7106ae28f chore(lint): Linted scripts, yaml and configs 2023-07-27 13:57:15 +03:00
1745a15acf fix(scripts): install-cheat-tldr now updates files 2023-07-23 21:51:40 +03:00
ad08a2956e fix(scripts): improve replacable function errors 2023-07-23 21:19:43 +03:00
83eb7d861e feat(tools): sha256-matcher, cheat script tweaks 2023-07-12 22:44:08 +03:00
8de487250d Feat: Pure Bash Bible and TLDR in cheat 2023-05-05 23:02:31 +03:00
c1287c4ea8 dfm: menu rework, docs. codestyle fixes. 2023-04-14 10:10:32 +03:00
e5d6cb37fd shell: have, path_(append|prepend|remove)
- have: command -v shorthand
- path_append: appends dir to PATH
- path_prepend: prepends dir to PATH
- path_remove: removes dir from PATH
2023-04-14 00:42:08 +03:00
4492c386b6 dfm: rewrote the usage menu generation 2023-04-14 00:01:58 +03:00
Ismo Vuorinen
bb3f4a8f6c Many updates and improvements
- yamllint
- shfmt config
- fix Go bin path
- fix git credentials config
- add nvm default packages
- updated Brewfile
2023-03-28 15:27:44 +03:00
Ismo Vuorinen
fa3dc531a0 Tweaks & EOL's added 2023-03-27 10:01:02 +03:00
Ismo Vuorinen
305355beaf scripts: chmods & npm package helper 2023-02-14 13:01:48 +02:00
Ismo Vuorinen
16d455a262 2023-01-30 2023-01-30 12:16:20 +02:00
Ismo Vuorinen
b6a18688c4 Fix shfmt command and formatted files 2023-01-12 16:49:49 +02:00
9f1ba5034f nvim: Added harpoon 2023-01-09 04:04:09 +02:00
Ismo Vuorinen
a708085dda Multiple scripts, go packages, shared configs...
Documentation, links, renaming files for clarity, and all that.
2022-12-19 17:19:00 +02:00