{"id":13600766,"url":"https://github.com/yaegassy/coc-php-cs-fixer","last_synced_at":"2025-03-09T10:30:41.675Z","repository":{"id":38286995,"uuid":"348348776","full_name":"yaegassy/coc-php-cs-fixer","owner":"yaegassy","description":"PHP CS Fixer (PHP Coding Standards Fixer) and Laravel Pint extension for coc.nvim","archived":false,"fork":false,"pushed_at":"2024-03-30T02:30:20.000Z","size":184,"stargazers_count":30,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-06T10:56:09.334Z","etag":null,"topics":["coc","coc-extensions","coc-nvim","laravel","neovim","php","php-cs-fixer","pint","vim"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/coc-php-cs-fixer","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/yaegassy.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-03-16T12:59:55.000Z","updated_at":"2024-09-08T21:30:40.000Z","dependencies_parsed_at":"2024-01-16T23:26:14.622Z","dependency_job_id":"64964c23-10ae-42f1-a8ba-19942d33d819","html_url":"https://github.com/yaegassy/coc-php-cs-fixer","commit_stats":{"total_commits":143,"total_committers":3,"mean_commits":"47.666666666666664","dds":"0.013986013986013957","last_synced_commit":"0ab4916fdbd0a0f7dbbc6962f5e7b74c2cd2f708"},"previous_names":[],"tags_count":33,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yaegassy%2Fcoc-php-cs-fixer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yaegassy%2Fcoc-php-cs-fixer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yaegassy%2Fcoc-php-cs-fixer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yaegassy%2Fcoc-php-cs-fixer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yaegassy","download_url":"https://codeload.github.com/yaegassy/coc-php-cs-fixer/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242679489,"owners_count":20168158,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["coc","coc-extensions","coc-nvim","laravel","neovim","php","php-cs-fixer","pint","vim"],"created_at":"2024-08-01T18:00:48.154Z","updated_at":"2025-03-09T10:30:41.289Z","avatar_url":"https://github.com/yaegassy.png","language":"TypeScript","funding_links":[],"categories":["Language Support"],"sub_categories":[],"readme":"# coc-php-cs-fixer\n\n[PHP CS Fixer](https://github.com/FriendsOfPHP/PHP-CS-Fixer) (PHP Coding Standards Fixer) and [Laravel Pint](https://github.com/laravel/pint) extension for [coc.nvim](https://github.com/neoclide/coc.nvim)\n\n## Install\n\n`:CocInstall coc-php-cs-fixer`\n\n## Features\n\n`php-cs-fixer` and `laravel/pint` are supported.\n\n- Formatter\n- Command\n- Code Action\n- Status Bar\n- `pint.json` Auto Completion and JSON validation\n- Downloader\n\n## Note\n\nThe formatter tool used is `php-cs-fixer` by default. If you want to use `laravel/pint`, change the `php-cs-fixer.activateTool` setting in `coc-settings.json`.\n\n```json\n{\n  \"php-cs-fixer.activateTool\": \"pint\"\n}\n```\n\n- [DEMO](https://github.com/yaegassy/coc-php-cs-fixer/pull/7#issue-1293669659)\n\n---\n\nDetects the `php-cs-fixer` or `pint` tool. They are prioritized in order from the top.\n\n1. `php-cs-fixer.toolPath` or `php-cs-fixer.pint.toolPath`\n1. `vendor/bin/php-cs-fixer` or `vendor/bin/pint`\n1. `php-cs-fixer` or `pint` retrieved by the download feature (`:CocCommand php-cs-fixer.download` or `php-cs-fixer.pintDownload`)\n   - **php-cs-fixer**:\n     - Mac/Linux: `~/.config/coc/extensions/coc-php-cs-fixer-data/php-cs-fixer`\n     - Windows: `~/AppData/Local/coc/extensions/coc-php-cs-fixer-data/php-cs-fixer`\n   - **pint**:\n     - Mac/Linux: `~/.config/coc/extensions/coc-php-cs-fixer-data/pint`\n     - Windows: `~/AppData/Local/coc/extensions/coc-php-cs-fixer-data/pint`\n\nIf \"1\" and \"2\" above are not detected, the download feature will be executed (The prompt will be displayed)\n\n## Usage\n\n`coc-php-cs-fixer` can be executed in multiple ways.\n\n### Auto run when saving a file\n\nAdd the settings to `coc-settings.json`.\n\n```jsonc\n{\n  \"[php]\": {\n    \"coc.preferences.formatOnSave\": true\n  },\n}\n```\n\nIf the file size is large or the tool (`php-cs-fixer` or `pint`) is slow in your environment, formatting may not work properly when saving. In coc.nvim, time-consuming formatting on save is canceled.\n\nIn that case, please perform the formatting in another way.\n\n### Run from CocCommand\n\n- If the `php-cs-fixer.activateTool` setting is `php-cs-fixer`\n  - `:CocCommand php-cs-fixer.fix`\n- If the `php-cs-fixer.activateTool` setting is `pint`\n  - `:CocCommand php-cs-fixer.pintFix`\n\n### Run formatting from call function\n\n- `:call CocAction('format')`\n\n### Run codeAction from call function\n\n- `:call CocAction('codeAction')`\n  - If the `php-cs-fixer.activateTool` setting is `php-cs-fixer`\n    - Choose action: `\"Run: php-cs-fixer.fix\"`\n  - If the `php-cs-fixer.activateTool` setting is `pint`\n    - Choose action: `\"Run: php-cs-fixer.pintFix\"`\n\n## Precedence of \"php-cs-fixer\" and \"laravel/pint\" configuration files and options\n\n### php-cs-fixer\n\n1. `php-cs-fixer.config` setting for this extension.\n2. `.php-cs-fixer.php` or `.php-cs-fixer.dist.php` config file in the workspace (project) root.\n3. options-reated settings for this extension. e.g. `php-cs-fixer.rules` and more.\n\n### pint\n\n1. `php-cs-fixer.pint.config` setting for this extension.\n2. `pint.json` config file in the workspace (project) root.\n3. options-reated settings for this extension. `php-cs-fixer.pint.preset`.\n\n## Configuration options\n\n- `php-cs-fixer.enable`: Enable coc-php-cs-fixer extension, default: `true`\n- `php-cs-fixer.activateTool`: Formatter tool to be used, valid option `[\"php-cs-fixer\", \"pint\"]`, default: `\"php-cs-fixer\"`\n- `php-cs-fixer.toolPath`: The path to the php-cs-fixer tool, default: `\"\"`\n- `php-cs-fixer.config`: Path to php-cs-fixer config file (--config), default: `\"\"`\n- `php-cs-fixer.useCache`: Use a cache file when fixing files (--using-cache), default: `false`\n- `php-cs-fixer.allowRisky`: Determines whether risky rules are allowed (--allow-risky), default: `false`\n- `php-cs-fixer.rules`: Rules to use when fixing files (--rules), e.g. `\"@PSR12,@Symfony\"`, default: `\"@PSR12\"`\n- `php-cs-fixer.enableIgnoreEnv`: Add the environment variable `PHP_CS_FIXER_IGNORE_ENV=1` and run php-cs-fixer, default: `false`\n- `php-cs-fixer.pint.toolPath`: The path to the pint tool, default: `\"\"`\n- `php-cs-fixer.pint.config`: Path to `pint.json` config file (`--config`), default: `\"\"`\n- `php-cs-fixer.pint.preset`: Presets define a set of rules that can be used to fix code style issues in your code (`--preset`), valid option `[\"laravel\", \"psr12\", \"symfony\"]`, default: `\"laravel\"`\n- `php-cs-fixer.downloadCheckOnStartup`: If `php-cs-fixer` or `pint` is not present at startup, run the built-in download. The tool to be downloaded will follow the `php-cs-fixer.activateTool` configuration, default: `true`\n- `php-cs-fixer.downloadMajorVersion`: Specify the major version of php-cs-fixer to download for the extension, valid option `[2, 3]`, default: `3`\n- `php-cs-fixer.enableFormatProvider`: Enable format provider, default: `true`\n- `php-cs-fixer.enableActionProvider`: Enable codeAction provider, default: `true`\n- `php-cs-fixer.terminal.enableSplitRight`: Use vertical belowright for dryRunDiff and pintTest terminal window, default: `false`\n\n## Commands\n\n- `php-cs-fixer.fix`: Run php-cs-fixer fix\n- `php-cs-fixer.dryRunDiff`: Run php-cs-fixer fix with `--dry-run` and `--diff` in a terminal window | [DEMO](https://github.com/yaegassy/coc-php-cs-fixer/pull/8)\n- `php-cs-fixer.pintFix`: Run pint\n- `php-cs-fixer.pintTest`: Run pint with `--test` in a terminal window | [DEMO](https://github.com/yaegassy/coc-php-cs-fixer/pull/9#issue-1295053515)\n- `php-cs-fixer.download`: Download php-cs-fixer\n   - By default, the \"v3\" series will be downloaded. If you want to download \"v2\" series, please change the `php-cs-fixer.downloadMajorVersion` setting.\n- `php-cs-fixer.pintDownload`: Download pint\n- `php-cs-fixer.showOutput`: Show php-cs-fixer output channel\n\n## Code Actions\n\n- `Run: php-cs-fixer.fix`\n- `Run: php-cs-fixer.pintFix`\n\n## Thanks\n\n- \u003chttps://github.com/FriendsOfPHP/PHP-CS-Fixer\u003e\n- \u003chttps://github.com/laravel/pint\u003e\n- \u003chttps://github.com/mlocati/php-cs-fixer-configurator\u003e\n- \u003chttps://github.com/open-southeners/vscode-laravel-pint\u003e\n\n## License\n\nMIT\n\n---\n\n\u003e This extension is built with [create-coc-extension](https://github.com/fannheyward/create-coc-extension)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyaegassy%2Fcoc-php-cs-fixer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyaegassy%2Fcoc-php-cs-fixer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyaegassy%2Fcoc-php-cs-fixer/lists"}