Skip to content

chore: format shell scripts, the Dockerfile and shell snippets in docs with prettier-plugin-sh - #2078

Open
artembelik wants to merge 5 commits into
mainfrom
chore/prettier-plugin-sh
Open

artembelik wants to merge 5 commits into
mainfrom
chore/prettier-plugin-sh

Conversation

@artembelik

@artembelik artembelik commented Sep 21, 2026

Copy link
Copy Markdown
Contributor

Summary

подключил prettier-plugin-sh: теперь yarn run prettier и lint-staged форматируют shell-скрипты, tools/e2e/Dockerfile, husky-хуки, ignore-файлы, .gitattributes, .nvmrc и shell-сниппеты в Markdown. tools/e2e/Dockerfile уже был в нужном формате, поэтому в диффе его нет

List of notable changes:

  • added prettier-plugin-sh в плагины prettier
  • updated плейсхолдеры в shell-сниппетах документации взяты в кавычки: --project "<your project>" вместо --project <your project>. для парсера < и > - редиректы: если за плейсхолдером идут аргументы, команда переписывается (--project <your project> --fix=false превращается в --project project < your > --fix=false), а если плейсхолдер в конце строки, блок не парсится и молча пропускается. таких блоков было 97 из 249
  • updated остальное в документации - результат форматирования: выравнивание комментариев в блоках команд AGENTS.md, цикл в 05-releasing-packages.md развёрнут в несколько строк, единый отступ у переносов в README new-icons-pack
  • updated tools/e2e/entrypoint.sh: пробел после 2>, это дефолт плагина
  • updated .prettierignore: .husky/_ (хуки, которые генерирует husky: git их прячет вложенным .gitignore, а prettier его не читает) и .github/CODEOWNERS, чтобы сохранить выравнивание колонок
  • updated AGENTS.md: про плагин и про кавычки вокруг плейсхолдеров

What should reviewers focus on?

  • плейсхолдеры в командах миграций (docs/guides/migration.{en,ru}.mdx, README схематиков) - это увидят пользователи на сайте
  • один блок bash в packages/cli/README.md так и не форматируется: внутри JSON, а не команда

🤖 Generated with Claude Code

artembelik and others added 3 commits September 21, 2026 15:50
…ttier-plugin-sh

Adds prettier-plugin-sh, so `yarn run prettier` and lint-staged also cover shell scripts,
tools/e2e/Dockerfile, husky hooks, ignore files, .gitattributes, .nvmrc and CODEOWNERS.

- the plugin is off for *.md and *.mdx: the sh parser reads doc placeholders as redirects
  and turns `--project <your project> --fix=false` into `--project project < your > --fix=false`
- .husky/_ is ignored: husky generates it locally and hides it from git with its own
  .gitignore, which prettier does not read
- CODEOWNERS loses its column alignment and entrypoint.sh gets a space after `2>`,
  both per the plugin defaults

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
- keep CODEOWNERS out of prettier to preserve its column alignment
- format the shell snippets in Markdown too: quote the `<placeholders>` so the sh parser reads
  them as words rather than redirects

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Write the placeholders in shell snippets as plain UPPER_CASE words (PROJECT_NAME, SCHEMATIC_NAME)
instead of quoted `"<...>"`, which read as if the quotes were required.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Sep 21, 2026

Copy link
Copy Markdown

Visit the preview URL for this PR (updated for commit 55afc6d):

https://koobiq-next--prs-2078-yhqdgeju.web.app

