PHP_CodeSniffer beautifier for Unibeautify
npm install --global @unibeautify/beautifier-php-codesniffer
Then change .unibeautifyrc.yml
:
PHP:
beautifiers: ["PHP_CodeSniffer"]
See unibeautify-cli
for details.
PHP_CodeSniffer beautifier for Unibeautify
Home Page: https://github.com/squizlabs/PHP_CodeSniffer
License: MIT License
PHP_CodeSniffer beautifier for Unibeautify
npm install --global @unibeautify/beautifier-php-codesniffer
Then change .unibeautifyrc.yml
:
PHP:
beautifiers: ["PHP_CodeSniffer"]
See unibeautify-cli
for details.
This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.
Warning
These dependencies are deprecated:
Datasource | Name | Replacement PR? |
---|---|---|
npm | @types/read-pkg-up |
|
npm | npm-run-all |
|
npm | read-pkg-up |
|
npm | tslint |
|
npm | tslint-microsoft-contrib |
These updates are currently rate-limited. Click on a checkbox below to force their creation now.
These updates have been manually edited so Renovate will no longer make changes. To discard all commits and start over, click on a checkbox.
tmp
, @types/tmp
)These updates have all been created already. Click a checkbox below to force a retry/rebase of any.
node
, @types/node
)@types/jest
, jest
, ts-jest
).node-version
node v9.10.1
package.json
read-pkg-up ^7.0.0
tmp 0.1.0
@types/jest 24.9.1
@types/node 12.20.55
@types/read-pkg-up 6.0.0
@types/tmp 0.1.0
jest 24.9.0
npm-run-all 4.1.5
rimraf 3.0.2
ts-jest 24.3.0
tslint 5.20.1
tslint-clean-code 0.2.10
tslint-microsoft-contrib 6.2.0
typescript 3.9.10
unibeautify 0.17.1
unibeautify >= 0.15.0
.travis.yml
normal .php files are working fine, but when I select a plain text as php template and run the formatter this weird thing happen:
Before:
<?php
return PhpCsFixer\Config::create()
->setRiskyAllowed(true)
->setIndent(' ')
->setLineEnding("\n")
->setRules([
'@Symfony' => true,
'indentation_type' => true,
'array_indentation' => true,
// 'array_syntax' => ['syntax' => 'short'],
'dir_constant' => true,
'heredoc_to_nowdoc' => true,
'linebreak_after_opening_tag' => true,
'modernize_types_casting' => true,
'semicolon_after_instruction' => true,
'align_multiline_comment' => true,
'doctrine_annotation_array_assignment' => true,
'general_phpdoc_annotation_remove' => true,
'list_syntax' => true,
'single_line_comment_style' => true,
'combine_consecutive_unsets' => true,
'method_separation' => true,
'no_multiline_whitespace_before_semicolons' => true,
'single_quote' => true,
'concat_space' => ['spacing' => 'one'],
'phpdoc_align' => true,
'phpdoc_annotation_without_dot' => true,
'phpdoc_indent' => true,
'phpdoc_inline_tag' => true,
'binary_operator_spaces' => [
'align_double_arrow' => false,
'align_equals' => false,
],
'braces' => [
'allow_single_line_closure' => true,
],
'declare_equal_normalize' => true,
'function_typehint_space' => true,
'hash_to_slash_comment' => true,
'include' => true,
'lowercase_cast' => true,
'no_extra_consecutive_blank_lines' => [
'curly_brace_block',
'extra',
'parenthesis_brace_block',
'square_brace_block',
'throw',
'use',
],
'single_blank_line_before_namespace' => true,
'ternary_operator_spaces' => true,
'trim_array_spaces' => true,
'unary_operator_spaces' => true,
'whitespace_after_comma_in_array' => true,
'no_multiline_whitespace_before_semicolons' => true,
'no_unreachable_default_argument_value' => true,
'no_useless_else' => true,
'no_useless_return' => true,
'no_php4_constructor' => true,
'no_short_echo_tag' => true,
'ordered_class_elements' => true,
'ordered_imports' => true,
'phpdoc_add_missing_param_annotation' => true,
'phpdoc_order' => true,
'phpdoc_types_order' => true,
'doctrine_annotation_braces' => true,
'doctrine_annotation_indentation' => true,
'doctrine_annotation_spaces' => true,
]);
After:
No fixable errors were found
Time: 34ms; Memory: 4Mb
So it outputs some log into the file and removes everything
From @muuvmuuv on June 20, 2018 12:4
Beautifier Details
Name: PHP_CodeSniffer (phpcs)
Link to project/homepage: https://github.com/squizlabs/PHP_CodeSniffer
If this is to update an existing beautifier, please describe what should be updated
currently, in PHP just php-cs-fixer is supported, but phpcs also supports auto fixing with the phpcbf
command. It would be nice to support phpcs too
Languages Supported: PHP
How is it run (node, terminal, etc): PHP terminal with phpcs <file> <options>
Copied from original issue: Unibeautify/unibeautify#110
There is an error with this repository's Renovate configuration that needs to be fixed. As a precaution, Renovate will stop PRs until it is resolved.
Error type: Cannot find preset's package (github>whitesource/merge-confidence:beta)
Today VSCode dev console printed an abort warning that it has aborted formatting on saving when using Unibeautify with phpcs
. Could happen in other languages too but I have only noticed it on PHP_CodeSniffer yet.
Formatting with Option+Shift+F
still works. Maybe a VSCode issue, but I wanted to submit it here first.
I get the following error when trying to format my PHP files:
Repo to reproduce: https://github.com/muuvmuuv/configs
VSCode: 1.25.1 โ 1dfc5e557209371715f655691b1235b6b26a06be x64
Unibeautify: 0.6.0
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.