Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Formatting CLI Tool #15664

Closed
Show file tree
Hide file tree
Changes from 8 commits
Commits
Show all changes
293 commits
Select commit Hold shift + click to select a range
a13ccc9
Refactor code
ldclakmal Jun 10, 2019
d8deb1a
Expose client config for grant types
ldclakmal Jun 10, 2019
b4b6b08
Change package name and class name generation
gimantha Jun 11, 2019
283ad36
Fix NPE issue when package is null
gimantha Jun 11, 2019
14cff0d
Enable rest of the native impl tests of streams
gimantha Jun 11, 2019
432b32a
Merge upstream
gimantha Jun 11, 2019
05b18bd
Fix lang-server related bal files
ldclakmal Jun 11, 2019
6d5bb20
Update module md of auth related modules
ldclakmal Jun 11, 2019
6802e5f
Add formatting CLI tool
NipunaMarcus Jun 11, 2019
c852091
Refactor JWT records
ldclakmal Jun 11, 2019
6200038
Fix JWT unit tests
ldclakmal Jun 11, 2019
393c5af
Merge branch 'master' of https://github.com/ballerina-platform/baller…
ldclakmal Jun 11, 2019
fd4f66e
Resolve conflicts
NipunaMarcus Jun 11, 2019
ee45e36
Update CHANGELOG.md
NipunaMarcus Jun 11, 2019
f123e9a
Update license year in pom.xml
NipunaMarcus Jun 12, 2019
328ba22
Update license year in spotbugs-exclude.xml
NipunaMarcus Jun 12, 2019
ca1c2d9
Improve unit tests related to auth module
ldclakmal Jun 12, 2019
2344afe
Refactor auth unit tests related to http module
ldclakmal Jun 12, 2019
0062359
Add formatting support for type init expression
NipunaMarcus Jun 12, 2019
567485e
Refactor unit tests related to jwt module
ldclakmal Jun 12, 2019
bafaf91
Enable auth related tests in http module
ldclakmal Jun 12, 2019
2e6575f
Add requested changes
NipunaMarcus Jun 12, 2019
efafbac
Merge branch 'formatting-cli-tool-dev' of https://github.com/NipunaMa…
NipunaMarcus Jun 12, 2019
bc9dd24
Enable object tests
SupunS Jun 12, 2019
569e43b
Merge branch 'master' of https://github.com/ballerina-platform/baller…
SupunS Jun 12, 2019
82a6f4b
Cleanup code
SupunS Jun 12, 2019
a1042b2
Refactor integration tests
ldclakmal Jun 13, 2019
cb92b15
Fix http message in tests
SupunS Jun 13, 2019
513de50
Merge branch 'master' of https://github.com/ballerina-platform/baller…
SupunS Jun 13, 2019
61c5d9b
Update custom auth provider integration test case
ldclakmal Jun 13, 2019
bf338d1
Refactor integration tests
ldclakmal Jun 13, 2019
42bd1f7
Use composer libs from Ballerina home
kaviththiranga Jun 13, 2019
3edc633
Remove composer lib dependency from vscode
kaviththiranga Jun 13, 2019
8efdd73
Fix import path for extension instance
kaviththiranga Jun 13, 2019
f7e6a83
Merge branch 'master' of https://github.com/ballerina-platform/baller…
ldclakmal Jun 13, 2019
7d8cf3f
Fix checkstyle issues
SupunS Jun 13, 2019
7358c79
Enable tests
SupunS Jun 13, 2019
a80585e
Merge branch 'master' of https://github.com/ballerina-platform/baller…
SupunS Jun 13, 2019
886f5b0
Merge branch 'master' of https://github.com/ballerina-platform/baller…
SupunS Jun 13, 2019
70502b2
Enable all XML tests
SupunS Jun 13, 2019
685a25d
Merge branch 'master' of https://github.com/ballerina-platform/baller…
ldclakmal Jun 14, 2019
87fb758
Fix spelling mistakes & lint issues
kaviththiranga Jun 14, 2019
8bdfdcb
Refactor code
ldclakmal Jun 14, 2019
f5a5d29
Fix a bug in inspecting oauth2 provider
ldclakmal Jun 14, 2019
8edfa23
Merge branch 'master' of https://github.com/ballerina-platform/baller…
ldclakmal Jun 14, 2019
60a0a69
Fix a bug in oauth2 outbound provider
ldclakmal Jun 14, 2019
deebf32
Enable stream query filter test
gimantha Jun 14, 2019
e290ccc
Fix streamevent data field access isue
gimantha Jun 14, 2019
87f21ca
Expose composer lib to vscode webview securely
kaviththiranga Jun 14, 2019
ebcc982
Merge branch 'master' of https://github.com/ballerina-platform/baller…
gimantha Jun 14, 2019
ffef152
Add module import suggestions for the current project
rasika Jun 14, 2019
e50a03f
Add tests for the package imports
rasika Jun 14, 2019
85a1467
Merge branch 'master' of https://github.com/ballerina-platform/baller…
ldclakmal Jun 14, 2019
e941f28
Enable auth tests of http module
ldclakmal Jun 14, 2019
211ca1f
Fix a bug in bbe
ldclakmal Jun 15, 2019
ce2c0a1
Fix balo creator for tests
SupunS Jun 15, 2019
5e469f3
Merge branch 'master' of https://github.com/ballerina-platform/baller…
SupunS Jun 15, 2019
85481b0
Fix doc issue
rasika Jun 15, 2019
db25133
Fix json error message
warunalakshitha Jun 15, 2019
d3bc35b
Fix match method args issue
warunalakshitha Jun 15, 2019
8cfc2bc
Enable more expression test packages
warunalakshitha Jun 15, 2019
a051e5a
Merge branch 'master' of https://github.com/ballerina-platform/baller…
SupunS Jun 15, 2019
f0eb26c
Fix message enriching for http/mime tests
SupunS Jun 15, 2019
dcfc7b6
Refactor json error message
warunalakshitha Jun 15, 2019
9540fba
Merge branch 'master' of https://github.com/ballerina-platform/baller…
SupunS Jun 15, 2019
3cbcacd
Merge master branch
warunalakshitha Jun 15, 2019
8bcaaa2
Fix object create value method to populate field values
Kishanthan Jun 16, 2019
2f25ec4
Update javadoc comment
Kishanthan Jun 16, 2019
b20864b
Fix hhtp/mime tests
SupunS Jun 15, 2019
abdda0c
Fix iterable desugar for min() and max() operations
SupunS Jun 16, 2019
e8863a4
Fix record equivalency checking
SupunS Jun 16, 2019
8e63ece
Fix object Documentation test
SupunS Jun 16, 2019
6c39d47
Merge commit 'refs/pull/15700/head' of https://github.com/ballerina-p…
SupunS Jun 16, 2019
f48b5af
Refactor code
SupunS Jun 16, 2019
5163b3c
Fix failing tests
SupunS Jun 16, 2019
3c056ff
Remove unused imports to fix tsc errors
kaviththiranga Jun 17, 2019
de46021
Merge branch 'master' of https://github.com/ballerina-platform/baller…
SupunS Jun 17, 2019
a2fd0d9
Improve error handling
rasika Jun 15, 2019
ae4fd1f
Fix array of unions type testing issue
gimantha Jun 17, 2019
96f87eb
Fix streaming test cases for jballerina
gimantha Jun 17, 2019
e6df674
Fix a bug in oauth2 caching
ldclakmal Jun 17, 2019
d2643b9
Introduce a new boolean preference to override Ballerina home
kaviththiranga Jun 17, 2019
71a281e
Refactor outbound oauth2 configurations
ldclakmal Jun 17, 2019
2657238
Merge branch 'master' of https://github.com/ballerina-platform/baller…
ldclakmal Jun 17, 2019
3aad557
Merge branch 'master' of https://github.com/ballerina-platform/baller…
Kishanthan Jun 17, 2019
b3f8231
Merge with master
gimantha Jun 17, 2019
f8de515
Fix annotation and top level completion tests
nadeeshaan Jun 18, 2019
9220758
Refactor code
ldclakmal Jun 18, 2019
3899aa0
Fix resource definition completion tests
nadeeshaan Jun 18, 2019
345748d
Change pref key for ballerina home overriding
kaviththiranga Jun 18, 2019
b1c762d
Fix Sevice definition completion tests
nadeeshaan Jun 18, 2019
53a4865
Refactor basic auth configurations
ldclakmal Jun 18, 2019
9590a85
Refactor jwt auth configurations
ldclakmal Jun 18, 2019
b727133
Refactor ldap auth configurations
ldclakmal Jun 18, 2019
9765bfa
Add argument passing support
vinok88 Jun 18, 2019
19bf34c
Revert "Add argument passing support"
vinok88 Jun 18, 2019
563948c
Fix integration tests with config refactoring
ldclakmal Jun 18, 2019
47f2a42
Update module md
ldclakmal Jun 18, 2019
fb67033
Enable test cases
wggihan Jun 18, 2019
1172898
Merge branch 'master' of https://github.com/ballerina-platform/baller…
wggihan Jun 19, 2019
4e7396e
Refactor code
ldclakmal Jun 19, 2019
fc5fd69
Compile and run bal files with jballerina run commond
vinok88 Jun 19, 2019
e84f375
Merge branch 'master' of https://github.com/ballerina-platform/baller…
ldclakmal Jun 19, 2019
dc9b645
Refactor provider constructors
ldclakmal Jun 19, 2019
22de1f9
Merge branch 'master' of https://github.com/ballerina-platform/baller…
SupunS Jun 19, 2019
1f04feb
Merge pull request #15822 from wggihan/io-test-fix
SupunS Jun 19, 2019
0e0470c
Merge branch 'jballerina' of https://github.com/ballerina-platform/ba…
SupunS Jun 19, 2019
104abb7
Merge branch 'jballerina' of https://github.com/ballerina-platform/ba…
wggihan Jun 19, 2019
e49e154
Fix failing test
gimantha Jun 19, 2019
14e55a2
Fix log-api module in jBallerina
Bhashinee Jun 19, 2019
968d301
Merge jballerina branch
warunalakshitha Jun 19, 2019
8a459fc
Fix lhs nil lifting and field access test cases
lankavitharana Jun 19, 2019
29aac2b
Merge branch 'jballerina' of https://github.com/ballerina-lang/baller…
Bhashinee Jun 19, 2019
f3c86fd
Merge branch 'jballerina' of https://github.com/ballerina-platform/ba…
lankavitharana Jun 19, 2019
a7752fe
Add map constants
SupunS Jun 19, 2019
a3f927e
Merge pull request #15790 from Kishanthan/fix-object-value-field-values
SupunS Jun 19, 2019
1be5c35
Merge branch 'jballerina' of https://github.com/ballerina-platform/ba…
SupunS Jun 19, 2019
7aba861
fix function completion tests
nadeeshaan Jun 19, 2019
0547c58
Enable function completion tests
nadeeshaan Jun 19, 2019
ec43761
Fix checkstyle issues
nadeeshaan Jun 19, 2019
36e320f
Sync with master
SupunS Jun 19, 2019
1daa3fa
Merge pull request #15847 from lankavitharana/testFix
SupunS Jun 19, 2019
e691cf4
Merge branch 'jballerina' of https://github.com/ballerina-platform/ba…
SupunS Jun 19, 2019
d6fdb8a
Fix services with main
vinok88 Jun 19, 2019
c8136b8
Merge branch 'master' of https://github.com/ballerina-platform/baller…
lankavitharana Jun 20, 2019
6a40a5e
Merge branch 'jballerina' of https://github.com/ballerina-platform/ba…
lankavitharana Jun 20, 2019
6da55fd
Merge branch 'jballerina' of https://github.com/ballerina-lang/baller…
Bhashinee Jun 20, 2019
00277ef
Merge pull request #15849 from nadeeshaan/dev-branch
nadeeshaan Jun 20, 2019
2983653
Fix failing jballerina tests
SupunS Jun 19, 2019
fb754c4
Merge branch 'enable-tests-2' into constants
SupunS Jun 20, 2019
c03f182
Merge branch 'jballerina' of https://github.com/ballerina-platform/ba…
vinok88 Jun 20, 2019
22d02b9
Remove null and add "." when there is no package
Bhashinee Jun 20, 2019
7aafe82
Add composer libraries to jballerina maven build
NipunaRanasinghe Jun 20, 2019
4559284
Add composer libraries to jballerina gradle build
NipunaRanasinghe Jun 20, 2019
9c4baa8
Disable file service tests
vinok88 Jun 20, 2019
d144739
Fix http caching issue, fix was to change the state var value generat…
lankavitharana Jun 20, 2019
f3a591f
Merge branch 'jballerina' of https://github.com/ballerina-platform/ba…
lankavitharana Jun 20, 2019
28e2c78
Merge pull request #15791 from SupunS/enable-tests-2
SupunS Jun 20, 2019
623e629
Refactor code
gimantha Jun 20, 2019
effe588
Merge branch 'master' of https://github.com/ballerina-platform/baller…
wggihan Jun 20, 2019
92379e8
Merge branch 'jballerina' of https://github.com/ballerina-platform/ba…
gimantha Jun 20, 2019
df6c97e
Merge branch 'jballerina' of https://github.com/ballerina-platform/ba…
wggihan Jun 20, 2019
2b3b355
Refactor ldap module for jballerina
ldclakmal Jun 20, 2019
7f285bd
Fix checkstyle issues
gimantha Jun 20, 2019
62542e9
Fix all remaining completion tests
nadeeshaan Jun 20, 2019
5e724f7
Enable test cases
wggihan Jun 20, 2019
0c7a232
Fix tests
SupunS Jun 20, 2019
96863db
Fix transaction module build
SupunS Jun 20, 2019
557894d
Add dry run feature and remove confirmation
NipunaMarcus Jun 20, 2019
5e6713b
Merge branch 'master' of https://github.com/ballerina-platform/baller…
NipunaMarcus Jun 20, 2019
364ceac
Fix source prune test cases
nadeeshaan Jun 20, 2019
0b96d9a
Rename FormattingCmd to FormatCmd
NipunaMarcus Jun 20, 2019
3b331ed
Fix cli-utils and prometheus build
SupunS Jun 20, 2019
b20ff75
Merge branch 'jballerina' of https://github.com/ballerina-platform/ba…
SupunS Jun 20, 2019
293d028
Disable tests temporarily
gimantha Jun 20, 2019
c5b4b65
Revert: Merge with master (b3f82316)
gimantha Jun 20, 2019
fe784f0
Merge pull request #15864 from lankavitharana/testFix
wggihan Jun 20, 2019
d26cbad
Add deleted tests
gimantha Jun 20, 2019
7034e43
Refactor code
gimantha Jun 20, 2019
de20c58
Merge pull request #15869 from NipunaRanasinghe/jabllerina-composer-l…
NipunaRanasinghe Jun 20, 2019
639ac64
Refactor crypto module for jballerina
ldclakmal Jun 20, 2019
0d6604e
Fix crypto test cases for jballerina
ldclakmal Jun 20, 2019
a5e6a25
Change preference name to Plugin Dev Mode
kaviththiranga Jun 20, 2019
f0a65b1
Cleanup code
SupunS Jun 20, 2019
872df5b
Merge pull request #15837 from vinok88/tests
SupunS Jun 20, 2019
9daf751
Revert change
gimantha Jun 20, 2019
ddf70a6
Revert change manually
gimantha Jun 20, 2019
2d93d2b
Fix _start method invocation for service only mode
vinok88 Jun 20, 2019
4520d7a
Merge branch 'jballerina' of https://github.com/ballerina-platform/ba…
nadeeshaan Jun 21, 2019
4dc81b5
Merge pull request #15767 from rasika/fix-15719
rasika Jun 21, 2019
48bd189
Enable balo tests
SupunS Jun 21, 2019
1c1758f
Fix definition test cases
nadeeshaan Jun 21, 2019
cd6b5d2
Fix checkstyle issues
ldclakmal Jun 21, 2019
0ae02c0
Complete migration of WebSocket to JBallerina
riyafa Jun 20, 2019
538d1e7
Merge pull request #15785 from rasika/fix-15418
rasika Jun 21, 2019
7cb25a5
Merge pull request #15727 from kaviththiranga/bundlevscode
kaviththiranga Jun 21, 2019
632eca6
Fix references and rename tests
nadeeshaan Jun 21, 2019
34fd8d8
Merge branch 'jballerina' into newPrefForBalHome
kaviththiranga Jun 21, 2019
d2ceb42
Sync with upstream
nadeeshaan Jun 21, 2019
12b4c1a
Merge pull request #15905 from vinok88/tests
vinok88 Jun 21, 2019
36cf71a
Merge pull request #15799 from kaviththiranga/newPrefForBalHome
kaviththiranga Jun 21, 2019
76defe6
Merge pull request #15883 from wggihan/io-test-fix
wggihan Jun 21, 2019
dd44a0c
Refactor code
ldclakmal Jun 21, 2019
fc3fdb5
Merge pull request #15871 from riyafa/websocket
riyafa Jun 21, 2019
36a2143
Merge pull request #15872 from ldclakmal/ldap-for-jballerina
ldclakmal Jun 21, 2019
1e482a5
Apply suggestions for BBE from code review
ldclakmal Jun 21, 2019
9c601fd
Apply suggestions from code review
ldclakmal Jun 21, 2019
790883e
Update intellij language client dependency version
NipunaRanasinghe Jun 21, 2019
475b363
Apply suggestions from code review
ldclakmal Jun 21, 2019
e6e1416
Add workers for next processors
gimantha Jun 21, 2019
e70ddf0
Reformat docs
ldclakmal Jun 21, 2019
936bfcd
Merge branch 'jballerina' of https://github.com/ballerina-platform/ba…
ldclakmal Jun 21, 2019
01564f3
Eable few tests
gimantha Jun 22, 2019
31d3b37
Revert: Add workers for next processors (e6e1416f)
gimantha Jun 22, 2019
1993643
fix balo read and write
SupunS Jun 22, 2019
5030cdb
Merge pull request #15910 from nadeeshaan/jballerina-dev
NipunaMarcus Jun 22, 2019
2c9fc8b
Merge pull request #15920 from NipunaRanasinghe/pr/jb-update-lang-cli…
gimantha Jun 22, 2019
bd6a8a9
Merge branch 'jballerina' of https://github.com/ballerina-platform/ba…
gimantha Jun 22, 2019
1043412
Fix constnts in compiled packages
SupunS Jun 22, 2019
7e19ae4
Merge pull request #15888 from gimantha/http+io_temp
SupunS Jun 22, 2019
41fa094
Fix formatting tests and enabled
NipunaMarcus Jun 22, 2019
cbf62c2
Resolve conflicts
NipunaMarcus Jun 22, 2019
9e0cc42
Fix check not getting formatted in binary expr
NipunaMarcus Jun 22, 2019
5970f7a
Fix balo tests
SupunS Jun 22, 2019
979455c
Merge branch 'jballerina' of https://github.com/ballerina-platform/ba…
SupunS Jun 22, 2019
45d3fc1
Cleanup code
SupunS Jun 22, 2019
b737d60
Disable http/mime tests that uses bvm
SupunS Jun 22, 2019
11d5885
Disable language serve completion tests
SupunS Jun 22, 2019
93962c0
Merge pull request #15935 from NipunaMarcus/jballerina
NipunaMarcus Jun 22, 2019
c38f82b
Merge branch 'jballerina' of https://github.com/ballerina-platform/ba…
SupunS Jun 23, 2019
fe4c12d
Disable failing language serve tests
SupunS Jun 23, 2019
6b6ccdb
Migrate filepath to jballerina
riyafa Jun 21, 2019
b1e72a5
Revamp signature help feature
rasika Jun 20, 2019
71ff8a8
Remove redundant SignatureHelpUtilTest
rasika Jun 20, 2019
9e3b1cc
Remove parameter population for function invocations
rasika Jun 20, 2019
302ae8d
Move CompletionUtil.getPrunedSource into SourcePruner
rasika Jun 19, 2019
f35e99b
Change WorkspaceDocument.toString() to show pruned-source when available
rasika Jun 19, 2019
3797449
Add signature tests
rasika Jun 21, 2019
a652148
Enable SignatureHelpTest
rasika Jun 23, 2019
b75d9a8
Merge pull request #15936 from SupunS/enable-tests-2
lankavitharana Jun 23, 2019
763f247
Add formatting support for unary
NipunaMarcus Jun 23, 2019
7e27e95
Merge branch 'jballerina' of https://github.com/ballerina-platform/ba…
NipunaMarcus Jun 23, 2019
de9ed4e
Merge branch 'jballerina' of https://github.com/ballerina-platform/ba…
ldclakmal Jun 24, 2019
f6f647f
Merge branch 'jballerina' of https://github.com/ballerina-platform/ba…
ldclakmal Jun 24, 2019
8ee14d4
Merge pull request #15914 from riyafa/file
riyafa Jun 24, 2019
75e497e
Fix checkstyle issue
NipunaMarcus Jun 24, 2019
77e49fb
Merge branch 'jballerina' of https://github.com/ballerina-platform/ba…
NipunaMarcus Jun 24, 2019
d659ec7
Change the ballerina command to jballerina in vscode extension
nadeeshaan Jun 24, 2019
e03f320
Merge pull request #15843 from Bhashinee/http+io3
Bhashinee Jun 24, 2019
9d37df0
Exclude redundant composer files in ballerina tools distribution
NipunaRanasinghe Jun 24, 2019
0263bf4
Fix object type referencing
SupunS Jun 24, 2019
843e0be
Add formatting for worker send and flush
NipunaMarcus Jun 24, 2019
e609286
Merge pull request #15943 from NipunaMarcus/jballerina
NipunaMarcus Jun 24, 2019
fabb5e0
Merge branch 'jballerina' of https://github.com/ballerina-platform/ba…
NipunaMarcus Jun 24, 2019
2187b2d
Merge branch 'jballerina' into access_tests
SupunS Jun 24, 2019
5c3d58a
Resolve conflicts
SupunS Jun 24, 2019
1b262cd
Resolve conflicts
SupunS Jun 24, 2019
994904c
Add stamp test to testng
SupunS Jun 24, 2019
d6148f4
Merge pull request #15909 from ldclakmal/crypto-for-jballerina
ldclakmal Jun 24, 2019
b0d7e26
Resolve conflicts
NipunaMarcus Jun 24, 2019
2237ec2
Merge pull request #15958 from nadeeshaan/change-ballerina-command2
nadeeshaan Jun 24, 2019
4d1ce53
Merge branch 'jballerina' of https://github.com/ballerina-platform/ba…
ldclakmal Jun 24, 2019
713da2e
Merge pull request #15874 from rasika/fix-15818
nadeeshaan Jun 25, 2019
5d40160
Merge pull request #15846 from warunalakshitha/access_tests
SupunS Jun 25, 2019
5b663ca
Merge pull request #15975 from SupunS/enable-tests-2
vinok88 Jun 25, 2019
2a74360
Merge pull request #15972 from NipunaRanasinghe/jballerina-compoer-fix
NipunaRanasinghe Jun 25, 2019
f0b0ab7
Merge pull request #15696 from ldclakmal/refactor-outbound-auth
ldclakmal Jun 25, 2019
7188e56
Merge pull request #15977 from NipunaMarcus/jballerina
NipunaMarcus Jun 25, 2019
65d517a
Add requested .help and readme file changes
NipunaMarcus Jun 25, 2019
62fcf0d
Resolve conflicts
NipunaMarcus Jun 25, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ All notable changes to this project will be documented in this file. When sendin