(expires Fri, 25 Sep 2026 09:43:09 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Sign: c9e37e518febda70d0317d07e8ceb35ac43c534c

@lskramarov

Copy link
Copy Markdown
Contributor

@artembelik синтаксис со скобками пришел из доки angular:
image

зачем менять на PROJECT_NAME ?

@artembelik
artembelik marked this pull request as ready for review September 22, 2026 08:57
Copilot AI lite review requested due to automatic review settings September 22, 2026 08:57

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

Two documentation examples currently introduce incorrect/inconsistent CLI placeholders (approve-api argument format and a mismatched trace path placeholder) that should be corrected before merging.

Get a fresh assessment by requesting another Copilot review.

Review effort: Lite
Findings: 2 Low severity

Open (2)
What changed in this PR

This PR integrates prettier-plugin-sh into the repository’s Prettier setup so yarn run prettier (and lint-staged) also formats shell scripts, shell snippets in Markdown, and related files; it additionally updates documentation command placeholders to be compatible with the plugin’s parsing.

Changes:

  • Add prettier-plugin-sh to Prettier configuration and dependencies (with corresponding lockfile updates).
  • Reformat shell-related docs and scripts per the new formatter behavior.
  • Replace angle-bracket placeholders in shell snippets with plain-word placeholders (e.g. PROJECT_NAME, SCHEMATIC_NAME) to avoid redirection parsing.
File Description
yarn.lock Adds lock entries for prettier-plugin-sh and its dependencies.
package.json Adds prettier-plugin-sh to devDependencies.
.prettierrc.js Registers prettier-plugin-sh in Prettier plugins list.
.prettierignore Ignores Husky-generated hooks and .github/CODEOWNERS to avoid unwanted reformatting.
tools/​e2e/​entrypoint.sh Shell formatting changes produced by the new Prettier plugin.
AGENTS.md Updates contributor guidance to mention the sh plugin and placeholder rules.
docs/​PUBLIC_API.md Updates the approve-api command placeholder in docs.
docs/​guides/​06-testing.md Re-formats Playwright troubleshooting commands and placeholders.
docs/​guides/​05-releasing-packages.md Re-formats a release helper shell loop for readability/consistency.
docs/​guides/​schematics.en.mdx Replaces angle-bracket schematic placeholder with a Prettier-safe placeholder.
docs/​guides/​schematics.ru.mdx Replaces angle-bracket schematic placeholder with a Prettier-safe placeholder.
docs/​guides/​migration.en.mdx Updates migration command examples to use Prettier-safe placeholders.
docs/​guides/​migration.ru.mdx Updates migration command examples to use Prettier-safe placeholders.
packages/​schematics/​src/​migrations/​top-bar-container-selectors/​README.md Updates --project placeholder in schematic usage examples.
packages/​schematics/​src/​migrations/​toast-stack-and-defaults/​README.md Updates --project placeholder in schematic usage examples.
packages/​schematics/​src/​migrations/​tag-slots/​README.md Updates --project placeholder in schematic usage examples.
packages/​schematics/​src/​migrations/​tag-list-cleaner/​README.md Updates --project placeholder in schematic usage examples.
packages/​schematics/​src/​migrations/​splitter-deprecated-path/​README.md Updates --project placeholder in schematic usage examples.
packages/​schematics/​src/​migrations/​scrollbar-deprecated-path/​README.md Updates --project placeholder in schematic usage examples.
packages/​schematics/​src/​migrations/​read-state-dwell-handlers/​README.md Updates --project placeholder in schematic usage examples.
packages/​schematics/​src/​migrations/​notification-center-signals/​README.md Updates --project placeholder in schematic usage examples.
packages/​schematics/​src/​migrations/​new-icons-pack/​README.md Updates placeholders and line wrapping in multi-line schematic command examples.
packages/​schematics/​src/​migrations/​mandatory-peer-dependencies/​README.md Updates --project placeholder in schematic usage examples.
packages/​schematics/​src/​migrations/​locale-configuration-providers/​README.md Updates --project placeholder in schematic usage examples.
packages/​schematics/​src/​migrations/​loader-overlay-size-attr/​README.md Updates --project placeholder in schematic usage examples.
packages/​schematics/​src/​migrations/​list-tree-multiple-input/​README.md Updates --project placeholder in schematic usage examples.
packages/​schematics/​src/​migrations/​icons-replacement/​README.md Updates --project and JSON-path placeholders in schematic usage examples.
packages/​schematics/​src/​migrations/​filter-bar-rename-action/​README.md Updates --project placeholder in schematic usage examples.
packages/​schematics/​src/​migrations/​file-upload-deprecated-outputs/​README.md Updates --project placeholder in schematic usage examples.
packages/​schematics/​src/​migrations/​empty-state-size-attr/​README.md Updates --project placeholder in schematic usage examples.
packages/​schematics/​src/​migrations/​dropdown-demote-overlay/​README.md Updates --project placeholder in schematic usage examples.
packages/​schematics/​src/​migrations/​deprecated-icons/​README.md Updates --project placeholder in schematic usage examples.
packages/​schematics/​src/​migrations/​css-selectors/​README.md Updates --project placeholder in schematic usage examples.
packages/​schematics/​src/​migrations/​button-truncation/​README.md Updates --project placeholder in schematic usage examples.
packages/​schematics/​src/​migrations/​button-toggle-signals-and-aria/​README.md Updates --project placeholder in schematic usage examples.
packages/​schematics/​src/​migrations/​button-state-and-styles/​README.md Updates --project placeholder in schematic usage examples.
packages/​schematics/​src/​migrations/​autocomplete-panel-width-auto/​README.md Updates --project placeholder in schematic usage examples.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread docs/PUBLIC_API.md Outdated
Comment thread docs/guides/06-testing.md Outdated
@artembelik
artembelik marked this pull request as draft September 22, 2026 09:02
artembelik and others added 2 commits September 22, 2026 12:26
Bring back the quoted `"<your project>"` placeholders: they keep the familiar look and are still
valid shell, so the sh plugin formats the snippets instead of rewriting or skipping them.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@artembelik

artembelik commented Sep 22, 2026

Copy link
Copy Markdown
Contributor Author

зачем менять на PROJECT_NAME ?

вернул "<your project>" - скобки оставили как в доке Angular, но в кавычках: без них shell читает < и > как редиректы, и prettier-plugin-sh либо ломает команду (--project project < your > --fix=false), либо молча пропускает блок

@artembelik
artembelik marked this pull request as ready for review September 22, 2026 09:37
@github-actions

Copy link
Copy Markdown

🚨 E2E tests failed

Review the report for details.


💡 Comment /approve-snapshots to approve snapshot changes.

@github-actions

Copy link
Copy Markdown

🚨 E2E tests failed

Review the report for details.


💡 Comment /approve-snapshots to approve snapshot changes.

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.

3 participants