Questions tagged [reformatting]

The act of rearranging structured text according to a ruleset concerning indentation, spacing and newlines for the specified language (java,html, etc...).

153 questions
66
votes
6 answers

Code reformatting on save in PhpStorm or other jetbrains ide

How can I set up that the code is reformatted automatically on saving? So I don't always have to press Ctrl + Alt + L.
ndrizza
  • 3,285
  • 6
  • 27
  • 41
36
votes
2 answers

MySQL Workbench > Plugins > Utilities > Reformat SQL Query

At some point I installed MySQL Workbench 5.2.47 Revision 10398. This version has the feature to reformat an SQL query located at: Plugins > Utilities > Reformat SQL Query I like this feature and I use it almost every day. Now every newer version I…
Robi Wan Kenobi
  • 1,441
  • 1
  • 10
  • 10
27
votes
2 answers

What is the difference between Reformat Code and Rearrange Code in Jetbrains IDEs?

These are options that can be found under the Code dropdown menu. Both of them seem to arrange the code in a similar manner.
roferrlls
  • 390
  • 4
  • 6
18
votes
4 answers

Tool to automatically expand YAML merges?

I'm looking for a tool or process which can easily take a YAML file which contains anchors, aliases and merge keys and expand the aliases and merges out into a flat YAML file. There are still many commonly used YAML parses which don't fully support…
jthompson
  • 843
  • 1
  • 11
  • 20
18
votes
24 answers

How to convince management that reformatting the entire Java code base is safe

How would one go about proving to management that a batch reformat of all .java files in a large code base (to place the code in compliance with the company's coding standards) is safe and will not affect functionality. The answers would have to…
jtsampson
  • 218
  • 1
  • 11
13
votes
1 answer

How to create a square dataframe/matrix given 3 columns - Python

I am struggling to figure out how to develop a square matrix given a format like a a 0 a b 3 a c 4 a d 12 b a 3 b b 0 b c 2 ... To something like: a b c d e a 0 3 4 12 ... b 3 0 2 7 ... c 4 3 0 .. . d 12 ... e . .. in pandas. I developed…
WolVes
  • 1,286
  • 2
  • 19
  • 39
11
votes
1 answer

PHPStorm. Reformat code. Chained method call wrapping

I have some questions regards to phpstorm code reformat. I have long line and single…
zhartaunik
  • 932
  • 12
  • 29
10
votes
3 answers

Can this function be rewritten with a regex?

I want to reformat and validate if a user has provided a valid Belgian enterprise number. Because the input can be all of the following examples: BE 0123.321.123 BE0123.321.123 BE0123 321 123 0123.321.123 123.321.123 123321123 I've written a…
Thore
  • 1,918
  • 2
  • 25
  • 50
10
votes
1 answer

IntelliJ IDEA 12 Keep Blank Lines

I have this code: private int a; private int b; private int c; But when I reformat it with IntelliJ, it changes to this: private int a; private int b; private int c; How would I allow it to keep the blank lines? But this code: private boolean…
Ramus
  • 250
  • 1
  • 2
  • 10
8
votes
1 answer

Disable Resharper auto-formatting around certain blocks of code

In my C# development team, we want to share auto-formatting rules to respect our coding standards to have unified code formatting. I'm actually testing ReSharper and it's great but we have one rule in our standards that I can't seem to get…
William Fortin
  • 777
  • 1
  • 4
  • 17
6
votes
0 answers

PyCharm - indentation of {% block name %} tags with Reformat Code

Is it possible to do not indent children of {% block %} django tag when Reformat Code? I'd like to have Reformated Code: {% block name %}

Some text.

{% endblock name %} No: {% block name %}

Some…

Mateusz Jagiełło
  • 6,854
  • 12
  • 40
  • 46
5
votes
2 answers

Android Studio - Rearranging XML in code style not working

So I'm trying to configure in Settings--> Code Style --> XML how I would like the order of the attributes to be sorted when reformatting the code using ctrl+shift+L on Windows. In my case, first all xmlns and other namespace attributes and then all…
Roy Hen Engel
  • 625
  • 1
  • 7
  • 21
4
votes
3 answers

Reconstruct a categorical variable from dummies in R

Heyho, I am a beginner in R and have a problem to which I couldn't find a solution so far. I would like to transform dummy variables back to categorical variables. |dummy1| dummy2|dummy3| |------| ------|------| | 0 | 1 |0 | | 1 | 0 …
waterline
  • 67
  • 1
  • 6
4
votes
3 answers

Remove Dollar signs from SAS Column

I have an SAS dataset that has $'s in with some of the columns. So instead of reading 67,349 it reads $67,349. How do I remove all the $'s from all the columns and have SAS recognize them as numbers? There are only a few columns with the dollar…
user18101
  • 626
  • 3
  • 13
  • 22
4
votes
1 answer

Object Initializer Formatting

Which setting(s) in Resharper 8 are reformatting my object initializer like this? (i.e. with the comma on it's own line). var snowDepthProcessor = new DataProcessor { Name = "Snow Depth" , DataRetriever =…
David Hayes
  • 7,402
  • 14
  • 50
  • 62
1
2 3
10 11