braykov
Member³
Hi,
I have created a script that sets a beautifier file and then beautifies a very large number of files. I need to unify the code in our company so we can use version control.
Turns out the BEAUTIFY command breaks the code inside it. Many lines are stuck to the right without adding leading whitespace.
I have further tested trying to beautify a single file. The file is a package .pck, containing the header and the body.
I did two major scenarios. One succeeds and one files.
Successful steps:
1) I dragged the original file to the program window. The file was opened.
2) I clicked the beautifier icon. -> The file gets beautified correctly
Failure steps:
1) I login and open a command window
2) I set a beautifier file: SET BEAUTIFIERRULES 'C:\temp\newBeautifier.br'
3) I execute the command: BEAUTIFY C:\Work\git\db\Packages\myfile.pck
I get the message that the file was beautified. No errors were shown.
The file is broken. I compared it with the correctly formatted file from the first test above - there are a lot of differences.
The same failure occurs if I create a .plsql file and execute it with command-line parameters of PLSQLD.
My conclusion - the BEAUTIFY command and the menu command do not do the same thing. Or I suspect in some way the rules file is not set successfully.
PL/SQL Developer
Version 11.0.4.1774
01.97711 - 13 user license
Service Contract: 01.12.2015
Windows 7 (64-bit) 6.1 Build 7601 (Service Pack 1)
UPDATE:
I did some more testing and I noticed the following:
1) Opening a DOS-style .pck file and saving it after beautifying using the Edit menu results in Unix-style file.
2) Beautifying a DOS-style file using a script with BEAUTIFY command, results in a DOS-style file.
3) I noticed the broken code in the file occurs immediately after the "CREATE OR REPLACE PACKAGE BODY...". The header of the package is beautified properly (only the first empty line before CREATE OR REPLACE BACKAGE... is not removed).
4) I removed the following part from the original file and beautified again (simulated only a header)
This results in a properly formatted code in the whole file. So, is this a bug? And how quickly can it be solved (or workarounded)?
UPDATE2:
The same problem occurs with CREATE OR REPLACE TYPE and CREATE OR REPLACE TYPE BODY.
I have created a script that sets a beautifier file and then beautifies a very large number of files. I need to unify the code in our company so we can use version control.
Turns out the BEAUTIFY command breaks the code inside it. Many lines are stuck to the right without adding leading whitespace.
I have further tested trying to beautify a single file. The file is a package .pck, containing the header and the body.
I did two major scenarios. One succeeds and one files.
Successful steps:
1) I dragged the original file to the program window. The file was opened.
2) I clicked the beautifier icon. -> The file gets beautified correctly
Failure steps:
1) I login and open a command window
2) I set a beautifier file: SET BEAUTIFIERRULES 'C:\temp\newBeautifier.br'
3) I execute the command: BEAUTIFY C:\Work\git\db\Packages\myfile.pck
I get the message that the file was beautified. No errors were shown.
The file is broken. I compared it with the correctly formatted file from the first test above - there are a lot of differences.
The same failure occurs if I create a .plsql file and execute it with command-line parameters of PLSQLD.
My conclusion - the BEAUTIFY command and the menu command do not do the same thing. Or I suspect in some way the rules file is not set successfully.
PL/SQL Developer
Version 11.0.4.1774
01.97711 - 13 user license
Service Contract: 01.12.2015
Windows 7 (64-bit) 6.1 Build 7601 (Service Pack 1)
UPDATE:
I did some more testing and I noticed the following:
1) Opening a DOS-style .pck file and saving it after beautifying using the Edit menu results in Unix-style file.
2) Beautifying a DOS-style file using a script with BEAUTIFY command, results in a DOS-style file.
3) I noticed the broken code in the file occurs immediately after the "CREATE OR REPLACE PACKAGE BODY...". The header of the package is beautified properly (only the first empty line before CREATE OR REPLACE BACKAGE... is not removed).
4) I removed the following part from the original file and beautified again (simulated only a header)
Code:
END;
/
CREATE OR REPLACE PACKAGE BODY "IBANK"."FACE" IS
This results in a properly formatted code in the whole file. So, is this a bug? And how quickly can it be solved (or workarounded)?
UPDATE2:
The same problem occurs with CREATE OR REPLACE TYPE and CREATE OR REPLACE TYPE BODY.
Last edited: