{"id":20779237,"url":"https://github.com/bolt/codingstyle","last_synced_at":"2025-06-18T06:36:26.902Z","repository":{"id":30217009,"uuid":"33768023","full_name":"bolt/codingstyle","owner":"bolt","description":"PHP_CodeSniffer rule set for Bolt","archived":false,"fork":false,"pushed_at":"2019-01-04T08:33:18.000Z","size":71,"stargazers_count":2,"open_issues_count":0,"forks_count":2,"subscribers_count":14,"default_branch":"master","last_synced_at":"2025-03-30T19:22:16.468Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://bolt.cm","language":"PHP","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/bolt.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}},"created_at":"2015-04-11T08:07:17.000Z","updated_at":"2019-04-01T15:35:27.000Z","dependencies_parsed_at":"2022-09-07T20:31:27.239Z","dependency_job_id":null,"html_url":"https://github.com/bolt/codingstyle","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bolt%2Fcodingstyle","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bolt%2Fcodingstyle/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bolt%2Fcodingstyle/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bolt%2Fcodingstyle/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bolt","download_url":"https://codeload.github.com/bolt/codingstyle/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251771554,"owners_count":21641277,"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":[],"created_at":"2024-11-17T13:26:45.729Z","updated_at":"2025-04-30T19:42:17.683Z","avatar_url":"https://github.com/bolt.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"Bolt coding style standard\n==========================\n\nPHP\n---\n\n[Bolt](https://github.com/bolt) tries to adhere a coding style based on PSR-2\nand the Symfony2 coding standard.\n\n### [CodeSniffer][phpcs]\n\nTo use run:\n```\ncomposer require bolt/codingstyle squizlabs/php_codesniffer escapestudios/symfony2-coding-standard:^3.0@dev --dev\n```\nAdd a `global` before `require` if you want to install it globally.\n\nIf installing globally you also need to configure the `installed_paths`:\n```\nphpcs --config-set installed_paths \"$(composer config --global data-dir)\"\n```\n\nThen create a CodeSniffer config file named `phpcs.xml.dist` in your project root:\n```xml\n\u003c?xml version=\"1.0\"?\u003e\n\u003cruleset\u003e\n    \u003c!-- Add color to output...umm duh --\u003e\n    \u003carg name=\"colors\"/\u003e\n\n    \u003c!-- Files or folders to sniff --\u003e\n    \u003cfile\u003esrc\u003c/file\u003e\n    \u003cfile\u003etests\u003c/file\u003e\n\n    \u003c!-- Path to our coding standard folder --\u003e\n    \u003crule ref=\"vendor/bolt/codingstyle/Bolt\"/\u003e\n\u003c/ruleset\u003e\n```\nAdditional changes can be made here. See [CodeSniffer's annotated ruleset][phpcs_ruleset] for more information.\n\n`phpcs.xml.dist` should be committed for all developers to use.  \nAn `phpcs.xml` file can also be create which takes precedence over `phpcs.xml.dist` for local\nchanges. This file should be ignored from git.\n\n\n### [Code Fixer][code_fixer]\n\nTo use run:\n```bash\ncomposer require bolt/codingstyle friendsofphp/php-cs-fixer --dev\n```\nAdd a `global` before `require` if you want to install it globally.\n\nThen create a config file named `.php_cs.dist` in your project root:\n```php\n\u003c?php\n\nreturn Bolt\\CsFixer\\Config::create()\n    // addRules() accepts arrays and traversable objects.\n    -\u003eaddRules(\n        // Create Bolt's standard rules.\n        Bolt\\CsFixer\\Rules::create()\n            // Enable risky rules.\n            -\u003erisky()\n            // Enable PHP 5.6, 7.0, and 7.1 rules. Methods exist for each version.\n            //-\u003ephp71()\n    )\n\n    // Modify existing rules or add new ones.\n    -\u003eaddRules([\n        'heredoc_to_nowdoc' =\u003e false,\n        'mb_str_functions'  =\u003e true,\n    ])\n\n    // Add directories to scan.\n    -\u003ein('src', 'tests')\n;\n```\nSee their [website][code_fixer] for a list of rules and additional configuration options.\n\n`.php_cs.dist` should be committed for all developers to use.  \nAn `.php_cs` file can also be create which takes precedence over `.php_cs.dist` for local\nchanges. This file should be ignored from git. \n\nJavaScript\n----------\n\nThere's no explicitly written style yet, but when creating the files needed for\nBolt using the grunt toolchain there's a target linting the javascript code.\n\n[phpcs]: http://pear.php.net/package/PHP_CodeSniffer\n[phpcs_ruleset]: https://github.com/squizlabs/PHP_CodeSniffer/wiki/Annotated-ruleset.xml\n[code_fixer]: http://cs.sensiolabs.org\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbolt%2Fcodingstyle","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbolt%2Fcodingstyle","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbolt%2Fcodingstyle/lists"}