Skip to content
This repository was archived by the owner on Aug 30, 2024. It is now read-only.

Commit 4294f01

Browse files
Merge pull request #111 from Trivadis/feature/issue-105-lightweight-formatter
Feature/issue 105 lightweight formatter
2 parents 26acadc + d44a07e commit 4294f01

File tree

177 files changed

+17175
-11919
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

177 files changed

+17175
-11919
lines changed

README.md

Lines changed: 40 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,10 @@
44

55
This repository provides formatter settings for the [coding style rules](https://trivadis.github.io/plsql-and-sql-coding-guidelines/v4.0/3-coding-style/coding-style/#rules) of the Trivadis PL/SQL & SQL Coding Guidelines.
66

7-
Settings are provided for
7+
Settings are primarily provided for
88

99
- [Oracle SQLcl, Version 21.1.0](https://www.oracle.com/tools/downloads/sqlcl-downloads.html)
1010
- [Oracle SQL Developer, Version 20.4.1](https://www.oracle.com/database/technologies/appdev/sql-developer.html)
11-
- [Allround Automations PL/SQL Developer, Version 14.0.5](https://www.allroundautomations.com/products/pl-sql-developer/)
1211

1312
These settings have been defined and tested with the product versions mentioned above. They might not work in other versions.
1413

@@ -18,7 +17,9 @@ See [releases](https://github.com/Trivadis/plsql-formatter-settings/releases) fo
1817

1918
## Deviating Settings
2019

21-
Please note that these settings do not comply with rule 5. Line breaks are placed after a comma and not before. All other rules are followed. However, you can easily change this in the settings for both products.
20+
Please note that these settings do not comply with rule 5. Line breaks are placed after a comma and not before. All other rules are followed. However, you can easily change this in the preferences.
21+
22+
![Change Line Breaks On Comma](images/change_line_breaks_on_comma.png)
2223

2324
## Installation
2425

@@ -32,6 +33,30 @@ See [sqlcl/README.md](sqlcl/README.md).
3233

3334
### SQL Developer
3435

36+
#### Configure `dbtools.arbori.home`
37+
38+
1. Start SQL Developer
39+
2. Open `Help` -> `About`
40+
3. Select `Properties` tab
41+
4. Type `user.conf` in the search box and press enter
42+
![About Properties - user.conf](images/about_properties_user_conf.png)
43+
5. Select the row with `user.conf` and press `Ctrl-C` to copy it into your clipboard
44+
6. Press `OK` to close the dialog
45+
7. Select `File` -> `Open...`
46+
8. Press `Ctrl-V` to paste the content of the clipboard into the `File Name` field
47+
9. Remove `user.conf` and the double quotes from the file name
48+
![File Open Dialog](images/file_open.png)
49+
10. Press `Open`
50+
11. Add `AddVMOption -Ddbtools.arbori.home=/.../plsql-formatter-settings/settings/sql_developer` at the end of the file
51+
12. Replace `/.../` to match the directory of the [`trivadis_custom_format.arbori`](settings/sql_developer/trivadis_custom_format.arbori) file on your system
52+
![product.conf](images/product_conf.png)
53+
13. Press the `Save` button in the toolbar
54+
14. Restart SQL Developer to apply this JVM configuration change
55+
15. Optionally check if `dbtools.arbori.home` is configured correctly
56+
![About Properties - dbtools.arbori.home](images/about_properties_arbori.png)
57+
58+
#### Import Settings
59+
3560
1. Start SQL Developer
3661
2. Open `Preferences`
3762
3. Select `Code Editor` -> `Format` -> `Advanced Format`
@@ -46,22 +71,6 @@ See [sqlcl/README.md](sqlcl/README.md).
4671
10. Press `Open`
4772
11. Press `OK` to save the settings
4873

49-
### PL/SQL Developer
50-
51-
1. Start PL/SQL Developer
52-
2. Open `Preferences`
53-
3. Select `User interface` -> `PL/SQL Beautifier`
54-
4. Press `Edit...`
55-
5. Press `Open...`
56-
![PL/SQL Beautifier](images/plsql_beautifier.png)
57-
6. Select [`trivadis_beautifier.br`](settings/plsql_developer/trivadis_beautifier.br)
58-
7. Press `Open`
59-
8. Press `Save as...`
60-
9. Select a permanent location for these settings and press `Save`
61-
10. Press `Close`
62-
11. Select the rule file you've saved previoulsy.
63-
12. Press `OK`
64-
6574
## Arbori
6675

6776
SQL Developer uses its own parse tree query language called Arbori for its advanced formatter configuration. Here is some additional information that might be useful if you plan to tweak the behavior of the formatter yourself.
@@ -92,6 +101,18 @@ Variable | Type | JAR File
92101
`tuple` | HashMap<String, oracle.dbtools.parser.ParseNode> | dbtools-common.jar
93102
`logger` | oracle.dbtools.util.Logger | dbtools-common.jar
94103

104+
## Settings for other Products
105+
106+
Formatter settings are also provided for the following products:
107+
108+
Product | Version | File
109+
------- | ------- | ---------
110+
[Allround Automations PL/SQL Developer](https://www.allroundautomations.com/products/pl-sql-developer/) | 14.0.6 | [trivadis_beautifier.br](settings/plsql_developer/trivadis_beautifier.br)
111+
[JetBrains DataGrip](https://www.jetbrains.com/datagrip/) | 2021.1 | [trivadis.xml](settings/datagrip/trivadis.xml)
112+
[Quest Toad for Oracle](https://www.quest.com/products/toad-for-oracle/) | 14.1 | [trivadis_fmtplus.opt](settings/toad/trivadis_fmtplus.opt)
113+
114+
Please refer to the vendor's documentation for instructions on how to import these settings.
115+
95116
## Issues
96117
Please file your bug reports, enhancement requests, questions and other support requests within [Github's issue tracker](https://help.github.com/articles/about-issues/).
97118

examples/formatted-by-hand/allroundautomations.sql

Lines changed: 0 additions & 103 deletions
This file was deleted.

examples/formatted-by-hand/oracle.sql

Lines changed: 0 additions & 81 deletions
This file was deleted.

examples/formatted-by-hand/trivadis.sql

Lines changed: 0 additions & 30 deletions
This file was deleted.

examples/formatted-by-plsql-developer/allroundautomations.sql

Lines changed: 0 additions & 85 deletions
This file was deleted.

0 commit comments

Comments
 (0)