From 4484d405b17b89a102225632debf4ffe150f4f2f Mon Sep 17 00:00:00 2001 From: "Oliver G. Mueller" Date: Tue, 19 Mar 2024 10:57:01 +0100 Subject: [PATCH] fixed linting and switch scrutinizer to PHP 8.1 --- .editorconfig | 13 ++----------- .github/workflows/ci.yml | 7 ++++++- .scrutinizer.yml | 2 +- .yamllint.yaml | 1 - README.md | 34 +++++++++++++++++----------------- 5 files changed, 26 insertions(+), 31 deletions(-) diff --git a/.editorconfig b/.editorconfig index 536482b..ca7747d 100644 --- a/.editorconfig +++ b/.editorconfig @@ -28,13 +28,12 @@ ij_shell_redirect_followed_by_space = false ij_shell_switch_cases_indented = false [{*.yml,*.yaml}] -indent_size = 4 -ij_continuation_indent_size = 4 +indent_size = 2 +ij_continuation_indent_size = 2 ij_yaml_keep_indents_on_empty_lines = false ij_yaml_keep_line_breaks = true [*.php] -ij_continuation_indent_size = 4 ij_php_align_assignments = true ij_php_align_class_constants = true ij_php_align_group_field_declarations = true @@ -248,19 +247,11 @@ ij_json_spaces_within_braces = false ij_json_spaces_within_brackets = false ij_json_wrap_long_lines = false -[package.json] -indent_size = 2 - [{phpunit.xml.dist,*.xslt,*.xul,*.rng,*.xsl,*.xsd,*.ant,*.jhm,*.tld,*.fxml,*.wsdl,*.jrxml,*.xml,*.jnlp,*.xlf}] ij_xml_block_comment_at_first_column = true ij_xml_keep_indents_on_empty_lines = false ij_xml_line_comment_at_first_column = true -[Jenkinsfile*] -indent_size = 2 -tab_width = 2 -ij_continuation_indent_size = 2 - [.editorconfig] ij_editorconfig_align_group_field_declarations = false ij_editorconfig_space_after_colon = false diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 12e6937..43aae3c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,5 +1,8 @@ +# https://docs.github.com/en/actions + name: "CI" -on: + +on: # yamllint disable-line rule:truthy push: paths-ignore: - "README.md" @@ -11,6 +14,8 @@ on: paths-ignore: - "README.md" - "LICENSE.md" + - ".scrutinizer.yml" + - ".editorconfig" branches: ["main"] permissions: diff --git a/.scrutinizer.yml b/.scrutinizer.yml index 92f2a91..1e54ea3 100644 --- a/.scrutinizer.yml +++ b/.scrutinizer.yml @@ -1,6 +1,6 @@ build: environment: - php: 8.3.1 + php: 8.1.2 nodes: analysis: tests: diff --git a/.yamllint.yaml b/.yamllint.yaml index 89dacff..d8daf0a 100644 --- a/.yamllint.yaml +++ b/.yamllint.yaml @@ -59,7 +59,6 @@ rules: allowed-values: - "false" - "true" - - "on" yaml-files: - "*.yaml" diff --git a/README.md b/README.md index 5887d4b..69a5e29 100644 --- a/README.md +++ b/README.md @@ -25,35 +25,35 @@ Here is an example of how the output of a single test class might look: ```console Stopwatch for TQ\Tests\Example\SingleTest::testDataCalculation: -- TQ\Testing\Database::deleteData 0.117secs ( 3x, Ø 0.04) TOTAL 327.026secs ( 184x, Ø 1.78) -- ...onment\Testing::cleanupInstance 0.259secs ( 1x, Ø 0.26) TOTAL 6.159secs ( 60x, Ø 0.10) -- TQ\Testing\Database::import 7.889secs ( 11x, Ø 0.72) TOTAL 250.958secs ( 352x, Ø 0.71) -- Test 1.428secs ( 1x, Ø 1.43) TOTAL 1041.228secs ( 70x, Ø 14.87) +- TQ\Testing\Database::deleteData 0.117secs ( 3x, Ø 0.04) TOTAL 327.026secs ( 184x, Ø 1.78) +- ...onment\Testing::cleanupInstance 0.259secs ( 1x, Ø 0.26) TOTAL 6.159secs ( 60x, Ø 0.10) +- TQ\Testing\Database::import 7.889secs ( 11x, Ø 0.72) TOTAL 250.958secs ( 352x, Ø 0.71) +- Test 1.428secs ( 1x, Ø 1.43) TOTAL 1041.228secs ( 70x, Ø 14.87) . Stopwatch for TQ\Tests\Example\SingleTest::testDataTransfer: -- TQ\Testing\Database::deleteData 0.116secs ( 3x, Ø 0.04) TOTAL 327.142secs ( 187x, Ø 1.75) -- ...onment\Testing::cleanupInstance 0.256secs ( 1x, Ø 0.26) TOTAL 6.415secs ( 61x, Ø 0.11) -- TQ\Testing\Database::import 7.573secs ( 11x, Ø 0.69) TOTAL 258.531secs ( 363x, Ø 0.71) -- Test 5.998secs ( 1x, Ø 6.00) TOTAL 1047.226secs ( 71x, Ø 14.75) +- TQ\Testing\Database::deleteData 0.116secs ( 3x, Ø 0.04) TOTAL 327.142secs ( 187x, Ø 1.75) +- ...onment\Testing::cleanupInstance 0.256secs ( 1x, Ø 0.26) TOTAL 6.415secs ( 61x, Ø 0.11) +- TQ\Testing\Database::import 7.573secs ( 11x, Ø 0.69) TOTAL 258.531secs ( 363x, Ø 0.71) +- Test 5.998secs ( 1x, Ø 6.00) TOTAL 1047.226secs ( 71x, Ø 14.75) . Stopwatch for TQ\Tests\Example\SingleTest TearDown: -- TQ\Testing\Database::deleteData 38.486secs ( 6x, Ø 6.41) TOTAL 365.511secs ( 190x, Ø 1.92) -- ...onment\Testing::cleanupInstance 0.256secs ( 1x, Ø 0.26) TOTAL 6.415secs ( 61x, Ø 0.11) -- TQ\Testing\Database::import 7.573secs ( 11x, Ø 0.69) TOTAL 258.531secs ( 363x, Ø 0.71) -- Test 5.998secs ( 1x, Ø 6.00) TOTAL 1047.226secs ( 71x, Ø 14.75) +- TQ\Testing\Database::deleteData 38.486secs ( 6x, Ø 6.41) TOTAL 365.511secs ( 190x, Ø 1.92) +- ...onment\Testing::cleanupInstance 0.256secs ( 1x, Ø 0.26) TOTAL 6.415secs ( 61x, Ø 0.11) +- TQ\Testing\Database::import 7.573secs ( 11x, Ø 0.69) TOTAL 258.531secs ( 363x, Ø 0.71) +- Test 5.998secs ( 1x, Ø 6.00) TOTAL 1047.226secs ( 71x, Ø 14.75) ``` And at the end of the test run, you will get a summary of all stopwatches used, and it is going to look like this: ```console Stopwatch TOTALS: -- Test TOTAL 1047.246secs ( 78x, Ø 13.43) -- TQ\Testing\Database::deleteData TOTAL 365.511secs ( 190x, Ø 1.92) -- TQ\Testing\Database::import TOTAL 258.531secs ( 363x, Ø 0.71) -- ...onment\Testing::cleanupInstance TOTAL 6.416secs ( 62x, Ø 0.10) -- TQ\Production\Monitoring::ping TOTAL 17.967secs ( 7x, Ø 2.57) +- Test TOTAL 1047.246secs ( 78x, Ø 13.43) +- TQ\Testing\Database::deleteData TOTAL 365.511secs ( 190x, Ø 1.92) +- TQ\Testing\Database::import TOTAL 258.531secs ( 363x, Ø 0.71) +- ...onment\Testing::cleanupInstance TOTAL 6.416secs ( 62x, Ø 0.10) +- TQ\Production\Monitoring::ping TOTAL 17.967secs ( 7x, Ø 2.57) ``` ### Usage