{"id":17190329,"url":"https://github.com/lode/linting-scripts","last_synced_at":"2025-09-04T06:35:20.901Z","repository":{"id":245805204,"uuid":"819084150","full_name":"lode/linting-scripts","owner":"lode","description":"Scripts and config for PHP linters","archived":false,"fork":false,"pushed_at":"2025-03-16T13:22:11.000Z","size":15,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-25T05:43:00.038Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Shell","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/lode.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-06-23T18:22:15.000Z","updated_at":"2025-03-16T13:22:14.000Z","dependencies_parsed_at":"2025-09-04T06:35:20.237Z","dependency_job_id":null,"html_url":"https://github.com/lode/linting-scripts","commit_stats":null,"previous_names":["lode/linting-scripts"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/lode/linting-scripts","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lode%2Flinting-scripts","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lode%2Flinting-scripts/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lode%2Flinting-scripts/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lode%2Flinting-scripts/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lode","download_url":"https://codeload.github.com/lode/linting-scripts/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lode%2Flinting-scripts/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273566844,"owners_count":25128629,"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","status":"online","status_checked_at":"2025-09-04T02:00:08.968Z","response_time":61,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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-10-15T01:14:00.713Z","updated_at":"2025-09-04T06:35:20.876Z","avatar_url":"https://github.com/lode.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PHP linting scripts \u0026 configuration\n\nThe files from this repository can be added to any PHP project to setup complete linting.\n\nThe configuration is explicitly not using any baseline feature of linters.\nInstead, it uses a low level for required checks, and adds a bonus check with the highest levels.\nThis way you are enticed, not required, to improve upon what you can handle.\nYou should slowly increase the levels for the required checks.\nE.g. once a week bump the level and run through the whole code base.\n\nThis repository works well together with [lode/playground](https://github.com/lode/playground).\n\n\n## Linters\n\n- phpcs\n- phpstan\n- rector\n- swiff-knife\n- symfony (container, twig, yaml)\n\n\n## Setup\n\nTo get started clone the repository and copy to your own repository:\n\n- `script/*`\n- `phpcs.xml`\n- `phpcs.bonus.xml`\n- `phpstan.neon`\n- `phpstan.bonus.neon`\n- `rector.php`\n- `.github/workflows/lint.yml`\n- the Usage section of this readme to your own documentation, e.g. `script/README.md`\n\nAnd install composer packages for the linters:\n\n```bash\ncomposer require --dev \\\n    squizlabs/php_codesniffer \\\n    phpstan/phpstan \\\n    phpstan/extension-installer \\\n    phpstan/phpstan-strict-rules \\\n    phpstan/phpstan-deprecation-rules \\\n    rector/rector \\\n    rector/swiss-knife\n```\n\nOptionally you can setup more phpstan extensions:\n\n```bash\ncomposer require --dev \\\n    phpstan/phpstan-doctrine \\\n    phpstan/phpstan-phpunit \\\n    phpstan/phpstan-symfony\n```\n\n\n## Usage\n\nDaily usage to use linters on the current branch's diff:\n- `./script/lint`\n- `./script/fix`\n\nRun only a single tool (on the current branch's _files_):\n- `./script/lint phpstan`\n- `./script/fix rector`\n\nRun a single tool for the whole project:\n- `./script/lint phpstan --everything`\n- `./script/fix rector --everything`\n\nDo better than what's required:\n- `./script/lint --bonus`\n- `./script/fix --bonus`\n- `./script/lint phpstan --bonus`\n- `./script/fix rector --bonus`\n\nGet more options:\n- `./script/lint --help`\n- `./script/fix --help`\n\n\n## Using with(out) Docker\n\nThis repository works well together with the Docker setup from [lode/playground](https://github.com/lode/playground).\n\nIf you don't use that repository, and experience issues running the scripts, you can change:\n\n- `./script/lint` to remove the part defining `CONSOLE_PREFIX`\n- `./script/fix` to remove the part defining `CONSOLE_PREFIX` and `CONSOLE_PREFIX_WITHOUT_TTY`\n- `./script/lint` and `./script/fix` to remove all references of `$CONSOLE_PREFIX ` and `$CONSOLE_PREFIX_WITHOUT_TTY `\n\nAlternatively, or if you run another Docker setup, you can adjust the parts defining the console-prefix to work with your Docker setup.\n\n\n## To Do\n\n- Use `linting.env` file for configuration\n- Setup as composer package\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flode%2Flinting-scripts","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flode%2Flinting-scripts","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flode%2Flinting-scripts/lists"}