How to force dos2unix?

Hello all,

I'm coding with a windows environment to a unix server, and using git
Most of the time, I don't have any problem, but I have an issue with my PHP code_sniffer : end of line character is invalid; expected "/n" but found "/r/n"

I googled it and I found the answer : http://forums.devnetwork.net/viewtopic.php?f=6&t=111169

It is said that on Eclipse, we can do :"Convert Line Delimiters To > Unix"
Is there an equivalent on PHPStorm?

Thx

2 comments
Comment actions Permalink

Hi Arnaud,

It is said that on Eclipse, we can do :"Convert Line Delimiters To > Unix"
Is there an equivalent on PHPStorm?


1) To create new files with desired line endings (as it is safe to use UNIX style line endings on Windows -- PHP understands them well) plese check Settings | Code Style | General --> Line separator (for new files)

2) To convert line ending for existing files -- you can do this via custom plugin:

  • Settings | Plugins | Browse repositories --> find and install Webmaster one
  • After restart you will be able to convert them via right click menu (works for current file as well as selection of files/folder in project View panel)
  • This plugin also has an inspection that will offer you to convert line endings for current file if they are different from the one defined in #1
0
Comment actions Permalink

Thanks a lot,

That's exactly what I need!!

0

Please sign in to leave a comment.