* eslint-disable no-alert */ alert ( 'foo' ) /* eslint-enable */ alert ( 'foo' ) // eslint-disable-line no-alert // eslint-disable-next-line no-alert alert ( 'foo' ) įor full details, see the eslint documentation. For full details, please refer to the Ignoring Parts of a File section of the CodeSniffer wiki.ĮSlint is run as part of the build process with grunt. The CodeSniffer supports this via special inline tags like phpcs:disable and phpcs:disable. An example of such exclusion is to declare that the script is supposed to be used by anonymous internet users - so that the login check does not apply. This should be done in very rare cases and the reasons for it must be well documented in the code. In certain situations, you may wish to exclude a part of the code from checking by the CodeSniffer. See Should_coding_style_issues_in_existing_code_be_fixed for guidance of when to fix lint issues in existing code. There are future plans ( CONTRIB-6209) to move the rules into a more distributable form separate from the codechecker plugin itself.Īs thousands of lines of Moodle php code was written before linting was introduced, lint errors are present in some parts of existing code. When configuring other PHP_CodeSniffer integrations the path to the rules file is /path/to/local_codechecker/moodle/ruleset.xml. ![]() ![]() The rules defined as part of the Code-checker plugin and if that plugin is installed to Moodle you can use the web user interface to check files. At it's best linting helps developers learn, with editor integration and fast feedback meaning that human code reviews can focus on the non-trivial details while linter can be the tireless mistake-preventing machine. Linting is used to ensure consistent coding style, detect common errors and enforce best practices.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |