Git Product home page Git Product logo

beautifier-php-codesniffer's Introduction

beautifier-php-codesniffer

Build Status Test Coverage Maintainability

PHP_CodeSniffer beautifier for Unibeautify

Installation

npm install --global @unibeautify/beautifier-php-codesniffer

Then change .unibeautifyrc.yml:

PHP:
    beautifiers: ["PHP_CodeSniffer"]

Usage

See unibeautify-cli for details.

beautifier-php-codesniffer's People

Contributors

glavin001 avatar renovate-bot avatar renovate[bot] avatar stevenzeck avatar

Stargazers

 avatar

Watchers

 avatar  avatar

beautifier-php-codesniffer's Issues

Dependency Dashboard

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 Unavailable
npm npm-run-all Available
npm read-pkg-up Available
npm tslint Unavailable
npm tslint-microsoft-contrib Unavailable

Rate-Limited

These updates are currently rate-limited. Click on a checkbox below to force their creation now.

  • Update dependency @types/node to v12.20.55
  • Update dependency tslint to v6
  • ๐Ÿ” Create all rate-limited PRs at once ๐Ÿ”

Edited/Blocked

These updates have been manually edited so Renovate will no longer make changes. To discard all commits and start over, click on a checkbox.

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Detected dependencies

nodenv
.node-version
  • node v9.10.1
npm
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
.travis.yml

  • Check this box to trigger a request for Renovate to run again on this repository

Overrides the file with some log output?

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

PHP_CodeSniffer Support

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

Action Required: Fix Renovate Configuration

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)

VSCode prints abort format on save error

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.

screenshot 2018-08-14 at 09 20 52

Formatting with Option+Shift+F still works. Maybe a VSCode issue, but I wanted to submit it here first.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.