Skip to content

fix(format): JavaDoc {@link} reflow + CI/hooks cleanup#2

Merged
vanillacake369 merged 9 commits into
mainfrom
fix/javadoc-reflow-and-ci-cleanup
Jun 1, 2026
Merged

fix(format): JavaDoc {@link} reflow + CI/hooks cleanup#2
vanillacake369 merged 9 commits into
mainfrom
fix/javadoc-reflow-and-ci-cleanup

Conversation

@vanillacake369

Copy link
Copy Markdown
Owner

Summary

세션 작업 6개 커밋. 핵심은 conform.nvim이 prepend_args를 builtin parent 없는 custom formatter에서 silently drop한다는 함정으로 clang-format-java에 style이 전혀 도달하지 않아 JavaDoc이 LLVM 기본 스타일로 reflow되던 버그 fix.

  • fix(format)--styleargs에 직접 배치 / range_args 추가 / ReflowComments: Never (v16+ enum) / deprecated 옵션 제거
  • feat(helm)towolf/vim-helm으로 helm filetype ftdetect 등록 → prettier 매핑 활성
  • refactor(config)collect_config fallback priority 정리 + docker/helm/java 명시적 filetypes + dead collect_formatters_opts 제거
  • style — pure stylua 정리 (10개 파일, semantic diff 0)
  • chore(ci) — 누락된 .typos.toml, selene 표준 라이브러리 형식 수정, nvim-test workflow의 loadfile()()loadfile() (rtp 미설정 환경에서 require 실패 회피)
  • chore(hooks).githooks/pre-commit (stylua/selene/syntax 게이트)

Test plan

  • clang-format --style "..." CLI reproduction → 166자 JavaDoc 라인 보존 확인
  • headless nvim 끝까지 E2E 재현: 76 lines → 76 lines, AFTER == BEFORE
  • stylua --check lua/ exit 0
  • selene --display-style=quiet --allow-warnings lua/ exit 0
  • pre-commit hook 모든 commit에서 통과
  • CI: lua-quality / nvim-test / typos / security 4개 모두 green

- Add .typos.toml so typos workflow can locate its config
- Replace broken inline-table vim.toml with proper selene std-lib (vim.yml)
- Lua quality job: pass --allow-warnings so selene only fails on errors
- Nvim integration test: switch syntax check from loadfile()()
  (which executes the chunk and fails on require() with -u NONE)
  to loadfile() with explicit error capture
Mirrors CI quality checks locally on every commit to fail fast:
- stylua --check on staged Lua files
- selene --allow-warnings on lua/
- nvim loadfile() syntax parse on staged Lua files

Enable with: git config core.hooksPath .githooks
Mechanical reformat of files that drifted from .stylua.toml.
All diffs are whitespace-only (verified with git diff -w showing
0 semantic changes). Unblocks CI lua-quality check.
- Remove unused collect_formatters_opts extension point (dead code,
  no language ever defined formatters_opts)
- collect_config fallback priority: config.filetypes > lsp_opts.filetypes > lang_name
  so linters/formatters can map to filetypes distinct from LSP's
- Add explicit filetypes for entries previously relying on lang_name fallback:
  - docker: hadolint -> dockerfile (was wrongly mapped to yaml.docker-compose)
  - helm: prettier -> helm (requires vim-helm ftdetect, see helm.lua)
  - java: clang-format-java -> java
- Rename java formatter to clang-format-java alias to isolate Java-specific
  clang-format options from any future c_cpp formatter usage
Neovim has no built-in 'helm' filetype, so the prettier formatter
mapping in languages.lua never fired on Helm chart templates.
towolf/vim-helm provides the missing ftdetect for templates/*.yaml
under Chart.yaml, helmfile.*, and *.gotmpl. lazy.nvim sources
ftdetect/ regardless of lazy state, so default lazy=true is sufficient.
Root cause: conform.nvim silently drops prepend_args for custom
formatters that have no built-in parent file. clang-format-java was
configured with --style in prepend_args, which never reached the
binary -- clang-format ran with no style and defaulted to LLVM C++,
which reflowed JavaDoc against the user's wish.

Fix the formatter spec end-to-end:
- Move --style into args directly so it actually reaches clang-format
- Add range_args for visual-mode partial formatting (was silently
  falling back to whole-buffer reformat + diff trim)
- inherit=false to skip pcall lookup of nonexistent builtin
- ReflowComments: Never (correct enum syntax for clang-format v16+;
  the boolean 'false' form is silently rejected by v21)
- Remove deprecated/inert options for Language: Java:
  AlwaysBreakAfterDefinitionReturnType (removed in clang-format 11),
  DerivePointerAlignment (C/C++ only)
- AllowAllParametersOfDeclarationOnNextLine -> false (avoid hybrid
  indent when parameter list does not fit)
- format_on_save timeout 1500ms -> 2500ms so ruff_fix +
  ruff_organize_imports + ruff_format chain has margin
- finder.lua: apply stylua to match .stylua.toml (was tab-indented)
- vim.yml: declare Snacks debug globals dd/bb so selene stops
  flagging them as undefined in finder.lua
- nvim-test workflow: remove "Test Plugin Manager" step. It ran
  `require('lazy').restore()` against a runner with no lazy.nvim
  bootstrap, so it failed deterministically. Syntax-check above
  is the right scope; plugin-manager smoke needs a separate
  bootstrap setup.
Mechanical reformat of files whose committed state still drifted
from .stylua.toml. Working-tree user WIP is preserved untouched
(index-only stage of the stylua-clean HEAD content).

Unblocks CI lua-quality StyLua Format Check.
Nix:
- nixd.nixpkgs.expr: switch from CWD-flake-root assumption to flake
  registry alias (`builtins.getFlake "nixpkgs"`). Survives non-flake
  projects and launches that lack NIX_PATH (macOS Spotlight/Launcher).
- clangd query-driver: narrow glob to *-clang-* / *-gcc-* so the Nix
  store walk on first IntelliSense is bounded; add /usr/bin/clang as
  nix-darwin fallback when no Nix cc wrapper is installed.
- VimLeavePre nixd cleanup: pkill -9 -> pkill -15 so the nixd
  evaluation cache flushes before exit.

Java / jdtls:
- LspAttach BufWritePre: scope augroup name by buffer AND client id so
  (a) re-attach of the same client clears its prior handler and (b) a
  second client attaching to the same buffer does not wipe out the
  first client's save-action handler.
- jdtls organizeImports: declare importOrder { java, javax, org, com }
  as a sensible default. Project-level .settings/org.eclipse.jdt.ui.prefs
  still takes precedence when present (Spring-generated repos).
@vanillacake369 vanillacake369 merged commit 03a58ab into main Jun 1, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant