Skip to content

Commit

Permalink
Regular expression fix for PHP CS Fixer version (#4611)
Browse files Browse the repository at this point in the history
* regular expresion fix for issue #4610

* fixed wrong version related to PHP CS Fixer

* add support to NO_COLOR (see https://no-color.org/) when getting linter version
  • Loading branch information
llaville authored Jan 28, 2025
1 parent 1e4e64a commit 42d85c5
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .automation/generated/linter-versions.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
"npm-package-json-lint": "8.0.0",
"perlcritic": "1.156",
"php": "7.4.26",
"php-cs-fixer": "7.4.0",
"php-cs-fixer": "3.68.3",
"phpcs": "3.11.3",
"phplint": "9.5.6",
"phpstan": "2.1.2",
Expand Down
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ Note: Can be used with `oxsecurity/megalinter@beta` in your GitHub Action mega-l
- Linters enhancements

- Fixes
- [GH-4610](https://github.com/oxsecurity/megalinter/issues/4610) : PHP CS Fixer linter version available is not correct since running on PHP 8.4 runtime (by @llaville)

- Reporters

Expand All @@ -35,6 +36,7 @@ Note: Can be used with `oxsecurity/megalinter@beta` in your GitHub Action mega-l
- [editorconfig-checker](https://editorconfig-checker.github.io/) from 3.1.2 to **3.2.0** on 2025-01-28
- [powershell_formatter](https://github.com/PowerShell/PSScriptAnalyzer) from 7.4.6 to **7.5.0** on 2025-01-28
- [powershell](https://github.com/PowerShell/PSScriptAnalyzer) from 7.4.6 to **7.5.0** on 2025-01-28
- [php-cs-fixer](https://cs.symfony.com/) from 3.68.0 to **3.68.3** on 2025-01-28
<!-- linter-versions-end -->

## [v8.4.1] - 2024-01-??
Expand Down
1 change: 1 addition & 0 deletions megalinter/Linter.py
Original file line number Diff line number Diff line change
Expand Up @@ -1149,6 +1149,7 @@ def get_linter_version_output(self):
subprocess_env = {
**config.build_env(self.request_id, True, self.unsecured_env_variables),
"FORCE_COLOR": "0",
"NO_COLOR": "true",
}
try:
process = subprocess.run(
Expand Down
1 change: 1 addition & 0 deletions megalinter/descriptors/php.megalinter-descriptor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,7 @@ linters:
cli_config_arg_name: "--config"
cli_lint_fix_remove_args:
- "--dry-run"
version_extract_regex: "(?<=PHP CS Fixer )\\d+(\\.\\d+)+"
examples:
- "php-cs-fixer check myfile.php"
- "php-cs-fixer check mydir"
Expand Down

0 comments on commit 42d85c5

Please sign in to comment.