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

Sniff to detect the irregular whitespace characters #191

Open
dingo-d opened this issue Dec 9, 2022 · 3 comments
Open

Sniff to detect the irregular whitespace characters #191

dingo-d opened this issue Dec 9, 2022 · 3 comments

Comments

@dingo-d
Copy link
Contributor

dingo-d commented Dec 9, 2022

Originally created in the WPCS repo

Motivation

The motivation behind the sniff was that I got errors in my php code, and I couldn't see where the errors were coming from, unless I highlighted the code in the editor (Sublime), where I could see that there is not a dot in my space.

So this sniff would detect these irregular white spaces in the code and warn the user not to use them.

@jrfnl jrfnl changed the title Sniff to detect the irregular whtespace characters Sniff to detect the irregular whitespace characters Jan 9, 2023
@jrfnl
Copy link
Member

jrfnl commented Jan 9, 2023

For this ticket to be actionable, it will need a list of what is considered an "irregular whitespace character".

Without that, there's nothing which can be done.

@dingo-d
Copy link
Contributor Author

dingo-d commented Jan 9, 2023

The inspiration for the sniff comes from ESLint: https://eslint.org/docs/latest/rules/no-irregular-whitespace

There's also the following list: https://invisible-characters.com/

I have copied some of the characters in a test file and ran it through the phpcsdebug standard and I get things like

image

image

@jrfnl
Copy link
Member

jrfnl commented Jan 9, 2023

Thanks for adding that additional info!

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

No branches or pull requests

2 participants