benmatselby / atom-php-checkstyle Goto Github PK
View Code? Open in Web Editor NEW✅ [DEPRECATED] Checkstyle reporter for PHP, utilising phpcs, phpmd, php linter and php-cs-fixer
License: MIT License
✅ [DEPRECATED] Checkstyle reporter for PHP, utilising phpcs, phpmd, php linter and php-cs-fixer
License: MIT License
Currently the plugin only shows the errors in the list, however it would be useful to have gutter marks
Not sure if this is an issue with this package, or atom in general, but with the default Atom Dark theme, the poor colour contrast in the list view makes it really hard to read anything.
Happy to change custom atom stylesheet, if that's the best solution... I don't have a clue how though, but happy to follow instructions :-)
Currently the list view will truncate long error messages.
In sublime-phpcs I put these in the status bar, so potentially can do the same thing.
Use Workspace::getActivePaneItem instead
WorkspaceView.getActivePaneItem (/Applications/Atom.app/Contents/Resources/app/src/workspace-view.js:564:7)
PhpCheckstyleStatusBarView.render (/Users/1ring/.atom/packages/php-checkstyle/lib/php-checkstyle-statusbar-view.coffee:66:37)
HTMLDivElement.<anonymous> (/Users/1ring/.atom/packages/php-checkstyle/lib/php-checkstyle-statusbar-view.coffee:40:24)
HTMLDivElement.jQuery.event.dispatch (/Applications/Atom.app/Contents/Resources/app/node_modules/space-pen/vendor/jquery.js:4676:9)
HTMLDivElement.elemData.handle (/Applications/Atom.app/Contents/Resources/app/node_modules/space-pen/vendor/jquery.js:4360:46)
Object.trigger (/Applications/Atom.app/Contents/Resources/app/node_modules/space-pen/vendor/jquery.js:4594:12)
HTMLDivElement.<anonymous> (/Applications/Atom.app/Contents/Resources/app/node_modules/space-pen/vendor/jquery.js:5119:17)
Function.jQuery.extend.each (/Applications/Atom.app/Contents/Resources/app/node_modules/space-pen/vendor/jquery.js:590:23)
ReactEditorView.each (/Applications/Atom.app/Contents/Resources/app/node_modules/space-pen/vendor/jquery.js:237:17)
ReactEditorView.trigger (/Applications/Atom.app/Contents/Resources/app/node_modules/space-pen/vendor/jquery.js:5118:15)
[object Object].componentDidUpdate (/Applications/Atom.app/Contents/Resources/app/src/editor-component.js:267:33)
CallbackQueue.notifyAll (/Applications/Atom.app/Contents/Resources/app/node_modules/react-atom-fork/lib/CallbackQueue.js:75:22)
ReactReconcileTransaction.ON_DOM_READY_QUEUEING.close (/Applications/Atom.app/Contents/Resources/app/node_modules/react-atom-fork/lib/ReactReconcileTransaction.js:88:26)
ReactReconcileTransaction.closeAll (/Applications/Atom.app/Contents/Resources/app/node_modules/react-atom-fork/lib/Transaction.js:214:42)
ReactReconcileTransaction.perform (/Applications/Atom.app/Contents/Resources/app/node_modules/react-atom-fork/lib/Transaction.js:155:16)
ReactUpdatesFlushTransaction.Mixin.perform (/Applications/Atom.app/Contents/Resources/app/node_modules/react-atom-fork/lib/Transaction.js:141:20)
ReactUpdatesFlushTransaction.perform (/Applications/Atom.app/Contents/Resources/app/node_modules/react-atom-fork/lib/ReactUpdates.js:98:38)
flushBatchedUpdates (/Applications/Atom.app/Contents/Resources/app/node_modules/react-atom-fork/lib/ReactUpdates.js:176:19)
ReactDefaultBatchingStrategyTransaction.closeAll (/Applications/Atom.app/Contents/Resources/app/node_modules/react-atom-fork/lib/Transaction.js:214:42)
ReactDefaultBatchingStrategyTransaction.perform (/Applications/Atom.app/Contents/Resources/app/node_modules/react-atom-fork/lib/Transaction.js:155:16)
Object.batchedUpdates (/Applications/Atom.app/Contents/Resources/app/node_modules/react-atom-fork/lib/ReactDefaultBatchingStrategy.js:70:19)
Object.enqueueUpdate (/Applications/Atom.app/Contents/Resources/app/node_modules/react-atom-fork/lib/ReactUpdates.js:209:22)
[object Object].forceUpdate (/Applications/Atom.app/Contents/Resources/app/node_modules/react-atom-fork/lib/ReactCompositeComponent.js:1232:18)
<unknown> (/Applications/Atom.app/Contents/Resources/app/src/editor-component.js:313:28)
I just downloaded Atom for the first time and started it up today, and got this error straight away before even seeing the welcome screen.
This error report came from the second time I started Atom because I thought maybe just restarting might help. The only configuration changes I made were to the projectHome directory, as you'll see in the config read-out.
Atom Version: 1.6.2
System: Mac OS X 10.11.4
Thrown From: php-checkstyle package, v0.12.0
Failed to load the php-checkstyle package
At Cannot read property 'prototype' of undefined
TypeError: Cannot read property 'prototype' of undefined
at __extends (<anonymous>:1:1)
at <anonymous>:8:3
at Object.<anonymous> (<anonymous>:8:3)
at Object.<anonymous> (<anonymous>:1:1)
at Module._compile (/Applications/Atom.app/Contents/Resources/app.asar/src/native-compile-cache.js:103:30)
at Object.defineProperty.value [as .coffee] (/Applications/Atom.app/Contents/Resources/app.asar/src/compile-cache.js:208:21)
at Module.load (module.js:355:32)
at Function.Module._load (module.js:310:12)
at Module.require (module.js:365:17)
at require (/Applications/Atom.app/Contents/Resources/app.asar/src/native-compile-cache.js:50:27)
at Object.<anonymous> (<anonymous>:2:25)
at Object.<anonymous> (<anonymous>:1:1)
at Module._compile (/Applications/Atom.app/Contents/Resources/app.asar/src/native-compile-cache.js:103:30)
at Object.defineProperty.value [as .coffee] (/Applications/Atom.app/Contents/Resources/app.asar/src/compile-cache.js:208:21)
at Module.load (module.js:355:32)
at Function.Module._load (module.js:310:12)
at Module.require (module.js:365:17)
at require (/Applications/Atom.app/Contents/Resources/app.asar/src/native-compile-cache.js:50:27)
at Object.<anonymous> (<anonymous>:2:21)
at Object.<anonymous> (<anonymous>:1:1)
at Module._compile (/Applications/Atom.app/Contents/Resources/app.asar/src/native-compile-cache.js:103:30)
at Object.defineProperty.value [as .coffee] (/Applications/Atom.app/Contents/Resources/app.asar/src/compile-cache.js:208:21)
at Module.load (module.js:355:32)
at Function.Module._load (module.js:310:12)
at Module.require (module.js:365:17)
at require (/Applications/Atom.app/Contents/Resources/app.asar/src/native-compile-cache.js:50:27)
at Package.module.exports.Package.requireMainModule (/Applications/Atom.app/Contents/Resources/app.asar/src/package.js:720:27)
at /Applications/Atom.app/Contents/Resources/app.asar/src/package.js:116:28
at Package.module.exports.Package.measure (/Applications/Atom.app/Contents/Resources/app.asar/src/package.js:92:15)
at Package.module.exports.Package.load (/Applications/Atom.app/Contents/Resources/app.asar/src/package.js:106:12)
{
"core": {
"ignoredNames": [
".git",
".svn",
".DS_Store"
],
"projectHome": "/Users/jwatson/Source",
"themes": [
"atom-dark-ui",
"atom-dark-syntax"
]
}
}
# User
minimap, v4.21.0
php-checkstyle, v0.12.0
vim-mode, v0.65.0
# Dev
No dev packages
Use Workspace::getActivePaneItem instead
WorkspaceView.getActivePaneItem (/Applications/Atom.app/Contents/Resources/app/src/workspace-view.js:564:7)
PhpCheckstyleStatusBarView.render (/Users/eitrix/.atom/packages/php-checkstyle/lib/php-checkstyle-statusbar-view.coffee:66:37)
HTMLDivElement.<anonymous> (/Users/eitrix/.atom/packages/php-checkstyle/lib/php-checkstyle-statusbar-view.coffee:40:24)
HTMLDivElement.jQuery.event.dispatch (/Applications/Atom.app/Contents/Resources/app/node_modules/space-pen/vendor/jquery.js:4676:9)
HTMLDivElement.elemData.handle (/Applications/Atom.app/Contents/Resources/app/node_modules/space-pen/vendor/jquery.js:4360:46)
Object.trigger (/Applications/Atom.app/Contents/Resources/app/node_modules/space-pen/vendor/jquery.js:4594:12)
HTMLDivElement.<anonymous> (/Applications/Atom.app/Contents/Resources/app/node_modules/space-pen/vendor/jquery.js:5119:17)
Function.jQuery.extend.each (/Applications/Atom.app/Contents/Resources/app/node_modules/space-pen/vendor/jquery.js:590:23)
ReactEditorView.each (/Applications/Atom.app/Contents/Resources/app/node_modules/space-pen/vendor/jquery.js:237:17)
ReactEditorView.trigger (/Applications/Atom.app/Contents/Resources/app/node_modules/space-pen/vendor/jquery.js:5118:15)
[object Object].componentDidUpdate (/Applications/Atom.app/Contents/Resources/app/src/editor-component.js:267:33)
CallbackQueue.notifyAll (/Applications/Atom.app/Contents/Resources/app/node_modules/react-atom-fork/lib/CallbackQueue.js:75:22)
ReactReconcileTransaction.ON_DOM_READY_QUEUEING.close (/Applications/Atom.app/Contents/Resources/app/node_modules/react-atom-fork/lib/ReactReconcileTransaction.js:88:26)
ReactReconcileTransaction.closeAll (/Applications/Atom.app/Contents/Resources/app/node_modules/react-atom-fork/lib/Transaction.js:214:42)
ReactReconcileTransaction.perform (/Applications/Atom.app/Contents/Resources/app/node_modules/react-atom-fork/lib/Transaction.js:155:16)
ReactUpdatesFlushTransaction.Mixin.perform (/Applications/Atom.app/Contents/Resources/app/node_modules/react-atom-fork/lib/Transaction.js:141:20)
ReactUpdatesFlushTransaction.perform (/Applications/Atom.app/Contents/Resources/app/node_modules/react-atom-fork/lib/ReactUpdates.js:98:38)
flushBatchedUpdates (/Applications/Atom.app/Contents/Resources/app/node_modules/react-atom-fork/lib/ReactUpdates.js:176:19)
ReactDefaultBatchingStrategyTransaction.closeAll (/Applications/Atom.app/Contents/Resources/app/node_modules/react-atom-fork/lib/Transaction.js:214:42)
ReactDefaultBatchingStrategyTransaction.perform (/Applications/Atom.app/Contents/Resources/app/node_modules/react-atom-fork/lib/Transaction.js:155:16)
Object.batchedUpdates (/Applications/Atom.app/Contents/Resources/app/node_modules/react-atom-fork/lib/ReactDefaultBatchingStrategy.js:70:19)
Object.batchedUpdates (/Applications/Atom.app/Contents/Resources/app/node_modules/react-atom-fork/lib/ReactUpdates.js:113:20)
ReactEventListener.dispatchEvent (/Applications/Atom.app/Contents/Resources/app/node_modules/react-atom-fork/lib/ReactEventListener.js:186:20)
I'm running in this bug when I click the listview.
The command on dev-tools window is:
[php-checkstyle]/usr/local/bin/php -l -d display_errors=On /Users/yriveiro/Development/test.php; /usr/local/bin/phpcs --standard=PSR2 --report=checkstyle /Users/yriveiro/Development/test.php; /usr/bin/phpmd /Users/yriveiro/DevelopmentUsers/yriveiro/Development/test.php text codesize,cleancode,controversial,naming,unusedcode; commands.coffee:20
I think that the first error is not on any row of the file and It's like a advice or something. When I click in the listview is not possible goto the row X and throws the error.
In keymaps/php-checkstyle.cson: Use the atom-text-editor
tag instead of the editor
class.
Hey,
It would be awesome if we could see all the errors listed in the status bar even if the cursor isn't placed on the error line, a bit like how the linter phpcs plugin works.
Thanks!
Hey there,
I've installed this package and set the right executable paths for phpcs, phpcsfixer, and phpmd. All of these have been installed with Homebrew.
Phpmd works, but when enabling phpcs I get an error every time the package runs. Looking at Atom's console, running the same command in Terminal results in the following UnexpectedValueExceptions:
/usr/local/bin/php -l -d display_errors=On /Path/to/File.php; /usr/local/bin/phpcs --standard=PSR2 --report=checkstyle /Path/to/File.php; /usr/local/bin/phpmd /Path/to/File.php text codesize,cleancode,controversial,naming,unusedcode;
No syntax errors detected in /Path/to/File.php
PHP Fatal error: Uncaught exception 'UnexpectedValueException' with message 'DirectoryIterator::__construct(/usr/local/etc/php-code-sniffer/Standards): failed to open dir: No such file or directory' in /usr/local/Cellar/php-code-sniffer/1.5.2/CodeSniffer.php:1961
Stack trace:
#0 /usr/local/Cellar/php-code-sniffer/1.5.2/CodeSniffer.php(1961): DirectoryIterator->__construct('/usr/local/etc/...')
#1 /usr/local/Cellar/php-code-sniffer/1.5.2/CodeSniffer/CLI.php(733): PHP_CodeSniffer::getInstalledStandards()
#2 /usr/local/Cellar/php-code-sniffer/1.5.2/CodeSniffer/CLI.php(538): PHP_CodeSniffer_CLI->validateStandard(Array)
#3 /usr/local/Cellar/php-code-sniffer/1.5.2/scripts/phpcs(37): PHP_CodeSniffer_CLI->process()
#4 {main}
thrown in /usr/local/Cellar/php-code-sniffer/1.5.2/CodeSniffer.php on line 1961
Fatal error: Uncaught exception 'UnexpectedValueException' with message 'DirectoryIterator::__construct(/usr/local/etc/php-code-sniffer/Standards): failed to open dir: No such file or directory' in /usr/local/Cellar/php-code-sniffer/1.5.2/CodeSniffer.php:1961
Stack trace:
#0 /usr/local/Cellar/php-code-sniffer/1.5.2/CodeSniffer.php(1961): DirectoryIterator->__construct('/usr/local/etc/...')
#1 /usr/local/Cellar/php-code-sniffer/1.5.2/CodeSniffer/CLI.php(733): PHP_CodeSniffer::getInstalledStandards()
#2 /usr/local/Cellar/php-code-sniffer/1.5.2/CodeSniffer/CLI.php(538): PHP_CodeSniffer_CLI->validateStandard(Array)
#3 /usr/local/Cellar/php-code-sniffer/1.5.2/scripts/phpcs(37): PHP_CodeSniffer_CLI->process()
#4 {main}
thrown in /usr/local/Cellar/php-code-sniffer/1.5.2/CodeSniffer.php on line 1961
Isolating the error to the command /usr/local/bin/phpcs --report=checkstyle --standard=PSR2 /Path/to/File.php
I attempted to remove and tweak the parameters, and it seems the error is thrown by the '--standard=PSR2' flag. By removing this in the Terminal it works and returns warnings about my code.
I'm not too familiar with PHPCS, so this might not be an issue related to the package, and if it's not—my apologies. :) A quick pointer in the right direction would be fabulous, though. Thanks!
We have config options for other views, so this should be no exception
The context menu CSON format has changed. Please see
https://atom.io/docs/api/latest/ContextMenuManager
It seems that every time I deactivate and reactivate the plugin, it adds an additional status bar at the bottom of the editor.
Hi,
Since Atom release 0.117+, when I open preferences I get the following error
Uncaught TypeError: Cannot call method 'removeClassFromAllLines' of undefined php-checkstyle-gutter-view.coffee:30
Anyone else got this error message?
Ability to have php -l
to be run when the sniffer executes
It would be nice if we could choose to disable the popup that appears with the issues in? I'd prefer just having the gutter and status bar markers
Store package style sheets in the styles/
directory instead of stylesheets/
in the php-checkstyle
package
Package.getStylesheetsPath (/Applications/Atom.app/Contents/Resources/app.asar/src/package.js:460:9)
Package.getStylesheetPaths (/Applications/Atom.app/Contents/Resources/app.asar/src/package.js:471:32)
Package.loadStylesheets (/Applications/Atom.app/Contents/Resources/app.asar/src/package.js:453:38)
<unknown> (/Applications/Atom.app/Contents/Resources/app.asar/src/package.js:185:19)
Package.measure (/Applications/Atom.app/Contents/Resources/app.asar/src/package.js:165:15)
Package.load (/Applications/Atom.app/Contents/Resources/app.asar/src/package.js:179:12)
At the moment everything is highlighted in red which makes it hard to spot other errors like syntax errors.
atom.workspaceView is no longer available.
In most cases you will not need the view. See the Workspace docs for
alternatives: https://atom.io/docs/api/latest/Workspace.
If you do need the view, please use atom.views.getView(atom.workspace)
,
which returns an HTMLElement.
Atom.Object.defineProperty.get (/opt/homebrew-cask/Caskroom/atom/latest/Atom.app/Contents/Resources/app/src/atom.js:55:11)
PhpCheckstyleStatusBarView.initialize (/Users/morganestes/.atom/packages/php-checkstyle/lib/php-checkstyle-statusbar-view.coffee:15:22)
Had the same issue in sublime-phpcs, so need to fix it in coffeescript this time. Basically we want "e to be actual quotes.
atom.workspaceView is no longer available.
In most cases you will not need the view. See the Workspace docs for
alternatives: https://atom.io/docs/api/latest/Workspace.
If you do need the view, please use atom.views.getView(atom.workspace)
,
which returns an HTMLElement.
Atom.Object.defineProperty.get (/Applications/Atom.app/Contents/Resources/app/src/atom.js:55:11)
PhpCheckstyleStatusBarView.initialize (/Users/giuseppelobrutto/.atom/packages/php-checkstyle/lib/php-checkstyle-statusbar-view.coffee:15:22)
We need to know what it did etc
Ability to have the code run through phpmd
when the sniffer runs
No method destroy
When a user saves the current file, I want the sniffer to execute for me.
Need a configuration option for this
Hey, this is awesome. I'm pretty new to CS too too, and some of the Atom / coffee standards have been a little strange for me to get used to. I don't want to tread on your toes here - do you have a preferred coding style for contributions?
I'm having this message each time this package runs and found an error:
Uncaught NotFoundError: An attempt was made to reference a Node in a context where it does not exist.
A dev-tools window opens and when I try to close it, it's open again in loop mode.
If I disable the package this behavior doesn't happen,
When I go to Atom's settings page the web inspector pops up with the following errors:
Uncaught TypeError: Cannot read property 'removeClassFromAllLines' of undefined /Users/alexbilbie/.atom/packages/php-checkstyle/lib/php-checkstyle-gutter-view.coffee:33
2Uncaught TypeError: Cannot read property 'id' of undefined /Users/alexbilbie/.atom/packages/php-checkstyle/lib/php-checkstyle-gutter-view.coffee:26
Uncaught TypeError: Cannot read property 'removeClassFromAllLines' of undefined /Users/alexbilbie/.atom/packages/php-checkstyle/lib/php-checkstyle-gutter-view.coffee:33
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.