Skip to content

Conversation

@BasCostBudde
Copy link
Contributor

@BasCostBudde BasCostBudde commented Sep 15, 2025

Fixes SublimeLinter/SublimeLinter#1988
Fixes #61

phpcs heavily uses realpath and reports "resolved" file paths to the end-user. We believe that the linter actually only reports for the file at hand so not passing or parsing the reported filename should be totally okay. Alternative: report "-" as filename to SublimeLinter which means "this file" per convention.

vim/Ale also ignores the reported filename.

@kaste
Copy link
Member

kaste commented Sep 15, 2025

Love the prose but shouldn't we try a fix like mentioned in the original issue?

@BasCostBudde
Copy link
Contributor Author

I agree that fixing the issue is better than putting up a sign. I do not know how to proceed though, this is my first attempt to submit an issue, and while I'm somewhat of a php developer, I do hardly know any python and would not know how to create the environment to test this in.

@kaste
Copy link
Member

kaste commented Sep 15, 2025

You're doing good here. Hacking on this, would mean

image

The path when clicking above, in that: git clone https://github.com/SublimeLinter/SublimeLinter-phpcs.git so that you have Packages/SublimeLinter-phpcs. This will take precedence over the official one installed via Package Control. Then open that folder in Sublime, open linter.py and delete the Line 19 (filename=file_path,) or set it to filename="-",. Save, should reload immediately. See if the patch works. Just delete "Packages/SublimeLinter-phpcs" to undo. If in doubt restart Sublime in between.

@BasCostBudde
Copy link
Contributor Author

Yes, that makes it work as expected.

@kaste kaste changed the title proposed fix for #1988 / #61 Ignore the filename phpcs reports Sep 16, 2025
@kaste kaste merged commit b38bd0d into SublimeLinter:master Sep 16, 2025
@kaste
Copy link
Member

kaste commented Sep 16, 2025

Thanks, you know I can guide you but don't have all the tools and languages installed. ❤️

@BasCostBudde
Copy link
Contributor Author

Excellent!

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

Labels

None yet

2 participants