From ceffb78be24a41d7cad165408fc64f701846d8a5 Mon Sep 17 00:00:00 2001 From: Gaith Hallak Date: Wed, 3 Aug 2022 15:51:25 +0400 Subject: [PATCH 01/13] Add CONTRIBUTING.md --- CONTRIBUTING.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 CONTRIBUTING.md diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..4742176 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,15 @@ +# Contributing to æSophia + +## Checklist For Creating New Pull Requests + +### Documentation + +- Update [Changelog](CHANGELOG.md) for all PRs. +- If the PR introduces a new feature that is relevant to the users of the language, the [Sophia Features Documentation](doc/sophia_features.md) should be updated to describe the new feature. +- If the PR introduces new syntax (e.g. changes in [aeso_syntax.erl](src/aeso_syntax.erl), [aeso_scan.erl](src/aeso_scan.erl), or [aeso_parser.erl](src/aeso_parser.erl)), the [Sophia Syntax Documentation](doc/sophia_syntax.md) should be updated to include the new syntax. +- If the PR introduces a new library, the new library's public interface should be fully documented in the [Sophia Standard Library Documentation](doc/sophia_stdlib.md). + +### Tests + +- If the PR introduces new syntax (e.g. changes in [aeso_syntax.erl](src/aeso_syntax.erl), [aeso_scan.erl](src/aeso_scan.erl), or [aeso_parser.erl](src/aeso_parser.erl)), the contract [all_syntax.aes](test/contracts/all_syntax.aes) should be updated to include the new syntax. +- If the PR fixes a bug, the code that replicates the bug should be added as a new passing test contract. \ No newline at end of file -- 2.30.2 From 11488ad4f708a44b54ace280e7ead041ae0d2422 Mon Sep 17 00:00:00 2001 From: Gaith Hallak Date: Wed, 3 Aug 2022 15:55:11 +0400 Subject: [PATCH 02/13] Include CONTRIBUTING.md in README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index e11896a..65513e7 100644 --- a/README.md +++ b/README.md @@ -14,6 +14,7 @@ The compiler is currently being used three places * [Features](docs/sophia_features.md) * [Standard library](docs/sophia_stdlib.md) * [Contract examples](docs/sophia_examples.md) +* [Contributing](CONTRIBUTING.md) Additionally you can check out the [contracts section](https://github.com/aeternity/protocol/blob/master/contracts/contracts.md) of the æternity blockchain specification. -- 2.30.2 From cbd0ba18fcea1cf2b1a1ef4c1d17002dee6234ad Mon Sep 17 00:00:00 2001 From: Gaith Hallak Date: Wed, 3 Aug 2022 15:57:02 +0400 Subject: [PATCH 03/13] Fix broken links --- CONTRIBUTING.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 4742176..9483225 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -5,9 +5,9 @@ ### Documentation - Update [Changelog](CHANGELOG.md) for all PRs. -- If the PR introduces a new feature that is relevant to the users of the language, the [Sophia Features Documentation](doc/sophia_features.md) should be updated to describe the new feature. -- If the PR introduces new syntax (e.g. changes in [aeso_syntax.erl](src/aeso_syntax.erl), [aeso_scan.erl](src/aeso_scan.erl), or [aeso_parser.erl](src/aeso_parser.erl)), the [Sophia Syntax Documentation](doc/sophia_syntax.md) should be updated to include the new syntax. -- If the PR introduces a new library, the new library's public interface should be fully documented in the [Sophia Standard Library Documentation](doc/sophia_stdlib.md). +- If the PR introduces a new feature that is relevant to the users of the language, the [Sophia Features Documentation](docs/sophia_features.md) should be updated to describe the new feature. +- If the PR introduces new syntax (e.g. changes in [aeso_syntax.erl](src/aeso_syntax.erl), [aeso_scan.erl](src/aeso_scan.erl), or [aeso_parser.erl](src/aeso_parser.erl)), the [Sophia Syntax Documentation](docs/sophia_syntax.md) should be updated to include the new syntax. +- If the PR introduces a new library, the new library's public interface should be fully documented in the [Sophia Standard Library Documentation](docs/sophia_stdlib.md). ### Tests -- 2.30.2 From 312eb347b97387b52a197172181a4cbf6ffb5bcf Mon Sep 17 00:00:00 2001 From: Gaith Hallak Date: Wed, 3 Aug 2022 16:00:55 +0400 Subject: [PATCH 04/13] Update CONTRIBUTING.md --- CONTRIBUTING.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 9483225..d7a11ac 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -2,12 +2,14 @@ ## Checklist For Creating New Pull Requests +The following points should be considered before creating a new PR to the Sophia compiler. + ### Documentation - Update [Changelog](CHANGELOG.md) for all PRs. - If the PR introduces a new feature that is relevant to the users of the language, the [Sophia Features Documentation](docs/sophia_features.md) should be updated to describe the new feature. - If the PR introduces new syntax (e.g. changes in [aeso_syntax.erl](src/aeso_syntax.erl), [aeso_scan.erl](src/aeso_scan.erl), or [aeso_parser.erl](src/aeso_parser.erl)), the [Sophia Syntax Documentation](docs/sophia_syntax.md) should be updated to include the new syntax. -- If the PR introduces a new library, the new library's public interface should be fully documented in the [Sophia Standard Library Documentation](docs/sophia_stdlib.md). +- If the PR introduces a new library, the public interface of the new library should be fully documented in the [Sophia Standard Library Documentation](docs/sophia_stdlib.md). ### Tests -- 2.30.2 From 62f14e3583b77ba1d802395c6c101d8a851fc61a Mon Sep 17 00:00:00 2001 From: Gaith Hallak Date: Wed, 3 Aug 2022 16:02:02 +0400 Subject: [PATCH 05/13] Update CONTRIBUTING.md --- CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index d7a11ac..2c8ebfc 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -6,7 +6,7 @@ The following points should be considered before creating a new PR to the Sophia ### Documentation -- Update [Changelog](CHANGELOG.md) for all PRs. +- The [Changelog](CHANGELOG.md) file should be updated for all PRs. - If the PR introduces a new feature that is relevant to the users of the language, the [Sophia Features Documentation](docs/sophia_features.md) should be updated to describe the new feature. - If the PR introduces new syntax (e.g. changes in [aeso_syntax.erl](src/aeso_syntax.erl), [aeso_scan.erl](src/aeso_scan.erl), or [aeso_parser.erl](src/aeso_parser.erl)), the [Sophia Syntax Documentation](docs/sophia_syntax.md) should be updated to include the new syntax. - If the PR introduces a new library, the public interface of the new library should be fully documented in the [Sophia Standard Library Documentation](docs/sophia_stdlib.md). -- 2.30.2 From 791e736e60e45b6cbba898b748e6248f5a796f55 Mon Sep 17 00:00:00 2001 From: Gaith Hallak Date: Wed, 3 Aug 2022 19:11:25 +0400 Subject: [PATCH 06/13] Use "If a PR" instead of "If the PR" --- CONTRIBUTING.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 2c8ebfc..0d084b0 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -7,11 +7,11 @@ The following points should be considered before creating a new PR to the Sophia ### Documentation - The [Changelog](CHANGELOG.md) file should be updated for all PRs. -- If the PR introduces a new feature that is relevant to the users of the language, the [Sophia Features Documentation](docs/sophia_features.md) should be updated to describe the new feature. -- If the PR introduces new syntax (e.g. changes in [aeso_syntax.erl](src/aeso_syntax.erl), [aeso_scan.erl](src/aeso_scan.erl), or [aeso_parser.erl](src/aeso_parser.erl)), the [Sophia Syntax Documentation](docs/sophia_syntax.md) should be updated to include the new syntax. -- If the PR introduces a new library, the public interface of the new library should be fully documented in the [Sophia Standard Library Documentation](docs/sophia_stdlib.md). +- If a PR introduces a new feature that is relevant to the users of the language, the [Sophia Features Documentation](docs/sophia_features.md) should be updated to describe the new feature. +- If a PR introduces new syntax (e.g. changes in [aeso_syntax.erl](src/aeso_syntax.erl), [aeso_scan.erl](src/aeso_scan.erl), or [aeso_parser.erl](src/aeso_parser.erl)), the [Sophia Syntax Documentation](docs/sophia_syntax.md) should be updated to include the new syntax. +- If a PR introduces a new library, the public interface of the new library should be fully documented in the [Sophia Standard Library Documentation](docs/sophia_stdlib.md). ### Tests -- If the PR introduces new syntax (e.g. changes in [aeso_syntax.erl](src/aeso_syntax.erl), [aeso_scan.erl](src/aeso_scan.erl), or [aeso_parser.erl](src/aeso_parser.erl)), the contract [all_syntax.aes](test/contracts/all_syntax.aes) should be updated to include the new syntax. -- If the PR fixes a bug, the code that replicates the bug should be added as a new passing test contract. \ No newline at end of file +- If a PR introduces new syntax (e.g. changes in [aeso_syntax.erl](src/aeso_syntax.erl), [aeso_scan.erl](src/aeso_scan.erl), or [aeso_parser.erl](src/aeso_parser.erl)), the contract [all_syntax.aes](test/contracts/all_syntax.aes) should be updated to include the new syntax. +- If a PR fixes a bug, the code that replicates the bug should be added as a new passing test contract. \ No newline at end of file -- 2.30.2 From 94511290d06951e4693561c2091347f5a362b141 Mon Sep 17 00:00:00 2001 From: Gaith Hallak Date: Wed, 3 Aug 2022 19:31:19 +0400 Subject: [PATCH 07/13] Mention fold and pretty printing --- CONTRIBUTING.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 0d084b0..dcf9ca5 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -14,4 +14,10 @@ The following points should be considered before creating a new PR to the Sophia ### Tests - If a PR introduces new syntax (e.g. changes in [aeso_syntax.erl](src/aeso_syntax.erl), [aeso_scan.erl](src/aeso_scan.erl), or [aeso_parser.erl](src/aeso_parser.erl)), the contract [all_syntax.aes](test/contracts/all_syntax.aes) should be updated to include the new syntax. -- If a PR fixes a bug, the code that replicates the bug should be added as a new passing test contract. \ No newline at end of file +- If a PR fixes a bug, the code that replicates the bug should be added as a new passing test contract. + +### Source Code + +- If a PR introduces new syntax (e.g. changes in [aeso_syntax.erl](src/aeso_syntax.erl), [aeso_scan.erl](src/aeso_scan.erl), or [aeso_parser.erl](src/aeso_parser.erl)), the following code should be updated to handle the new syntax: + - The function `aeso_syntax_utils:fold/4` in the file [aeso_syntax_utils.erl](src/aeso_syntax_utils.erl). + - Any related pretty printing function in the file [aeso_pretty.erl](src/aeso_pretty.erl), depending on the type of the newly added syntax. -- 2.30.2 From be3cb5cc763e3b09aa999209933aa229e500db25 Mon Sep 17 00:00:00 2001 From: Gaith Hallak Date: Wed, 3 Aug 2022 19:31:44 +0400 Subject: [PATCH 08/13] Add missing precedence of the operator '|>' --- src/aeso_pretty.erl | 1 + 1 file changed, 1 insertion(+) diff --git a/src/aeso_pretty.erl b/src/aeso_pretty.erl index d639ce9..32208c4 100644 --- a/src/aeso_pretty.erl +++ b/src/aeso_pretty.erl @@ -430,6 +430,7 @@ lc_bind(Let) -> bin_prec('..') -> { 0, 0, 0}; %% Always printed inside '[ ]' bin_prec('=') -> { 0, 0, 0}; %% Always printed inside '[ ]' bin_prec('@') -> { 0, 0, 0}; %% Only in error messages +bin_prec('|>') -> {150, 150, 200}; bin_prec('||') -> {200, 300, 200}; bin_prec('&&') -> {300, 400, 300}; bin_prec('<') -> {400, 500, 500}; -- 2.30.2 From 543e5cc7e2fb0b9b17de86d9b5f8f3e9a02ca5dc Mon Sep 17 00:00:00 2001 From: Gaith Hallak Date: Wed, 3 Aug 2022 20:21:33 +0400 Subject: [PATCH 09/13] Add a note about tests --- CONTRIBUTING.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index dcf9ca5..5ca8c5b 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -15,6 +15,7 @@ The following points should be considered before creating a new PR to the Sophia - If a PR introduces new syntax (e.g. changes in [aeso_syntax.erl](src/aeso_syntax.erl), [aeso_scan.erl](src/aeso_scan.erl), or [aeso_parser.erl](src/aeso_parser.erl)), the contract [all_syntax.aes](test/contracts/all_syntax.aes) should be updated to include the new syntax. - If a PR fixes a bug, the code that replicates the bug should be added as a new passing test contract. +- If a PR introduces a new feature, add tests for both successful and failing usage of that feature. In order to run the entire compilation pipeline and to avoid erroring during intermediate steps, failing tests should not be mixed with the successful ones. ### Source Code -- 2.30.2 From 321edb0e7bdb70f8b3611245a519131aea9b70c9 Mon Sep 17 00:00:00 2001 From: Gaith Hallak Date: Thu, 4 Aug 2022 01:34:55 +0400 Subject: [PATCH 10/13] Rename to Sophia --- CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 5ca8c5b..b47b3b2 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,4 +1,4 @@ -# Contributing to æSophia +# Contributing to Sophia ## Checklist For Creating New Pull Requests -- 2.30.2 From bb137ae642f1a1f4e08ce77cb71c3e975db5f0bf Mon Sep 17 00:00:00 2001 From: Gaith Hallak Date: Thu, 4 Aug 2022 15:19:47 +0400 Subject: [PATCH 11/13] Add missing using keyword --- docs/sophia_syntax.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/sophia_syntax.md b/docs/sophia_syntax.md index a55fa60..c89cc0f 100644 --- a/docs/sophia_syntax.md +++ b/docs/sophia_syntax.md @@ -11,7 +11,7 @@ and `*/` and can be nested. ``` contract elif else entrypoint false function if import include let mod namespace -private payable stateful switch true type record datatype main interface +private payable stateful switch true type record datatype main interface using ``` ### Tokens -- 2.30.2 From 9d20221c5279409da5541a9b15307f3abb4ab256 Mon Sep 17 00:00:00 2001 From: Gaith Hallak Date: Thu, 4 Aug 2022 16:05:27 +0400 Subject: [PATCH 12/13] Update the entire list of keywords in sophia syntax doc --- docs/sophia_syntax.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/sophia_syntax.md b/docs/sophia_syntax.md index c89cc0f..bc34346 100644 --- a/docs/sophia_syntax.md +++ b/docs/sophia_syntax.md @@ -10,8 +10,9 @@ and `*/` and can be nested. ### Keywords ``` -contract elif else entrypoint false function if import include let mod namespace -private payable stateful switch true type record datatype main interface using +contract include let switch type record datatype if elif else function +stateful payable true false mod public entrypoint private indexed namespace +interface main using as for hiding ``` ### Tokens -- 2.30.2 From 2251a97f02a9e0936007bd8931c67008f434102d Mon Sep 17 00:00:00 2001 From: Gaith Hallak Date: Thu, 4 Aug 2022 16:25:11 +0400 Subject: [PATCH 13/13] Add a section about creating a new aesophia release --- CONTRIBUTING.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index b47b3b2..bc6ac72 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -22,3 +22,17 @@ The following points should be considered before creating a new PR to the Sophia - If a PR introduces new syntax (e.g. changes in [aeso_syntax.erl](src/aeso_syntax.erl), [aeso_scan.erl](src/aeso_scan.erl), or [aeso_parser.erl](src/aeso_parser.erl)), the following code should be updated to handle the new syntax: - The function `aeso_syntax_utils:fold/4` in the file [aeso_syntax_utils.erl](src/aeso_syntax_utils.erl). - Any related pretty printing function in the file [aeso_pretty.erl](src/aeso_pretty.erl), depending on the type of the newly added syntax. + +## Checklist For Creating a Release + +- Update the version in the file [aesophia.app.src](src/aesophia.app.src). +- Update the version in the file [rebar.config](rebar.config). +- In the [Changelog](CHANGELOG.md): + - Update the `Unreleased` changes to be under the new version. + - Update the version at the bottom of the file. +- Commit and the changes and create a new PR (check the commit of [v6.1.0](5ad5270e381f6e810d7b8b5cdc168d283e7a90bb) for reference). +- Create a release after merging the new PR to `master` branch. +- After releasing `aesophia`, refer to each of the following repositories and create new releases as well, using the new `aesophia` release: + - [aesophia_cli](https://github.com/aeternity/aesophia_cli) + - [aesophia_http](https://github.com/aeternity/aesophia_http) + - [aerepl](https://github.com/aeternity/aerepl) -- 2.30.2