Skip to content

Commit

Permalink
change Forc.toml to take an array of authors (FuelLabs#822)
Browse files Browse the repository at this point in the history
* change Forc.toml to take an array of authors

* author and authors are optional. added deprecation notice to author

* removed duplicate entry fields
  • Loading branch information
JoshuaBatty authored Feb 28, 2022
1 parent ee72f72 commit 2c14dc6
Show file tree
Hide file tree
Showing 119 changed files with 128 additions and 126 deletions.
2 changes: 1 addition & 1 deletion docs/src/sway-on-chain/libraries.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ Libraries are composed of just a `Forc.toml` file and a `src` folder, unlike usu

```toml=
[project]
author = "Fuel Labs <[email protected]>"
authors = ["Fuel Labs <[email protected]>"]
entry = "lib.sw"
license = "Apache-2.0"
name = "lib-std"
Expand Down
2 changes: 1 addition & 1 deletion examples/fizzbuzz/Forc.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[project]
author = "Fuel Labs <[email protected]>"
authors = ["Fuel Labs <[email protected]>"]
entry = "main.sw"
license = "Apache-2.0"
name = "fizzbuzz"
Expand Down
2 changes: 1 addition & 1 deletion examples/hello_world/Forc.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[project]
author = "Fuel Labs <[email protected]>"
authors = ["Fuel Labs <[email protected]>"]
entry = "main.sw"
license = "Apache-2.0"
name = "hello_world"
Expand Down
2 changes: 1 addition & 1 deletion examples/subcurrency/Forc.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[project]
author = "Fuel Labs <[email protected]>"
authors = ["Fuel Labs <[email protected]>"]
entry = "main.sw"
license = "Apache-2.0"
name = "subcurrency"
Expand Down
2 changes: 1 addition & 1 deletion examples/wallet_smart_contract/Forc.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[project]
author = "Fuel Labs <[email protected]>"
authors = ["Fuel Labs <[email protected]>"]
entry = "main.sw"
license = "Apache-2.0"
name = "wallet_smart_contract"
Expand Down
10 changes: 5 additions & 5 deletions forc/src/ops/forc_fmt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ mod tests {
fn test_forc_indentation() {
let correct_forc_manifest = r#"
[project]
author = "Fuel Labs <[email protected]>"
authors = ["Fuel Labs <[email protected]>"]
license = "Apache-2.0"
name = "Fuel example project"
Expand All @@ -193,7 +193,7 @@ std = { git = "http://github.com/FuelLabs/sway-lib-std", version = "v0.0.1" }
assert_eq!(formatted_content, correct_forc_manifest);
let indented_forc_manifest = r#"
[project]
author = "Fuel Labs <[email protected]>"
authors = ["Fuel Labs <[email protected]>"]
license = "Apache-2.0"
name = "Fuel example project"
Expand All @@ -207,7 +207,7 @@ std = { git = "http://github.com/FuelLabs/sway-lib-std", version = "v0.0.1" }
assert_eq!(formatted_content, correct_forc_manifest);
let whitespace_forc_manifest = r#"
[project]
author="Fuel Labs <[email protected]>"
authors=["Fuel Labs <[email protected]>"]
license = "Apache-2.0"
name = "Fuel example project"
Expand All @@ -224,7 +224,7 @@ std = { git = "http://github.com/FuelLabs/sway-lib-std" , ve
fn test_forc_alphabetization() {
let correct_forc_manifest = r#"
[project]
author = "Fuel Labs <[email protected]>"
authors = ["Fuel Labs <[email protected]>"]
license = "Apache-2.0"
name = "Fuel example project"
Expand All @@ -243,7 +243,7 @@ std = { git = "http://github.com/FuelLabs/sway-lib-std", version = "v0.0.1" }
[project]
name = "Fuel example project"
license = "Apache-2.0"
author = "Fuel Labs <[email protected]>"
authors = ["Fuel Labs <[email protected]>"]
[dependencies]
Expand Down
2 changes: 1 addition & 1 deletion forc/src/utils/defaults.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ pub(crate) fn default_manifest(project_name: &str) -> String {

format!(
r#"[project]
author = "{real_name}"
authors = ["{real_name}"]
entry = "main.sw"
license = "Apache-2.0"
name = "{project_name}"
Expand Down
4 changes: 3 additions & 1 deletion forc/src/utils/manifest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ impl Manifest {}
#[derive(Serialize, Deserialize, Debug)]
#[serde(rename_all = "kebab-case")]
pub struct Project {
pub author: String,
#[deprecated = "use the authors field instead, the author field will be removed soon."]
pub author: Option<String>,
pub authors: Option<Vec<String>>,
pub name: String,
pub organization: Option<String>,
pub license: String,
Expand Down
2 changes: 1 addition & 1 deletion test/src/e2e_vm_tests/test_programs/address_test/Forc.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[project]
author = "Fuel Labs <[email protected]>"
authors = ["Fuel Labs <[email protected]>"]
entry = "main.sw"
license = "Apache-2.0"
name = "address_test"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[project]
author = "Fuel Labs <[email protected]>"
authors = ["Fuel Labs <[email protected]>"]
license = "Apache-2.0"
name = "aliased_imports"
entry = "main.sw"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[project]
author = "Fuel Labs <[email protected]>"
authors = ["Fuel Labs <[email protected]>"]
license = "Apache-2.0"
name = "array_bad_index"
entry = "main.sw"
2 changes: 1 addition & 1 deletion test/src/e2e_vm_tests/test_programs/array_basics/Forc.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[project]
author = "Fuel Labs <[email protected]>"
authors = ["Fuel Labs <[email protected]>"]
license = "Apache-2.0"
name = "array_basics"
entry = "main.sw"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[project]
author = "Fuel Labs <[email protected]>"
authors = ["Fuel Labs <[email protected]>"]
license = "Apache-2.0"
name = "array_dynamic_oob"
entry = "main.sw"
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[project]
author = "Fuel Labs <[email protected]>"
authors = ["Fuel Labs <[email protected]>"]
license = "Apache-2.0"
name = "array_generics"
entry = "main.sw"
2 changes: 1 addition & 1 deletion test/src/e2e_vm_tests/test_programs/array_oob/Forc.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[project]
author = "Fuel Labs <[email protected]>"
authors = ["Fuel Labs <[email protected]>"]
license = "Apache-2.0"
name = "array_oob"
entry = "main.sw"
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[project]
author = "Fuel Labs <[email protected]>"
authors = ["Fuel Labs <[email protected]>"]
license = "Apache-2.0"
name = "asm_expr_basic"
entry = "main.sw"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[project]
author = "Fuel Labs <[email protected]>"
authors = ["Fuel Labs <[email protected]>"]
license = "Apache-2.0"
name = "asm_missing_return"
entry = "main.sw"
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[project]
author = "Fuel Labs <[email protected]>"
authors = ["Fuel Labs <[email protected]>"]
license = "Apache-2.0"
name = "asm_should_not_have_return"
entry = "main.sw"
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[project]
author = "Fuel Labs <[email protected]>"
authors = ["Fuel Labs <[email protected]>"]
license = "Apache-2.0"
name = "asm_without_return"
entry = "main.sw"
2 changes: 1 addition & 1 deletion test/src/e2e_vm_tests/test_programs/assert_test/Forc.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[project]
author = "Fuel Labs <[email protected]>"
authors = ["Fuel Labs <[email protected]>"]
license = "Apache-2.0"
name = "assert_test"
entry = "main.sw"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[project]
author = "Fuel Labs <[email protected]>"
authors = ["Fuel Labs <[email protected]>"]
license = "Apache-2.0"
name = "auth_testing_abi"
entry = "main.sw"
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[project]
author = "Fuel Labs <[email protected]>"
authors = ["Fuel Labs <[email protected]>"]
license = "Apache-2.0"
name = "auth_testing_contract"
entry = "main.sw"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[project]
author = "Fuel Labs <[email protected]>"
authors = ["Fuel Labs <[email protected]>"]
license = "Apache-2.0"
name = "b256_bad_jumps"
entry = "main.sw"
Expand Down
2 changes: 1 addition & 1 deletion test/src/e2e_vm_tests/test_programs/b256_ops/Forc.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[project]
author = "Fuel Labs <[email protected]>"
authors = ["Fuel Labs <[email protected]>"]
license = "Apache-2.0"
name = "b256_ops"
entry = "main.sw"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[project]
author = "Fuel Labs <[email protected]>"
authors = ["Fuel Labs <[email protected]>"]
license = "Apache-2.0"
name = "b512_panic_test"
entry = "main.sw"
Expand Down
2 changes: 1 addition & 1 deletion test/src/e2e_vm_tests/test_programs/b512_test/Forc.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[project]
author = "Fuel Labs <[email protected]>"
authors = ["Fuel Labs <[email protected]>"]
license = "Apache-2.0"
name = "b512_test"
entry = "main.sw"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[project]
author = "Fuel Labs <[email protected]>"
authors = ["Fuel Labs <[email protected]>"]
license = "Apache-2.0"
name = "bad_generic_annotation"
entry = "main.sw"
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[project]
author = "Fuel Labs <[email protected]>"
authors = ["Fuel Labs <[email protected]>"]
license = "Apache-2.0"
name = "bad_generic_var_annotation"
entry = "main.sw"
2 changes: 1 addition & 1 deletion test/src/e2e_vm_tests/test_programs/bal_opcode/Forc.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[project]
author = "Fuel Labs <[email protected]>"
authors = ["Fuel Labs <[email protected]>"]
license = "Apache-2.0"
name = "bal_opcode"
entry = "main.sw"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[project]
author = "Fuel Labs <[email protected]>"
authors = ["Fuel Labs <[email protected]>"]
license = "Apache-2.0"
name = "balance_test_abi"
entry = "main.sw"
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[project]
author = "Fuel Labs <[email protected]>"
authors = ["Fuel Labs <[email protected]>"]
license = "Apache-2.0"
name = "balance_test_contract"
entry = "main.sw"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[project]
author = "Fuel Labs <[email protected]>"
authors = ["Fuel Labs <[email protected]>"]
license = "Apache-2.0"
name = "basic_func_decl"
entry = "main.sw"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[project]
author = "Fuel Labs <[email protected]>"
authors = ["Fuel Labs <[email protected]>"]
license = "Apache-2.0"
name = "basic_storage"
entry = "main.sw"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[project]
author = "Fuel Labs <[email protected]>"
authors = ["Fuel Labs <[email protected]>"]
license = "Apache-2.0"
name = "basic_storage_abi"
entry = "main.sw"
2 changes: 1 addition & 1 deletion test/src/e2e_vm_tests/test_programs/block_height/Forc.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[project]
author = "Fuel Labs <[email protected]>"
authors = ["Fuel Labs <[email protected]>"]
license = "Apache-2.0"
name = "block_height"
entry = "main.sw"
Expand Down
2 changes: 1 addition & 1 deletion test/src/e2e_vm_tests/test_programs/bool_and_or/Forc.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[project]
author = "Fuel Labs <[email protected]>"
authors = ["Fuel Labs <[email protected]>"]
license = "Apache-2.0"
name = "bool_and_or"
entry = "main.sw"
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[project]
author = "Fuel Labs <[email protected]>"
authors = ["Fuel Labs <[email protected]>"]
license = "Apache-2.0"
name = "call_basic_storage"
entry = "main.sw"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[project]
author = "Fuel Labs <[email protected]>"
authors = ["Fuel Labs <[email protected]>"]
license = "Apache-2.0"
name = "call_increment_contract"
entry = "main.sw"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[project]
author = "Fuel Labs <[email protected]>"
authors = ["Fuel Labs <[email protected]>"]
license = "Apache-2.0"
name = "caller_auth_test"
entry = "main.sw"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[project]
author = "Fuel Labs <[email protected]>"
authors = ["Fuel Labs <[email protected]>"]
license = "Apache-2.0"
name = "caller_context_test"
entry = "main.sw"
Expand Down
2 changes: 1 addition & 1 deletion test/src/e2e_vm_tests/test_programs/const_decl/Forc.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[project]
author = "Fuel Labs <[email protected]>"
authors = ["Fuel Labs <[email protected]>"]
license = "Apache-2.0"
name = "const_decl"
entry = "main.sw"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[project]
author = "Fuel Labs <[email protected]>"
authors = ["Fuel Labs <[email protected]>"]
license = "Apache-2.0"
name = "const_decl_in_library"
entry = "main.sw"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[project]
author = "Fuel Labs <[email protected]>"
authors = ["Fuel Labs <[email protected]>"]
license = "Apache-2.0"
name = "context_testing_abi"
entry = "main.sw"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[project]
author = "Fuel Labs <[email protected]>"
authors = ["Fuel Labs <[email protected]>"]
license = "Apache-2.0"
name = "context_testing_contract"
entry = "main.sw"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[project]
author = "Fuel Labs <[email protected]>"
authors = ["Fuel Labs <[email protected]>"]
license = "Apache-2.0"
name = "contract_abi_impl"
entry = "main.sw"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[project]
author = "Fuel Labs <[email protected]>"
authors = ["Fuel Labs <[email protected]>"]
license = "Apache-2.0"
name = "contract_call"
entry = "main.sw"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[project]
author = "Fuel Labs <[email protected]>"
authors = ["Fuel Labs <[email protected]>"]
license = "Apache-2.0"
name = "contract_id_test"
entry = "main.sw"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[project]
author = "Fuel Labs <[email protected]>"
authors = ["Fuel Labs <[email protected]>"]
license = "Apache-2.0"
name = "valid_impurity"
entry = "main.sw"
2 changes: 1 addition & 1 deletion test/src/e2e_vm_tests/test_programs/dependencies/Forc.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[project]
author = "Fuel Labs <[email protected]>"
authors = ["Fuel Labs <[email protected]>"]
license = "Apache-2.0"
name = "dependencies"
entry = "main.sw"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[project]
author = "Fuel Labs <[email protected]>"
authors = ["Fuel Labs <[email protected]>"]
license = "Apache-2.0"
name = "dependencies_parsing_error"
entry = "main.sw"
Expand Down
Loading

0 comments on commit 2c14dc6

Please sign in to comment.