Skip to content

Notifysend report to show desktop notifications#39

Merged
gsherwood merged 4 commits into
squizlabs:masterfrom
cweiske:master
Aug 14, 2012
Merged

Notifysend report to show desktop notifications#39
gsherwood merged 4 commits into
squizlabs:masterfrom
cweiske:master

Conversation

@cweiske

@cweiske cweiske commented Jul 11, 2012

Copy link
Copy Markdown

A new Codesniffer report that shows a short popup message on your desktop. Very useful when phpcs is automatically executed when saving a file.

@gsherwood

Copy link
Copy Markdown
Member

I have no way I can currently test this and I'm not sure what conventions are used in these messages currently.

Can I trust that you have tested this thoroughly?
Are there version or OS requirements that need to be considered for notify-send (needed for the PHPCS docs)?
Should the path to notify-send actually be a PHP_CodeSniffer config setting?
Anything else I should be aware of?

@cweiske

cweiske commented Jul 23, 2012

Copy link
Copy Markdown
Author

Hello Greg,

I have no way I can currently test this and I'm not sure what
conventions are used in these messages currently.
It shows an information message stating that all is fine when no
errors+warnings have been found, and an error message with the number
of warnings+errors if there are some.

Can I trust that you have tested this thoroughly?
It works for me for a week now.

Are there version or OS requirements that need to be considered for
notify-send (needed for the PHPCS docs)?
notify-send is standard on all linux desktops AFAIK.

Should the path to notify-send actually be a PHP_CodeSniffer config setting?
That'd be a good option, but I don't know how to do that. Could you
give me a hin?

Anything else I should be aware of?
I'd like to make e.g. the timeout configurable, but didn't know how to
pass config options. Enlighten me :)

Regards/Mit freundlichen Grüßen
Christian Weiske

-=≡ Geeking around in the name of science since 1982 ≡=-

@gsherwood

Copy link
Copy Markdown
Member

The config stuff in PHPCS is very basic. You just go ahead and use config vars in the code and handle defaults. So something like:

$path = PHP_CodeSniffer::getConfigData('notifysend_path');
if ($path === null) {
// Try default path, or maybe throw an exception telling them to set the path.
}

Same would go for the timeout:
$timeout = PHP_CodeSniffer::getConfigData('notifysend_timeout');
if ($timeout === null) {
$timeout = 3000;
}

You set those config vars like this:
phpcs --config-set notifysend_path /path/to/notify-send
phpcs --config-set notifysend_timeout 5000

@cweiske

cweiske commented Jul 25, 2012

Copy link
Copy Markdown
Author

I've implemented the configuration options now.

Screenshots:
all fine
error

gsherwood added a commit that referenced this pull request Aug 14, 2012
Notifysend report to show desktop notifications
@gsherwood gsherwood merged commit 655fb64 into squizlabs:master Aug 14, 2012
@gsherwood

Copy link
Copy Markdown
Member

Found a linux box at work to try this one and it worked great. Thanks for the contribution.

anomiex referenced this pull request in anomiex/PHP_CodeSniffer Dec 1, 2023
…-pear-cleanup

More clean up after removal of PEAR installation support
jrfnl added a commit to jrfnl/PHP_CodeSniffer that referenced this pull request Jul 29, 2024
Follow up after squizlabs#4 and squizlabs#39

The alternative path referred to in the bin scripts and the test bootstrap was specific for running via a PEAR install. This should no longer be needed (nor will this work).
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.

2 participants