PHP_CodeSniffer format validation rules

Source: Internet
Author: User
Recently Added validation rules, you know phpcs install phpcspearinstallPHP_CodeSniffer use phpcs -- config-setencodingutf-8phpcs -- config-settab_width4phpcs -- config-setshow_warings0phpcs -- config-showArray ([encoding] UTF-8 [tab_width]

Recently, validation rules were added to the project, install phpcs pear install PHP_CodeSniffer using phpcs -- config-set encoding = UTF-8 phpcs -- config-set tab_width = 4 phpcs -- config-set show_warings = 0 phpcs -- config-show Array ([encoding] = UTF-8 [tab_width]

Check rules have been added for recent projects, you know

Phpcs

Install phpcs

   pear install PHP_CodeSniffer

Use

 phpcs --config-set encoding=utf-8 phpcs --config-set tab_width=4 phpcs --config-set show_warings=0 phpcs --config-show Array (    [encoding] => utf-8    [tab_width] => 4    [show_warnings] => 0 ) phpcs -s *.php

Because the project verifies Doc comment and file comment, I used

  DoxygenToolkit.vim

The plug-in implements function comment, but for file comment and doc comment, DoxygenToolkit does not meet my project requirements.

So I spent a little time writing a small vim plug-in python, specifically adding annotations that meet my needs,

Commentvim. vim git hub address: https://github.com/childeYin/vim-comment-plugin

Original article address: PHP_CodeSniffer format validation rules. Thank you for sharing them.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.