Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: class_attributes_separation ruleset #280

Merged
merged 1 commit into from
May 23, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 1 addition & 8 deletions src/RuleSets/ExtendedPERSet.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
'method' => 'one',
'property' => 'one',
'trait_import' => 'none',
'case' => 'one',
'case' => 'only_if_meta',

Check warning on line 81 in src/RuleSets/ExtendedPERSet.php

View check run for this annotation

Codecov / codecov/patch

src/RuleSets/ExtendedPERSet.php#L81

Added line #L81 was not covered by tests
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tip

Codebase Verification

The added line 'case' => 'only_if_meta' in src/RuleSets/ExtendedPERSet.php is not covered by tests. No references to this rule were found in the test files.

  • src/RuleSets/ExtendedPERSet.php
  • src/RuleSets/DefaultSet.php
Analysis chain

The added line #L81 was not covered by tests.

Scripts Executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Verify if the new rule 'case' => 'only_if_meta' is covered by tests.

# Test: Search for tests covering the 'case' rule in 'class_attributes_separation'.
rg --type php $'class_attributes_separation.*case.*only_if_meta' tests/

Length of output: 72



Script:

#!/bin/bash
# Description: Broaden the search to find any references to 'class_attributes_separation' in the tests.

# Step 1: Search for any references to 'class_attributes_separation' in the tests.
rg --type php 'class_attributes_separation' tests/

# Step 2: If found, search within those files for 'case' => 'only_if_meta'.
for file in $(rg --files-with-matches --type php 'class_attributes_separation' tests/); do
    rg --type php 'case.*only_if_meta' "$file"
done

Length of output: 123



Script:

#!/bin/bash
# Description: Verify the definition and usage of 'class_attributes_separation' and search for any related tests.

# Step 1: Search for the definition of 'class_attributes_separation' in the codebase.
rg --type php 'class_attributes_separation' src/

# Step 2: Search for any related tests that might indirectly cover the new rule.
rg --type php 'only_if_meta' tests/

Length of output: 238

],
],
'no_unused_imports' => true,
Expand All @@ -104,23 +104,16 @@
'use_trait',
'case',
'constant',
// 'property_public_static',
'property_public',
// 'property_protected_static',
'property_protected',
// 'property_private_static',
'property_private',
'construct',
'method_public_static',
// 'method_public_abstract_static',
// 'method_public_abstract',
'method_public',
'magic',
'destruct',
'phpunit',
'method_protected_static',
// 'method_protected_abstract_static',
// 'method_protected_abstract',
'method_protected',
'method_private_static',
'method_private',
Expand Down
Loading