When I check in my code to Git, there is an option in IntelliJ to reformat the code before checking in. I want to use scalafmt instead of IntelliJ standard Scala formatter to format my code before it is committed. Is there such option? Thanks
You need to enable scalafmt formatter in IntelliJ options instead of IntelliJ formatter.
This way scalafmt will be applied whenever formatting occurs (manually or at commit).
Related
IntelliJ's Scala plugin comes with support for Scalastyle and provides this guidance:
Scalastyle examines your Scala code and indicates potential problems with it.
Place scalastyle_config.xml in the root/.idea or root/project directory.
However, when I make changes to my local scalastyle_config.xml file IntelliJ does not automatically detect the changes and apply them to the code I am editing.
I have found that if I close and re-open my IntelliJ project it will indeed reload this file and apply the rules to my code but this is a very heavy-handed and lengthy approach.
How do you initiate an IntelliJ reload of scalastyle_config.xml when the file has changed?
Is there a reason IntelliJ adds underscore lines for Scala code?
In this example bellow - IntelliJ is complaining about 'comment':
example
Style IDE Issue
How to prevent that / fix it?
That looks like ScalaStyle integration in IntelliJ IDEA (ScalastyleCodeInspection.scala).
ScalaStyle is a third-party tool and it's not enabled out of the box - it requires a custom configuration in .idea/scalastyle_config.xml.
It should be possible to disable the inspection, as usual: Alt + Enter / Disable inspection, or Settings / Editor / Inspections / Scala style inspection. Aternatively, you may simply delete the scalastyle_config.xml file from the project.
I'm using the Scala console to experiment with some code I have written in several source files. I'm using IntelliJ IDEA 15. When I make changes to the source it seems I have to restart the console for the changes to have an effect. Is there a shortcut? Or can I configure IDEA/the console to recompile and reload the files automatically?
Anyone know how to disable CSS validation with Aptana Studio 3? In version 3.0.4 the warnings remain even after completely disabling the W3C CSS Validator.
Any ideas?
Have you tried to manually delete all existing warnings? Disabling the validator will not create any new warnings, but the existing warnings remain.
Right click on the warnings and click Delete.
This is a known issue with Studio 3.0.4: http://jira.appcelerator.org/browse/APSTUD-3371.
A workaround is to do a Project > Clean on the selected project, or you could update to the nightly build using the instruction at http://aptana.com/r/apupdate.
I think that the problem is still there. If I switch the CSS validator off and clean the project, the errors disappear. On the other hand, if I turn on and add some regular expressions in order to exclude some errors, the validator still shows the "excluded" errors, even with after executing a "clean project" command. It look likes that the regular expressions are somehow omitted.
BTW, I'm working with the version Aptana Studio 3, build: 3.1.1.201204131931
How can i make code formatting standards equal in netbeans and eclipse equal. Also is ther is any way that i use eclipse code formatter in netbeans as for netbeans does not format javadocs comments
Abdul Khaliq
Maybe. You have these options:
Configure the formatters to the lowest common denominator (i.e. something that both of them can do). Not sure if that's possible because you can't "switch off" some options.
Eclipse has a feature called "Clean up". Select the project and it becomes available in the "Source" menu. This allows you to clean up certain aspects of a project: Unused imports, formatting, etc. So you save the work in Netbeans and then clean up the project once in a while in Eclipse.
Use an external formatter like Jindent (Commercial but they have a non-commercial license). Create an Ant task to format the code.
If your project uses Maven, you can use this Maven plugin: http://code.google.com/p/maven-java-formatter-plugin/
It uses Eclipse formatting classes to do the format, and can be configured with your Eclipse formatting preferences, see the configFile property here: http://maven-java-formatter-plugin.googlecode.com/svn/site/0.3.1/format-mojo.html