PhpStorm Custom Severity Levels No Longer Function with CodeSniffer - phpstorm

UPDATE (2020/12/03):
This has been fixed in PHP Storm 2020.3
I utilize PHP CodeSniffer and PHP Mess Detector to lint my code in PhpStorm. Until recently, I have been able to create custom severity levels (as shown below) and it will highlight my code accordingly if there is a violation.
What I found is that if I used one of the built in severity levels (e.g. Weak Error, Error, Sever Problem), the inspections and highlighting appear as I would expect, so it is not a problem with the installation of CodeSniffer or Mess Detector.
What I do to replicate the problem
Go under Inspections -> Quality Tools -> PHP_CodeSniffer Validation
Choose "Error" severity (all scopes)
Linting works as configured -- see below.
Click Edit Severity -> "Edit Severities" and create a custom Profile (e.g. CS Violation)
Set Colors and promote severity level to the top.
Click Apply
Editor now says "No Violations Found" and Syntax highlighting, feedback is missing as show below.
Question:
Is this a known bug or are there now additional tasks that must be completed in order to use custom severity levels in PhpStorm?

It's a known issue (if I'm getting your description correctly): https://youtrack.jetbrains.com/issue/WI-52633
Watch that ticket (star/vote/comment) to get notified on any progress.

Related

PhpStorm. Highlight file in project tree on inspection error (e.g. Strict type checking rules violation)

Is it possible to highlight a file in the project tree on inspection error (e.g. Strict type checking rules violation) in PhpStorm?
I would like to highlight it as a serious error. Couldn't find anything in settings and documentation.
Now it just highlighted the wrong property and mark the line on the right.
v
I thought it would be possible by changing the Inspection Severity to the highest Error level (see the official doc page on how to configure Inspection Severity)... but apparently this will not work.
It seems that right now only certain hardcoded error types (that come from lower level Lexer/Parser as I understand) can display the "red underwave" in the Project View panel.
Watch the following ticket: PhpStorm's WI-33552 --> platform-wide IDEA-96288 (star/vote/comment) to get notified with any progress.
It's not the same of course, but will give yo an overview on a most-important errors (for your filtering level/inspection profile).
As a possible alternative: Run Inspect Code manually (Code | Inspect Code from the Main Menu; you can invoke it for a specific folder/custom scope to limit the number of files to be processed) and then filter you results in the Problems toolwindow to only see the errors with required severity.
https://www.jetbrains.com/help/phpstorm/running-inspections.html#run-inspections-manually
https://www.jetbrains.com/help/phpstorm/problems-tool-window.html#854a2648

Hide warning messages in console window

The Chrome console window is full of warning messages that I like to hide.
Is it possible to hide the warning logs?
I only want to show my custom logs e.g. console.log('mymessage');
This is how the console windowbar looks like:
Just recently there was a Chrome update. Now filtering single message types is possible (Verbose, Info, Warnings, Errors)! (My Version: Version 60.0.3112.90)
When opening the console, instead of selecting a "filter level", you can now check or uncheck each message type.
As of Chrome version 78 (Dec 2019), in the "Console" tab, click on the "Default levels" pulldown, and uncheck the types of messages you don't want displayed.
At the top bar of the console log you can select what kind of messages should be shown.
All is selected by default. Select error to see only error.
You can press ctrl + click to select multiple message types.
First off: you can hide all warnings and show only console.log output if you are using Microsoft Edge. In the console, there are a couple of icons representing the different levels of log output you may be using - error, warning, and info. If you just want to hide warnings, you can simply toggle the warning icon to off.
Also, if you are on firefox, you can set the log to only display info, in which case the warnings will also be hidden.
Next, to elaborate on the other answer, and phrase what I said (above in my comment) in the form of an answer:
For chrome, you cannot toggle specific levels off individually (newer versions of Chrome). Instead, you have to set an overall verbosity level for the log. By using the strictest level (i.e. the level that displays the least), you can minimize console messages that are created by portions of code that you did not write. In this case, that is the error level.
If you are just trying to hide warning messages for testing purposes, you can, for the time being, switch over to only logging messages at the error level. In production, this is not good practice, as it doesn't let you differentiate between helpful info log messages or actual errors.
To log a message as an error, use:
console.error('mymessage');
Then, as mentioned above, you can change the Level of your console output to error, which will only show you error messages. It will ignore console.log as well as any warning messages.
Be sure to change your calls to console.error back to console.log when you are done with the development phase of your work, for any instances where you are calling console.error with some message that does not describe an error.
Now, if you are getting warnings due to something you are doing in your code, you may want to consider spending time trying to correct whatever is causing those warnings to appear. Warnings are generally well thought out, and are there to help you prevent issues in your code that you may not be aware of. Correcting any issues in your code would also cause the warning messages to go away.
NOTE: you cannot tell the console to only display messages you print out, even at the level of verbosity you set your console to. This is because the console would have no way of knowing which statements you are logging out, versus which statements code your webpage is running that was written by someone else is logging out. The steps mentioned in this answer as well as the other are workarounds that may improve your situation.
UPDATE: It seems like Chrome has reintroduced the ability to enable/disable different levels of console logging individually. Now, when clicking on log level, you can toggle whether certain log levels are enabled or disabled.
Under the console tab it is now possible to highlight the message type as a general filter. There is also a filter box right next to the eyeball. So if you put a unique flag in your console.log then it will show only your messages with this flag.
But in general. I think you want to click the 'Info' item as highlighted below to just obtain the console.log messages
There is a drop down next to filter, where can you select only things you require.
Note : ReactJS warnings are actually displayed in red as errors. So to remove them you need to uncheck errors too.

How can I over-ride the default code formatting policy in MonoDevelop?

MonoDevelop allows creation and installation of custom policies to control all aspects of code formatting. I have created a policy for our work site, which can be applied via Project > Apply Policy ...
We are using the Unity game engine, which regularly regenerates the MonoDevelop solution, requiring each developer to re-apply the policy -- irritating and error-prone.
How can I make my policy file be the default for new MonoDevelop solutions?
Also, where is the information about the applied policy saved?
In the .sln file I see "$0.CSharpFormattingPolicy = $2", but this is unchanged after applying my custom policy. I have compared all the project files before and after applying the policy, and the only changes are (1) a .userprefs file is generated, but doesn't mention policies, and (2) various .pidb files are different, but this can't be where policy information goes??
I'm using the version of MonoDevelop that is integrated with Unity 3.5.2, which is MonoDevelop version 2.8.2 (on Windows 7). (Yes, 2.8.2 is a little out of date, and it's possible that Unity Technologies has made changes that are causing my issues.)
This is a year after the other answers, but none of the above works for unity, and this was near the top of the google search.
Here are the steps I had to follow to get formatting to work:
MonoDevelop->Tools->Custom Policies->Add Policy->New Policy
Edit the policy inside of the 'Custom Policies' window, making sure your policy is selected.
Project->Apply Policy->Apply Stock or Custom Policy Set (select your policy)->Apply
Goto Tools->Options->KeyBinding
Then goto Edit -> FormatDocument
Then assign your shortcut key and click on apply and use it in your document.
The default policy is applied to new solutions or solutions without policies. It can be edited in the Preferences/Options dialog, where it's mixed in with the user preferences: Tools->Options on Windows, MonoDevelop->Preferences on Mac. You can identify the policies because they have a "Policy" dropdown at the top of the panel that allows you to load from a named policy.
I spent like 30 minutes fixing this and finally figure it out.
In Windows:
Go to Project -> Assembly C-Sharp Options
Then change the Code Formatting from there!
Going to Project -> Solution Options does absolutely nothing
After a year of dealing with this, we wrote a Unity editor script that would watch the project files for changes, and when they changed, check the policy entries in the project (pretty simple XML to parse.) If they had deviated from our desired policy, we'd modify them and write them back out with the correct policy changes.
Another idea (we wanted to enforce a policy) would be do do the same thing, but just remove the policy entries from the project whenever they got updated, and then you'd never have project policies overriding what you set up at the tool level.

How to see library name loaded with R6034 error?

I am getting R6034 error, but can't see the related library/executable since it's name is shortened (see the picture below). Is there any way I can see the full name?
Start task manager and go to the "Applications" tab. The popup should be in that list.
Right-click the window and choose "go to process". Task manager now jumps to the "processes" tab and shows the process that gives this message.
If you want to find out which DLL is causing the problem, open your executable in Dependency Walker. If the static analysis of Dependency Walker does not reveal the problem, profile the application in Dependency Walker and look at the profiling output.

How can I disable "HTML Checking" in NetBeans?

I'm using NetBean's Compile on Save setting, and it's really handy when I'm editing a single file. But when I'm dealing with a pair of (or more) class files and am switching between the files, I have a problem:
The Task tab is nearly worthless since it is littered by HTML "error" messages(+) from many dozens of HTML files in the project that are generated by some external tool. The number of HTML errors swamps out any actual Java errors.
What I want is one of:
A way to tell NB to ignore the directory with the HTML files ("help").
A way to turn off HTML "errors" or even to specify HTML2.
A way to filter "Task" errors by file type, parent folder: all Java is under "com".
I've perused the settings and properties, but found nothing that helps.
<rant> Yet another reason I hate an IDE that use the "Take Everything in the Folder" approach.... </rant>
+ = The files are valid HTML but probably not XHTML. Plus, half the messages end abruptly, with something like: "Unexpected tag <TD> found, expecting one of
I found the answer, or at least one that works for me (NB 6.8, YMMV):
In the Tasks tab, click the filter button in the left,
Choose Edit...
In the Task List Filter dialog:
Click New
Enter a value for Name (such as "No Script Messages"),
Uncheck the Scripting Language Tasks option
Click OK.
If the filter doesn't work immediately, you may wish to close/open the Task window or Netbeans.
Hope that helps someone else.
You can go to Tools->options->Editor->Hint .
You can easily select the right options from there .
I want to use task list to only track my To Do list and It can be a real pain when Netbeans starts showing me #todos from included libraries and all sort of compile errors that I am not interested in. If your use case is like me (not interested in compile errors etc. in task window) then you can do following:- (Netbeans 7.1.2)
1) Tasks window | Right click filter | Edit
To edit the default filter.
Click default filter in left hand panel.
Right hand panel, under Type tab - un-check compile errors and issues
2) You can go to Tools | Options | Miscellaneous
Go to Tasks tab now.
Here you can add/remove the To Do strings that you want.
You can create your own custom todo string or make sure that only one of them is listed (what you use)
Now apply default filter and you will only see your #todo tasks. sane and sweet :D