diff --git a/.editorconfig b/.editorconfig index 713e73f..1ee2520 100644 --- a/.editorconfig +++ b/.editorconfig @@ -8,6 +8,10 @@ indent_style = space insert_final_newline = true trim_trailing_whitespace = true +[*.py] +indent_size = 4 +max_line_length = 120 + [*.fish] max_line_length = 120 diff --git a/.github/README.md b/.github/README.md index 4e0510d..0c8fff7 100644 --- a/.github/README.md +++ b/.github/README.md @@ -37,7 +37,7 @@ see what interesting stuff you've done with it. Sharing is caring. ### Interesting folders | Path | Description | -| ------------------- | -------------------------------------------- | +|---------------------|----------------------------------------------| | `.github` | GitHub Repository configuration files, meta. | | `hosts/{hostname}/` | Configs that should apply to that host only. | | `local/bin` | Helper scripts that I've collected or wrote. | @@ -52,7 +52,7 @@ is processed by Dotbot during installation. ### dotfile folders | Repo | Destination | Description | -| --------- | ----------- | ------------------------------------------- | +|-----------|-------------|---------------------------------------------| | `base/` | `.*` | `$HOME` level files. | | `config/` | `.config/` | Configurations for applications. | | `local/` | `.local/` | XDG Base folder: `bin`, `share` and `state` | @@ -86,7 +86,7 @@ The folder structure follows [XDG Base Directory Specification][xdg] where possi ### XDG Variables | Env | Default | Short description | -| ------------------ | -------------------- | ---------------------------------------------- | +|--------------------|----------------------|------------------------------------------------| | `$XDG_BIN_HOME` | `$HOME/.local/bin` | Local binaries | | `$XDG_CONFIG_HOME` | `$HOME/.config` | User-specific configs | | `$XDG_DATA_HOME` | `$HOME/.local/share` | User-specific data files | diff --git a/.github/workflows/changelog.yml b/.github/workflows/changelog.yml index 1eb2b65..b5a2093 100644 --- a/.github/workflows/changelog.yml +++ b/.github/workflows/changelog.yml @@ -9,13 +9,15 @@ concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true -permissions: read-all +permissions: + contents: read jobs: debug-changelog: runs-on: ubuntu-latest - permissions: write-all + permissions: + contents: read steps: - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 @@ -27,7 +29,7 @@ jobs: token: ${{ secrets.GITHUB_TOKEN }} config_file: .github/tag-changelog-config.js - - name: 'Echo results' + - name: "Echo results" id: output-changelog run: | echo "${{ steps.changelog.outputs.changes }}" diff --git a/.github/workflows/linters.yml b/.github/workflows/linters.yml index a5ff5d6..9499c82 100644 --- a/.github/workflows/linters.yml +++ b/.github/workflows/linters.yml @@ -11,7 +11,8 @@ concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true -permissions: read-all +permissions: + contents: read jobs: Linter: diff --git a/.github/workflows/new-release.yml b/.github/workflows/new-release.yml index 5cad4b6..09e36d5 100644 --- a/.github/workflows/new-release.yml +++ b/.github/workflows/new-release.yml @@ -5,19 +5,21 @@ name: Release Daily State on: workflow_dispatch: schedule: - - cron: '0 21 * * *' # 00:00 at Europe/Helsinki + - cron: "0 21 * * *" # 00:00 at Europe/Helsinki concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true -permissions: read-all +permissions: + contents: read jobs: new-daily-release: runs-on: ubuntu-latest - permissions: write-all + permissions: + contents: write outputs: created: ${{ steps.daily-version.outputs.created }} diff --git a/.github/workflows/pre-commit-autoupdate.yml b/.github/workflows/pre-commit-autoupdate.yml index 55247ee..e17355d 100644 --- a/.github/workflows/pre-commit-autoupdate.yml +++ b/.github/workflows/pre-commit-autoupdate.yml @@ -5,14 +5,15 @@ name: Pre-commit autoupdate on: schedule: # At 04:00 on Monday and Thursday. - - cron: '0 4 * * 1,4' + - cron: "0 4 * * 1,4" workflow_dispatch: concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true -permissions: read-all +permissions: + contents: read jobs: auto-update: @@ -33,6 +34,6 @@ jobs: with: token: ${{ secrets.GITHUB_TOKEN }} branch: update/pre-commit-hooks - title: 'chore: update pre-commit hooks' - commit-message: 'chore: update pre-commit hooks' + title: "chore: update pre-commit hooks" + commit-message: "chore: update pre-commit hooks" body: Update versions of pre-commit hooks to latest version. diff --git a/.github/workflows/semantic-pr.yml b/.github/workflows/semantic-pr.yml index f882012..a4e7ab8 100644 --- a/.github/workflows/semantic-pr.yml +++ b/.github/workflows/semantic-pr.yml @@ -14,7 +14,8 @@ concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true -permissions: read-all +permissions: + pull-requests: read jobs: semantic-pr: diff --git a/.github/workflows/sync-labels.yml b/.github/workflows/sync-labels.yml index aab4089..f06f615 100644 --- a/.github/workflows/sync-labels.yml +++ b/.github/workflows/sync-labels.yml @@ -11,7 +11,7 @@ on: - .github/workflows/sync-labels.yml - .github/labels.yml schedule: - - cron: '34 5 * * *' + - cron: "34 5 * * *" workflow_call: workflow_dispatch: @@ -19,7 +19,8 @@ concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true -permissions: read-all +permissions: + contents: read jobs: SyncLabels: diff --git a/.github/workflows/update-submodules.yml b/.github/workflows/update-submodules.yml index 9b304c1..8c05e85 100644 --- a/.github/workflows/update-submodules.yml +++ b/.github/workflows/update-submodules.yml @@ -5,20 +5,22 @@ name: Update submodules on: schedule: # At 04:00 on Monday and Thursday. - - cron: '0 4 * * 1' + - cron: "0 4 * * 1" workflow_dispatch: concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true -permissions: read-all +permissions: + contents: read jobs: update-submodules: runs-on: ubuntu-latest - permissions: write-all + permissions: + contents: write steps: - name: Checkout repository diff --git a/.gitignore b/.gitignore index 03523cf..49c8e93 100644 --- a/.gitignore +++ b/.gitignore @@ -56,5 +56,6 @@ local/man/yabai.1 local/share/fonts/* lock node_modules +__pycache__ ssh/local.d/* config/fish/fish_variables* diff --git a/.mega-linter.yml b/.mega-linter.yml index 44c5dbf..12d4f86 100644 --- a/.mega-linter.yml +++ b/.mega-linter.yml @@ -9,16 +9,21 @@ VALIDATE_ALL_CODEBASE: true FILEIO_REPORTER: false # Generate file.io report GITHUB_STATUS_REPORTER: true # Generate GitHub status report IGNORE_GENERATED_FILES: true # Ignore generated files -JAVASCRIPT_DEFAULT_STYLE: prettier # Default style for JavaScript PRINT_ALPACA: false # Print Alpaca logo in console SARIF_REPORTER: true # Generate SARIF report SHOW_SKIPPED_LINTERS: false # Show skipped linters in MegaLinter log -TYPESCRIPT_DEFAULT_STYLE: prettier # Default style for TypeScript DISABLE_LINTERS: - REPOSITORY_DEVSKIM - JAVASCRIPT_ES # using biome - JAVASCRIPT_PRETTIER # using biome + - TYPESCRIPT_PRETTIER # using biome + - JSON_PRETTIER # using biome + - PYTHON_BLACK # using ruff + - PYTHON_FLAKE8 # using ruff + - PYTHON_PYLINT # using ruff + - PYTHON_ISORT # using ruff (I rules) YAML_YAMLLINT_CONFIG_FILE: .yamllint.yml REPOSITORY_GIT_DIFF_DISABLE_ERRORS: true +BASH_SHFMT_ARGUMENTS: -i 2 -bn -ci -sr -fn FILTER_REGEX_EXCLUDE: > (node_modules|tools|config/cheat/cheatsheets/community|config/cheat/cheatsheets/tldr|config/fzf|config/zsh|config/tmux/plugins) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index b9f085f..5328865 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -28,12 +28,25 @@ repos: entry: yarn biome check --write --files-ignore-unknown=true --no-errors-on-unmatched language: system files: \.(js|ts|jsx|tsx|json|md)$ + - id: markdown-table-formatter + name: Markdown Table Formatter + entry: yarn markdown-table-formatter + language: system + types: [markdown] - repo: https://github.com/adrienverge/yamllint rev: v1.38.0 hooks: - id: yamllint + - repo: https://github.com/pre-commit/mirrors-prettier + rev: v4.0.0-alpha.8 + hooks: + - id: prettier + types_or: [yaml] + additional_dependencies: + - prettier@3.8.1 + - repo: https://github.com/shellcheck-py/shellcheck-py rev: v0.11.0.1 hooks: @@ -43,6 +56,7 @@ repos: rev: v3.12.0-2 hooks: - id: shfmt + args: [-i, "2", -bn, -ci, -sr, -fn, -w] - repo: https://github.com/rhysd/actionlint rev: v1.7.10 @@ -60,3 +74,10 @@ repos: hooks: - id: fish_syntax - id: fish_indent + + - repo: https://github.com/astral-sh/ruff-pre-commit + rev: v0.15.0 + hooks: + - id: ruff-check + args: [--fix] + - id: ruff-format diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 0000000..0311b10 --- /dev/null +++ b/.prettierignore @@ -0,0 +1,18 @@ +node_modules +.yarn +.pnp.* +.mypy_cache +Brewfile.lock.json +lazy-lock.json +config/cheat/cheatsheets/community +config/cheat/cheatsheets/tldr +config/fzf +config/nvim +config/op/plugins/used_plugins +config/tmux/plugins +config/vim/plugged +config/zsh +local/bin/antigen.zsh +local/bin/asdf +tools +docs/plans diff --git a/.prettierrc.json b/.prettierrc.json new file mode 100644 index 0000000..62739f8 --- /dev/null +++ b/.prettierrc.json @@ -0,0 +1,9 @@ +{ + "$schema": "https://json.schemastore.org/prettierrc", + "printWidth": 200, + "tabWidth": 2, + "useTabs": false, + "endOfLine": "lf", + "singleQuote": false, + "proseWrap": "preserve" +} diff --git a/.serena/project.yml b/.serena/project.yml index a0ff204..82b8167 100644 --- a/.serena/project.yml +++ b/.serena/project.yml @@ -13,11 +13,11 @@ ignore_all_files_in_gitignore: true # Was previously called `ignored_dirs`, please update your config if you are using that. # Added (renamed) on 2025-04-07 ignored_paths: - - '*.swp' - - '*.tmp' - - '*.tmp.*' - - '.DS_Store' - - '.git/**' + - "*.swp" + - "*.tmp" + - "*.tmp.*" + - ".DS_Store" + - ".git/**" - /config/cheat/cheatsheets/community/** - /config/cheat/cheatsheets/pure-bash-bible/** - /config/cheat/cheatsheets/tldr/** @@ -85,6 +85,6 @@ excluded_tools: [] # initial prompt for the project. It will always be given to the LLM upon activating the project # (contrary to the memories, which are loaded on demand). -initial_prompt: '' +initial_prompt: "" -project_name: '.dotfiles' +project_name: ".dotfiles" diff --git a/CLAUDE.md b/CLAUDE.md new file mode 100644 index 0000000..4d88144 --- /dev/null +++ b/CLAUDE.md @@ -0,0 +1,123 @@ +# CLAUDE.md + +This file provides guidance to Claude Code (claude.ai/code) +when working with code in this repository. + +## Repository Overview + +Personal dotfiles repository for Ismo Vuorinen. +Uses **Dotbot** (not GNU Stow) to symlink configuration files into place. +The directory layout follows the XDG Base Directory Specification. + +## Directory Layout and Linking + +| Source | Destination | Notes | +|---------------------|-------------------|-------------------------------------------| +| `base/*` | `~/.*` | Home-level dotfiles (`.` added by Dotbot) | +| `config/*` | `~/.config/` | Application configurations | +| `local/bin/*` | `~/.local/bin/` | Helper scripts and utilities | +| `local/share/*` | `~/.local/share/` | Data files | +| `local/man/**` | `~/.local/man/` | Manual pages | +| `ssh/*` | `~/.ssh/` | SSH configuration (mode 0600) | +| `hosts//` | Overlays | Host-specific overrides | + +Installation: `./install` runs Dotbot with `install.conf.yaml`, +then applies `hosts//install.conf.yaml` if it exists. + +## Commands + +```bash +# Install dependencies (required before lint/test) +yarn install + +# Linting +yarn lint # Run biome + prettier + editorconfig-checker +yarn lint:biome # Biome only +yarn lint:ec # EditorConfig checker only + +# Formatting +yarn fix:biome # Autofix with biome (JS/TS/JSON/MD) +yarn fix:prettier # Autofix with prettier (YAML) +yarn format # Format with biome +yarn format:yaml # Format YAML files with prettier + +# Testing (Bats - Bash Automated Testing System) +yarn test # Run all tests in tests/ +# Run a single test file: +./node_modules/.bin/bats tests/dfm.bats + +# Shell linting +shellcheck