-
Notifications
You must be signed in to change notification settings - Fork 54
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
Add a 'View in code editor' link to the PHPCS warnings/errors #262
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added some changes to make the logic easier to read, do you mind adding a Changelog to the readme.txt
?
Co-authored-by: Gustavo Bordoni <[email protected]>
|
||
$return[] = new $notice_class( | ||
$message['source'], | ||
sprintf( | ||
'%s Line %d of file %s.<br>%s.<br>%s', | ||
'%s Line %d of file %s.<br>%s.<br>%s%s', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will need to be translated at some point.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh that is a great catch too, I will handle that in a separate PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @EvanHerman for the PR. Left some feedback.
This PR closed the original issue but make sure we have to update it in trunk so we will get this for future version.
@EvanHerman @bordoni A general question not specifically about this change: I see this is targeting I would like to better understand what your current plans are with the "legacy plugin", because I thought it was about publishing only a 0.2. Since this PR is an enhancement and not a bug fix, I'm curious whether you plan to do further releases based on that codebase? I want to be mindful of us not duplicating too much work, and I think switching sooner than later will help with that. |
@felixarntz 100% in agreement there, I will create a Ticket for me to port this functionality to the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@EvanHerman This looks good, just one important change needed (permissions check).
) | ||
); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is awesome 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Inline after script goodness! 😄
Co-authored-by: Felix Arntz <[email protected]>
Co-authored-by: Felix Arntz <[email protected]>
Closes #251
Description of the Change
As outlined in the issue linked below, this PR conditionally displays a View in code editor link beneath each PHPCS warning/error so users can make changes to their code in the code editor in the WordPress dashboard.
Open files in external IDE
Editing files can be done in an external editor using the supplied
plugin_check_validation_error_source_file_editor_url_template
filter.Examples:
PhpStorm
VS Code
How to test the Change
Run the Plugin Check (from this branch) on any plugin with a PHPCS warning or error and click on the 'View in code editor' to be brought over to the plugin file editor. Once there, confirm that the editor scrolls down to (and highlights) the correct line.
Changelog Entry
Added - 'View in code editor' link beneath each PHPCS error or warning.
Credits
Props @westonruter, @felixarntz, @mukeshpanchal27, @bordoni
Checklist: