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

Look for badly named files #629

Open
wants to merge 9 commits into
base: trunk
Choose a base branch
from

Conversation

davidperezgar
Copy link
Member

Fixes #628

@davidperezgar davidperezgar linked an issue Sep 12, 2024 that may be closed by this pull request
@davidperezgar davidperezgar changed the title look for badly names Look for badly named files Sep 12, 2024
@davidperezgar davidperezgar self-assigned this Sep 12, 2024
@davidperezgar davidperezgar marked this pull request as ready for review September 14, 2024 07:38
Copy link

github-actions bot commented Sep 14, 2024

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: davidperezgar <[email protected]>
Co-authored-by: swissspidy <[email protected]>
Co-authored-by: ernilambar <[email protected]>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

composer.lock Outdated Show resolved Hide resolved
@davidperezgar
Copy link
Member Author

Stills need duplicated filenames

@davidperezgar
Copy link
Member Author

I believe that is done!

// Duplicated filenames.
$this->assertArrayHasKey( 0, $errors['class-filename.php'] );
$this->assertArrayHasKey( 0, $errors['class-filename.php'][0] );
$this->assertCount( 1, wp_list_filter( $errors['class-filename.php'][0][0], array( 'code' => 'duplicated_files' ) ) );
Copy link
Member

Choose a reason for hiding this comment

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

Having same file name in separate folders should not be error I believe. From what I understand, duplicate files refers to like this:
filename.php and Filename.php. These two files in same location are treated differently based on operating system.

Copy link
Member Author

Choose a reason for hiding this comment

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

ok!

Copy link
Member Author

Choose a reason for hiding this comment

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

But I have to force, I cannot create in my system two files like that.

Copy link
Member Author

Choose a reason for hiding this comment

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

How could I do it?

Copy link
Member

Choose a reason for hiding this comment

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

I cannot create in my MacOS also. May be we need to rewrite test from an array of files names rather than actual filename.

Copy link
Member

Choose a reason for hiding this comment

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

Yes that will be easiest

Copy link
Member Author

Choose a reason for hiding this comment

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

How can achieve that? some guide to make it?

Copy link
Member

Choose a reason for hiding this comment

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

You should be able to achieve a positive outcome using things like mocking/overriding the ::get_files method to return a fake list of bad files.

Copy link
Member Author

Choose a reason for hiding this comment

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

Any ideas @felixarntz ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Check: Badly named files (spaces etc)
3 participants