### Tooling

-
- [Add Formatting CLI tool](https://github.com/ballerina-platform/ballerina-lang/pull/15664)
-
-
-
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
NAME
Ballerina Format - Format ballerina source files according to
NipunaMarcus marked this conversation as resolved.
Show resolved Hide resolved
the default Ballerina style guide.
NipunaMarcus marked this conversation as resolved.
Show resolved Hide resolved
https://github.com/ballerina-platform/ballerina-lang/tree/master/docs/style_guide
NipunaMarcus marked this conversation as resolved.
Show resolved Hide resolved

SYNOPSIS
ballerina format [ballerinaFile|moduleName] [-ow|--over-write]

DESCRIPTION
Format Ballerina source files according to the ballerina style guide.
NipunaMarcus marked this conversation as resolved.
Show resolved Hide resolved

Formatting can be performed on Ballerina project, on a Ballerina Module,
NipunaMarcus marked this conversation as resolved.
Show resolved Hide resolved
on a Ballerina file.

Formatted content will be written on to the original files and will ask
for confirmation before proceeding to replace the original content.

If Ballerina sources contains syntax errors they will be notified and
NipunaMarcus marked this conversation as resolved.
Show resolved Hide resolved
formatting won't proceed until they are fixed.
NipunaMarcus marked this conversation as resolved.
Show resolved Hide resolved

SUB COMMANDS
ballerina format
Format the all ballerina source files available in the given ballerina project.
NipunaMarcus marked this conversation as resolved.
Show resolved Hide resolved
This command should be executed from the ballerina project root.
NipunaMarcus marked this conversation as resolved.
Show resolved Hide resolved

ballerina format <moduleName>
Format the all ballerina source files available in the given module. This command
NipunaMarcus marked this conversation as resolved.
Show resolved Hide resolved
should be executed from the ballerina project root.
NipunaMarcus marked this conversation as resolved.
Show resolved Hide resolved

ballerina format <ballerinaFile>
Format the given ballerina file to match the default Ballerina style guide.
NipunaMarcus marked this conversation as resolved.
Show resolved Hide resolved
Formatted source will replace the given files content with user consent.
NipunaMarcus marked this conversation as resolved.
Show resolved Hide resolved

OPTIONS
-ow
--over-write
By providing this option user can over write the original file content without blocked by consent message.
CAUTION: This process is not reversible unless your file is under a VCS.
If you don't want your original source file content to be replaced with
Formatted code please do not use this command.

-h
--help
Show help file for the format command.
NipunaMarcus marked this conversation as resolved.
Show resolved Hide resolved

EXAMPLES
Format Ballerina project
$ ballerina format

Format Ballerina module
$ ballerina format module1

Format Ballerina file
$ ballerina format hello.bal

Overwrite without confirmation
$ ballerina format -ow
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ DESCRIPTION
test Test Ballerina program
NipunaMarcus marked this conversation as resolved.
Show resolved Hide resolved
version Print Ballerina version
NipunaMarcus marked this conversation as resolved.
Show resolved Hide resolved
encrypt Encrypt sensitive data
NipunaMarcus marked this conversation as resolved.
Show resolved Hide resolved
format Format ballerina source code
NipunaMarcus marked this conversation as resolved.
Show resolved Hide resolved

OPTIONS
Ballerina help takes no command line options
NipunaMarcus marked this conversation as resolved.
Show resolved Hide resolved
Expand Down
1 change: 1 addition & 0 deletions distribution/zip/ballerina-tools/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ dependencies {
dist project(':openapi-ballerina:openapi-to-ballerina-generator')
dist project(':ballerina-backend-jvm')
dist project(':language-server:language-server-compiler')
dist project(':ballerina-formatter')
dist project(':ballerina-packerina')
// dist project(':protobuf-ballerina')
dist project(':openapi-ballerina:openapi-to-ballerina-generator')
Expand Down
4 changes: 4 additions & 0 deletions distribution/zip/ballerina-tools/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,10 @@
<groupId>org.ballerinalang</groupId>
<artifactId>openapi-to-ballerina-generator</artifactId>
</dependency>
<dependency>
<groupId>org.ballerinalang</groupId>
<artifactId>ballerina-formatter</artifactId>
</dependency>
<dependency>
<groupId>org.ballerinalang</groupId>
<artifactId>ballerina-client-generator</artifactId>
Expand Down
1 change: 1 addition & 0 deletions distribution/zip/ballerina-tools/src/assembly/bin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@
in ballerina OpenAPI CLI tools
-->
<include>org.ballerinalang:language-server-compiler:jar</include>
<include>org.ballerinalang:ballerina-formatter:jar</include>
<include>org.ballerinalang:ballerina-packerina:jar</include>
<include>org.ballerinalang:protobuf-ballerina:jar</include>
<include>org.ballerinalang:ballerina-client-generator:jar</include>
Expand Down
2 changes: 1 addition & 1 deletion distribution/zip/jballerina-tools/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ dependencies {
dist project(':ballerina-runtime')

dist project(':testerina:testerina-core')

dist project(':ballerina-formatter')
dist project(':openapi-ballerina:openapi-to-ballerina-generator')
dist project(':ballerina-backend-jvm')
dist project(':language-server:language-server-compiler')
Expand Down
4 changes: 4 additions & 0 deletions distribution/zip/jballerina-tools/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,10 @@
<groupId>org.ballerinalang</groupId>
<artifactId>ballerina-client-generator</artifactId>
</dependency>
<dependency>
<groupId>org.ballerinalang</groupId>
<artifactId>ballerina-formatter</artifactId>
</dependency>
<dependency>
<groupId>org.ballerinalang</groupId>
<artifactId>protobuf-ballerina</artifactId>
Expand Down
1 change: 1 addition & 0 deletions distribution/zip/jballerina-tools/src/assembly/bin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@
in ballerina OpenAPI CLI tools
-->
<include>org.ballerinalang:language-server-compiler:jar</include>
<include>org.ballerinalang:ballerina-formatter:jar</include>
<include>org.ballerinalang:ballerina-packerina:jar</include>
<include>org.ballerinalang:protobuf-ballerina:jar</include>
<include>org.ballerinalang:ballerina-client-generator:jar</include>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.ballerinalang.langserver.formatting;
package org.ballerinalang.langserver.compiler.format;

/**
* Formatting constants for keywords used in the formatting util.
Expand Down Expand Up @@ -54,4 +54,5 @@ public class FormattingConstants {
public static final String KIND = "kind";
public static final String TYPE = "type";
public static final String NAME = "name";
public static final String EXPRESSIONS = "expressions";
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,12 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.ballerinalang.langserver.formatting;
package org.ballerinalang.langserver.compiler.format;

import com.google.gson.JsonArray;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import org.ballerinalang.langserver.compiler.sourcegen.FormattingSourceGen;

import java.util.ArrayList;
import java.util.List;
Expand Down Expand Up @@ -2913,8 +2914,8 @@ public void formatPanicNode(JsonObject node) {
}

// Handle the expression formatting.
if (node.has("expressions")) {
node.getAsJsonObject("expressions").add(FormattingConstants.FORMATTING_CONFIG,
if (node.has(FormattingConstants.EXPRESSIONS)) {
node.getAsJsonObject(FormattingConstants.EXPRESSIONS).add(FormattingConstants.FORMATTING_CONFIG,
this.getFormattingConfig(0, 1, this.getWhiteSpaceCount(indentation),
false, this.getWhiteSpaceCount(indentationOfParent),
formatConfig.get(FormattingConstants.USE_PARENT_INDENTATION).getAsBoolean()));
Expand Down Expand Up @@ -3006,20 +3007,10 @@ public void formatRecordLiteralExprNode(JsonObject node) {
if (node.has(FormattingConstants.WS) && node.has(FormattingConstants.FORMATTING_CONFIG)) {
JsonArray ws = node.getAsJsonArray(FormattingConstants.WS);
JsonObject formatConfig = node.getAsJsonObject(FormattingConstants.FORMATTING_CONFIG);
String indentation = this.getIndentation(formatConfig, false);
String indentWithParentIndentation = this.getParentIndentation(formatConfig);
String parentKind = node.getAsJsonObject(FormattingConstants.PARENT).get(FormattingConstants.KIND)
.getAsString();
boolean isTable = parentKind.equals("Table");
boolean isExpression = parentKind.equals("Endpoint") || parentKind.equals("AnnotationAttachment")
|| parentKind.equals("Service") || parentKind.equals("Variable") || parentKind.equals("Invocation")
|| parentKind.equals("ErrorConstructor") || parentKind.equals("RecordLiteralExpr")
|| parentKind.equals("RecordLiteralKeyValue") || parentKind.equals("Return");

if (isExpression) {
node.getAsJsonObject(FormattingConstants.POSITION).addProperty(FormattingConstants.START_COLUMN,
indentation);
}

// Preserve line separation that already available.
this.preserveHeight(ws, indentWithParentIndentation);
Expand All @@ -3037,12 +3028,12 @@ public void formatRecordLiteralExprNode(JsonObject node) {
// Update whitespace for opening brace.
if (text.equals(Tokens.OPENING_BRACE)
&& this.noHeightAvailable(currentWS.get(FormattingConstants.WS).getAsString())) {
if (isExpression) {
currentWS.addProperty(FormattingConstants.WS,
this.getWhiteSpaces(formatConfig.get(FormattingConstants.SPACE_COUNT).getAsInt()));
} else if (isTable) {
if (isTable) {
currentWS.addProperty(FormattingConstants.WS, this.getNewLines(formatConfig
.get(FormattingConstants.NEW_LINE_COUNT).getAsInt()) + indentWithParentIndentation);
} else {
currentWS.addProperty(FormattingConstants.WS,
this.getWhiteSpaces(formatConfig.get(FormattingConstants.SPACE_COUNT).getAsInt()));
}
}

Expand Down Expand Up @@ -4222,8 +4213,8 @@ public void formatStringTemplateLiteralNode(JsonObject node) {
}

// Handle expressions format
if (node.has("expressions")) {
JsonArray expressions = node.getAsJsonArray("expressions");
if (node.has(FormattingConstants.EXPRESSIONS)) {
JsonArray expressions = node.getAsJsonArray(FormattingConstants.EXPRESSIONS);
// Every three expression is related to
// Start of the template expression
// expression of the template expression
Expand Down Expand Up @@ -5106,8 +5097,51 @@ public void formatTypedescExpressionNode(JsonObject node) {
* @param node {JsonObject} node as json object
*/
public void formatTypeInitExprNode(JsonObject node) {
// TODO: fix formatting for type init expression
this.skipFormatting(node, true);
if (node.has(FormattingConstants.WS) && node.has(FormattingConstants.FORMATTING_CONFIG)) {
JsonObject formatConfig = node.getAsJsonObject(FormattingConstants.FORMATTING_CONFIG);
JsonArray ws = node.getAsJsonArray(FormattingConstants.WS);

String indentation = this.getIndentation(formatConfig, false);
String indentationOfParent = this.getParentIndentation(formatConfig);
boolean useParentIndentation = formatConfig.get(FormattingConstants.USE_PARENT_INDENTATION).getAsBoolean();

// Preserve available new lines in node.
this.preserveHeight(ws, useParentIndentation ? indentationOfParent : indentation);

// Iterate and update whitespaces for node.
for (JsonElement wsItem : ws) {
JsonObject currentWS = wsItem.getAsJsonObject();
if (this.noHeightAvailable(currentWS.get(FormattingConstants.WS).getAsString())) {
String text = currentWS.get(FormattingConstants.TEXT).getAsString();
if (text.equals(Tokens.NEW)) {
currentWS.addProperty(FormattingConstants.WS,
this.getWhiteSpaces(formatConfig.get(FormattingConstants.SPACE_COUNT).getAsInt()));
} else if (text.equals(Tokens.OPENING_PARENTHESES)) {
if (node.has(FormattingConstants.TYPE)) {
currentWS.addProperty(FormattingConstants.WS, FormattingConstants.EMPTY_SPACE);
} else {
currentWS.addProperty(FormattingConstants.WS, FormattingConstants.SINGLE_SPACE);
}
} else if (text.equals(Tokens.COMMA) || text.equals(Tokens.CLOSING_PARENTHESES)) {
currentWS.addProperty(FormattingConstants.WS, FormattingConstants.EMPTY_SPACE);
}
}
}

// Iterate and format expressions.
if (node.has(FormattingConstants.EXPRESSIONS)) {
JsonArray expressions = node.getAsJsonArray(FormattingConstants.EXPRESSIONS);
iterateAndFormatMembers(indentation.isEmpty() ? indentationOfParent : indentation,
expressions);
}

// Handle type name formatting.
if (node.has(FormattingConstants.TYPE)) {
node.getAsJsonObject(FormattingConstants.TYPE).add(FormattingConstants.FORMATTING_CONFIG,
this.getFormattingConfig(0, 1, 0, false,
this.getWhiteSpaceCount(indentationOfParent), true));
}
}
}

/**
Expand Down Expand Up @@ -6034,8 +6068,8 @@ private void modifyReturnTypeAnnotations(JsonObject node, String indentation) {
}

private void modifyExpressions(JsonObject node, String indentWithParentIndentation) {
if (node.has("expressions")) {
JsonArray expressions = node.getAsJsonArray("expressions");
if (node.has(FormattingConstants.EXPRESSIONS)) {
JsonArray expressions = node.getAsJsonArray(FormattingConstants.EXPRESSIONS);
iterateAndFormatMembers(indentWithParentIndentation, expressions);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.ballerinalang.langserver.formatting;
package org.ballerinalang.langserver.compiler.format;

import com.google.gson.JsonObject;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.ballerinalang.langserver.formatting;
package org.ballerinalang.langserver.compiler.format;

import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.ballerinalang.langserver.formatting;
package org.ballerinalang.langserver.compiler.format;

/**
* Constants values to be used when comparing tokens in formatting.
Expand Down Expand Up @@ -104,4 +104,5 @@ public class Tokens {
public static final String ONABORT = "onabort";
public static final String ONCOMMIT = "oncommit";
public static final String TRAP = "trap";
public static final String NEW = "new";
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,12 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.ballerinalang.langserver.formatting;
package org.ballerinalang.langserver.compiler.sourcegen;

import com.google.gson.JsonArray;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import org.ballerinalang.langserver.compiler.format.FormattingConstants;

import java.util.ArrayList;
import java.util.Comparator;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,15 @@
import org.ballerinalang.langserver.compiler.LSServiceOperationContext;
import org.ballerinalang.langserver.compiler.common.LSCustomErrorStrategy;
import org.ballerinalang.langserver.compiler.common.LSDocument;
import org.ballerinalang.langserver.compiler.format.FormattingVisitorEntry;
import org.ballerinalang.langserver.compiler.format.TextDocumentFormatUtil;
import org.ballerinalang.langserver.compiler.sourcegen.FormattingSourceGen;
import org.ballerinalang.langserver.compiler.workspace.WorkspaceDocumentException;
import org.ballerinalang.langserver.compiler.workspace.WorkspaceDocumentManager;
import org.ballerinalang.langserver.completions.CompletionKeys;
import org.ballerinalang.langserver.completions.util.CompletionUtil;
import org.ballerinalang.langserver.definition.LSReferencesException;
import org.ballerinalang.langserver.diagnostic.DiagnosticsHelper;
import org.ballerinalang.langserver.formatting.FormattingSourceGen;
import org.ballerinalang.langserver.formatting.FormattingVisitorEntry;
import org.ballerinalang.langserver.hover.util.HoverUtil;
import org.ballerinalang.langserver.implementation.GotoImplementationCustomErrorStrategy;
import org.ballerinalang.langserver.implementation.GotoImplementationUtil;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@
import org.ballerinalang.langserver.compiler.common.modal.SymbolMetaInfo;
import org.ballerinalang.langserver.compiler.format.JSONGenerationException;
import org.ballerinalang.langserver.compiler.format.TextDocumentFormatUtil;
import org.ballerinalang.langserver.compiler.sourcegen.FormattingSourceGen;
import org.ballerinalang.langserver.compiler.workspace.WorkspaceDocumentException;
import org.ballerinalang.langserver.compiler.workspace.WorkspaceDocumentManager;
import org.ballerinalang.langserver.extensions.OASGenerationException;
import org.ballerinalang.langserver.formatting.FormattingSourceGen;
import org.ballerinalang.model.tree.ServiceNode;
import org.ballerinalang.model.tree.TopLevelNode;
import org.ballerinalang.openapi.CodeGenerator;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
import org.ballerinalang.langserver.compiler.common.modal.BallerinaFile;
import org.ballerinalang.langserver.compiler.format.JSONGenerationException;
import org.ballerinalang.langserver.compiler.format.TextDocumentFormatUtil;
import org.ballerinalang.langserver.formatting.FormattingSourceGen;
import org.ballerinalang.langserver.compiler.sourcegen.FormattingSourceGen;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.wso2.ballerinalang.compiler.tree.BLangCompilationUnit;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@ public Object[][] fileProvider() {
{"expectedInvocation.bal", "invocation.bal"},
{"expectedTypeDesc.bal", "typeDesc.bal"},
{"expectedAnonObject.bal", "anonObject.bal"},
{"expectedTypeInitExpr.bal", "typeInitExpr.bal"},
};
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@
import org.ballerinalang.langserver.compiler.LSCompiler;
import org.ballerinalang.langserver.compiler.LSServiceOperationContext;
import org.ballerinalang.langserver.compiler.format.TextDocumentFormatUtil;
import org.ballerinalang.langserver.compiler.sourcegen.FormattingSourceGen;
import org.ballerinalang.langserver.compiler.workspace.WorkspaceDocumentManager;
import org.ballerinalang.langserver.compiler.workspace.WorkspaceDocumentManagerImpl;
import org.ballerinalang.langserver.formatting.FormattingSourceGen;
import org.ballerinalang.langserver.util.TestUtil;
import org.eclipse.lsp4j.jsonrpc.Endpoint;
import org.slf4j.Logger;
Expand Down
Loading