I&#x27;ll offer another opinion on this - I an a frontend developer and so it&#x27;s very common for me to have to deal with files that are written in PHP, HTML, JavaScript, and also sometimes including CSS embedded right in it.<p>Roughly speaking, PHP and JavaScript have a similar syntax and can be formatted&#x2F;styled in a similar way, but HTML it a totally different beast and has very different structure, as well as CSS which is a glorified list of rules.<p>I don&#x27;t refactor code for the sake of it, however, in an effort to read related files I often clean things up that I must read in order to edit another section. I don&#x27;t discard my cleanups because I&#x27;m leaving it better than when I found it (and cleaning up a messy repository is tough, but a little in each commit can help).<p>So I agree that you should style where you&#x27;re working - but there are valid reasons to refactor or restyle code in other places too. Here&#x27;s an example of a file I&#x27;ve been updating lately:<p>- before: <a href="http:&#x2F;&#x2F;i.imgur.com&#x2F;X37RFQD.png" rel="nofollow">http:&#x2F;&#x2F;i.imgur.com&#x2F;X37RFQD.png</a><p>- after: <a href="http:&#x2F;&#x2F;i.imgur.com&#x2F;9cjiJxn.png" rel="nofollow">http:&#x2F;&#x2F;i.imgur.com&#x2F;9cjiJxn.png</a>