From 18b485b2af06e78d994bbcae97bd5b0184875d65 Mon Sep 17 00:00:00 2001 From: Astrodevs CI Date: Thu, 17 Aug 2023 19:44:05 +0000 Subject: [PATCH 001/325] chore: create branch chore/47-migrate-solidhunter-staging --- remove-me-afed2859e00b4dee9bea.txt | 1 + 1 file changed, 1 insertion(+) create mode 100644 remove-me-afed2859e00b4dee9bea.txt diff --git a/remove-me-afed2859e00b4dee9bea.txt b/remove-me-afed2859e00b4dee9bea.txt new file mode 100644 index 00000000..bbf6f3de --- /dev/null +++ b/remove-me-afed2859e00b4dee9bea.txt @@ -0,0 +1 @@ +afed2859e00b4dee9bea From 78fba2333dff563be2e28ecbfb4c00a49bc97663 Mon Sep 17 00:00:00 2001 From: Astrodevs CI Date: Thu, 17 Aug 2023 19:44:20 +0000 Subject: [PATCH 002/325] chore: create branch chore/47-migrate-solidhunter/63-copy-solidhunter-to-osmium-staging --- remove-me-8c6a45fa260b4ee0b7bd.txt | 1 + 1 file changed, 1 insertion(+) create mode 100644 remove-me-8c6a45fa260b4ee0b7bd.txt diff --git a/remove-me-8c6a45fa260b4ee0b7bd.txt b/remove-me-8c6a45fa260b4ee0b7bd.txt new file mode 100644 index 00000000..c48e6879 --- /dev/null +++ b/remove-me-8c6a45fa260b4ee0b7bd.txt @@ -0,0 +1 @@ +8c6a45fa260b4ee0b7bd From 09882fc25418fa3ce6a128e525f23f690c4b9d38 Mon Sep 17 00:00:00 2001 From: 0xtekgrinder <0xtekgrinder@protonmail.com> Date: Tue, 29 Aug 2023 19:38:33 +0200 Subject: [PATCH 003/325] feat: add solidhunter to osmium --- toolchains/solidity/linter/.gitignore | 13 + toolchains/solidity/linter/.unstable | 0 toolchains/solidity/linter/Cargo.lock | 1889 +++++++++++++++ toolchains/solidity/linter/Cargo.toml | 18 + toolchains/solidity/linter/package.json | 4 +- .../solidity/linter/solc-wrapper/.gitignore | 1 + .../solidity/linter/solc-wrapper/Cargo.toml | 19 + .../linter/solc-wrapper/src/ast/ast.rs | 2101 +++++++++++++++++ .../linter/solc-wrapper/src/ast/error.rs | 7 + .../linter/solc-wrapper/src/ast/mod.rs | 4 + .../linter/solc-wrapper/src/ast/parse.rs | 7 + .../linter/solc-wrapper/src/ast/utils.rs | 732 ++++++ .../solidity/linter/solc-wrapper/src/error.rs | 28 + .../solidity/linter/solc-wrapper/src/lib.rs | 146 ++ .../linter/solc-wrapper/src/solc/command.rs | 66 + .../linter/solc-wrapper/src/solc/error.rs | 19 + .../linter/solc-wrapper/src/solc/mod.rs | 3 + .../solc-wrapper/src/solc/parsing_error.rs | 29 + .../solidity/linter/solc-wrapper/src/utils.rs | 71 + .../linter/solc-wrapper/src/version/error.rs | 19 + .../linter/solc-wrapper/src/version/mod.rs | 2 + .../solc-wrapper/src/version/version.rs | 87 + .../tests/files/ast/Assignment.json | 23 + .../tests/files/ast/BinaryOperation.json | 42 + .../solc-wrapper/tests/files/ast/Block.json | 6 + .../solc-wrapper/tests/files/ast/Break.json | 5 + .../tests/files/ast/Conditional.json | 61 + .../tests/files/ast/Continue.json | 5 + .../tests/files/ast/ContractDefinition.json | 13 + .../tests/files/ast/DoWhileStatement.json | 33 + .../tests/files/ast/ElementaryTypeName.json | 8 + .../ast/ElementaryTypeNameExpression.json | 17 + .../tests/files/ast/EmitStatement.json | 42 + .../tests/files/ast/EnumDefinition.json | 24 + .../tests/files/ast/EnumValue.json | 7 + .../tests/files/ast/ErrorDefinition.json | 15 + .../tests/files/ast/EventDefinition.json | 20 + .../tests/files/ast/ExpressionStatement.json | 29 + .../tests/files/ast/ForStatement.json | 148 ++ .../tests/files/ast/FunctionCall.json | 39 + .../tests/files/ast/FunctionCallOptions.json | 57 + .../tests/files/ast/FunctionDefinition.json | 31 + .../tests/files/ast/FunctionTypeName.json | 72 + .../tests/files/ast/Identifier.json | 12 + .../tests/files/ast/IfStatement.json | 167 ++ .../tests/files/ast/ImportDirective.json | 10 + .../tests/files/ast/IndexAccess.json | 32 + .../tests/files/ast/IndexRangeAccess.json | 31 + .../tests/files/ast/InheritanceSpecifier.json | 14 + .../tests/files/ast/InlineAssembly.json | 12 + .../solc-wrapper/tests/files/ast/Literal.json | 9 + .../tests/files/ast/MemberAccess.json | 16 + .../tests/files/ast/ModifierDefinition.json | 74 + .../tests/files/ast/ModifierInvocation.json | 14 + .../tests/files/ast/NewExpression.json | 25 + .../tests/files/ast/ParameterList.json | 27 + .../tests/files/ast/PlaceholderStatement.json | 5 + .../tests/files/ast/PragmaDirective.json | 10 + .../solc-wrapper/tests/files/ast/Return.json | 13 + .../tests/files/ast/RevertStatement.json | 36 + .../tests/files/ast/SourceUnit.json | 8 + .../tests/files/ast/StructDefinition.json | 66 + .../files/ast/StructuredDocumentation.json | 6 + .../tests/files/ast/TryStatement.json | 244 ++ .../tests/files/ast/TupleExpression.json | 44 + .../tests/files/ast/TypeDescriptions.json | 4 + .../tests/files/ast/UnaryOperation.json | 22 + .../tests/files/ast/UncheckedBlock.json | 34 + .../ast/UserDefinedValueTypeDefinition.json | 16 + .../tests/files/ast/UsingForDirective.json | 31 + .../tests/files/ast/VariableDeclaration.json | 20 + .../tests/files/ast/WhileStatement.json | 33 + .../linter/solidhunter-lib/.gitignore | 1 + .../linter/solidhunter-lib/Cargo.toml | 18 + .../linter/solidhunter-lib/src/lib.rs | 24 + .../linter/solidhunter-lib/src/linter.rs | 148 ++ .../best_practises/function_max_lines.rs | 129 + .../src/rules/best_practises/line_maxlen.rs | 58 + .../rules/best_practises/max_states_count.rs | 73 + .../src/rules/best_practises/mod.rs | 38 + .../src/rules/best_practises/reason_string.rs | 144 ++ .../solidhunter-lib/src/rules/factory.rs | 31 + .../src/rules/miscellaneous/mod.rs | 26 + .../src/rules/miscellaneous/quotes.rs | 58 + .../linter/solidhunter-lib/src/rules/mod.rs | 42 + .../rules/naming/contract_name_pascalcase.rs | 62 + .../src/rules/naming/func_name_camelcase.rs | 70 + .../rules/naming/func_param_name_camelcase.rs | 72 + .../solidhunter-lib/src/rules/naming/mod.rs | 38 + .../src/rules/naming/use_forbidden_name.rs | 66 + .../src/rules/order/import_on_top.rs | 73 + .../solidhunter-lib/src/rules/order/mod.rs | 26 + .../solidhunter-lib/src/rules/rule_impl.rs | 87 + .../linter/solidhunter-lib/src/rules/types.rs | 30 + .../linter/solidhunter-lib/src/types.rs | 84 + toolchains/solidity/linter/src/main.rs | 156 ++ 96 files changed, 8549 insertions(+), 2 deletions(-) create mode 100644 toolchains/solidity/linter/.gitignore delete mode 100644 toolchains/solidity/linter/.unstable create mode 100644 toolchains/solidity/linter/Cargo.lock create mode 100644 toolchains/solidity/linter/Cargo.toml create mode 100644 toolchains/solidity/linter/solc-wrapper/.gitignore create mode 100644 toolchains/solidity/linter/solc-wrapper/Cargo.toml create mode 100644 toolchains/solidity/linter/solc-wrapper/src/ast/ast.rs create mode 100644 toolchains/solidity/linter/solc-wrapper/src/ast/error.rs create mode 100644 toolchains/solidity/linter/solc-wrapper/src/ast/mod.rs create mode 100644 toolchains/solidity/linter/solc-wrapper/src/ast/parse.rs create mode 100644 toolchains/solidity/linter/solc-wrapper/src/ast/utils.rs create mode 100644 toolchains/solidity/linter/solc-wrapper/src/error.rs create mode 100644 toolchains/solidity/linter/solc-wrapper/src/lib.rs create mode 100644 toolchains/solidity/linter/solc-wrapper/src/solc/command.rs create mode 100644 toolchains/solidity/linter/solc-wrapper/src/solc/error.rs create mode 100644 toolchains/solidity/linter/solc-wrapper/src/solc/mod.rs create mode 100644 toolchains/solidity/linter/solc-wrapper/src/solc/parsing_error.rs create mode 100644 toolchains/solidity/linter/solc-wrapper/src/utils.rs create mode 100644 toolchains/solidity/linter/solc-wrapper/src/version/error.rs create mode 100644 toolchains/solidity/linter/solc-wrapper/src/version/mod.rs create mode 100644 toolchains/solidity/linter/solc-wrapper/src/version/version.rs create mode 100644 toolchains/solidity/linter/solc-wrapper/tests/files/ast/Assignment.json create mode 100644 toolchains/solidity/linter/solc-wrapper/tests/files/ast/BinaryOperation.json create mode 100644 toolchains/solidity/linter/solc-wrapper/tests/files/ast/Block.json create mode 100644 toolchains/solidity/linter/solc-wrapper/tests/files/ast/Break.json create mode 100644 toolchains/solidity/linter/solc-wrapper/tests/files/ast/Conditional.json create mode 100644 toolchains/solidity/linter/solc-wrapper/tests/files/ast/Continue.json create mode 100644 toolchains/solidity/linter/solc-wrapper/tests/files/ast/ContractDefinition.json create mode 100644 toolchains/solidity/linter/solc-wrapper/tests/files/ast/DoWhileStatement.json create mode 100644 toolchains/solidity/linter/solc-wrapper/tests/files/ast/ElementaryTypeName.json create mode 100644 toolchains/solidity/linter/solc-wrapper/tests/files/ast/ElementaryTypeNameExpression.json create mode 100644 toolchains/solidity/linter/solc-wrapper/tests/files/ast/EmitStatement.json create mode 100644 toolchains/solidity/linter/solc-wrapper/tests/files/ast/EnumDefinition.json create mode 100644 toolchains/solidity/linter/solc-wrapper/tests/files/ast/EnumValue.json create mode 100644 toolchains/solidity/linter/solc-wrapper/tests/files/ast/ErrorDefinition.json create mode 100644 toolchains/solidity/linter/solc-wrapper/tests/files/ast/EventDefinition.json create mode 100644 toolchains/solidity/linter/solc-wrapper/tests/files/ast/ExpressionStatement.json create mode 100644 toolchains/solidity/linter/solc-wrapper/tests/files/ast/ForStatement.json create mode 100644 toolchains/solidity/linter/solc-wrapper/tests/files/ast/FunctionCall.json create mode 100644 toolchains/solidity/linter/solc-wrapper/tests/files/ast/FunctionCallOptions.json create mode 100644 toolchains/solidity/linter/solc-wrapper/tests/files/ast/FunctionDefinition.json create mode 100644 toolchains/solidity/linter/solc-wrapper/tests/files/ast/FunctionTypeName.json create mode 100644 toolchains/solidity/linter/solc-wrapper/tests/files/ast/Identifier.json create mode 100644 toolchains/solidity/linter/solc-wrapper/tests/files/ast/IfStatement.json create mode 100644 toolchains/solidity/linter/solc-wrapper/tests/files/ast/ImportDirective.json create mode 100644 toolchains/solidity/linter/solc-wrapper/tests/files/ast/IndexAccess.json create mode 100644 toolchains/solidity/linter/solc-wrapper/tests/files/ast/IndexRangeAccess.json create mode 100644 toolchains/solidity/linter/solc-wrapper/tests/files/ast/InheritanceSpecifier.json create mode 100644 toolchains/solidity/linter/solc-wrapper/tests/files/ast/InlineAssembly.json create mode 100644 toolchains/solidity/linter/solc-wrapper/tests/files/ast/Literal.json create mode 100644 toolchains/solidity/linter/solc-wrapper/tests/files/ast/MemberAccess.json create mode 100644 toolchains/solidity/linter/solc-wrapper/tests/files/ast/ModifierDefinition.json create mode 100644 toolchains/solidity/linter/solc-wrapper/tests/files/ast/ModifierInvocation.json create mode 100644 toolchains/solidity/linter/solc-wrapper/tests/files/ast/NewExpression.json create mode 100644 toolchains/solidity/linter/solc-wrapper/tests/files/ast/ParameterList.json create mode 100644 toolchains/solidity/linter/solc-wrapper/tests/files/ast/PlaceholderStatement.json create mode 100644 toolchains/solidity/linter/solc-wrapper/tests/files/ast/PragmaDirective.json create mode 100644 toolchains/solidity/linter/solc-wrapper/tests/files/ast/Return.json create mode 100644 toolchains/solidity/linter/solc-wrapper/tests/files/ast/RevertStatement.json create mode 100644 toolchains/solidity/linter/solc-wrapper/tests/files/ast/SourceUnit.json create mode 100644 toolchains/solidity/linter/solc-wrapper/tests/files/ast/StructDefinition.json create mode 100644 toolchains/solidity/linter/solc-wrapper/tests/files/ast/StructuredDocumentation.json create mode 100644 toolchains/solidity/linter/solc-wrapper/tests/files/ast/TryStatement.json create mode 100644 toolchains/solidity/linter/solc-wrapper/tests/files/ast/TupleExpression.json create mode 100644 toolchains/solidity/linter/solc-wrapper/tests/files/ast/TypeDescriptions.json create mode 100644 toolchains/solidity/linter/solc-wrapper/tests/files/ast/UnaryOperation.json create mode 100644 toolchains/solidity/linter/solc-wrapper/tests/files/ast/UncheckedBlock.json create mode 100644 toolchains/solidity/linter/solc-wrapper/tests/files/ast/UserDefinedValueTypeDefinition.json create mode 100644 toolchains/solidity/linter/solc-wrapper/tests/files/ast/UsingForDirective.json create mode 100644 toolchains/solidity/linter/solc-wrapper/tests/files/ast/VariableDeclaration.json create mode 100644 toolchains/solidity/linter/solc-wrapper/tests/files/ast/WhileStatement.json create mode 100644 toolchains/solidity/linter/solidhunter-lib/.gitignore create mode 100644 toolchains/solidity/linter/solidhunter-lib/Cargo.toml create mode 100644 toolchains/solidity/linter/solidhunter-lib/src/lib.rs create mode 100644 toolchains/solidity/linter/solidhunter-lib/src/linter.rs create mode 100644 toolchains/solidity/linter/solidhunter-lib/src/rules/best_practises/function_max_lines.rs create mode 100644 toolchains/solidity/linter/solidhunter-lib/src/rules/best_practises/line_maxlen.rs create mode 100644 toolchains/solidity/linter/solidhunter-lib/src/rules/best_practises/max_states_count.rs create mode 100644 toolchains/solidity/linter/solidhunter-lib/src/rules/best_practises/mod.rs create mode 100644 toolchains/solidity/linter/solidhunter-lib/src/rules/best_practises/reason_string.rs create mode 100644 toolchains/solidity/linter/solidhunter-lib/src/rules/factory.rs create mode 100644 toolchains/solidity/linter/solidhunter-lib/src/rules/miscellaneous/mod.rs create mode 100644 toolchains/solidity/linter/solidhunter-lib/src/rules/miscellaneous/quotes.rs create mode 100644 toolchains/solidity/linter/solidhunter-lib/src/rules/mod.rs create mode 100644 toolchains/solidity/linter/solidhunter-lib/src/rules/naming/contract_name_pascalcase.rs create mode 100644 toolchains/solidity/linter/solidhunter-lib/src/rules/naming/func_name_camelcase.rs create mode 100644 toolchains/solidity/linter/solidhunter-lib/src/rules/naming/func_param_name_camelcase.rs create mode 100644 toolchains/solidity/linter/solidhunter-lib/src/rules/naming/mod.rs create mode 100644 toolchains/solidity/linter/solidhunter-lib/src/rules/naming/use_forbidden_name.rs create mode 100644 toolchains/solidity/linter/solidhunter-lib/src/rules/order/import_on_top.rs create mode 100644 toolchains/solidity/linter/solidhunter-lib/src/rules/order/mod.rs create mode 100644 toolchains/solidity/linter/solidhunter-lib/src/rules/rule_impl.rs create mode 100644 toolchains/solidity/linter/solidhunter-lib/src/rules/types.rs create mode 100644 toolchains/solidity/linter/solidhunter-lib/src/types.rs create mode 100644 toolchains/solidity/linter/src/main.rs diff --git a/toolchains/solidity/linter/.gitignore b/toolchains/solidity/linter/.gitignore new file mode 100644 index 00000000..4940fa07 --- /dev/null +++ b/toolchains/solidity/linter/.gitignore @@ -0,0 +1,13 @@ +# Jetbrain +.idea/ + +# Generated by Cargo +# will have compiled files and executables +target + +# Remove Cargo.lock from gitignore if creating an executable, leave it for libraries +# More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html + +# These are backup files generated by rustfmt +**/*.rs.bk +.solidhunter.json \ No newline at end of file diff --git a/toolchains/solidity/linter/.unstable b/toolchains/solidity/linter/.unstable deleted file mode 100644 index e69de29b..00000000 diff --git a/toolchains/solidity/linter/Cargo.lock b/toolchains/solidity/linter/Cargo.lock new file mode 100644 index 00000000..d9d49b76 --- /dev/null +++ b/toolchains/solidity/linter/Cargo.lock @@ -0,0 +1,1889 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "adler" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" + +[[package]] +name = "aes" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e8b47f52ea9bae42228d07ec09eb676433d7c4ed1ebdf0f1d1c29ed446f1ab8" +dependencies = [ + "cfg-if", + "cipher", + "cpufeatures", + "opaque-debug", +] + +[[package]] +name = "aho-corasick" +version = "0.7.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cc936419f96fa211c1b9166887b38e5e40b19958e5b895be7c1f93adec7071ac" +dependencies = [ + "memchr", +] + +[[package]] +name = "anyhow" +version = "1.0.66" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "216261ddc8289130e551ddcd5ce8a064710c0d064a4d2895c67151c92b5443f6" + +[[package]] +name = "arrayvec" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8da52d66c7071e2e3fa2a1e5c6d088fec47b593032b254f5e980de8ea54454d6" + +[[package]] +name = "atty" +version = "0.2.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" +dependencies = [ + "hermit-abi 0.1.19", + "libc", + "winapi", +] + +[[package]] +name = "auto_impl" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a8c1df849285fbacd587de7818cc7d13be6cd2cbcd47a04fb1801b0e2706e33" +dependencies = [ + "proc-macro-error", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "autocfg" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" + +[[package]] +name = "base64" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" + +[[package]] +name = "base64ct" +version = "1.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b645a089122eccb6111b4f81cbc1a49f5900ac4666bb93ac027feaecf15607bf" + +[[package]] +name = "binstall-zip" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a7d6964f4bcc7bf2b07f47bc20245b08997b5be470e450b5b511d72164151894" +dependencies = [ + "aes", + "byteorder", + "bzip2", + "constant_time_eq", + "crc32fast", + "crossbeam-utils", + "flate2", + "hmac", + "pbkdf2", + "sha1", + "time", + "zstd", +] + +[[package]] +name = "bitflags" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" + +[[package]] +name = "block-buffer" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4152116fd6e9dadb291ae18fc1ec3575ed6d84c29642d97890f4b4a3417297e4" +dependencies = [ + "generic-array", +] + +[[package]] +name = "block-buffer" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "69cce20737498f97b993470a6e536b8523f0af7892a4f928cceb1ac5e52ebe7e" +dependencies = [ + "generic-array", +] + +[[package]] +name = "bumpalo" +version = "3.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "572f695136211188308f16ad2ca5c851a712c464060ae6974944458eb83880ba" + +[[package]] +name = "byteorder" +version = "1.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" + +[[package]] +name = "bytes" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dfb24e866b15a1af2a1b663f10c6b6b8f397a84aadb828f12e5b289ec23a3a3c" + +[[package]] +name = "bzip2" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6afcd980b5f3a45017c57e57a2fcccbb351cc43a356ce117ef760ef8052b89b0" +dependencies = [ + "bzip2-sys", + "libc", +] + +[[package]] +name = "bzip2-sys" +version = "0.1.11+1.0.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "736a955f3fa7875102d57c82b8cac37ec45224a07fd32d58f9f7a186b6cd4cdc" +dependencies = [ + "cc", + "libc", + "pkg-config", +] + +[[package]] +name = "cc" +version = "1.0.77" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e9f73505338f7d905b19d18738976aae232eb46b8efc15554ffc56deb5d9ebe4" +dependencies = [ + "jobserver", +] + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "cipher" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ee52072ec15386f770805afd189a01c8841be8696bed250fa2f13c4c0d6dfb7" +dependencies = [ + "generic-array", +] + +[[package]] +name = "clap" +version = "3.2.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "71655c45cb9845d3270c9d6df84ebe72b4dad3c2ba3f7023ad47c144e4e473a5" +dependencies = [ + "atty", + "bitflags", + "clap_derive 3.2.18", + "clap_lex 0.2.4", + "indexmap", + "once_cell", + "strsim", + "termcolor", + "textwrap", +] + +[[package]] +name = "clap" +version = "4.0.29" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4d63b9e9c07271b9957ad22c173bae2a4d9a81127680962039296abcd2f8251d" +dependencies = [ + "bitflags", + "clap_derive 4.0.21", + "clap_lex 0.3.0", + "is-terminal", + "once_cell", + "strsim", + "termcolor", +] + +[[package]] +name = "clap_derive" +version = "3.2.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ea0c8bce528c4be4da13ea6fead8965e95b6073585a2f05204bd8f4119f82a65" +dependencies = [ + "heck", + "proc-macro-error", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "clap_derive" +version = "4.0.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0177313f9f02afc995627906bbd8967e2be069f5261954222dac78290c2b9014" +dependencies = [ + "heck", + "proc-macro-error", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "clap_lex" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2850f2f5a82cbf437dd5af4d49848fbdfc27c157c3d010345776f952765261c5" +dependencies = [ + "os_str_bytes", +] + +[[package]] +name = "clap_lex" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d4198f73e42b4936b35b5bb248d81d2b595ecb170da0bac7655c54eedfa8da8" +dependencies = [ + "os_str_bytes", +] + +[[package]] +name = "colored" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b3616f750b84d8f0de8a58bda93e08e2a81ad3f523089b05f1dffecab48c6cbd" +dependencies = [ + "atty", + "lazy_static", + "winapi", +] + +[[package]] +name = "console" +version = "0.14.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3993e6445baa160675931ec041a5e03ca84b9c6e32a056150d3aa2bdda0a1f45" +dependencies = [ + "encode_unicode", + "lazy_static", + "libc", + "regex", + "terminal_size", + "unicode-width", + "winapi", +] + +[[package]] +name = "console" +version = "0.15.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c050367d967ced717c04b65d8c619d863ef9292ce0c5760028655a2fb298718c" +dependencies = [ + "encode_unicode", + "lazy_static", + "libc", + "terminal_size", + "winapi", +] + +[[package]] +name = "constant_time_eq" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "245097e9a4535ee1e3e3931fcfcd55a796a44c643e8596ff6566d68f09b87bbc" + +[[package]] +name = "cpufeatures" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28d997bd5e24a5928dd43e46dc529867e207907fe0b239c3477d924f7f2ca320" +dependencies = [ + "libc", +] + +[[package]] +name = "crc32fast" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b540bd8bc810d3885c6ea91e2018302f68baba2129ab3e88f32389ee9370880d" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "crossbeam-utils" +version = "0.8.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4fb766fa798726286dbbb842f174001dab8abc7b627a1dd86e0b7222a95d929f" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "crypto-common" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" +dependencies = [ + "generic-array", + "typenum", +] + +[[package]] +name = "dialoguer" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c9dd058f8b65922819fabb4a41e7d1964e56344042c26efbccd465202c23fa0c" +dependencies = [ + "console 0.14.1", + "lazy_static", + "tempfile", + "zeroize", +] + +[[package]] +name = "digest" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3dd60d1080a57a05ab032377049e0591415d2b31afd7028356dbf3cc6dcb066" +dependencies = [ + "generic-array", +] + +[[package]] +name = "digest" +version = "0.10.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8168378f4e5023e7218c89c891c0fd8ecdb5e5e4f18cb78f38cf245dd021e76f" +dependencies = [ + "block-buffer 0.10.3", + "crypto-common", + "subtle", +] + +[[package]] +name = "either" +version = "1.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90e5c1c8368803113bf0c9584fc495a58b86dc8a29edbf8fe877d21d9507e797" + +[[package]] +name = "encode_unicode" +version = "0.3.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a357d28ed41a50f9c765dbfe56cbc04a64e53e5fc58ba79fbc34c10ef3df831f" + +[[package]] +name = "encoding_rs" +version = "0.8.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9852635589dc9f9ea1b6fe9f05b50ef208c85c834a562f0c6abb1c475736ec2b" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "errno" +version = "0.2.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f639046355ee4f37944e44f60642c6f3a7efa3cf6b78c78a0d989a8ce6c396a1" +dependencies = [ + "errno-dragonfly", + "libc", + "winapi", +] + +[[package]] +name = "errno-dragonfly" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa68f1b12764fab894d2755d2518754e71b4fd80ecfb822714a1206c2aab39bf" +dependencies = [ + "cc", + "libc", +] + +[[package]] +name = "fastrand" +version = "1.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a7a407cfaa3385c4ae6b23e84623d48c2798d06e3e6a1878f7f59f17b3f86499" +dependencies = [ + "instant", +] + +[[package]] +name = "flate2" +version = "1.0.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8a2db397cb1c8772f31494cb8917e48cd1e64f0fa7efac59fbd741a0a8ce841" +dependencies = [ + "crc32fast", + "miniz_oxide", +] + +[[package]] +name = "fnv" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" + +[[package]] +name = "form_urlencoded" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a9c384f161156f5260c24a097c56119f9be8c798586aecc13afbcbe7b7e26bf8" +dependencies = [ + "percent-encoding", +] + +[[package]] +name = "fs2" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9564fc758e15025b46aa6643b1b77d047d1a56a1aea6e01002ac0c7026876213" +dependencies = [ + "libc", + "winapi", +] + +[[package]] +name = "futures-channel" +version = "0.3.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "52ba265a92256105f45b719605a571ffe2d1f0fea3807304b522c1d778f79eed" +dependencies = [ + "futures-core", +] + +[[package]] +name = "futures-core" +version = "0.3.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "04909a7a7e4633ae6c4a9ab280aeb86da1236243a77b694a49eacd659a4bd3ac" + +[[package]] +name = "futures-io" +version = "0.3.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "00f5fb52a06bdcadeb54e8d3671f8888a39697dcb0b81b23b55174030427f4eb" + +[[package]] +name = "futures-sink" +version = "0.3.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "39c15cf1a4aa79df40f1bb462fb39676d0ad9e366c2a33b590d7c66f4f81fcf9" + +[[package]] +name = "futures-task" +version = "0.3.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2ffb393ac5d9a6eaa9d3fdf37ae2776656b706e200c8e16b1bdb227f5198e6ea" + +[[package]] +name = "futures-util" +version = "0.3.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "197676987abd2f9cadff84926f410af1c183608d36641465df73ae8211dc65d6" +dependencies = [ + "futures-core", + "futures-io", + "futures-task", + "memchr", + "pin-project-lite", + "pin-utils", + "slab", +] + +[[package]] +name = "generic-array" +version = "0.14.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bff49e947297f3312447abdca79f45f4738097cc82b06e72054d2223f601f1b9" +dependencies = [ + "typenum", + "version_check", +] + +[[package]] +name = "glob" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b919933a397b79c37e33b77bb2aa3dc8eb6e165ad809e58ff75bc7db2e34574" + +[[package]] +name = "h2" +version = "0.3.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f9f29bc9dda355256b2916cf526ab02ce0aeaaaf2bad60d65ef3f12f11dd0f4" +dependencies = [ + "bytes", + "fnv", + "futures-core", + "futures-sink", + "futures-util", + "http", + "indexmap", + "slab", + "tokio", + "tokio-util", + "tracing", +] + +[[package]] +name = "hashbrown" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" + +[[package]] +name = "heck" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2540771e65fc8cb83cd6e8a237f70c319bd5c29f78ed1084ba5d50eeac86f7f9" + +[[package]] +name = "hermit-abi" +version = "0.1.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" +dependencies = [ + "libc", +] + +[[package]] +name = "hermit-abi" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee512640fe35acbfb4bb779db6f0d80704c2cacfa2e39b601ef3e3f47d1ae4c7" +dependencies = [ + "libc", +] + +[[package]] +name = "hex" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" + +[[package]] +name = "hmac" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" +dependencies = [ + "digest 0.10.6", +] + +[[package]] +name = "home" +version = "0.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "747309b4b440c06d57b0b25f2aee03ee9b5e5397d288c60e21fc709bb98a7408" +dependencies = [ + "winapi", +] + +[[package]] +name = "http" +version = "0.2.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75f43d41e26995c17e71ee126451dd3941010b0514a81a9d11f3b341debc2399" +dependencies = [ + "bytes", + "fnv", + "itoa", +] + +[[package]] +name = "http-body" +version = "0.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d5f38f16d184e36f2408a55281cd658ecbd3ca05cce6d6510a176eca393e26d1" +dependencies = [ + "bytes", + "http", + "pin-project-lite", +] + +[[package]] +name = "httparse" +version = "1.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904" + +[[package]] +name = "httpdate" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4a1e36c821dbe04574f602848a19f742f4fb3c98d40449f11bcad18d6b17421" + +[[package]] +name = "hyper" +version = "0.14.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "034711faac9d2166cb1baf1a2fb0b60b1f277f8492fd72176c17f3515e1abd3c" +dependencies = [ + "bytes", + "futures-channel", + "futures-core", + "futures-util", + "h2", + "http", + "http-body", + "httparse", + "httpdate", + "itoa", + "pin-project-lite", + "socket2", + "tokio", + "tower-service", + "tracing", + "want", +] + +[[package]] +name = "hyper-rustls" +version = "0.23.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1788965e61b367cd03a62950836d5cd41560c3577d90e40e0819373194d1661c" +dependencies = [ + "http", + "hyper", + "rustls", + "tokio", + "tokio-rustls", +] + +[[package]] +name = "idna" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e14ddfc70884202db2244c223200c204c2bda1bc6e0998d11b5e024d657209e6" +dependencies = [ + "unicode-bidi", + "unicode-normalization", +] + +[[package]] +name = "indexmap" +version = "1.9.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1885e79c1fc4b10f0e172c475f458b7f7b93061064d98c3293e98c5ba0c8b399" +dependencies = [ + "autocfg", + "hashbrown", +] + +[[package]] +name = "indicatif" +version = "0.16.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2d207dc617c7a380ab07ff572a6e52fa202a2a8f355860ac9c38e23f8196be1b" +dependencies = [ + "console 0.15.2", + "lazy_static", + "number_prefix", + "regex", +] + +[[package]] +name = "instant" +version = "0.1.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "io-lifetimes" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "46112a93252b123d31a119a8d1a1ac19deac4fac6e0e8b0df58f0d4e5870e63c" +dependencies = [ + "libc", + "windows-sys", +] + +[[package]] +name = "ipnet" +version = "2.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "11b0d96e660696543b251e58030cf9787df56da39dab19ad60eae7353040917e" + +[[package]] +name = "is-terminal" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "927609f78c2913a6f6ac3c27a4fe87f43e2a35367c0c4b0f8265e8f49a104330" +dependencies = [ + "hermit-abi 0.2.6", + "io-lifetimes", + "rustix", + "windows-sys", +] + +[[package]] +name = "itertools" +version = "0.10.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" +dependencies = [ + "either", +] + +[[package]] +name = "itoa" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4217ad341ebadf8d8e724e264f13e593e0648f5b3e94b3896a5df283be015ecc" + +[[package]] +name = "jobserver" +version = "0.1.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "068b1ee6743e4d11fb9c6a1e6064b3693a1b600e7f5f5988047d98b3dc9fb90b" +dependencies = [ + "libc", +] + +[[package]] +name = "js-sys" +version = "0.3.60" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49409df3e3bf0856b916e2ceaca09ee28e6871cf7d9ce97a692cacfdb2a25a47" +dependencies = [ + "wasm-bindgen", +] + +[[package]] +name = "lazy_static" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" + +[[package]] +name = "libc" +version = "0.2.138" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db6d7e329c562c5dfab7a46a2afabc8b987ab9a4834c9d1ca04dc54c1546cef8" + +[[package]] +name = "linux-raw-sys" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f9f08d8963a6c613f4b1a78f4f4a4dbfadf8e6545b2d72861731e4858b8b47f" + +[[package]] +name = "lock_api" +version = "0.4.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "435011366fe56583b16cf956f9df0095b405b82d76425bc8981c0e22e60ec4df" +dependencies = [ + "autocfg", + "scopeguard", +] + +[[package]] +name = "log" +version = "0.4.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "abb12e687cfb44aa40f41fc3978ef76448f9b6038cad6aef4259d3c095a2382e" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "memchr" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" + +[[package]] +name = "mime" +version = "0.3.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2a60c7ce501c71e03a9c9c0d35b861413ae925bd979cc7a4e30d060069aaac8d" + +[[package]] +name = "miniz_oxide" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b275950c28b37e794e8c55d88aeb5e139d0ce23fdbbeda68f8d7174abdf9e8fa" +dependencies = [ + "adler", +] + +[[package]] +name = "mio" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5d732bc30207a6423068df043e3d02e0735b155ad7ce1a6f76fe2baa5b158de" +dependencies = [ + "libc", + "log", + "wasi", + "windows-sys", +] + +[[package]] +name = "num_cpus" +version = "1.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6058e64324c71e02bc2b150e4f3bc8286db6c83092132ffa3f6b1eab0f9def5" +dependencies = [ + "hermit-abi 0.1.19", + "libc", +] + +[[package]] +name = "number_prefix" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "830b246a0e5f20af87141b25c173cd1b609bd7779a4617d6ec582abaf90870f3" + +[[package]] +name = "once_cell" +version = "1.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "86f0b0d4bf799edbc74508c1e8bf170ff5f41238e5f8225603ca7caaae2b7860" + +[[package]] +name = "opaque-debug" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5" + +[[package]] +name = "open-fastrlp" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "786393f80485445794f6043fd3138854dd109cc6c4bd1a6383db304c9ce9b9ce" +dependencies = [ + "arrayvec", + "auto_impl", + "bytes", +] + +[[package]] +name = "os_str_bytes" +version = "6.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b7820b9daea5457c9f21c69448905d723fbd21136ccf521748f23fd49e723ee" + +[[package]] +name = "parking_lot" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" +dependencies = [ + "lock_api", + "parking_lot_core", +] + +[[package]] +name = "parking_lot_core" +version = "0.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ff9f3fef3968a3ec5945535ed654cb38ff72d7495a25619e2247fb15a2ed9ba" +dependencies = [ + "cfg-if", + "libc", + "redox_syscall", + "smallvec", + "windows-sys", +] + +[[package]] +name = "password-hash" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7676374caaee8a325c9e7a2ae557f216c5563a171d6997b0ef8a65af35147700" +dependencies = [ + "base64ct", + "rand_core", + "subtle", +] + +[[package]] +name = "pbkdf2" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "83a0692ec44e4cf1ef28ca317f14f8f07da2d95ec3fa01f86e4467b725e60917" +dependencies = [ + "digest 0.10.6", + "hmac", + "password-hash", + "sha2 0.10.6", +] + +[[package]] +name = "percent-encoding" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "478c572c3d73181ff3c2539045f6eb99e5491218eae919370993b890cdbdd98e" + +[[package]] +name = "pin-project-lite" +version = "0.2.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e0a7ae3ac2f1173085d398531c705756c94a4c56843785df85a60c1a0afac116" + +[[package]] +name = "pin-utils" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" + +[[package]] +name = "pkg-config" +version = "0.3.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ac9a59f73473f1b8d852421e59e64809f025994837ef743615c6d0c5b305160" + +[[package]] +name = "proc-macro-error" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" +dependencies = [ + "proc-macro-error-attr", + "proc-macro2", + "quote", + "syn", + "version_check", +] + +[[package]] +name = "proc-macro-error-attr" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" +dependencies = [ + "proc-macro2", + "quote", + "version_check", +] + +[[package]] +name = "proc-macro2" +version = "1.0.47" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5ea3d908b0e36316caf9e9e2c4625cdde190a7e6f440d794667ed17a1855e725" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quote" +version = "1.0.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbe448f377a7d6961e30f5955f9b8d106c3f5e449d493ee1b125c1d43c2b5179" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "rand" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" +dependencies = [ + "rand_core", +] + +[[package]] +name = "rand_core" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" + +[[package]] +name = "redox_syscall" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a" +dependencies = [ + "bitflags", +] + +[[package]] +name = "regex" +version = "1.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e076559ef8e241f2ae3479e36f97bd5741c0330689e217ad51ce2c76808b868a" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax", +] + +[[package]] +name = "regex-syntax" +version = "0.6.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "456c603be3e8d448b072f410900c09faf164fbce2d480456f50eea6e25f9c848" + +[[package]] +name = "remove_dir_all" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3acd125665422973a33ac9d3dd2df85edad0f4ae9b00dafb1a05e43a9f5ef8e7" +dependencies = [ + "winapi", +] + +[[package]] +name = "reqwest" +version = "0.11.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68cc60575865c7831548863cc02356512e3f1dc2f3f82cb837d7fc4cc8f3c97c" +dependencies = [ + "base64", + "bytes", + "encoding_rs", + "futures-core", + "futures-util", + "h2", + "http", + "http-body", + "hyper", + "hyper-rustls", + "ipnet", + "js-sys", + "log", + "mime", + "once_cell", + "percent-encoding", + "pin-project-lite", + "rustls", + "rustls-pemfile", + "serde", + "serde_json", + "serde_urlencoded", + "tokio", + "tokio-rustls", + "tower-service", + "url", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", + "webpki-roots", + "winreg", +] + +[[package]] +name = "ring" +version = "0.16.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3053cf52e236a3ed746dfc745aa9cacf1b791d846bdaf412f60a8d7d6e17c8fc" +dependencies = [ + "cc", + "libc", + "once_cell", + "spin", + "untrusted", + "web-sys", + "winapi", +] + +[[package]] +name = "rustix" +version = "0.36.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a3807b5d10909833d3e9acd1eb5fb988f79376ff10fce42937de71a449c4c588" +dependencies = [ + "bitflags", + "errno", + "io-lifetimes", + "libc", + "linux-raw-sys", + "windows-sys", +] + +[[package]] +name = "rustls" +version = "0.20.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "539a2bfe908f471bfa933876bd1eb6a19cf2176d375f82ef7f99530a40e48c2c" +dependencies = [ + "log", + "ring", + "sct", + "webpki", +] + +[[package]] +name = "rustls-pemfile" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0864aeff53f8c05aa08d86e5ef839d3dfcf07aeba2db32f12db0ef716e87bd55" +dependencies = [ + "base64", +] + +[[package]] +name = "ryu" +version = "1.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4501abdff3ae82a1c1b477a17252eb69cee9e66eb915c1abaa4f44d873df9f09" + +[[package]] +name = "scopeguard" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" + +[[package]] +name = "sct" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d53dcdb7c9f8158937a7981b48accfd39a43af418591a5d008c7b22b5e1b7ca4" +dependencies = [ + "ring", + "untrusted", +] + +[[package]] +name = "semver" +version = "1.0.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e25dfac463d778e353db5be2449d1cce89bd6fd23c9f1ea21310ce6e5a1b29c4" +dependencies = [ + "serde", +] + +[[package]] +name = "serde" +version = "1.0.150" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e326c9ec8042f1b5da33252c8a37e9ffbd2c9bef0155215b6e6c80c790e05f91" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.150" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42a3df25b0713732468deadad63ab9da1f1fd75a48a15024b50363f128db627e" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "serde_json" +version = "1.0.89" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "020ff22c755c2ed3f8cf162dbb41a7268d934702f3ed3631656ea597e08fc3db" +dependencies = [ + "itoa", + "ryu", + "serde", +] + +[[package]] +name = "serde_urlencoded" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd" +dependencies = [ + "form_urlencoded", + "itoa", + "ryu", + "serde", +] + +[[package]] +name = "sha1" +version = "0.10.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f04293dc80c3993519f2d7f6f511707ee7094fe0c6d3406feb330cdb3540eba3" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest 0.10.6", +] + +[[package]] +name = "sha2" +version = "0.9.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4d58a1e1bf39749807d89cf2d98ac2dfa0ff1cb3faa38fbb64dd88ac8013d800" +dependencies = [ + "block-buffer 0.9.0", + "cfg-if", + "cpufeatures", + "digest 0.9.0", + "opaque-debug", +] + +[[package]] +name = "sha2" +version = "0.10.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "82e6b795fe2e3b1e845bafcb27aa35405c4d47cdfc92af5fc8d3002f76cebdc0" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest 0.10.6", +] + +[[package]] +name = "signal-hook-registry" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e51e73328dc4ac0c7ccbda3a494dfa03df1de2f46018127f60c693f2648455b0" +dependencies = [ + "libc", +] + +[[package]] +name = "slab" +version = "0.4.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4614a76b2a8be0058caa9dbbaf66d988527d86d003c11a94fbd335d7661edcef" +dependencies = [ + "autocfg", +] + +[[package]] +name = "smallvec" +version = "1.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a507befe795404456341dfab10cef66ead4c041f62b8b11bbb92bffe5d0953e0" + +[[package]] +name = "socket2" +version = "0.4.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "02e2d2db9033d13a1567121ddd7a095ee144db4e1ca1b1bda3419bc0da294ebd" +dependencies = [ + "libc", + "winapi", +] + +[[package]] +name = "solc-wrapper" +version = "0.1.0" +dependencies = [ + "anyhow", + "hex", + "home", + "once_cell", + "open-fastrlp", + "regex", + "semver", + "serde", + "serde_json", + "svm-rs", + "thiserror", +] + +[[package]] +name = "solidhunter" +version = "0.0.1" +dependencies = [ + "anyhow", + "clap 4.0.29", + "colored", + "glob", + "serde", + "serde_json", + "solidhunter-lib", + "thiserror", +] + +[[package]] +name = "solidhunter-lib" +version = "0.0.1" +dependencies = [ + "anyhow", + "clap 4.0.29", + "colored", + "glob", + "serde", + "serde_json", + "solc-wrapper", + "thiserror", +] + +[[package]] +name = "spin" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" + +[[package]] +name = "strsim" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" + +[[package]] +name = "subtle" +version = "2.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6bdef32e8150c2a081110b42772ffe7d7c9032b606bc226c8260fd97e0976601" + +[[package]] +name = "svm-rs" +version = "0.2.18" +source = "git+https://github.com/roynalnaruto/svm-rs#ad9434b9fe1aee6e87cbbebb4eb15f6182663f52" +dependencies = [ + "anyhow", + "binstall-zip", + "cfg-if", + "clap 3.2.23", + "console 0.14.1", + "dialoguer", + "fs2", + "hex", + "home", + "indicatif", + "itertools", + "once_cell", + "rand", + "reqwest", + "semver", + "serde", + "serde_json", + "sha2 0.9.9", + "tempfile", + "thiserror", + "tokio", + "tracing", + "url", +] + +[[package]] +name = "syn" +version = "1.0.105" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "60b9b43d45702de4c839cb9b51d9f529c5dd26a4aff255b42b1ebc03e88ee908" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "tempfile" +version = "3.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5cdb1ef4eaeeaddc8fbd371e5017057064af0911902ef36b39801f67cc6d79e4" +dependencies = [ + "cfg-if", + "fastrand", + "libc", + "redox_syscall", + "remove_dir_all", + "winapi", +] + +[[package]] +name = "termcolor" +version = "1.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bab24d30b911b2376f3a13cc2cd443142f0c81dda04c118693e35b3835757755" +dependencies = [ + "winapi-util", +] + +[[package]] +name = "terminal_size" +version = "0.1.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "633c1a546cee861a1a6d0dc69ebeca693bf4296661ba7852b9d21d159e0506df" +dependencies = [ + "libc", + "winapi", +] + +[[package]] +name = "textwrap" +version = "0.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "222a222a5bfe1bba4a77b45ec488a741b3cb8872e5e499451fd7d0129c9c7c3d" + +[[package]] +name = "thiserror" +version = "1.0.37" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "10deb33631e3c9018b9baf9dcbbc4f737320d2b576bac10f6aefa048fa407e3e" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.37" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "982d17546b47146b28f7c22e3d08465f6b8903d0ea13c1660d9d84a6e7adcdbb" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "time" +version = "0.3.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a561bf4617eebd33bca6434b988f39ed798e527f51a1e797d0ee4f61c0a38376" +dependencies = [ + "itoa", + "serde", + "time-core", + "time-macros", +] + +[[package]] +name = "time-core" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e153e1f1acaef8acc537e68b44906d2db6436e2b35ac2c6b42640fff91f00fd" + +[[package]] +name = "time-macros" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d967f99f534ca7e495c575c62638eebc2898a8c84c119b89e250477bc4ba16b2" +dependencies = [ + "time-core", +] + +[[package]] +name = "tinyvec" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" +dependencies = [ + "tinyvec_macros", +] + +[[package]] +name = "tinyvec_macros" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c" + +[[package]] +name = "tokio" +version = "1.23.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eab6d665857cc6ca78d6e80303a02cea7a7851e85dfbd77cbdc09bd129f1ef46" +dependencies = [ + "autocfg", + "bytes", + "libc", + "memchr", + "mio", + "num_cpus", + "parking_lot", + "pin-project-lite", + "signal-hook-registry", + "socket2", + "tokio-macros", + "windows-sys", +] + +[[package]] +name = "tokio-macros" +version = "1.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d266c00fde287f55d3f1c3e96c500c362a2b8c695076ec180f27918820bc6df8" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "tokio-rustls" +version = "0.23.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c43ee83903113e03984cb9e5cebe6c04a5116269e900e3ddba8f068a62adda59" +dependencies = [ + "rustls", + "tokio", + "webpki", +] + +[[package]] +name = "tokio-util" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0bb2e075f03b3d66d8d8785356224ba688d2906a371015e225beeb65ca92c740" +dependencies = [ + "bytes", + "futures-core", + "futures-sink", + "pin-project-lite", + "tokio", + "tracing", +] + +[[package]] +name = "tower-service" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" + +[[package]] +name = "tracing" +version = "0.1.37" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ce8c33a8d48bd45d624a6e523445fd21ec13d3653cd51f681abf67418f54eb8" +dependencies = [ + "cfg-if", + "pin-project-lite", + "tracing-attributes", + "tracing-core", +] + +[[package]] +name = "tracing-attributes" +version = "0.1.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4017f8f45139870ca7e672686113917c71c7a6e02d4924eda67186083c03081a" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "tracing-core" +version = "0.1.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24eb03ba0eab1fd845050058ce5e616558e8f8d8fca633e6b163fe25c797213a" +dependencies = [ + "once_cell", +] + +[[package]] +name = "try-lock" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59547bce71d9c38b83d9c0e92b6066c4253371f15005def0c30d9657f50c7642" + +[[package]] +name = "typenum" +version = "1.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "497961ef93d974e23eb6f433eb5fe1b7930b659f06d12dec6fc44a8f554c0bba" + +[[package]] +name = "unicode-bidi" +version = "0.3.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "099b7128301d285f79ddd55b9a83d5e6b9e97c92e0ea0daebee7263e932de992" + +[[package]] +name = "unicode-ident" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ceab39d59e4c9499d4e5a8ee0e2735b891bb7308ac83dfb4e80cad195c9f6f3" + +[[package]] +name = "unicode-normalization" +version = "0.1.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c5713f0fc4b5db668a2ac63cdb7bb4469d8c9fed047b1d0292cc7b0ce2ba921" +dependencies = [ + "tinyvec", +] + +[[package]] +name = "unicode-width" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0edd1e5b14653f783770bce4a4dabb4a5108a5370a5f5d8cfe8710c361f6c8b" + +[[package]] +name = "untrusted" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a156c684c91ea7d62626509bce3cb4e1d9ed5c4d978f7b4352658f96a4c26b4a" + +[[package]] +name = "url" +version = "2.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d68c799ae75762b8c3fe375feb6600ef5602c883c5d21eb51c09f22b83c4643" +dependencies = [ + "form_urlencoded", + "idna", + "percent-encoding", +] + +[[package]] +name = "version_check" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" + +[[package]] +name = "want" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ce8a968cb1cd110d136ff8b819a556d6fb6d919363c61534f6860c7eb172ba0" +dependencies = [ + "log", + "try-lock", +] + +[[package]] +name = "wasi" +version = "0.11.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" + +[[package]] +name = "wasm-bindgen" +version = "0.2.83" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eaf9f5aceeec8be17c128b2e93e031fb8a4d469bb9c4ae2d7dc1888b26887268" +dependencies = [ + "cfg-if", + "wasm-bindgen-macro", +] + +[[package]] +name = "wasm-bindgen-backend" +version = "0.2.83" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c8ffb332579b0557b52d268b91feab8df3615f265d5270fec2a8c95b17c1142" +dependencies = [ + "bumpalo", + "log", + "once_cell", + "proc-macro2", + "quote", + "syn", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-futures" +version = "0.4.33" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23639446165ca5a5de86ae1d8896b737ae80319560fbaa4c2887b7da6e7ebd7d" +dependencies = [ + "cfg-if", + "js-sys", + "wasm-bindgen", + "web-sys", +] + +[[package]] +name = "wasm-bindgen-macro" +version = "0.2.83" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "052be0f94026e6cbc75cdefc9bae13fd6052cdcaf532fa6c45e7ae33a1e6c810" +dependencies = [ + "quote", + "wasm-bindgen-macro-support", +] + +[[package]] +name = "wasm-bindgen-macro-support" +version = "0.2.83" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07bc0c051dc5f23e307b13285f9d75df86bfdf816c5721e573dec1f9b8aa193c" +dependencies = [ + "proc-macro2", + "quote", + "syn", + "wasm-bindgen-backend", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-shared" +version = "0.2.83" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1c38c045535d93ec4f0b4defec448e4291638ee608530863b1e2ba115d4fff7f" + +[[package]] +name = "web-sys" +version = "0.3.60" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bcda906d8be16e728fd5adc5b729afad4e444e106ab28cd1c7256e54fa61510f" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "webpki" +version = "0.22.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f095d78192e208183081cc07bc5515ef55216397af48b873e5edcd72637fa1bd" +dependencies = [ + "ring", + "untrusted", +] + +[[package]] +name = "webpki-roots" +version = "0.22.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6c71e40d7d2c34a5106301fb632274ca37242cd0c9d3e64dbece371a40a2d87" +dependencies = [ + "webpki", +] + +[[package]] +name = "winapi" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" +dependencies = [ + "winapi-i686-pc-windows-gnu", + "winapi-x86_64-pc-windows-gnu", +] + +[[package]] +name = "winapi-i686-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" + +[[package]] +name = "winapi-util" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" +dependencies = [ + "winapi", +] + +[[package]] +name = "winapi-x86_64-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" + +[[package]] +name = "windows-sys" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a3e1820f08b8513f676f7ab6c1f99ff312fb97b553d30ff4dd86f9f15728aa7" +dependencies = [ + "windows_aarch64_gnullvm", + "windows_aarch64_msvc", + "windows_i686_gnu", + "windows_i686_msvc", + "windows_x86_64_gnu", + "windows_x86_64_gnullvm", + "windows_x86_64_msvc", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41d2aa71f6f0cbe00ae5167d90ef3cfe66527d6f613ca78ac8024c3ccab9a19e" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd0f252f5a35cac83d6311b2e795981f5ee6e67eb1f9a7f64eb4500fbc4dcdb4" + +[[package]] +name = "windows_i686_gnu" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fbeae19f6716841636c28d695375df17562ca208b2b7d0dc47635a50ae6c5de7" + +[[package]] +name = "windows_i686_msvc" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "84c12f65daa39dd2babe6e442988fc329d6243fdce47d7d2d155b8d874862246" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bf7b1b21b5362cbc318f686150e5bcea75ecedc74dd157d874d754a2ca44b0ed" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09d525d2ba30eeb3297665bd434a54297e4170c7f1a44cad4ef58095b4cd2028" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f40009d85759725a34da6d89a94e63d7bdc50a862acf0dbc7c8e488f1edcb6f5" + +[[package]] +name = "winreg" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "80d0f4e272c85def139476380b12f9ac60926689dd2e01d4923222f40580869d" +dependencies = [ + "winapi", +] + +[[package]] +name = "zeroize" +version = "1.5.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c394b5bd0c6f669e7275d9c20aa90ae064cb22e75a1cad54e1b34088034b149f" + +[[package]] +name = "zstd" +version = "0.11.2+zstd.1.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "20cc960326ece64f010d2d2107537f26dc589a6573a316bd5b1dba685fa5fde4" +dependencies = [ + "zstd-safe", +] + +[[package]] +name = "zstd-safe" +version = "5.0.2+zstd.1.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d2a5585e04f9eea4b2a3d1eca508c4dee9592a89ef6f450c11719da0726f4db" +dependencies = [ + "libc", + "zstd-sys", +] + +[[package]] +name = "zstd-sys" +version = "2.0.4+zstd.1.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4fa202f2ef00074143e219d15b62ffc317d17cc33909feac471c044087cad7b0" +dependencies = [ + "cc", + "libc", +] diff --git a/toolchains/solidity/linter/Cargo.toml b/toolchains/solidity/linter/Cargo.toml new file mode 100644 index 00000000..89fee01d --- /dev/null +++ b/toolchains/solidity/linter/Cargo.toml @@ -0,0 +1,18 @@ +[package] +name = "solidhunter" +version = "0.0.1" +edition = "2021" +authors = ["Astrodevs Labs"] +license = "GPL-3.0-or-later" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] +clap = { version = "4.0.29", features = ["derive"] } +colored = "2" +serde = { version = "1.0.149", features = ["derive"] } +serde_json = "1.0.89" +solidhunter-lib = { path = "./solidhunter-lib" } +anyhow = "1.0" +glob = "0.3.0" +thiserror = "1.0" diff --git a/toolchains/solidity/linter/package.json b/toolchains/solidity/linter/package.json index 2fc3896b..71f7c970 100644 --- a/toolchains/solidity/linter/package.json +++ b/toolchains/solidity/linter/package.json @@ -6,8 +6,8 @@ "*" ], "scripts": { - "build": "echo 'building solidity linter...'", - "test": "echo 'testing solidity linter...'", + "build": "cargo build --release", + "test": "cargo test", "publish": "echo 'publishing solidity linter...'" } } diff --git a/toolchains/solidity/linter/solc-wrapper/.gitignore b/toolchains/solidity/linter/solc-wrapper/.gitignore new file mode 100644 index 00000000..ffa3bbd2 --- /dev/null +++ b/toolchains/solidity/linter/solc-wrapper/.gitignore @@ -0,0 +1 @@ +Cargo.lock \ No newline at end of file diff --git a/toolchains/solidity/linter/solc-wrapper/Cargo.toml b/toolchains/solidity/linter/solc-wrapper/Cargo.toml new file mode 100644 index 00000000..9735382b --- /dev/null +++ b/toolchains/solidity/linter/solc-wrapper/Cargo.toml @@ -0,0 +1,19 @@ +[package] +name = "solc-wrapper" +version = "0.1.0" +edition = "2021" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] +svm-rs = { git = "https://github.com/roynalnaruto/svm-rs", features = ["blocking"] } +home = "0.5.4" +semver = { version = "1.0.14", features = ["serde"] } +regex = "1.7.0" +once_cell = "1.16.0" +thiserror = "1.0" +serde_json = "1.0" +serde = { version = "1.0", features = ["derive"] } +open-fastrlp = "0.1.4" +hex = "0.4.3" +anyhow = "1.0" \ No newline at end of file diff --git a/toolchains/solidity/linter/solc-wrapper/src/ast/ast.rs b/toolchains/solidity/linter/solc-wrapper/src/ast/ast.rs new file mode 100644 index 00000000..915518e0 --- /dev/null +++ b/toolchains/solidity/linter/solc-wrapper/src/ast/ast.rs @@ -0,0 +1,2101 @@ +use std::collections::HashMap; +use std::fs::File; +use serde::{Serialize, Deserialize}; + +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] +pub enum StateMutability { + #[serde(rename = "payable")] + Payable, + + #[serde(rename = "pure")] + Pure, + + #[serde(rename = "nonpayable")] + NonPayable, + + #[serde(rename = "view")] + View, +} + +pub type SourceLocation = String; + +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] +pub enum Mutability { + #[serde(rename = "mutable")] + Mutable, + + #[serde(rename = "immutable")] + Immutable, + + #[serde(rename = "constant")] + Constant, +} + +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] +pub enum StorageLocation { + #[serde(rename = "default")] + Default, + + #[serde(rename = "storage")] + Storage, + + #[serde(rename = "memory")] + Memory, + + #[serde(rename = "calldata")] + Calldata, +} + +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] +pub enum Visibility { + #[serde(rename = "public")] + Public, + + #[serde(rename = "external")] + External, + + #[serde(rename = "internal")] + Internal, + + #[serde(rename = "private")] + Private, +} + +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] +pub enum AssignmentOperator { + #[serde(rename = "=")] + Equal, + + #[serde(rename = "+=")] + PlusEqual, + + #[serde(rename = "-=")] + MinusEqual, + + #[serde(rename = "*=")] + StarEqual, + + #[serde(rename = "/=")] + SlashEqual, + + #[serde(rename = "%=")] + PercentEqual, + + #[serde(rename = "|=")] + PipeEqual, + + #[serde(rename = "&=")] + AmpersandEqual, + + #[serde(rename = "^=")] + CaretEqual, + + #[serde(rename = ">>=")] + RightShiftEqual, + + #[serde(rename = "<<=")] + LeftShiftEqual, +} + +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] +pub enum BinaryOperator { + #[serde(rename = "+")] + Plus, + + #[serde(rename = "-")] + Minus, + + #[serde(rename = "*")] + Star, + + #[serde(rename = "/")] + Slash, + + #[serde(rename = "%")] + Percent, + + #[serde(rename = "**")] + DoubleStar, + + #[serde(rename = "&&")] + DoubleAmpersand, + + #[serde(rename = "||")] + DoublePipe, + + #[serde(rename = "!=")] + ExclamationEqual, + + #[serde(rename = "==")] + DoubleEqual, + + #[serde(rename = "<")] + LessThan, + + #[serde(rename = "<=")] + LessThanOrEqual, + + #[serde(rename = ">")] + GreaterThan, + + #[serde(rename = ">=")] + GreaterThanOrEqual, + + #[serde(rename = "^")] + Caret, + + #[serde(rename = "&")] + Ampersand, + + #[serde(rename = "|")] + Pipe, + + #[serde(rename = "<<")] + LeftShift, + + #[serde(rename = ">>")] + RightShift, +} + +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] +pub enum UnaryOperator { + #[serde(rename = "!")] + Exclamation, + + #[serde(rename = "-")] + Minus, + + #[serde(rename = "+")] + Plus, + + #[serde(rename = "++")] + DoublePlus, + + #[serde(rename = "--")] + DoubleMinus, + + #[serde(rename = "delete")] + Delete, +} + +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] +pub enum FunctionCallKind { + #[serde(rename = "functionCall")] + FunctionCall, + + #[serde(rename = "structConstructorCall")] + StructConstructorCall, + + #[serde(rename = "typeConversion")] + TypeConversion, +} + +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] +pub enum LiteralKind { + #[serde(rename = "number")] + Number, + + #[serde(rename = "string")] + String, + + #[serde(rename = "hexString")] + HexString, + + #[serde(rename = "unicodeString")] + UnicodeString, + + #[serde(rename = "bool")] + Bool, +} + +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] +pub enum FunctionDefinitionKind { + #[serde(rename = "function")] + Function, + + #[serde(rename = "constructor")] + Constructor, + + #[serde(rename = "fallback")] + Fallback, + + #[serde(rename = "receive")] + Receive, + + #[serde(rename = "modifier")] + Modifier, + + #[serde(rename = "event")] + Event, + + #[serde(rename = "freeFunction")] + FreeFunction +} + +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] +#[serde(untagged)] +pub enum TypeName { + ArrayTypeName(Box), + ElementaryTypeName(Box), + FunctionTypeName(Box), + Mapping(Box), + UserDefinedTypeName(Box), +} + +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] +#[serde(untagged)] +pub enum Expression { + Assignment(Box), + BinaryOperation(Box), + Conditional(Box), + ElementaryTypeNameExpression(Box), + FunctionCall(Box), + FunctionCallOptions(Box), + Identifier(Box), + IdentifierPath(Box), + IndexAccess(Box), + IndexRangeAccess(Box), + Literal(Box), + MemberAccess(Box), + NewExpression(Box), + TupleExpression(Box), + UnaryOperation(Box), +} + +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] +#[serde(untagged)] +pub enum Statement { + VariableDeclarationStatement(Box), + ForStatement(Box), + IfStatement(Box), + DoWhileStatement(Box), + Return(Box), + TryStatement(Box), + WhileStatement(Box), + UncheckedBlock(Box), + EmitStatement(Box), + RevertStatement(Box), + ExpressionStatement(Box), + Block(Box), + Continue(Box), + Break(Box), + PlaceholderStatement(Box), +} + +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] +pub enum NodeType { + // Expressions + Assignment, + BinaryOperation, + Conditional, + ElementaryTypeNameExpression, + FunctionCall, + FunctionCallOptions, + Identifier, + IdentifierPath, + IndexAccess, + IndexRangeAccess, + Literal, + MemberAccess, + NewExpression, + TupleExpression, + UnaryOperation, + + // Statements + Block, + Break, + Continue, + DoWhileStatement, + EmitStatement, + ExpressionStatement, + ForStatement, + IfStatement, + InlineAssembly, + PlaceholderStatement, + Return, + RevertStatement, + TryStatement, + UncheckedBlock, + VariableDeclarationStatement, + VariableDeclaration, + WhileStatement, + + // Definitions + ContractDefinition, + FunctionDefinition, + EventDefinition, + ErrorDefinition, + ModifierDefinition, + StructDefinition, + EnumDefinition, + EnumValue, + UserDefinedValueTypeDefinition, + + // Directives + PragmaDirective, + ImportDirective, + UsingForDirective, + + // Misc + SourceUnit, + InheritanceSpecifier, + ElementaryTypeName, + FunctionTypeName, + ParameterList, + TryCatchClause, + ModifierInvocation, + StructuredDocumentation, + UserDefinedTypeName, + OverrideSpecifier, + Mapping, + + /// An unknown AST node type. + Other(String), +} + +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] +pub struct EnumDefinition { + pub id: usize, + pub src: SourceLocation, + pub name: String, + #[serde(rename = "nameLocation", skip_serializing_if = "Option::is_none")] + pub name_location: Option, + #[serde(rename = "canonicalName")] + pub canonical_name: String, + pub members: Vec, + #[serde(rename = "nodeType")] + pub node_type: NodeType, +} + +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] +pub struct EnumValue { + pub id: usize, + pub src: SourceLocation, + pub name: String, + #[serde(rename = "nameLocation", skip_serializing_if = "Option::is_none")] + pub name_location: Option, + #[serde(rename = "nodeType")] + pub node_type: NodeType, +} + +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] +pub struct TypeDescriptions { + #[serde(rename = "typeIdentifier", skip_serializing_if = "Option::is_none")] + pub type_identifier: Option, + #[serde(rename = "typeString", skip_serializing_if = "Option::is_none")] + pub type_string: Option +} + +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] +pub struct StructuredDocumentation { + pub id: usize, + pub src: SourceLocation, + pub text: String, + #[serde(rename = "nodeType")] + pub node_type: NodeType, +} + +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] +pub struct StructureFunction { + pub function: IdentifierPath +} + +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] +#[serde(untagged)] +pub enum SourceUnitChildNodes { + ContractDefinition(Box), + StructDefinition(Box), + EnumDefinition(Box), + ErrorDefinition(Box), + PragmaDirective(Box), + ImportDirective(Box), + UsingForDirective(Box), + Other(String) +} + +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] +pub struct SourceUnit { + pub id: usize, + pub src: SourceLocation, + #[serde(rename = "absolutePath")] + pub absolute_path: String, + #[serde(rename = "exportedSymbols")] + pub exported_symbols: Option>>, + #[serde(rename = "license", skip_serializing_if = "Option::is_none")] + pub license: Option, + #[serde(rename = "nodes")] + pub nodes: Vec, + #[serde(rename = "nodeType")] + pub node_type: NodeType, +} + +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ContractDefinitionChildNodes { + FunctionDefinition(Box), + ModifierDefinition(Box), + StructDefinition(Box), + UserDefinedValueTypeDefinition(Box), + VariableDeclaration(Box), + EnumDefinition(Box), + ErrorDefinition(Box), + EventDefinition(Box), + UsingForDirective(Box), +} + +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] +pub enum ContractKind { + #[serde(rename = "contract")] + Contract, + #[serde(rename = "interface")] + Interface, + #[serde(rename = "library")] + Library, + Other(String) +} + +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] +pub struct ContractDefinition { + pub id: usize, + pub src: SourceLocation, + pub name: String, + #[serde(rename = "nameLocation", skip_serializing_if = "Option::is_none")] + pub name_location: Option, + #[serde(rename = "abstract")] + pub is_abstract: bool, + #[serde(rename = "baseContracts")] + pub base_contracts: Vec, + #[serde(rename = "canonicalName", skip_serializing_if = "Option::is_none")] + pub canonical_name: Option, + #[serde(rename = "contractDependencies")] + pub contract_dependencies: Vec, + #[serde(rename = "contractKind")] + pub contract_kind: ContractKind, + #[serde(rename = "documentation", skip_serializing_if = "Option::is_none")] + pub documentation: Option, + #[serde(rename = "fullyImplemented")] + pub is_fully_implemented: Option, + #[serde(rename = "linearizedBaseContracts")] + pub linearized_base_contracts: Option>, + #[serde(rename = "nodes")] + pub nodes: Vec, + #[serde(rename = "scope")] + pub scope: Option, + #[serde(rename = "usedErrors")] + pub used_errors: Vec, + #[serde(rename = "nodeType")] + pub node_type: NodeType, +} + +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] +#[serde(untagged)] +pub enum BaseName { + UserDefinedTypeName(UserDefinedTypeName), + IdentifierPath(IdentifierPath), +} + +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] +pub struct InheritanceSpecifier { + pub id: usize, + pub src: SourceLocation, + #[serde(rename = "arguments")] + pub arguments: Option>, + #[serde(rename = "baseName")] + pub base_name: BaseName, + #[serde(rename = "nodeType")] + pub node_type: NodeType, +} + +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] +pub struct Assignment { + pub id: usize, + pub src: SourceLocation, + #[serde(rename = "argumentTypes", skip_serializing_if = "Option::is_none")] + pub argument_types: Option>, + #[serde(rename = "isConstant")] + pub is_constant: Option, + #[serde(rename = "isLValue")] + pub is_l_value: Option, + #[serde(rename = "isPure")] + pub is_pure: Option, + #[serde(rename = "lValueRequested")] + pub l_value_requested: Option, + #[serde(rename = "typeDescriptions")] + pub type_descriptions: TypeDescriptions, + #[serde(rename = "leftHandSide")] + pub left_hand_side: Expression, + pub operator: AssignmentOperator, + #[serde(rename = "rightHandSide")] + pub right_hand_side: Expression, + #[serde(rename = "nodeType")] + pub node_type: NodeType, +} + +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] +pub struct BinaryOperation { + pub id: usize, + pub src: SourceLocation, + #[serde(rename = "argumentTypes", skip_serializing_if = "Option::is_none")] + pub argument_types: Option>, + #[serde(rename = "isConstant")] + pub is_constant: bool, + #[serde(rename = "isLValue")] + pub is_l_value: bool, + #[serde(rename = "isPure")] + pub is_pure: bool, + #[serde(rename = "lValueRequested")] + pub l_value_requested: bool, + #[serde(rename = "typeDescriptions")] + pub type_descriptions: TypeDescriptions, + #[serde(rename = "commonType")] + pub common_type: TypeDescriptions, + #[serde(rename = "leftExpression")] + pub left_expression: Expression, + pub operator: BinaryOperator, + #[serde(rename = "rightExpression")] + pub right_expression: Expression, + #[serde(rename = "nodeType")] + pub node_type: NodeType, +} + +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] +pub struct Conditional { + pub id: usize, + pub src: SourceLocation, + #[serde(rename = "argumentTypes", skip_serializing_if = "Option::is_none")] + pub argument_types: Option>, + #[serde(rename = "isConstant")] + pub is_constant: bool, + #[serde(rename = "isLValue")] + pub is_l_value: bool, + #[serde(rename = "isPure")] + pub is_pure: bool, + #[serde(rename = "lValueRequested")] + pub l_value_requested: bool, + #[serde(rename = "typeDescriptions")] + pub type_descriptions: TypeDescriptions, + #[serde(rename = "condition")] + pub condition: Expression, + #[serde(rename = "falseExpression")] + pub false_expression: Expression, + #[serde(rename = "trueExpression")] + pub true_expression: Expression, + #[serde(rename = "nodeType")] + pub node_type: NodeType, +} + +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] +pub struct ElementaryTypeNameExpression { + pub id: usize, + pub src: SourceLocation, + #[serde(rename = "argumentTypes", skip_serializing_if = "Option::is_none")] + pub argument_types: Option>, + #[serde(rename = "isConstant")] + pub is_constant: Option, + #[serde(rename = "isLValue")] + pub is_l_value: Option, + #[serde(rename = "isPure")] + pub is_pure: Option, + #[serde(rename = "lValueRequested")] + pub l_value_requested: Option, + #[serde(rename = "typeDescriptions")] + pub type_descriptions: TypeDescriptions, + #[serde(rename = "typeName")] + pub type_name: ElementaryTypeName, + #[serde(rename = "nodeType")] + pub node_type: NodeType, +} + +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] +pub struct ElementaryTypeName { + pub id: usize, + pub src: SourceLocation, + #[serde(rename = "typeDescriptions")] + pub type_descriptions: TypeDescriptions, + pub name: String, + #[serde(rename = "stateMutability")] + pub state_mutability: Option, + #[serde(rename = "nodeType")] + pub node_type: NodeType, +} + +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] +pub struct FunctionCall { + pub id: usize, + pub src: SourceLocation, + #[serde(rename = "argumentTypes", skip_serializing_if = "Option::is_none")] + pub argument_types: Option>, + #[serde(rename = "isConstant")] + pub is_constant: Option, + #[serde(rename = "isLValue")] + pub is_l_value: Option, + #[serde(rename = "isPure")] + pub is_pure: Option, + #[serde(rename = "lValueRequested")] + pub l_value_requested: Option, + #[serde(rename = "typeDescriptions")] + pub type_descriptions: TypeDescriptions, + #[serde(rename = "arguments")] + pub arguments: Vec, + #[serde(rename = "expression")] + pub expression: Expression, + pub kind: Option, + pub names: Vec, + #[serde(rename = "tryCall")] + pub try_call: bool, + #[serde(rename = "nodeType")] + pub node_type: NodeType, +} + +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] +pub struct FunctionCallOptions { + pub id: usize, + pub src: SourceLocation, + #[serde(rename = "argumentTypes", skip_serializing_if = "Option::is_none")] + pub argument_types: Option>, + #[serde(rename = "isConstant")] + pub is_constant: Option, + #[serde(rename = "isLValue")] + pub is_l_value: Option, + #[serde(rename = "isPure")] + pub is_pure: Option, + #[serde(rename = "lValueRequested")] + pub l_value_requested: Option, + #[serde(rename = "typeDescriptions")] + pub type_descriptions: TypeDescriptions, + pub expression: Expression, + pub names: Vec, + pub options: Vec, + #[serde(rename = "nodeType")] + pub node_type: NodeType, +} + +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] +pub struct Identifier { + pub id: usize, + pub src: SourceLocation, + #[serde(rename = "argumentTypes", skip_serializing_if = "Option::is_none")] + pub argument_types: Option>, + pub name: String, + #[serde(rename = "overloadedDeclarations")] + pub overloaded_declarations: Vec, + #[serde(rename = "referencedDeclaration")] + pub referenced_declaration: Option, + #[serde(rename = "typeDescriptions")] + pub type_descriptions: TypeDescriptions, + #[serde(rename = "nodeType")] + pub node_type: NodeType, +} + +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] +pub struct IndexAccess { + pub id: usize, + pub src: SourceLocation, + #[serde(rename = "argumentTypes", skip_serializing_if = "Option::is_none")] + pub argument_types: Option>, + #[serde(rename = "isConstant")] + pub is_constant: Option, + #[serde(rename = "isLValue")] + pub is_l_value: Option, + #[serde(rename = "isPure")] + pub is_pure: Option, + #[serde(rename = "lValueRequested")] + pub l_value_requested: Option, + #[serde(rename = "typeDescriptions")] + pub type_descriptions: TypeDescriptions, + #[serde(rename = "baseExpression")] + pub base_expression: Expression, + #[serde(rename = "indexExpression", skip_serializing_if = "Option::is_none")] + pub index_expression: Option, + #[serde(rename = "nodeType")] + pub node_type: NodeType, +} + +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] +pub struct IndexRangeAccess { + pub id: usize, + pub src: SourceLocation, + #[serde(rename = "argumentTypes", skip_serializing_if = "Option::is_none")] + pub argument_types: Option>, + #[serde(rename = "isConstant")] + pub is_constant: Option, + #[serde(rename = "isLValue")] + pub is_l_value: Option, + #[serde(rename = "isPure")] + pub is_pure: Option, + #[serde(rename = "lValueRequested")] + pub l_value_requested: Option, + #[serde(rename = "typeDescriptions")] + pub type_descriptions: TypeDescriptions, + #[serde(rename = "baseExpression")] + pub base_expression: Expression, + #[serde(rename = "endExpression", skip_serializing_if = "Option::is_none")] + pub end_expression: Option, + #[serde(rename = "startExpression", skip_serializing_if = "Option::is_none")] + pub start_expression: Option, + #[serde(rename = "nodeType")] + pub node_type: NodeType, +} + +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] +pub struct Literal { + pub id: usize, + pub src: SourceLocation, + #[serde(rename = "argumentTypes", skip_serializing_if = "Option::is_none")] + pub argument_types: Option>, + #[serde(rename = "isConstant")] + pub is_constant: Option, + #[serde(rename = "isLValue")] + pub is_l_value: Option, + #[serde(rename = "isPure")] + pub is_pure: Option, + #[serde(rename = "lValueRequested")] + pub l_value_requested: Option, + #[serde(rename = "typeDescriptions")] + pub type_descriptions: TypeDescriptions, + #[serde(rename = "hexValue")] + pub hex_value: String, + pub kind: LiteralKind, + //#[serde(rename = "subdenomination", skip_serializing_if = "Option::is_none")] + //subdenomination: Option, + pub value: Option, + #[serde(rename = "nodeType")] + pub node_type: NodeType, +} + +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] +pub struct MemberAccess { + pub id: usize, + pub src: SourceLocation, + #[serde(rename = "argumentTypes", skip_serializing_if = "Option::is_none")] + pub argument_types: Option>, + #[serde(rename = "isConstant")] + pub is_constant: Option, + #[serde(rename = "isLValue")] + pub is_l_value: Option, + #[serde(rename = "isPure")] + pub is_pure: Option, + #[serde(rename = "lValueRequested")] + pub l_value_requested: Option, + #[serde(rename = "typeDescriptions")] + pub type_descriptions: TypeDescriptions, + #[serde(rename = "expression")] + pub expression: Expression, + #[serde(rename = "memberLocation")] + pub member_location: SourceLocation, + #[serde(rename = "memberName")] + pub member_name: String, + #[serde(rename = "referencedDeclaration")] + pub referenced_declaration: Option, + #[serde(rename = "nodeType")] + pub node_type: NodeType, +} + +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] +pub struct NewExpression { + pub id: usize, + pub src: SourceLocation, + #[serde(rename = "argumentTypes", skip_serializing_if = "Option::is_none")] + pub argument_types: Option>, + #[serde(rename = "isConstant")] + pub is_constant: Option, + #[serde(rename = "isLValue")] + pub is_l_value: Option, + #[serde(rename = "isPure")] + pub is_pure: Option, + #[serde(rename = "lValueRequested")] + pub l_value_requested: Option, + #[serde(rename = "typeDescriptions")] + pub type_descriptions: TypeDescriptions, + #[serde(rename = "typeName")] + pub type_name: TypeName, + #[serde(rename = "nodeType")] + pub node_type: NodeType, +} + +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] +pub struct ArrayTypeName { + pub id: usize, + pub src: SourceLocation, + #[serde(rename = "typeDescriptions")] + pub type_descriptions: TypeDescriptions, + #[serde(rename = "baseType")] + pub base_type: TypeName, + pub length: Option, + #[serde(rename = "nodeType")] + pub node_type: NodeType, +} + +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] +pub struct FunctionTypeName { + id : usize, + pub src: SourceLocation, + #[serde(rename = "typeDescriptions")] + pub type_descriptions: TypeDescriptions, + #[serde(rename = "parameterTypes")] + pub parameter_types: ParameterList, + #[serde(rename = "returnParameterTypes")] + pub return_parameter_types: ParameterList, + #[serde(rename = "stateMutability")] + pub state_mutability: StateMutability, + pub visibility: Visibility, + #[serde(rename = "nodeType")] + pub node_type: NodeType, +} + +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] +pub struct ParameterList { + pub id: usize, + pub src: SourceLocation, + pub parameters: Vec, + #[serde(rename = "nodeType")] + pub node_type: NodeType, +} + +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] +pub struct VariableDeclaration { + pub id: usize, + pub src: SourceLocation, + pub name: String, + #[serde(rename = "nameLocation")] + pub name_location: Option, + #[serde(rename = "baseFunctions", skip_serializing_if = "Option::is_none")] + pub base_functions: Option>, + #[serde(rename = "constant")] + pub is_constant: bool, + pub documentation: Option, + #[serde(rename = "functionSelector")] + pub function_selector: Option, + pub indexed: Option, + pub mutability: Mutability, + pub overrides: Option, + pub scope: Option, + #[serde(rename = "stateVariable")] + pub state_variable: bool, + #[serde(rename = "storageLocation")] + pub storage_location: StorageLocation, + #[serde(rename = "typeDescriptions")] + pub type_descriptions: TypeDescriptions, + #[serde(rename = "typeName", skip_serializing_if = "Option::is_none")] + pub type_name: Option, + #[serde(rename = "value", skip_serializing_if = "Option::is_none")] + pub value: Option, + pub visibility: Visibility, + #[serde(rename = "nodeType")] + pub node_type: NodeType, +} + +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] +#[serde(untagged)] +pub enum OverridesEnum { + UserDefinedTypeName(Vec), + Identifier(Vec), +} + +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] +pub struct OverrideSpecifier { + pub id: usize, + pub src: SourceLocation, + pub overrides: OverridesEnum, + #[serde(rename = "nodeType")] + pub node_type: NodeType, +} + +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] +pub struct UserDefinedTypeName { + pub id: usize, + pub src: SourceLocation, + #[serde(rename = "typeDescriptions")] + pub type_descriptions: TypeDescriptions, + //#[serde(rename = "contractScope")] + //contract_scope: Option, + pub name: Option, + #[serde(rename = "pathNode")] + pub path_node: Option, + #[serde(rename = "referencedDeclaration")] + pub referenced_declaration: Option, + #[serde(rename = "nodeType")] + pub node_type: NodeType, +} + +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] +pub struct IdentifierPath { + pub id: usize, + pub src: SourceLocation, + pub name: String, + #[serde(rename = "nameLocations")] + pub name_locations: Option>, + #[serde(rename = "referencedDeclaration")] + pub referenced_declaration: Option, + #[serde(rename = "nodeType")] + pub node_type: NodeType, +} + +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] +pub struct Mapping { + pub id: usize, + pub src: SourceLocation, + #[serde(rename = "typeDescriptions")] + pub type_descriptions: TypeDescriptions, + #[serde(rename = "keyType")] + pub key_type: TypeName, + #[serde(rename = "valueType")] + pub value_type: TypeName, + #[serde(rename = "nodeType")] + pub node_type: NodeType, +} + +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] +pub struct TupleExpression { + pub id: usize, + pub src: SourceLocation, + #[serde(rename = "argumentTypes")] + pub argument_types: Option>, + #[serde(rename = "isConstant")] + pub is_constant: Option, + #[serde(rename = "isLValue")] + pub is_l_value: Option, + #[serde(rename = "isPure")] + pub is_pure: Option, + #[serde(rename = "lValueRequested")] + pub l_value_requested: Option, + #[serde(rename = "typeDescriptions")] + pub type_descriptions: TypeDescriptions, + pub components: Vec, + #[serde(rename = "isInlineArray")] + pub is_inline_array: bool, + #[serde(rename = "nodeType")] + pub node_type: NodeType, +} + +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] +pub struct UnaryOperation { + pub id: usize, + pub src: SourceLocation, + #[serde(rename = "argumentTypes")] + pub argument_types: Option>, + #[serde(rename = "isConstant")] + pub is_constant: Option, + #[serde(rename = "isLValue")] + pub is_l_value: Option, + #[serde(rename = "isPure")] + pub is_pure: Option, + #[serde(rename = "lValueRequested")] + pub l_value_requested: Option, + #[serde(rename = "typeDescriptions")] + pub type_descriptions: TypeDescriptions, + #[serde(rename = "operator")] + pub operator: UnaryOperator, + pub prefix: bool, + #[serde(rename = "subExpression")] + pub sub_expression: Expression, + #[serde(rename = "nodeType")] + pub node_type: NodeType, +} + +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] +pub struct ErrorDefinition { + pub id: usize, + pub src: SourceLocation, + pub name: String, + #[serde(rename = "nameLocation")] + pub name_location: String, + pub documentation: Option, + #[serde(rename = "errorSelector")] + pub error_selector: Option, + pub parameters: Option, + #[serde(rename = "nodeType")] + pub node_type: NodeType, +} + +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] +pub struct EventDefinition { + pub id: usize, + pub src: SourceLocation, + pub name: String, + #[serde(rename = "nameLocation")] + pub name_location: Option, + pub anonymous: bool, + #[serde(rename = "eventSelector")] + pub event_selector: Option, + pub documentation: Option, + pub parameters: Option, + #[serde(rename = "nodeType")] + pub node_type: NodeType, +} + +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] +pub struct FunctionDefinition { + pub id: usize, + pub src: SourceLocation, + pub name: String, + #[serde(rename = "nameLocation")] + pub name_location: Option, + #[serde(rename = "baseFunctions")] + pub base_functions: Option>, + pub body: Option, + #[serde(rename = "documentation")] + pub documentation: Option, + #[serde(rename = "functionSelector")] + pub function_selector: Option, + pub implemented: bool, + pub kind: FunctionDefinitionKind, + pub modifiers: Vec, + pub overrides: Option, + pub parameters: ParameterList, + #[serde(rename = "returnParameters")] + pub return_parameters: ParameterList, + #[serde(rename = "scope")] + pub scope: Option, + #[serde(rename = "stateMutability")] + pub state_mutability: StateMutability, + #[serde(rename = "virtual")] + pub is_virtual: bool, + pub visibility: Option, + #[serde(rename = "nodeType")] + pub node_type: NodeType, +} + +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] +pub struct Block { + pub id: usize, + pub src: SourceLocation, + pub documentation: Option, + pub statements: Option>, + #[serde(rename = "nodeType")] + pub node_type: NodeType, +} + + +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] +pub struct Break { + pub id: usize, + pub src: SourceLocation, + pub documentation: Option, + #[serde(rename = "nodeType")] + pub node_type: NodeType, +} + +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] +pub struct Continue { + pub id: usize, + pub src: SourceLocation, + pub documentation: Option, + #[serde(rename = "nodeType")] + pub node_type: NodeType, +} + +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] +#[serde(untagged)] +pub enum Body { + Block(Box), + Statement(Box), +} + +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] +pub struct DoWhileStatement { + pub id: usize, + pub src: SourceLocation, + pub documentation: Option, + #[serde(rename = "condition")] + pub condition: Expression, + #[serde(rename = "body")] + pub body: Body, + #[serde(rename = "nodeType")] + pub node_type: NodeType, +} + +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] +pub struct EmitStatement { + pub id: usize, + pub src: SourceLocation, + pub documentation: Option, + #[serde(rename = "eventCall")] + pub event_call: FunctionCall, + #[serde(rename = "nodeType")] + pub node_type: NodeType, +} + +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] +pub struct ExpressionStatement { + pub id: usize, + pub src: SourceLocation, + pub documentation: Option, + pub expression: Expression, + #[serde(rename = "nodeType")] + pub node_type: NodeType, +} + +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] +#[serde(untagged)] +pub enum InitializationExpression { + ExpressionStatement(ExpressionStatement), + VariableDeclarationStatement(VariableDeclarationStatement) +} + +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] +pub struct ForStatement { + pub id: usize, + pub src: SourceLocation, + pub documentation: Option, + pub body: Body, + pub condition: Option, + #[serde(rename = "initializationExpression")] + pub initialization_expression: Option, + #[serde(rename = "loopExpression")] + pub loop_expression: Option, + #[serde(rename = "nodeType")] + pub node_type: NodeType, +} + +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] +pub struct VariableDeclarationStatement { + pub id: usize, + pub src: SourceLocation, + pub documentation: Option, + pub assignments: Vec>, + #[serde(rename = "declarations")] + pub declarations: Vec>, + #[serde(rename = "initialValue")] + pub initial_value: Option, + #[serde(rename = "nodeType")] + pub node_type: NodeType, +} + +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] +pub struct IfStatement { + pub id: usize, + pub src: SourceLocation, + pub documentation: Option, + #[serde(rename = "condition")] + pub condition: Expression, + #[serde(rename = "trueBody")] + pub true_body: Body, + #[serde(rename = "falseBody")] + pub false_body: Option, + #[serde(rename = "nodeType")] + pub node_type: NodeType, +} + +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] +pub struct PlaceholderStatement { + pub id: usize, + pub src: SourceLocation, + pub documentation: Option, + #[serde(rename = "nodeType")] + pub node_type: NodeType, +} + +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] +pub struct Return { + pub id: usize, + pub src: SourceLocation, + pub documentation: Option, + pub expression: Option, + #[serde(rename = "functionReturnParameters")] + pub function_return_parameters: Option, + #[serde(rename = "nodeType")] + pub node_type: NodeType, +} + +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] +pub struct RevertStatement { + pub id: usize, + pub src: SourceLocation, + pub documentation: Option, + #[serde(rename = "errorCall")] + pub error_call: Statement, + #[serde(rename = "nodeType")] + pub node_type: NodeType, +} + +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] +pub struct TryStatement { + pub id: usize, + pub src: SourceLocation, + pub documentation: Option, + pub clauses: Vec, + #[serde(rename = "externalCall")] + pub external_call: Expression, + #[serde(rename = "nodeType")] + pub node_type: NodeType, +} + +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] +pub struct TryCatchClause { + pub id: usize, + pub src: SourceLocation, + pub block: Block, + #[serde(rename = "errorName")] + pub error_name: String, + pub parameters: Option, + #[serde(rename = "nodeType")] + pub node_type: NodeType, +} + +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] +pub struct UncheckedBlock { + pub id: usize, + pub src: SourceLocation, + pub documentation: Option, + pub statements: Vec, + #[serde(rename = "nodeType")] + pub node_type: NodeType, +} + +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] +pub struct WhileStatement { + pub id: usize, + pub src: SourceLocation, + pub documentation: Option, + pub body: Statement, + pub condition: Expression, + #[serde(rename = "nodeType")] + pub node_type: NodeType, +} + +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ModifierName { + Identifier(Identifier), + IdentifierPath(IdentifierPath), +} + +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] +pub enum ModifierInvocationKind { + #[serde(rename = "modifierInvocation")] + ModifierInvocation, + #[serde(rename = "baseConstructorSpecifier")] + BaseConstructorSpecifier, +} + +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] +pub struct ModifierInvocation { + pub id: usize, + pub src: SourceLocation, + pub arguments: Option, + pub kind: Option, + #[serde(rename = "modifierName")] + pub modifier_name: ModifierName, + #[serde(rename = "nodeType")] + pub node_type: NodeType, +} + +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] +pub struct ModifierDefinition { + pub id: usize, + pub src: SourceLocation, + pub name: String, + #[serde(rename = "nameLocation")] + pub name_location: Option, + #[serde(rename = "baseModifiers")] + pub base_modifiers: Option>, + pub body: Statement, + pub documentation: Option, + pub overrides: Option, + pub parameters: ParameterList, + #[serde(rename = "virtual")] + pub is_virtual: bool, + pub visibility: Visibility, + #[serde(rename = "nodeType")] + pub node_type: NodeType, +} + +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] +pub struct StructDefinition { + pub id: usize, + pub src: SourceLocation, + pub name: String, + #[serde(rename = "nameLocation")] + pub name_location: Option, + #[serde(rename = "canonicalName")] + pub canonical_name: String, + pub members: Vec, + pub scope: usize, + pub visibility: Visibility, + #[serde(rename = "nodeType")] + pub node_type: NodeType, +} + +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] +pub struct UserDefinedValueTypeDefinition { + pub id: usize, + pub src: SourceLocation, + pub name: String, + #[serde(rename = "nameLocation")] + pub name_location: Option, + #[serde(rename = "canonicalName")] + pub canonical_name: Option, + #[serde(rename = "underlyingType")] + pub underlying_type: TypeName, + #[serde(rename = "nodeType")] + pub node_type: NodeType, +} + +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] +pub struct UsingForDirective { + pub id: usize, + pub src: SourceLocation, + #[serde(rename = "functionList")] + pub function_list: Option>, + pub function: Option, + pub global: Option, + #[serde(rename = "libraryName")] + pub library_name: Option, + #[serde(rename = "typeName")] + pub type_name: Option, + #[serde(rename = "nodeType")] + pub node_type: NodeType, +} + +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] +pub struct SymbolAlias { + pub foreign: Identifier, + pub local: Option, + pub name_location: Option, +} + +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] +pub struct ImportDirective { + pub id: usize, + pub src: SourceLocation, + #[serde(rename = "absolutePath")] + pub absolute_path: String, + pub file: String, + #[serde(rename = "nameLocation")] + pub name_location: Option, + pub scope: Option, + #[serde(rename = "sourceUnit")] + pub source_unit: Option, + #[serde(rename = "symbolAliases")] + pub symbol_aliases: Vec, + #[serde(rename = "unitAlias")] + pub unit_alias: String, + #[serde(rename = "nodeType")] + pub node_type: NodeType, +} + +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] +pub struct PragmaDirective { + pub id: usize, + pub src: SourceLocation, + pub literals: Vec, + #[serde(rename = "nodeType")] + pub node_type: NodeType, +} + +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] +pub enum EvmVersion { + #[serde(rename = "homestead")] + Homestead, + #[serde(rename = "tangerineWhistle")] + TangerineWhistle, + #[serde(rename = "spuriousDragon")] + SpuriousDragon, + #[serde(rename = "byzantium")] + Byzantium, + #[serde(rename = "constantinople")] + Constantinople, + #[serde(rename = "petersburg")] + Petersburg, + #[serde(rename = "istanbul")] + Istanbul, + #[serde(rename = "berlin")] + Berlin, + #[serde(rename = "london")] + London, +} + +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] +pub enum Suffix { + #[serde(rename = "slot")] + Slot, + #[serde(rename = "offset")] + Offset +} + +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] +pub struct ExternalReference { + pub declaration: usize, + #[serde(rename = "isOffset")] + pub is_offset: bool, + #[serde(rename = "isSlot")] + pub is_slot: bool, + pub src: SourceLocation, + #[serde(rename = "valueSize")] + pub value_size: usize, + pub suffix: Option +} + +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] +pub struct InlineAssembly { + pub id: usize, + pub src: SourceLocation, + pub documentation: Option, + #[serde(rename = "evmVersion")] + pub evm_version: EvmVersion, + #[serde(rename = "externalReferences")] + pub external_references: Vec, + pub flags: Option>, + #[serde(rename = "nodeType")] + pub node_type: NodeType +} + +#[derive(Debug, Clone, PartialEq, Eq)] +pub struct CodeLocation { + pub line: usize, + pub column: usize, + pub length: usize, +} + +pub fn get_line_from_offset(content: &str, offset: usize) -> (usize, usize) { + let mut nb_line = 1; + let mut tmp = offset; + + for line in content.split('\n') { + if line.len() < tmp { + tmp -= line.len() + 1; + nb_line += 1; + continue; + } + return (nb_line, tmp); + } + return (0, 0); +} + +pub fn decode_begin_location(src: &str, content: &str) -> CodeLocation { + let mut split = src.split(':'); + let offset = split.next().unwrap().parse().unwrap(); + let (line, column) = get_line_from_offset(&content, offset); + let length = split.next().unwrap().parse().unwrap(); + CodeLocation { line, column, length } +} + +pub fn decode_end_location(src: &str, content: &str) -> CodeLocation { + let mut split = src.split(':'); + let offset = split.next().unwrap().parse().unwrap(); + let (line, _column) = get_line_from_offset(&content, offset); + let length = split.next().unwrap().parse().unwrap(); + let extract = content[offset..offset + length].to_string(); + let (diff_line, new_column) = get_line_from_offset(&extract, length); + CodeLocation { + line: line + diff_line, + column: new_column, + length + } +} + +pub fn offset_from_location(content: &str, location: &CodeLocation) -> usize { + let mut offset = 0; + + for (i, line) in content.split('\n').enumerate() { + if i == location.line - 1 { + return offset + location.column; + } + offset += line.len() + 1; + } + offset +} + +pub fn decode_location(src: &str, content: &str) -> (CodeLocation, CodeLocation) { + (decode_begin_location(src, content), decode_end_location(src, content)) +} + +#[cfg(test)] +mod tests { + use std::fs; + use super::*; + + #[test] + fn test_correct_EnumValue_parsing() -> Result<(), String> { + let ast = fs::read_to_string("../solc-wrapper/tests/files/ast/EnumValue.json").expect("Could not find test data file"); + let res = serde_json::from_str::(&ast).map_err(|_| "Error deserializing EnumValue".to_string())?; + assert_eq!(res.name, "item1"); + assert_eq!(res.name_location, Some("72:5:0".to_string())); + Ok(assert_eq!(res.node_type, NodeType::EnumValue)) + } + + #[test] + fn test_correct_enum_definition_parsing() -> Result<(), String> { + let ast = fs::read_to_string("../solc-wrapper/tests/files/ast/EnumDefinition.json").expect("Could not find test data file"); + let res = serde_json::from_str::(&ast).map_err(|_| "Error deserializing EnumDefinition".to_string())?; + assert_eq!(res.canonical_name, "Test"); + assert_eq!(res.name_location, Some("66:4:0".to_string())); + Ok(assert_eq!(res.node_type, NodeType::EnumDefinition)) + } + + #[test] + fn test_correct_event_definition_parsing() -> Result<(), String> { + let ast = fs::read_to_string("../solc-wrapper/tests/files/ast/EventDefinition.json").expect("Could not find test data file"); + let res = serde_json::from_str::(&ast).map_err(|_| "Error deserializing EventDefinition".to_string())?; + assert_eq!(res.anonymous, false); + assert_eq!(res.id, 67); + assert_eq!(res.name, "MintingLocked".to_string()); + assert_eq!(res.src, "1582:45:0".to_string()); + assert_eq!(res.name_location, Some("1588:13:0".to_string())); + Ok(assert_eq!(res.node_type, NodeType::EventDefinition)) + } + + #[test] + fn test_correct_return_parsing() -> Result<(), String> { + let ast = fs::read_to_string("../solc-wrapper/tests/files/ast/Return.json").expect("Could not find test data file"); + let res = serde_json::from_str::(&ast).map_err(|_| "Error deserializing Return".to_string())?; + assert_eq!(res.id, 296); + assert_eq!(res.src, "5761:19:0".to_string()); + Ok(assert_eq!(res.node_type, NodeType::Return)) + } + + #[test] + fn test_correct_emit_statement_parsing() -> Result<(), String> { + let ast = fs::read_to_string("../solc-wrapper/tests/files/ast/EmitStatement.json").expect("Could not find test data file"); + let res = serde_json::from_str::(&ast).map_err(|_| "Error deserializing EmitStatement".to_string())?; + assert_eq!(res.id, 287); + assert_eq!(res.src, "5537:33:0".to_string()); + Ok(assert_eq!(res.node_type, NodeType::EmitStatement)) + } + + #[test] + fn test_correct_modifier_invocation_parsing() -> Result<(), String> { + let ast = fs::read_to_string("../solc-wrapper/tests/files/ast/ModifierInvocation.json").expect("Could not find test data file"); + let res = serde_json::from_str::(&ast).map_err(|_| "Error deserializing ModifierInvocation".to_string())?; + + assert_eq!(res.id, 274); + assert_eq!(res.src, "5445:13:0".to_string()); + Ok(assert_eq!(res.node_type, NodeType::ModifierInvocation)) + } + + #[test] + fn test_correct_pragma_directive_parsing() -> Result<(), String> { + let ast = fs::read_to_string("../solc-wrapper/tests/files/ast/PragmaDirective.json").expect("Could not find test data file"); + let res = serde_json::from_str::(&ast).map_err(|_| "Error deserializing PragmaDirective".to_string())?; + assert_eq!(res.id, 1); + assert_eq!(res.src, "33:23:0".to_string()); + assert_eq!(res.literals, vec!["solidity".to_string(), + "0.8".to_string(), + ".16".to_string()] as Vec); + Ok(assert_eq!(res.node_type, NodeType::PragmaDirective)) + } + + #[test] + fn test_correct_tuple_expression_parsing() -> Result<(), String> { + let ast = fs::read_to_string("../solc-wrapper/tests/files/ast/TupleExpression.json").expect("Could not find test data file"); + let res = serde_json::from_str::(&ast).map_err(|_| "Error deserializing TupleExpression".to_string())?; + assert_eq!(res.id, 16); + assert_eq!(res.src, "150:12:0".to_string()); + assert_eq!(res.is_inline_array, false); + Ok(assert_eq!(res.node_type, NodeType::TupleExpression)) + } + + #[test] + fn test_correct_using_for_directive_parsing() -> Result<(), String> { + let ast = fs::read_to_string("../solc-wrapper/tests/files/ast/UsingForDirective.json").expect("Could not find test data file"); + let res = serde_json::from_str::(&ast).map_err(|_| "Error deserializing UsingForDirective".to_string())?; + assert_eq!(res.id, 31); + assert_eq!(res.global, Some(false)); + assert_eq!(res.src, "1007:36:0".to_string()); + Ok(assert_eq!(res.node_type, NodeType::UsingForDirective)) + } + + #[test] + fn test_correct_modifier_definition_parsing() -> Result<(), String> { + let ast = fs::read_to_string("../solc-wrapper/tests/files/ast/ModifierDefinition.json").expect("Could not find test data file"); + let res = serde_json::from_str::(&ast).map_err(|_| "Error deserializing ModifierDefinition".to_string())?; + assert_eq!(res.id, 92); + assert_eq!(res.name, "metadataNotLocked".to_string()); + assert_eq!(res.name_location, Some("1995:17:0".to_string())); + assert_eq!(res.src, "1986:104:0".to_string()); + assert_eq!(res.is_virtual, false); + assert_eq!(res.visibility, Visibility::Internal); + Ok(assert_eq!(res.node_type, NodeType::ModifierDefinition)) + } + + #[test] + fn test_correct_parameter_list_parsing() -> Result<(), String> { + let ast = fs::read_to_string("../solc-wrapper/tests/files/ast/ParameterList.json").expect("Could not find test data file"); + let res = serde_json::from_str::(&ast).map_err(|_| "Error deserializing ParameterList".to_string())?; + assert_eq!(res.id, 197); + assert_eq!(res.src, "3904:30:0".to_string()); + Ok(assert_eq!(res.node_type, NodeType::ParameterList)) + } + + #[test] + fn test_correct_assignment_list_parsing() -> Result<(), String> { + let ast = fs::read_to_string("../solc-wrapper/tests/files/ast/Assignment.json").expect("Could not find test data file"); + let res = serde_json::from_str::(&ast).map_err(|_| "Error deserializing Assignment".to_string())?; + + assert_eq!(res.id, 141); + assert_eq!(res.src, "2849:35:0".to_string()); + assert_eq!(res.operator, AssignmentOperator::Equal); + Ok(assert_eq!(res.node_type, NodeType::Assignment)) + } + + #[test] + fn test_correct_inheritance_specifier_parsing() -> Result<(), String> { + let ast = fs::read_to_string("../solc-wrapper/tests/files/ast/InheritanceSpecifier.json").expect("Could not find test data file"); + let res = serde_json::from_str::(&ast).map_err(|_| "Error deserializing InheritanceSpecifier".to_string())?; + + assert_eq!(res.id, 13); + assert_eq!(res.src, "828:16:0".to_string()); + Ok(assert_eq!(res.node_type, NodeType::InheritanceSpecifier)) + } + + #[test] + fn test_correct_variable_declaration_parsing() -> Result<(), String> { + let ast = fs::read_to_string("../solc-wrapper/tests/files/ast/VariableDeclaration.json").expect("Could not find test data file"); + let res = serde_json::from_str::(&ast).map_err(|_| "Error deserializing VariableDeclaration".to_string())?; + assert_eq!(res.is_constant, false); + assert_eq!(res.id, 293); + assert_eq!(res.mutability, Mutability::Mutable); + assert_eq!(res.src, "5736:13:0".to_string()); + assert_eq!(res.name_location, Some("-1:-1:-1".to_string())); + assert_eq!(res.state_variable, false); + assert_eq!(res.storage_location, StorageLocation::Memory); + assert_eq!(res.visibility, Visibility::Internal); + Ok(assert_eq!(res.node_type, NodeType::VariableDeclaration)) + } + + #[test] + fn test_correct_if_statement_parsing() -> Result<(), String> { + let ast = fs::read_to_string("../solc-wrapper/tests/files/ast/IfStatement.json").expect("Could not find test data file"); + let res = serde_json::from_str::(&ast).map_err(|_| "Error deserializing IfStatement".to_string())?; + assert_eq!(res.id, 19); + assert_eq!(res.src, "145:103:0".to_string()); + Ok(assert_eq!(res.node_type, NodeType::IfStatement)) + } + + #[test] + fn test_correct_binary_operation_parsing() -> Result<(), String> { + let ast = fs::read_to_string("../solc-wrapper/tests/files/ast/BinaryOperation.json").expect("Could not find test data file"); + let res = serde_json::from_str::(&ast).map_err(|_| "Error deserializing TypeDescriptions".to_string())?; + + assert_eq!(res.id, 18); + assert_eq!(res.src, "203:5:0".to_string()); + assert_eq!(res.argument_types, None); + assert_eq!(res.is_constant, false); + assert_eq!(res.is_l_value, false); + assert_eq!(res.is_pure, false); + assert_eq!(res.l_value_requested, false); + assert_eq!(res.operator, BinaryOperator::Ampersand); + Ok(assert_eq!(res.node_type, NodeType::BinaryOperation)) + } + + #[test] + fn test_correct_unary_operation_parsing() -> Result<(), String> { + let ast = fs::read_to_string("../solc-wrapper/tests/files/ast/UnaryOperation.json").expect("Could not find test data file"); + let res = serde_json::from_str::(&ast).map_err(|_| "Error deserializing UnaryOperation".to_string())?; + + assert_eq!(res.id, 7); + assert_eq!(res.src, "104:6:0".to_string()); + assert_eq!(res.operator, UnaryOperator::DoublePlus); + assert_eq!(res.prefix, false); + Ok(assert_eq!(res.node_type, NodeType::UnaryOperation)) + } + + #[test] + fn test_correct_unchecked_block_parsing() -> Result<(), String> { + let ast = fs::read_to_string("../solc-wrapper/tests/files/ast/UncheckedBlock.json").expect("Could not find test data file"); + let res = serde_json::from_str::(&ast).map_err(|_| "Error deserializing UncheckedBlock".to_string())?; + + assert_eq!(res.id, 9); + assert_eq!(res.src, "104:21:0".to_string()); + Ok(assert_eq!(res.node_type, NodeType::UncheckedBlock)) + } + + #[test] + fn test_correct_identifier_parsing() -> Result<(), String> { + let ast = fs::read_to_string("../solc-wrapper/tests/files/ast/Identifier.json").expect("Could not find test data file"); + let res = serde_json::from_str::(&ast).map_err(|_| "Error deserializing TypeDescriptions".to_string())?; + + assert_eq!(res.id, 16); + assert_eq!(res.src, "203:1:0".to_string()); + assert_eq!(res.name, "a".to_string()); + assert_eq!(res.overloaded_declarations, vec![] as Vec); + assert_eq!(res.referenced_declaration, Some(7)); + Ok(assert_eq!(res.node_type, NodeType::Identifier)) + } + + #[test] + fn test_correct_conditional_parsing() -> Result<(), String> { + let ast = fs::read_to_string("../solc-wrapper/tests/files/ast/Conditional.json").expect("Could not find test data file"); + let res = serde_json::from_str::(&ast).map_err(|_| "Error deserializing Conditional".to_string())?; + + assert_eq!(res.id, 10); + assert_eq!(res.src, "158:20:0".to_string()); + assert_eq!(res.is_constant, false); + assert_eq!(res.is_l_value, false); + assert_eq!(res.is_pure, true); + assert_eq!(res.l_value_requested, false); + assert_eq!(res.node_type, NodeType::Conditional); + Ok(()) + } + + #[test] + fn test_correct_type_descriptions_parsing() -> Result<(), String> { + let ast = fs::read_to_string("../solc-wrapper/tests/files/ast/TypeDescriptions.json").expect("Could not find test data file"); + let res = serde_json::from_str::(&ast).map_err(|_| "Error deserializing Conditional".to_string())?; + + assert_eq!(res.type_identifier, Some("t_bool".to_string())); + assert_eq!(res.type_string, Some("bool".to_string())); + Ok(()) + } + + #[test] + fn test_correct_elementary_type_name_parsing() -> Result<(), String> { + let ast = fs::read_to_string("../solc-wrapper/tests/files/ast/ElementaryTypeName.json").expect("Could not find test data file"); + let res = serde_json::from_str::(&ast).map_err(|_| "Error deserializing ElementaryTypeName".to_string())?; + + assert_eq!(res.id, 64); + assert_eq!(res.src, "1602:7:0".to_string()); + assert_eq!(res.name, "address".to_string()); + assert_eq!(res.state_mutability, Some(StateMutability::NonPayable)); + assert_eq!(res.node_type, NodeType::ElementaryTypeName); + Ok(()) + } + + #[test] + fn test_correct_function_call_parsing() -> Result<(), String> { + let ast = fs::read_to_string("../solc-wrapper/tests/files/ast/FunctionCall.json").expect("Could not find test data file"); + let res = serde_json::from_str::(&ast).map_err(|_| "Error deserializing FunctionCall".to_string())?; + + assert_eq!(res.id, 78); + assert_eq!(res.src, "1850:44:0".to_string()); + assert_eq!(res.try_call, false); + assert_eq!(res.node_type, NodeType::FunctionCall); + Ok(()) + } + + #[test] + fn test_correct_literal_parsing() -> Result<(), String> { + let ast = fs::read_to_string("../solc-wrapper/tests/files/ast/Literal.json").expect("Could not find test data file"); + let res = serde_json::from_str::(&ast).map_err(|_| "Error deserializing Literal".to_string())?; + + assert_eq!(res.id, 77); + assert_eq!(res.src, "1874:19:0".to_string()); + assert_eq!(res.value, Some("Minting is locked".to_string())); + assert_eq!(res.hex_value, "4d696e74696e67206973206c6f636b6564".to_string()); + assert_eq!(res.kind, LiteralKind::String); + assert_eq!(res.node_type, NodeType::Literal); + Ok(()) + } + + #[test] + fn test_correct_member_access_parsing() -> Result<(), String> { + let ast = fs::read_to_string("../solc-wrapper/tests/files/ast/MemberAccess.json").expect("Could not find test data file"); + let res = serde_json::from_str::(&ast).map_err(|_| "Error deserializing Literal".to_string())?; + + assert_eq!(res.id, 176); + assert_eq!(res.src, "3535:23:0".to_string()); + assert_eq!(res.member_name, "current".to_string()); + assert_eq!(res.member_location, "3551:7:0".to_string()); + assert_eq!(res.node_type, NodeType::MemberAccess); + Ok(()) + } + + #[test] + fn test_correct_block_parsing() -> Result<(), String> { + let ast = fs::read_to_string("../solc-wrapper/tests/files/ast/Block.json").expect("Could not find test data file"); + let res = serde_json::from_str::(&ast).map_err(|_| "Error deserializing Block".to_string())?; + + assert_eq!(res.id, 192); + assert_eq!(res.src, "3511:148:0".to_string()); + assert_eq!(res.statements, Some(vec![] as Vec)); + assert_eq!(res.node_type, NodeType::Block); + Ok(()) + } + + #[test] + fn test_correct_expression_statement_parsing() -> Result<(), String> { + let ast = fs::read_to_string("../solc-wrapper/tests/files/ast/ExpressionStatement.json").expect("Could not find test data file"); + let res = serde_json::from_str::(&ast).map_err(|_| "Error deserializing Expression Statement".to_string())?; + + assert_eq!(res.id, 154); + assert_eq!(res.src, "2968:35:0".to_string()); + assert_eq!(res.node_type, NodeType::ExpressionStatement); + Ok(()) + } + + #[test] + fn test_correct_placeholder_statement_parsing() -> Result<(), String> { + let ast = fs::read_to_string("../solc-wrapper/tests/files/ast/PlaceholderStatement.json").expect("Could not find test data file"); + let res = serde_json::from_str::(&ast).map_err(|_| "Error deserializing PlaceholderStatement".to_string())?; + + assert_eq!(res.id, 80); + assert_eq!(res.src, "1904:1:0".to_string()); + assert_eq!(res.node_type, NodeType::PlaceholderStatement); + Ok(()) + } + + #[test] + fn test_correct_contract_definition_parsing() -> Result<(), String> { + let ast = fs::read_to_string("../solc-wrapper/tests/files/ast/ContractDefinition.json").expect("Could not find test data file"); + let res = serde_json::from_str::(&ast).map_err(|_| "Error deserializing ContractDefinition".to_string())?; + + assert_eq!(res.id, 427); + assert_eq!(res.src, "783:7774:0".to_string()); + assert_eq!(res.name_location, Some("792:28:0".to_string())); + assert_eq!(res.name, "StartonERC721MetaTransaction".to_string()); + assert_eq!(res.contract_kind, ContractKind::Contract); + assert_eq!(res.is_abstract, false); + assert_eq!(res.node_type, NodeType::ContractDefinition); + Ok(()) + } + + #[test] + fn test_correct_function_definition_parsing() -> Result<(), String> { + let ast = fs::read_to_string("../solc-wrapper/tests/files/ast/FunctionDefinition.json").expect("Could not find test data file"); + let res = serde_json::from_str::(&ast).map_err(|_| "Error deserializing FunctionDefinition".to_string())?; + + assert_eq!(res.id, 193); + assert_eq!(res.src, "3392:267:0".to_string()); + assert_eq!(res.name, "mint".to_string()); + assert_eq!(res.name_location, Some("3401:4:0".to_string())); + assert_eq!(res.implemented, true); + assert_eq!(res.kind, FunctionDefinitionKind::Function); + assert_eq!(res.visibility, Some(Visibility::Public)); + assert_eq!(res.is_virtual, false); + assert_eq!(res.state_mutability, StateMutability::NonPayable); + assert_eq!(res.node_type, NodeType::FunctionDefinition); + Ok(()) + } + + #[test] + fn test_correct_import_directive_parsing() -> Result<(), String> { + let ast = fs::read_to_string("../solc-wrapper/tests/files/ast/ImportDirective.json").expect("Could not find test data file"); + let res = serde_json::from_str::(&ast).map_err(|_| "Error deserializing ImportDirective".to_string())?; + + assert_eq!(res.id, 2); + assert_eq!(res.src, "58:78:0".to_string()); + assert_eq!(res.name_location, Some("-1:-1:-1".to_string())); + assert_eq!(res.file, "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol".to_string()); + assert_eq!(res.absolute_path, "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol".to_string()); + assert_eq!(res.unit_alias, "".to_string()); + assert_eq!(res.symbol_aliases, vec![] as Vec); + assert_eq!(res.node_type, NodeType::ImportDirective); + Ok(()) + } + + #[test] + fn test_correct_source_unit_parsing() -> Result<(), String> { + let ast = fs::read_to_string("../solc-wrapper/tests/files/ast/SourceUnit.json").expect("Could not find test data file"); + let res = serde_json::from_str::(&ast).map_err(|_| "Error deserializing SourceUnit".to_string())?; + + assert_eq!(res.id, 428); + assert_eq!(res.src, "33:8524:0".to_string()); + assert_eq!(res.absolute_path, "wow.sol".to_string()); + assert_eq!(res.license, Some("MIT".to_string())); + assert_eq!(res.node_type, NodeType::SourceUnit); + Ok(()) + } + + #[test] + fn test_correct_structured_documentation_parsing() -> Result<(), String> { + let ast = fs::read_to_string("../solc-wrapper/tests/files/ast/StructuredDocumentation.json").expect("Could not find test data file"); + let res = serde_json::from_str::(&ast).map_err(|_| "Error deserializing StructuredDocumentation".to_string())?; + + assert_eq!(res.id, 63); + assert_eq!(res.src, "1522:55:0".to_string()); + assert_eq!(res.text, "@notice Event emitted when the minting is locked ".to_string()); + assert_eq!(res.node_type, NodeType::StructuredDocumentation); + Ok(()) + } + + #[test] + fn test_correct_break_parsing() -> Result<(), String> { + let ast = fs::read_to_string("../solc-wrapper/tests/files/ast/Break.json").expect("Could not find test data file"); + let res = serde_json::from_str::(&ast).map_err(|_| "Error deserializing Break".to_string())?; + + assert_eq!(res.id, 7); + assert_eq!(res.src, "172:5:0".to_string()); + assert_eq!(res.node_type, NodeType::Break); + Ok(()) + } + + #[test] + fn test_correct_continue_parsing() -> Result<(), String> { + let ast = fs::read_to_string("../solc-wrapper/tests/files/ast/Continue.json").expect("Could not find test data file"); + let res = serde_json::from_str::(&ast).map_err(|_| "Error deserializing Continue".to_string())?; + + assert_eq!(res.id, 7); + assert_eq!(res.src, "172:8:0".to_string()); + assert_eq!(res.node_type, NodeType::Continue); + Ok(()) + } + + #[test] + fn test_correct_while_statement_parsing() -> Result<(), String> { + let ast = fs::read_to_string("../solc-wrapper/tests/files/ast/WhileStatement.json").expect("Could not find test data file"); + let res = serde_json::from_str::(&ast).map_err(|_| "Error deserializing WhileStatement".to_string())?; + + assert_eq!(res.id, 9); + assert_eq!(res.src, "145:46:0".to_string()); + assert_eq!(res.node_type, NodeType::WhileStatement); + Ok(()) + } + + #[test] + fn test_correct_do_while_statement_parsing() -> Result<(), String> { + let ast = fs::read_to_string("../solc-wrapper/tests/files/ast/DoWhileStatement.json").expect("Could not find test data file"); + let res = serde_json::from_str::(&ast).map_err(|_| "Error deserializing DoWhileStatement".to_string())?; + + assert_eq!(res.id, 9); + assert_eq!(res.src, "145:50:0".to_string()); + assert_eq!(res.node_type, NodeType::DoWhileStatement); + Ok(()) + } + + #[test] + fn test_correct_for_statement_parsing() -> Result<(), String> { + let ast = fs::read_to_string("../solc-wrapper/tests/files/ast/ForStatement.json").expect("Could not find test data file"); + let res = serde_json::from_str::(&ast).map_err(|_| "Error deserializing ForStatement".to_string())?; + + assert_eq!(res.id, 18); + assert_eq!(res.src, "145:60:0".to_string()); + assert_eq!(res.node_type, NodeType::ForStatement); + Ok(()) + } + + #[test] + fn test_correct_struct_definition_parsing() -> Result<(), String> { + let ast = fs::read_to_string("../solc-wrapper/tests/files/ast/StructDefinition.json").expect("Could not find test data file"); + let res = serde_json::from_str::(&ast).map_err(|_| "Error deserializing StructDefinition".to_string())?; + + assert_eq!(res.id, 6); + assert_eq!(res.src, "62:36:0".to_string()); + assert_eq!(res.name_location, Some("69:1:0".to_string())); + assert_eq!(res.name, "S".to_string()); + assert_eq!(res.scope, 27); + assert_eq!(res.visibility, Visibility::Public); + assert_eq!(res.canonical_name, "S".to_string()); + assert_eq!(res.node_type, NodeType::StructDefinition); + Ok(()) + } + + #[test] + fn test_correct_try_statement_parsing() -> Result<(), String> { + let ast = fs::read_to_string("../solc-wrapper/tests/files/ast/TryStatement.json").expect("Could not find test data file"); + let res = serde_json::from_str::(&ast).map_err(|_| "Error deserializing TryStatement".to_string())?; + + assert_eq!(res.id, 95); + assert_eq!(res.src, "976:155:0".to_string()); + assert_eq!(res.node_type, NodeType::TryStatement); + Ok(()) + } + + #[test] + fn test_correct_revert_statement_parsing() -> Result<(), String> { + let ast = fs::read_to_string("../solc-wrapper/tests/files/ast/RevertStatement.json").expect("Could not find test data file"); + let res = serde_json::from_str::(&ast).map_err(|_| "Error deserializing RevertStatement".to_string())?; + + assert_eq!(res.id, 8); + assert_eq!(res.src, "118:12:0".to_string()); + assert_eq!(res.node_type, NodeType::RevertStatement); + Ok(()) + } + + #[test] + fn test_correct_inline_assembly_parsing() -> Result<(), String> { + let ast = fs::read_to_string("../solc-wrapper/tests/files/ast/InlineAssembly.json").expect("Could not find test data file"); + let res = serde_json::from_str::(&ast).map_err(|_| "Error deserializing InlineAssembly".to_string())?; + + assert_eq!(res.id, 9); + assert_eq!(res.src, "176:50:0".to_string()); + assert_eq!(res.evm_version, EvmVersion::London); + assert_eq!(res.node_type, NodeType::InlineAssembly); + Ok(()) + } + + #[test] + fn test_correct_error_definition_parsing() -> Result<(), String> { + let ast = fs::read_to_string("../solc-wrapper/tests/files/ast/ErrorDefinition.json").expect("Could not find test data file"); + let res = serde_json::from_str::(&ast).map_err(|_| "Error deserializing ErrorDefinition".to_string())?; + + assert_eq!(res.id, 3); + assert_eq!(res.name, "No".to_string()); + assert_eq!(res.name_location, "92:2:0".to_string()); + assert_eq!(res.src, "86:11:0".to_string()); + assert_eq!(res.node_type, NodeType::ErrorDefinition); + Ok(()) + } + + #[test] + fn test_correct_index_access_parsing() -> Result<(), String> { + let ast = fs::read_to_string("../solc-wrapper/tests/files/ast/IndexAccess.json").expect("Could not find test data file"); + let res = serde_json::from_str::(&ast).map_err(|_| "Error deserializing IndexAccess".to_string())?; + + assert_eq!(res.id, 14); + assert_eq!(res.src, "203:10:0".to_string()); + assert_eq!(res.node_type, NodeType::IndexAccess); + Ok(()) + } + + #[test] + fn test_correct_new_expression_parsing() -> Result<(), String> { + let ast = fs::read_to_string("../solc-wrapper/tests/files/ast/NewExpression.json").expect("Could not find test data file"); + let res = serde_json::from_str::(&ast).map_err(|_| "Error deserializing NewExpression".to_string())?; + + assert_eq!(res.id, 7); + assert_eq!(res.src, "131:6:0".to_string()); + assert_eq!(res.node_type, NodeType::NewExpression); + Ok(()) + } + + #[test] + fn test_correct_function_call_options_parsing() -> Result<(), String> { + let ast = fs::read_to_string("../solc-wrapper/tests/files/ast/FunctionCallOptions.json").expect("Could not find test data file"); + let res = serde_json::from_str::(&ast).map_err(|_| "Error deserializing FunctionCallOptions".to_string())?; + + assert_eq!(res.id, 21); + assert_eq!(res.src, "236:36:0".to_string()); + assert_eq!(res.names, vec!["value".to_string()] as Vec); + assert_eq!(res.node_type, NodeType::FunctionCallOptions); + Ok(()) + } + + #[test] + fn test_correct_function_type_name_options_parsing() -> Result<(), String> { + let ast = fs::read_to_string("../solc-wrapper/tests/files/ast/FunctionTypeName.json").expect("Could not find test data file"); + let res = serde_json::from_str::(&ast).map_err(|_| "Error deserializing FunctionTypeName".to_string())?; + + assert_eq!(res.id, 11); + assert_eq!(res.src, "260:37:0".to_string()); + assert_eq!(res.state_mutability, StateMutability::Pure); + assert_eq!(res.visibility, Visibility::Internal); + assert_eq!(res.node_type, NodeType::FunctionTypeName); + Ok(()) + } + + #[test] + fn test_correct_user_defined_value_type_definition_parsing() -> Result<(), String> { + let ast = fs::read_to_string("../solc-wrapper/tests/files/ast/UserDefinedValueTypeDefinition.json").expect("Could not find test data file"); + let res = serde_json::from_str::(&ast).map_err(|_| "Error deserializing UserDefinedValueTypeDefinition".to_string())?; + + assert_eq!(res.id, 3); + assert_eq!(res.name, "UFixed256x18".to_string()); + assert_eq!(res.name_location, Some("160:12:0".to_string())); + assert_eq!(res.src, "155:29:0".to_string()); + assert_eq!(res.node_type, NodeType::UserDefinedValueTypeDefinition); + Ok(()) + } + + #[test] + fn test_correct_elementary_type_name_expression_parsing() -> Result<(), String> { + let ast = fs::read_to_string("../solc-wrapper/tests/files/ast/ElementaryTypeNameExpression.json").expect("Could not find test data file"); + let res = serde_json::from_str::(&ast).map_err(|_| "Error deserializing ElementaryTypeNameExpression".to_string())?; + + assert_eq!(res.id, 10); + assert_eq!(res.src, "156:7:0".to_string()); + assert_eq!(res.node_type, NodeType::ElementaryTypeNameExpression); + Ok(()) + } + + #[test] + fn test_correct_index_range_access_expression_parsing() -> Result<(), String> { + let ast = fs::read_to_string("../solc-wrapper/tests/files/ast/IndexRangeAccess.json").expect("Could not find test data file"); + let res = serde_json::from_str::(&ast).map_err(|_| "Error deserializing IndexRangeAccess".to_string())?; + + assert_eq!(res.id, 12); + assert_eq!(res.src, "174:8:0".to_string()); + assert_eq!(res.node_type, NodeType::IndexRangeAccess); + Ok(()) + } +} \ No newline at end of file diff --git a/toolchains/solidity/linter/solc-wrapper/src/ast/error.rs b/toolchains/solidity/linter/solc-wrapper/src/ast/error.rs new file mode 100644 index 00000000..2e16d955 --- /dev/null +++ b/toolchains/solidity/linter/solc-wrapper/src/ast/error.rs @@ -0,0 +1,7 @@ +use thiserror::Error; + +#[derive(Error, Debug)] +pub enum AstError { + #[error("AstError: cannot parse the json to AST")] + JsonParseFailed(#[from] serde_json::Error), +} diff --git a/toolchains/solidity/linter/solc-wrapper/src/ast/mod.rs b/toolchains/solidity/linter/solc-wrapper/src/ast/mod.rs new file mode 100644 index 00000000..6b8c7b6c --- /dev/null +++ b/toolchains/solidity/linter/solc-wrapper/src/ast/mod.rs @@ -0,0 +1,4 @@ +pub mod parse; +pub mod ast; +pub mod error; +pub mod utils; \ No newline at end of file diff --git a/toolchains/solidity/linter/solc-wrapper/src/ast/parse.rs b/toolchains/solidity/linter/solc-wrapper/src/ast/parse.rs new file mode 100644 index 00000000..6c03cd37 --- /dev/null +++ b/toolchains/solidity/linter/solc-wrapper/src/ast/parse.rs @@ -0,0 +1,7 @@ +use crate::ast::ast::SourceUnit; + +use super::error::AstError; + +pub fn parse_ast(json: &str) -> Result { + Ok(serde_json::from_str(json)?) +} diff --git a/toolchains/solidity/linter/solc-wrapper/src/ast/utils.rs b/toolchains/solidity/linter/solc-wrapper/src/ast/utils.rs new file mode 100644 index 00000000..4e667f3c --- /dev/null +++ b/toolchains/solidity/linter/solc-wrapper/src/ast/utils.rs @@ -0,0 +1,732 @@ +use std::ops::Deref; +use crate::ast::ast::*; + +pub enum Nodes { + SourceUnit(SourceUnit), + ContractDefinition(Box), + Assignment(Box), + BinaryOperation(Box), + Conditional(Box), + ElementaryTypeNameExpression(Box), + FunctionCall(Box), + FunctionCallOptions(Box), + Identifier(Box), + IdentifierPath(Box), + IndexAccess(Box), + IndexRangeAccess(Box), + Literal(Box), + MemberAccess(Box), + NewExpression(Box), + TupleExpression(Box), + UnaryOperation(Box), + Block(Box), + Break(Box), + Continue(Box), + DoWhileStatement(Box), + EmitStatement(Box), + ExpressionStatement(Box), + ForStatement(Box), + IfStatement(Box), + PlaceholderStatement(Box), + Return(Box), + RevertStatement(Box), + TryStatement(Box), + TryCatchClause(Box), + UncheckedBlock(Box), + VariableDeclarationStatement(Box), + WhileStatement(Box), + FunctionDefinition(Box), + ModifierDefinition(Box), + StructDefinition(Box), + UserDefinedValueTypeDefinition(Box), + VariableDeclaration(Box), + EnumDefinition(Box), + EnumValue(Box), + ErrorDefinition(Box), + EventDefinition(Box), + UsingForDirective(Box), + UserDefinedTypeName(Box), + ImportDirective(Box), + PragmaDirective(Box), + FunctionTypeName(Box), + Mapping(Box), + ElementaryTypeName(Box), + ParameterList(Box), + OverrideSpecifier(Box), + InheritanceSpecifier(Box), + ModifierInvocation(Box) +} + +fn check_statement_node(node: Statement, nodes: &mut Vec, node_type: NodeType) { + match node { + Statement::Block(block) => { + check_block_node(block, nodes, node_type); + } + Statement::Break(break_statement) => { + check_break_node(break_statement, nodes, node_type); + } + Statement::Continue(continue_statement) => { + check_continue_node(continue_statement, nodes, node_type); + } + Statement::DoWhileStatement(do_while_statement) => { + check_do_while_statement_node(do_while_statement, nodes, node_type); + } + Statement::EmitStatement(emit_statement) => { + check_emit_statement_node(emit_statement, nodes, node_type); + } + Statement::ExpressionStatement(expression_statement) => { + check_expression_statement_node(expression_statement, nodes, node_type); + } + Statement::ForStatement(for_statement) => { + check_for_statement_node(for_statement, nodes, node_type); + } + Statement::IfStatement(if_statement) => { + check_if_statement_node(if_statement, nodes, node_type); + } + Statement::PlaceholderStatement(placeholder_statement) => { + check_placeholder_statement_node(placeholder_statement, nodes, node_type); + } + Statement::Return(return_statement) => { + check_return_node(return_statement, nodes, node_type); + } + Statement::RevertStatement(revert_statement) => { + check_revert_statement_node(revert_statement, nodes, node_type); + } + Statement::TryStatement(try_statement) => { + check_try_statement_node(try_statement, nodes, node_type); + } + Statement::UncheckedBlock(unchecked_block) => { + check_unchecked_block_node(unchecked_block, nodes, node_type); + } + Statement::VariableDeclarationStatement(variable_declaration_statement) => { + check_variable_declaration_statement_node(variable_declaration_statement, nodes, node_type); + } + Statement::WhileStatement(while_statement) => { + check_while_statement_node(while_statement, nodes, node_type); + } + } +} + +fn check_body_node(body: Body, nodes: &mut Vec, node_type: NodeType) { + match body { + Body::Block(block) => { + check_block_node(block, nodes, node_type); + } + Body::Statement(statement) => { + check_statement_node(*statement, nodes, node_type); + } + } +} + +fn check_function_type_name_node(node: Box, nodes: &mut Vec, node_type: NodeType) { + if node_type == NodeType::FunctionTypeName { + nodes.push(Nodes::FunctionTypeName(node.clone())); + } + check_parameter_list_node(Box::new(node.parameter_types), nodes, node_type.clone()); + check_parameter_list_node(Box::new(node.return_parameter_types), nodes, node_type); +} + +fn check_typename_node(node: TypeName, nodes: &mut Vec, node_type: NodeType) { + match node { + TypeName::ArrayTypeName(node) => { + check_typename_node(node.base_type, nodes, node_type); + }, + TypeName::ElementaryTypeName(node) => { + check_elementary_type_name_node(node, nodes, node_type); + }, + TypeName::FunctionTypeName(node) => { + check_function_type_name_node(node, nodes, node_type); + }, + TypeName::Mapping(node) => { + check_mapping_node(node, nodes, node_type); + }, + TypeName::UserDefinedTypeName(node) => { + nodes.push(Nodes::UserDefinedTypeName(node)); + }, + } +} + +fn check_mapping_node(node: Box, nodes: &mut Vec, node_type: NodeType) { + if node_type == NodeType::Mapping { + nodes.push(Nodes::Mapping(node.clone())); + } + check_typename_node(node.key_type, nodes, node_type.clone()); + check_typename_node(node.value_type, nodes, node_type.clone()); +} + +fn check_expression_node(node: Expression, nodes: &mut Vec, node_type: NodeType) { + match node { + Expression::Assignment(node) => { + check_assignment_node(node, nodes, node_type); + } + Expression::BinaryOperation(node) => { + check_binary_operation_node(node, nodes, node_type); + } + Expression::Conditional(node) => { + check_conditional_node(node, nodes, node_type); + } + Expression::ElementaryTypeNameExpression(node) => { + check_elementary_type_name_expression_node(node, nodes, node_type); + } + Expression::FunctionCall(node) => { + check_function_call_node(node, nodes, node_type); + } + Expression::FunctionCallOptions(node) => { + check_function_call_options_node(node, nodes, node_type); + } + Expression::Identifier(node) => { + check_identifier_node(node, nodes, node_type); + } + Expression::IdentifierPath(node) => { + check_identifier_path_node(node, nodes, node_type); + } + Expression::IndexAccess(node) => { + check_index_access_node(node, nodes, node_type); + } + Expression::IndexRangeAccess(node) => { + check_index_range_access_node(node, nodes, node_type); + } + Expression::Literal(node) => { + check_literal_node(node, nodes, node_type); + } + Expression::MemberAccess(node) => { + check_member_access_node(node, nodes, node_type); + } + Expression::NewExpression(node) => { + check_new_expression_node(node, nodes, node_type); + } + Expression::TupleExpression(node) => { + check_tuple_expression_node(node, nodes, node_type); + } + Expression::UnaryOperation(node) => { + check_unary_operation_node(node, nodes, node_type); + } + } +} + +fn check_parameter_list_node(node: Box, nodes: &mut Vec, node_type: NodeType) { + if node_type == NodeType::ParameterList { + nodes.push(Nodes::ParameterList(node.clone())); + } + for parameter in node.parameters { + check_variable_declaration_node(Box::new(parameter), nodes, node_type.clone()); + } +} + +fn check_assignment_node(node: Box, nodes: &mut Vec, node_type: NodeType) { + if node_type == NodeType::Assignment { + nodes.push(Nodes::Assignment(node.clone())); + } + check_expression_node(node.left_hand_side, nodes, node_type.clone()); + check_expression_node(node.right_hand_side, nodes, node_type); +} + +fn check_binary_operation_node(node: Box, nodes: &mut Vec, node_type: NodeType) { + if node_type == NodeType::BinaryOperation { + nodes.push(Nodes::BinaryOperation(node.clone())); + } + check_expression_node(node.left_expression, nodes, node_type.clone()); + check_expression_node(node.right_expression, nodes, node_type.clone()); +} + +fn check_conditional_node(node: Box, nodes: &mut Vec, node_type: NodeType) { + if node_type == NodeType::Conditional { + nodes.push(Nodes::Conditional(node.clone())); + } + check_expression_node(node.condition, nodes, node_type.clone()); + check_expression_node(node.true_expression, nodes, node_type.clone()); + check_expression_node(node.false_expression, nodes, node_type); +} + +fn check_elementary_type_name_expression_node(node: Box, nodes: &mut Vec, node_type: NodeType) { + if node_type == NodeType::ElementaryTypeNameExpression { + nodes.push(Nodes::ElementaryTypeNameExpression(node.clone())); + } + check_elementary_type_name_node(Box::new(node.type_name), nodes, node_type); +} + +fn check_elementary_type_name_node(node: Box, nodes: &mut Vec, node_type: NodeType) { + if node_type == NodeType::ElementaryTypeName { + nodes.push(Nodes::ElementaryTypeName(node.clone())); + } +} + +fn check_function_call_node(node: Box, nodes: &mut Vec, node_type: NodeType) { + if node_type == NodeType::FunctionCall { + nodes.push(Nodes::FunctionCall(node.clone())); + } + check_expression_node(node.expression, nodes, node_type.clone()); + for argument in node.arguments { + check_expression_node(argument, nodes, node_type.clone()); + } +} + +fn check_function_call_options_node(node: Box, nodes: &mut Vec, node_type: NodeType) { + if node_type == NodeType::FunctionCallOptions { + nodes.push(Nodes::FunctionCallOptions(node.clone())); + } + check_expression_node(node.expression, nodes, node_type.clone()); + for option in node.options { + check_expression_node(option, nodes, node_type.clone()); + } +} + +fn check_identifier_node(node: Box, nodes: &mut Vec, node_type: NodeType) { + if node_type == NodeType::Identifier { + nodes.push(Nodes::Identifier(node.clone())); + } +} + +fn check_identifier_path_node(node: Box, nodes: &mut Vec, node_type: NodeType) { + if node_type == NodeType::IdentifierPath { + nodes.push(Nodes::IdentifierPath(node.clone())); + } +} + +fn check_index_access_node(node: Box, nodes: &mut Vec, node_type: NodeType) { + if node_type == NodeType::IndexAccess { + nodes.push(Nodes::IndexAccess(node.clone())); + } + check_expression_node(node.base_expression, nodes, node_type.clone()); + if node.index_expression.is_some() { + check_expression_node(node.index_expression.unwrap(), nodes, node_type); + } +} + +fn check_index_range_access_node(node: Box, nodes: &mut Vec, node_type: NodeType) { + if node_type == NodeType::IndexRangeAccess { + nodes.push(Nodes::IndexRangeAccess(node.clone())); + } + check_expression_node(node.base_expression, nodes, node_type.clone()); + if node.start_expression.is_some() { + check_expression_node(node.start_expression.unwrap(), nodes, node_type.clone()); + } + if node.end_expression.is_some() { + check_expression_node(node.end_expression.unwrap(), nodes, node_type); + } +} + +fn check_literal_node(node: Box, nodes: &mut Vec, node_type: NodeType) { + if node_type == NodeType::Literal { + nodes.push(Nodes::Literal(node.clone())); + } +} + +fn check_member_access_node(node: Box, nodes: &mut Vec, node_type: NodeType) { + if node_type == NodeType::MemberAccess { + nodes.push(Nodes::MemberAccess(node.clone())); + } + check_expression_node(node.expression, nodes, node_type); +} + +fn check_new_expression_node(node: Box, nodes: &mut Vec, node_type: NodeType) { + if node_type == NodeType::NewExpression { + nodes.push(Nodes::NewExpression(node.clone())); + } +} + +fn check_tuple_expression_node(node: Box, nodes: &mut Vec, node_type: NodeType) { + if node_type == NodeType::TupleExpression { + nodes.push(Nodes::TupleExpression(node.clone())); + } + for expression in node.components { + check_expression_node(expression, nodes, node_type.clone()); + } +} + +fn check_unary_operation_node(node: Box, nodes: &mut Vec, node_type: NodeType) { + if node_type == NodeType::UnaryOperation { + nodes.push(Nodes::UnaryOperation(node.clone())); + } + check_expression_node(node.sub_expression, nodes, node_type); +} + +fn check_block_node(node: Box, nodes: &mut Vec, node_type: NodeType) { + if node_type == NodeType::Block { + nodes.push(Nodes::Block(node.clone())); + } + if node.statements.is_some() { + for statement in node.statements.unwrap() { + check_statement_node(statement, nodes, node_type.clone()); + } + } +} + +fn check_break_node(node: Box, nodes: &mut Vec, node_type: NodeType) { + if node_type == NodeType::Break { + nodes.push(Nodes::Break(node.clone())); + } +} + +fn check_continue_node(node: Box, nodes: &mut Vec, node_type: NodeType) { + if node_type == NodeType::Continue { + nodes.push(Nodes::Continue(node.clone())); + } +} + +fn check_do_while_statement_node(node: Box, nodes: &mut Vec, node_type: NodeType) { + if node_type == NodeType::DoWhileStatement { + nodes.push(Nodes::DoWhileStatement(node.clone())); + } + check_body_node(node.body, nodes, node_type.clone()); + check_expression_node(node.condition, nodes, node_type); +} + +fn check_emit_statement_node(node: Box, nodes: &mut Vec, node_type: NodeType) { + if node_type == NodeType::EmitStatement { + nodes.push(Nodes::EmitStatement(node.clone())); + } + check_function_call_node(Box::new(node.event_call), nodes, node_type); +} + +fn check_expression_statement_node(node: Box, nodes: &mut Vec, node_type: NodeType) { + if node_type == NodeType::ExpressionStatement { + nodes.push(Nodes::ExpressionStatement(node.clone())); + } + check_expression_node(node.expression, nodes, node_type); +} + +fn check_for_statement_node(node: Box, nodes: &mut Vec, node_type: NodeType) { + if node_type == NodeType::ForStatement { + nodes.push(Nodes::ForStatement(node.clone())); + } + check_body_node(node.body, nodes, node_type.clone()); + if node.condition.is_some() { + check_expression_node(node.condition.unwrap(), nodes, node_type.clone()); + } + if node.loop_expression.is_some() { + check_expression_statement_node(Box::new(node.loop_expression.unwrap()), nodes, node_type.clone()); + } + if node.initialization_expression.is_some() { + let initialization_expression = node.initialization_expression.unwrap(); + match initialization_expression { + InitializationExpression::VariableDeclarationStatement(variable_declaration_statement) => { + check_variable_declaration_statement_node(Box::new(variable_declaration_statement), nodes, node_type.clone()); + }, + InitializationExpression::ExpressionStatement(expression_statement) => { + check_expression_statement_node(Box::new(expression_statement), nodes, node_type.clone()); + }, + } + } +} + +fn check_if_statement_node(node: Box, nodes: &mut Vec, node_type: NodeType) { + if node_type == NodeType::IfStatement { + nodes.push(Nodes::IfStatement(node.clone())); + } + check_expression_node(node.condition, nodes, node_type.clone()); + check_body_node(node.true_body, nodes, node_type.clone()); + if node.false_body.is_some() { + check_body_node(node.false_body.unwrap(), nodes, node_type); + } +} + +fn check_placeholder_statement_node(node: Box, nodes: &mut Vec, node_type: NodeType) { + if node_type == NodeType::PlaceholderStatement { + nodes.push(Nodes::PlaceholderStatement(node.clone())); + } +} + +fn check_return_node(node: Box, nodes: &mut Vec, node_type: NodeType) { + if node_type == NodeType::Return { + nodes.push(Nodes::Return(node.clone())); + } + if node.expression.is_some() { + check_expression_node(node.expression.unwrap(), nodes, node_type); + } +} + +fn check_revert_statement_node(node: Box, nodes: &mut Vec, node_type: NodeType) { + if node_type == NodeType::RevertStatement { + nodes.push(Nodes::RevertStatement(node.clone())); + } + check_statement_node(node.error_call, nodes, node_type); +} + +fn check_try_statement_node(node: Box, nodes: &mut Vec, node_type: NodeType) { + if node_type == NodeType::TryStatement { + nodes.push(Nodes::TryStatement(node.clone())); + } + check_expression_node(node.external_call, nodes, node_type.clone()); + for catch_clause in node.clauses { + check_try_catch_clause_node(Box::new(catch_clause), nodes, node_type.clone()); + } +} + +fn check_try_catch_clause_node(node: Box, nodes: &mut Vec, node_type: NodeType) { + if node_type == NodeType::TryCatchClause { + nodes.push(Nodes::TryCatchClause(node.clone())); + } + check_block_node(Box::new(node.block), nodes, node_type); +} + +fn check_unchecked_block_node(node: Box, nodes: &mut Vec, node_type: NodeType) { + if node_type == NodeType::UncheckedBlock { + nodes.push(Nodes::UncheckedBlock(node.clone())); + } + for statement in node.statements { + check_statement_node(statement, nodes, node_type.clone()); + } +} + +fn check_variable_declaration_statement_node(node: Box, nodes: &mut Vec, node_type: NodeType) { + if node_type == NodeType::VariableDeclarationStatement { + nodes.push(Nodes::VariableDeclarationStatement(node.clone())); + } + for variable_declaration in node.declarations { + if variable_declaration.is_some() { + check_variable_declaration_node(Box::new(variable_declaration.unwrap()), nodes, node_type.clone()); + } + } +} + +fn check_while_statement_node(node: Box, nodes: &mut Vec, node_type: NodeType) { + if node_type == NodeType::WhileStatement { + nodes.push(Nodes::WhileStatement(node.clone())); + } + check_statement_node(node.body, nodes, node_type.clone()); + check_expression_node(node.condition, nodes, node_type); +} + +fn check_modifier_invocation_node(node: Box, nodes: &mut Vec, node_type: NodeType) { + if node_type == NodeType::ModifierInvocation { + nodes.push(Nodes::ModifierInvocation(node.clone())); + } + if node.arguments.is_some() { + check_expression_node(node.arguments.unwrap(), nodes, node_type.clone()); + } + match node.modifier_name { + ModifierName::Identifier(identifier) => { + check_identifier_node(Box::new(identifier), nodes, node_type); + }, + ModifierName::IdentifierPath(identifier_path) => { + check_identifier_path_node(Box::new(identifier_path), nodes, node_type); + } + }; +} + +fn check_function_definition_node(node: Box, nodes: &mut Vec, node_type: NodeType) { + if node_type == NodeType::FunctionDefinition { + nodes.push(Nodes::FunctionDefinition(node.clone())); + } + if node.body.is_some() { + check_block_node(Box::new(node.body.unwrap()), nodes, node_type.clone()); + } + for modifier in node.modifiers { + check_modifier_invocation_node(Box::new(modifier), nodes, node_type.clone()); + } + if node.overrides.is_some() { + check_override_specifier_node(Box::new(node.overrides.unwrap()), nodes, node_type.clone()); + } + check_parameter_list_node(Box::new(node.parameters), nodes, node_type.clone()); + check_parameter_list_node(Box::new(node.return_parameters), nodes, node_type); +} + +fn check_override_specifier_node(node: Box, nodes: &mut Vec, node_type: NodeType) { + if node_type == NodeType::OverrideSpecifier { + nodes.push(Nodes::OverrideSpecifier(node.clone())); + } + match node.overrides { + OverridesEnum::Identifier(identifier_list) => { + for identifier in identifier_list { + check_identifier_path_node(Box::new(identifier), nodes, node_type.clone()); + } + }, + OverridesEnum::UserDefinedTypeName(user_defined_type_name) => { + for user_defined_type in user_defined_type_name { + check_user_defined_type_name_node(Box::new(user_defined_type), nodes, node_type.clone()); + } + }, + } +} + +fn check_modifier_definition_node(node: Box, nodes: &mut Vec, node_type: NodeType) { + if node_type == NodeType::ModifierDefinition { + nodes.push(Nodes::ModifierDefinition(node.clone())); + } + check_statement_node(node.body, nodes, node_type.clone()); + if node.overrides.is_some() { + check_override_specifier_node(Box::new(node.overrides.unwrap()), nodes, node_type.clone()); + } + check_parameter_list_node(Box::new(node.parameters), nodes, node_type); +} + +fn check_struct_definition_node(node: Box, nodes: &mut Vec, node_type: NodeType) { + if node_type == NodeType::StructDefinition { + nodes.push(Nodes::StructDefinition(node.clone())); + } + for member in node.members { + check_variable_declaration_node(Box::new(member), nodes, node_type.clone()); + } +} + +fn check_user_defined_value_type_definition_node(node: Box, nodes: &mut Vec, node_type: NodeType) { + if node_type == NodeType::UserDefinedValueTypeDefinition { + nodes.push(Nodes::UserDefinedValueTypeDefinition(node.clone())); + } + check_typename_node(node.underlying_type, nodes, node_type); +} + +fn check_variable_declaration_node(node: Box, nodes: &mut Vec, node_type: NodeType) { + if node_type == NodeType::VariableDeclaration { + nodes.push(Nodes::VariableDeclaration(node.clone())); + } + if node.value.is_some() { + check_expression_node(node.value.unwrap(), nodes, node_type.clone()); + } + if node.type_name.is_some() { + check_typename_node(node.type_name.unwrap(), nodes, node_type); + } +} + +fn check_enum_definition_node(node: Box, nodes: &mut Vec, node_type: NodeType) { + if node_type == NodeType::EnumDefinition { + nodes.push(Nodes::EnumDefinition(node.clone())); + } + for member in node.members { + check_enum_value_node(Box::new(member), nodes, node_type.clone()); + } +} + +fn check_enum_value_node(node: Box, nodes: &mut Vec, node_type: NodeType) { + if node_type == NodeType::EnumValue { + nodes.push(Nodes::EnumValue(node.clone())); + } +} + +fn check_error_definition_node(node: Box, nodes: &mut Vec, node_type: NodeType) { + if node_type == NodeType::ErrorDefinition { + nodes.push(Nodes::ErrorDefinition(node.clone())); + } + if node.parameters.is_some() { + check_parameter_list_node(Box::new(node.parameters.unwrap()), nodes, node_type); + } +} + +fn check_event_definition_node(node: Box, nodes: &mut Vec, node_type: NodeType) { + if node_type == NodeType::EventDefinition { + nodes.push(Nodes::EventDefinition(node.clone())); + } + if node.parameters.is_some() { + check_parameter_list_node(Box::new(node.parameters.unwrap()), nodes, node_type); + } +} + +fn check_using_for_directive_node(node: Box, nodes: &mut Vec, node_type: NodeType) { + if node_type == NodeType::UsingForDirective { + nodes.push(Nodes::UsingForDirective(node.clone())); + } + if node.function_list.is_some() { + let function_list = node.function_list.unwrap(); + for function in function_list { + check_identifier_path_node(Box::new(function.function), nodes, node_type.clone()); + } + } + if node.function.is_some() { + check_identifier_path_node(Box::new(node.function.unwrap()), nodes, node_type.clone()); + } + if node.library_name.is_some() { + check_expression_node(node.library_name.unwrap(), nodes, node_type.clone()); + } + if node.type_name.is_some() { + check_typename_node(node.type_name.unwrap(), nodes, node_type); + } +} + +fn check_inheritance_specifier_node(node: Box, nodes: &mut Vec, node_type: NodeType) { + if node_type == NodeType::InheritanceSpecifier { + nodes.push(Nodes::InheritanceSpecifier(node.clone())); + } + if node.arguments.is_some() { + for argument in node.arguments.unwrap() { + check_expression_node(argument, nodes, node_type.clone()); + } + } +} + +fn check_contract_definition_node(node: Box, nodes: &mut Vec, node_type: NodeType) { + if node_type == NodeType::ContractDefinition { + nodes.push(Nodes::ContractDefinition(node.clone())); + } + for base in node.base_contracts { + check_inheritance_specifier_node(Box::new(base), nodes, node_type.clone()); + } + for node in node.nodes { + check_contract_definition_child_node(Box::new(node), nodes, node_type.clone()); + } +} + +fn check_contract_definition_child_node(node: Box, nodes: &mut Vec, node_type: NodeType) { + match *node { + ContractDefinitionChildNodes::UsingForDirective(node) => check_using_for_directive_node(node, nodes, node_type), + ContractDefinitionChildNodes::StructDefinition(node) => check_struct_definition_node(node, nodes, node_type), + ContractDefinitionChildNodes::EnumDefinition(node) => check_enum_definition_node(node, nodes, node_type), + ContractDefinitionChildNodes::EventDefinition(node) => check_event_definition_node(node, nodes, node_type), + ContractDefinitionChildNodes::FunctionDefinition(node) => check_function_definition_node(node, nodes, node_type), + ContractDefinitionChildNodes::ModifierDefinition(node) => check_modifier_definition_node(node, nodes, node_type), + ContractDefinitionChildNodes::ErrorDefinition(node) => check_error_definition_node(node, nodes, node_type), + ContractDefinitionChildNodes::UserDefinedValueTypeDefinition(node) => check_user_defined_value_type_definition_node(node, nodes, node_type), + ContractDefinitionChildNodes::VariableDeclaration(node) => check_variable_declaration_node(node, nodes, node_type), + } +} + + +fn check_user_defined_type_name_node(node: Box, nodes: &mut Vec, node_type: NodeType) { + if node_type == NodeType::UserDefinedTypeName { + nodes.push(Nodes::UserDefinedTypeName(node.clone())); + } + if node.path_node.is_some() { + check_identifier_path_node(Box::new(node.path_node.unwrap()), nodes, node_type); + } +} + +fn check_import_directive_node(node: Box, nodes: &mut Vec, node_type: NodeType) { + if node_type == NodeType::ImportDirective { + nodes.push(Nodes::ImportDirective(node.clone())); + } +} + +fn check_pragma_directive_node(node: Box, nodes: &mut Vec, node_type: NodeType) { + if node_type == NodeType::PragmaDirective { + nodes.push(Nodes::PragmaDirective(node.clone())); + } +} + +fn check_source_unit_child_node(ast: SourceUnitChildNodes, nodes: &mut Vec, node_type: NodeType) { + match ast { + SourceUnitChildNodes::ContractDefinition(node) => { + check_contract_definition_node(node, nodes, node_type); + } + SourceUnitChildNodes::EnumDefinition(node) => { + check_enum_definition_node(node, nodes, node_type); + } + SourceUnitChildNodes::ErrorDefinition(node) => { + check_error_definition_node(node, nodes, node_type); + } + SourceUnitChildNodes::ImportDirective(node) => { + check_import_directive_node(node, nodes, node_type); + } + SourceUnitChildNodes::PragmaDirective(node) => { + check_pragma_directive_node(node, nodes, node_type); + } + SourceUnitChildNodes::StructDefinition(node) => { + check_struct_definition_node(node, nodes, node_type); + } + SourceUnitChildNodes::UsingForDirective(node) => { + check_using_for_directive_node(node, nodes, node_type); + } + _ => {} + } +} + +pub fn get_all_nodes_by_type(ast: SourceUnit, node_type: NodeType) -> Vec { + let mut nodes = Vec::new(); + if ast.node_type == node_type { + nodes.push(Nodes::SourceUnit(ast)); + return nodes; + } + for node in ast.nodes { + check_source_unit_child_node(node, &mut nodes, node_type.clone()); + } + nodes +} \ No newline at end of file diff --git a/toolchains/solidity/linter/solc-wrapper/src/error.rs b/toolchains/solidity/linter/solc-wrapper/src/error.rs new file mode 100644 index 00000000..4ce0fcb0 --- /dev/null +++ b/toolchains/solidity/linter/solc-wrapper/src/error.rs @@ -0,0 +1,28 @@ +use thiserror::Error; +use crate::{solc::error::CommandError, version::error::SolcVersionError, ast::error::AstError}; +use anyhow; +use crate::solc::parsing_error::ParsingError; + +#[derive(Error, Debug)] +pub enum SolcError { + #[error("SolcError: Something went wrong with sevm")] + SevmFailed(#[from] SolcVersionError), + + #[error("SolcError: Error from solc")] + SolcFailed(#[from] CommandError), + + #[error("SolcError: Can't do the compuation")] + ComputationFailed, + + #[error("SolcError: Error from ast pasing")] + AstFailed(#[from] AstError), + + #[error("SolcError: Output is empty")] + OutputIsEmpty, + + #[error("SolcError: compiler returned an error without outputing AST")] + ParsingFailed(#[from] ParsingError), + + #[error(transparent)] + Other(#[from] anyhow::Error), +} diff --git a/toolchains/solidity/linter/solc-wrapper/src/lib.rs b/toolchains/solidity/linter/solc-wrapper/src/lib.rs new file mode 100644 index 00000000..320924d0 --- /dev/null +++ b/toolchains/solidity/linter/solc-wrapper/src/lib.rs @@ -0,0 +1,146 @@ +mod solc; + +pub mod ast; +pub use ast::ast::*; + +mod utils; +mod version; + +use solc::command::SolcCommand; +use version::version::SolcVersion; +use ast::parse::parse_ast; + +mod error; +pub use error::SolcError; +use crate::solc::parsing_error::ParsingError; +use crate::utils::{get_error_location, get_error_message}; + + +pub enum ExecuteResult { + Ast(String), + ParsingError(ParsingError), +} + +pub struct Solc { + version: SolcVersion +} + +impl Default for Solc { + fn default() -> Self { + Solc::new() + } +} + +impl Solc { + pub fn new() -> Self { + Solc { version: SolcVersion::default() } + } + + fn skip_output_header(output: &str) -> &str { + let idx = output.find("{").expect("No { found"); + &output[idx..] + } + + fn check_stderr(stderr: &str) -> Result<(), ParsingError> { + if !stderr.contains("Error") { + return Ok(()); + } + let location = get_error_location(stderr); + let location = match location { + Ok(e) => e, + Err(_) => return Ok(()) + }; + let error = get_error_message(stderr); + let error = match error { + Ok(e) => e, + Err(_) => return Ok(()) + }; + + Err( + ParsingError { + error, + location + } + ) + } + + pub fn execute_on_file(&self, path: &str) -> Result { + let content = std::fs::read_to_string(path).map_err(|e| SolcError::Other(anyhow::Error::new(e)))?; + + let version = self.version.find_matching_version( content.as_str())?; + let version_path = self.version.find_version_and_install(&version)?; + + let output = SolcCommand::new(version_path) + .args(["--ast-compact-json", "--stop-after", "parsing", path]) + .execute()?; + let stderr = String::from_utf8(output.clone().stderr) + .map_err(|e| SolcError::Other(anyhow::Error::new(e)))?; + let output = match Solc::check_stderr(stderr.as_str()).map_err(|e| SolcError::ParsingFailed(e)) { + Ok(_) => output, + Err(e) => return Err(e) + }; + let res = String::from_utf8(output.stdout) + .map_err(|e| SolcError::Other(anyhow::Error::new(e)))?; + Ok(String::from(Self::skip_output_header(&res))) + } + + pub fn execute_on_content(&self, content: &str) -> Result { + let version = self.version.find_matching_version( content)?; + let version_path = self.version.find_version_and_install(&version)?; + + let output = SolcCommand::new(version_path) + .args(["--ast-compact-json", "--stop-after", "parsing", "-"]) + .execute_with_input(content)?; + let stderr = String::from_utf8(output.clone().stderr) + .map_err(|e| SolcError::Other(anyhow::Error::new(e)))?; + let output = match Solc::check_stderr(stderr.as_str()).map_err(|e| SolcError::ParsingFailed(e)) { + Ok(_) => output, + Err(e) => return Err(e) + }; + let res = String::from_utf8(output.stdout) + .map_err(|e| SolcError::Other(anyhow::Error::new(e)))?; + Ok(String::from(Self::skip_output_header(&res))) + } + + pub fn extract_ast_file(&self, filepath: String) -> Result { + let output = self.execute_on_file(filepath.as_str())?; + Ok(parse_ast(output.as_str())?) + } + + pub fn extract_ast_content(&self, content: String) -> Result { + let output = self.execute_on_content(&content)?; + Ok(parse_ast(output.as_str())?) + } + +} + + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn test_skip_output_header_already_formatted() { + let output = r#"{ + "contracts": {}, + "sources": {}, + "errors": [] + }"#; + assert_eq!(Solc::skip_output_header(output), output); + } + + #[test] + fn test_skip_output_header() { + let output = r#"ok ======= test ====== \n awesome { + "contracts": {}, + "sources": {}, + "errors": [] + }"#; + let expected = r#"{ + "contracts": {}, + "sources": {}, + "errors": [] + }"#; + assert_eq!(Solc::skip_output_header(output), expected); + } +} diff --git a/toolchains/solidity/linter/solc-wrapper/src/solc/command.rs b/toolchains/solidity/linter/solc-wrapper/src/solc/command.rs new file mode 100644 index 00000000..426253e8 --- /dev/null +++ b/toolchains/solidity/linter/solc-wrapper/src/solc/command.rs @@ -0,0 +1,66 @@ +use std::{process::Command}; +use std::io::Write; +use std::process::{Output, Stdio}; +use std::{path::PathBuf}; + +use super::error::{CommandError, CommandType}; + +pub struct SolcCommand { + args: Vec, + bin_path : PathBuf +} + +impl Default for SolcCommand { + fn default() -> Self { + SolcCommand::new("solc") + } +} + +impl SolcCommand { + + pub fn new(path: impl Into) -> Self { + SolcCommand { + args: Vec::new(), + bin_path: path.into() + } + } + + pub fn arg>(mut self, arg: T) -> Self { + self.args.push(arg.into()); + self + } + + pub fn args(mut self, args: I) -> Self + where + I: IntoIterator, + S: Into, + { + for arg in args { + self = self.arg(arg); + } + self + } + + pub fn execute(&self) -> Result { + Command::new(&self.bin_path) + .args(&self.args) + .stdout(Stdio::piped()) + .output() + .map_err(|e| CommandError { error: e.to_string(), command_type: CommandType::ParseFile }) + } + + pub fn execute_with_input(&self, input: &str) -> Result { + let mut cmd = Command::new(&self.bin_path) + .args(&self.args) + .stdin(Stdio::piped()) + .stdout(Stdio::piped()) + .spawn() + .map_err(|e| CommandError { error: e.to_string(), command_type: CommandType::ParseStdin })?; + + { + let child_stdin = cmd.stdin.as_mut().unwrap(); + child_stdin.write_all(input.as_bytes()).map_err(|e| CommandError { error: e.to_string(), command_type: CommandType::ParseStdin })?; + } + cmd.wait_with_output().map_err(|e| CommandError { error: e.to_string(), command_type: CommandType::ParseStdin }) + } +} \ No newline at end of file diff --git a/toolchains/solidity/linter/solc-wrapper/src/solc/error.rs b/toolchains/solidity/linter/solc-wrapper/src/solc/error.rs new file mode 100644 index 00000000..6efc974c --- /dev/null +++ b/toolchains/solidity/linter/solc-wrapper/src/solc/error.rs @@ -0,0 +1,19 @@ +use thiserror::Error; + +#[derive(Debug)] +pub enum CommandType { + ParseFile, + ParseStdin, +} + +#[derive(Error, Debug)] +pub struct CommandError { + pub command_type: CommandType, + pub error: String, +} + +impl std::fmt::Display for CommandError { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + write!(f, "CommandError: {}", self.error) + } +} \ No newline at end of file diff --git a/toolchains/solidity/linter/solc-wrapper/src/solc/mod.rs b/toolchains/solidity/linter/solc-wrapper/src/solc/mod.rs new file mode 100644 index 00000000..fb5cfd3e --- /dev/null +++ b/toolchains/solidity/linter/solc-wrapper/src/solc/mod.rs @@ -0,0 +1,3 @@ +pub mod error; +pub mod command; +pub mod parsing_error; \ No newline at end of file diff --git a/toolchains/solidity/linter/solc-wrapper/src/solc/parsing_error.rs b/toolchains/solidity/linter/solc-wrapper/src/solc/parsing_error.rs new file mode 100644 index 00000000..199776d8 --- /dev/null +++ b/toolchains/solidity/linter/solc-wrapper/src/solc/parsing_error.rs @@ -0,0 +1,29 @@ +use thiserror::Error; + + + +#[derive(Error, Debug)] +pub struct ErrorLocation { + pub file: String, + pub line: usize, + pub column: usize, + pub length: usize +} + +#[derive(Error, Debug)] +pub struct ParsingError { + pub error: String, + pub location: ErrorLocation, +} + +impl std::fmt::Display for ErrorLocation { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + write!(f, "ErrorLocation in {} at line {}, column {}", self.file, self.line, self.column) + } +} + +impl std::fmt::Display for ParsingError { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + write!(f, "ParsingError: {}", self.error) + } +} \ No newline at end of file diff --git a/toolchains/solidity/linter/solc-wrapper/src/utils.rs b/toolchains/solidity/linter/solc-wrapper/src/utils.rs new file mode 100644 index 00000000..bad6ebd2 --- /dev/null +++ b/toolchains/solidity/linter/solc-wrapper/src/utils.rs @@ -0,0 +1,71 @@ +use regex::{Match, Regex}; +use once_cell::sync::Lazy; +use crate::solc::parsing_error::{ErrorLocation}; + +pub static RE_SOL_ERROR_PRINT: Lazy = Lazy::new(|| Regex::new(r"Error: (.*)\n").unwrap()); +pub static RE_SOL_ERROR_FILE: Lazy = Lazy::new(|| Regex::new(r"--> (?P.*):(?P\d+):(?P\d+):").unwrap()); +pub static RE_SOL_PRAGMA_VERSION: Lazy = Lazy::new(|| Regex::new(r"pragma\s+solidity\s+(?P\^?\d+\.\d+(?:\.\d+)?);").unwrap()); + +pub fn find_version_pragma(contract: &str) -> Option { + RE_SOL_PRAGMA_VERSION.captures(contract)?.name("version") +} + +fn count_length(error: String) -> usize { + let mut count = 0; + let mut n = error.len() - 3; + + while n > 0 { + if error.chars().nth(n).unwrap() == '\n' { + return count; + } + if error.chars().nth(n).unwrap() == '^' { + count += 1; + } + n-=1; + } + return count; +} + +pub fn get_error_message(stderr: &str) -> Result { + let error = RE_SOL_ERROR_PRINT.captures(stderr); + let error = match error { + Some(error) => error.get(0), + None => return Err(()) + }; + let error = match error { + Some(error) => error.as_str(), + None => return Err(()) + }; + let error = error.to_string(); + Ok(error) +} + +pub fn get_error_location(stderr: &str) -> Result { + let error = RE_SOL_ERROR_FILE.captures(stderr); + let error = match error { + Some(error) => error, + None => return Err(()) + }; + let file = match error.name("file") { + Some(file) => file.as_str().to_string(), + None => return Err(()) + }; + let line = match error.name("line") { + Some(line) => line.as_str().to_string(), + None => return Err(()) + }; + let column = match error.name("column") { + Some(line) => line.as_str().to_string(), + None => return Err(()) + }; + let length = count_length(stderr.to_string()); + + Ok( + ErrorLocation { + file, + line: line.parse().unwrap(), //unwrap is safe due to the regex that matches only number + column: column.parse().unwrap(), //unwrap is safe due to the regex that matches only number + length: length + } + ) +} \ No newline at end of file diff --git a/toolchains/solidity/linter/solc-wrapper/src/version/error.rs b/toolchains/solidity/linter/solc-wrapper/src/version/error.rs new file mode 100644 index 00000000..00d14e80 --- /dev/null +++ b/toolchains/solidity/linter/solc-wrapper/src/version/error.rs @@ -0,0 +1,19 @@ +use svm_lib::SolcVmError; +use thiserror::Error; + +use semver::Error; + +#[derive(Error, Debug)] +pub enum SolcVersionError { + #[error("SolcVersionError: Something went wrong with sevm")] + SevmFailed(#[from] SolcVmError), + + #[error("SolcVersionError: Can't do the compuation")] + ComputationFailed, + + #[error("SolcVersionError: Version failed")] + VersionFailed(#[from] Error), + + #[error("SolcVersionError: Wrong version of solidity")] + WrongVersion, +} diff --git a/toolchains/solidity/linter/solc-wrapper/src/version/mod.rs b/toolchains/solidity/linter/solc-wrapper/src/version/mod.rs new file mode 100644 index 00000000..b4e1bd83 --- /dev/null +++ b/toolchains/solidity/linter/solc-wrapper/src/version/mod.rs @@ -0,0 +1,2 @@ +pub mod error; +pub mod version; \ No newline at end of file diff --git a/toolchains/solidity/linter/solc-wrapper/src/version/version.rs b/toolchains/solidity/linter/solc-wrapper/src/version/version.rs new file mode 100644 index 00000000..fb22722b --- /dev/null +++ b/toolchains/solidity/linter/solc-wrapper/src/version/version.rs @@ -0,0 +1,87 @@ +use crate::utils; + +use semver::{Version, VersionReq}; +use std::{path::PathBuf}; + +use super::error::SolcVersionError; + +pub struct SolcVersion { + global_version_path: PathBuf +} + +impl Default for SolcVersion { + fn default() -> Self { + SolcVersion::new(Self::get_global_version_path()) + } +} + +impl SolcVersion { + pub fn new(path: impl Into) -> Self { + SolcVersion { global_version_path: path.into() } + } + + pub fn find_matching_version(&self, source: &str) -> Result { + let version_req = Self::source_version_req(source)?; + + if self.global_version_path.is_file() { + let installed_versions = Self::list_installed_versions()?; + let version = installed_versions.iter().find(|v| version_req.matches(v)); + if !version.is_none() { + return version.cloned().ok_or(SolcVersionError::ComputationFailed); + } + } + let remote_versions = Self::list_remote_versions()?; + let version = remote_versions.iter().find(|v| version_req.matches(v)); + version.cloned().ok_or(SolcVersionError::ComputationFailed) + } + + pub fn list_installed_versions() -> Result, SolcVersionError> { + Ok(svm_lib::installed_versions()?) + } + + pub fn get_global_version_path() -> PathBuf { + svm_lib::global_version_path() + } + + pub fn list_remote_versions() -> Result, SolcVersionError> { + Ok(svm_lib::blocking_all_versions()?) + } + + pub fn install_version(version: &Version) -> Result { + Ok(svm_lib::blocking_install(version)?) + } + + pub fn find_version_and_install(&self, version: &Version) -> Result { + // TODO optimize the code to only have to run it once and outside this function possibly + if self.global_version_path.is_file() { + let versions = svm_lib::installed_versions()?; + if !versions.is_empty() && versions.contains(&version) { + return Ok(svm_lib::version_path(&version.to_string()).join("solc-".to_owned() + version.to_string().as_str())); + } + } + Self::install_version(version) + } + + pub fn source_version_req(source: &str) -> Result { + let version = + utils::find_version_pragma(source).ok_or(SolcVersionError::WrongVersion)?; + Self::version_req(version.as_str()) + } + + /// Returns the corresponding SemVer version requirement for the solidity version + pub fn version_req(version: &str) -> Result { + let version = version.replace(' ', ","); + + // Somehow, Solidity semver without an operator is considered to be "exact", + // but lack of operator automatically marks the operator as Caret, so we need + // to manually patch it? :shrug: + let exact = !matches!(&version[0..1], "*" | "^" | "=" | ">" | "<" | "~"); + let mut version = VersionReq::parse(&version)?; + if exact { + version.comparators[0].op = semver::Op::Exact; + } + + Ok(version) + } + +} \ No newline at end of file diff --git a/toolchains/solidity/linter/solc-wrapper/tests/files/ast/Assignment.json b/toolchains/solidity/linter/solc-wrapper/tests/files/ast/Assignment.json new file mode 100644 index 00000000..ff0e828a --- /dev/null +++ b/toolchains/solidity/linter/solc-wrapper/tests/files/ast/Assignment.json @@ -0,0 +1,23 @@ +{ + "id": 141, + "leftHandSide": { + "id": 139, + "name": "_baseTokenURI", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "src": "2849:13:0", + "typeDescriptions": {} + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "id": 140, + "name": "initialBaseTokenURI", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "src": "2865:19:0", + "typeDescriptions": {} + }, + "src": "2849:35:0", + "typeDescriptions": {} +} \ No newline at end of file diff --git a/toolchains/solidity/linter/solc-wrapper/tests/files/ast/BinaryOperation.json b/toolchains/solidity/linter/solc-wrapper/tests/files/ast/BinaryOperation.json new file mode 100644 index 00000000..16df1b7f --- /dev/null +++ b/toolchains/solidity/linter/solc-wrapper/tests/files/ast/BinaryOperation.json @@ -0,0 +1,42 @@ +{ + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 18, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 16, + "name": "a", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 7, + "src": "203:1:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "&", + "rightExpression": { + "id": 17, + "name": "b", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 11, + "src": "207:1:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "203:5:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } +} \ No newline at end of file diff --git a/toolchains/solidity/linter/solc-wrapper/tests/files/ast/Block.json b/toolchains/solidity/linter/solc-wrapper/tests/files/ast/Block.json new file mode 100644 index 00000000..1e5d02e4 --- /dev/null +++ b/toolchains/solidity/linter/solc-wrapper/tests/files/ast/Block.json @@ -0,0 +1,6 @@ +{ + "id": 192, + "nodeType": "Block", + "src": "3511:148:0", + "statements": [] +} \ No newline at end of file diff --git a/toolchains/solidity/linter/solc-wrapper/tests/files/ast/Break.json b/toolchains/solidity/linter/solc-wrapper/tests/files/ast/Break.json new file mode 100644 index 00000000..714cc6c5 --- /dev/null +++ b/toolchains/solidity/linter/solc-wrapper/tests/files/ast/Break.json @@ -0,0 +1,5 @@ +{ + "id": 7, + "nodeType": "Break", + "src": "172:5:0" +} \ No newline at end of file diff --git a/toolchains/solidity/linter/solc-wrapper/tests/files/ast/Conditional.json b/toolchains/solidity/linter/solc-wrapper/tests/files/ast/Conditional.json new file mode 100644 index 00000000..14695b37 --- /dev/null +++ b/toolchains/solidity/linter/solc-wrapper/tests/files/ast/Conditional.json @@ -0,0 +1,61 @@ +{ + "condition": { + "hexValue": "74727565", + "id": 7, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "bool", + "lValueRequested": false, + "nodeType": "Literal", + "src": "158:4:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "value": "true" + }, + "falseExpression": { + "hexValue": "66616c7365", + "id": 9, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "bool", + "lValueRequested": false, + "nodeType": "Literal", + "src": "173:5:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "value": "false" + }, + "id": 10, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "Conditional", + "src": "158:20:0", + "trueExpression": { + "hexValue": "74727565", + "id": 8, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "bool", + "lValueRequested": false, + "nodeType": "Literal", + "src": "166:4:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "value": "true" + }, + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } +} \ No newline at end of file diff --git a/toolchains/solidity/linter/solc-wrapper/tests/files/ast/Continue.json b/toolchains/solidity/linter/solc-wrapper/tests/files/ast/Continue.json new file mode 100644 index 00000000..ec2f7f48 --- /dev/null +++ b/toolchains/solidity/linter/solc-wrapper/tests/files/ast/Continue.json @@ -0,0 +1,5 @@ +{ + "id": 7, + "nodeType": "Continue", + "src": "172:8:0" +} \ No newline at end of file diff --git a/toolchains/solidity/linter/solc-wrapper/tests/files/ast/ContractDefinition.json b/toolchains/solidity/linter/solc-wrapper/tests/files/ast/ContractDefinition.json new file mode 100644 index 00000000..be9b8e3b --- /dev/null +++ b/toolchains/solidity/linter/solc-wrapper/tests/files/ast/ContractDefinition.json @@ -0,0 +1,13 @@ +{ + "abstract": false, + "baseContracts": [], + "contractDependencies": [], + "contractKind": "contract", + "id": 427, + "name": "StartonERC721MetaTransaction", + "nameLocation": "792:28:0", + "nodeType": "ContractDefinition", + "nodes": [], + "src": "783:7774:0", + "usedErrors": [] +} \ No newline at end of file diff --git a/toolchains/solidity/linter/solc-wrapper/tests/files/ast/DoWhileStatement.json b/toolchains/solidity/linter/solc-wrapper/tests/files/ast/DoWhileStatement.json new file mode 100644 index 00000000..4eb3773d --- /dev/null +++ b/toolchains/solidity/linter/solc-wrapper/tests/files/ast/DoWhileStatement.json @@ -0,0 +1,33 @@ +{ + "body": { + "id": 7, + "nodeType": "Block", + "src": "148:33:0", + "statements": [ + { + "id": 6, + "nodeType": "Continue", + "src": "162:8:0" + } + ] + }, + "condition": { + "hexValue": "74727565", + "id": 8, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "bool", + "lValueRequested": false, + "nodeType": "Literal", + "src": "189:4:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "value": "true" + }, + "id": 9, + "nodeType": "DoWhileStatement", + "src": "145:50:0" +} \ No newline at end of file diff --git a/toolchains/solidity/linter/solc-wrapper/tests/files/ast/ElementaryTypeName.json b/toolchains/solidity/linter/solc-wrapper/tests/files/ast/ElementaryTypeName.json new file mode 100644 index 00000000..ed5e54f9 --- /dev/null +++ b/toolchains/solidity/linter/solc-wrapper/tests/files/ast/ElementaryTypeName.json @@ -0,0 +1,8 @@ +{ + "id": 64, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "1602:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": {} +} \ No newline at end of file diff --git a/toolchains/solidity/linter/solc-wrapper/tests/files/ast/ElementaryTypeNameExpression.json b/toolchains/solidity/linter/solc-wrapper/tests/files/ast/ElementaryTypeNameExpression.json new file mode 100644 index 00000000..cd4213f9 --- /dev/null +++ b/toolchains/solidity/linter/solc-wrapper/tests/files/ast/ElementaryTypeNameExpression.json @@ -0,0 +1,17 @@ +{ + "id":10, + "nodeType":"ElementaryTypeNameExpression", + "src":"156:7:0", + "typeDescriptions":{ + + }, + "typeName":{ + "id":9, + "name":"bytes32", + "nodeType":"ElementaryTypeName", + "src":"156:7:0", + "typeDescriptions":{ + + } + } +} \ No newline at end of file diff --git a/toolchains/solidity/linter/solc-wrapper/tests/files/ast/EmitStatement.json b/toolchains/solidity/linter/solc-wrapper/tests/files/ast/EmitStatement.json new file mode 100644 index 00000000..fbee8ec6 --- /dev/null +++ b/toolchains/solidity/linter/solc-wrapper/tests/files/ast/EmitStatement.json @@ -0,0 +1,42 @@ +{ + "eventCall": { + "arguments": [ + { + "arguments": [], + "expression": { + "id": 284, + "name": "_msgSender", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "src": "5557:10:0", + "typeDescriptions": {} + }, + "id": 285, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "5557:12:0", + "tryCall": false, + "typeDescriptions": {} + } + ], + "expression": { + "id": 283, + "name": "MetadataLocked", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "src": "5542:14:0", + "typeDescriptions": {} + }, + "id": 286, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "5542:28:0", + "tryCall": false, + "typeDescriptions": {} + }, + "id": 287, + "nodeType": "EmitStatement", + "src": "5537:33:0" +} diff --git a/toolchains/solidity/linter/solc-wrapper/tests/files/ast/EnumDefinition.json b/toolchains/solidity/linter/solc-wrapper/tests/files/ast/EnumDefinition.json new file mode 100644 index 00000000..a52239c5 --- /dev/null +++ b/toolchains/solidity/linter/solc-wrapper/tests/files/ast/EnumDefinition.json @@ -0,0 +1,24 @@ +{ + "canonicalName":"Test", + "id":4, + "members":[ + { + "id":2, + "name":"item1", + "nameLocation":"72:5:0", + "nodeType":"EnumValue", + "src":"72:5:0" + }, + { + "id":3, + "name":"item2", + "nameLocation":"79:5:0", + "nodeType":"EnumValue", + "src":"79:5:0" + } + ], + "name":"Test", + "nameLocation":"66:4:0", + "nodeType":"EnumDefinition", + "src":"61:25:0" +} \ No newline at end of file diff --git a/toolchains/solidity/linter/solc-wrapper/tests/files/ast/EnumValue.json b/toolchains/solidity/linter/solc-wrapper/tests/files/ast/EnumValue.json new file mode 100644 index 00000000..a3e3a12c --- /dev/null +++ b/toolchains/solidity/linter/solc-wrapper/tests/files/ast/EnumValue.json @@ -0,0 +1,7 @@ +{ + "id":2, + "name": "item1", + "nameLocation": "72:5:0", + "nodeType": "EnumValue", + "src": "72:5:0" +} \ No newline at end of file diff --git a/toolchains/solidity/linter/solc-wrapper/tests/files/ast/ErrorDefinition.json b/toolchains/solidity/linter/solc-wrapper/tests/files/ast/ErrorDefinition.json new file mode 100644 index 00000000..d93579bb --- /dev/null +++ b/toolchains/solidity/linter/solc-wrapper/tests/files/ast/ErrorDefinition.json @@ -0,0 +1,15 @@ +{ + "id":3, + "name":"No", + "nameLocation":"92:2:0", + "nodeType":"ErrorDefinition", + "parameters":{ + "id":2, + "nodeType":"ParameterList", + "parameters":[ + + ], + "src":"94:2:0" + }, + "src":"86:11:0" +} \ No newline at end of file diff --git a/toolchains/solidity/linter/solc-wrapper/tests/files/ast/EventDefinition.json b/toolchains/solidity/linter/solc-wrapper/tests/files/ast/EventDefinition.json new file mode 100644 index 00000000..f204ee06 --- /dev/null +++ b/toolchains/solidity/linter/solc-wrapper/tests/files/ast/EventDefinition.json @@ -0,0 +1,20 @@ +{ + "anonymous": false, + "documentation": { + "id": 63, + "nodeType": "StructuredDocumentation", + "src": "1522:55:0", + "text": "@notice Event emitted when the minting is locked " + }, + "id": 67, + "name": "MintingLocked", + "nameLocation": "1588:13:0", + "nodeType": "EventDefinition", + "parameters": { + "id": 66, + "nodeType": "ParameterList", + "parameters": [], + "src": "1601:25:0" + }, + "src": "1582:45:0" +} diff --git a/toolchains/solidity/linter/solc-wrapper/tests/files/ast/ExpressionStatement.json b/toolchains/solidity/linter/solc-wrapper/tests/files/ast/ExpressionStatement.json new file mode 100644 index 00000000..efd8766d --- /dev/null +++ b/toolchains/solidity/linter/solc-wrapper/tests/files/ast/ExpressionStatement.json @@ -0,0 +1,29 @@ +{ + "expression": { + "id": 153, + "leftHandSide": { + "id": 151, + "name": "_isMetatadataChangingAllowed", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "src": "2968:28:0", + "typeDescriptions": {} + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "hexValue": "74727565", + "id": 152, + "kind": "bool", + "nodeType": "Literal", + "src": "2999:4:0", + "typeDescriptions": {}, + "value": "true" + }, + "src": "2968:35:0", + "typeDescriptions": {} + }, + "id": 154, + "nodeType": "ExpressionStatement", + "src": "2968:35:0" +} \ No newline at end of file diff --git a/toolchains/solidity/linter/solc-wrapper/tests/files/ast/ForStatement.json b/toolchains/solidity/linter/solc-wrapper/tests/files/ast/ForStatement.json new file mode 100644 index 00000000..21dfa622 --- /dev/null +++ b/toolchains/solidity/linter/solc-wrapper/tests/files/ast/ForStatement.json @@ -0,0 +1,148 @@ +{ + "body": { + "id": 17, + "nodeType": "Block", + "src": "175:30:0", + "statements": [ + { + "id": 16, + "nodeType": "Break", + "src": "189:5:0" + } + ] + }, + "condition": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 12, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 10, + "name": "i", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 7, + "src": "162:1:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "<", + "rightExpression": { + "hexValue": "3130", + "id": 11, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "166:2:0", + "typeDescriptions": { + "typeIdentifier": "t_rational_10_by_1", + "typeString": "int_const 10" + }, + "value": "10" + }, + "src": "162:6:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 18, + "initializationExpression": { + "assignments": [ + 7 + ], + "declarations": [ + { + "constant": false, + "id": 7, + "mutability": "mutable", + "name": "i", + "nameLocation": "155:1:0", + "nodeType": "VariableDeclaration", + "scope": 18, + "src": "150:6:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 6, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "150:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "id": 9, + "initialValue": { + "hexValue": "30", + "id": 8, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "159:1:0", + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "nodeType": "VariableDeclarationStatement", + "src": "150:10:0" + }, + "loopExpression": { + "expression": { + "id": 14, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "UnaryOperation", + "operator": "++", + "prefix": false, + "src": "170:3:0", + "subExpression": { + "id": 13, + "name": "i", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 7, + "src": "170:1:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 15, + "nodeType": "ExpressionStatement", + "src": "170:3:0" + }, + "nodeType": "ForStatement", + "src": "145:60:0" +} \ No newline at end of file diff --git a/toolchains/solidity/linter/solc-wrapper/tests/files/ast/FunctionCall.json b/toolchains/solidity/linter/solc-wrapper/tests/files/ast/FunctionCall.json new file mode 100644 index 00000000..391d05f5 --- /dev/null +++ b/toolchains/solidity/linter/solc-wrapper/tests/files/ast/FunctionCall.json @@ -0,0 +1,39 @@ +{ + "arguments": [ + { + "hexValue": "4d696e74696e67206973206c6f636b6564", + "id": 76, + "name": "_isMintAllowed", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "src": "1858:14:0", + "typeDescriptions": {}, + "kind": "string", + "value": "Minting is locked" + }, + { + "hexValue": "4d696e74696e67206973206c6f636b6564", + "id": 77, + "kind": "string", + "nodeType": "Literal", + "src": "1874:19:0", + "typeDescriptions": {}, + "value": "Minting is locked" + } + ], + "expression": { + "id": 75, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "src": "1850:7:0", + "typeDescriptions": {} + }, + "id": 78, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "1850:44:0", + "tryCall": false, + "typeDescriptions": {} +} \ No newline at end of file diff --git a/toolchains/solidity/linter/solc-wrapper/tests/files/ast/FunctionCallOptions.json b/toolchains/solidity/linter/solc-wrapper/tests/files/ast/FunctionCallOptions.json new file mode 100644 index 00000000..64fe122e --- /dev/null +++ b/toolchains/solidity/linter/solc-wrapper/tests/files/ast/FunctionCallOptions.json @@ -0,0 +1,57 @@ +{ + "expression":{ + "expression":{ + "id":16, + "name":"otherContract", + "nodeType":"Identifier", + "overloadedDeclarations":[ + + ], + "src":"236:13:0", + "typeDescriptions":{ + + } + }, + "id":18, + "memberLocation":"250:4:0", + "memberName":"call", + "nodeType":"MemberAccess", + "src":"236:18:0", + "typeDescriptions":{ + + } + }, + "id":21, + "names":[ + "value" + ], + "nodeType":"FunctionCallOptions", + "options":[ + { + "expression":{ + "id":19, + "name":"msg", + "nodeType":"Identifier", + "overloadedDeclarations":[ + + ], + "src":"262:3:0", + "typeDescriptions":{ + + } + }, + "id":20, + "memberLocation":"266:5:0", + "memberName":"value", + "nodeType":"MemberAccess", + "src":"262:9:0", + "typeDescriptions":{ + + } + } + ], + "src":"236:36:0", + "typeDescriptions":{ + + } +} \ No newline at end of file diff --git a/toolchains/solidity/linter/solc-wrapper/tests/files/ast/FunctionDefinition.json b/toolchains/solidity/linter/solc-wrapper/tests/files/ast/FunctionDefinition.json new file mode 100644 index 00000000..3158d372 --- /dev/null +++ b/toolchains/solidity/linter/solc-wrapper/tests/files/ast/FunctionDefinition.json @@ -0,0 +1,31 @@ +{ + "body": { + "id": 192, + "nodeType": "Block", + "src": "3511:148:0", + "statements": [] + }, + "id": 193, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "mint", + "nameLocation": "3401:4:0", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 166, + "nodeType": "ParameterList", + "parameters": [], + "src": "3405:31:0" + }, + "returnParameters": { + "id": 172, + "nodeType": "ParameterList", + "parameters": [], + "src": "3511:0:0" + }, + "src": "3392:267:0", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "public" +} \ No newline at end of file diff --git a/toolchains/solidity/linter/solc-wrapper/tests/files/ast/FunctionTypeName.json b/toolchains/solidity/linter/solc-wrapper/tests/files/ast/FunctionTypeName.json new file mode 100644 index 00000000..2a593dc7 --- /dev/null +++ b/toolchains/solidity/linter/solc-wrapper/tests/files/ast/FunctionTypeName.json @@ -0,0 +1,72 @@ +{ + "id":11, + "nodeType":"FunctionTypeName", + "parameterTypes":{ + "id":7, + "nodeType":"ParameterList", + "parameters":[ + { + "constant":false, + "id":6, + "mutability":"mutable", + "name":"", + "nameLocation":"-1:-1:-1", + "nodeType":"VariableDeclaration", + "src":"270:4:0", + "stateVariable":false, + "storageLocation":"default", + "typeDescriptions":{ + + }, + "typeName":{ + "id":5, + "name":"uint", + "nodeType":"ElementaryTypeName", + "src":"270:4:0", + "typeDescriptions":{ + + } + }, + "visibility":"internal" + } + ], + "src":"269:6:0" + }, + "returnParameterTypes":{ + "id":10, + "nodeType":"ParameterList", + "parameters":[ + { + "constant":false, + "id":9, + "mutability":"mutable", + "name":"", + "nameLocation":"-1:-1:-1", + "nodeType":"VariableDeclaration", + "src":"290:4:0", + "stateVariable":false, + "storageLocation":"default", + "typeDescriptions":{ + + }, + "typeName":{ + "id":8, + "name":"uint", + "nodeType":"ElementaryTypeName", + "src":"290:4:0", + "typeDescriptions":{ + + } + }, + "visibility":"internal" + } + ], + "src":"289:6:0" + }, + "src":"260:37:0", + "stateMutability":"pure", + "typeDescriptions":{ + + }, + "visibility":"internal" +} diff --git a/toolchains/solidity/linter/solc-wrapper/tests/files/ast/Identifier.json b/toolchains/solidity/linter/solc-wrapper/tests/files/ast/Identifier.json new file mode 100644 index 00000000..b2a4cccb --- /dev/null +++ b/toolchains/solidity/linter/solc-wrapper/tests/files/ast/Identifier.json @@ -0,0 +1,12 @@ +{ + "id": 16, + "name": "a", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 7, + "src": "203:1:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } +} \ No newline at end of file diff --git a/toolchains/solidity/linter/solc-wrapper/tests/files/ast/IfStatement.json b/toolchains/solidity/linter/solc-wrapper/tests/files/ast/IfStatement.json new file mode 100644 index 00000000..aee61e1c --- /dev/null +++ b/toolchains/solidity/linter/solc-wrapper/tests/files/ast/IfStatement.json @@ -0,0 +1,167 @@ +{ + "condition":{ + "commonType":{ + "typeIdentifier":"t_uint8", + "typeString":"uint8" + }, + "id":8, + "isConstant":false, + "isLValue":false, + "isPure":true, + "lValueRequested":false, + "leftExpression":{ + "hexValue":"31", + "id":6, + "isConstant":false, + "isLValue":false, + "isPure":true, + "kind":"number", + "lValueRequested":false, + "nodeType":"Literal", + "src":"149:1:0", + "typeDescriptions":{ + "typeIdentifier":"t_rational_1_by_1", + "typeString":"int_const 1" + }, + "value":"1" + }, + "nodeType":"BinaryOperation", + "operator":"==", + "rightExpression":{ + "hexValue":"32", + "id":7, + "isConstant":false, + "isLValue":false, + "isPure":true, + "kind":"number", + "lValueRequested":false, + "nodeType":"Literal", + "src":"154:1:0", + "typeDescriptions":{ + "typeIdentifier":"t_rational_2_by_1", + "typeString":"int_const 2" + }, + "value":"2" + }, + "src":"149:6:0", + "typeDescriptions":{ + "typeIdentifier":"t_bool", + "typeString":"bool" + } + }, + "falseBody":{ + "id":18, + "nodeType":"Block", + "src":"205:43:0", + "statements":[ + { + "expression":{ + "id":16, + "isConstant":false, + "isLValue":false, + "isPure":false, + "lValueRequested":false, + "leftHandSide":{ + "id":14, + "name":"goStraight", + "nodeType":"Identifier", + "overloadedDeclarations":[ + + ], + "referencedDeclaration":3, + "src":"219:10:0", + "typeDescriptions":{ + "typeIdentifier":"t_bool", + "typeString":"bool" + } + }, + "nodeType":"Assignment", + "operator":"=", + "rightHandSide":{ + "hexValue":"66616c7365", + "id":15, + "isConstant":false, + "isLValue":false, + "isPure":true, + "kind":"bool", + "lValueRequested":false, + "nodeType":"Literal", + "src":"232:5:0", + "typeDescriptions":{ + "typeIdentifier":"t_bool", + "typeString":"bool" + }, + "value":"false" + }, + "src":"219:18:0", + "typeDescriptions":{ + "typeIdentifier":"t_bool", + "typeString":"bool" + } + }, + "id":17, + "nodeType":"ExpressionStatement", + "src":"219:18:0" + } + ] + }, + "id":19, + "nodeType":"IfStatement", + "src":"145:103:0", + "trueBody":{ + "id":13, + "nodeType":"Block", + "src":"157:42:0", + "statements":[ + { + "expression":{ + "id":11, + "isConstant":false, + "isLValue":false, + "isPure":false, + "lValueRequested":false, + "leftHandSide":{ + "id":9, + "name":"goStraight", + "nodeType":"Identifier", + "overloadedDeclarations":[ + + ], + "referencedDeclaration":3, + "src":"171:10:0", + "typeDescriptions":{ + "typeIdentifier":"t_bool", + "typeString":"bool" + } + }, + "nodeType":"Assignment", + "operator":"=", + "rightHandSide":{ + "hexValue":"74727565", + "id":10, + "isConstant":false, + "isLValue":false, + "isPure":true, + "kind":"bool", + "lValueRequested":false, + "nodeType":"Literal", + "src":"184:4:0", + "typeDescriptions":{ + "typeIdentifier":"t_bool", + "typeString":"bool" + }, + "value":"true" + }, + "src":"171:17:0", + "typeDescriptions":{ + "typeIdentifier":"t_bool", + "typeString":"bool" + } + }, + "id":12, + "nodeType":"ExpressionStatement", + "src":"171:17:0" + } + ] + } +} \ No newline at end of file diff --git a/toolchains/solidity/linter/solc-wrapper/tests/files/ast/ImportDirective.json b/toolchains/solidity/linter/solc-wrapper/tests/files/ast/ImportDirective.json new file mode 100644 index 00000000..64f0a282 --- /dev/null +++ b/toolchains/solidity/linter/solc-wrapper/tests/files/ast/ImportDirective.json @@ -0,0 +1,10 @@ +{ + "absolutePath": "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol", + "file": "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol", + "id": 2, + "nameLocation": "-1:-1:-1", + "nodeType": "ImportDirective", + "src": "58:78:0", + "symbolAliases": [], + "unitAlias": "" +} \ No newline at end of file diff --git a/toolchains/solidity/linter/solc-wrapper/tests/files/ast/IndexAccess.json b/toolchains/solidity/linter/solc-wrapper/tests/files/ast/IndexAccess.json new file mode 100644 index 00000000..aa2ea6d6 --- /dev/null +++ b/toolchains/solidity/linter/solc-wrapper/tests/files/ast/IndexAccess.json @@ -0,0 +1,32 @@ +{ + "baseExpression":{ + "id":12, + "name":"pls", + "nodeType":"Identifier", + "overloadedDeclarations":[ + + ], + "src":"203:3:0", + "typeDescriptions":{ + + } + }, + "id":14, + "indexExpression":{ + "id":13, + "name":"index", + "nodeType":"Identifier", + "overloadedDeclarations":[ + + ], + "src":"207:5:0", + "typeDescriptions":{ + + } + }, + "nodeType":"IndexAccess", + "src":"203:10:0", + "typeDescriptions":{ + + } +} \ No newline at end of file diff --git a/toolchains/solidity/linter/solc-wrapper/tests/files/ast/IndexRangeAccess.json b/toolchains/solidity/linter/solc-wrapper/tests/files/ast/IndexRangeAccess.json new file mode 100644 index 00000000..6799147e --- /dev/null +++ b/toolchains/solidity/linter/solc-wrapper/tests/files/ast/IndexRangeAccess.json @@ -0,0 +1,31 @@ +{ + "baseExpression":{ + "id":10, + "name":"cheh", + "nodeType":"Identifier", + "overloadedDeclarations":[ + + ], + "src":"174:4:0", + "typeDescriptions":{ + + } + }, + "endExpression":{ + "hexValue":"33", + "id":11, + "kind":"number", + "nodeType":"Literal", + "src":"180:1:0", + "typeDescriptions":{ + + }, + "value":"3" + }, + "id":12, + "nodeType":"IndexRangeAccess", + "src":"174:8:0", + "typeDescriptions":{ + + } +} \ No newline at end of file diff --git a/toolchains/solidity/linter/solc-wrapper/tests/files/ast/InheritanceSpecifier.json b/toolchains/solidity/linter/solc-wrapper/tests/files/ast/InheritanceSpecifier.json new file mode 100644 index 00000000..4d7ace84 --- /dev/null +++ b/toolchains/solidity/linter/solc-wrapper/tests/files/ast/InheritanceSpecifier.json @@ -0,0 +1,14 @@ +{ + "baseName": { + "id": 12, + "name": "ERC721Enumerable", + "nameLocations": [ + "828:16:0" + ], + "nodeType": "IdentifierPath", + "src": "828:16:0" + }, + "id": 13, + "nodeType": "InheritanceSpecifier", + "src": "828:16:0" +} diff --git a/toolchains/solidity/linter/solc-wrapper/tests/files/ast/InlineAssembly.json b/toolchains/solidity/linter/solc-wrapper/tests/files/ast/InlineAssembly.json new file mode 100644 index 00000000..57caaa4e --- /dev/null +++ b/toolchains/solidity/linter/solc-wrapper/tests/files/ast/InlineAssembly.json @@ -0,0 +1,12 @@ +{ + "AST":{ + + }, + "evmVersion":"london", + "externalReferences":[ + + ], + "id":9, + "nodeType":"InlineAssembly", + "src":"176:50:0" +} diff --git a/toolchains/solidity/linter/solc-wrapper/tests/files/ast/Literal.json b/toolchains/solidity/linter/solc-wrapper/tests/files/ast/Literal.json new file mode 100644 index 00000000..2485266e --- /dev/null +++ b/toolchains/solidity/linter/solc-wrapper/tests/files/ast/Literal.json @@ -0,0 +1,9 @@ +{ + "hexValue": "4d696e74696e67206973206c6f636b6564", + "id": 77, + "kind": "string", + "nodeType": "Literal", + "src": "1874:19:0", + "typeDescriptions": {}, + "value": "Minting is locked" +} \ No newline at end of file diff --git a/toolchains/solidity/linter/solc-wrapper/tests/files/ast/MemberAccess.json b/toolchains/solidity/linter/solc-wrapper/tests/files/ast/MemberAccess.json new file mode 100644 index 00000000..bd935f36 --- /dev/null +++ b/toolchains/solidity/linter/solc-wrapper/tests/files/ast/MemberAccess.json @@ -0,0 +1,16 @@ +{ + "expression": { + "id": 175, + "name": "_tokenIdCounter", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "src": "3535:15:0", + "typeDescriptions": {} + }, + "id": 176, + "memberLocation": "3551:7:0", + "memberName": "current", + "nodeType": "MemberAccess", + "src": "3535:23:0", + "typeDescriptions": {} +} \ No newline at end of file diff --git a/toolchains/solidity/linter/solc-wrapper/tests/files/ast/ModifierDefinition.json b/toolchains/solidity/linter/solc-wrapper/tests/files/ast/ModifierDefinition.json new file mode 100644 index 00000000..033a6ecf --- /dev/null +++ b/toolchains/solidity/linter/solc-wrapper/tests/files/ast/ModifierDefinition.json @@ -0,0 +1,74 @@ +{ + "body": { + "id": 91, + "nodeType": "Block", + "src": "2015:75:0", + "statements": [ + { + "expression": { + "arguments": [ + { + "id": 86, + "name": "_isMintAllowed", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "src": "2033:14:0", + "typeDescriptions": {} + }, + { + "hexValue": "4d657461646174617320617265206c6f636b6564", + "id": 87, + "kind": "string", + "nodeType": "Literal", + "src": "2049:22:0", + "typeDescriptions": {}, + "value": "Metadatas are locked" + } + ], + "expression": { + "id": 85, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "src": "2025:7:0", + "typeDescriptions": {} + }, + "id": 88, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "2025:47:0", + "tryCall": false, + "typeDescriptions": {} + }, + "id": 89, + "nodeType": "ExpressionStatement", + "src": "2025:47:0" + }, + { + "id": 90, + "nodeType": "PlaceholderStatement", + "src": "2082:1:0" + } + ] + }, + "documentation": { + "id": 83, + "nodeType": "StructuredDocumentation", + "src": "1918:63:0", + "text": "@dev Modifier that reverts when the metadatas are locked " + }, + "id": 92, + "name": "metadataNotLocked", + "nameLocation": "1995:17:0", + "nodeType": "ModifierDefinition", + "parameters": { + "id": 84, + "nodeType": "ParameterList", + "parameters": [], + "src": "2012:2:0" + }, + "src": "1986:104:0", + "virtual": false, + "visibility": "internal" +} diff --git a/toolchains/solidity/linter/solc-wrapper/tests/files/ast/ModifierInvocation.json b/toolchains/solidity/linter/solc-wrapper/tests/files/ast/ModifierInvocation.json new file mode 100644 index 00000000..3e8f4eee --- /dev/null +++ b/toolchains/solidity/linter/solc-wrapper/tests/files/ast/ModifierInvocation.json @@ -0,0 +1,14 @@ +{ + "id": 274, + "modifierName": { + "id": 273, + "name": "whenNotPaused", + "nameLocations": [ + "5445:13:0" + ], + "nodeType": "IdentifierPath", + "src": "5445:13:0" + }, + "nodeType": "ModifierInvocation", + "src": "5445:13:0" +} diff --git a/toolchains/solidity/linter/solc-wrapper/tests/files/ast/NewExpression.json b/toolchains/solidity/linter/solc-wrapper/tests/files/ast/NewExpression.json new file mode 100644 index 00000000..fb6494e7 --- /dev/null +++ b/toolchains/solidity/linter/solc-wrapper/tests/files/ast/NewExpression.json @@ -0,0 +1,25 @@ +{ + "id":7, + "nodeType":"NewExpression", + "src":"131:6:0", + "typeDescriptions":{ + + }, + "typeName":{ + "id":6, + "nodeType":"UserDefinedTypeName", + "pathNode":{ + "id":5, + "name":"Ok", + "nameLocations":[ + "135:2:0" + ], + "nodeType":"IdentifierPath", + "src":"135:2:0" + }, + "src":"135:2:0", + "typeDescriptions":{ + + } + } +} \ No newline at end of file diff --git a/toolchains/solidity/linter/solc-wrapper/tests/files/ast/ParameterList.json b/toolchains/solidity/linter/solc-wrapper/tests/files/ast/ParameterList.json new file mode 100644 index 00000000..6b6abd8b --- /dev/null +++ b/toolchains/solidity/linter/solc-wrapper/tests/files/ast/ParameterList.json @@ -0,0 +1,27 @@ +{ + "id": 197, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 196, + "mutability": "mutable", + "name": "newContractURI", + "nameLocation": "3919:14:0", + "nodeType": "VariableDeclaration", + "src": "3905:28:0", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": {}, + "typeName": { + "id": 195, + "name": "string", + "nodeType": "ElementaryTypeName", + "src": "3905:6:0", + "typeDescriptions": {} + }, + "visibility": "internal" + } + ], + "src": "3904:30:0" +} \ No newline at end of file diff --git a/toolchains/solidity/linter/solc-wrapper/tests/files/ast/PlaceholderStatement.json b/toolchains/solidity/linter/solc-wrapper/tests/files/ast/PlaceholderStatement.json new file mode 100644 index 00000000..b2c8fac2 --- /dev/null +++ b/toolchains/solidity/linter/solc-wrapper/tests/files/ast/PlaceholderStatement.json @@ -0,0 +1,5 @@ +{ + "id": 80, + "nodeType": "PlaceholderStatement", + "src": "1904:1:0" +} \ No newline at end of file diff --git a/toolchains/solidity/linter/solc-wrapper/tests/files/ast/PragmaDirective.json b/toolchains/solidity/linter/solc-wrapper/tests/files/ast/PragmaDirective.json new file mode 100644 index 00000000..88b94d2e --- /dev/null +++ b/toolchains/solidity/linter/solc-wrapper/tests/files/ast/PragmaDirective.json @@ -0,0 +1,10 @@ +{ + "id": 1, + "literals": [ + "solidity", + "0.8", + ".16" + ], + "nodeType": "PragmaDirective", + "src": "33:23:0" +} diff --git a/toolchains/solidity/linter/solc-wrapper/tests/files/ast/Return.json b/toolchains/solidity/linter/solc-wrapper/tests/files/ast/Return.json new file mode 100644 index 00000000..94882bcc --- /dev/null +++ b/toolchains/solidity/linter/solc-wrapper/tests/files/ast/Return.json @@ -0,0 +1,13 @@ +{ + "expression": { + "id": 295, + "name": "_contractURI", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "src": "5768:12:0", + "typeDescriptions": {} + }, + "id": 296, + "nodeType": "Return", + "src": "5761:19:0" +} diff --git a/toolchains/solidity/linter/solc-wrapper/tests/files/ast/RevertStatement.json b/toolchains/solidity/linter/solc-wrapper/tests/files/ast/RevertStatement.json new file mode 100644 index 00000000..674afc60 --- /dev/null +++ b/toolchains/solidity/linter/solc-wrapper/tests/files/ast/RevertStatement.json @@ -0,0 +1,36 @@ +{ + "errorCall": { + "arguments": [], + "expression": { + "argumentTypes": [], + "id": 6, + "name": "Pls", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3, + "src": "125:3:0", + "typeDescriptions": { + "typeIdentifier": "t_function_error_pure$__$returns$__$", + "typeString": "function () pure" + } + }, + "id": 7, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "125:5:0", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 8, + "nodeType": "RevertStatement", + "src": "118:12:0" +} diff --git a/toolchains/solidity/linter/solc-wrapper/tests/files/ast/SourceUnit.json b/toolchains/solidity/linter/solc-wrapper/tests/files/ast/SourceUnit.json new file mode 100644 index 00000000..cfb0f0b2 --- /dev/null +++ b/toolchains/solidity/linter/solc-wrapper/tests/files/ast/SourceUnit.json @@ -0,0 +1,8 @@ +{ + "absolutePath": "wow.sol", + "id": 428, + "license": "MIT", + "nodeType": "SourceUnit", + "nodes": [], + "src": "33:8524:0" +} \ No newline at end of file diff --git a/toolchains/solidity/linter/solc-wrapper/tests/files/ast/StructDefinition.json b/toolchains/solidity/linter/solc-wrapper/tests/files/ast/StructDefinition.json new file mode 100644 index 00000000..c28ab437 --- /dev/null +++ b/toolchains/solidity/linter/solc-wrapper/tests/files/ast/StructDefinition.json @@ -0,0 +1,66 @@ +{ + "canonicalName": "S", + "id": 6, + "members": [ + { + "constant": false, + "id": 3, + "mutability": "mutable", + "name": "x", + "nameLocation": "82:1:0", + "nodeType": "VariableDeclaration", + "scope": 6, + "src": "77:6:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 2, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "77:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 5, + "mutability": "mutable", + "name": "y", + "nameLocation": "94:1:0", + "nodeType": "VariableDeclaration", + "scope": 6, + "src": "89:6:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 4, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "89:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "name": "S", + "nameLocation": "69:1:0", + "nodeType": "StructDefinition", + "scope": 27, + "src": "62:36:0", + "visibility": "public" +} \ No newline at end of file diff --git a/toolchains/solidity/linter/solc-wrapper/tests/files/ast/StructuredDocumentation.json b/toolchains/solidity/linter/solc-wrapper/tests/files/ast/StructuredDocumentation.json new file mode 100644 index 00000000..9263e3f1 --- /dev/null +++ b/toolchains/solidity/linter/solc-wrapper/tests/files/ast/StructuredDocumentation.json @@ -0,0 +1,6 @@ +{ + "id": 63, + "nodeType": "StructuredDocumentation", + "src": "1522:55:0", + "text": "@notice Event emitted when the minting is locked " +} \ No newline at end of file diff --git a/toolchains/solidity/linter/solc-wrapper/tests/files/ast/TryStatement.json b/toolchains/solidity/linter/solc-wrapper/tests/files/ast/TryStatement.json new file mode 100644 index 00000000..6cda0cc1 --- /dev/null +++ b/toolchains/solidity/linter/solc-wrapper/tests/files/ast/TryStatement.json @@ -0,0 +1,244 @@ +{ + "clauses": [ + { + "block": { + "id": 87, + "nodeType": "Block", + "src": "1026:41:0", + "statements": [ + { + "eventCall": { + "arguments": [ + { + "id": 84, + "name": "result", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 81, + "src": "1049:6:0", + "typeDescriptions": { + "typeIdentifier": "t_string_memory_ptr", + "typeString": "string memory" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_string_memory_ptr", + "typeString": "string memory" + } + ], + "id": 83, + "name": "Log", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 51, + "src": "1045:3:0", + "typeDescriptions": { + "typeIdentifier": "t_function_event_nonpayable$_t_string_memory_ptr_$returns$__$", + "typeString": "function (string memory)" + } + }, + "id": 85, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "1045:11:0", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 86, + "nodeType": "EmitStatement", + "src": "1040:16:0" + } + ] + }, + "errorName": "", + "id": 88, + "nodeType": "TryCatchClause", + "parameters": { + "id": 82, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 81, + "mutability": "mutable", + "name": "result", + "nameLocation": "1018:6:0", + "nodeType": "VariableDeclaration", + "scope": 88, + "src": "1004:20:0", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_string_memory_ptr", + "typeString": "string" + }, + "typeName": { + "id": 80, + "name": "string", + "nodeType": "ElementaryTypeName", + "src": "1004:6:0", + "typeDescriptions": { + "typeIdentifier": "t_string_storage_ptr", + "typeString": "string" + } + }, + "visibility": "internal" + } + ], + "src": "1003:22:0" + }, + "src": "995:72:0" + }, + { + "block": { + "id": 93, + "nodeType": "Block", + "src": "1074:57:0", + "statements": [ + { + "eventCall": { + "arguments": [ + { + "hexValue": "65787465726e616c2063616c6c206661696c6564", + "id": 90, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "1097:22:0", + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_e0e3f7224ce5e493e1d6652b2633dc31e8929d0dd88f4f97ce03f976e5157351", + "typeString": "literal_string \"external call failed\"" + }, + "value": "external call failed" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_stringliteral_e0e3f7224ce5e493e1d6652b2633dc31e8929d0dd88f4f97ce03f976e5157351", + "typeString": "literal_string \"external call failed\"" + } + ], + "id": 89, + "name": "Log", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 51, + "src": "1093:3:0", + "typeDescriptions": { + "typeIdentifier": "t_function_event_nonpayable$_t_string_memory_ptr_$returns$__$", + "typeString": "function (string memory)" + } + }, + "id": 91, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "1093:27:0", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 92, + "nodeType": "EmitStatement", + "src": "1088:32:0" + } + ] + }, + "errorName": "", + "id": 94, + "nodeType": "TryCatchClause", + "src": "1068:63:0" + } + ], + "externalCall": { + "arguments": [ + { + "id": 78, + "name": "_i", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 73, + "src": "991:2:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "expression": { + "id": 76, + "name": "foo", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 58, + "src": "980:3:0", + "typeDescriptions": { + "typeIdentifier": "t_contract$_Foo_$47", + "typeString": "contract Foo" + } + }, + "id": 77, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "984:6:0", + "memberName": "myFunc", + "nodeType": "MemberAccess", + "referencedDeclaration": 46, + "src": "980:10:0", + "typeDescriptions": { + "typeIdentifier": "t_function_external_pure$_t_uint256_$returns$_t_string_memory_ptr_$", + "typeString": "function (uint256) pure external returns (string memory)" + } + }, + "id": 79, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "980:14:0", + "tryCall": true, + "typeDescriptions": { + "typeIdentifier": "t_string_memory_ptr", + "typeString": "string memory" + } + }, + "id": 95, + "nodeType": "TryStatement", + "src": "976:155:0" +} \ No newline at end of file diff --git a/toolchains/solidity/linter/solc-wrapper/tests/files/ast/TupleExpression.json b/toolchains/solidity/linter/solc-wrapper/tests/files/ast/TupleExpression.json new file mode 100644 index 00000000..83397dc2 --- /dev/null +++ b/toolchains/solidity/linter/solc-wrapper/tests/files/ast/TupleExpression.json @@ -0,0 +1,44 @@ +{ + "components":[ + { + "hexValue":"37", + "id":13, + "kind":"number", + "nodeType":"Literal", + "src":"151:1:0", + "typeDescriptions":{ + + }, + "value":"7" + }, + { + "hexValue":"74727565", + "id":14, + "kind":"bool", + "nodeType":"Literal", + "src":"154:4:0", + "typeDescriptions":{ + + }, + "value":"true" + }, + { + "hexValue":"32", + "id":15, + "kind":"number", + "nodeType":"Literal", + "src":"160:1:0", + "typeDescriptions":{ + + }, + "value":"2" + } + ], + "id":16, + "isInlineArray":false, + "nodeType":"TupleExpression", + "src":"150:12:0", + "typeDescriptions":{ + + } +} \ No newline at end of file diff --git a/toolchains/solidity/linter/solc-wrapper/tests/files/ast/TypeDescriptions.json b/toolchains/solidity/linter/solc-wrapper/tests/files/ast/TypeDescriptions.json new file mode 100644 index 00000000..622d7e8f --- /dev/null +++ b/toolchains/solidity/linter/solc-wrapper/tests/files/ast/TypeDescriptions.json @@ -0,0 +1,4 @@ +{ + "typeIdentifier": "t_bool", + "typeString": "bool" +} \ No newline at end of file diff --git a/toolchains/solidity/linter/solc-wrapper/tests/files/ast/UnaryOperation.json b/toolchains/solidity/linter/solc-wrapper/tests/files/ast/UnaryOperation.json new file mode 100644 index 00000000..84ecbd0f --- /dev/null +++ b/toolchains/solidity/linter/solc-wrapper/tests/files/ast/UnaryOperation.json @@ -0,0 +1,22 @@ +{ + "id":7, + "nodeType":"UnaryOperation", + "operator":"++", + "prefix":false, + "src":"104:6:0", + "subExpression":{ + "id":6, + "name":"test", + "nodeType":"Identifier", + "overloadedDeclarations":[ + + ], + "src":"104:4:0", + "typeDescriptions":{ + + } + }, + "typeDescriptions":{ + + } +} \ No newline at end of file diff --git a/toolchains/solidity/linter/solc-wrapper/tests/files/ast/UncheckedBlock.json b/toolchains/solidity/linter/solc-wrapper/tests/files/ast/UncheckedBlock.json new file mode 100644 index 00000000..e3be941a --- /dev/null +++ b/toolchains/solidity/linter/solc-wrapper/tests/files/ast/UncheckedBlock.json @@ -0,0 +1,34 @@ +{ + "id":9, + "nodeType":"UncheckedBlock", + "src":"104:21:0", + "statements":[ + { + "expression":{ + "id":7, + "nodeType":"UnaryOperation", + "operator":"++", + "prefix":false, + "src":"116:6:0", + "subExpression":{ + "id":6, + "name":"test", + "nodeType":"Identifier", + "overloadedDeclarations":[ + + ], + "src":"116:4:0", + "typeDescriptions":{ + + } + }, + "typeDescriptions":{ + + } + }, + "id":8, + "nodeType":"ExpressionStatement", + "src":"116:6:0" + } + ] +} \ No newline at end of file diff --git a/toolchains/solidity/linter/solc-wrapper/tests/files/ast/UserDefinedValueTypeDefinition.json b/toolchains/solidity/linter/solc-wrapper/tests/files/ast/UserDefinedValueTypeDefinition.json new file mode 100644 index 00000000..6177c970 --- /dev/null +++ b/toolchains/solidity/linter/solc-wrapper/tests/files/ast/UserDefinedValueTypeDefinition.json @@ -0,0 +1,16 @@ +{ + "id":3, + "name":"UFixed256x18", + "nameLocation":"160:12:0", + "nodeType":"UserDefinedValueTypeDefinition", + "src":"155:29:0", + "underlyingType":{ + "id":2, + "name":"uint256", + "nodeType":"ElementaryTypeName", + "src":"176:7:0", + "typeDescriptions":{ + + } + } +} \ No newline at end of file diff --git a/toolchains/solidity/linter/solc-wrapper/tests/files/ast/UsingForDirective.json b/toolchains/solidity/linter/solc-wrapper/tests/files/ast/UsingForDirective.json new file mode 100644 index 00000000..2e2090fb --- /dev/null +++ b/toolchains/solidity/linter/solc-wrapper/tests/files/ast/UsingForDirective.json @@ -0,0 +1,31 @@ +{ + "global": false, + "id": 31, + "libraryName": { + "id": 28, + "name": "Counters", + "nameLocations": [ + "1013:8:0" + ], + "nodeType": "IdentifierPath", + "src": "1013:8:0" + }, + "nodeType": "UsingForDirective", + "src": "1007:36:0", + "typeName": { + "id": 30, + "nodeType": "UserDefinedTypeName", + "pathNode": { + "id": 29, + "name": "Counters.Counter", + "nameLocations": [ + "1026:8:0", + "1035:7:0" + ], + "nodeType": "IdentifierPath", + "src": "1026:16:0" + }, + "src": "1026:16:0", + "typeDescriptions": {} + } +} diff --git a/toolchains/solidity/linter/solc-wrapper/tests/files/ast/VariableDeclaration.json b/toolchains/solidity/linter/solc-wrapper/tests/files/ast/VariableDeclaration.json new file mode 100644 index 00000000..d283e5b1 --- /dev/null +++ b/toolchains/solidity/linter/solc-wrapper/tests/files/ast/VariableDeclaration.json @@ -0,0 +1,20 @@ +{ + "constant": false, + "id": 293, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "src": "5736:13:0", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": {}, + "typeName": { + "id": 292, + "name": "string", + "nodeType": "ElementaryTypeName", + "src": "5736:6:0", + "typeDescriptions": {} + }, + "visibility": "internal" +} diff --git a/toolchains/solidity/linter/solc-wrapper/tests/files/ast/WhileStatement.json b/toolchains/solidity/linter/solc-wrapper/tests/files/ast/WhileStatement.json new file mode 100644 index 00000000..2aa8ae02 --- /dev/null +++ b/toolchains/solidity/linter/solc-wrapper/tests/files/ast/WhileStatement.json @@ -0,0 +1,33 @@ +{ + "body": { + "id": 8, + "nodeType": "Block", + "src": "158:33:0", + "statements": [ + { + "id": 7, + "nodeType": "Continue", + "src": "172:8:0" + } + ] + }, + "condition": { + "hexValue": "74727565", + "id": 6, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "bool", + "lValueRequested": false, + "nodeType": "Literal", + "src": "152:4:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "value": "true" + }, + "id": 9, + "nodeType": "WhileStatement", + "src": "145:46:0" +} \ No newline at end of file diff --git a/toolchains/solidity/linter/solidhunter-lib/.gitignore b/toolchains/solidity/linter/solidhunter-lib/.gitignore new file mode 100644 index 00000000..ffa3bbd2 --- /dev/null +++ b/toolchains/solidity/linter/solidhunter-lib/.gitignore @@ -0,0 +1 @@ +Cargo.lock \ No newline at end of file diff --git a/toolchains/solidity/linter/solidhunter-lib/Cargo.toml b/toolchains/solidity/linter/solidhunter-lib/Cargo.toml new file mode 100644 index 00000000..3e4aa694 --- /dev/null +++ b/toolchains/solidity/linter/solidhunter-lib/Cargo.toml @@ -0,0 +1,18 @@ +[package] +name = "solidhunter-lib" +version = "0.0.1" +edition = "2021" +authors = ["Astrodevs Labs"] +license = "GPL-3.0-or-later" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] +clap = { version = "4.0.29", features = ["derive"] } +colored = "2" +serde = { version = "1.0.149", features = ["derive"] } +solc-wrapper = { path = "../solc-wrapper" } +serde_json = "1.0.89" +anyhow = "1.0" +glob = "0.3.0" +thiserror = "1.0" diff --git a/toolchains/solidity/linter/solidhunter-lib/src/lib.rs b/toolchains/solidity/linter/solidhunter-lib/src/lib.rs new file mode 100644 index 00000000..a0791e93 --- /dev/null +++ b/toolchains/solidity/linter/solidhunter-lib/src/lib.rs @@ -0,0 +1,24 @@ +use crate::types::{Range}; +use solc_wrapper::ast::ast::{CodeLocation, offset_from_location}; + +pub mod linter; +pub mod types; +pub mod rules; + +pub fn offset_from_range(content: &str, range: &Range) -> usize { + let loc = CodeLocation { + line: range.start.line as usize, + column: range.start.character as usize, + length: range.length as usize, + }; + offset_from_location(content, &loc) +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn it_works() { + } +} diff --git a/toolchains/solidity/linter/solidhunter-lib/src/linter.rs b/toolchains/solidity/linter/solidhunter-lib/src/linter.rs new file mode 100644 index 00000000..8dbdc91f --- /dev/null +++ b/toolchains/solidity/linter/solidhunter-lib/src/linter.rs @@ -0,0 +1,148 @@ +use std::fs; +use crate::types::*; +use crate::rules::types::*; +use crate::rules::factory::RuleFactory; +use crate::rules::rule_impl::{create_rules_file, parse_rules}; + +use glob::glob; +use solc_wrapper::{Solc, SourceUnit}; + +pub struct SolidFile { + pub data: SourceUnit, + pub path: String, + pub content: String, +} + +pub struct SolidLinter { + files: Vec, + rule_factory: RuleFactory, + rules : Vec>, +} + +impl SolidLinter { + fn _create_rules(&mut self, rules_config:& String, _first: bool) + { + let res = parse_rules(rules_config.as_str()); + match res { + Ok(rules) => { + for rule in rules.rules { + self.rules.push(self.rule_factory.create_rule(rule)); + } + } + Err(_) => { + create_rules_file(rules_config.as_str()); + if _first { + self._create_rules(rules_config, false); + } + } + } + } + pub fn initalize(&mut self, rules_config: &String) + { + self.rule_factory.register_rules(); + self._create_rules(&rules_config, true); + } + pub fn new() -> SolidLinter { + let mut linter : SolidLinter = SolidLinter { + files: Vec::new(), + rule_factory: RuleFactory::new(), + rules: Vec::new(), + }; + return linter; + } + + fn file_exists(&self, path: &str) -> bool { + for file in &self.files { + if file.path == path { + return true; + } + } + false + } + + fn update_file_ast(&mut self, path: &str, ast: SourceUnit) { + for file in &mut self.files { + if file.path == path { + file.data = ast.clone(); + } + } + } + + fn add_file(&mut self, path: &str, ast: SourceUnit, content: &str) { + let file = SolidFile { + data: ast, + path: String::from(path), + content: String::from(content), + }; + self.files.push(file); + } + + pub fn parse_file(&mut self, filepath: String) -> LintResult{ + let res = Solc::default().extract_ast_file(filepath.clone()); + + if res.is_err() { + println!("{:?}", res); + return Err(LintError::SolcError(res.err().unwrap())); + } + if self.file_exists(filepath.as_str()) { + self.update_file_ast(filepath.as_str(), res.expect("ast not found")); + } else { + let content = fs::read_to_string(filepath.clone()).map_err(|e| LintError::IoError(e))?; + self.add_file(filepath.as_str(), res.expect("ast not found"), content.as_str()); + } + let mut res : Vec = Vec::new(); + + for rule in &self.rules { + let mut diags = rule.diagnose(&self.files[0], &self.files); + res.append(&mut diags); + } + Ok(res) + } + + pub fn parse_content(&mut self, filepath: String, content : &String) -> LintResult { + let res = Solc::default().extract_ast_content(content.to_string()); + + if res.is_err() { + println!("{:?}", res); + return Err(LintError::SolcError(res.err().unwrap())); + } + + if self.file_exists(filepath.as_str()) { + self.update_file_ast(filepath.as_str(), res.expect("ast not found")); + } else { + self.add_file(filepath.as_str(), res.expect("ast not found"), content.as_str()); + } + + let mut res : Vec = Vec::new(); + + for rule in &self.rules { + let mut diags = rule.diagnose(&self.files[0], &self.files); + res.append(&mut diags); + } + Ok(res) + } + + pub fn parse_folder(&mut self, folder: String) -> Vec { + let mut result: Vec = Vec::new(); + + for entry in glob(&*(folder + "/**/*.sol")) { + for path in entry { + result.push(self.parse_file(String::from(path.unwrap().into_os_string().into_string().unwrap()))); + } + } + result + } + pub fn delete_file(&mut self, path: String) { + loop { + let idx = self.files.iter().position(|x| x.path == path); + match idx { + Some(idx) => { + self.files.remove(idx); + } + None => { + break; + } + } + } + } +} diff --git a/toolchains/solidity/linter/solidhunter-lib/src/rules/best_practises/function_max_lines.rs b/toolchains/solidity/linter/solidhunter-lib/src/rules/best_practises/function_max_lines.rs new file mode 100644 index 00000000..bd122394 --- /dev/null +++ b/toolchains/solidity/linter/solidhunter-lib/src/rules/best_practises/function_max_lines.rs @@ -0,0 +1,129 @@ +use crate::linter::SolidFile; +use crate::rules::types::*; +use crate::types::*; +use solc_wrapper::ast::ast::*; + +// const DEFAULT_SEVERITY: &str = "warn"; +const DEFAULT_MESSAGE: &str = "Function contains too much lines"; + +// specific +pub const DEFAULT_MAX_LINES: usize = 20; + +pub struct FunctionMaxLines { + number_max_lines: usize, + _data: RuleEntry +} + +impl RuleType for FunctionMaxLines { + + fn diagnose(&self, _file: &SolidFile, _files: &Vec) -> Vec { + let mut res = Vec::new(); + + let functions = get_all_functions_from_ast(&_file.data.nodes); + for function in functions { + let _report = check_function_lines(_file, function, self.number_max_lines); + if let Some(report) = _report { + res.push(LintDiag { + range: report, + severity: Some(Severity::WARNING), + code: None, + source: None, + message: DEFAULT_MESSAGE.to_string(), + uri: _file.path.clone(), + source_file_content: _file.content.clone() + }); + } + } + res + } +} + + +// returns a struct containing the line number of the start and end of the function if it is too long +fn check_function_lines(_file: &SolidFile, function: Box, nb_max_line: usize) -> Option { + let mut res: Option = None; + let function_copy_name_location = &function.src; + let (_start, _) = decode_location(function_copy_name_location.as_str(), _file.content.as_str()); + let index = function_copy_name_location.split(":").collect::>()[0].parse::().unwrap(); + let mut function_lines:usize = 0; + let mut left_bracket:usize = 0; + let mut right_bracket:usize = 0; + let mut last_bracket_line:usize = 0; + + for (_, c) in _file.content.chars().enumerate().skip(index) { + if c == '{' { + left_bracket += 1; + } + if c == '}' { + right_bracket += 1; + } + if c == '\n' { + function_lines += 1; + } + if right_bracket > 0 && left_bracket == right_bracket { + last_bracket_line = _start.line + function_lines; + break; + } + } + if function_lines > nb_max_line { + res = Some(Range { + start: Position { + line: _start.line as u64, + character: _start.column as u64, + }, + end: Position { + line: last_bracket_line as u64, + character: 1, + }, + length: _file.content.lines().nth(_start.line - 1)?.len() as u64 + }); + } + res +} + +fn get_all_functions_from_ast(ast_nodes: &Vec) -> Vec> { + let mut res = Vec::new(); + + for node in ast_nodes { + let contract = match node { + SourceUnitChildNodes::ContractDefinition(contract) => contract, + _ => continue, + }; + for contract_node in &contract.nodes { + let function = match contract_node { + ContractDefinitionChildNodes::FunctionDefinition(function) => function, + _ => continue, + }; + res.push(function.clone()); + } + } + res +} + + +impl FunctionMaxLines { + + pub(crate) const RULE_ID: &'static str = "function-max-lines"; + + pub fn create(data: RuleEntry) -> Box { + let max_number_lines = match data.data[0].parse::() { + Ok(v) => v, + Err(_) => DEFAULT_MAX_LINES + }; + + let rule = FunctionMaxLines { + number_max_lines: max_number_lines, + _data: data + }; + Box::new(rule) + } + + pub fn create_default() -> RuleEntry { + RuleEntry { + id: FunctionMaxLines::RULE_ID.to_string(), + severity: Severity::WARNING, + data: vec![DEFAULT_MAX_LINES.to_string()] + + } + } +} diff --git a/toolchains/solidity/linter/solidhunter-lib/src/rules/best_practises/line_maxlen.rs b/toolchains/solidity/linter/solidhunter-lib/src/rules/best_practises/line_maxlen.rs new file mode 100644 index 00000000..4de2c5ba --- /dev/null +++ b/toolchains/solidity/linter/solidhunter-lib/src/rules/best_practises/line_maxlen.rs @@ -0,0 +1,58 @@ +use std::ops::Index; +use crate::linter::SolidFile; +use solc_wrapper::*; +use crate::rules::types::*; +use crate::types::*; + +pub struct LineMaxLen { + max_len: usize, + data: RuleEntry +} + +impl RuleType for LineMaxLen { + + fn diagnose(&self, file: &SolidFile, files: &Vec) -> Vec { + let mut res = Vec::new(); + let mut line_idx = 1; + + for line in file.content.lines() { + if line.len() > self.max_len { + res.push(LintDiag { + range: Range { + start: Position { line: line_idx, character: self.max_len as u64}, + end: Position { line: line_idx, character: line.len() as u64 }, + length: (line.len() - self.max_len) as u64 + }, + message: format!("Line is too long: {}", line.len()), + severity: Some(self.data.severity), + code: None, + source: None, + uri: file.path.clone(), + source_file_content: file.content.clone() + }); + } + line_idx += 1; + } + res + } + + +} + +impl LineMaxLen { + pub(crate) fn create(data: RuleEntry) -> Box { + let mut rule = LineMaxLen { + max_len: data.data[0].parse::().unwrap(), + data + }; + Box::new(rule) + } + + pub(crate) fn create_default() -> RuleEntry { + RuleEntry { + id: "line-max-len".to_string(), + severity: Severity::WARNING, + data: vec!["80".to_string()] + } + } +} \ No newline at end of file diff --git a/toolchains/solidity/linter/solidhunter-lib/src/rules/best_practises/max_states_count.rs b/toolchains/solidity/linter/solidhunter-lib/src/rules/best_practises/max_states_count.rs new file mode 100644 index 00000000..3da97c95 --- /dev/null +++ b/toolchains/solidity/linter/solidhunter-lib/src/rules/best_practises/max_states_count.rs @@ -0,0 +1,73 @@ +use std::ops::Index; +use crate::linter::SolidFile; +use solc_wrapper::*; +use crate::rules::types::*; +use crate::types::*; + + +pub struct MaxStatesCount { + max_states: usize, + data: RuleEntry +} + +impl RuleType for MaxStatesCount { + + fn diagnose(&self, file: &SolidFile, files: &Vec) -> Vec { + let mut res = Vec::new(); + + let mut count = 0; + + // var def => contract def + for node in file.data.nodes.iter() { + let contract = match node { + SourceUnitChildNodes::ContractDefinition(contract) => contract, + _ => continue + }; + for node_var in contract.nodes.iter() { + let var = match node_var { + ContractDefinitionChildNodes::VariableDeclaration(var) => var, + _ => continue + }; + count += 1; + if count > self.max_states { + let location = decode_location(&var.src, &file.content); + res.push(LintDiag { + range: Range { + start: Position { line: location.0.line as u64, character: location.0.column as u64}, + end: Position { line: location.1.line as u64, character: location.1.column as u64 }, + length: location.0.length as u64 + }, + message: format!("Too many states: {}", count), + severity: Some(self.data.severity), + code: None, + source: None, + uri: file.path.clone(), + source_file_content: file.content.clone() + }); + } + } + } + res + } +} + +impl MaxStatesCount { + + pub(crate) const RULE_ID: &'static str = "max-states-count"; + + pub(crate) fn create(data: RuleEntry) -> Box { + let mut rule = MaxStatesCount { + max_states: data.data[0].parse::().unwrap(), + data + }; + Box::new(rule) + } + + pub(crate) fn create_default() -> RuleEntry { + RuleEntry { + id: MaxStatesCount::RULE_ID.to_string(), + severity: Severity::WARNING, + data: vec!["15".to_string()] + } + } +} \ No newline at end of file diff --git a/toolchains/solidity/linter/solidhunter-lib/src/rules/best_practises/mod.rs b/toolchains/solidity/linter/solidhunter-lib/src/rules/best_practises/mod.rs new file mode 100644 index 00000000..62398701 --- /dev/null +++ b/toolchains/solidity/linter/solidhunter-lib/src/rules/best_practises/mod.rs @@ -0,0 +1,38 @@ +use std::collections::HashMap; +use crate::rules::types::{RuleEntry, RuleType}; + +#[macro_use] +pub mod line_maxlen; +pub mod max_states_count; +pub mod function_max_lines; +pub mod reason_string; + +// List all rules + +use crate::rules::best_practises::line_maxlen::LineMaxLen; +use crate::rules::best_practises::max_states_count::MaxStatesCount; +use crate::rules::best_practises::reason_string::ReasonString; +use crate::rules::best_practises::function_max_lines::FunctionMaxLines; +use crate::rules::RuleBuilder; + +pub fn create_default_rules() -> Vec { + let mut rules = Vec::new(); + + rules.push(LineMaxLen::create_default()); + rules.push(MaxStatesCount::create_default()); + rules.push(FunctionMaxLines::create_default()); + rules.push(ReasonString::create_default()); + + rules +} + +pub fn create_rules() -> HashMap Box> { + let mut rules : HashMap = HashMap::new(); + + rules.insert( "line-max-len".to_string(), LineMaxLen::create); + rules.insert(MaxStatesCount::RULE_ID.to_string(), MaxStatesCount::create); + rules.insert(FunctionMaxLines::RULE_ID.to_string(), FunctionMaxLines::create); + rules.insert(reason_string::RULE_ID.to_string(), ReasonString::create); + + rules +} \ No newline at end of file diff --git a/toolchains/solidity/linter/solidhunter-lib/src/rules/best_practises/reason_string.rs b/toolchains/solidity/linter/solidhunter-lib/src/rules/best_practises/reason_string.rs new file mode 100644 index 00000000..04468081 --- /dev/null +++ b/toolchains/solidity/linter/solidhunter-lib/src/rules/best_practises/reason_string.rs @@ -0,0 +1,144 @@ +use solc_wrapper::{NodeType, Expression, decode_location}; +use solc_wrapper::ast::utils::{get_all_nodes_by_type, self}; + +use crate::linter::SolidFile; +use crate::rules::types::{RuleEntry, RuleType}; +use crate::types::{LintDiag, Range, Position, Severity}; + +pub const RULE_ID: &str = "reason-string"; +const DEFAULT_SEVERITY: Severity = Severity::WARNING; + +// Specific +const DEFAULT_LENGTH: u32 = 32; + + +pub struct ReasonString { + max_length: u32, + data: RuleEntry +} + +impl RuleType for ReasonString { + + fn diagnose(&self, file: &SolidFile, files: &Vec) -> Vec { + let mut res = Vec::new(); + + let nodes = get_all_nodes_by_type(file.data.clone(), NodeType::FunctionCall); + for i in &nodes { + match i { + utils::Nodes::FunctionCall(j) => { + match &j.expression { + Expression::Identifier(v) => { + if v.name == "require" { + if j.arguments.len() != 2 { + let location = decode_location(&j.src, &file.content); + let diag = LintDiag { + range: Range { + start: Position { line: location.0.line as u64, character: location.0.column as u64 }, + end: Position { line: location.1.line as u64, character: location.1.column as u64 }, + length: location.0.length as u64 + }, + message: format!("reason-string: A require statement must have a reason string"), + severity: Some(self.data.severity), + code: None, + source: None, + uri: file.path.clone(), + source_file_content: file.content.clone(), + }; + res.push(diag); + } else { + for nj in &j.arguments { + match nj { + Expression::Literal(z) => { + if z.value.clone().unwrap().len() > self.max_length as usize { + let location = decode_location(&z.src, &file.content); + let diag = LintDiag { + range: Range { + start: Position { line: location.0.line as u64, character: location.0.column as u64 }, + end: Position { line: location.1.line as u64, character: location.1.column as u64 }, + length: location.0.length as u64 + }, + message: format!("reason-string: A revert statement must have a reason string of length less than {}", self.max_length), + severity: Some(self.data.severity), + code: None, + source: None, + uri: file.path.clone(), + source_file_content: file.content.clone(), + }; + res.push(diag); + } + } + _ => {} + } + } + } + } else if v.name == "revert" { + if j.arguments.len() == 0 { + let location = decode_location(&j.src, &file.content); + let diag = LintDiag { + range: Range { + start: Position { line: location.0.line as u64, character: location.0.column as u64 }, + end: Position { line: location.1.line as u64, character: location.1.column as u64 }, + length: location.0.length as u64 + }, + message: format!("reason-string: A revert statement must have a reason string"), + severity: Some(self.data.severity), + code: None, + source: None, + uri: file.path.clone(), + source_file_content: file.content.clone(), + }; + res.push(diag); + } else { + match &j.arguments[0] { + Expression::Literal(z) => { + if z.value.clone().unwrap().len() > self.max_length as usize { + let location = decode_location(&z.src, &file.content); + let diag = LintDiag { + range: Range { + start: Position { line: location.0.line as u64, character: location.0.column as u64 }, + end: Position { line: location.1.line as u64, character: location.1.column as u64 }, + length: location.0.length as u64 + }, + message: format!("reason-string: A revert statement must have a reason string of length less than {}", self.max_length), + severity: Some(self.data.severity), + code: None, + source: None, + uri: file.path.clone(), + source_file_content: file.content.clone(), + }; + res.push(diag); + } + } + _ => {} + } + } + } + } + _ => {} + } + } + _ => {} + } + } + res + } + +} + +impl ReasonString { + pub fn create(data: RuleEntry) -> Box { + let mut rule = ReasonString { + max_length: data.data[0].parse::().unwrap(), + data + }; + Box::new(rule) + } + + pub fn create_default() -> RuleEntry { + RuleEntry { + id: RULE_ID.to_string(), + severity: DEFAULT_SEVERITY, + data: vec![DEFAULT_LENGTH.to_string()] + } + } +} diff --git a/toolchains/solidity/linter/solidhunter-lib/src/rules/factory.rs b/toolchains/solidity/linter/solidhunter-lib/src/rules/factory.rs new file mode 100644 index 00000000..5c060655 --- /dev/null +++ b/toolchains/solidity/linter/solidhunter-lib/src/rules/factory.rs @@ -0,0 +1,31 @@ +use std::collections::HashMap; +use crate::rules::types::*; +use crate::rules::create_rules; + +pub struct RuleFactory { + _buildables: HashMap Box>, + _rules : Vec>, +} + +impl RuleFactory { + pub fn new() -> RuleFactory { + RuleFactory { + _buildables: HashMap::new(), + _rules: Vec::new(), + } + } + + pub fn register_rules(&mut self) + { + self._buildables = create_rules() + } + + pub fn create_rule(&self, rule: RuleEntry) -> Box + { + let rule_type = self._buildables.get(&rule.id); + if rule_type.is_none() { + panic!("Rule {} not found", &rule.id); + } + rule_type.unwrap()(rule) + } +} \ No newline at end of file diff --git a/toolchains/solidity/linter/solidhunter-lib/src/rules/miscellaneous/mod.rs b/toolchains/solidity/linter/solidhunter-lib/src/rules/miscellaneous/mod.rs new file mode 100644 index 00000000..09c71213 --- /dev/null +++ b/toolchains/solidity/linter/solidhunter-lib/src/rules/miscellaneous/mod.rs @@ -0,0 +1,26 @@ +use std::collections::HashMap; +use crate::rules::types::{RuleEntry, RuleType}; + +#[macro_use] +pub mod quotes; + +// List all rules + +use crate::rules::miscellaneous::quotes::Quotes; +use crate::rules::RuleBuilder; + +pub fn create_default_rules() -> Vec { + let mut rules = Vec::new(); + + rules.push(Quotes::create_default()); + + rules +} + +pub fn create_rules() -> HashMap Box> { + let mut rules : HashMap = HashMap::new(); + + rules.insert("quotes".to_string(), Quotes::create); + + rules +} \ No newline at end of file diff --git a/toolchains/solidity/linter/solidhunter-lib/src/rules/miscellaneous/quotes.rs b/toolchains/solidity/linter/solidhunter-lib/src/rules/miscellaneous/quotes.rs new file mode 100644 index 00000000..6a5e00d9 --- /dev/null +++ b/toolchains/solidity/linter/solidhunter-lib/src/rules/miscellaneous/quotes.rs @@ -0,0 +1,58 @@ +use std::ops::Index; +use crate::linter::SolidFile; +use solc_wrapper::*; +use crate::rules::types::*; +use crate::types::*; + + +pub struct Quotes { + data: RuleEntry +} + +impl RuleType for Quotes { + + fn diagnose(&self, file: &SolidFile, files: &Vec) -> Vec { + let mut res = Vec::new(); + let mut line_idx = 1; + + for line in file.content.lines() { + line.chars().enumerate().for_each(|(idx, c)| { + if c == '\'' && line.chars().nth(idx - 1).unwrap_or(' ') != '\\' { + res.push(LintDiag { + range: Range { + start: Position { line: line_idx, character: idx as u64}, + end: Position { line: line_idx, character: idx as u64 }, + length: 1 as u64, + }, + message: format!("Use double quotes instead of single quote"), + severity: Some(self.data.severity), + code: None, + source: None, + uri: file.path.clone(), + source_file_content: file.content.clone() + }); + } + }); + line_idx += 1; + } + res + } + +} + +impl Quotes { + pub(crate) fn create(data: RuleEntry) -> Box { + let mut rule = Quotes { + data + }; + Box::new(rule) + } + + pub(crate) fn create_default() -> RuleEntry { + RuleEntry { + id: "quotes".to_string(), + severity: Severity::ERROR, + data: vec![] + } + } +} \ No newline at end of file diff --git a/toolchains/solidity/linter/solidhunter-lib/src/rules/mod.rs b/toolchains/solidity/linter/solidhunter-lib/src/rules/mod.rs new file mode 100644 index 00000000..f78c49ec --- /dev/null +++ b/toolchains/solidity/linter/solidhunter-lib/src/rules/mod.rs @@ -0,0 +1,42 @@ +use std::collections::HashMap; +use crate::rules::types::{RuleEntry, RuleType}; + +pub mod types; +pub mod rule_impl; +pub mod factory; + +// List all rules +pub mod best_practises; +pub mod miscellaneous; +pub mod naming; +pub mod order; + +pub fn create_default_rules() -> Vec { + let mut rules = Vec::new(); + + rules.append(&mut best_practises::create_default_rules()); + rules.append(&mut miscellaneous::create_default_rules()); + rules.append(&mut naming::create_default_rules()); + rules.append(&mut order::create_default_rules()); + + rules +} + +type RuleBuilder = fn(RuleEntry) -> Box; + +pub fn add_rules(rules : &mut HashMap, to_add: HashMap) { + for (key, value) in to_add { + rules.insert(key, value); + } +} + +pub fn create_rules() -> HashMap Box> { + let mut rules = HashMap::new(); + + add_rules(&mut rules, best_practises::create_rules()); + add_rules(&mut rules, naming::create_rules()); + add_rules(&mut rules, order::create_rules()); + add_rules(&mut rules, miscellaneous::create_rules()); + + rules +} \ No newline at end of file diff --git a/toolchains/solidity/linter/solidhunter-lib/src/rules/naming/contract_name_pascalcase.rs b/toolchains/solidity/linter/solidhunter-lib/src/rules/naming/contract_name_pascalcase.rs new file mode 100644 index 00000000..b94c85c6 --- /dev/null +++ b/toolchains/solidity/linter/solidhunter-lib/src/rules/naming/contract_name_pascalcase.rs @@ -0,0 +1,62 @@ +use clap::builder::Str; +use crate::linter::SolidFile; +use crate::rules::types::*; +use crate::types::*; +use solc_wrapper::{ContractDefinitionChildNodes, decode_location, SourceUnit, SourceUnitChildNodes}; + +pub struct ContractNamePascalCase { + data: RuleEntry +} + +impl RuleType for ContractNamePascalCase { + + fn diagnose(&self, file: &SolidFile, files: &Vec) -> Vec { + + let mut res = Vec::new(); + + for node in &file.data.nodes { + match node { + SourceUnitChildNodes::ContractDefinition(contract) => { + if (contract.name.chars().nth(0).unwrap() >= 'a' && contract.name.chars().nth(0).unwrap() <= 'z') || + contract.name.contains("_") || + contract.name.contains("-") { + //Untested + let location = decode_location(contract.name_location.as_ref().unwrap(), &file.content); + res.push(LintDiag { + range: Range { + start: Position { line: location.0.line as u64, character: location.0.column as u64 }, + end: Position { line: location.1.line as u64, character: location.1.column as u64 }, + length: location.0.length as u64, + }, + message: format!("Contract name need to be in pascal case"), + severity: Some(self.data.severity), + code: None, + source: None, + uri: file.path.clone(), + source_file_content: file.content.clone(), + }); + } + } + _ => { continue; } + } + } + res + } +} + +impl ContractNamePascalCase { + pub(crate) fn create(data: RuleEntry) -> Box { + let mut rule = ContractNamePascalCase { + data + }; + Box::new(rule) + } + + pub(crate) fn create_default() -> RuleEntry { + RuleEntry { + id: "contract-name-pascalcase".to_string(), + severity: Severity::WARNING, + data: vec![] + } + } +} \ No newline at end of file diff --git a/toolchains/solidity/linter/solidhunter-lib/src/rules/naming/func_name_camelcase.rs b/toolchains/solidity/linter/solidhunter-lib/src/rules/naming/func_name_camelcase.rs new file mode 100644 index 00000000..94c4f146 --- /dev/null +++ b/toolchains/solidity/linter/solidhunter-lib/src/rules/naming/func_name_camelcase.rs @@ -0,0 +1,70 @@ +use clap::builder::Str; +use crate::linter::SolidFile; +use crate::rules::types::*; +use crate::types::*; +use solc_wrapper::{ContractDefinitionChildNodes, decode_location, FunctionDefinitionKind, SourceUnit, SourceUnitChildNodes}; + +pub struct FuncNameCamelCase { + data: RuleEntry +} + +impl RuleType for FuncNameCamelCase { + + fn diagnose(&self, file: &SolidFile, files: &Vec) -> Vec { + + let mut res = Vec::new(); + + for node in &file.data.nodes { + match node { + SourceUnitChildNodes::ContractDefinition(contract) => { + for node in &contract.nodes { + match node { + ContractDefinitionChildNodes::FunctionDefinition(function) => { + if function.kind != FunctionDefinitionKind::Constructor + && (!(function.name.chars().nth(0).unwrap_or(' ') >= 'a' && function.name.chars().nth(0).unwrap_or(' ') <= 'z') + || function.name.contains('_') + || function.name.contains('-')) { + //Untested + let location = decode_location(function.name_location.as_ref().unwrap(), &file.content); + res.push(LintDiag { + range: Range { + start: Position { line: location.0.line as u64, character: location.0.column as u64 }, + end: Position { line: location.1.line as u64, character: location.1.column as u64 }, + length: location.0.length as u64 + }, + message: format!("Function name need to be in camel case"), + severity: Some(self.data.severity), + code: None, + source: None, + uri: file.path.clone(), + source_file_content: file.content.clone(), + }); + } + } + _ => { continue; } + } + } + } + _ => { continue; } + } + } + res + } +} + +impl FuncNameCamelCase { + pub(crate) fn create(data: RuleEntry) -> Box { + let mut rule = FuncNameCamelCase { + data + }; + Box::new(rule) + } + + pub(crate) fn create_default() -> RuleEntry { + RuleEntry { + id: "func-name-camelcase".to_string(), + severity: Severity::WARNING, + data: vec![] + } + } +} \ No newline at end of file diff --git a/toolchains/solidity/linter/solidhunter-lib/src/rules/naming/func_param_name_camelcase.rs b/toolchains/solidity/linter/solidhunter-lib/src/rules/naming/func_param_name_camelcase.rs new file mode 100644 index 00000000..53e07d87 --- /dev/null +++ b/toolchains/solidity/linter/solidhunter-lib/src/rules/naming/func_param_name_camelcase.rs @@ -0,0 +1,72 @@ +use clap::builder::Str; +use crate::linter::SolidFile; +use crate::rules::types::*; +use crate::types::*; +use solc_wrapper::{ContractDefinitionChildNodes, decode_location, SourceUnit, SourceUnitChildNodes}; + +pub struct FuncParamNameCamelcase { + data: RuleEntry +} + +impl RuleType for FuncParamNameCamelcase { + + fn diagnose(&self, file: &SolidFile, files: &Vec) -> Vec { + + let mut res = Vec::new(); + + for node in &file.data.nodes { + match node { + SourceUnitChildNodes::ContractDefinition(contract) => { + for node in &contract.nodes { + match node { + ContractDefinitionChildNodes::FunctionDefinition(function) => { + for parameter in &function.parameters.parameters { + if !(parameter.name.chars().nth(0).unwrap() >= 'a' && parameter.name.chars().nth(0).unwrap() <= 'z') || + parameter.name.contains("_") || + parameter.name.contains("-") { + //Untested + let location = decode_location(parameter.name_location.as_ref().unwrap(), &file.content); + res.push(LintDiag { + range: Range { + start: Position { line: location.0.line as u64, character: location.0.column as u64 }, + end: Position { line: location.1.line as u64, character: location.1.column as u64 }, + length: location.0.length as u64, + }, + message: format!("Parameter name need to be in camel case"), + severity: Some(self.data.severity), + code: None, + source: None, + uri: file.path.clone(), + source_file_content: file.content.clone(), + }); + } + } + } + _ => { continue; } + } + } + + } + _ => { continue; } + } + } + res + } +} + +impl FuncParamNameCamelcase { + pub(crate) fn create(data: RuleEntry) -> Box { + let mut rule = FuncParamNameCamelcase { + data + }; + Box::new(rule) + } + + pub(crate) fn create_default() -> RuleEntry { + RuleEntry { + id: "func-param-name-camelcase".to_string(), + severity: Severity::WARNING, + data: vec![] + } + } +} \ No newline at end of file diff --git a/toolchains/solidity/linter/solidhunter-lib/src/rules/naming/mod.rs b/toolchains/solidity/linter/solidhunter-lib/src/rules/naming/mod.rs new file mode 100644 index 00000000..a066a16b --- /dev/null +++ b/toolchains/solidity/linter/solidhunter-lib/src/rules/naming/mod.rs @@ -0,0 +1,38 @@ +use std::collections::HashMap; +use crate::rules::naming::contract_name_pascalcase::ContractNamePascalCase; +use crate::rules::naming::func_name_camelcase::FuncNameCamelCase; +use crate::rules::naming::use_forbidden_name::UseForbiddenName; +use crate::rules::types::{RuleEntry, RuleType}; +use crate::rules::naming::func_param_name_camelcase::FuncParamNameCamelcase; +use crate::rules::RuleBuilder; + +#[macro_use] +pub(crate) mod func_param_name_camelcase; +pub(crate) mod contract_name_pascalcase; +pub(crate) mod func_name_camelcase; +pub(crate) mod use_forbidden_name; + +// List all rules + + +pub fn create_default_rules() -> Vec { + let mut rules = Vec::new(); + + rules.push(FuncParamNameCamelcase::create_default()); + rules.push(ContractNamePascalCase::create_default()); + rules.push(FuncNameCamelCase::create_default()); + rules.push(UseForbiddenName::create_default()); + + rules +} + +pub fn create_rules() -> HashMap Box> { + let mut rules : HashMap = HashMap::new(); + + rules.insert( "func-param-name-camelcase".to_string(), FuncParamNameCamelcase::create); + rules.insert( "contract-name-pascalcase".to_string(), ContractNamePascalCase::create); + rules.insert( "func-name-camelcase".to_string(), FuncNameCamelCase::create); + rules.insert( UseForbiddenName::RULE_ID.to_string(), UseForbiddenName::create); + + rules +} diff --git a/toolchains/solidity/linter/solidhunter-lib/src/rules/naming/use_forbidden_name.rs b/toolchains/solidity/linter/solidhunter-lib/src/rules/naming/use_forbidden_name.rs new file mode 100644 index 00000000..99d47eb4 --- /dev/null +++ b/toolchains/solidity/linter/solidhunter-lib/src/rules/naming/use_forbidden_name.rs @@ -0,0 +1,66 @@ +use std::ops::Index; +use crate::linter::SolidFile; +use solc_wrapper::*; +use solc_wrapper::ast::utils::{get_all_nodes_by_type, Nodes}; +use crate::rules::types::*; +use crate::types::*; + +pub struct UseForbiddenName { + data: RuleEntry +} + +impl RuleType for UseForbiddenName { + + fn diagnose(&self, file: &SolidFile, files: &Vec) -> Vec { + let mut res = Vec::new(); + let blacklist = vec!['I', 'l', 'O']; + + let nodes = get_all_nodes_by_type(file.data.clone(), NodeType::VariableDeclaration); + + for node in nodes { + let var = match node { + Nodes::VariableDeclaration(var) => var, + _ => continue + }; + if var.name.len() == 1 && blacklist.contains(&var.name.chars().next().unwrap()) { + let location = decode_location(&var.src, &file.content); + res.push(LintDiag { + range: Range { + start: Position { line: location.0.line as u64, character: location.0.column as u64}, + end: Position { line: location.1.line as u64, character: location.1.column as u64 }, + length: location.0.length as u64 + }, + message: format!("Forbidden variable name: {}", var.name), + severity: Some(self.data.severity), + code: None, + source: None, + uri: file.path.clone(), + source_file_content: file.content.clone() + }); + } + } + res + } + + +} + +impl UseForbiddenName { + + pub const RULE_ID : &'static str = "use-forbidden-name"; + + pub(crate) fn create(data: RuleEntry) -> Box { + let mut rule = UseForbiddenName { + data + }; + Box::new(rule) + } + + pub(crate) fn create_default() -> RuleEntry { + RuleEntry { + id: UseForbiddenName::RULE_ID.to_string(), + severity: Severity::WARNING, + data: vec![], + } + } +} \ No newline at end of file diff --git a/toolchains/solidity/linter/solidhunter-lib/src/rules/order/import_on_top.rs b/toolchains/solidity/linter/solidhunter-lib/src/rules/order/import_on_top.rs new file mode 100644 index 00000000..21f4ea3e --- /dev/null +++ b/toolchains/solidity/linter/solidhunter-lib/src/rules/order/import_on_top.rs @@ -0,0 +1,73 @@ +use clap::builder::Str; +use crate::linter::SolidFile; +use crate::rules::types::*; +use crate::types::*; +use solc_wrapper::{ContractDefinitionChildNodes, decode_location, SourceUnit, SourceUnitChildNodes}; + +pub struct ImportOnTop { + data: RuleEntry +} + +impl RuleType for ImportOnTop { + + fn diagnose(&self, file: &SolidFile, files: &Vec) -> Vec { + + let mut res = Vec::new(); + let mut last_import_location = 0; + + for i in 1..file.data.nodes.len() { + match &file.data.nodes[i] { + SourceUnitChildNodes::ImportDirective(_) => { + last_import_location = i; + } + _ => { + break; + } + } + } + + for i in 1..file.data.nodes.len() { + match &file.data.nodes[i] { + SourceUnitChildNodes::ImportDirective(import) => { + if i > last_import_location { + let location = decode_location(&import.src, &file.content); + + res.push(LintDiag { + range: Range { + start: Position { line: location.0.line as u64, character: location.0.column as u64 }, + end: Position { line: location.1.line as u64, character: location.1.column as u64 }, + length: location.0.length as u64 + }, + message: format!("Import must be on top in the file"), + severity: Some(self.data.severity), + code: None, + source: None, + uri: file.path.clone(), + source_file_content: file.content.clone(), + }); + } + } + _ => {} + } + } + + res + } +} + +impl ImportOnTop { + pub(crate) fn create(data: RuleEntry) -> Box { + let mut rule = ImportOnTop { + data + }; + Box::new(rule) + } + + pub(crate) fn create_default() -> RuleEntry { + RuleEntry { + id: "import-on-top".to_string(), + severity: Severity::WARNING, + data: vec![] + } + } +} \ No newline at end of file diff --git a/toolchains/solidity/linter/solidhunter-lib/src/rules/order/mod.rs b/toolchains/solidity/linter/solidhunter-lib/src/rules/order/mod.rs new file mode 100644 index 00000000..0fa313d3 --- /dev/null +++ b/toolchains/solidity/linter/solidhunter-lib/src/rules/order/mod.rs @@ -0,0 +1,26 @@ +use std::collections::HashMap; +use crate::rules::types::{RuleEntry, RuleType}; + +#[macro_use] +pub(crate) mod import_on_top; + +// List all rules + +use crate::rules::order::import_on_top::ImportOnTop; +use crate::rules::RuleBuilder; + +pub fn create_default_rules() -> Vec { + let mut rules = Vec::new(); + + rules.push(ImportOnTop::create_default()); + + rules +} + +pub fn create_rules() -> HashMap Box> { + let mut rules : HashMap = HashMap::new(); + + rules.insert( "import-on-top".to_string(), ImportOnTop::create); + + rules +} \ No newline at end of file diff --git a/toolchains/solidity/linter/solidhunter-lib/src/rules/rule_impl.rs b/toolchains/solidity/linter/solidhunter-lib/src/rules/rule_impl.rs new file mode 100644 index 00000000..e2773b1b --- /dev/null +++ b/toolchains/solidity/linter/solidhunter-lib/src/rules/rule_impl.rs @@ -0,0 +1,87 @@ +use std::collections::HashMap; +use crate::rules::create_default_rules; +use crate::rules::types::*; + + +// Untested +fn merge_rules(rules: &mut Vec, new_rules: &Vec) { + let mut new_rules_map = HashMap::new(); + for rule in new_rules { + new_rules_map.insert(rule.id.clone(), rule); + } + + for rule in rules { + if let Some(new_rule) = new_rules_map.get(&rule.id) { + rule.severity = new_rule.severity.clone(); + rule.data = new_rule.data.clone(); + } + } +} + +pub fn create_rules_file(path: &str) { + let mut rules = Rules { + name: "solidhunter".to_string(), + includes: vec![], + plugins: vec![], + rules: create_default_rules(), + }; + let serialized = serde_json::to_string_pretty(&rules).unwrap(); + + std::fs::write(path, serialized).unwrap(); +} + +type RulesResult = Result; + +pub fn parse_rules(path: &str) -> RulesResult { + let mut rules = Rules { + name: String::new(), + includes: Vec::new(), + plugins: Vec::new(), + rules: Vec::new(), + }; + + if !std::path::Path::new(&path).is_file() { + return Err(RulesError::IoError(std::io::Error::new(std::io::ErrorKind::NotFound, "Rules file not found"))); + } + let file = std::fs::read_to_string(path).unwrap(); + let parsed: Rules = serde_json::from_str(&file).unwrap(); + + /* + // Danger zone + for include in parsed.includes { + let include_rules = parse_rules(include.as_str()); + merge_rules(&mut rules.rules, &include_rules.unwrap().rules); + } + + merge_rules(&mut rules.rules, &parsed.rules); + // End of danger zone + */ + + Ok(parsed) +} + + +// create rules +/* +#[macro_export] +macro_rules! create_rule { + ($rule_name:ident, $rule_id:expr, $default_severity:expr, $custom_data:expr, $message:expr) => { + pub struct $rule_name { + id: String, + message: String, + severity: RuleSeverity, + data: Vec, + } + + impl $rule_name { + pub fn new(severity: Severity, data: Vec) -> $rule_name { + $rule_name { + id: $rule_id.to_string(), + message: $message.to_string(), + severity, + data, + } + } + } + }; +}*/ \ No newline at end of file diff --git a/toolchains/solidity/linter/solidhunter-lib/src/rules/types.rs b/toolchains/solidity/linter/solidhunter-lib/src/rules/types.rs new file mode 100644 index 00000000..fec52ecf --- /dev/null +++ b/toolchains/solidity/linter/solidhunter-lib/src/rules/types.rs @@ -0,0 +1,30 @@ +use serde::{Serialize, Deserialize}; +use crate::linter::SolidFile; +use crate::types::*; + + +#[derive(Serialize, Deserialize, Debug)] +pub struct RuleEntry +{ + pub id: String, + pub severity: Severity, + pub data: Vec, +} + +#[derive(Serialize, Deserialize, Debug)] +pub struct Rules { + pub name: String, + pub includes: Vec, + pub plugins: Vec, + pub rules: Vec +} + +#[derive(Debug)] +pub enum RulesError { + IoError(std::io::Error), +} + +pub trait RuleType: Send + Sync + 'static { + + fn diagnose(&self, file: &SolidFile, files: &Vec) -> Vec; +} \ No newline at end of file diff --git a/toolchains/solidity/linter/solidhunter-lib/src/types.rs b/toolchains/solidity/linter/solidhunter-lib/src/types.rs new file mode 100644 index 00000000..7ad3fa87 --- /dev/null +++ b/toolchains/solidity/linter/solidhunter-lib/src/types.rs @@ -0,0 +1,84 @@ +use serde::{Serialize, Deserialize}; +use thiserror::Error; + +#[derive(Error, Debug)] +pub enum LintError { + #[error("LintError: Solc error occured")] + SolcError(#[from] solc_wrapper::SolcError), + #[error("LintError: Something went wrong with the file")] + IoError(#[from] std::io::Error), + #[error("LintError: Something went wrong")] + LinterError(String), +} + + +pub type LintResult = Result, LintError>; + +#[derive(Clone, Serialize, Deserialize, Debug)] +pub struct LintDiag { + + /// The range at which the message applies. + pub range: Range, + + #[serde(skip_serializing_if = "Option::is_none")] + /// The diagnostic's severity. Can be omitted. If omitted it is up to the + /// client to interpret diagnostics as error, warning, info or hint. + pub severity: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + /// The diagnostic's code. Can be omitted. + pub code: Option, + + + #[serde(skip_serializing_if = "Option::is_none")] + /// A human-readable string describing the source of this + /// diagnostic, e.g. 'typescript' or 'super lint'. + pub source: Option, + + /// The diagnostic's message. + pub message: String, + + pub uri: Uri, + + #[serde(rename="sourceFileContent")] + pub source_file_content: String +} + + +//////////////////////////////////////////////////////////// +/////////////////// RELATED TYPES: ///////////////////////// +//////////////////////////////////////////////////////////// + +#[derive(Clone, Serialize, Deserialize, Debug)] +pub struct Position { + pub line: u64, + pub character: u64, +} + +#[derive(PartialEq, Eq, Clone, Copy, Serialize, Deserialize, Debug)] +pub enum Severity { + /// Reports an error. + ERROR = 1, + /// Reports a warning. + WARNING = 2, + /// Reports an information. + INFO = 3, + /// Reports a hint. + HINT = 4 +} + +#[derive(Clone, Serialize, Deserialize, Debug)] +pub struct Range { + pub start: Position, + pub end: Position, + pub length: u64, +} + + +#[derive(Clone, Serialize, Deserialize, Debug)] +pub enum NumberOrString { + Number(i32), + String(String), +} + +type Uri = String; diff --git a/toolchains/solidity/linter/src/main.rs b/toolchains/solidity/linter/src/main.rs new file mode 100644 index 00000000..97ae1325 --- /dev/null +++ b/toolchains/solidity/linter/src/main.rs @@ -0,0 +1,156 @@ +use clap::Parser; +use colored::Colorize; +use solidhunter_lib::linter::SolidLinter; +use solidhunter_lib::offset_from_range; + +use solidhunter_lib::rules::rule_impl::{create_rules_file, parse_rules}; +use solidhunter_lib::types::Severity; + +#[derive(Parser, Debug)] +#[command(author, version, about, long_about = None)] +struct Args { + #[arg(short = 'p', long = "path", default_value = ".", help = "Specify project path")] + project_path: Vec, + + #[arg(short = 'f', long = "file", default_value = "", help = "Specify a single file to lint")] + file_to_lint: String, + + #[arg(short = 'e', long = "exclude", help = "Exclude part of the project path")] + ignore_path: Vec, + + #[arg(short = 'r', long = "rules", default_value = ".solidhunter.json", help = "Specify rules file")] + rules_file: String, + + #[arg(short = 'j', long = "json_output", default_value = "false", help = "Outputs a json format instead")] + to_json: bool, + + #[arg(short = 'v', long = "verbose", default_value = "false", help = "Verbose output")] + verbose: bool, + + #[arg(short = 'i', long = "init", default_value = "false", help = "Initialize rules file")] + init: bool, +} + +pub fn severity_to_string(severity: Option) -> String { + match severity { + Some(Severity::ERROR) => format!("error").red(), + Some(Severity::WARNING) => format!("warning").yellow(), + Some(Severity::INFO) => format!("info").blue(), + Some(Severity::HINT) => format!("hint").green(), + _ => format!("error").red(), + } + .to_string() +} + +fn print_diag(diag: &solidhunter_lib::types::LintDiag) { + let mut padding : String = String::new(); + if diag.range.start.line > 99 { + padding = " ".repeat(0).to_string(); + } else if diag.range.start.line > 9 { + padding = " ".repeat(1).to_string(); + } else { + padding = " ".repeat(2).to_string(); + } + let line = diag.source_file_content.lines().nth((diag.range.start.line - 1) as usize).unwrap(); + + println!("\n{}: {}", severity_to_string(diag.severity), diag.message); + println!( + " --> {}:{}:{}", + diag.uri, + diag.range.start.line, + diag.range.start.character, + ); + println!( + " |"); + //TODO: add code to print + println!( + "{}{}|{}", diag.range.start.line,padding, line); + println!( + " |{}{}", " ".repeat(diag.range.start.character as usize), "^".repeat(diag.range.length as usize)); +} + +fn lint_folder(args: Args) { + let mut linter: SolidLinter = SolidLinter::new(); + linter.initalize(&args.rules_file); + let mut result = Vec::new(); + for path in args.project_path { + result.append(&mut linter.parse_folder(path)); + } + for res in result { + match res { + Ok(diags) => { + for diag in diags { + print_diag(&diag); + } + } + Err(e) => { + println!("{}", e); + } + } + } +} + +fn main() { + let args = Args::parse(); + + if !args.to_json { + println!(); + println!("SolidHunter: Fast and efficient Solidity linter"); + println!("By {} - v{} - GNU GPL v3", env!("CARGO_PKG_AUTHORS"), env!("CARGO_PKG_VERSION")); + println!(); + } + + if args.verbose { + println!("Verbose output enabled"); + println!("Project path: {:?}", args.project_path); + println!("Exclude path: {:?}", args.ignore_path); + println!("Using rules file: {}", args.rules_file); + println!("Verbose output: {}", args.verbose); + } + + if args.init { + println!("Initializing rules file..."); + create_rules_file(".solidhunter.json"); + println!("Done!"); + return; + } + + if !args.to_json && args.file_to_lint == "" { + lint_folder(args); + } + else if args.file_to_lint != "" { + let mut linter: SolidLinter = SolidLinter::new(); + linter.initalize(&args.rules_file); + + let result = linter.parse_file(args.file_to_lint); + if !args.to_json { + match result { + Ok(diags) => { + for diag in diags { + print_diag(&diag); + } + } + Err(e) => { + println!("{}", e); + } + } + } else { + match result { + Ok(diags) => { + let json = serde_json::to_string_pretty(&diags); + match json { + Ok(j) => { + println!("{}", j); + } + Err(e) => { + println!("{}", e); + } + } + } + Err(e) => { + println!("{}", e); + } + } + } + } +} From 29f56fca5f9516fa9388a36896f41b099438f659 Mon Sep 17 00:00:00 2001 From: 0xtekgrinder <0xtekgrinder@protonmail.com> Date: Thu, 31 Aug 2023 19:08:25 +0200 Subject: [PATCH 004/325] refactor(linter): linter has the right architecture of files --- remove-me-8c6a45fa260b4ee0b7bd.txt | 1 - toolchains/solidity/linter/.unstable | 0 toolchains/solidity/linter/{ => core}/.gitignore | 0 toolchains/solidity/linter/{ => core}/Cargo.lock | 0 toolchains/solidity/linter/{ => core}/Cargo.toml | 0 toolchains/solidity/linter/core/package.json | 9 +++++++++ .../solidity/linter/{ => core}/solc-wrapper/.gitignore | 0 .../solidity/linter/{ => core}/solc-wrapper/Cargo.toml | 0 .../linter/{ => core}/solc-wrapper/src/ast/ast.rs | 0 .../linter/{ => core}/solc-wrapper/src/ast/error.rs | 0 .../linter/{ => core}/solc-wrapper/src/ast/mod.rs | 0 .../linter/{ => core}/solc-wrapper/src/ast/parse.rs | 0 .../linter/{ => core}/solc-wrapper/src/ast/utils.rs | 0 .../linter/{ => core}/solc-wrapper/src/error.rs | 0 .../solidity/linter/{ => core}/solc-wrapper/src/lib.rs | 0 .../linter/{ => core}/solc-wrapper/src/solc/command.rs | 0 .../linter/{ => core}/solc-wrapper/src/solc/error.rs | 0 .../linter/{ => core}/solc-wrapper/src/solc/mod.rs | 0 .../{ => core}/solc-wrapper/src/solc/parsing_error.rs | 0 .../linter/{ => core}/solc-wrapper/src/utils.rs | 0 .../{ => core}/solc-wrapper/src/version/error.rs | 0 .../linter/{ => core}/solc-wrapper/src/version/mod.rs | 0 .../{ => core}/solc-wrapper/src/version/version.rs | 0 .../solc-wrapper/tests/files/ast/Assignment.json | 0 .../solc-wrapper/tests/files/ast/BinaryOperation.json | 0 .../{ => core}/solc-wrapper/tests/files/ast/Block.json | 0 .../{ => core}/solc-wrapper/tests/files/ast/Break.json | 0 .../solc-wrapper/tests/files/ast/Conditional.json | 0 .../solc-wrapper/tests/files/ast/Continue.json | 0 .../tests/files/ast/ContractDefinition.json | 0 .../solc-wrapper/tests/files/ast/DoWhileStatement.json | 0 .../tests/files/ast/ElementaryTypeName.json | 0 .../tests/files/ast/ElementaryTypeNameExpression.json | 0 .../solc-wrapper/tests/files/ast/EmitStatement.json | 0 .../solc-wrapper/tests/files/ast/EnumDefinition.json | 0 .../solc-wrapper/tests/files/ast/EnumValue.json | 0 .../solc-wrapper/tests/files/ast/ErrorDefinition.json | 0 .../solc-wrapper/tests/files/ast/EventDefinition.json | 0 .../tests/files/ast/ExpressionStatement.json | 0 .../solc-wrapper/tests/files/ast/ForStatement.json | 0 .../solc-wrapper/tests/files/ast/FunctionCall.json | 0 .../tests/files/ast/FunctionCallOptions.json | 0 .../tests/files/ast/FunctionDefinition.json | 0 .../solc-wrapper/tests/files/ast/FunctionTypeName.json | 0 .../solc-wrapper/tests/files/ast/Identifier.json | 0 .../solc-wrapper/tests/files/ast/IfStatement.json | 0 .../solc-wrapper/tests/files/ast/ImportDirective.json | 0 .../solc-wrapper/tests/files/ast/IndexAccess.json | 0 .../solc-wrapper/tests/files/ast/IndexRangeAccess.json | 0 .../tests/files/ast/InheritanceSpecifier.json | 0 .../solc-wrapper/tests/files/ast/InlineAssembly.json | 0 .../solc-wrapper/tests/files/ast/Literal.json | 0 .../solc-wrapper/tests/files/ast/MemberAccess.json | 0 .../tests/files/ast/ModifierDefinition.json | 0 .../tests/files/ast/ModifierInvocation.json | 0 .../solc-wrapper/tests/files/ast/NewExpression.json | 0 .../solc-wrapper/tests/files/ast/ParameterList.json | 0 .../tests/files/ast/PlaceholderStatement.json | 0 .../solc-wrapper/tests/files/ast/PragmaDirective.json | 0 .../solc-wrapper/tests/files/ast/Return.json | 0 .../solc-wrapper/tests/files/ast/RevertStatement.json | 0 .../solc-wrapper/tests/files/ast/SourceUnit.json | 0 .../solc-wrapper/tests/files/ast/StructDefinition.json | 0 .../tests/files/ast/StructuredDocumentation.json | 0 .../solc-wrapper/tests/files/ast/TryStatement.json | 0 .../solc-wrapper/tests/files/ast/TupleExpression.json | 0 .../solc-wrapper/tests/files/ast/TypeDescriptions.json | 0 .../solc-wrapper/tests/files/ast/UnaryOperation.json | 0 .../solc-wrapper/tests/files/ast/UncheckedBlock.json | 0 .../files/ast/UserDefinedValueTypeDefinition.json | 0 .../tests/files/ast/UsingForDirective.json | 0 .../tests/files/ast/VariableDeclaration.json | 0 .../solc-wrapper/tests/files/ast/WhileStatement.json | 0 .../linter/{ => core}/solidhunter-lib/.gitignore | 0 .../linter/{ => core}/solidhunter-lib/Cargo.toml | 0 .../linter/{ => core}/solidhunter-lib/src/lib.rs | 0 .../linter/{ => core}/solidhunter-lib/src/linter.rs | 0 .../src/rules/best_practises/function_max_lines.rs | 0 .../src/rules/best_practises/line_maxlen.rs | 0 .../src/rules/best_practises/max_states_count.rs | 0 .../solidhunter-lib/src/rules/best_practises/mod.rs | 0 .../src/rules/best_practises/reason_string.rs | 0 .../{ => core}/solidhunter-lib/src/rules/factory.rs | 0 .../solidhunter-lib/src/rules/miscellaneous/mod.rs | 0 .../solidhunter-lib/src/rules/miscellaneous/quotes.rs | 0 .../linter/{ => core}/solidhunter-lib/src/rules/mod.rs | 0 .../src/rules/naming/contract_name_pascalcase.rs | 0 .../src/rules/naming/func_name_camelcase.rs | 0 .../src/rules/naming/func_param_name_camelcase.rs | 0 .../{ => core}/solidhunter-lib/src/rules/naming/mod.rs | 0 .../src/rules/naming/use_forbidden_name.rs | 0 .../solidhunter-lib/src/rules/order/import_on_top.rs | 0 .../{ => core}/solidhunter-lib/src/rules/order/mod.rs | 0 .../{ => core}/solidhunter-lib/src/rules/rule_impl.rs | 0 .../{ => core}/solidhunter-lib/src/rules/types.rs | 0 .../linter/{ => core}/solidhunter-lib/src/types.rs | 0 toolchains/solidity/linter/{ => core}/src/main.rs | 0 toolchains/solidity/linter/package.json | 10 +++------- 98 files changed, 12 insertions(+), 8 deletions(-) delete mode 100644 remove-me-8c6a45fa260b4ee0b7bd.txt create mode 100644 toolchains/solidity/linter/.unstable rename toolchains/solidity/linter/{ => core}/.gitignore (100%) rename toolchains/solidity/linter/{ => core}/Cargo.lock (100%) rename toolchains/solidity/linter/{ => core}/Cargo.toml (100%) create mode 100644 toolchains/solidity/linter/core/package.json rename toolchains/solidity/linter/{ => core}/solc-wrapper/.gitignore (100%) rename toolchains/solidity/linter/{ => core}/solc-wrapper/Cargo.toml (100%) rename toolchains/solidity/linter/{ => core}/solc-wrapper/src/ast/ast.rs (100%) rename toolchains/solidity/linter/{ => core}/solc-wrapper/src/ast/error.rs (100%) rename toolchains/solidity/linter/{ => core}/solc-wrapper/src/ast/mod.rs (100%) rename toolchains/solidity/linter/{ => core}/solc-wrapper/src/ast/parse.rs (100%) rename toolchains/solidity/linter/{ => core}/solc-wrapper/src/ast/utils.rs (100%) rename toolchains/solidity/linter/{ => core}/solc-wrapper/src/error.rs (100%) rename toolchains/solidity/linter/{ => core}/solc-wrapper/src/lib.rs (100%) rename toolchains/solidity/linter/{ => core}/solc-wrapper/src/solc/command.rs (100%) rename toolchains/solidity/linter/{ => core}/solc-wrapper/src/solc/error.rs (100%) rename toolchains/solidity/linter/{ => core}/solc-wrapper/src/solc/mod.rs (100%) rename toolchains/solidity/linter/{ => core}/solc-wrapper/src/solc/parsing_error.rs (100%) rename toolchains/solidity/linter/{ => core}/solc-wrapper/src/utils.rs (100%) rename toolchains/solidity/linter/{ => core}/solc-wrapper/src/version/error.rs (100%) rename toolchains/solidity/linter/{ => core}/solc-wrapper/src/version/mod.rs (100%) rename toolchains/solidity/linter/{ => core}/solc-wrapper/src/version/version.rs (100%) rename toolchains/solidity/linter/{ => core}/solc-wrapper/tests/files/ast/Assignment.json (100%) rename toolchains/solidity/linter/{ => core}/solc-wrapper/tests/files/ast/BinaryOperation.json (100%) rename toolchains/solidity/linter/{ => core}/solc-wrapper/tests/files/ast/Block.json (100%) rename toolchains/solidity/linter/{ => core}/solc-wrapper/tests/files/ast/Break.json (100%) rename toolchains/solidity/linter/{ => core}/solc-wrapper/tests/files/ast/Conditional.json (100%) rename toolchains/solidity/linter/{ => core}/solc-wrapper/tests/files/ast/Continue.json (100%) rename toolchains/solidity/linter/{ => core}/solc-wrapper/tests/files/ast/ContractDefinition.json (100%) rename toolchains/solidity/linter/{ => core}/solc-wrapper/tests/files/ast/DoWhileStatement.json (100%) rename toolchains/solidity/linter/{ => core}/solc-wrapper/tests/files/ast/ElementaryTypeName.json (100%) rename toolchains/solidity/linter/{ => core}/solc-wrapper/tests/files/ast/ElementaryTypeNameExpression.json (100%) rename toolchains/solidity/linter/{ => core}/solc-wrapper/tests/files/ast/EmitStatement.json (100%) rename toolchains/solidity/linter/{ => core}/solc-wrapper/tests/files/ast/EnumDefinition.json (100%) rename toolchains/solidity/linter/{ => core}/solc-wrapper/tests/files/ast/EnumValue.json (100%) rename toolchains/solidity/linter/{ => core}/solc-wrapper/tests/files/ast/ErrorDefinition.json (100%) rename toolchains/solidity/linter/{ => core}/solc-wrapper/tests/files/ast/EventDefinition.json (100%) rename toolchains/solidity/linter/{ => core}/solc-wrapper/tests/files/ast/ExpressionStatement.json (100%) rename toolchains/solidity/linter/{ => core}/solc-wrapper/tests/files/ast/ForStatement.json (100%) rename toolchains/solidity/linter/{ => core}/solc-wrapper/tests/files/ast/FunctionCall.json (100%) rename toolchains/solidity/linter/{ => core}/solc-wrapper/tests/files/ast/FunctionCallOptions.json (100%) rename toolchains/solidity/linter/{ => core}/solc-wrapper/tests/files/ast/FunctionDefinition.json (100%) rename toolchains/solidity/linter/{ => core}/solc-wrapper/tests/files/ast/FunctionTypeName.json (100%) rename toolchains/solidity/linter/{ => core}/solc-wrapper/tests/files/ast/Identifier.json (100%) rename toolchains/solidity/linter/{ => core}/solc-wrapper/tests/files/ast/IfStatement.json (100%) rename toolchains/solidity/linter/{ => core}/solc-wrapper/tests/files/ast/ImportDirective.json (100%) rename toolchains/solidity/linter/{ => core}/solc-wrapper/tests/files/ast/IndexAccess.json (100%) rename toolchains/solidity/linter/{ => core}/solc-wrapper/tests/files/ast/IndexRangeAccess.json (100%) rename toolchains/solidity/linter/{ => core}/solc-wrapper/tests/files/ast/InheritanceSpecifier.json (100%) rename toolchains/solidity/linter/{ => core}/solc-wrapper/tests/files/ast/InlineAssembly.json (100%) rename toolchains/solidity/linter/{ => core}/solc-wrapper/tests/files/ast/Literal.json (100%) rename toolchains/solidity/linter/{ => core}/solc-wrapper/tests/files/ast/MemberAccess.json (100%) rename toolchains/solidity/linter/{ => core}/solc-wrapper/tests/files/ast/ModifierDefinition.json (100%) rename toolchains/solidity/linter/{ => core}/solc-wrapper/tests/files/ast/ModifierInvocation.json (100%) rename toolchains/solidity/linter/{ => core}/solc-wrapper/tests/files/ast/NewExpression.json (100%) rename toolchains/solidity/linter/{ => core}/solc-wrapper/tests/files/ast/ParameterList.json (100%) rename toolchains/solidity/linter/{ => core}/solc-wrapper/tests/files/ast/PlaceholderStatement.json (100%) rename toolchains/solidity/linter/{ => core}/solc-wrapper/tests/files/ast/PragmaDirective.json (100%) rename toolchains/solidity/linter/{ => core}/solc-wrapper/tests/files/ast/Return.json (100%) rename toolchains/solidity/linter/{ => core}/solc-wrapper/tests/files/ast/RevertStatement.json (100%) rename toolchains/solidity/linter/{ => core}/solc-wrapper/tests/files/ast/SourceUnit.json (100%) rename toolchains/solidity/linter/{ => core}/solc-wrapper/tests/files/ast/StructDefinition.json (100%) rename toolchains/solidity/linter/{ => core}/solc-wrapper/tests/files/ast/StructuredDocumentation.json (100%) rename toolchains/solidity/linter/{ => core}/solc-wrapper/tests/files/ast/TryStatement.json (100%) rename toolchains/solidity/linter/{ => core}/solc-wrapper/tests/files/ast/TupleExpression.json (100%) rename toolchains/solidity/linter/{ => core}/solc-wrapper/tests/files/ast/TypeDescriptions.json (100%) rename toolchains/solidity/linter/{ => core}/solc-wrapper/tests/files/ast/UnaryOperation.json (100%) rename toolchains/solidity/linter/{ => core}/solc-wrapper/tests/files/ast/UncheckedBlock.json (100%) rename toolchains/solidity/linter/{ => core}/solc-wrapper/tests/files/ast/UserDefinedValueTypeDefinition.json (100%) rename toolchains/solidity/linter/{ => core}/solc-wrapper/tests/files/ast/UsingForDirective.json (100%) rename toolchains/solidity/linter/{ => core}/solc-wrapper/tests/files/ast/VariableDeclaration.json (100%) rename toolchains/solidity/linter/{ => core}/solc-wrapper/tests/files/ast/WhileStatement.json (100%) rename toolchains/solidity/linter/{ => core}/solidhunter-lib/.gitignore (100%) rename toolchains/solidity/linter/{ => core}/solidhunter-lib/Cargo.toml (100%) rename toolchains/solidity/linter/{ => core}/solidhunter-lib/src/lib.rs (100%) rename toolchains/solidity/linter/{ => core}/solidhunter-lib/src/linter.rs (100%) rename toolchains/solidity/linter/{ => core}/solidhunter-lib/src/rules/best_practises/function_max_lines.rs (100%) rename toolchains/solidity/linter/{ => core}/solidhunter-lib/src/rules/best_practises/line_maxlen.rs (100%) rename toolchains/solidity/linter/{ => core}/solidhunter-lib/src/rules/best_practises/max_states_count.rs (100%) rename toolchains/solidity/linter/{ => core}/solidhunter-lib/src/rules/best_practises/mod.rs (100%) rename toolchains/solidity/linter/{ => core}/solidhunter-lib/src/rules/best_practises/reason_string.rs (100%) rename toolchains/solidity/linter/{ => core}/solidhunter-lib/src/rules/factory.rs (100%) rename toolchains/solidity/linter/{ => core}/solidhunter-lib/src/rules/miscellaneous/mod.rs (100%) rename toolchains/solidity/linter/{ => core}/solidhunter-lib/src/rules/miscellaneous/quotes.rs (100%) rename toolchains/solidity/linter/{ => core}/solidhunter-lib/src/rules/mod.rs (100%) rename toolchains/solidity/linter/{ => core}/solidhunter-lib/src/rules/naming/contract_name_pascalcase.rs (100%) rename toolchains/solidity/linter/{ => core}/solidhunter-lib/src/rules/naming/func_name_camelcase.rs (100%) rename toolchains/solidity/linter/{ => core}/solidhunter-lib/src/rules/naming/func_param_name_camelcase.rs (100%) rename toolchains/solidity/linter/{ => core}/solidhunter-lib/src/rules/naming/mod.rs (100%) rename toolchains/solidity/linter/{ => core}/solidhunter-lib/src/rules/naming/use_forbidden_name.rs (100%) rename toolchains/solidity/linter/{ => core}/solidhunter-lib/src/rules/order/import_on_top.rs (100%) rename toolchains/solidity/linter/{ => core}/solidhunter-lib/src/rules/order/mod.rs (100%) rename toolchains/solidity/linter/{ => core}/solidhunter-lib/src/rules/rule_impl.rs (100%) rename toolchains/solidity/linter/{ => core}/solidhunter-lib/src/rules/types.rs (100%) rename toolchains/solidity/linter/{ => core}/solidhunter-lib/src/types.rs (100%) rename toolchains/solidity/linter/{ => core}/src/main.rs (100%) diff --git a/remove-me-8c6a45fa260b4ee0b7bd.txt b/remove-me-8c6a45fa260b4ee0b7bd.txt deleted file mode 100644 index c48e6879..00000000 --- a/remove-me-8c6a45fa260b4ee0b7bd.txt +++ /dev/null @@ -1 +0,0 @@ -8c6a45fa260b4ee0b7bd diff --git a/toolchains/solidity/linter/.unstable b/toolchains/solidity/linter/.unstable new file mode 100644 index 00000000..e69de29b diff --git a/toolchains/solidity/linter/.gitignore b/toolchains/solidity/linter/core/.gitignore similarity index 100% rename from toolchains/solidity/linter/.gitignore rename to toolchains/solidity/linter/core/.gitignore diff --git a/toolchains/solidity/linter/Cargo.lock b/toolchains/solidity/linter/core/Cargo.lock similarity index 100% rename from toolchains/solidity/linter/Cargo.lock rename to toolchains/solidity/linter/core/Cargo.lock diff --git a/toolchains/solidity/linter/Cargo.toml b/toolchains/solidity/linter/core/Cargo.toml similarity index 100% rename from toolchains/solidity/linter/Cargo.toml rename to toolchains/solidity/linter/core/Cargo.toml diff --git a/toolchains/solidity/linter/core/package.json b/toolchains/solidity/linter/core/package.json new file mode 100644 index 00000000..8d2a3507 --- /dev/null +++ b/toolchains/solidity/linter/core/package.json @@ -0,0 +1,9 @@ +{ + "name": "core", + "version": "0.0.1", + "license": "MIT", + "scripts": { + "build": "cargo build --release", + "test": "cargo test" + } +} diff --git a/toolchains/solidity/linter/solc-wrapper/.gitignore b/toolchains/solidity/linter/core/solc-wrapper/.gitignore similarity index 100% rename from toolchains/solidity/linter/solc-wrapper/.gitignore rename to toolchains/solidity/linter/core/solc-wrapper/.gitignore diff --git a/toolchains/solidity/linter/solc-wrapper/Cargo.toml b/toolchains/solidity/linter/core/solc-wrapper/Cargo.toml similarity index 100% rename from toolchains/solidity/linter/solc-wrapper/Cargo.toml rename to toolchains/solidity/linter/core/solc-wrapper/Cargo.toml diff --git a/toolchains/solidity/linter/solc-wrapper/src/ast/ast.rs b/toolchains/solidity/linter/core/solc-wrapper/src/ast/ast.rs similarity index 100% rename from toolchains/solidity/linter/solc-wrapper/src/ast/ast.rs rename to toolchains/solidity/linter/core/solc-wrapper/src/ast/ast.rs diff --git a/toolchains/solidity/linter/solc-wrapper/src/ast/error.rs b/toolchains/solidity/linter/core/solc-wrapper/src/ast/error.rs similarity index 100% rename from toolchains/solidity/linter/solc-wrapper/src/ast/error.rs rename to toolchains/solidity/linter/core/solc-wrapper/src/ast/error.rs diff --git a/toolchains/solidity/linter/solc-wrapper/src/ast/mod.rs b/toolchains/solidity/linter/core/solc-wrapper/src/ast/mod.rs similarity index 100% rename from toolchains/solidity/linter/solc-wrapper/src/ast/mod.rs rename to toolchains/solidity/linter/core/solc-wrapper/src/ast/mod.rs diff --git a/toolchains/solidity/linter/solc-wrapper/src/ast/parse.rs b/toolchains/solidity/linter/core/solc-wrapper/src/ast/parse.rs similarity index 100% rename from toolchains/solidity/linter/solc-wrapper/src/ast/parse.rs rename to toolchains/solidity/linter/core/solc-wrapper/src/ast/parse.rs diff --git a/toolchains/solidity/linter/solc-wrapper/src/ast/utils.rs b/toolchains/solidity/linter/core/solc-wrapper/src/ast/utils.rs similarity index 100% rename from toolchains/solidity/linter/solc-wrapper/src/ast/utils.rs rename to toolchains/solidity/linter/core/solc-wrapper/src/ast/utils.rs diff --git a/toolchains/solidity/linter/solc-wrapper/src/error.rs b/toolchains/solidity/linter/core/solc-wrapper/src/error.rs similarity index 100% rename from toolchains/solidity/linter/solc-wrapper/src/error.rs rename to toolchains/solidity/linter/core/solc-wrapper/src/error.rs diff --git a/toolchains/solidity/linter/solc-wrapper/src/lib.rs b/toolchains/solidity/linter/core/solc-wrapper/src/lib.rs similarity index 100% rename from toolchains/solidity/linter/solc-wrapper/src/lib.rs rename to toolchains/solidity/linter/core/solc-wrapper/src/lib.rs diff --git a/toolchains/solidity/linter/solc-wrapper/src/solc/command.rs b/toolchains/solidity/linter/core/solc-wrapper/src/solc/command.rs similarity index 100% rename from toolchains/solidity/linter/solc-wrapper/src/solc/command.rs rename to toolchains/solidity/linter/core/solc-wrapper/src/solc/command.rs diff --git a/toolchains/solidity/linter/solc-wrapper/src/solc/error.rs b/toolchains/solidity/linter/core/solc-wrapper/src/solc/error.rs similarity index 100% rename from toolchains/solidity/linter/solc-wrapper/src/solc/error.rs rename to toolchains/solidity/linter/core/solc-wrapper/src/solc/error.rs diff --git a/toolchains/solidity/linter/solc-wrapper/src/solc/mod.rs b/toolchains/solidity/linter/core/solc-wrapper/src/solc/mod.rs similarity index 100% rename from toolchains/solidity/linter/solc-wrapper/src/solc/mod.rs rename to toolchains/solidity/linter/core/solc-wrapper/src/solc/mod.rs diff --git a/toolchains/solidity/linter/solc-wrapper/src/solc/parsing_error.rs b/toolchains/solidity/linter/core/solc-wrapper/src/solc/parsing_error.rs similarity index 100% rename from toolchains/solidity/linter/solc-wrapper/src/solc/parsing_error.rs rename to toolchains/solidity/linter/core/solc-wrapper/src/solc/parsing_error.rs diff --git a/toolchains/solidity/linter/solc-wrapper/src/utils.rs b/toolchains/solidity/linter/core/solc-wrapper/src/utils.rs similarity index 100% rename from toolchains/solidity/linter/solc-wrapper/src/utils.rs rename to toolchains/solidity/linter/core/solc-wrapper/src/utils.rs diff --git a/toolchains/solidity/linter/solc-wrapper/src/version/error.rs b/toolchains/solidity/linter/core/solc-wrapper/src/version/error.rs similarity index 100% rename from toolchains/solidity/linter/solc-wrapper/src/version/error.rs rename to toolchains/solidity/linter/core/solc-wrapper/src/version/error.rs diff --git a/toolchains/solidity/linter/solc-wrapper/src/version/mod.rs b/toolchains/solidity/linter/core/solc-wrapper/src/version/mod.rs similarity index 100% rename from toolchains/solidity/linter/solc-wrapper/src/version/mod.rs rename to toolchains/solidity/linter/core/solc-wrapper/src/version/mod.rs diff --git a/toolchains/solidity/linter/solc-wrapper/src/version/version.rs b/toolchains/solidity/linter/core/solc-wrapper/src/version/version.rs similarity index 100% rename from toolchains/solidity/linter/solc-wrapper/src/version/version.rs rename to toolchains/solidity/linter/core/solc-wrapper/src/version/version.rs diff --git a/toolchains/solidity/linter/solc-wrapper/tests/files/ast/Assignment.json b/toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/Assignment.json similarity index 100% rename from toolchains/solidity/linter/solc-wrapper/tests/files/ast/Assignment.json rename to toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/Assignment.json diff --git a/toolchains/solidity/linter/solc-wrapper/tests/files/ast/BinaryOperation.json b/toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/BinaryOperation.json similarity index 100% rename from toolchains/solidity/linter/solc-wrapper/tests/files/ast/BinaryOperation.json rename to toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/BinaryOperation.json diff --git a/toolchains/solidity/linter/solc-wrapper/tests/files/ast/Block.json b/toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/Block.json similarity index 100% rename from toolchains/solidity/linter/solc-wrapper/tests/files/ast/Block.json rename to toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/Block.json diff --git a/toolchains/solidity/linter/solc-wrapper/tests/files/ast/Break.json b/toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/Break.json similarity index 100% rename from toolchains/solidity/linter/solc-wrapper/tests/files/ast/Break.json rename to toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/Break.json diff --git a/toolchains/solidity/linter/solc-wrapper/tests/files/ast/Conditional.json b/toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/Conditional.json similarity index 100% rename from toolchains/solidity/linter/solc-wrapper/tests/files/ast/Conditional.json rename to toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/Conditional.json diff --git a/toolchains/solidity/linter/solc-wrapper/tests/files/ast/Continue.json b/toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/Continue.json similarity index 100% rename from toolchains/solidity/linter/solc-wrapper/tests/files/ast/Continue.json rename to toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/Continue.json diff --git a/toolchains/solidity/linter/solc-wrapper/tests/files/ast/ContractDefinition.json b/toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/ContractDefinition.json similarity index 100% rename from toolchains/solidity/linter/solc-wrapper/tests/files/ast/ContractDefinition.json rename to toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/ContractDefinition.json diff --git a/toolchains/solidity/linter/solc-wrapper/tests/files/ast/DoWhileStatement.json b/toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/DoWhileStatement.json similarity index 100% rename from toolchains/solidity/linter/solc-wrapper/tests/files/ast/DoWhileStatement.json rename to toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/DoWhileStatement.json diff --git a/toolchains/solidity/linter/solc-wrapper/tests/files/ast/ElementaryTypeName.json b/toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/ElementaryTypeName.json similarity index 100% rename from toolchains/solidity/linter/solc-wrapper/tests/files/ast/ElementaryTypeName.json rename to toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/ElementaryTypeName.json diff --git a/toolchains/solidity/linter/solc-wrapper/tests/files/ast/ElementaryTypeNameExpression.json b/toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/ElementaryTypeNameExpression.json similarity index 100% rename from toolchains/solidity/linter/solc-wrapper/tests/files/ast/ElementaryTypeNameExpression.json rename to toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/ElementaryTypeNameExpression.json diff --git a/toolchains/solidity/linter/solc-wrapper/tests/files/ast/EmitStatement.json b/toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/EmitStatement.json similarity index 100% rename from toolchains/solidity/linter/solc-wrapper/tests/files/ast/EmitStatement.json rename to toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/EmitStatement.json diff --git a/toolchains/solidity/linter/solc-wrapper/tests/files/ast/EnumDefinition.json b/toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/EnumDefinition.json similarity index 100% rename from toolchains/solidity/linter/solc-wrapper/tests/files/ast/EnumDefinition.json rename to toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/EnumDefinition.json diff --git a/toolchains/solidity/linter/solc-wrapper/tests/files/ast/EnumValue.json b/toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/EnumValue.json similarity index 100% rename from toolchains/solidity/linter/solc-wrapper/tests/files/ast/EnumValue.json rename to toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/EnumValue.json diff --git a/toolchains/solidity/linter/solc-wrapper/tests/files/ast/ErrorDefinition.json b/toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/ErrorDefinition.json similarity index 100% rename from toolchains/solidity/linter/solc-wrapper/tests/files/ast/ErrorDefinition.json rename to toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/ErrorDefinition.json diff --git a/toolchains/solidity/linter/solc-wrapper/tests/files/ast/EventDefinition.json b/toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/EventDefinition.json similarity index 100% rename from toolchains/solidity/linter/solc-wrapper/tests/files/ast/EventDefinition.json rename to toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/EventDefinition.json diff --git a/toolchains/solidity/linter/solc-wrapper/tests/files/ast/ExpressionStatement.json b/toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/ExpressionStatement.json similarity index 100% rename from toolchains/solidity/linter/solc-wrapper/tests/files/ast/ExpressionStatement.json rename to toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/ExpressionStatement.json diff --git a/toolchains/solidity/linter/solc-wrapper/tests/files/ast/ForStatement.json b/toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/ForStatement.json similarity index 100% rename from toolchains/solidity/linter/solc-wrapper/tests/files/ast/ForStatement.json rename to toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/ForStatement.json diff --git a/toolchains/solidity/linter/solc-wrapper/tests/files/ast/FunctionCall.json b/toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/FunctionCall.json similarity index 100% rename from toolchains/solidity/linter/solc-wrapper/tests/files/ast/FunctionCall.json rename to toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/FunctionCall.json diff --git a/toolchains/solidity/linter/solc-wrapper/tests/files/ast/FunctionCallOptions.json b/toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/FunctionCallOptions.json similarity index 100% rename from toolchains/solidity/linter/solc-wrapper/tests/files/ast/FunctionCallOptions.json rename to toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/FunctionCallOptions.json diff --git a/toolchains/solidity/linter/solc-wrapper/tests/files/ast/FunctionDefinition.json b/toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/FunctionDefinition.json similarity index 100% rename from toolchains/solidity/linter/solc-wrapper/tests/files/ast/FunctionDefinition.json rename to toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/FunctionDefinition.json diff --git a/toolchains/solidity/linter/solc-wrapper/tests/files/ast/FunctionTypeName.json b/toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/FunctionTypeName.json similarity index 100% rename from toolchains/solidity/linter/solc-wrapper/tests/files/ast/FunctionTypeName.json rename to toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/FunctionTypeName.json diff --git a/toolchains/solidity/linter/solc-wrapper/tests/files/ast/Identifier.json b/toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/Identifier.json similarity index 100% rename from toolchains/solidity/linter/solc-wrapper/tests/files/ast/Identifier.json rename to toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/Identifier.json diff --git a/toolchains/solidity/linter/solc-wrapper/tests/files/ast/IfStatement.json b/toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/IfStatement.json similarity index 100% rename from toolchains/solidity/linter/solc-wrapper/tests/files/ast/IfStatement.json rename to toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/IfStatement.json diff --git a/toolchains/solidity/linter/solc-wrapper/tests/files/ast/ImportDirective.json b/toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/ImportDirective.json similarity index 100% rename from toolchains/solidity/linter/solc-wrapper/tests/files/ast/ImportDirective.json rename to toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/ImportDirective.json diff --git a/toolchains/solidity/linter/solc-wrapper/tests/files/ast/IndexAccess.json b/toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/IndexAccess.json similarity index 100% rename from toolchains/solidity/linter/solc-wrapper/tests/files/ast/IndexAccess.json rename to toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/IndexAccess.json diff --git a/toolchains/solidity/linter/solc-wrapper/tests/files/ast/IndexRangeAccess.json b/toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/IndexRangeAccess.json similarity index 100% rename from toolchains/solidity/linter/solc-wrapper/tests/files/ast/IndexRangeAccess.json rename to toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/IndexRangeAccess.json diff --git a/toolchains/solidity/linter/solc-wrapper/tests/files/ast/InheritanceSpecifier.json b/toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/InheritanceSpecifier.json similarity index 100% rename from toolchains/solidity/linter/solc-wrapper/tests/files/ast/InheritanceSpecifier.json rename to toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/InheritanceSpecifier.json diff --git a/toolchains/solidity/linter/solc-wrapper/tests/files/ast/InlineAssembly.json b/toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/InlineAssembly.json similarity index 100% rename from toolchains/solidity/linter/solc-wrapper/tests/files/ast/InlineAssembly.json rename to toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/InlineAssembly.json diff --git a/toolchains/solidity/linter/solc-wrapper/tests/files/ast/Literal.json b/toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/Literal.json similarity index 100% rename from toolchains/solidity/linter/solc-wrapper/tests/files/ast/Literal.json rename to toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/Literal.json diff --git a/toolchains/solidity/linter/solc-wrapper/tests/files/ast/MemberAccess.json b/toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/MemberAccess.json similarity index 100% rename from toolchains/solidity/linter/solc-wrapper/tests/files/ast/MemberAccess.json rename to toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/MemberAccess.json diff --git a/toolchains/solidity/linter/solc-wrapper/tests/files/ast/ModifierDefinition.json b/toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/ModifierDefinition.json similarity index 100% rename from toolchains/solidity/linter/solc-wrapper/tests/files/ast/ModifierDefinition.json rename to toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/ModifierDefinition.json diff --git a/toolchains/solidity/linter/solc-wrapper/tests/files/ast/ModifierInvocation.json b/toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/ModifierInvocation.json similarity index 100% rename from toolchains/solidity/linter/solc-wrapper/tests/files/ast/ModifierInvocation.json rename to toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/ModifierInvocation.json diff --git a/toolchains/solidity/linter/solc-wrapper/tests/files/ast/NewExpression.json b/toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/NewExpression.json similarity index 100% rename from toolchains/solidity/linter/solc-wrapper/tests/files/ast/NewExpression.json rename to toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/NewExpression.json diff --git a/toolchains/solidity/linter/solc-wrapper/tests/files/ast/ParameterList.json b/toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/ParameterList.json similarity index 100% rename from toolchains/solidity/linter/solc-wrapper/tests/files/ast/ParameterList.json rename to toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/ParameterList.json diff --git a/toolchains/solidity/linter/solc-wrapper/tests/files/ast/PlaceholderStatement.json b/toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/PlaceholderStatement.json similarity index 100% rename from toolchains/solidity/linter/solc-wrapper/tests/files/ast/PlaceholderStatement.json rename to toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/PlaceholderStatement.json diff --git a/toolchains/solidity/linter/solc-wrapper/tests/files/ast/PragmaDirective.json b/toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/PragmaDirective.json similarity index 100% rename from toolchains/solidity/linter/solc-wrapper/tests/files/ast/PragmaDirective.json rename to toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/PragmaDirective.json diff --git a/toolchains/solidity/linter/solc-wrapper/tests/files/ast/Return.json b/toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/Return.json similarity index 100% rename from toolchains/solidity/linter/solc-wrapper/tests/files/ast/Return.json rename to toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/Return.json diff --git a/toolchains/solidity/linter/solc-wrapper/tests/files/ast/RevertStatement.json b/toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/RevertStatement.json similarity index 100% rename from toolchains/solidity/linter/solc-wrapper/tests/files/ast/RevertStatement.json rename to toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/RevertStatement.json diff --git a/toolchains/solidity/linter/solc-wrapper/tests/files/ast/SourceUnit.json b/toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/SourceUnit.json similarity index 100% rename from toolchains/solidity/linter/solc-wrapper/tests/files/ast/SourceUnit.json rename to toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/SourceUnit.json diff --git a/toolchains/solidity/linter/solc-wrapper/tests/files/ast/StructDefinition.json b/toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/StructDefinition.json similarity index 100% rename from toolchains/solidity/linter/solc-wrapper/tests/files/ast/StructDefinition.json rename to toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/StructDefinition.json diff --git a/toolchains/solidity/linter/solc-wrapper/tests/files/ast/StructuredDocumentation.json b/toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/StructuredDocumentation.json similarity index 100% rename from toolchains/solidity/linter/solc-wrapper/tests/files/ast/StructuredDocumentation.json rename to toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/StructuredDocumentation.json diff --git a/toolchains/solidity/linter/solc-wrapper/tests/files/ast/TryStatement.json b/toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/TryStatement.json similarity index 100% rename from toolchains/solidity/linter/solc-wrapper/tests/files/ast/TryStatement.json rename to toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/TryStatement.json diff --git a/toolchains/solidity/linter/solc-wrapper/tests/files/ast/TupleExpression.json b/toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/TupleExpression.json similarity index 100% rename from toolchains/solidity/linter/solc-wrapper/tests/files/ast/TupleExpression.json rename to toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/TupleExpression.json diff --git a/toolchains/solidity/linter/solc-wrapper/tests/files/ast/TypeDescriptions.json b/toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/TypeDescriptions.json similarity index 100% rename from toolchains/solidity/linter/solc-wrapper/tests/files/ast/TypeDescriptions.json rename to toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/TypeDescriptions.json diff --git a/toolchains/solidity/linter/solc-wrapper/tests/files/ast/UnaryOperation.json b/toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/UnaryOperation.json similarity index 100% rename from toolchains/solidity/linter/solc-wrapper/tests/files/ast/UnaryOperation.json rename to toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/UnaryOperation.json diff --git a/toolchains/solidity/linter/solc-wrapper/tests/files/ast/UncheckedBlock.json b/toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/UncheckedBlock.json similarity index 100% rename from toolchains/solidity/linter/solc-wrapper/tests/files/ast/UncheckedBlock.json rename to toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/UncheckedBlock.json diff --git a/toolchains/solidity/linter/solc-wrapper/tests/files/ast/UserDefinedValueTypeDefinition.json b/toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/UserDefinedValueTypeDefinition.json similarity index 100% rename from toolchains/solidity/linter/solc-wrapper/tests/files/ast/UserDefinedValueTypeDefinition.json rename to toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/UserDefinedValueTypeDefinition.json diff --git a/toolchains/solidity/linter/solc-wrapper/tests/files/ast/UsingForDirective.json b/toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/UsingForDirective.json similarity index 100% rename from toolchains/solidity/linter/solc-wrapper/tests/files/ast/UsingForDirective.json rename to toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/UsingForDirective.json diff --git a/toolchains/solidity/linter/solc-wrapper/tests/files/ast/VariableDeclaration.json b/toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/VariableDeclaration.json similarity index 100% rename from toolchains/solidity/linter/solc-wrapper/tests/files/ast/VariableDeclaration.json rename to toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/VariableDeclaration.json diff --git a/toolchains/solidity/linter/solc-wrapper/tests/files/ast/WhileStatement.json b/toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/WhileStatement.json similarity index 100% rename from toolchains/solidity/linter/solc-wrapper/tests/files/ast/WhileStatement.json rename to toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/WhileStatement.json diff --git a/toolchains/solidity/linter/solidhunter-lib/.gitignore b/toolchains/solidity/linter/core/solidhunter-lib/.gitignore similarity index 100% rename from toolchains/solidity/linter/solidhunter-lib/.gitignore rename to toolchains/solidity/linter/core/solidhunter-lib/.gitignore diff --git a/toolchains/solidity/linter/solidhunter-lib/Cargo.toml b/toolchains/solidity/linter/core/solidhunter-lib/Cargo.toml similarity index 100% rename from toolchains/solidity/linter/solidhunter-lib/Cargo.toml rename to toolchains/solidity/linter/core/solidhunter-lib/Cargo.toml diff --git a/toolchains/solidity/linter/solidhunter-lib/src/lib.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/lib.rs similarity index 100% rename from toolchains/solidity/linter/solidhunter-lib/src/lib.rs rename to toolchains/solidity/linter/core/solidhunter-lib/src/lib.rs diff --git a/toolchains/solidity/linter/solidhunter-lib/src/linter.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/linter.rs similarity index 100% rename from toolchains/solidity/linter/solidhunter-lib/src/linter.rs rename to toolchains/solidity/linter/core/solidhunter-lib/src/linter.rs diff --git a/toolchains/solidity/linter/solidhunter-lib/src/rules/best_practises/function_max_lines.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/function_max_lines.rs similarity index 100% rename from toolchains/solidity/linter/solidhunter-lib/src/rules/best_practises/function_max_lines.rs rename to toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/function_max_lines.rs diff --git a/toolchains/solidity/linter/solidhunter-lib/src/rules/best_practises/line_maxlen.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/line_maxlen.rs similarity index 100% rename from toolchains/solidity/linter/solidhunter-lib/src/rules/best_practises/line_maxlen.rs rename to toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/line_maxlen.rs diff --git a/toolchains/solidity/linter/solidhunter-lib/src/rules/best_practises/max_states_count.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/max_states_count.rs similarity index 100% rename from toolchains/solidity/linter/solidhunter-lib/src/rules/best_practises/max_states_count.rs rename to toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/max_states_count.rs diff --git a/toolchains/solidity/linter/solidhunter-lib/src/rules/best_practises/mod.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/mod.rs similarity index 100% rename from toolchains/solidity/linter/solidhunter-lib/src/rules/best_practises/mod.rs rename to toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/mod.rs diff --git a/toolchains/solidity/linter/solidhunter-lib/src/rules/best_practises/reason_string.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/reason_string.rs similarity index 100% rename from toolchains/solidity/linter/solidhunter-lib/src/rules/best_practises/reason_string.rs rename to toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/reason_string.rs diff --git a/toolchains/solidity/linter/solidhunter-lib/src/rules/factory.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/factory.rs similarity index 100% rename from toolchains/solidity/linter/solidhunter-lib/src/rules/factory.rs rename to toolchains/solidity/linter/core/solidhunter-lib/src/rules/factory.rs diff --git a/toolchains/solidity/linter/solidhunter-lib/src/rules/miscellaneous/mod.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/miscellaneous/mod.rs similarity index 100% rename from toolchains/solidity/linter/solidhunter-lib/src/rules/miscellaneous/mod.rs rename to toolchains/solidity/linter/core/solidhunter-lib/src/rules/miscellaneous/mod.rs diff --git a/toolchains/solidity/linter/solidhunter-lib/src/rules/miscellaneous/quotes.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/miscellaneous/quotes.rs similarity index 100% rename from toolchains/solidity/linter/solidhunter-lib/src/rules/miscellaneous/quotes.rs rename to toolchains/solidity/linter/core/solidhunter-lib/src/rules/miscellaneous/quotes.rs diff --git a/toolchains/solidity/linter/solidhunter-lib/src/rules/mod.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/mod.rs similarity index 100% rename from toolchains/solidity/linter/solidhunter-lib/src/rules/mod.rs rename to toolchains/solidity/linter/core/solidhunter-lib/src/rules/mod.rs diff --git a/toolchains/solidity/linter/solidhunter-lib/src/rules/naming/contract_name_pascalcase.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/contract_name_pascalcase.rs similarity index 100% rename from toolchains/solidity/linter/solidhunter-lib/src/rules/naming/contract_name_pascalcase.rs rename to toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/contract_name_pascalcase.rs diff --git a/toolchains/solidity/linter/solidhunter-lib/src/rules/naming/func_name_camelcase.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/func_name_camelcase.rs similarity index 100% rename from toolchains/solidity/linter/solidhunter-lib/src/rules/naming/func_name_camelcase.rs rename to toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/func_name_camelcase.rs diff --git a/toolchains/solidity/linter/solidhunter-lib/src/rules/naming/func_param_name_camelcase.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/func_param_name_camelcase.rs similarity index 100% rename from toolchains/solidity/linter/solidhunter-lib/src/rules/naming/func_param_name_camelcase.rs rename to toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/func_param_name_camelcase.rs diff --git a/toolchains/solidity/linter/solidhunter-lib/src/rules/naming/mod.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/mod.rs similarity index 100% rename from toolchains/solidity/linter/solidhunter-lib/src/rules/naming/mod.rs rename to toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/mod.rs diff --git a/toolchains/solidity/linter/solidhunter-lib/src/rules/naming/use_forbidden_name.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/use_forbidden_name.rs similarity index 100% rename from toolchains/solidity/linter/solidhunter-lib/src/rules/naming/use_forbidden_name.rs rename to toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/use_forbidden_name.rs diff --git a/toolchains/solidity/linter/solidhunter-lib/src/rules/order/import_on_top.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/order/import_on_top.rs similarity index 100% rename from toolchains/solidity/linter/solidhunter-lib/src/rules/order/import_on_top.rs rename to toolchains/solidity/linter/core/solidhunter-lib/src/rules/order/import_on_top.rs diff --git a/toolchains/solidity/linter/solidhunter-lib/src/rules/order/mod.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/order/mod.rs similarity index 100% rename from toolchains/solidity/linter/solidhunter-lib/src/rules/order/mod.rs rename to toolchains/solidity/linter/core/solidhunter-lib/src/rules/order/mod.rs diff --git a/toolchains/solidity/linter/solidhunter-lib/src/rules/rule_impl.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/rule_impl.rs similarity index 100% rename from toolchains/solidity/linter/solidhunter-lib/src/rules/rule_impl.rs rename to toolchains/solidity/linter/core/solidhunter-lib/src/rules/rule_impl.rs diff --git a/toolchains/solidity/linter/solidhunter-lib/src/rules/types.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/types.rs similarity index 100% rename from toolchains/solidity/linter/solidhunter-lib/src/rules/types.rs rename to toolchains/solidity/linter/core/solidhunter-lib/src/rules/types.rs diff --git a/toolchains/solidity/linter/solidhunter-lib/src/types.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/types.rs similarity index 100% rename from toolchains/solidity/linter/solidhunter-lib/src/types.rs rename to toolchains/solidity/linter/core/solidhunter-lib/src/types.rs diff --git a/toolchains/solidity/linter/src/main.rs b/toolchains/solidity/linter/core/src/main.rs similarity index 100% rename from toolchains/solidity/linter/src/main.rs rename to toolchains/solidity/linter/core/src/main.rs diff --git a/toolchains/solidity/linter/package.json b/toolchains/solidity/linter/package.json index 71f7c970..42de7a3e 100644 --- a/toolchains/solidity/linter/package.json +++ b/toolchains/solidity/linter/package.json @@ -1,13 +1,9 @@ { - "name": "osmium-solidity-linter", + "name": "@solidity/linter", "version": "0.0.1", "license": "MIT", - "workspaces": [ - "*" - ], "scripts": { - "build": "cargo build --release", - "test": "cargo test", - "publish": "echo 'publishing solidity linter...'" + "build": "yarn --cwd core build", + "test": "yarn --cwd core test" } } From 129b8b780ae545ce4e524ed27daf56b1753ed114 Mon Sep 17 00:00:00 2001 From: 0xMemoryGrinder <35138272+0xMemoryGrinder@users.noreply.github.com> Date: Fri, 8 Sep 2023 14:57:13 -0400 Subject: [PATCH 005/325] fix(solidity/linter): ran yarn install command to fix CI dependencies issues --- .pnp.cjs | 4140 +++++++---------------------------------------------- yarn.lock | 3542 ++++++--------------------------------------- 2 files changed, 967 insertions(+), 6715 deletions(-) diff --git a/.pnp.cjs b/.pnp.cjs index 46a12b15..8894b437 100644 --- a/.pnp.cjs +++ b/.pnp.cjs @@ -12,15 +12,15 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { ],\ "dependencyTreeRoots": [\ {\ - "name": "test-project-architecture",\ + "name": "osmium",\ "reference": "workspace:."\ },\ {\ - "name": "@libs/lsp-launcher",\ + "name": "@osmium-libs/lsp-launcher",\ "reference": "workspace:libs/lsp-launcher"\ },\ {\ - "name": "manager",\ + "name": "osmium-manager",\ "reference": "workspace:manager"\ },\ {\ @@ -32,34 +32,29 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { "reference": "workspace:packages/prettier-config"\ },\ {\ - "name": "cairo",\ - "reference": "workspace:toolchains/cairo"\ - },\ - {\ - "name": "@osmium-toolchains/solidity",\ + "name": "osmium-solidity-toolchain",\ "reference": "workspace:toolchains/solidity"\ },\ {\ - "name": "@osmium-solidity/lsp",\ - "reference": "workspace:toolchains/solidity/lsp"\ + "name": "@solidity/linter",\ + "reference": "workspace:toolchains/solidity/linter"\ },\ {\ - "name": "@osmium-solidity-lsp/extension",\ - "reference": "workspace:toolchains/solidity/lsp/extension"\ + "name": "osmium-solidity-lsp",\ + "reference": "workspace:toolchains/solidity/lsp"\ }\ ],\ "enableTopLevelFallback": true,\ "ignorePatternData": "(^(?:\\\\.yarn\\\\/sdks(?:\\\\/(?!\\\\.{1,2}(?:\\\\/|$))(?:(?:(?!(?:^|\\\\/)\\\\.{1,2}(?:\\\\/|$)).)*?)|$))$)",\ "fallbackExclusionList": [\ - ["@libs/lsp-launcher", ["workspace:libs/lsp-launcher"]],\ + ["@osmium-libs/lsp-launcher", ["workspace:libs/lsp-launcher"]],\ ["@osmium-packages/eslint-config", ["workspace:packages/eslint-config"]],\ ["@osmium-packages/prettier-config", ["workspace:packages/prettier-config"]],\ - ["@osmium-solidity-lsp/extension", ["workspace:toolchains/solidity/lsp/extension"]],\ - ["@osmium-solidity/lsp", ["workspace:toolchains/solidity/lsp"]],\ - ["@osmium-toolchains/solidity", ["workspace:toolchains/solidity"]],\ - ["cairo", ["workspace:toolchains/cairo"]],\ - ["manager", ["workspace:manager"]],\ - ["test-project-architecture", ["workspace:."]]\ + ["@solidity/linter", ["workspace:toolchains/solidity/linter"]],\ + ["osmium", ["workspace:."]],\ + ["osmium-manager", ["workspace:manager"]],\ + ["osmium-solidity-lsp", ["workspace:toolchains/solidity/lsp"]],\ + ["osmium-solidity-toolchain", ["workspace:toolchains/solidity"]]\ ],\ "fallbackPool": [\ ],\ @@ -82,15 +77,6 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { "linkType": "HARD"\ }]\ ]],\ - ["@discoveryjs/json-ext", [\ - ["npm:0.5.7", {\ - "packageLocation": "./.yarn/cache/@discoveryjs-json-ext-npm-0.5.7-fe04af1f31-2176d301cc.zip/node_modules/@discoveryjs/json-ext/",\ - "packageDependencies": [\ - ["@discoveryjs/json-ext", "npm:0.5.7"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ ["@eslint-community/eslint-utils", [\ ["npm:4.4.0", {\ "packageLocation": "./.yarn/cache/@eslint-community-eslint-utils-npm-4.4.0-d1791bd5a3-cdfe3ae42b.zip/node_modules/@eslint-community/eslint-utils/",\ @@ -180,107 +166,6 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { "linkType": "HARD"\ }]\ ]],\ - ["@isaacs/cliui", [\ - ["npm:8.0.2", {\ - "packageLocation": "./.yarn/cache/@isaacs-cliui-npm-8.0.2-f4364666d5-4a473b9b32.zip/node_modules/@isaacs/cliui/",\ - "packageDependencies": [\ - ["@isaacs/cliui", "npm:8.0.2"],\ - ["string-width", "npm:5.1.2"],\ - ["string-width-cjs", [\ - "string-width",\ - "npm:4.2.3"\ - ]],\ - ["strip-ansi", "npm:7.1.0"],\ - ["strip-ansi-cjs", [\ - "strip-ansi",\ - "npm:6.0.1"\ - ]],\ - ["wrap-ansi", "npm:8.1.0"],\ - ["wrap-ansi-cjs", [\ - "wrap-ansi",\ - "npm:7.0.0"\ - ]]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["@jridgewell/gen-mapping", [\ - ["npm:0.3.3", {\ - "packageLocation": "./.yarn/cache/@jridgewell-gen-mapping-npm-0.3.3-1815eba94c-4a74944bd3.zip/node_modules/@jridgewell/gen-mapping/",\ - "packageDependencies": [\ - ["@jridgewell/gen-mapping", "npm:0.3.3"],\ - ["@jridgewell/set-array", "npm:1.1.2"],\ - ["@jridgewell/sourcemap-codec", "npm:1.4.15"],\ - ["@jridgewell/trace-mapping", "npm:0.3.18"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["@jridgewell/resolve-uri", [\ - ["npm:3.1.0", {\ - "packageLocation": "./.yarn/cache/@jridgewell-resolve-uri-npm-3.1.0-6ff2351e61-b5ceaaf9a1.zip/node_modules/@jridgewell/resolve-uri/",\ - "packageDependencies": [\ - ["@jridgewell/resolve-uri", "npm:3.1.0"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["@jridgewell/set-array", [\ - ["npm:1.1.2", {\ - "packageLocation": "./.yarn/cache/@jridgewell-set-array-npm-1.1.2-45b82d7fb6-69a84d5980.zip/node_modules/@jridgewell/set-array/",\ - "packageDependencies": [\ - ["@jridgewell/set-array", "npm:1.1.2"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["@jridgewell/source-map", [\ - ["npm:0.3.5", {\ - "packageLocation": "./.yarn/cache/@jridgewell-source-map-npm-0.3.5-9f964eaf44-1ad4dec0bd.zip/node_modules/@jridgewell/source-map/",\ - "packageDependencies": [\ - ["@jridgewell/source-map", "npm:0.3.5"],\ - ["@jridgewell/gen-mapping", "npm:0.3.3"],\ - ["@jridgewell/trace-mapping", "npm:0.3.18"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["@jridgewell/sourcemap-codec", [\ - ["npm:1.4.14", {\ - "packageLocation": "./.yarn/cache/@jridgewell-sourcemap-codec-npm-1.4.14-f5f0630788-61100637b6.zip/node_modules/@jridgewell/sourcemap-codec/",\ - "packageDependencies": [\ - ["@jridgewell/sourcemap-codec", "npm:1.4.14"]\ - ],\ - "linkType": "HARD"\ - }],\ - ["npm:1.4.15", {\ - "packageLocation": "./.yarn/cache/@jridgewell-sourcemap-codec-npm-1.4.15-a055fb62cf-b881c7e503.zip/node_modules/@jridgewell/sourcemap-codec/",\ - "packageDependencies": [\ - ["@jridgewell/sourcemap-codec", "npm:1.4.15"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["@jridgewell/trace-mapping", [\ - ["npm:0.3.18", {\ - "packageLocation": "./.yarn/cache/@jridgewell-trace-mapping-npm-0.3.18-cd96571385-0572669f85.zip/node_modules/@jridgewell/trace-mapping/",\ - "packageDependencies": [\ - ["@jridgewell/trace-mapping", "npm:0.3.18"],\ - ["@jridgewell/resolve-uri", "npm:3.1.0"],\ - ["@jridgewell/sourcemap-codec", "npm:1.4.14"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["@libs/lsp-launcher", [\ - ["workspace:libs/lsp-launcher", {\ - "packageLocation": "./libs/lsp-launcher/",\ - "packageDependencies": [\ - ["@libs/lsp-launcher", "workspace:libs/lsp-launcher"]\ - ],\ - "linkType": "SOFT"\ - }]\ - ]],\ ["@nodelib/fs.scandir", [\ ["npm:2.1.5", {\ "packageLocation": "./.yarn/cache/@nodelib-fs.scandir-npm-2.1.5-89c67370dd-a970d595bd.zip/node_modules/@nodelib/fs.scandir/",\ @@ -312,14 +197,13 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { "linkType": "HARD"\ }]\ ]],\ - ["@npmcli/fs", [\ - ["npm:3.1.0", {\ - "packageLocation": "./.yarn/cache/@npmcli-fs-npm-3.1.0-0844a57978-a50a6818de.zip/node_modules/@npmcli/fs/",\ + ["@osmium-libs/lsp-launcher", [\ + ["workspace:libs/lsp-launcher", {\ + "packageLocation": "./libs/lsp-launcher/",\ "packageDependencies": [\ - ["@npmcli/fs", "npm:3.1.0"],\ - ["semver", "npm:7.5.4"]\ + ["@osmium-libs/lsp-launcher", "workspace:libs/lsp-launcher"]\ ],\ - "linkType": "HARD"\ + "linkType": "SOFT"\ }]\ ]],\ ["@osmium-packages/eslint-config", [\ @@ -342,3963 +226,949 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { "linkType": "SOFT"\ }]\ ]],\ - ["@osmium-solidity-lsp/extension", [\ - ["workspace:toolchains/solidity/lsp/extension", {\ - "packageLocation": "./toolchains/solidity/lsp/extension/",\ + ["@solidity/linter", [\ + ["workspace:toolchains/solidity/linter", {\ + "packageLocation": "./toolchains/solidity/linter/",\ "packageDependencies": [\ - ["@osmium-solidity-lsp/extension", "workspace:toolchains/solidity/lsp/extension"],\ - ["@osmium-packages/eslint-config", "workspace:packages/eslint-config"],\ - ["@osmium-packages/prettier-config", "workspace:packages/prettier-config"],\ - ["@types/glob", "npm:8.1.0"],\ - ["@types/mocha", "npm:10.0.1"],\ - ["@types/node", "npm:20.2.5"],\ - ["@types/vscode", "npm:1.80.0"],\ - ["@typescript-eslint/eslint-plugin", "virtual:1ca5ffe7bd50eeef98202150e5e82f61f0cd48370e28be026fb583fb2f7a661646940189809f3c41a31e7fa741840d72885f5ba9590a9d578183b22f2ea105b5#npm:5.62.0"],\ - ["@typescript-eslint/parser", "virtual:1ca5ffe7bd50eeef98202150e5e82f61f0cd48370e28be026fb583fb2f7a661646940189809f3c41a31e7fa741840d72885f5ba9590a9d578183b22f2ea105b5#npm:5.62.0"],\ - ["@vscode/test-electron", "npm:2.3.3"],\ - ["eslint", "npm:8.46.0"],\ - ["glob", "npm:8.1.0"],\ - ["mocha", "npm:10.2.0"],\ - ["prettier", "npm:3.0.0"],\ - ["ts-loader", "virtual:1ca5ffe7bd50eeef98202150e5e82f61f0cd48370e28be026fb583fb2f7a661646940189809f3c41a31e7fa741840d72885f5ba9590a9d578183b22f2ea105b5#npm:9.4.4"],\ - ["typescript", "patch:typescript@npm%3A5.1.6#~builtin::version=5.1.6&hash=5da071"],\ - ["webpack", "virtual:1ca5ffe7bd50eeef98202150e5e82f61f0cd48370e28be026fb583fb2f7a661646940189809f3c41a31e7fa741840d72885f5ba9590a9d578183b22f2ea105b5#npm:5.88.2"],\ - ["webpack-cli", "virtual:1ca5ffe7bd50eeef98202150e5e82f61f0cd48370e28be026fb583fb2f7a661646940189809f3c41a31e7fa741840d72885f5ba9590a9d578183b22f2ea105b5#npm:5.1.4"]\ + ["@solidity/linter", "workspace:toolchains/solidity/linter"]\ ],\ "linkType": "SOFT"\ }]\ ]],\ - ["@osmium-solidity/lsp", [\ - ["workspace:toolchains/solidity/lsp", {\ - "packageLocation": "./toolchains/solidity/lsp/",\ + ["acorn", [\ + ["npm:8.10.0", {\ + "packageLocation": "./.yarn/cache/acorn-npm-8.10.0-2230c9e83e-538ba38af0.zip/node_modules/acorn/",\ "packageDependencies": [\ - ["@osmium-solidity/lsp", "workspace:toolchains/solidity/lsp"]\ + ["acorn", "npm:8.10.0"]\ ],\ - "linkType": "SOFT"\ + "linkType": "HARD"\ }]\ ]],\ - ["@osmium-toolchains/solidity", [\ - ["workspace:toolchains/solidity", {\ - "packageLocation": "./toolchains/solidity/",\ + ["acorn-jsx", [\ + ["npm:5.3.2", {\ + "packageLocation": "./.yarn/cache/acorn-jsx-npm-5.3.2-d7594599ea-c3d3b2a89c.zip/node_modules/acorn-jsx/",\ "packageDependencies": [\ - ["@osmium-toolchains/solidity", "workspace:toolchains/solidity"]\ + ["acorn-jsx", "npm:5.3.2"]\ ],\ "linkType": "SOFT"\ - }]\ - ]],\ - ["@pkgjs/parseargs", [\ - ["npm:0.11.0", {\ - "packageLocation": "./.yarn/cache/@pkgjs-parseargs-npm-0.11.0-cd2a3fe948-6ad6a00fc4.zip/node_modules/@pkgjs/parseargs/",\ + }],\ + ["virtual:a50722a5a9326b6a5f12350c494c4db3aa0f4caeac45e3e9e5fe071da20014ecfe738fe2ebe2c9c98abae81a4ea86b42f56d776b3bd5ec37f9ad3670c242b242#npm:5.3.2", {\ + "packageLocation": "./.yarn/__virtual__/acorn-jsx-virtual-834321b202/0/cache/acorn-jsx-npm-5.3.2-d7594599ea-c3d3b2a89c.zip/node_modules/acorn-jsx/",\ "packageDependencies": [\ - ["@pkgjs/parseargs", "npm:0.11.0"]\ + ["acorn-jsx", "virtual:a50722a5a9326b6a5f12350c494c4db3aa0f4caeac45e3e9e5fe071da20014ecfe738fe2ebe2c9c98abae81a4ea86b42f56d776b3bd5ec37f9ad3670c242b242#npm:5.3.2"],\ + ["@types/acorn", null],\ + ["acorn", "npm:8.10.0"]\ + ],\ + "packagePeers": [\ + "@types/acorn",\ + "acorn"\ ],\ "linkType": "HARD"\ }]\ ]],\ - ["@tootallnate/once", [\ - ["npm:1.1.2", {\ - "packageLocation": "./.yarn/cache/@tootallnate-once-npm-1.1.2-0517220057-e1fb1bbbc1.zip/node_modules/@tootallnate/once/",\ - "packageDependencies": [\ - ["@tootallnate/once", "npm:1.1.2"]\ - ],\ - "linkType": "HARD"\ - }],\ - ["npm:2.0.0", {\ - "packageLocation": "./.yarn/cache/@tootallnate-once-npm-2.0.0-e36cf4f140-ad87447820.zip/node_modules/@tootallnate/once/",\ + ["ajv", [\ + ["npm:6.12.6", {\ + "packageLocation": "./.yarn/cache/ajv-npm-6.12.6-4b5105e2b2-874972efe5.zip/node_modules/ajv/",\ "packageDependencies": [\ - ["@tootallnate/once", "npm:2.0.0"]\ + ["ajv", "npm:6.12.6"],\ + ["fast-deep-equal", "npm:3.1.3"],\ + ["fast-json-stable-stringify", "npm:2.1.0"],\ + ["json-schema-traverse", "npm:0.4.1"],\ + ["uri-js", "npm:4.4.1"]\ ],\ "linkType": "HARD"\ }]\ ]],\ - ["@types/eslint", [\ - ["npm:8.44.1", {\ - "packageLocation": "./.yarn/cache/@types-eslint-npm-8.44.1-0d28c810c6-8b45be72d3.zip/node_modules/@types/eslint/",\ + ["ansi-regex", [\ + ["npm:5.0.1", {\ + "packageLocation": "./.yarn/cache/ansi-regex-npm-5.0.1-c963a48615-2aa4bb54ca.zip/node_modules/ansi-regex/",\ "packageDependencies": [\ - ["@types/eslint", "npm:8.44.1"],\ - ["@types/estree", "npm:1.0.1"],\ - ["@types/json-schema", "npm:7.0.12"]\ + ["ansi-regex", "npm:5.0.1"]\ ],\ "linkType": "HARD"\ }]\ ]],\ - ["@types/eslint-scope", [\ - ["npm:3.7.4", {\ - "packageLocation": "./.yarn/cache/@types-eslint-scope-npm-3.7.4-c11d226d71-ea6a9363e9.zip/node_modules/@types/eslint-scope/",\ + ["ansi-styles", [\ + ["npm:4.3.0", {\ + "packageLocation": "./.yarn/cache/ansi-styles-npm-4.3.0-245c7d42c7-513b44c3b2.zip/node_modules/ansi-styles/",\ "packageDependencies": [\ - ["@types/eslint-scope", "npm:3.7.4"],\ - ["@types/eslint", "npm:8.44.1"],\ - ["@types/estree", "npm:1.0.1"]\ + ["ansi-styles", "npm:4.3.0"],\ + ["color-convert", "npm:2.0.1"]\ ],\ "linkType": "HARD"\ }]\ ]],\ - ["@types/estree", [\ - ["npm:1.0.1", {\ - "packageLocation": "./.yarn/cache/@types-estree-npm-1.0.1-4c9469c165-e9aa175eac.zip/node_modules/@types/estree/",\ + ["argparse", [\ + ["npm:2.0.1", {\ + "packageLocation": "./.yarn/cache/argparse-npm-2.0.1-faff7999e6-83644b5649.zip/node_modules/argparse/",\ "packageDependencies": [\ - ["@types/estree", "npm:1.0.1"]\ + ["argparse", "npm:2.0.1"]\ ],\ "linkType": "HARD"\ }]\ ]],\ - ["@types/glob", [\ - ["npm:8.1.0", {\ - "packageLocation": "./.yarn/cache/@types-glob-npm-8.1.0-bdb9d0520c-9101f3a906.zip/node_modules/@types/glob/",\ + ["balanced-match", [\ + ["npm:1.0.2", {\ + "packageLocation": "./.yarn/cache/balanced-match-npm-1.0.2-a53c126459-9706c088a2.zip/node_modules/balanced-match/",\ "packageDependencies": [\ - ["@types/glob", "npm:8.1.0"],\ - ["@types/minimatch", "npm:5.1.2"],\ - ["@types/node", "npm:20.4.5"]\ + ["balanced-match", "npm:1.0.2"]\ ],\ "linkType": "HARD"\ }]\ ]],\ - ["@types/json-schema", [\ - ["npm:7.0.12", {\ - "packageLocation": "./.yarn/cache/@types-json-schema-npm-7.0.12-f05cfc0e99-00239e9723.zip/node_modules/@types/json-schema/",\ + ["brace-expansion", [\ + ["npm:1.1.11", {\ + "packageLocation": "./.yarn/cache/brace-expansion-npm-1.1.11-fb95eb05ad-faf34a7bb0.zip/node_modules/brace-expansion/",\ "packageDependencies": [\ - ["@types/json-schema", "npm:7.0.12"]\ + ["brace-expansion", "npm:1.1.11"],\ + ["balanced-match", "npm:1.0.2"],\ + ["concat-map", "npm:0.0.1"]\ ],\ "linkType": "HARD"\ }]\ ]],\ - ["@types/minimatch", [\ - ["npm:5.1.2", {\ - "packageLocation": "./.yarn/cache/@types-minimatch-npm-5.1.2-aab9c394d3-0391a28286.zip/node_modules/@types/minimatch/",\ + ["callsites", [\ + ["npm:3.1.0", {\ + "packageLocation": "./.yarn/cache/callsites-npm-3.1.0-268f989910-072d17b6ab.zip/node_modules/callsites/",\ "packageDependencies": [\ - ["@types/minimatch", "npm:5.1.2"]\ + ["callsites", "npm:3.1.0"]\ ],\ "linkType": "HARD"\ }]\ ]],\ - ["@types/mocha", [\ - ["npm:10.0.1", {\ - "packageLocation": "./.yarn/cache/@types-mocha-npm-10.0.1-7c94e9e170-224ea9fce7.zip/node_modules/@types/mocha/",\ + ["chalk", [\ + ["npm:4.1.2", {\ + "packageLocation": "./.yarn/cache/chalk-npm-4.1.2-ba8b67ab80-fe75c9d5c7.zip/node_modules/chalk/",\ "packageDependencies": [\ - ["@types/mocha", "npm:10.0.1"]\ + ["chalk", "npm:4.1.2"],\ + ["ansi-styles", "npm:4.3.0"],\ + ["supports-color", "npm:7.2.0"]\ ],\ "linkType": "HARD"\ }]\ ]],\ - ["@types/node", [\ - ["npm:20.2.5", {\ - "packageLocation": "./.yarn/cache/@types-node-npm-20.2.5-0014d2d9ce-38ce7c7e9d.zip/node_modules/@types/node/",\ + ["color-convert", [\ + ["npm:2.0.1", {\ + "packageLocation": "./.yarn/cache/color-convert-npm-2.0.1-79730e935b-79e6bdb9fd.zip/node_modules/color-convert/",\ "packageDependencies": [\ - ["@types/node", "npm:20.2.5"]\ + ["color-convert", "npm:2.0.1"],\ + ["color-name", "npm:1.1.4"]\ ],\ "linkType": "HARD"\ - }],\ - ["npm:20.4.5", {\ - "packageLocation": "./.yarn/cache/@types-node-npm-20.4.5-7555fad0d4-36a0304a8d.zip/node_modules/@types/node/",\ + }]\ + ]],\ + ["color-name", [\ + ["npm:1.1.4", {\ + "packageLocation": "./.yarn/cache/color-name-npm-1.1.4-025792b0ea-b044585952.zip/node_modules/color-name/",\ "packageDependencies": [\ - ["@types/node", "npm:20.4.5"]\ + ["color-name", "npm:1.1.4"]\ ],\ "linkType": "HARD"\ }]\ ]],\ - ["@types/semver", [\ - ["npm:7.5.0", {\ - "packageLocation": "./.yarn/cache/@types-semver-npm-7.5.0-4823ff34be-0a64b9b9c7.zip/node_modules/@types/semver/",\ + ["concat-map", [\ + ["npm:0.0.1", {\ + "packageLocation": "./.yarn/cache/concat-map-npm-0.0.1-85a921b7ee-902a9f5d89.zip/node_modules/concat-map/",\ "packageDependencies": [\ - ["@types/semver", "npm:7.5.0"]\ + ["concat-map", "npm:0.0.1"]\ ],\ "linkType": "HARD"\ }]\ ]],\ - ["@types/vscode", [\ - ["npm:1.80.0", {\ - "packageLocation": "./.yarn/cache/@types-vscode-npm-1.80.0-7ea3286e88-442c55fb83.zip/node_modules/@types/vscode/",\ + ["cross-spawn", [\ + ["npm:7.0.3", {\ + "packageLocation": "./.yarn/cache/cross-spawn-npm-7.0.3-e4ff3e65b3-671cc7c728.zip/node_modules/cross-spawn/",\ "packageDependencies": [\ - ["@types/vscode", "npm:1.80.0"]\ + ["cross-spawn", "npm:7.0.3"],\ + ["path-key", "npm:3.1.1"],\ + ["shebang-command", "npm:2.0.0"],\ + ["which", "npm:2.0.2"]\ ],\ "linkType": "HARD"\ }]\ ]],\ - ["@typescript-eslint/eslint-plugin", [\ - ["npm:5.62.0", {\ - "packageLocation": "./.yarn/cache/@typescript-eslint-eslint-plugin-npm-5.62.0-c48b9a5492-fc104b389c.zip/node_modules/@typescript-eslint/eslint-plugin/",\ + ["debug", [\ + ["npm:4.3.4", {\ + "packageLocation": "./.yarn/cache/debug-npm-4.3.4-4513954577-3dbad3f94e.zip/node_modules/debug/",\ "packageDependencies": [\ - ["@typescript-eslint/eslint-plugin", "npm:5.62.0"]\ + ["debug", "npm:4.3.4"]\ ],\ "linkType": "SOFT"\ }],\ - ["virtual:1ca5ffe7bd50eeef98202150e5e82f61f0cd48370e28be026fb583fb2f7a661646940189809f3c41a31e7fa741840d72885f5ba9590a9d578183b22f2ea105b5#npm:5.62.0", {\ - "packageLocation": "./.yarn/__virtual__/@typescript-eslint-eslint-plugin-virtual-8630658562/0/cache/@typescript-eslint-eslint-plugin-npm-5.62.0-c48b9a5492-fc104b389c.zip/node_modules/@typescript-eslint/eslint-plugin/",\ + ["virtual:ced87d94ab05a28b44536eb0cd61a9458e757a0ae7bb35e5ab5d27e03d08b996abd275928b29aad2eb0973d5bb0800e75ba8ca3e26bf62cbe8ea0fae8cca70a8#npm:4.3.4", {\ + "packageLocation": "./.yarn/__virtual__/debug-virtual-023f479948/0/cache/debug-npm-4.3.4-4513954577-3dbad3f94e.zip/node_modules/debug/",\ "packageDependencies": [\ - ["@typescript-eslint/eslint-plugin", "virtual:1ca5ffe7bd50eeef98202150e5e82f61f0cd48370e28be026fb583fb2f7a661646940189809f3c41a31e7fa741840d72885f5ba9590a9d578183b22f2ea105b5#npm:5.62.0"],\ - ["@eslint-community/regexpp", "npm:4.6.2"],\ - ["@types/eslint", null],\ - ["@types/typescript", null],\ - ["@types/typescript-eslint__parser", null],\ - ["@typescript-eslint/parser", "virtual:1ca5ffe7bd50eeef98202150e5e82f61f0cd48370e28be026fb583fb2f7a661646940189809f3c41a31e7fa741840d72885f5ba9590a9d578183b22f2ea105b5#npm:5.62.0"],\ - ["@typescript-eslint/scope-manager", "npm:5.62.0"],\ - ["@typescript-eslint/type-utils", "virtual:86306585622eaa558a7935143680436b12bcb983114f7f1e70b7a6cbe6b1a02edb5147e3f11f9ac3d79c4e3a3a61b09dfa72db122a5134072ca645ab9675155a#npm:5.62.0"],\ - ["@typescript-eslint/utils", "virtual:86306585622eaa558a7935143680436b12bcb983114f7f1e70b7a6cbe6b1a02edb5147e3f11f9ac3d79c4e3a3a61b09dfa72db122a5134072ca645ab9675155a#npm:5.62.0"],\ ["debug", "virtual:ced87d94ab05a28b44536eb0cd61a9458e757a0ae7bb35e5ab5d27e03d08b996abd275928b29aad2eb0973d5bb0800e75ba8ca3e26bf62cbe8ea0fae8cca70a8#npm:4.3.4"],\ - ["eslint", "npm:8.46.0"],\ - ["graphemer", "npm:1.4.0"],\ - ["ignore", "npm:5.2.4"],\ - ["natural-compare-lite", "npm:1.4.0"],\ - ["semver", "npm:7.5.4"],\ - ["tsutils", "virtual:86306585622eaa558a7935143680436b12bcb983114f7f1e70b7a6cbe6b1a02edb5147e3f11f9ac3d79c4e3a3a61b09dfa72db122a5134072ca645ab9675155a#npm:3.21.0"],\ - ["typescript", "patch:typescript@npm%3A5.1.6#~builtin::version=5.1.6&hash=5da071"]\ + ["@types/supports-color", null],\ + ["ms", "npm:2.1.2"],\ + ["supports-color", null]\ ],\ "packagePeers": [\ - "@types/eslint",\ - "@types/typescript-eslint__parser",\ - "@types/typescript",\ - "@typescript-eslint/parser",\ - "eslint",\ - "typescript"\ + "@types/supports-color",\ + "supports-color"\ ],\ "linkType": "HARD"\ }]\ ]],\ - ["@typescript-eslint/parser", [\ - ["npm:5.62.0", {\ - "packageLocation": "./.yarn/cache/@typescript-eslint-parser-npm-5.62.0-c6b29fa302-d168f4c7f2.zip/node_modules/@typescript-eslint/parser/",\ - "packageDependencies": [\ - ["@typescript-eslint/parser", "npm:5.62.0"]\ - ],\ - "linkType": "SOFT"\ - }],\ - ["virtual:1ca5ffe7bd50eeef98202150e5e82f61f0cd48370e28be026fb583fb2f7a661646940189809f3c41a31e7fa741840d72885f5ba9590a9d578183b22f2ea105b5#npm:5.62.0", {\ - "packageLocation": "./.yarn/__virtual__/@typescript-eslint-parser-virtual-fb26eb6233/0/cache/@typescript-eslint-parser-npm-5.62.0-c6b29fa302-d168f4c7f2.zip/node_modules/@typescript-eslint/parser/",\ + ["deep-is", [\ + ["npm:0.1.4", {\ + "packageLocation": "./.yarn/cache/deep-is-npm-0.1.4-88938b5a67-edb65dd0d7.zip/node_modules/deep-is/",\ "packageDependencies": [\ - ["@typescript-eslint/parser", "virtual:1ca5ffe7bd50eeef98202150e5e82f61f0cd48370e28be026fb583fb2f7a661646940189809f3c41a31e7fa741840d72885f5ba9590a9d578183b22f2ea105b5#npm:5.62.0"],\ - ["@types/eslint", null],\ - ["@types/typescript", null],\ - ["@typescript-eslint/scope-manager", "npm:5.62.0"],\ - ["@typescript-eslint/types", "npm:5.62.0"],\ - ["@typescript-eslint/typescript-estree", "virtual:17df369d0d0e174cf30be035f31322493b41a1be6546da15412dcf419d74e1a15b34a24d327edc3b35285e2ccd0cab96b927bd7ca2fb31e7133fa1394149762a#npm:5.62.0"],\ - ["debug", "virtual:ced87d94ab05a28b44536eb0cd61a9458e757a0ae7bb35e5ab5d27e03d08b996abd275928b29aad2eb0973d5bb0800e75ba8ca3e26bf62cbe8ea0fae8cca70a8#npm:4.3.4"],\ - ["eslint", "npm:8.46.0"],\ - ["typescript", "patch:typescript@npm%3A5.1.6#~builtin::version=5.1.6&hash=5da071"]\ - ],\ - "packagePeers": [\ - "@types/eslint",\ - "@types/typescript",\ - "eslint",\ - "typescript"\ + ["deep-is", "npm:0.1.4"]\ ],\ "linkType": "HARD"\ }]\ ]],\ - ["@typescript-eslint/scope-manager", [\ - ["npm:5.62.0", {\ - "packageLocation": "./.yarn/cache/@typescript-eslint-scope-manager-npm-5.62.0-c0013838b0-6062d6b797.zip/node_modules/@typescript-eslint/scope-manager/",\ + ["doctrine", [\ + ["npm:3.0.0", {\ + "packageLocation": "./.yarn/cache/doctrine-npm-3.0.0-c6f1615f04-fd7673ca77.zip/node_modules/doctrine/",\ "packageDependencies": [\ - ["@typescript-eslint/scope-manager", "npm:5.62.0"],\ - ["@typescript-eslint/types", "npm:5.62.0"],\ - ["@typescript-eslint/visitor-keys", "npm:5.62.0"]\ + ["doctrine", "npm:3.0.0"],\ + ["esutils", "npm:2.0.3"]\ ],\ "linkType": "HARD"\ }]\ ]],\ - ["@typescript-eslint/type-utils", [\ - ["npm:5.62.0", {\ - "packageLocation": "./.yarn/cache/@typescript-eslint-type-utils-npm-5.62.0-220216d668-fc41eece5f.zip/node_modules/@typescript-eslint/type-utils/",\ + ["escape-string-regexp", [\ + ["npm:4.0.0", {\ + "packageLocation": "./.yarn/cache/escape-string-regexp-npm-4.0.0-4b531d8d59-98b48897d9.zip/node_modules/escape-string-regexp/",\ "packageDependencies": [\ - ["@typescript-eslint/type-utils", "npm:5.62.0"]\ + ["escape-string-regexp", "npm:4.0.0"]\ ],\ - "linkType": "SOFT"\ - }],\ - ["virtual:86306585622eaa558a7935143680436b12bcb983114f7f1e70b7a6cbe6b1a02edb5147e3f11f9ac3d79c4e3a3a61b09dfa72db122a5134072ca645ab9675155a#npm:5.62.0", {\ - "packageLocation": "./.yarn/__virtual__/@typescript-eslint-type-utils-virtual-17df369d0d/0/cache/@typescript-eslint-type-utils-npm-5.62.0-220216d668-fc41eece5f.zip/node_modules/@typescript-eslint/type-utils/",\ + "linkType": "HARD"\ + }]\ + ]],\ + ["eslint", [\ + ["npm:8.46.0", {\ + "packageLocation": "./.yarn/cache/eslint-npm-8.46.0-dc7af99e61-7a7d36b1a3.zip/node_modules/eslint/",\ "packageDependencies": [\ - ["@typescript-eslint/type-utils", "virtual:86306585622eaa558a7935143680436b12bcb983114f7f1e70b7a6cbe6b1a02edb5147e3f11f9ac3d79c4e3a3a61b09dfa72db122a5134072ca645ab9675155a#npm:5.62.0"],\ - ["@types/eslint", null],\ - ["@types/typescript", null],\ - ["@typescript-eslint/typescript-estree", "virtual:17df369d0d0e174cf30be035f31322493b41a1be6546da15412dcf419d74e1a15b34a24d327edc3b35285e2ccd0cab96b927bd7ca2fb31e7133fa1394149762a#npm:5.62.0"],\ - ["@typescript-eslint/utils", "virtual:86306585622eaa558a7935143680436b12bcb983114f7f1e70b7a6cbe6b1a02edb5147e3f11f9ac3d79c4e3a3a61b09dfa72db122a5134072ca645ab9675155a#npm:5.62.0"],\ - ["debug", "virtual:ced87d94ab05a28b44536eb0cd61a9458e757a0ae7bb35e5ab5d27e03d08b996abd275928b29aad2eb0973d5bb0800e75ba8ca3e26bf62cbe8ea0fae8cca70a8#npm:4.3.4"],\ ["eslint", "npm:8.46.0"],\ - ["tsutils", "virtual:86306585622eaa558a7935143680436b12bcb983114f7f1e70b7a6cbe6b1a02edb5147e3f11f9ac3d79c4e3a3a61b09dfa72db122a5134072ca645ab9675155a#npm:3.21.0"],\ - ["typescript", "patch:typescript@npm%3A5.1.6#~builtin::version=5.1.6&hash=5da071"]\ - ],\ - "packagePeers": [\ - "@types/eslint",\ - "@types/typescript",\ - "eslint",\ - "typescript"\ + ["@eslint-community/eslint-utils", "virtual:dc7af99e618232ac0e2a751f560e2225037bf809144a4cc05369d5312b9d24061282984c0c0c6c5c199f3a0663f91f11c21afb60016655f472fa253e0b676e3b#npm:4.4.0"],\ + ["@eslint-community/regexpp", "npm:4.6.2"],\ + ["@eslint/eslintrc", "npm:2.1.1"],\ + ["@eslint/js", "npm:8.46.0"],\ + ["@humanwhocodes/config-array", "npm:0.11.10"],\ + ["@humanwhocodes/module-importer", "npm:1.0.1"],\ + ["@nodelib/fs.walk", "npm:1.2.8"],\ + ["ajv", "npm:6.12.6"],\ + ["chalk", "npm:4.1.2"],\ + ["cross-spawn", "npm:7.0.3"],\ + ["debug", "virtual:ced87d94ab05a28b44536eb0cd61a9458e757a0ae7bb35e5ab5d27e03d08b996abd275928b29aad2eb0973d5bb0800e75ba8ca3e26bf62cbe8ea0fae8cca70a8#npm:4.3.4"],\ + ["doctrine", "npm:3.0.0"],\ + ["escape-string-regexp", "npm:4.0.0"],\ + ["eslint-scope", "npm:7.2.2"],\ + ["eslint-visitor-keys", "npm:3.4.2"],\ + ["espree", "npm:9.6.1"],\ + ["esquery", "npm:1.5.0"],\ + ["esutils", "npm:2.0.3"],\ + ["fast-deep-equal", "npm:3.1.3"],\ + ["file-entry-cache", "npm:6.0.1"],\ + ["find-up", "npm:5.0.0"],\ + ["glob-parent", "npm:6.0.2"],\ + ["globals", "npm:13.20.0"],\ + ["graphemer", "npm:1.4.0"],\ + ["ignore", "npm:5.2.4"],\ + ["imurmurhash", "npm:0.1.4"],\ + ["is-glob", "npm:4.0.3"],\ + ["is-path-inside", "npm:3.0.3"],\ + ["js-yaml", "npm:4.1.0"],\ + ["json-stable-stringify-without-jsonify", "npm:1.0.1"],\ + ["levn", "npm:0.4.1"],\ + ["lodash.merge", "npm:4.6.2"],\ + ["minimatch", "npm:3.1.2"],\ + ["natural-compare", "npm:1.4.0"],\ + ["optionator", "npm:0.9.3"],\ + ["strip-ansi", "npm:6.0.1"],\ + ["text-table", "npm:0.2.0"]\ ],\ "linkType": "HARD"\ }]\ ]],\ - ["@typescript-eslint/types", [\ - ["npm:5.62.0", {\ - "packageLocation": "./.yarn/cache/@typescript-eslint-types-npm-5.62.0-5c2e0aab15-48c8711738.zip/node_modules/@typescript-eslint/types/",\ + ["eslint-scope", [\ + ["npm:7.2.2", {\ + "packageLocation": "./.yarn/cache/eslint-scope-npm-7.2.2-53cb0df8e8-ec97dbf5fb.zip/node_modules/eslint-scope/",\ "packageDependencies": [\ - ["@typescript-eslint/types", "npm:5.62.0"]\ + ["eslint-scope", "npm:7.2.2"],\ + ["esrecurse", "npm:4.3.0"],\ + ["estraverse", "npm:5.3.0"]\ ],\ "linkType": "HARD"\ }]\ ]],\ - ["@typescript-eslint/typescript-estree", [\ - ["npm:5.62.0", {\ - "packageLocation": "./.yarn/cache/@typescript-eslint-typescript-estree-npm-5.62.0-5d1ea132a9-3624520abb.zip/node_modules/@typescript-eslint/typescript-estree/",\ - "packageDependencies": [\ - ["@typescript-eslint/typescript-estree", "npm:5.62.0"]\ - ],\ - "linkType": "SOFT"\ - }],\ - ["virtual:17df369d0d0e174cf30be035f31322493b41a1be6546da15412dcf419d74e1a15b34a24d327edc3b35285e2ccd0cab96b927bd7ca2fb31e7133fa1394149762a#npm:5.62.0", {\ - "packageLocation": "./.yarn/__virtual__/@typescript-eslint-typescript-estree-virtual-8d2baa383a/0/cache/@typescript-eslint-typescript-estree-npm-5.62.0-5d1ea132a9-3624520abb.zip/node_modules/@typescript-eslint/typescript-estree/",\ - "packageDependencies": [\ - ["@typescript-eslint/typescript-estree", "virtual:17df369d0d0e174cf30be035f31322493b41a1be6546da15412dcf419d74e1a15b34a24d327edc3b35285e2ccd0cab96b927bd7ca2fb31e7133fa1394149762a#npm:5.62.0"],\ - ["@types/typescript", null],\ - ["@typescript-eslint/types", "npm:5.62.0"],\ - ["@typescript-eslint/visitor-keys", "npm:5.62.0"],\ - ["debug", "virtual:ced87d94ab05a28b44536eb0cd61a9458e757a0ae7bb35e5ab5d27e03d08b996abd275928b29aad2eb0973d5bb0800e75ba8ca3e26bf62cbe8ea0fae8cca70a8#npm:4.3.4"],\ - ["globby", "npm:11.1.0"],\ - ["is-glob", "npm:4.0.3"],\ - ["semver", "npm:7.5.4"],\ - ["tsutils", "virtual:86306585622eaa558a7935143680436b12bcb983114f7f1e70b7a6cbe6b1a02edb5147e3f11f9ac3d79c4e3a3a61b09dfa72db122a5134072ca645ab9675155a#npm:3.21.0"],\ - ["typescript", "patch:typescript@npm%3A5.1.6#~builtin::version=5.1.6&hash=5da071"]\ - ],\ - "packagePeers": [\ - "@types/typescript",\ - "typescript"\ - ],\ - "linkType": "HARD"\ - }],\ - ["virtual:6c3dc272fb1f6e044fb882656f5c5c0ef77a1d45882c304a91fa314d91966940b96c071a5d83f3d2c5ba1ebf5a605e30473b1b2a025010e0d04d7bd29b7eda15#npm:5.62.0", {\ - "packageLocation": "./.yarn/__virtual__/@typescript-eslint-typescript-estree-virtual-e1b3efbf2a/0/cache/@typescript-eslint-typescript-estree-npm-5.62.0-5d1ea132a9-3624520abb.zip/node_modules/@typescript-eslint/typescript-estree/",\ - "packageDependencies": [\ - ["@typescript-eslint/typescript-estree", "virtual:6c3dc272fb1f6e044fb882656f5c5c0ef77a1d45882c304a91fa314d91966940b96c071a5d83f3d2c5ba1ebf5a605e30473b1b2a025010e0d04d7bd29b7eda15#npm:5.62.0"],\ - ["@types/typescript", null],\ - ["@typescript-eslint/types", "npm:5.62.0"],\ - ["@typescript-eslint/visitor-keys", "npm:5.62.0"],\ - ["debug", "virtual:ced87d94ab05a28b44536eb0cd61a9458e757a0ae7bb35e5ab5d27e03d08b996abd275928b29aad2eb0973d5bb0800e75ba8ca3e26bf62cbe8ea0fae8cca70a8#npm:4.3.4"],\ - ["globby", "npm:11.1.0"],\ - ["is-glob", "npm:4.0.3"],\ - ["semver", "npm:7.5.4"],\ - ["tsutils", "virtual:e1b3efbf2a363ce342c579e38d131acc33dc687f2696b030f8279ed649898433c42f766540f5e6287f9f5bcbc5a841d763d4d4c167d089350eb01afdc8aadfdd#npm:3.21.0"],\ - ["typescript", null]\ - ],\ - "packagePeers": [\ - "@types/typescript",\ - "typescript"\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["@typescript-eslint/utils", [\ - ["npm:5.62.0", {\ - "packageLocation": "./.yarn/cache/@typescript-eslint-utils-npm-5.62.0-907f2d579e-ee9398c8c5.zip/node_modules/@typescript-eslint/utils/",\ - "packageDependencies": [\ - ["@typescript-eslint/utils", "npm:5.62.0"]\ - ],\ - "linkType": "SOFT"\ - }],\ - ["virtual:86306585622eaa558a7935143680436b12bcb983114f7f1e70b7a6cbe6b1a02edb5147e3f11f9ac3d79c4e3a3a61b09dfa72db122a5134072ca645ab9675155a#npm:5.62.0", {\ - "packageLocation": "./.yarn/__virtual__/@typescript-eslint-utils-virtual-6c3dc272fb/0/cache/@typescript-eslint-utils-npm-5.62.0-907f2d579e-ee9398c8c5.zip/node_modules/@typescript-eslint/utils/",\ - "packageDependencies": [\ - ["@typescript-eslint/utils", "virtual:86306585622eaa558a7935143680436b12bcb983114f7f1e70b7a6cbe6b1a02edb5147e3f11f9ac3d79c4e3a3a61b09dfa72db122a5134072ca645ab9675155a#npm:5.62.0"],\ - ["@eslint-community/eslint-utils", "virtual:dc7af99e618232ac0e2a751f560e2225037bf809144a4cc05369d5312b9d24061282984c0c0c6c5c199f3a0663f91f11c21afb60016655f472fa253e0b676e3b#npm:4.4.0"],\ - ["@types/eslint", null],\ - ["@types/json-schema", "npm:7.0.12"],\ - ["@types/semver", "npm:7.5.0"],\ - ["@typescript-eslint/scope-manager", "npm:5.62.0"],\ - ["@typescript-eslint/types", "npm:5.62.0"],\ - ["@typescript-eslint/typescript-estree", "virtual:6c3dc272fb1f6e044fb882656f5c5c0ef77a1d45882c304a91fa314d91966940b96c071a5d83f3d2c5ba1ebf5a605e30473b1b2a025010e0d04d7bd29b7eda15#npm:5.62.0"],\ - ["eslint", "npm:8.46.0"],\ - ["eslint-scope", "npm:5.1.1"],\ - ["semver", "npm:7.5.4"]\ - ],\ - "packagePeers": [\ - "@types/eslint",\ - "eslint"\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["@typescript-eslint/visitor-keys", [\ - ["npm:5.62.0", {\ - "packageLocation": "./.yarn/cache/@typescript-eslint-visitor-keys-npm-5.62.0-da1af55f83-976b05d103.zip/node_modules/@typescript-eslint/visitor-keys/",\ - "packageDependencies": [\ - ["@typescript-eslint/visitor-keys", "npm:5.62.0"],\ - ["@typescript-eslint/types", "npm:5.62.0"],\ - ["eslint-visitor-keys", "npm:3.4.2"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["@vscode/test-electron", [\ - ["npm:2.3.3", {\ - "packageLocation": "./.yarn/cache/@vscode-test-electron-npm-2.3.3-7f38fc555a-ecb5a52e7a.zip/node_modules/@vscode/test-electron/",\ - "packageDependencies": [\ - ["@vscode/test-electron", "npm:2.3.3"],\ - ["http-proxy-agent", "npm:4.0.1"],\ - ["https-proxy-agent", "npm:5.0.1"],\ - ["jszip", "npm:3.10.1"],\ - ["semver", "npm:7.5.4"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["@webassemblyjs/ast", [\ - ["npm:1.11.6", {\ - "packageLocation": "./.yarn/cache/@webassemblyjs-ast-npm-1.11.6-d3fd2bb49a-38ef1b526c.zip/node_modules/@webassemblyjs/ast/",\ - "packageDependencies": [\ - ["@webassemblyjs/ast", "npm:1.11.6"],\ - ["@webassemblyjs/helper-numbers", "npm:1.11.6"],\ - ["@webassemblyjs/helper-wasm-bytecode", "npm:1.11.6"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["@webassemblyjs/floating-point-hex-parser", [\ - ["npm:1.11.6", {\ - "packageLocation": "./.yarn/cache/@webassemblyjs-floating-point-hex-parser-npm-1.11.6-3a9928fc76-29b0875884.zip/node_modules/@webassemblyjs/floating-point-hex-parser/",\ - "packageDependencies": [\ - ["@webassemblyjs/floating-point-hex-parser", "npm:1.11.6"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["@webassemblyjs/helper-api-error", [\ - ["npm:1.11.6", {\ - "packageLocation": "./.yarn/cache/@webassemblyjs-helper-api-error-npm-1.11.6-75f6275ff4-e8563df851.zip/node_modules/@webassemblyjs/helper-api-error/",\ - "packageDependencies": [\ - ["@webassemblyjs/helper-api-error", "npm:1.11.6"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["@webassemblyjs/helper-buffer", [\ - ["npm:1.11.6", {\ - "packageLocation": "./.yarn/cache/@webassemblyjs-helper-buffer-npm-1.11.6-69996544b0-b14d0573bf.zip/node_modules/@webassemblyjs/helper-buffer/",\ - "packageDependencies": [\ - ["@webassemblyjs/helper-buffer", "npm:1.11.6"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["@webassemblyjs/helper-numbers", [\ - ["npm:1.11.6", {\ - "packageLocation": "./.yarn/cache/@webassemblyjs-helper-numbers-npm-1.11.6-819ddab1da-f4b562fa21.zip/node_modules/@webassemblyjs/helper-numbers/",\ - "packageDependencies": [\ - ["@webassemblyjs/helper-numbers", "npm:1.11.6"],\ - ["@webassemblyjs/floating-point-hex-parser", "npm:1.11.6"],\ - ["@webassemblyjs/helper-api-error", "npm:1.11.6"],\ - ["@xtuc/long", "npm:4.2.2"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["@webassemblyjs/helper-wasm-bytecode", [\ - ["npm:1.11.6", {\ - "packageLocation": "./.yarn/cache/@webassemblyjs-helper-wasm-bytecode-npm-1.11.6-3bc23747de-3535ef4f1f.zip/node_modules/@webassemblyjs/helper-wasm-bytecode/",\ - "packageDependencies": [\ - ["@webassemblyjs/helper-wasm-bytecode", "npm:1.11.6"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["@webassemblyjs/helper-wasm-section", [\ - ["npm:1.11.6", {\ - "packageLocation": "./.yarn/cache/@webassemblyjs-helper-wasm-section-npm-1.11.6-344f8ff2af-b2cf751bf4.zip/node_modules/@webassemblyjs/helper-wasm-section/",\ - "packageDependencies": [\ - ["@webassemblyjs/helper-wasm-section", "npm:1.11.6"],\ - ["@webassemblyjs/ast", "npm:1.11.6"],\ - ["@webassemblyjs/helper-buffer", "npm:1.11.6"],\ - ["@webassemblyjs/helper-wasm-bytecode", "npm:1.11.6"],\ - ["@webassemblyjs/wasm-gen", "npm:1.11.6"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["@webassemblyjs/ieee754", [\ - ["npm:1.11.6", {\ - "packageLocation": "./.yarn/cache/@webassemblyjs-ieee754-npm-1.11.6-95c92f446a-13574b8e41.zip/node_modules/@webassemblyjs/ieee754/",\ - "packageDependencies": [\ - ["@webassemblyjs/ieee754", "npm:1.11.6"],\ - ["@xtuc/ieee754", "npm:1.2.0"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["@webassemblyjs/leb128", [\ - ["npm:1.11.6", {\ - "packageLocation": "./.yarn/cache/@webassemblyjs-leb128-npm-1.11.6-697d62da2e-7ea942dc97.zip/node_modules/@webassemblyjs/leb128/",\ - "packageDependencies": [\ - ["@webassemblyjs/leb128", "npm:1.11.6"],\ - ["@xtuc/long", "npm:4.2.2"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["@webassemblyjs/utf8", [\ - ["npm:1.11.6", {\ - "packageLocation": "./.yarn/cache/@webassemblyjs-utf8-npm-1.11.6-102c4e5d68-807fe5b5ce.zip/node_modules/@webassemblyjs/utf8/",\ - "packageDependencies": [\ - ["@webassemblyjs/utf8", "npm:1.11.6"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["@webassemblyjs/wasm-edit", [\ - ["npm:1.11.6", {\ - "packageLocation": "./.yarn/cache/@webassemblyjs-wasm-edit-npm-1.11.6-8d2703f828-29ce758704.zip/node_modules/@webassemblyjs/wasm-edit/",\ - "packageDependencies": [\ - ["@webassemblyjs/wasm-edit", "npm:1.11.6"],\ - ["@webassemblyjs/ast", "npm:1.11.6"],\ - ["@webassemblyjs/helper-buffer", "npm:1.11.6"],\ - ["@webassemblyjs/helper-wasm-bytecode", "npm:1.11.6"],\ - ["@webassemblyjs/helper-wasm-section", "npm:1.11.6"],\ - ["@webassemblyjs/wasm-gen", "npm:1.11.6"],\ - ["@webassemblyjs/wasm-opt", "npm:1.11.6"],\ - ["@webassemblyjs/wasm-parser", "npm:1.11.6"],\ - ["@webassemblyjs/wast-printer", "npm:1.11.6"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["@webassemblyjs/wasm-gen", [\ - ["npm:1.11.6", {\ - "packageLocation": "./.yarn/cache/@webassemblyjs-wasm-gen-npm-1.11.6-0ca036cab0-a645a2eecb.zip/node_modules/@webassemblyjs/wasm-gen/",\ - "packageDependencies": [\ - ["@webassemblyjs/wasm-gen", "npm:1.11.6"],\ - ["@webassemblyjs/ast", "npm:1.11.6"],\ - ["@webassemblyjs/helper-wasm-bytecode", "npm:1.11.6"],\ - ["@webassemblyjs/ieee754", "npm:1.11.6"],\ - ["@webassemblyjs/leb128", "npm:1.11.6"],\ - ["@webassemblyjs/utf8", "npm:1.11.6"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["@webassemblyjs/wasm-opt", [\ - ["npm:1.11.6", {\ - "packageLocation": "./.yarn/cache/@webassemblyjs-wasm-opt-npm-1.11.6-8be3443975-b4557f1954.zip/node_modules/@webassemblyjs/wasm-opt/",\ - "packageDependencies": [\ - ["@webassemblyjs/wasm-opt", "npm:1.11.6"],\ - ["@webassemblyjs/ast", "npm:1.11.6"],\ - ["@webassemblyjs/helper-buffer", "npm:1.11.6"],\ - ["@webassemblyjs/wasm-gen", "npm:1.11.6"],\ - ["@webassemblyjs/wasm-parser", "npm:1.11.6"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["@webassemblyjs/wasm-parser", [\ - ["npm:1.11.6", {\ - "packageLocation": "./.yarn/cache/@webassemblyjs-wasm-parser-npm-1.11.6-88e2433c21-8200a8d77c.zip/node_modules/@webassemblyjs/wasm-parser/",\ - "packageDependencies": [\ - ["@webassemblyjs/wasm-parser", "npm:1.11.6"],\ - ["@webassemblyjs/ast", "npm:1.11.6"],\ - ["@webassemblyjs/helper-api-error", "npm:1.11.6"],\ - ["@webassemblyjs/helper-wasm-bytecode", "npm:1.11.6"],\ - ["@webassemblyjs/ieee754", "npm:1.11.6"],\ - ["@webassemblyjs/leb128", "npm:1.11.6"],\ - ["@webassemblyjs/utf8", "npm:1.11.6"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["@webassemblyjs/wast-printer", [\ - ["npm:1.11.6", {\ - "packageLocation": "./.yarn/cache/@webassemblyjs-wast-printer-npm-1.11.6-3191861e3f-d2fa6a4c42.zip/node_modules/@webassemblyjs/wast-printer/",\ - "packageDependencies": [\ - ["@webassemblyjs/wast-printer", "npm:1.11.6"],\ - ["@webassemblyjs/ast", "npm:1.11.6"],\ - ["@xtuc/long", "npm:4.2.2"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["@webpack-cli/configtest", [\ - ["npm:2.1.1", {\ - "packageLocation": "./.yarn/cache/@webpack-cli-configtest-npm-2.1.1-2aa637b6bc-9f9f9145c2.zip/node_modules/@webpack-cli/configtest/",\ - "packageDependencies": [\ - ["@webpack-cli/configtest", "npm:2.1.1"]\ - ],\ - "linkType": "SOFT"\ - }],\ - ["virtual:e797243e4a0090f0f0b78c3ae107e9934ef77ae19f7a9263059d446ab98f3c6c587cd4057de32bf6173e21c30f45852b89da5a717a575720c8bfb5f721456d5f#npm:2.1.1", {\ - "packageLocation": "./.yarn/__virtual__/@webpack-cli-configtest-virtual-bb231b5c47/0/cache/@webpack-cli-configtest-npm-2.1.1-2aa637b6bc-9f9f9145c2.zip/node_modules/@webpack-cli/configtest/",\ - "packageDependencies": [\ - ["@webpack-cli/configtest", "virtual:e797243e4a0090f0f0b78c3ae107e9934ef77ae19f7a9263059d446ab98f3c6c587cd4057de32bf6173e21c30f45852b89da5a717a575720c8bfb5f721456d5f#npm:2.1.1"],\ - ["@types/webpack", null],\ - ["@types/webpack-cli", null],\ - ["webpack", "virtual:1ca5ffe7bd50eeef98202150e5e82f61f0cd48370e28be026fb583fb2f7a661646940189809f3c41a31e7fa741840d72885f5ba9590a9d578183b22f2ea105b5#npm:5.88.2"],\ - ["webpack-cli", "virtual:1ca5ffe7bd50eeef98202150e5e82f61f0cd48370e28be026fb583fb2f7a661646940189809f3c41a31e7fa741840d72885f5ba9590a9d578183b22f2ea105b5#npm:5.1.4"]\ - ],\ - "packagePeers": [\ - "@types/webpack-cli",\ - "@types/webpack",\ - "webpack-cli",\ - "webpack"\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["@webpack-cli/info", [\ - ["npm:2.0.2", {\ - "packageLocation": "./.yarn/cache/@webpack-cli-info-npm-2.0.2-494be2e91a-8f9a178afc.zip/node_modules/@webpack-cli/info/",\ - "packageDependencies": [\ - ["@webpack-cli/info", "npm:2.0.2"]\ - ],\ - "linkType": "SOFT"\ - }],\ - ["virtual:e797243e4a0090f0f0b78c3ae107e9934ef77ae19f7a9263059d446ab98f3c6c587cd4057de32bf6173e21c30f45852b89da5a717a575720c8bfb5f721456d5f#npm:2.0.2", {\ - "packageLocation": "./.yarn/__virtual__/@webpack-cli-info-virtual-06fb8b4810/0/cache/@webpack-cli-info-npm-2.0.2-494be2e91a-8f9a178afc.zip/node_modules/@webpack-cli/info/",\ - "packageDependencies": [\ - ["@webpack-cli/info", "virtual:e797243e4a0090f0f0b78c3ae107e9934ef77ae19f7a9263059d446ab98f3c6c587cd4057de32bf6173e21c30f45852b89da5a717a575720c8bfb5f721456d5f#npm:2.0.2"],\ - ["@types/webpack", null],\ - ["@types/webpack-cli", null],\ - ["webpack", "virtual:1ca5ffe7bd50eeef98202150e5e82f61f0cd48370e28be026fb583fb2f7a661646940189809f3c41a31e7fa741840d72885f5ba9590a9d578183b22f2ea105b5#npm:5.88.2"],\ - ["webpack-cli", "virtual:1ca5ffe7bd50eeef98202150e5e82f61f0cd48370e28be026fb583fb2f7a661646940189809f3c41a31e7fa741840d72885f5ba9590a9d578183b22f2ea105b5#npm:5.1.4"]\ - ],\ - "packagePeers": [\ - "@types/webpack-cli",\ - "@types/webpack",\ - "webpack-cli",\ - "webpack"\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["@webpack-cli/serve", [\ - ["npm:2.0.5", {\ - "packageLocation": "./.yarn/cache/@webpack-cli-serve-npm-2.0.5-5a220c2601-75f0e54681.zip/node_modules/@webpack-cli/serve/",\ - "packageDependencies": [\ - ["@webpack-cli/serve", "npm:2.0.5"]\ - ],\ - "linkType": "SOFT"\ - }],\ - ["virtual:e797243e4a0090f0f0b78c3ae107e9934ef77ae19f7a9263059d446ab98f3c6c587cd4057de32bf6173e21c30f45852b89da5a717a575720c8bfb5f721456d5f#npm:2.0.5", {\ - "packageLocation": "./.yarn/__virtual__/@webpack-cli-serve-virtual-72260b947d/0/cache/@webpack-cli-serve-npm-2.0.5-5a220c2601-75f0e54681.zip/node_modules/@webpack-cli/serve/",\ - "packageDependencies": [\ - ["@webpack-cli/serve", "virtual:e797243e4a0090f0f0b78c3ae107e9934ef77ae19f7a9263059d446ab98f3c6c587cd4057de32bf6173e21c30f45852b89da5a717a575720c8bfb5f721456d5f#npm:2.0.5"],\ - ["@types/webpack", null],\ - ["@types/webpack-cli", null],\ - ["@types/webpack-dev-server", null],\ - ["webpack", "virtual:1ca5ffe7bd50eeef98202150e5e82f61f0cd48370e28be026fb583fb2f7a661646940189809f3c41a31e7fa741840d72885f5ba9590a9d578183b22f2ea105b5#npm:5.88.2"],\ - ["webpack-cli", "virtual:1ca5ffe7bd50eeef98202150e5e82f61f0cd48370e28be026fb583fb2f7a661646940189809f3c41a31e7fa741840d72885f5ba9590a9d578183b22f2ea105b5#npm:5.1.4"],\ - ["webpack-dev-server", null]\ - ],\ - "packagePeers": [\ - "@types/webpack-cli",\ - "@types/webpack-dev-server",\ - "@types/webpack",\ - "webpack-cli",\ - "webpack-dev-server",\ - "webpack"\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["@xtuc/ieee754", [\ - ["npm:1.2.0", {\ - "packageLocation": "./.yarn/cache/@xtuc-ieee754-npm-1.2.0-ec0ce4e025-ac56d4ca6e.zip/node_modules/@xtuc/ieee754/",\ - "packageDependencies": [\ - ["@xtuc/ieee754", "npm:1.2.0"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["@xtuc/long", [\ - ["npm:4.2.2", {\ - "packageLocation": "./.yarn/cache/@xtuc-long-npm-4.2.2-37236e6d72-8ed0d477ce.zip/node_modules/@xtuc/long/",\ - "packageDependencies": [\ - ["@xtuc/long", "npm:4.2.2"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["abbrev", [\ - ["npm:1.1.1", {\ - "packageLocation": "./.yarn/cache/abbrev-npm-1.1.1-3659247eab-a4a97ec07d.zip/node_modules/abbrev/",\ - "packageDependencies": [\ - ["abbrev", "npm:1.1.1"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["acorn", [\ - ["npm:8.10.0", {\ - "packageLocation": "./.yarn/cache/acorn-npm-8.10.0-2230c9e83e-538ba38af0.zip/node_modules/acorn/",\ - "packageDependencies": [\ - ["acorn", "npm:8.10.0"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["acorn-import-assertions", [\ - ["npm:1.9.0", {\ - "packageLocation": "./.yarn/cache/acorn-import-assertions-npm-1.9.0-22f56507c7-944fb2659d.zip/node_modules/acorn-import-assertions/",\ - "packageDependencies": [\ - ["acorn-import-assertions", "npm:1.9.0"]\ - ],\ - "linkType": "SOFT"\ - }],\ - ["virtual:b6bfc672b303c71b5d5814a280178845b040765d1c845e72583b43793cc2d012f6a05337605eb54a3df63863a6a2c58aa0756b0dbc78097799d81600669a675a#npm:1.9.0", {\ - "packageLocation": "./.yarn/__virtual__/acorn-import-assertions-virtual-2c0cf1ed11/0/cache/acorn-import-assertions-npm-1.9.0-22f56507c7-944fb2659d.zip/node_modules/acorn-import-assertions/",\ - "packageDependencies": [\ - ["acorn-import-assertions", "virtual:b6bfc672b303c71b5d5814a280178845b040765d1c845e72583b43793cc2d012f6a05337605eb54a3df63863a6a2c58aa0756b0dbc78097799d81600669a675a#npm:1.9.0"],\ - ["@types/acorn", null],\ - ["acorn", "npm:8.10.0"]\ - ],\ - "packagePeers": [\ - "@types/acorn",\ - "acorn"\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["acorn-jsx", [\ - ["npm:5.3.2", {\ - "packageLocation": "./.yarn/cache/acorn-jsx-npm-5.3.2-d7594599ea-c3d3b2a89c.zip/node_modules/acorn-jsx/",\ - "packageDependencies": [\ - ["acorn-jsx", "npm:5.3.2"]\ - ],\ - "linkType": "SOFT"\ - }],\ - ["virtual:a50722a5a9326b6a5f12350c494c4db3aa0f4caeac45e3e9e5fe071da20014ecfe738fe2ebe2c9c98abae81a4ea86b42f56d776b3bd5ec37f9ad3670c242b242#npm:5.3.2", {\ - "packageLocation": "./.yarn/__virtual__/acorn-jsx-virtual-834321b202/0/cache/acorn-jsx-npm-5.3.2-d7594599ea-c3d3b2a89c.zip/node_modules/acorn-jsx/",\ - "packageDependencies": [\ - ["acorn-jsx", "virtual:a50722a5a9326b6a5f12350c494c4db3aa0f4caeac45e3e9e5fe071da20014ecfe738fe2ebe2c9c98abae81a4ea86b42f56d776b3bd5ec37f9ad3670c242b242#npm:5.3.2"],\ - ["@types/acorn", null],\ - ["acorn", "npm:8.10.0"]\ - ],\ - "packagePeers": [\ - "@types/acorn",\ - "acorn"\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["agent-base", [\ - ["npm:6.0.2", {\ - "packageLocation": "./.yarn/cache/agent-base-npm-6.0.2-428f325a93-f52b6872cc.zip/node_modules/agent-base/",\ - "packageDependencies": [\ - ["agent-base", "npm:6.0.2"],\ - ["debug", "virtual:ced87d94ab05a28b44536eb0cd61a9458e757a0ae7bb35e5ab5d27e03d08b996abd275928b29aad2eb0973d5bb0800e75ba8ca3e26bf62cbe8ea0fae8cca70a8#npm:4.3.4"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["agentkeepalive", [\ - ["npm:4.3.0", {\ - "packageLocation": "./.yarn/cache/agentkeepalive-npm-4.3.0-ac3d8e6807-982453aa44.zip/node_modules/agentkeepalive/",\ - "packageDependencies": [\ - ["agentkeepalive", "npm:4.3.0"],\ - ["debug", "virtual:ced87d94ab05a28b44536eb0cd61a9458e757a0ae7bb35e5ab5d27e03d08b996abd275928b29aad2eb0973d5bb0800e75ba8ca3e26bf62cbe8ea0fae8cca70a8#npm:4.3.4"],\ - ["depd", "npm:2.0.0"],\ - ["humanize-ms", "npm:1.2.1"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["aggregate-error", [\ - ["npm:3.1.0", {\ - "packageLocation": "./.yarn/cache/aggregate-error-npm-3.1.0-415a406f4e-1101a33f21.zip/node_modules/aggregate-error/",\ - "packageDependencies": [\ - ["aggregate-error", "npm:3.1.0"],\ - ["clean-stack", "npm:2.2.0"],\ - ["indent-string", "npm:4.0.0"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["ajv", [\ - ["npm:6.12.6", {\ - "packageLocation": "./.yarn/cache/ajv-npm-6.12.6-4b5105e2b2-874972efe5.zip/node_modules/ajv/",\ - "packageDependencies": [\ - ["ajv", "npm:6.12.6"],\ - ["fast-deep-equal", "npm:3.1.3"],\ - ["fast-json-stable-stringify", "npm:2.1.0"],\ - ["json-schema-traverse", "npm:0.4.1"],\ - ["uri-js", "npm:4.4.1"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["ajv-keywords", [\ - ["npm:3.5.2", {\ - "packageLocation": "./.yarn/cache/ajv-keywords-npm-3.5.2-0e391b70e2-7dc5e59316.zip/node_modules/ajv-keywords/",\ - "packageDependencies": [\ - ["ajv-keywords", "npm:3.5.2"]\ - ],\ - "linkType": "SOFT"\ - }],\ - ["virtual:f2b36937f163b579815d3163513b3330d7a31aaf0599eea66346382b8838395c613f4204e9809cc2ff6bba09c17ab0c34b37deadcb147de7e2f5e535d6ccc245#npm:3.5.2", {\ - "packageLocation": "./.yarn/__virtual__/ajv-keywords-virtual-80fc73abbe/0/cache/ajv-keywords-npm-3.5.2-0e391b70e2-7dc5e59316.zip/node_modules/ajv-keywords/",\ - "packageDependencies": [\ - ["ajv-keywords", "virtual:f2b36937f163b579815d3163513b3330d7a31aaf0599eea66346382b8838395c613f4204e9809cc2ff6bba09c17ab0c34b37deadcb147de7e2f5e535d6ccc245#npm:3.5.2"],\ - ["@types/ajv", null],\ - ["ajv", "npm:6.12.6"]\ - ],\ - "packagePeers": [\ - "@types/ajv",\ - "ajv"\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["ansi-colors", [\ - ["npm:4.1.1", {\ - "packageLocation": "./.yarn/cache/ansi-colors-npm-4.1.1-97ad42f223-138d04a510.zip/node_modules/ansi-colors/",\ - "packageDependencies": [\ - ["ansi-colors", "npm:4.1.1"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["ansi-regex", [\ - ["npm:5.0.1", {\ - "packageLocation": "./.yarn/cache/ansi-regex-npm-5.0.1-c963a48615-2aa4bb54ca.zip/node_modules/ansi-regex/",\ - "packageDependencies": [\ - ["ansi-regex", "npm:5.0.1"]\ - ],\ - "linkType": "HARD"\ - }],\ - ["npm:6.0.1", {\ - "packageLocation": "./.yarn/cache/ansi-regex-npm-6.0.1-8d663a607d-1ff8b7667c.zip/node_modules/ansi-regex/",\ - "packageDependencies": [\ - ["ansi-regex", "npm:6.0.1"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["ansi-styles", [\ - ["npm:4.3.0", {\ - "packageLocation": "./.yarn/cache/ansi-styles-npm-4.3.0-245c7d42c7-513b44c3b2.zip/node_modules/ansi-styles/",\ - "packageDependencies": [\ - ["ansi-styles", "npm:4.3.0"],\ - ["color-convert", "npm:2.0.1"]\ - ],\ - "linkType": "HARD"\ - }],\ - ["npm:6.2.1", {\ - "packageLocation": "./.yarn/cache/ansi-styles-npm-6.2.1-d43647018c-ef940f2f0c.zip/node_modules/ansi-styles/",\ - "packageDependencies": [\ - ["ansi-styles", "npm:6.2.1"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["anymatch", [\ - ["npm:3.1.3", {\ - "packageLocation": "./.yarn/cache/anymatch-npm-3.1.3-bc81d103b1-3e044fd6d1.zip/node_modules/anymatch/",\ - "packageDependencies": [\ - ["anymatch", "npm:3.1.3"],\ - ["normalize-path", "npm:3.0.0"],\ - ["picomatch", "npm:2.3.1"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["aproba", [\ - ["npm:2.0.0", {\ - "packageLocation": "./.yarn/cache/aproba-npm-2.0.0-8716bcfde6-5615cadcfb.zip/node_modules/aproba/",\ - "packageDependencies": [\ - ["aproba", "npm:2.0.0"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["are-we-there-yet", [\ - ["npm:3.0.1", {\ - "packageLocation": "./.yarn/cache/are-we-there-yet-npm-3.0.1-3395b1512f-52590c2486.zip/node_modules/are-we-there-yet/",\ - "packageDependencies": [\ - ["are-we-there-yet", "npm:3.0.1"],\ - ["delegates", "npm:1.0.0"],\ - ["readable-stream", "npm:3.6.2"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["argparse", [\ - ["npm:2.0.1", {\ - "packageLocation": "./.yarn/cache/argparse-npm-2.0.1-faff7999e6-83644b5649.zip/node_modules/argparse/",\ - "packageDependencies": [\ - ["argparse", "npm:2.0.1"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["array-union", [\ - ["npm:2.1.0", {\ - "packageLocation": "./.yarn/cache/array-union-npm-2.1.0-4e4852b221-5bee12395c.zip/node_modules/array-union/",\ - "packageDependencies": [\ - ["array-union", "npm:2.1.0"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["balanced-match", [\ - ["npm:1.0.2", {\ - "packageLocation": "./.yarn/cache/balanced-match-npm-1.0.2-a53c126459-9706c088a2.zip/node_modules/balanced-match/",\ - "packageDependencies": [\ - ["balanced-match", "npm:1.0.2"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["binary-extensions", [\ - ["npm:2.2.0", {\ - "packageLocation": "./.yarn/cache/binary-extensions-npm-2.2.0-180c33fec7-ccd267956c.zip/node_modules/binary-extensions/",\ - "packageDependencies": [\ - ["binary-extensions", "npm:2.2.0"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["brace-expansion", [\ - ["npm:1.1.11", {\ - "packageLocation": "./.yarn/cache/brace-expansion-npm-1.1.11-fb95eb05ad-faf34a7bb0.zip/node_modules/brace-expansion/",\ - "packageDependencies": [\ - ["brace-expansion", "npm:1.1.11"],\ - ["balanced-match", "npm:1.0.2"],\ - ["concat-map", "npm:0.0.1"]\ - ],\ - "linkType": "HARD"\ - }],\ - ["npm:2.0.1", {\ - "packageLocation": "./.yarn/cache/brace-expansion-npm-2.0.1-17aa2616f9-a61e7cd2e8.zip/node_modules/brace-expansion/",\ - "packageDependencies": [\ - ["brace-expansion", "npm:2.0.1"],\ - ["balanced-match", "npm:1.0.2"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["braces", [\ - ["npm:3.0.2", {\ - "packageLocation": "./.yarn/cache/braces-npm-3.0.2-782240b28a-e2a8e769a8.zip/node_modules/braces/",\ - "packageDependencies": [\ - ["braces", "npm:3.0.2"],\ - ["fill-range", "npm:7.0.1"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["browser-stdout", [\ - ["npm:1.3.1", {\ - "packageLocation": "./.yarn/cache/browser-stdout-npm-1.3.1-6b2376bf3f-b717b19b25.zip/node_modules/browser-stdout/",\ - "packageDependencies": [\ - ["browser-stdout", "npm:1.3.1"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["browserslist", [\ - ["npm:4.21.10", {\ - "packageLocation": "./.yarn/cache/browserslist-npm-4.21.10-e2170a875b-1e27c0f111.zip/node_modules/browserslist/",\ - "packageDependencies": [\ - ["browserslist", "npm:4.21.10"],\ - ["caniuse-lite", "npm:1.0.30001517"],\ - ["electron-to-chromium", "npm:1.4.477"],\ - ["node-releases", "npm:2.0.13"],\ - ["update-browserslist-db", "virtual:e2170a875bba2f8fa9e93e47c65f2f250097e101a59d95ea6fd852f32965e8cd6cef3b5662aa7295279d5bc60c9a612ddb8515c7dd1b7e8fb9984dee1823e7d6#npm:1.0.11"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["buffer-from", [\ - ["npm:1.1.2", {\ - "packageLocation": "./.yarn/cache/buffer-from-npm-1.1.2-03d2f20d7e-0448524a56.zip/node_modules/buffer-from/",\ - "packageDependencies": [\ - ["buffer-from", "npm:1.1.2"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["cacache", [\ - ["npm:17.1.3", {\ - "packageLocation": "./.yarn/cache/cacache-npm-17.1.3-f75f768a29-385756781e.zip/node_modules/cacache/",\ - "packageDependencies": [\ - ["cacache", "npm:17.1.3"],\ - ["@npmcli/fs", "npm:3.1.0"],\ - ["fs-minipass", "npm:3.0.2"],\ - ["glob", "npm:10.3.3"],\ - ["lru-cache", "npm:7.18.3"],\ - ["minipass", "npm:5.0.0"],\ - ["minipass-collect", "npm:1.0.2"],\ - ["minipass-flush", "npm:1.0.5"],\ - ["minipass-pipeline", "npm:1.2.4"],\ - ["p-map", "npm:4.0.0"],\ - ["ssri", "npm:10.0.4"],\ - ["tar", "npm:6.1.15"],\ - ["unique-filename", "npm:3.0.0"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["cairo", [\ - ["workspace:toolchains/cairo", {\ - "packageLocation": "./toolchains/cairo/",\ - "packageDependencies": [\ - ["cairo", "workspace:toolchains/cairo"]\ - ],\ - "linkType": "SOFT"\ - }]\ - ]],\ - ["callsites", [\ - ["npm:3.1.0", {\ - "packageLocation": "./.yarn/cache/callsites-npm-3.1.0-268f989910-072d17b6ab.zip/node_modules/callsites/",\ - "packageDependencies": [\ - ["callsites", "npm:3.1.0"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["camelcase", [\ - ["npm:6.3.0", {\ - "packageLocation": "./.yarn/cache/camelcase-npm-6.3.0-e5e42a0d15-8c96818a90.zip/node_modules/camelcase/",\ - "packageDependencies": [\ - ["camelcase", "npm:6.3.0"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["caniuse-lite", [\ - ["npm:1.0.30001517", {\ - "packageLocation": "./.yarn/cache/caniuse-lite-npm-1.0.30001517-43126c8553-e4e87436ae.zip/node_modules/caniuse-lite/",\ - "packageDependencies": [\ - ["caniuse-lite", "npm:1.0.30001517"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["chalk", [\ - ["npm:4.1.2", {\ - "packageLocation": "./.yarn/cache/chalk-npm-4.1.2-ba8b67ab80-fe75c9d5c7.zip/node_modules/chalk/",\ - "packageDependencies": [\ - ["chalk", "npm:4.1.2"],\ - ["ansi-styles", "npm:4.3.0"],\ - ["supports-color", "npm:7.2.0"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["chokidar", [\ - ["npm:3.5.3", {\ - "packageLocation": "./.yarn/cache/chokidar-npm-3.5.3-c5f9b0a56a-b49fcde401.zip/node_modules/chokidar/",\ - "packageDependencies": [\ - ["chokidar", "npm:3.5.3"],\ - ["anymatch", "npm:3.1.3"],\ - ["braces", "npm:3.0.2"],\ - ["fsevents", "patch:fsevents@npm%3A2.3.2#~builtin::version=2.3.2&hash=df0bf1"],\ - ["glob-parent", "npm:5.1.2"],\ - ["is-binary-path", "npm:2.1.0"],\ - ["is-glob", "npm:4.0.3"],\ - ["normalize-path", "npm:3.0.0"],\ - ["readdirp", "npm:3.6.0"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["chownr", [\ - ["npm:2.0.0", {\ - "packageLocation": "./.yarn/cache/chownr-npm-2.0.0-638f1c9c61-c57cf9dd07.zip/node_modules/chownr/",\ - "packageDependencies": [\ - ["chownr", "npm:2.0.0"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["chrome-trace-event", [\ - ["npm:1.0.3", {\ - "packageLocation": "./.yarn/cache/chrome-trace-event-npm-1.0.3-e0ae3dcd60-cb8b1fc7e8.zip/node_modules/chrome-trace-event/",\ - "packageDependencies": [\ - ["chrome-trace-event", "npm:1.0.3"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["clean-stack", [\ - ["npm:2.2.0", {\ - "packageLocation": "./.yarn/cache/clean-stack-npm-2.2.0-a8ce435a5c-2ac8cd2b2f.zip/node_modules/clean-stack/",\ - "packageDependencies": [\ - ["clean-stack", "npm:2.2.0"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["cliui", [\ - ["npm:7.0.4", {\ - "packageLocation": "./.yarn/cache/cliui-npm-7.0.4-d6b8a9edb6-ce2e8f578a.zip/node_modules/cliui/",\ - "packageDependencies": [\ - ["cliui", "npm:7.0.4"],\ - ["string-width", "npm:4.2.3"],\ - ["strip-ansi", "npm:6.0.1"],\ - ["wrap-ansi", "npm:7.0.0"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["clone-deep", [\ - ["npm:4.0.1", {\ - "packageLocation": "./.yarn/cache/clone-deep-npm-4.0.1-70adab92c8-770f912fe4.zip/node_modules/clone-deep/",\ - "packageDependencies": [\ - ["clone-deep", "npm:4.0.1"],\ - ["is-plain-object", "npm:2.0.4"],\ - ["kind-of", "npm:6.0.3"],\ - ["shallow-clone", "npm:3.0.1"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["color-convert", [\ - ["npm:2.0.1", {\ - "packageLocation": "./.yarn/cache/color-convert-npm-2.0.1-79730e935b-79e6bdb9fd.zip/node_modules/color-convert/",\ - "packageDependencies": [\ - ["color-convert", "npm:2.0.1"],\ - ["color-name", "npm:1.1.4"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["color-name", [\ - ["npm:1.1.4", {\ - "packageLocation": "./.yarn/cache/color-name-npm-1.1.4-025792b0ea-b044585952.zip/node_modules/color-name/",\ - "packageDependencies": [\ - ["color-name", "npm:1.1.4"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["color-support", [\ - ["npm:1.1.3", {\ - "packageLocation": "./.yarn/cache/color-support-npm-1.1.3-3be5c53455-9b73568176.zip/node_modules/color-support/",\ - "packageDependencies": [\ - ["color-support", "npm:1.1.3"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["colorette", [\ - ["npm:2.0.20", {\ - "packageLocation": "./.yarn/cache/colorette-npm-2.0.20-692d428726-0c016fea2b.zip/node_modules/colorette/",\ - "packageDependencies": [\ - ["colorette", "npm:2.0.20"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["commander", [\ - ["npm:10.0.1", {\ - "packageLocation": "./.yarn/cache/commander-npm-10.0.1-f17613b72b-436901d64a.zip/node_modules/commander/",\ - "packageDependencies": [\ - ["commander", "npm:10.0.1"]\ - ],\ - "linkType": "HARD"\ - }],\ - ["npm:2.20.3", {\ - "packageLocation": "./.yarn/cache/commander-npm-2.20.3-d8dcbaa39b-ab8c07884e.zip/node_modules/commander/",\ - "packageDependencies": [\ - ["commander", "npm:2.20.3"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["concat-map", [\ - ["npm:0.0.1", {\ - "packageLocation": "./.yarn/cache/concat-map-npm-0.0.1-85a921b7ee-902a9f5d89.zip/node_modules/concat-map/",\ - "packageDependencies": [\ - ["concat-map", "npm:0.0.1"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["console-control-strings", [\ - ["npm:1.1.0", {\ - "packageLocation": "./.yarn/cache/console-control-strings-npm-1.1.0-e3160e5275-8755d76787.zip/node_modules/console-control-strings/",\ - "packageDependencies": [\ - ["console-control-strings", "npm:1.1.0"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["core-util-is", [\ - ["npm:1.0.3", {\ - "packageLocation": "./.yarn/cache/core-util-is-npm-1.0.3-ca74b76c90-9de8597363.zip/node_modules/core-util-is/",\ - "packageDependencies": [\ - ["core-util-is", "npm:1.0.3"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["cross-spawn", [\ - ["npm:7.0.3", {\ - "packageLocation": "./.yarn/cache/cross-spawn-npm-7.0.3-e4ff3e65b3-671cc7c728.zip/node_modules/cross-spawn/",\ - "packageDependencies": [\ - ["cross-spawn", "npm:7.0.3"],\ - ["path-key", "npm:3.1.1"],\ - ["shebang-command", "npm:2.0.0"],\ - ["which", "npm:2.0.2"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["debug", [\ - ["npm:4.3.4", {\ - "packageLocation": "./.yarn/cache/debug-npm-4.3.4-4513954577-3dbad3f94e.zip/node_modules/debug/",\ - "packageDependencies": [\ - ["debug", "npm:4.3.4"]\ - ],\ - "linkType": "SOFT"\ - }],\ - ["virtual:87db25c7c5e6b25bbc12571091cdabc648b79d427ab445d1714ccfdcdfb3265c9de6561ca760cc3de470037cbedf3af4be56ba3b684b3a1c01d4c9c2fd55a741#npm:4.3.4", {\ - "packageLocation": "./.yarn/__virtual__/debug-virtual-762d08cbe9/0/cache/debug-npm-4.3.4-4513954577-3dbad3f94e.zip/node_modules/debug/",\ - "packageDependencies": [\ - ["debug", "virtual:87db25c7c5e6b25bbc12571091cdabc648b79d427ab445d1714ccfdcdfb3265c9de6561ca760cc3de470037cbedf3af4be56ba3b684b3a1c01d4c9c2fd55a741#npm:4.3.4"],\ - ["@types/supports-color", null],\ - ["ms", "npm:2.1.2"],\ - ["supports-color", "npm:8.1.1"]\ - ],\ - "packagePeers": [\ - "@types/supports-color",\ - "supports-color"\ - ],\ - "linkType": "HARD"\ - }],\ - ["virtual:ced87d94ab05a28b44536eb0cd61a9458e757a0ae7bb35e5ab5d27e03d08b996abd275928b29aad2eb0973d5bb0800e75ba8ca3e26bf62cbe8ea0fae8cca70a8#npm:4.3.4", {\ - "packageLocation": "./.yarn/__virtual__/debug-virtual-023f479948/0/cache/debug-npm-4.3.4-4513954577-3dbad3f94e.zip/node_modules/debug/",\ - "packageDependencies": [\ - ["debug", "virtual:ced87d94ab05a28b44536eb0cd61a9458e757a0ae7bb35e5ab5d27e03d08b996abd275928b29aad2eb0973d5bb0800e75ba8ca3e26bf62cbe8ea0fae8cca70a8#npm:4.3.4"],\ - ["@types/supports-color", null],\ - ["ms", "npm:2.1.2"],\ - ["supports-color", null]\ - ],\ - "packagePeers": [\ - "@types/supports-color",\ - "supports-color"\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["decamelize", [\ - ["npm:4.0.0", {\ - "packageLocation": "./.yarn/cache/decamelize-npm-4.0.0-12410e3409-b7d09b8265.zip/node_modules/decamelize/",\ - "packageDependencies": [\ - ["decamelize", "npm:4.0.0"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["deep-is", [\ - ["npm:0.1.4", {\ - "packageLocation": "./.yarn/cache/deep-is-npm-0.1.4-88938b5a67-edb65dd0d7.zip/node_modules/deep-is/",\ - "packageDependencies": [\ - ["deep-is", "npm:0.1.4"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["delegates", [\ - ["npm:1.0.0", {\ - "packageLocation": "./.yarn/cache/delegates-npm-1.0.0-9b1942d75f-a51744d9b5.zip/node_modules/delegates/",\ - "packageDependencies": [\ - ["delegates", "npm:1.0.0"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["depd", [\ - ["npm:2.0.0", {\ - "packageLocation": "./.yarn/cache/depd-npm-2.0.0-b6c51a4b43-abbe19c768.zip/node_modules/depd/",\ - "packageDependencies": [\ - ["depd", "npm:2.0.0"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["diff", [\ - ["npm:5.0.0", {\ - "packageLocation": "./.yarn/cache/diff-npm-5.0.0-ad6900db18-f19fe29284.zip/node_modules/diff/",\ - "packageDependencies": [\ - ["diff", "npm:5.0.0"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["dir-glob", [\ - ["npm:3.0.1", {\ - "packageLocation": "./.yarn/cache/dir-glob-npm-3.0.1-1aea628b1b-fa05e18324.zip/node_modules/dir-glob/",\ - "packageDependencies": [\ - ["dir-glob", "npm:3.0.1"],\ - ["path-type", "npm:4.0.0"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["doctrine", [\ - ["npm:3.0.0", {\ - "packageLocation": "./.yarn/cache/doctrine-npm-3.0.0-c6f1615f04-fd7673ca77.zip/node_modules/doctrine/",\ - "packageDependencies": [\ - ["doctrine", "npm:3.0.0"],\ - ["esutils", "npm:2.0.3"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["eastasianwidth", [\ - ["npm:0.2.0", {\ - "packageLocation": "./.yarn/cache/eastasianwidth-npm-0.2.0-c37eb16bd1-7d00d7cd8e.zip/node_modules/eastasianwidth/",\ - "packageDependencies": [\ - ["eastasianwidth", "npm:0.2.0"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["electron-to-chromium", [\ - ["npm:1.4.477", {\ - "packageLocation": "./.yarn/cache/electron-to-chromium-npm-1.4.477-bc19f6b30e-1bf6117b2b.zip/node_modules/electron-to-chromium/",\ - "packageDependencies": [\ - ["electron-to-chromium", "npm:1.4.477"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["emoji-regex", [\ - ["npm:8.0.0", {\ - "packageLocation": "./.yarn/cache/emoji-regex-npm-8.0.0-213764015c-d4c5c39d5a.zip/node_modules/emoji-regex/",\ - "packageDependencies": [\ - ["emoji-regex", "npm:8.0.0"]\ - ],\ - "linkType": "HARD"\ - }],\ - ["npm:9.2.2", {\ - "packageLocation": "./.yarn/cache/emoji-regex-npm-9.2.2-e6fac8d058-8487182da7.zip/node_modules/emoji-regex/",\ - "packageDependencies": [\ - ["emoji-regex", "npm:9.2.2"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["encoding", [\ - ["npm:0.1.13", {\ - "packageLocation": "./.yarn/cache/encoding-npm-0.1.13-82a1837d30-bb98632f8f.zip/node_modules/encoding/",\ - "packageDependencies": [\ - ["encoding", "npm:0.1.13"],\ - ["iconv-lite", "npm:0.6.3"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["enhanced-resolve", [\ - ["npm:5.15.0", {\ - "packageLocation": "./.yarn/cache/enhanced-resolve-npm-5.15.0-16eb7ddef9-fbd8cdc926.zip/node_modules/enhanced-resolve/",\ - "packageDependencies": [\ - ["enhanced-resolve", "npm:5.15.0"],\ - ["graceful-fs", "npm:4.2.11"],\ - ["tapable", "npm:2.2.1"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["env-paths", [\ - ["npm:2.2.1", {\ - "packageLocation": "./.yarn/cache/env-paths-npm-2.2.1-7c7577428c-65b5df55a8.zip/node_modules/env-paths/",\ - "packageDependencies": [\ - ["env-paths", "npm:2.2.1"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["envinfo", [\ - ["npm:7.10.0", {\ - "packageLocation": "./.yarn/cache/envinfo-npm-7.10.0-cba8c054d4-05e81a5768.zip/node_modules/envinfo/",\ - "packageDependencies": [\ - ["envinfo", "npm:7.10.0"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["err-code", [\ - ["npm:2.0.3", {\ - "packageLocation": "./.yarn/cache/err-code-npm-2.0.3-082e0ff9a7-8b7b1be20d.zip/node_modules/err-code/",\ - "packageDependencies": [\ - ["err-code", "npm:2.0.3"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["es-module-lexer", [\ - ["npm:1.3.0", {\ - "packageLocation": "./.yarn/cache/es-module-lexer-npm-1.3.0-9be5e8b1c4-48fd9f504a.zip/node_modules/es-module-lexer/",\ - "packageDependencies": [\ - ["es-module-lexer", "npm:1.3.0"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["escalade", [\ - ["npm:3.1.1", {\ - "packageLocation": "./.yarn/cache/escalade-npm-3.1.1-e02da076aa-a3e2a99f07.zip/node_modules/escalade/",\ - "packageDependencies": [\ - ["escalade", "npm:3.1.1"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["escape-string-regexp", [\ - ["npm:4.0.0", {\ - "packageLocation": "./.yarn/cache/escape-string-regexp-npm-4.0.0-4b531d8d59-98b48897d9.zip/node_modules/escape-string-regexp/",\ - "packageDependencies": [\ - ["escape-string-regexp", "npm:4.0.0"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["eslint", [\ - ["npm:8.46.0", {\ - "packageLocation": "./.yarn/cache/eslint-npm-8.46.0-dc7af99e61-7a7d36b1a3.zip/node_modules/eslint/",\ - "packageDependencies": [\ - ["eslint", "npm:8.46.0"],\ - ["@eslint-community/eslint-utils", "virtual:dc7af99e618232ac0e2a751f560e2225037bf809144a4cc05369d5312b9d24061282984c0c0c6c5c199f3a0663f91f11c21afb60016655f472fa253e0b676e3b#npm:4.4.0"],\ - ["@eslint-community/regexpp", "npm:4.6.2"],\ - ["@eslint/eslintrc", "npm:2.1.1"],\ - ["@eslint/js", "npm:8.46.0"],\ - ["@humanwhocodes/config-array", "npm:0.11.10"],\ - ["@humanwhocodes/module-importer", "npm:1.0.1"],\ - ["@nodelib/fs.walk", "npm:1.2.8"],\ - ["ajv", "npm:6.12.6"],\ - ["chalk", "npm:4.1.2"],\ - ["cross-spawn", "npm:7.0.3"],\ - ["debug", "virtual:ced87d94ab05a28b44536eb0cd61a9458e757a0ae7bb35e5ab5d27e03d08b996abd275928b29aad2eb0973d5bb0800e75ba8ca3e26bf62cbe8ea0fae8cca70a8#npm:4.3.4"],\ - ["doctrine", "npm:3.0.0"],\ - ["escape-string-regexp", "npm:4.0.0"],\ - ["eslint-scope", "npm:7.2.2"],\ - ["eslint-visitor-keys", "npm:3.4.2"],\ - ["espree", "npm:9.6.1"],\ - ["esquery", "npm:1.5.0"],\ - ["esutils", "npm:2.0.3"],\ - ["fast-deep-equal", "npm:3.1.3"],\ - ["file-entry-cache", "npm:6.0.1"],\ - ["find-up", "npm:5.0.0"],\ - ["glob-parent", "npm:6.0.2"],\ - ["globals", "npm:13.20.0"],\ - ["graphemer", "npm:1.4.0"],\ - ["ignore", "npm:5.2.4"],\ - ["imurmurhash", "npm:0.1.4"],\ - ["is-glob", "npm:4.0.3"],\ - ["is-path-inside", "npm:3.0.3"],\ - ["js-yaml", "npm:4.1.0"],\ - ["json-stable-stringify-without-jsonify", "npm:1.0.1"],\ - ["levn", "npm:0.4.1"],\ - ["lodash.merge", "npm:4.6.2"],\ - ["minimatch", "npm:3.1.2"],\ - ["natural-compare", "npm:1.4.0"],\ - ["optionator", "npm:0.9.3"],\ - ["strip-ansi", "npm:6.0.1"],\ - ["text-table", "npm:0.2.0"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["eslint-scope", [\ - ["npm:5.1.1", {\ - "packageLocation": "./.yarn/cache/eslint-scope-npm-5.1.1-71fe59b18a-47e4b6a3f0.zip/node_modules/eslint-scope/",\ - "packageDependencies": [\ - ["eslint-scope", "npm:5.1.1"],\ - ["esrecurse", "npm:4.3.0"],\ - ["estraverse", "npm:4.3.0"]\ - ],\ - "linkType": "HARD"\ - }],\ - ["npm:7.2.2", {\ - "packageLocation": "./.yarn/cache/eslint-scope-npm-7.2.2-53cb0df8e8-ec97dbf5fb.zip/node_modules/eslint-scope/",\ - "packageDependencies": [\ - ["eslint-scope", "npm:7.2.2"],\ - ["esrecurse", "npm:4.3.0"],\ - ["estraverse", "npm:5.3.0"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["eslint-visitor-keys", [\ - ["npm:3.4.2", {\ - "packageLocation": "./.yarn/cache/eslint-visitor-keys-npm-3.4.2-304459f972-9e0e7e4aae.zip/node_modules/eslint-visitor-keys/",\ - "packageDependencies": [\ - ["eslint-visitor-keys", "npm:3.4.2"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["espree", [\ - ["npm:9.6.1", {\ - "packageLocation": "./.yarn/cache/espree-npm-9.6.1-a50722a5a9-eb8c149c7a.zip/node_modules/espree/",\ - "packageDependencies": [\ - ["espree", "npm:9.6.1"],\ - ["acorn", "npm:8.10.0"],\ - ["acorn-jsx", "virtual:a50722a5a9326b6a5f12350c494c4db3aa0f4caeac45e3e9e5fe071da20014ecfe738fe2ebe2c9c98abae81a4ea86b42f56d776b3bd5ec37f9ad3670c242b242#npm:5.3.2"],\ - ["eslint-visitor-keys", "npm:3.4.2"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["esquery", [\ - ["npm:1.5.0", {\ - "packageLocation": "./.yarn/cache/esquery-npm-1.5.0-d8f8a06879-aefb0d2596.zip/node_modules/esquery/",\ - "packageDependencies": [\ - ["esquery", "npm:1.5.0"],\ - ["estraverse", "npm:5.3.0"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["esrecurse", [\ - ["npm:4.3.0", {\ - "packageLocation": "./.yarn/cache/esrecurse-npm-4.3.0-10b86a887a-ebc17b1a33.zip/node_modules/esrecurse/",\ - "packageDependencies": [\ - ["esrecurse", "npm:4.3.0"],\ - ["estraverse", "npm:5.3.0"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["estraverse", [\ - ["npm:4.3.0", {\ - "packageLocation": "./.yarn/cache/estraverse-npm-4.3.0-920a32f3c6-a6299491f9.zip/node_modules/estraverse/",\ - "packageDependencies": [\ - ["estraverse", "npm:4.3.0"]\ - ],\ - "linkType": "HARD"\ - }],\ - ["npm:5.3.0", {\ - "packageLocation": "./.yarn/cache/estraverse-npm-5.3.0-03284f8f63-072780882d.zip/node_modules/estraverse/",\ - "packageDependencies": [\ - ["estraverse", "npm:5.3.0"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["esutils", [\ - ["npm:2.0.3", {\ - "packageLocation": "./.yarn/cache/esutils-npm-2.0.3-f865beafd5-22b5b08f74.zip/node_modules/esutils/",\ - "packageDependencies": [\ - ["esutils", "npm:2.0.3"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["events", [\ - ["npm:3.3.0", {\ - "packageLocation": "./.yarn/cache/events-npm-3.3.0-c280bc7e48-f6f487ad21.zip/node_modules/events/",\ - "packageDependencies": [\ - ["events", "npm:3.3.0"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["exponential-backoff", [\ - ["npm:3.1.1", {\ - "packageLocation": "./.yarn/cache/exponential-backoff-npm-3.1.1-04df458b30-3d21519a4f.zip/node_modules/exponential-backoff/",\ - "packageDependencies": [\ - ["exponential-backoff", "npm:3.1.1"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["fast-deep-equal", [\ - ["npm:3.1.3", {\ - "packageLocation": "./.yarn/cache/fast-deep-equal-npm-3.1.3-790edcfcf5-e21a9d8d84.zip/node_modules/fast-deep-equal/",\ - "packageDependencies": [\ - ["fast-deep-equal", "npm:3.1.3"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["fast-glob", [\ - ["npm:3.3.1", {\ - "packageLocation": "./.yarn/cache/fast-glob-npm-3.3.1-8045ff8f4d-b6f3add640.zip/node_modules/fast-glob/",\ - "packageDependencies": [\ - ["fast-glob", "npm:3.3.1"],\ - ["@nodelib/fs.stat", "npm:2.0.5"],\ - ["@nodelib/fs.walk", "npm:1.2.8"],\ - ["glob-parent", "npm:5.1.2"],\ - ["merge2", "npm:1.4.1"],\ - ["micromatch", "npm:4.0.5"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["fast-json-stable-stringify", [\ - ["npm:2.1.0", {\ - "packageLocation": "./.yarn/cache/fast-json-stable-stringify-npm-2.1.0-02e8905fda-b191531e36.zip/node_modules/fast-json-stable-stringify/",\ - "packageDependencies": [\ - ["fast-json-stable-stringify", "npm:2.1.0"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["fast-levenshtein", [\ - ["npm:2.0.6", {\ - "packageLocation": "./.yarn/cache/fast-levenshtein-npm-2.0.6-fcd74b8df5-92cfec0a8d.zip/node_modules/fast-levenshtein/",\ - "packageDependencies": [\ - ["fast-levenshtein", "npm:2.0.6"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["fastest-levenshtein", [\ - ["npm:1.0.16", {\ - "packageLocation": "./.yarn/cache/fastest-levenshtein-npm-1.0.16-192d328856-a78d44285c.zip/node_modules/fastest-levenshtein/",\ - "packageDependencies": [\ - ["fastest-levenshtein", "npm:1.0.16"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["fastq", [\ - ["npm:1.15.0", {\ - "packageLocation": "./.yarn/cache/fastq-npm-1.15.0-1013f6514e-0170e6bfcd.zip/node_modules/fastq/",\ - "packageDependencies": [\ - ["fastq", "npm:1.15.0"],\ - ["reusify", "npm:1.0.4"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["file-entry-cache", [\ - ["npm:6.0.1", {\ - "packageLocation": "./.yarn/cache/file-entry-cache-npm-6.0.1-31965cf0af-f49701feaa.zip/node_modules/file-entry-cache/",\ - "packageDependencies": [\ - ["file-entry-cache", "npm:6.0.1"],\ - ["flat-cache", "npm:3.0.4"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["fill-range", [\ - ["npm:7.0.1", {\ - "packageLocation": "./.yarn/cache/fill-range-npm-7.0.1-b8b1817caa-cc283f4e65.zip/node_modules/fill-range/",\ - "packageDependencies": [\ - ["fill-range", "npm:7.0.1"],\ - ["to-regex-range", "npm:5.0.1"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["find-up", [\ - ["npm:4.1.0", {\ - "packageLocation": "./.yarn/cache/find-up-npm-4.1.0-c3ccf8d855-4c172680e8.zip/node_modules/find-up/",\ - "packageDependencies": [\ - ["find-up", "npm:4.1.0"],\ - ["locate-path", "npm:5.0.0"],\ - ["path-exists", "npm:4.0.0"]\ - ],\ - "linkType": "HARD"\ - }],\ - ["npm:5.0.0", {\ - "packageLocation": "./.yarn/cache/find-up-npm-5.0.0-e03e9b796d-07955e3573.zip/node_modules/find-up/",\ - "packageDependencies": [\ - ["find-up", "npm:5.0.0"],\ - ["locate-path", "npm:6.0.0"],\ - ["path-exists", "npm:4.0.0"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["flat", [\ - ["npm:5.0.2", {\ - "packageLocation": "./.yarn/cache/flat-npm-5.0.2-12748102a5-12a1536ac7.zip/node_modules/flat/",\ - "packageDependencies": [\ - ["flat", "npm:5.0.2"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["flat-cache", [\ - ["npm:3.0.4", {\ - "packageLocation": "./.yarn/cache/flat-cache-npm-3.0.4-ee77e5911e-4fdd10ecbc.zip/node_modules/flat-cache/",\ - "packageDependencies": [\ - ["flat-cache", "npm:3.0.4"],\ - ["flatted", "npm:3.2.7"],\ - ["rimraf", "npm:3.0.2"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["flatted", [\ - ["npm:3.2.7", {\ - "packageLocation": "./.yarn/cache/flatted-npm-3.2.7-0da10b7c56-427633049d.zip/node_modules/flatted/",\ - "packageDependencies": [\ - ["flatted", "npm:3.2.7"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["foreground-child", [\ - ["npm:3.1.1", {\ - "packageLocation": "./.yarn/cache/foreground-child-npm-3.1.1-77e78ed774-139d270bc8.zip/node_modules/foreground-child/",\ - "packageDependencies": [\ - ["foreground-child", "npm:3.1.1"],\ - ["cross-spawn", "npm:7.0.3"],\ - ["signal-exit", "npm:4.1.0"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["fs-minipass", [\ - ["npm:2.1.0", {\ - "packageLocation": "./.yarn/cache/fs-minipass-npm-2.1.0-501ef87306-1b8d128dae.zip/node_modules/fs-minipass/",\ - "packageDependencies": [\ - ["fs-minipass", "npm:2.1.0"],\ - ["minipass", "npm:3.3.6"]\ - ],\ - "linkType": "HARD"\ - }],\ - ["npm:3.0.2", {\ - "packageLocation": "./.yarn/cache/fs-minipass-npm-3.0.2-a27ef235f5-e9cc0e1f2d.zip/node_modules/fs-minipass/",\ - "packageDependencies": [\ - ["fs-minipass", "npm:3.0.2"],\ - ["minipass", "npm:5.0.0"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["fs.realpath", [\ - ["npm:1.0.0", {\ - "packageLocation": "./.yarn/cache/fs.realpath-npm-1.0.0-c8f05d8126-99ddea01a7.zip/node_modules/fs.realpath/",\ - "packageDependencies": [\ - ["fs.realpath", "npm:1.0.0"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["fsevents", [\ - ["patch:fsevents@npm%3A2.3.2#~builtin::version=2.3.2&hash=df0bf1", {\ - "packageLocation": "./.yarn/unplugged/fsevents-patch-2882183fbf/node_modules/fsevents/",\ - "packageDependencies": [\ - ["fsevents", "patch:fsevents@npm%3A2.3.2#~builtin::version=2.3.2&hash=df0bf1"],\ - ["node-gyp", "npm:9.4.0"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["function-bind", [\ - ["npm:1.1.1", {\ - "packageLocation": "./.yarn/cache/function-bind-npm-1.1.1-b56b322ae9-b32fbaebb3.zip/node_modules/function-bind/",\ - "packageDependencies": [\ - ["function-bind", "npm:1.1.1"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["gauge", [\ - ["npm:4.0.4", {\ - "packageLocation": "./.yarn/cache/gauge-npm-4.0.4-8f878385e9-788b6bfe52.zip/node_modules/gauge/",\ - "packageDependencies": [\ - ["gauge", "npm:4.0.4"],\ - ["aproba", "npm:2.0.0"],\ - ["color-support", "npm:1.1.3"],\ - ["console-control-strings", "npm:1.1.0"],\ - ["has-unicode", "npm:2.0.1"],\ - ["signal-exit", "npm:3.0.7"],\ - ["string-width", "npm:4.2.3"],\ - ["strip-ansi", "npm:6.0.1"],\ - ["wide-align", "npm:1.1.5"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["get-caller-file", [\ - ["npm:2.0.5", {\ - "packageLocation": "./.yarn/cache/get-caller-file-npm-2.0.5-80e8a86305-b9769a836d.zip/node_modules/get-caller-file/",\ - "packageDependencies": [\ - ["get-caller-file", "npm:2.0.5"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["glob", [\ - ["npm:10.3.3", {\ - "packageLocation": "./.yarn/cache/glob-npm-10.3.3-2d9abea8c7-29190d3291.zip/node_modules/glob/",\ - "packageDependencies": [\ - ["glob", "npm:10.3.3"],\ - ["foreground-child", "npm:3.1.1"],\ - ["jackspeak", "npm:2.2.2"],\ - ["minimatch", "npm:9.0.3"],\ - ["minipass", "npm:7.0.2"],\ - ["path-scurry", "npm:1.10.1"]\ - ],\ - "linkType": "HARD"\ - }],\ - ["npm:7.2.0", {\ - "packageLocation": "./.yarn/cache/glob-npm-7.2.0-bb4644d239-78a8ea9423.zip/node_modules/glob/",\ - "packageDependencies": [\ - ["glob", "npm:7.2.0"],\ - ["fs.realpath", "npm:1.0.0"],\ - ["inflight", "npm:1.0.6"],\ - ["inherits", "npm:2.0.4"],\ - ["minimatch", "npm:3.1.2"],\ - ["once", "npm:1.4.0"],\ - ["path-is-absolute", "npm:1.0.1"]\ - ],\ - "linkType": "HARD"\ - }],\ - ["npm:7.2.3", {\ - "packageLocation": "./.yarn/cache/glob-npm-7.2.3-2d866d17a5-29452e97b3.zip/node_modules/glob/",\ - "packageDependencies": [\ - ["glob", "npm:7.2.3"],\ - ["fs.realpath", "npm:1.0.0"],\ - ["inflight", "npm:1.0.6"],\ - ["inherits", "npm:2.0.4"],\ - ["minimatch", "npm:3.1.2"],\ - ["once", "npm:1.4.0"],\ - ["path-is-absolute", "npm:1.0.1"]\ - ],\ - "linkType": "HARD"\ - }],\ - ["npm:8.1.0", {\ - "packageLocation": "./.yarn/cache/glob-npm-8.1.0-65f64af8b1-92fbea3221.zip/node_modules/glob/",\ - "packageDependencies": [\ - ["glob", "npm:8.1.0"],\ - ["fs.realpath", "npm:1.0.0"],\ - ["inflight", "npm:1.0.6"],\ - ["inherits", "npm:2.0.4"],\ - ["minimatch", "npm:5.1.6"],\ - ["once", "npm:1.4.0"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["glob-parent", [\ - ["npm:5.1.2", {\ - "packageLocation": "./.yarn/cache/glob-parent-npm-5.1.2-021ab32634-f4f2bfe242.zip/node_modules/glob-parent/",\ - "packageDependencies": [\ - ["glob-parent", "npm:5.1.2"],\ - ["is-glob", "npm:4.0.3"]\ - ],\ - "linkType": "HARD"\ - }],\ - ["npm:6.0.2", {\ - "packageLocation": "./.yarn/cache/glob-parent-npm-6.0.2-2cbef12738-c13ee97978.zip/node_modules/glob-parent/",\ - "packageDependencies": [\ - ["glob-parent", "npm:6.0.2"],\ - ["is-glob", "npm:4.0.3"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["glob-to-regexp", [\ - ["npm:0.4.1", {\ - "packageLocation": "./.yarn/cache/glob-to-regexp-npm-0.4.1-cd697e0fc7-e795f4e8f0.zip/node_modules/glob-to-regexp/",\ - "packageDependencies": [\ - ["glob-to-regexp", "npm:0.4.1"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["globals", [\ - ["npm:13.20.0", {\ - "packageLocation": "./.yarn/cache/globals-npm-13.20.0-4565a722e7-ad1ecf914b.zip/node_modules/globals/",\ - "packageDependencies": [\ - ["globals", "npm:13.20.0"],\ - ["type-fest", "npm:0.20.2"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["globby", [\ - ["npm:11.1.0", {\ - "packageLocation": "./.yarn/cache/globby-npm-11.1.0-bdcdf20c71-b4be8885e0.zip/node_modules/globby/",\ - "packageDependencies": [\ - ["globby", "npm:11.1.0"],\ - ["array-union", "npm:2.1.0"],\ - ["dir-glob", "npm:3.0.1"],\ - ["fast-glob", "npm:3.3.1"],\ - ["ignore", "npm:5.2.4"],\ - ["merge2", "npm:1.4.1"],\ - ["slash", "npm:3.0.0"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["graceful-fs", [\ - ["npm:4.2.11", {\ - "packageLocation": "./.yarn/cache/graceful-fs-npm-4.2.11-24bb648a68-ac85f94da9.zip/node_modules/graceful-fs/",\ - "packageDependencies": [\ - ["graceful-fs", "npm:4.2.11"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["graphemer", [\ - ["npm:1.4.0", {\ - "packageLocation": "./.yarn/cache/graphemer-npm-1.4.0-0627732d35-bab8f0be9b.zip/node_modules/graphemer/",\ - "packageDependencies": [\ - ["graphemer", "npm:1.4.0"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["has", [\ - ["npm:1.0.3", {\ - "packageLocation": "./.yarn/cache/has-npm-1.0.3-b7f00631c1-b9ad53d53b.zip/node_modules/has/",\ - "packageDependencies": [\ - ["has", "npm:1.0.3"],\ - ["function-bind", "npm:1.1.1"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["has-flag", [\ - ["npm:4.0.0", {\ - "packageLocation": "./.yarn/cache/has-flag-npm-4.0.0-32af9f0536-261a135703.zip/node_modules/has-flag/",\ - "packageDependencies": [\ - ["has-flag", "npm:4.0.0"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["has-unicode", [\ - ["npm:2.0.1", {\ - "packageLocation": "./.yarn/cache/has-unicode-npm-2.0.1-893adb4747-1eab07a743.zip/node_modules/has-unicode/",\ - "packageDependencies": [\ - ["has-unicode", "npm:2.0.1"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["he", [\ - ["npm:1.2.0", {\ - "packageLocation": "./.yarn/cache/he-npm-1.2.0-3b73a2ff07-3d4d6babcc.zip/node_modules/he/",\ - "packageDependencies": [\ - ["he", "npm:1.2.0"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["http-cache-semantics", [\ - ["npm:4.1.1", {\ - "packageLocation": "./.yarn/cache/http-cache-semantics-npm-4.1.1-1120131375-83ac0bc60b.zip/node_modules/http-cache-semantics/",\ - "packageDependencies": [\ - ["http-cache-semantics", "npm:4.1.1"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["http-proxy-agent", [\ - ["npm:4.0.1", {\ - "packageLocation": "./.yarn/cache/http-proxy-agent-npm-4.0.1-ce9ef61788-c6a5da5a19.zip/node_modules/http-proxy-agent/",\ - "packageDependencies": [\ - ["http-proxy-agent", "npm:4.0.1"],\ - ["@tootallnate/once", "npm:1.1.2"],\ - ["agent-base", "npm:6.0.2"],\ - ["debug", "virtual:ced87d94ab05a28b44536eb0cd61a9458e757a0ae7bb35e5ab5d27e03d08b996abd275928b29aad2eb0973d5bb0800e75ba8ca3e26bf62cbe8ea0fae8cca70a8#npm:4.3.4"]\ - ],\ - "linkType": "HARD"\ - }],\ - ["npm:5.0.0", {\ - "packageLocation": "./.yarn/cache/http-proxy-agent-npm-5.0.0-7f1f121b83-e2ee1ff165.zip/node_modules/http-proxy-agent/",\ - "packageDependencies": [\ - ["http-proxy-agent", "npm:5.0.0"],\ - ["@tootallnate/once", "npm:2.0.0"],\ - ["agent-base", "npm:6.0.2"],\ - ["debug", "virtual:ced87d94ab05a28b44536eb0cd61a9458e757a0ae7bb35e5ab5d27e03d08b996abd275928b29aad2eb0973d5bb0800e75ba8ca3e26bf62cbe8ea0fae8cca70a8#npm:4.3.4"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["https-proxy-agent", [\ - ["npm:5.0.1", {\ - "packageLocation": "./.yarn/cache/https-proxy-agent-npm-5.0.1-42d65f358e-571fccdf38.zip/node_modules/https-proxy-agent/",\ - "packageDependencies": [\ - ["https-proxy-agent", "npm:5.0.1"],\ - ["agent-base", "npm:6.0.2"],\ - ["debug", "virtual:ced87d94ab05a28b44536eb0cd61a9458e757a0ae7bb35e5ab5d27e03d08b996abd275928b29aad2eb0973d5bb0800e75ba8ca3e26bf62cbe8ea0fae8cca70a8#npm:4.3.4"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["humanize-ms", [\ - ["npm:1.2.1", {\ - "packageLocation": "./.yarn/cache/humanize-ms-npm-1.2.1-e942bd7329-9c7a74a282.zip/node_modules/humanize-ms/",\ - "packageDependencies": [\ - ["humanize-ms", "npm:1.2.1"],\ - ["ms", "npm:2.1.3"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["husky", [\ - ["npm:8.0.3", {\ - "packageLocation": "./.yarn/cache/husky-npm-8.0.3-b0b59c5127-837bc7e441.zip/node_modules/husky/",\ - "packageDependencies": [\ - ["husky", "npm:8.0.3"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["iconv-lite", [\ - ["npm:0.6.3", {\ - "packageLocation": "./.yarn/cache/iconv-lite-npm-0.6.3-24b8aae27e-3f60d47a5c.zip/node_modules/iconv-lite/",\ - "packageDependencies": [\ - ["iconv-lite", "npm:0.6.3"],\ - ["safer-buffer", "npm:2.1.2"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["ignore", [\ - ["npm:5.2.4", {\ - "packageLocation": "./.yarn/cache/ignore-npm-5.2.4-fbe6e989e5-3d4c309c60.zip/node_modules/ignore/",\ - "packageDependencies": [\ - ["ignore", "npm:5.2.4"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["immediate", [\ - ["npm:3.0.6", {\ - "packageLocation": "./.yarn/cache/immediate-npm-3.0.6-c27588a2d3-f9b3486477.zip/node_modules/immediate/",\ - "packageDependencies": [\ - ["immediate", "npm:3.0.6"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["import-fresh", [\ - ["npm:3.3.0", {\ - "packageLocation": "./.yarn/cache/import-fresh-npm-3.3.0-3e34265ca9-2cacfad06e.zip/node_modules/import-fresh/",\ - "packageDependencies": [\ - ["import-fresh", "npm:3.3.0"],\ - ["parent-module", "npm:1.0.1"],\ - ["resolve-from", "npm:4.0.0"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["import-local", [\ - ["npm:3.1.0", {\ - "packageLocation": "./.yarn/cache/import-local-npm-3.1.0-8960af5e51-bfcdb63b5e.zip/node_modules/import-local/",\ - "packageDependencies": [\ - ["import-local", "npm:3.1.0"],\ - ["pkg-dir", "npm:4.2.0"],\ - ["resolve-cwd", "npm:3.0.0"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["imurmurhash", [\ - ["npm:0.1.4", {\ - "packageLocation": "./.yarn/cache/imurmurhash-npm-0.1.4-610c5068a0-7cae75c8cd.zip/node_modules/imurmurhash/",\ - "packageDependencies": [\ - ["imurmurhash", "npm:0.1.4"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["indent-string", [\ - ["npm:4.0.0", {\ - "packageLocation": "./.yarn/cache/indent-string-npm-4.0.0-7b717435b2-824cfb9929.zip/node_modules/indent-string/",\ - "packageDependencies": [\ - ["indent-string", "npm:4.0.0"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["inflight", [\ - ["npm:1.0.6", {\ - "packageLocation": "./.yarn/cache/inflight-npm-1.0.6-ccedb4b908-f4f76aa072.zip/node_modules/inflight/",\ - "packageDependencies": [\ - ["inflight", "npm:1.0.6"],\ - ["once", "npm:1.4.0"],\ - ["wrappy", "npm:1.0.2"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["inherits", [\ - ["npm:2.0.4", {\ - "packageLocation": "./.yarn/cache/inherits-npm-2.0.4-c66b3957a0-4a48a73384.zip/node_modules/inherits/",\ - "packageDependencies": [\ - ["inherits", "npm:2.0.4"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["interpret", [\ - ["npm:3.1.1", {\ - "packageLocation": "./.yarn/cache/interpret-npm-3.1.1-715bac2bd7-35cebcf48c.zip/node_modules/interpret/",\ - "packageDependencies": [\ - ["interpret", "npm:3.1.1"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["ip", [\ - ["npm:2.0.0", {\ - "packageLocation": "./.yarn/cache/ip-npm-2.0.0-204facb3cc-cfcfac6b87.zip/node_modules/ip/",\ - "packageDependencies": [\ - ["ip", "npm:2.0.0"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["is-binary-path", [\ - ["npm:2.1.0", {\ - "packageLocation": "./.yarn/cache/is-binary-path-npm-2.1.0-e61d46f557-84192eb88c.zip/node_modules/is-binary-path/",\ - "packageDependencies": [\ - ["is-binary-path", "npm:2.1.0"],\ - ["binary-extensions", "npm:2.2.0"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["is-core-module", [\ - ["npm:2.12.1", {\ - "packageLocation": "./.yarn/cache/is-core-module-npm-2.12.1-ce74e89160-f04ea30533.zip/node_modules/is-core-module/",\ - "packageDependencies": [\ - ["is-core-module", "npm:2.12.1"],\ - ["has", "npm:1.0.3"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["is-extglob", [\ - ["npm:2.1.1", {\ - "packageLocation": "./.yarn/cache/is-extglob-npm-2.1.1-0870ea68b5-df033653d0.zip/node_modules/is-extglob/",\ - "packageDependencies": [\ - ["is-extglob", "npm:2.1.1"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["is-fullwidth-code-point", [\ - ["npm:3.0.0", {\ - "packageLocation": "./.yarn/cache/is-fullwidth-code-point-npm-3.0.0-1ecf4ebee5-44a30c2945.zip/node_modules/is-fullwidth-code-point/",\ - "packageDependencies": [\ - ["is-fullwidth-code-point", "npm:3.0.0"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["is-glob", [\ - ["npm:4.0.3", {\ - "packageLocation": "./.yarn/cache/is-glob-npm-4.0.3-cb87bf1bdb-d381c1319f.zip/node_modules/is-glob/",\ - "packageDependencies": [\ - ["is-glob", "npm:4.0.3"],\ - ["is-extglob", "npm:2.1.1"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["is-lambda", [\ - ["npm:1.0.1", {\ - "packageLocation": "./.yarn/cache/is-lambda-npm-1.0.1-7ab55bc8a8-93a32f0194.zip/node_modules/is-lambda/",\ - "packageDependencies": [\ - ["is-lambda", "npm:1.0.1"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["is-number", [\ - ["npm:7.0.0", {\ - "packageLocation": "./.yarn/cache/is-number-npm-7.0.0-060086935c-456ac6f8e0.zip/node_modules/is-number/",\ - "packageDependencies": [\ - ["is-number", "npm:7.0.0"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["is-path-inside", [\ - ["npm:3.0.3", {\ - "packageLocation": "./.yarn/cache/is-path-inside-npm-3.0.3-2ea0ef44fd-abd50f0618.zip/node_modules/is-path-inside/",\ - "packageDependencies": [\ - ["is-path-inside", "npm:3.0.3"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["is-plain-obj", [\ - ["npm:2.1.0", {\ - "packageLocation": "./.yarn/cache/is-plain-obj-npm-2.1.0-8dffd7ae9c-cec9100678.zip/node_modules/is-plain-obj/",\ - "packageDependencies": [\ - ["is-plain-obj", "npm:2.1.0"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["is-plain-object", [\ - ["npm:2.0.4", {\ - "packageLocation": "./.yarn/cache/is-plain-object-npm-2.0.4-da3265d804-2a401140cf.zip/node_modules/is-plain-object/",\ - "packageDependencies": [\ - ["is-plain-object", "npm:2.0.4"],\ - ["isobject", "npm:3.0.1"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["is-unicode-supported", [\ - ["npm:0.1.0", {\ - "packageLocation": "./.yarn/cache/is-unicode-supported-npm-0.1.0-0833e1bbfb-a2aab86ee7.zip/node_modules/is-unicode-supported/",\ - "packageDependencies": [\ - ["is-unicode-supported", "npm:0.1.0"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["isarray", [\ - ["npm:1.0.0", {\ - "packageLocation": "./.yarn/cache/isarray-npm-1.0.0-db4f547720-f032df8e02.zip/node_modules/isarray/",\ - "packageDependencies": [\ - ["isarray", "npm:1.0.0"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["isexe", [\ - ["npm:2.0.0", {\ - "packageLocation": "./.yarn/cache/isexe-npm-2.0.0-b58870bd2e-26bf6c5480.zip/node_modules/isexe/",\ - "packageDependencies": [\ - ["isexe", "npm:2.0.0"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["isobject", [\ - ["npm:3.0.1", {\ - "packageLocation": "./.yarn/cache/isobject-npm-3.0.1-8145901fd2-db85c4c970.zip/node_modules/isobject/",\ - "packageDependencies": [\ - ["isobject", "npm:3.0.1"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["jackspeak", [\ - ["npm:2.2.2", {\ - "packageLocation": "./.yarn/cache/jackspeak-npm-2.2.2-374ca454fe-7b1468dd91.zip/node_modules/jackspeak/",\ - "packageDependencies": [\ - ["jackspeak", "npm:2.2.2"],\ - ["@isaacs/cliui", "npm:8.0.2"],\ - ["@pkgjs/parseargs", "npm:0.11.0"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["jest-worker", [\ - ["npm:27.5.1", {\ - "packageLocation": "./.yarn/cache/jest-worker-npm-27.5.1-1c110b5894-98cd68b696.zip/node_modules/jest-worker/",\ - "packageDependencies": [\ - ["jest-worker", "npm:27.5.1"],\ - ["@types/node", "npm:20.4.5"],\ - ["merge-stream", "npm:2.0.0"],\ - ["supports-color", "npm:8.1.1"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["js-yaml", [\ - ["npm:4.1.0", {\ - "packageLocation": "./.yarn/cache/js-yaml-npm-4.1.0-3606f32312-c7830dfd45.zip/node_modules/js-yaml/",\ - "packageDependencies": [\ - ["js-yaml", "npm:4.1.0"],\ - ["argparse", "npm:2.0.1"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["json-parse-even-better-errors", [\ - ["npm:2.3.1", {\ - "packageLocation": "./.yarn/cache/json-parse-even-better-errors-npm-2.3.1-144d62256e-798ed4cf33.zip/node_modules/json-parse-even-better-errors/",\ - "packageDependencies": [\ - ["json-parse-even-better-errors", "npm:2.3.1"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["json-schema-traverse", [\ - ["npm:0.4.1", {\ - "packageLocation": "./.yarn/cache/json-schema-traverse-npm-0.4.1-4759091693-7486074d3b.zip/node_modules/json-schema-traverse/",\ - "packageDependencies": [\ - ["json-schema-traverse", "npm:0.4.1"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["json-stable-stringify-without-jsonify", [\ - ["npm:1.0.1", {\ - "packageLocation": "./.yarn/cache/json-stable-stringify-without-jsonify-npm-1.0.1-b65772b28b-cff44156dd.zip/node_modules/json-stable-stringify-without-jsonify/",\ - "packageDependencies": [\ - ["json-stable-stringify-without-jsonify", "npm:1.0.1"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["jszip", [\ - ["npm:3.10.1", {\ - "packageLocation": "./.yarn/cache/jszip-npm-3.10.1-2862546cfb-abc77bfbe3.zip/node_modules/jszip/",\ - "packageDependencies": [\ - ["jszip", "npm:3.10.1"],\ - ["lie", "npm:3.3.0"],\ - ["pako", "npm:1.0.11"],\ - ["readable-stream", "npm:2.3.8"],\ - ["setimmediate", "npm:1.0.5"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["kind-of", [\ - ["npm:6.0.3", {\ - "packageLocation": "./.yarn/cache/kind-of-npm-6.0.3-ab15f36220-3ab01e7b1d.zip/node_modules/kind-of/",\ - "packageDependencies": [\ - ["kind-of", "npm:6.0.3"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["levn", [\ - ["npm:0.4.1", {\ - "packageLocation": "./.yarn/cache/levn-npm-0.4.1-d183b2d7bb-12c5021c85.zip/node_modules/levn/",\ - "packageDependencies": [\ - ["levn", "npm:0.4.1"],\ - ["prelude-ls", "npm:1.2.1"],\ - ["type-check", "npm:0.4.0"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["lie", [\ - ["npm:3.3.0", {\ - "packageLocation": "./.yarn/cache/lie-npm-3.3.0-35ddd11a4d-33102302cf.zip/node_modules/lie/",\ - "packageDependencies": [\ - ["lie", "npm:3.3.0"],\ - ["immediate", "npm:3.0.6"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["loader-runner", [\ - ["npm:4.3.0", {\ - "packageLocation": "./.yarn/cache/loader-runner-npm-4.3.0-9ca67df372-a90e00dee9.zip/node_modules/loader-runner/",\ - "packageDependencies": [\ - ["loader-runner", "npm:4.3.0"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["locate-path", [\ - ["npm:5.0.0", {\ - "packageLocation": "./.yarn/cache/locate-path-npm-5.0.0-46580c43e4-83e51725e6.zip/node_modules/locate-path/",\ - "packageDependencies": [\ - ["locate-path", "npm:5.0.0"],\ - ["p-locate", "npm:4.1.0"]\ - ],\ - "linkType": "HARD"\ - }],\ - ["npm:6.0.0", {\ - "packageLocation": "./.yarn/cache/locate-path-npm-6.0.0-06a1e4c528-72eb661788.zip/node_modules/locate-path/",\ - "packageDependencies": [\ - ["locate-path", "npm:6.0.0"],\ - ["p-locate", "npm:5.0.0"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["lodash.merge", [\ - ["npm:4.6.2", {\ - "packageLocation": "./.yarn/cache/lodash.merge-npm-4.6.2-77cb4416bf-ad580b4bdb.zip/node_modules/lodash.merge/",\ - "packageDependencies": [\ - ["lodash.merge", "npm:4.6.2"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["log-symbols", [\ - ["npm:4.1.0", {\ - "packageLocation": "./.yarn/cache/log-symbols-npm-4.1.0-0a13492d8b-fce1497b31.zip/node_modules/log-symbols/",\ - "packageDependencies": [\ - ["log-symbols", "npm:4.1.0"],\ - ["chalk", "npm:4.1.2"],\ - ["is-unicode-supported", "npm:0.1.0"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["lru-cache", [\ - ["npm:10.0.0", {\ - "packageLocation": "./.yarn/cache/lru-cache-npm-10.0.0-256d74bb20-18f101675f.zip/node_modules/lru-cache/",\ - "packageDependencies": [\ - ["lru-cache", "npm:10.0.0"]\ - ],\ - "linkType": "HARD"\ - }],\ - ["npm:6.0.0", {\ - "packageLocation": "./.yarn/cache/lru-cache-npm-6.0.0-b4c8668fe1-f97f499f89.zip/node_modules/lru-cache/",\ - "packageDependencies": [\ - ["lru-cache", "npm:6.0.0"],\ - ["yallist", "npm:4.0.0"]\ - ],\ - "linkType": "HARD"\ - }],\ - ["npm:7.18.3", {\ - "packageLocation": "./.yarn/cache/lru-cache-npm-7.18.3-e68be5b11c-e550d77238.zip/node_modules/lru-cache/",\ - "packageDependencies": [\ - ["lru-cache", "npm:7.18.3"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["make-fetch-happen", [\ - ["npm:11.1.1", {\ - "packageLocation": "./.yarn/cache/make-fetch-happen-npm-11.1.1-f32b79aaaa-7268bf274a.zip/node_modules/make-fetch-happen/",\ - "packageDependencies": [\ - ["make-fetch-happen", "npm:11.1.1"],\ - ["agentkeepalive", "npm:4.3.0"],\ - ["cacache", "npm:17.1.3"],\ - ["http-cache-semantics", "npm:4.1.1"],\ - ["http-proxy-agent", "npm:5.0.0"],\ - ["https-proxy-agent", "npm:5.0.1"],\ - ["is-lambda", "npm:1.0.1"],\ - ["lru-cache", "npm:7.18.3"],\ - ["minipass", "npm:5.0.0"],\ - ["minipass-fetch", "npm:3.0.3"],\ - ["minipass-flush", "npm:1.0.5"],\ - ["minipass-pipeline", "npm:1.2.4"],\ - ["negotiator", "npm:0.6.3"],\ - ["promise-retry", "npm:2.0.1"],\ - ["socks-proxy-agent", "npm:7.0.0"],\ - ["ssri", "npm:10.0.4"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["manager", [\ - ["workspace:manager", {\ - "packageLocation": "./manager/",\ - "packageDependencies": [\ - ["manager", "workspace:manager"]\ - ],\ - "linkType": "SOFT"\ - }]\ - ]],\ - ["merge-stream", [\ - ["npm:2.0.0", {\ - "packageLocation": "./.yarn/cache/merge-stream-npm-2.0.0-2ac83efea5-6fa4dcc8d8.zip/node_modules/merge-stream/",\ - "packageDependencies": [\ - ["merge-stream", "npm:2.0.0"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["merge2", [\ - ["npm:1.4.1", {\ - "packageLocation": "./.yarn/cache/merge2-npm-1.4.1-a2507bd06c-7268db63ed.zip/node_modules/merge2/",\ - "packageDependencies": [\ - ["merge2", "npm:1.4.1"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["micromatch", [\ - ["npm:4.0.5", {\ - "packageLocation": "./.yarn/cache/micromatch-npm-4.0.5-cfab5d7669-02a17b671c.zip/node_modules/micromatch/",\ - "packageDependencies": [\ - ["micromatch", "npm:4.0.5"],\ - ["braces", "npm:3.0.2"],\ - ["picomatch", "npm:2.3.1"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["mime-db", [\ - ["npm:1.52.0", {\ - "packageLocation": "./.yarn/cache/mime-db-npm-1.52.0-b5371d6fd2-0d99a03585.zip/node_modules/mime-db/",\ - "packageDependencies": [\ - ["mime-db", "npm:1.52.0"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["mime-types", [\ - ["npm:2.1.35", {\ - "packageLocation": "./.yarn/cache/mime-types-npm-2.1.35-dd9ea9f3e2-89a5b7f1de.zip/node_modules/mime-types/",\ - "packageDependencies": [\ - ["mime-types", "npm:2.1.35"],\ - ["mime-db", "npm:1.52.0"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["minimatch", [\ - ["npm:3.1.2", {\ - "packageLocation": "./.yarn/cache/minimatch-npm-3.1.2-9405269906-c154e56640.zip/node_modules/minimatch/",\ - "packageDependencies": [\ - ["minimatch", "npm:3.1.2"],\ - ["brace-expansion", "npm:1.1.11"]\ - ],\ - "linkType": "HARD"\ - }],\ - ["npm:5.0.1", {\ - "packageLocation": "./.yarn/cache/minimatch-npm-5.0.1-612724f6f0-b34b98463d.zip/node_modules/minimatch/",\ - "packageDependencies": [\ - ["minimatch", "npm:5.0.1"],\ - ["brace-expansion", "npm:2.0.1"]\ - ],\ - "linkType": "HARD"\ - }],\ - ["npm:5.1.6", {\ - "packageLocation": "./.yarn/cache/minimatch-npm-5.1.6-1e71429f4c-7564208ef8.zip/node_modules/minimatch/",\ - "packageDependencies": [\ - ["minimatch", "npm:5.1.6"],\ - ["brace-expansion", "npm:2.0.1"]\ - ],\ - "linkType": "HARD"\ - }],\ - ["npm:9.0.3", {\ - "packageLocation": "./.yarn/cache/minimatch-npm-9.0.3-69d7d6fad5-253487976b.zip/node_modules/minimatch/",\ - "packageDependencies": [\ - ["minimatch", "npm:9.0.3"],\ - ["brace-expansion", "npm:2.0.1"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["minipass", [\ - ["npm:3.3.6", {\ - "packageLocation": "./.yarn/cache/minipass-npm-3.3.6-b8d93a945b-a30d083c80.zip/node_modules/minipass/",\ - "packageDependencies": [\ - ["minipass", "npm:3.3.6"],\ - ["yallist", "npm:4.0.0"]\ - ],\ - "linkType": "HARD"\ - }],\ - ["npm:5.0.0", {\ - "packageLocation": "./.yarn/cache/minipass-npm-5.0.0-c64fb63c92-425dab2887.zip/node_modules/minipass/",\ - "packageDependencies": [\ - ["minipass", "npm:5.0.0"]\ - ],\ - "linkType": "HARD"\ - }],\ - ["npm:7.0.2", {\ - "packageLocation": "./.yarn/cache/minipass-npm-7.0.2-baa42a5a34-46776de732.zip/node_modules/minipass/",\ - "packageDependencies": [\ - ["minipass", "npm:7.0.2"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["minipass-collect", [\ - ["npm:1.0.2", {\ - "packageLocation": "./.yarn/cache/minipass-collect-npm-1.0.2-3b4676eab5-14df761028.zip/node_modules/minipass-collect/",\ - "packageDependencies": [\ - ["minipass-collect", "npm:1.0.2"],\ - ["minipass", "npm:3.3.6"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["minipass-fetch", [\ - ["npm:3.0.3", {\ - "packageLocation": "./.yarn/cache/minipass-fetch-npm-3.0.3-2c4966d142-af5ab2552a.zip/node_modules/minipass-fetch/",\ - "packageDependencies": [\ - ["minipass-fetch", "npm:3.0.3"],\ - ["encoding", "npm:0.1.13"],\ - ["minipass", "npm:5.0.0"],\ - ["minipass-sized", "npm:1.0.3"],\ - ["minizlib", "npm:2.1.2"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["minipass-flush", [\ - ["npm:1.0.5", {\ - "packageLocation": "./.yarn/cache/minipass-flush-npm-1.0.5-efe79d9826-56269a0b22.zip/node_modules/minipass-flush/",\ - "packageDependencies": [\ - ["minipass-flush", "npm:1.0.5"],\ - ["minipass", "npm:3.3.6"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["minipass-pipeline", [\ - ["npm:1.2.4", {\ - "packageLocation": "./.yarn/cache/minipass-pipeline-npm-1.2.4-5924cb077f-b14240dac0.zip/node_modules/minipass-pipeline/",\ - "packageDependencies": [\ - ["minipass-pipeline", "npm:1.2.4"],\ - ["minipass", "npm:3.3.6"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["minipass-sized", [\ - ["npm:1.0.3", {\ - "packageLocation": "./.yarn/cache/minipass-sized-npm-1.0.3-306d86f432-79076749fc.zip/node_modules/minipass-sized/",\ - "packageDependencies": [\ - ["minipass-sized", "npm:1.0.3"],\ - ["minipass", "npm:3.3.6"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["minizlib", [\ - ["npm:2.1.2", {\ - "packageLocation": "./.yarn/cache/minizlib-npm-2.1.2-ea89cd0cfb-f1fdeac0b0.zip/node_modules/minizlib/",\ - "packageDependencies": [\ - ["minizlib", "npm:2.1.2"],\ - ["minipass", "npm:3.3.6"],\ - ["yallist", "npm:4.0.0"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["mkdirp", [\ - ["npm:1.0.4", {\ - "packageLocation": "./.yarn/cache/mkdirp-npm-1.0.4-37f6ef56b9-a96865108c.zip/node_modules/mkdirp/",\ - "packageDependencies": [\ - ["mkdirp", "npm:1.0.4"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["mocha", [\ - ["npm:10.2.0", {\ - "packageLocation": "./.yarn/cache/mocha-npm-10.2.0-87db25c7c5-406c45eab1.zip/node_modules/mocha/",\ - "packageDependencies": [\ - ["mocha", "npm:10.2.0"],\ - ["ansi-colors", "npm:4.1.1"],\ - ["browser-stdout", "npm:1.3.1"],\ - ["chokidar", "npm:3.5.3"],\ - ["debug", "virtual:87db25c7c5e6b25bbc12571091cdabc648b79d427ab445d1714ccfdcdfb3265c9de6561ca760cc3de470037cbedf3af4be56ba3b684b3a1c01d4c9c2fd55a741#npm:4.3.4"],\ - ["diff", "npm:5.0.0"],\ - ["escape-string-regexp", "npm:4.0.0"],\ - ["find-up", "npm:5.0.0"],\ - ["glob", "npm:7.2.0"],\ - ["he", "npm:1.2.0"],\ - ["js-yaml", "npm:4.1.0"],\ - ["log-symbols", "npm:4.1.0"],\ - ["minimatch", "npm:5.0.1"],\ - ["ms", "npm:2.1.3"],\ - ["nanoid", "npm:3.3.3"],\ - ["serialize-javascript", "npm:6.0.0"],\ - ["strip-json-comments", "npm:3.1.1"],\ - ["supports-color", "npm:8.1.1"],\ - ["workerpool", "npm:6.2.1"],\ - ["yargs", "npm:16.2.0"],\ - ["yargs-parser", "npm:20.2.4"],\ - ["yargs-unparser", "npm:2.0.0"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["ms", [\ - ["npm:2.1.2", {\ - "packageLocation": "./.yarn/cache/ms-npm-2.1.2-ec0c1512ff-673cdb2c31.zip/node_modules/ms/",\ - "packageDependencies": [\ - ["ms", "npm:2.1.2"]\ - ],\ - "linkType": "HARD"\ - }],\ - ["npm:2.1.3", {\ - "packageLocation": "./.yarn/cache/ms-npm-2.1.3-81ff3cfac1-aa92de6080.zip/node_modules/ms/",\ - "packageDependencies": [\ - ["ms", "npm:2.1.3"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["nanoid", [\ - ["npm:3.3.3", {\ - "packageLocation": "./.yarn/cache/nanoid-npm-3.3.3-25d865be84-ada019402a.zip/node_modules/nanoid/",\ - "packageDependencies": [\ - ["nanoid", "npm:3.3.3"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["natural-compare", [\ - ["npm:1.4.0", {\ - "packageLocation": "./.yarn/cache/natural-compare-npm-1.4.0-97b75b362d-23ad088b08.zip/node_modules/natural-compare/",\ - "packageDependencies": [\ - ["natural-compare", "npm:1.4.0"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["natural-compare-lite", [\ - ["npm:1.4.0", {\ - "packageLocation": "./.yarn/cache/natural-compare-lite-npm-1.4.0-12b6b308ed-5222ac3986.zip/node_modules/natural-compare-lite/",\ - "packageDependencies": [\ - ["natural-compare-lite", "npm:1.4.0"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["negotiator", [\ - ["npm:0.6.3", {\ - "packageLocation": "./.yarn/cache/negotiator-npm-0.6.3-9d50e36171-b8ffeb1e26.zip/node_modules/negotiator/",\ - "packageDependencies": [\ - ["negotiator", "npm:0.6.3"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["neo-async", [\ - ["npm:2.6.2", {\ - "packageLocation": "./.yarn/cache/neo-async-npm-2.6.2-75d6902586-deac9f8d00.zip/node_modules/neo-async/",\ - "packageDependencies": [\ - ["neo-async", "npm:2.6.2"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["node-gyp", [\ - ["npm:9.4.0", {\ - "packageLocation": "./.yarn/unplugged/node-gyp-npm-9.4.0-ebf5f5573e/node_modules/node-gyp/",\ - "packageDependencies": [\ - ["node-gyp", "npm:9.4.0"],\ - ["env-paths", "npm:2.2.1"],\ - ["exponential-backoff", "npm:3.1.1"],\ - ["glob", "npm:7.2.3"],\ - ["graceful-fs", "npm:4.2.11"],\ - ["make-fetch-happen", "npm:11.1.1"],\ - ["nopt", "npm:6.0.0"],\ - ["npmlog", "npm:6.0.2"],\ - ["rimraf", "npm:3.0.2"],\ - ["semver", "npm:7.5.4"],\ - ["tar", "npm:6.1.15"],\ - ["which", "npm:2.0.2"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["node-releases", [\ - ["npm:2.0.13", {\ - "packageLocation": "./.yarn/cache/node-releases-npm-2.0.13-1f2e177887-17ec8f315d.zip/node_modules/node-releases/",\ - "packageDependencies": [\ - ["node-releases", "npm:2.0.13"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["nopt", [\ - ["npm:6.0.0", {\ - "packageLocation": "./.yarn/cache/nopt-npm-6.0.0-5ea8050815-82149371f8.zip/node_modules/nopt/",\ - "packageDependencies": [\ - ["nopt", "npm:6.0.0"],\ - ["abbrev", "npm:1.1.1"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["normalize-path", [\ - ["npm:3.0.0", {\ - "packageLocation": "./.yarn/cache/normalize-path-npm-3.0.0-658ba7d77f-88eeb4da89.zip/node_modules/normalize-path/",\ - "packageDependencies": [\ - ["normalize-path", "npm:3.0.0"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["npmlog", [\ - ["npm:6.0.2", {\ - "packageLocation": "./.yarn/cache/npmlog-npm-6.0.2-e0e69455c7-ae238cd264.zip/node_modules/npmlog/",\ - "packageDependencies": [\ - ["npmlog", "npm:6.0.2"],\ - ["are-we-there-yet", "npm:3.0.1"],\ - ["console-control-strings", "npm:1.1.0"],\ - ["gauge", "npm:4.0.4"],\ - ["set-blocking", "npm:2.0.0"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["once", [\ - ["npm:1.4.0", {\ - "packageLocation": "./.yarn/cache/once-npm-1.4.0-ccf03ef07a-cd0a885013.zip/node_modules/once/",\ - "packageDependencies": [\ - ["once", "npm:1.4.0"],\ - ["wrappy", "npm:1.0.2"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["optionator", [\ - ["npm:0.9.3", {\ - "packageLocation": "./.yarn/cache/optionator-npm-0.9.3-56c3a4bf80-0928199944.zip/node_modules/optionator/",\ - "packageDependencies": [\ - ["optionator", "npm:0.9.3"],\ - ["@aashutoshrathi/word-wrap", "npm:1.2.6"],\ - ["deep-is", "npm:0.1.4"],\ - ["fast-levenshtein", "npm:2.0.6"],\ - ["levn", "npm:0.4.1"],\ - ["prelude-ls", "npm:1.2.1"],\ - ["type-check", "npm:0.4.0"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["p-limit", [\ - ["npm:2.3.0", {\ - "packageLocation": "./.yarn/cache/p-limit-npm-2.3.0-94a0310039-84ff17f1a3.zip/node_modules/p-limit/",\ - "packageDependencies": [\ - ["p-limit", "npm:2.3.0"],\ - ["p-try", "npm:2.2.0"]\ - ],\ - "linkType": "HARD"\ - }],\ - ["npm:3.1.0", {\ - "packageLocation": "./.yarn/cache/p-limit-npm-3.1.0-05d2ede37f-7c3690c4db.zip/node_modules/p-limit/",\ - "packageDependencies": [\ - ["p-limit", "npm:3.1.0"],\ - ["yocto-queue", "npm:0.1.0"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["p-locate", [\ - ["npm:4.1.0", {\ - "packageLocation": "./.yarn/cache/p-locate-npm-4.1.0-eec6872537-513bd14a45.zip/node_modules/p-locate/",\ - "packageDependencies": [\ - ["p-locate", "npm:4.1.0"],\ - ["p-limit", "npm:2.3.0"]\ - ],\ - "linkType": "HARD"\ - }],\ - ["npm:5.0.0", {\ - "packageLocation": "./.yarn/cache/p-locate-npm-5.0.0-92cc7c7a3e-1623088f36.zip/node_modules/p-locate/",\ - "packageDependencies": [\ - ["p-locate", "npm:5.0.0"],\ - ["p-limit", "npm:3.1.0"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["p-map", [\ - ["npm:4.0.0", {\ - "packageLocation": "./.yarn/cache/p-map-npm-4.0.0-4677ae07c7-cb0ab21ec0.zip/node_modules/p-map/",\ - "packageDependencies": [\ - ["p-map", "npm:4.0.0"],\ - ["aggregate-error", "npm:3.1.0"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["p-try", [\ - ["npm:2.2.0", {\ - "packageLocation": "./.yarn/cache/p-try-npm-2.2.0-e0390dbaf8-f8a8e9a769.zip/node_modules/p-try/",\ - "packageDependencies": [\ - ["p-try", "npm:2.2.0"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["pako", [\ - ["npm:1.0.11", {\ - "packageLocation": "./.yarn/cache/pako-npm-1.0.11-b8f1b69d3e-1be2bfa1f8.zip/node_modules/pako/",\ - "packageDependencies": [\ - ["pako", "npm:1.0.11"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["parent-module", [\ - ["npm:1.0.1", {\ - "packageLocation": "./.yarn/cache/parent-module-npm-1.0.1-1fae11b095-6ba8b25514.zip/node_modules/parent-module/",\ - "packageDependencies": [\ - ["parent-module", "npm:1.0.1"],\ - ["callsites", "npm:3.1.0"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["path-exists", [\ - ["npm:4.0.0", {\ - "packageLocation": "./.yarn/cache/path-exists-npm-4.0.0-e9e4f63eb0-505807199d.zip/node_modules/path-exists/",\ - "packageDependencies": [\ - ["path-exists", "npm:4.0.0"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["path-is-absolute", [\ - ["npm:1.0.1", {\ - "packageLocation": "./.yarn/cache/path-is-absolute-npm-1.0.1-31bc695ffd-060840f92c.zip/node_modules/path-is-absolute/",\ - "packageDependencies": [\ - ["path-is-absolute", "npm:1.0.1"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["path-key", [\ - ["npm:3.1.1", {\ - "packageLocation": "./.yarn/cache/path-key-npm-3.1.1-0e66ea8321-55cd7a9dd4.zip/node_modules/path-key/",\ - "packageDependencies": [\ - ["path-key", "npm:3.1.1"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["path-parse", [\ - ["npm:1.0.7", {\ - "packageLocation": "./.yarn/cache/path-parse-npm-1.0.7-09564527b7-49abf3d811.zip/node_modules/path-parse/",\ - "packageDependencies": [\ - ["path-parse", "npm:1.0.7"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["path-scurry", [\ - ["npm:1.10.1", {\ - "packageLocation": "./.yarn/cache/path-scurry-npm-1.10.1-52bd946f2e-e2557cff3a.zip/node_modules/path-scurry/",\ - "packageDependencies": [\ - ["path-scurry", "npm:1.10.1"],\ - ["lru-cache", "npm:10.0.0"],\ - ["minipass", "npm:7.0.2"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["path-type", [\ - ["npm:4.0.0", {\ - "packageLocation": "./.yarn/cache/path-type-npm-4.0.0-10d47fc86a-5b1e2daa24.zip/node_modules/path-type/",\ - "packageDependencies": [\ - ["path-type", "npm:4.0.0"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["picocolors", [\ - ["npm:1.0.0", {\ - "packageLocation": "./.yarn/cache/picocolors-npm-1.0.0-d81e0b1927-a2e8092dd8.zip/node_modules/picocolors/",\ - "packageDependencies": [\ - ["picocolors", "npm:1.0.0"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["picomatch", [\ - ["npm:2.3.1", {\ - "packageLocation": "./.yarn/cache/picomatch-npm-2.3.1-c782cfd986-050c865ce8.zip/node_modules/picomatch/",\ - "packageDependencies": [\ - ["picomatch", "npm:2.3.1"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["pkg-dir", [\ - ["npm:4.2.0", {\ - "packageLocation": "./.yarn/cache/pkg-dir-npm-4.2.0-2b5d0a8d32-9863e3f351.zip/node_modules/pkg-dir/",\ - "packageDependencies": [\ - ["pkg-dir", "npm:4.2.0"],\ - ["find-up", "npm:4.1.0"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["prelude-ls", [\ - ["npm:1.2.1", {\ - "packageLocation": "./.yarn/cache/prelude-ls-npm-1.2.1-3e4d272a55-cd192ec0d0.zip/node_modules/prelude-ls/",\ - "packageDependencies": [\ - ["prelude-ls", "npm:1.2.1"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["prettier", [\ - ["npm:3.0.0", {\ - "packageLocation": "./.yarn/cache/prettier-npm-3.0.0-7ffbcce680-6a832876a1.zip/node_modules/prettier/",\ - "packageDependencies": [\ - ["prettier", "npm:3.0.0"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["process-nextick-args", [\ - ["npm:2.0.1", {\ - "packageLocation": "./.yarn/cache/process-nextick-args-npm-2.0.1-b8d7971609-1d38588e52.zip/node_modules/process-nextick-args/",\ - "packageDependencies": [\ - ["process-nextick-args", "npm:2.0.1"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["promise-retry", [\ - ["npm:2.0.1", {\ - "packageLocation": "./.yarn/cache/promise-retry-npm-2.0.1-871f0b01b7-f96a3f6d90.zip/node_modules/promise-retry/",\ - "packageDependencies": [\ - ["promise-retry", "npm:2.0.1"],\ - ["err-code", "npm:2.0.3"],\ - ["retry", "npm:0.12.0"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["punycode", [\ - ["npm:2.3.0", {\ - "packageLocation": "./.yarn/cache/punycode-npm-2.3.0-df4bdce06b-39f760e09a.zip/node_modules/punycode/",\ - "packageDependencies": [\ - ["punycode", "npm:2.3.0"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["queue-microtask", [\ - ["npm:1.2.3", {\ - "packageLocation": "./.yarn/cache/queue-microtask-npm-1.2.3-fcc98e4e2d-b676f8c040.zip/node_modules/queue-microtask/",\ - "packageDependencies": [\ - ["queue-microtask", "npm:1.2.3"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["randombytes", [\ - ["npm:2.1.0", {\ - "packageLocation": "./.yarn/cache/randombytes-npm-2.1.0-e3da76bccf-d779499376.zip/node_modules/randombytes/",\ + ["eslint-visitor-keys", [\ + ["npm:3.4.2", {\ + "packageLocation": "./.yarn/cache/eslint-visitor-keys-npm-3.4.2-304459f972-9e0e7e4aae.zip/node_modules/eslint-visitor-keys/",\ "packageDependencies": [\ - ["randombytes", "npm:2.1.0"],\ - ["safe-buffer", "npm:5.2.1"]\ + ["eslint-visitor-keys", "npm:3.4.2"]\ ],\ "linkType": "HARD"\ }]\ ]],\ - ["readable-stream", [\ - ["npm:2.3.8", {\ - "packageLocation": "./.yarn/cache/readable-stream-npm-2.3.8-67a94c2cb1-6564546703.zip/node_modules/readable-stream/",\ - "packageDependencies": [\ - ["readable-stream", "npm:2.3.8"],\ - ["core-util-is", "npm:1.0.3"],\ - ["inherits", "npm:2.0.4"],\ - ["isarray", "npm:1.0.0"],\ - ["process-nextick-args", "npm:2.0.1"],\ - ["safe-buffer", "npm:5.1.2"],\ - ["string_decoder", "npm:1.1.1"],\ - ["util-deprecate", "npm:1.0.2"]\ - ],\ - "linkType": "HARD"\ - }],\ - ["npm:3.6.2", {\ - "packageLocation": "./.yarn/cache/readable-stream-npm-3.6.2-d2a6069158-bdcbe6c22e.zip/node_modules/readable-stream/",\ + ["espree", [\ + ["npm:9.6.1", {\ + "packageLocation": "./.yarn/cache/espree-npm-9.6.1-a50722a5a9-eb8c149c7a.zip/node_modules/espree/",\ "packageDependencies": [\ - ["readable-stream", "npm:3.6.2"],\ - ["inherits", "npm:2.0.4"],\ - ["string_decoder", "npm:1.3.0"],\ - ["util-deprecate", "npm:1.0.2"]\ + ["espree", "npm:9.6.1"],\ + ["acorn", "npm:8.10.0"],\ + ["acorn-jsx", "virtual:a50722a5a9326b6a5f12350c494c4db3aa0f4caeac45e3e9e5fe071da20014ecfe738fe2ebe2c9c98abae81a4ea86b42f56d776b3bd5ec37f9ad3670c242b242#npm:5.3.2"],\ + ["eslint-visitor-keys", "npm:3.4.2"]\ ],\ "linkType": "HARD"\ }]\ ]],\ - ["readdirp", [\ - ["npm:3.6.0", {\ - "packageLocation": "./.yarn/cache/readdirp-npm-3.6.0-f950cc74ab-1ced032e6e.zip/node_modules/readdirp/",\ + ["esquery", [\ + ["npm:1.5.0", {\ + "packageLocation": "./.yarn/cache/esquery-npm-1.5.0-d8f8a06879-aefb0d2596.zip/node_modules/esquery/",\ "packageDependencies": [\ - ["readdirp", "npm:3.6.0"],\ - ["picomatch", "npm:2.3.1"]\ + ["esquery", "npm:1.5.0"],\ + ["estraverse", "npm:5.3.0"]\ ],\ "linkType": "HARD"\ }]\ ]],\ - ["rechoir", [\ - ["npm:0.8.0", {\ - "packageLocation": "./.yarn/cache/rechoir-npm-0.8.0-fb660b3bc8-ad3caed8af.zip/node_modules/rechoir/",\ + ["esrecurse", [\ + ["npm:4.3.0", {\ + "packageLocation": "./.yarn/cache/esrecurse-npm-4.3.0-10b86a887a-ebc17b1a33.zip/node_modules/esrecurse/",\ "packageDependencies": [\ - ["rechoir", "npm:0.8.0"],\ - ["resolve", "patch:resolve@npm%3A1.22.3#~builtin::version=1.22.3&hash=c3c19d"]\ + ["esrecurse", "npm:4.3.0"],\ + ["estraverse", "npm:5.3.0"]\ ],\ "linkType": "HARD"\ }]\ ]],\ - ["require-directory", [\ - ["npm:2.1.1", {\ - "packageLocation": "./.yarn/cache/require-directory-npm-2.1.1-8608aee50b-fb47e70bf0.zip/node_modules/require-directory/",\ + ["estraverse", [\ + ["npm:5.3.0", {\ + "packageLocation": "./.yarn/cache/estraverse-npm-5.3.0-03284f8f63-072780882d.zip/node_modules/estraverse/",\ "packageDependencies": [\ - ["require-directory", "npm:2.1.1"]\ + ["estraverse", "npm:5.3.0"]\ ],\ "linkType": "HARD"\ }]\ ]],\ - ["resolve", [\ - ["patch:resolve@npm%3A1.22.3#~builtin::version=1.22.3&hash=c3c19d", {\ - "packageLocation": "./.yarn/cache/resolve-patch-bb62d3c3c5-ad59734723.zip/node_modules/resolve/",\ + ["esutils", [\ + ["npm:2.0.3", {\ + "packageLocation": "./.yarn/cache/esutils-npm-2.0.3-f865beafd5-22b5b08f74.zip/node_modules/esutils/",\ "packageDependencies": [\ - ["resolve", "patch:resolve@npm%3A1.22.3#~builtin::version=1.22.3&hash=c3c19d"],\ - ["is-core-module", "npm:2.12.1"],\ - ["path-parse", "npm:1.0.7"],\ - ["supports-preserve-symlinks-flag", "npm:1.0.0"]\ + ["esutils", "npm:2.0.3"]\ ],\ "linkType": "HARD"\ }]\ ]],\ - ["resolve-cwd", [\ - ["npm:3.0.0", {\ - "packageLocation": "./.yarn/cache/resolve-cwd-npm-3.0.0-e6f4e296bf-546e081601.zip/node_modules/resolve-cwd/",\ + ["fast-deep-equal", [\ + ["npm:3.1.3", {\ + "packageLocation": "./.yarn/cache/fast-deep-equal-npm-3.1.3-790edcfcf5-e21a9d8d84.zip/node_modules/fast-deep-equal/",\ "packageDependencies": [\ - ["resolve-cwd", "npm:3.0.0"],\ - ["resolve-from", "npm:5.0.0"]\ + ["fast-deep-equal", "npm:3.1.3"]\ ],\ "linkType": "HARD"\ }]\ ]],\ - ["resolve-from", [\ - ["npm:4.0.0", {\ - "packageLocation": "./.yarn/cache/resolve-from-npm-4.0.0-f758ec21bf-f4ba0b8494.zip/node_modules/resolve-from/",\ - "packageDependencies": [\ - ["resolve-from", "npm:4.0.0"]\ - ],\ - "linkType": "HARD"\ - }],\ - ["npm:5.0.0", {\ - "packageLocation": "./.yarn/cache/resolve-from-npm-5.0.0-15c9db4d33-4ceeb9113e.zip/node_modules/resolve-from/",\ + ["fast-json-stable-stringify", [\ + ["npm:2.1.0", {\ + "packageLocation": "./.yarn/cache/fast-json-stable-stringify-npm-2.1.0-02e8905fda-b191531e36.zip/node_modules/fast-json-stable-stringify/",\ "packageDependencies": [\ - ["resolve-from", "npm:5.0.0"]\ + ["fast-json-stable-stringify", "npm:2.1.0"]\ ],\ "linkType": "HARD"\ }]\ ]],\ - ["retry", [\ - ["npm:0.12.0", {\ - "packageLocation": "./.yarn/cache/retry-npm-0.12.0-72ac7fb4cc-623bd7d2e5.zip/node_modules/retry/",\ + ["fast-levenshtein", [\ + ["npm:2.0.6", {\ + "packageLocation": "./.yarn/cache/fast-levenshtein-npm-2.0.6-fcd74b8df5-92cfec0a8d.zip/node_modules/fast-levenshtein/",\ "packageDependencies": [\ - ["retry", "npm:0.12.0"]\ + ["fast-levenshtein", "npm:2.0.6"]\ ],\ "linkType": "HARD"\ }]\ ]],\ - ["reusify", [\ - ["npm:1.0.4", {\ - "packageLocation": "./.yarn/cache/reusify-npm-1.0.4-95ac4aec11-c3076ebcc2.zip/node_modules/reusify/",\ + ["fastq", [\ + ["npm:1.15.0", {\ + "packageLocation": "./.yarn/cache/fastq-npm-1.15.0-1013f6514e-0170e6bfcd.zip/node_modules/fastq/",\ "packageDependencies": [\ + ["fastq", "npm:1.15.0"],\ ["reusify", "npm:1.0.4"]\ ],\ "linkType": "HARD"\ }]\ ]],\ - ["rimraf", [\ - ["npm:3.0.2", {\ - "packageLocation": "./.yarn/cache/rimraf-npm-3.0.2-2cb7dac69a-87f4164e39.zip/node_modules/rimraf/",\ + ["file-entry-cache", [\ + ["npm:6.0.1", {\ + "packageLocation": "./.yarn/cache/file-entry-cache-npm-6.0.1-31965cf0af-f49701feaa.zip/node_modules/file-entry-cache/",\ "packageDependencies": [\ - ["rimraf", "npm:3.0.2"],\ - ["glob", "npm:7.2.3"]\ + ["file-entry-cache", "npm:6.0.1"],\ + ["flat-cache", "npm:3.0.4"]\ ],\ "linkType": "HARD"\ }]\ ]],\ - ["run-parallel", [\ - ["npm:1.2.0", {\ - "packageLocation": "./.yarn/cache/run-parallel-npm-1.2.0-3f47ff2034-cb4f97ad25.zip/node_modules/run-parallel/",\ + ["find-up", [\ + ["npm:5.0.0", {\ + "packageLocation": "./.yarn/cache/find-up-npm-5.0.0-e03e9b796d-07955e3573.zip/node_modules/find-up/",\ "packageDependencies": [\ - ["run-parallel", "npm:1.2.0"],\ - ["queue-microtask", "npm:1.2.3"]\ + ["find-up", "npm:5.0.0"],\ + ["locate-path", "npm:6.0.0"],\ + ["path-exists", "npm:4.0.0"]\ ],\ "linkType": "HARD"\ }]\ ]],\ - ["safe-buffer", [\ - ["npm:5.1.2", {\ - "packageLocation": "./.yarn/cache/safe-buffer-npm-5.1.2-c27fedf6c4-f2f1f7943c.zip/node_modules/safe-buffer/",\ - "packageDependencies": [\ - ["safe-buffer", "npm:5.1.2"]\ - ],\ - "linkType": "HARD"\ - }],\ - ["npm:5.2.1", {\ - "packageLocation": "./.yarn/cache/safe-buffer-npm-5.2.1-3481c8aa9b-b99c4b41fd.zip/node_modules/safe-buffer/",\ + ["flat-cache", [\ + ["npm:3.0.4", {\ + "packageLocation": "./.yarn/cache/flat-cache-npm-3.0.4-ee77e5911e-4fdd10ecbc.zip/node_modules/flat-cache/",\ "packageDependencies": [\ - ["safe-buffer", "npm:5.2.1"]\ + ["flat-cache", "npm:3.0.4"],\ + ["flatted", "npm:3.2.7"],\ + ["rimraf", "npm:3.0.2"]\ ],\ "linkType": "HARD"\ }]\ ]],\ - ["safer-buffer", [\ - ["npm:2.1.2", {\ - "packageLocation": "./.yarn/cache/safer-buffer-npm-2.1.2-8d5c0b705e-cab8f25ae6.zip/node_modules/safer-buffer/",\ + ["flatted", [\ + ["npm:3.2.7", {\ + "packageLocation": "./.yarn/cache/flatted-npm-3.2.7-0da10b7c56-427633049d.zip/node_modules/flatted/",\ "packageDependencies": [\ - ["safer-buffer", "npm:2.1.2"]\ + ["flatted", "npm:3.2.7"]\ ],\ "linkType": "HARD"\ }]\ ]],\ - ["schema-utils", [\ - ["npm:3.3.0", {\ - "packageLocation": "./.yarn/cache/schema-utils-npm-3.3.0-f2b36937f1-ea56971926.zip/node_modules/schema-utils/",\ + ["fs.realpath", [\ + ["npm:1.0.0", {\ + "packageLocation": "./.yarn/cache/fs.realpath-npm-1.0.0-c8f05d8126-99ddea01a7.zip/node_modules/fs.realpath/",\ "packageDependencies": [\ - ["schema-utils", "npm:3.3.0"],\ - ["@types/json-schema", "npm:7.0.12"],\ - ["ajv", "npm:6.12.6"],\ - ["ajv-keywords", "virtual:f2b36937f163b579815d3163513b3330d7a31aaf0599eea66346382b8838395c613f4204e9809cc2ff6bba09c17ab0c34b37deadcb147de7e2f5e535d6ccc245#npm:3.5.2"]\ + ["fs.realpath", "npm:1.0.0"]\ ],\ "linkType": "HARD"\ }]\ ]],\ - ["semver", [\ - ["npm:7.5.4", {\ - "packageLocation": "./.yarn/cache/semver-npm-7.5.4-c4ad957fcd-12d8ad952f.zip/node_modules/semver/",\ + ["glob", [\ + ["npm:7.2.3", {\ + "packageLocation": "./.yarn/cache/glob-npm-7.2.3-2d866d17a5-29452e97b3.zip/node_modules/glob/",\ "packageDependencies": [\ - ["semver", "npm:7.5.4"],\ - ["lru-cache", "npm:6.0.0"]\ + ["glob", "npm:7.2.3"],\ + ["fs.realpath", "npm:1.0.0"],\ + ["inflight", "npm:1.0.6"],\ + ["inherits", "npm:2.0.4"],\ + ["minimatch", "npm:3.1.2"],\ + ["once", "npm:1.4.0"],\ + ["path-is-absolute", "npm:1.0.1"]\ ],\ "linkType": "HARD"\ }]\ ]],\ - ["serialize-javascript", [\ - ["npm:6.0.0", {\ - "packageLocation": "./.yarn/cache/serialize-javascript-npm-6.0.0-0bb8a3c88d-56f90b562a.zip/node_modules/serialize-javascript/",\ - "packageDependencies": [\ - ["serialize-javascript", "npm:6.0.0"],\ - ["randombytes", "npm:2.1.0"]\ - ],\ - "linkType": "HARD"\ - }],\ - ["npm:6.0.1", {\ - "packageLocation": "./.yarn/cache/serialize-javascript-npm-6.0.1-fac87289ed-3c4f4cb61d.zip/node_modules/serialize-javascript/",\ + ["glob-parent", [\ + ["npm:6.0.2", {\ + "packageLocation": "./.yarn/cache/glob-parent-npm-6.0.2-2cbef12738-c13ee97978.zip/node_modules/glob-parent/",\ "packageDependencies": [\ - ["serialize-javascript", "npm:6.0.1"],\ - ["randombytes", "npm:2.1.0"]\ + ["glob-parent", "npm:6.0.2"],\ + ["is-glob", "npm:4.0.3"]\ ],\ "linkType": "HARD"\ }]\ ]],\ - ["set-blocking", [\ - ["npm:2.0.0", {\ - "packageLocation": "./.yarn/cache/set-blocking-npm-2.0.0-49e2cffa24-6e65a05f7c.zip/node_modules/set-blocking/",\ + ["globals", [\ + ["npm:13.20.0", {\ + "packageLocation": "./.yarn/cache/globals-npm-13.20.0-4565a722e7-ad1ecf914b.zip/node_modules/globals/",\ "packageDependencies": [\ - ["set-blocking", "npm:2.0.0"]\ + ["globals", "npm:13.20.0"],\ + ["type-fest", "npm:0.20.2"]\ ],\ "linkType": "HARD"\ }]\ ]],\ - ["setimmediate", [\ - ["npm:1.0.5", {\ - "packageLocation": "./.yarn/cache/setimmediate-npm-1.0.5-54587459b6-c9a6f2c5b5.zip/node_modules/setimmediate/",\ + ["graphemer", [\ + ["npm:1.4.0", {\ + "packageLocation": "./.yarn/cache/graphemer-npm-1.4.0-0627732d35-bab8f0be9b.zip/node_modules/graphemer/",\ "packageDependencies": [\ - ["setimmediate", "npm:1.0.5"]\ + ["graphemer", "npm:1.4.0"]\ ],\ "linkType": "HARD"\ }]\ ]],\ - ["shallow-clone", [\ - ["npm:3.0.1", {\ - "packageLocation": "./.yarn/cache/shallow-clone-npm-3.0.1-dab5873d0d-39b3dd9630.zip/node_modules/shallow-clone/",\ + ["has-flag", [\ + ["npm:4.0.0", {\ + "packageLocation": "./.yarn/cache/has-flag-npm-4.0.0-32af9f0536-261a135703.zip/node_modules/has-flag/",\ "packageDependencies": [\ - ["shallow-clone", "npm:3.0.1"],\ - ["kind-of", "npm:6.0.3"]\ + ["has-flag", "npm:4.0.0"]\ ],\ "linkType": "HARD"\ }]\ ]],\ - ["shebang-command", [\ - ["npm:2.0.0", {\ - "packageLocation": "./.yarn/cache/shebang-command-npm-2.0.0-eb2b01921d-6b52fe8727.zip/node_modules/shebang-command/",\ + ["husky", [\ + ["npm:8.0.3", {\ + "packageLocation": "./.yarn/cache/husky-npm-8.0.3-b0b59c5127-837bc7e441.zip/node_modules/husky/",\ "packageDependencies": [\ - ["shebang-command", "npm:2.0.0"],\ - ["shebang-regex", "npm:3.0.0"]\ + ["husky", "npm:8.0.3"]\ ],\ "linkType": "HARD"\ }]\ ]],\ - ["shebang-regex", [\ - ["npm:3.0.0", {\ - "packageLocation": "./.yarn/cache/shebang-regex-npm-3.0.0-899a0cd65e-1a2bcae50d.zip/node_modules/shebang-regex/",\ + ["ignore", [\ + ["npm:5.2.4", {\ + "packageLocation": "./.yarn/cache/ignore-npm-5.2.4-fbe6e989e5-3d4c309c60.zip/node_modules/ignore/",\ "packageDependencies": [\ - ["shebang-regex", "npm:3.0.0"]\ + ["ignore", "npm:5.2.4"]\ ],\ "linkType": "HARD"\ }]\ ]],\ - ["signal-exit", [\ - ["npm:3.0.7", {\ - "packageLocation": "./.yarn/cache/signal-exit-npm-3.0.7-bd270458a3-a2f098f247.zip/node_modules/signal-exit/",\ - "packageDependencies": [\ - ["signal-exit", "npm:3.0.7"]\ - ],\ - "linkType": "HARD"\ - }],\ - ["npm:4.1.0", {\ - "packageLocation": "./.yarn/cache/signal-exit-npm-4.1.0-61fb957687-64c757b498.zip/node_modules/signal-exit/",\ + ["import-fresh", [\ + ["npm:3.3.0", {\ + "packageLocation": "./.yarn/cache/import-fresh-npm-3.3.0-3e34265ca9-2cacfad06e.zip/node_modules/import-fresh/",\ "packageDependencies": [\ - ["signal-exit", "npm:4.1.0"]\ + ["import-fresh", "npm:3.3.0"],\ + ["parent-module", "npm:1.0.1"],\ + ["resolve-from", "npm:4.0.0"]\ ],\ "linkType": "HARD"\ }]\ ]],\ - ["slash", [\ - ["npm:3.0.0", {\ - "packageLocation": "./.yarn/cache/slash-npm-3.0.0-b87de2279a-94a93fff61.zip/node_modules/slash/",\ + ["imurmurhash", [\ + ["npm:0.1.4", {\ + "packageLocation": "./.yarn/cache/imurmurhash-npm-0.1.4-610c5068a0-7cae75c8cd.zip/node_modules/imurmurhash/",\ "packageDependencies": [\ - ["slash", "npm:3.0.0"]\ + ["imurmurhash", "npm:0.1.4"]\ ],\ "linkType": "HARD"\ }]\ ]],\ - ["smart-buffer", [\ - ["npm:4.2.0", {\ - "packageLocation": "./.yarn/cache/smart-buffer-npm-4.2.0-5ac3f668bb-b5167a7142.zip/node_modules/smart-buffer/",\ + ["inflight", [\ + ["npm:1.0.6", {\ + "packageLocation": "./.yarn/cache/inflight-npm-1.0.6-ccedb4b908-f4f76aa072.zip/node_modules/inflight/",\ "packageDependencies": [\ - ["smart-buffer", "npm:4.2.0"]\ + ["inflight", "npm:1.0.6"],\ + ["once", "npm:1.4.0"],\ + ["wrappy", "npm:1.0.2"]\ ],\ "linkType": "HARD"\ }]\ ]],\ - ["socks", [\ - ["npm:2.7.1", {\ - "packageLocation": "./.yarn/cache/socks-npm-2.7.1-17f2b53052-259d9e3e8e.zip/node_modules/socks/",\ + ["inherits", [\ + ["npm:2.0.4", {\ + "packageLocation": "./.yarn/cache/inherits-npm-2.0.4-c66b3957a0-4a48a73384.zip/node_modules/inherits/",\ "packageDependencies": [\ - ["socks", "npm:2.7.1"],\ - ["ip", "npm:2.0.0"],\ - ["smart-buffer", "npm:4.2.0"]\ + ["inherits", "npm:2.0.4"]\ ],\ "linkType": "HARD"\ }]\ ]],\ - ["socks-proxy-agent", [\ - ["npm:7.0.0", {\ - "packageLocation": "./.yarn/cache/socks-proxy-agent-npm-7.0.0-7aacf32ea0-7205543701.zip/node_modules/socks-proxy-agent/",\ + ["is-extglob", [\ + ["npm:2.1.1", {\ + "packageLocation": "./.yarn/cache/is-extglob-npm-2.1.1-0870ea68b5-df033653d0.zip/node_modules/is-extglob/",\ "packageDependencies": [\ - ["socks-proxy-agent", "npm:7.0.0"],\ - ["agent-base", "npm:6.0.2"],\ - ["debug", "virtual:ced87d94ab05a28b44536eb0cd61a9458e757a0ae7bb35e5ab5d27e03d08b996abd275928b29aad2eb0973d5bb0800e75ba8ca3e26bf62cbe8ea0fae8cca70a8#npm:4.3.4"],\ - ["socks", "npm:2.7.1"]\ + ["is-extglob", "npm:2.1.1"]\ ],\ "linkType": "HARD"\ }]\ ]],\ - ["source-map", [\ - ["npm:0.6.1", {\ - "packageLocation": "./.yarn/cache/source-map-npm-0.6.1-1a3621db16-59ce8640cf.zip/node_modules/source-map/",\ + ["is-glob", [\ + ["npm:4.0.3", {\ + "packageLocation": "./.yarn/cache/is-glob-npm-4.0.3-cb87bf1bdb-d381c1319f.zip/node_modules/is-glob/",\ "packageDependencies": [\ - ["source-map", "npm:0.6.1"]\ + ["is-glob", "npm:4.0.3"],\ + ["is-extglob", "npm:2.1.1"]\ ],\ "linkType": "HARD"\ }]\ ]],\ - ["source-map-support", [\ - ["npm:0.5.21", {\ - "packageLocation": "./.yarn/cache/source-map-support-npm-0.5.21-09ca99e250-43e98d700d.zip/node_modules/source-map-support/",\ + ["is-path-inside", [\ + ["npm:3.0.3", {\ + "packageLocation": "./.yarn/cache/is-path-inside-npm-3.0.3-2ea0ef44fd-abd50f0618.zip/node_modules/is-path-inside/",\ "packageDependencies": [\ - ["source-map-support", "npm:0.5.21"],\ - ["buffer-from", "npm:1.1.2"],\ - ["source-map", "npm:0.6.1"]\ + ["is-path-inside", "npm:3.0.3"]\ ],\ "linkType": "HARD"\ }]\ ]],\ - ["ssri", [\ - ["npm:10.0.4", {\ - "packageLocation": "./.yarn/cache/ssri-npm-10.0.4-f583dafaf3-fb14da9f8a.zip/node_modules/ssri/",\ + ["isexe", [\ + ["npm:2.0.0", {\ + "packageLocation": "./.yarn/cache/isexe-npm-2.0.0-b58870bd2e-26bf6c5480.zip/node_modules/isexe/",\ "packageDependencies": [\ - ["ssri", "npm:10.0.4"],\ - ["minipass", "npm:5.0.0"]\ + ["isexe", "npm:2.0.0"]\ ],\ "linkType": "HARD"\ }]\ ]],\ - ["string-width", [\ - ["npm:4.2.3", {\ - "packageLocation": "./.yarn/cache/string-width-npm-4.2.3-2c27177bae-e52c10dc3f.zip/node_modules/string-width/",\ - "packageDependencies": [\ - ["string-width", "npm:4.2.3"],\ - ["emoji-regex", "npm:8.0.0"],\ - ["is-fullwidth-code-point", "npm:3.0.0"],\ - ["strip-ansi", "npm:6.0.1"]\ - ],\ - "linkType": "HARD"\ - }],\ - ["npm:5.1.2", {\ - "packageLocation": "./.yarn/cache/string-width-npm-5.1.2-bf60531341-7369deaa29.zip/node_modules/string-width/",\ + ["js-yaml", [\ + ["npm:4.1.0", {\ + "packageLocation": "./.yarn/cache/js-yaml-npm-4.1.0-3606f32312-c7830dfd45.zip/node_modules/js-yaml/",\ "packageDependencies": [\ - ["string-width", "npm:5.1.2"],\ - ["eastasianwidth", "npm:0.2.0"],\ - ["emoji-regex", "npm:9.2.2"],\ - ["strip-ansi", "npm:7.1.0"]\ + ["js-yaml", "npm:4.1.0"],\ + ["argparse", "npm:2.0.1"]\ ],\ "linkType": "HARD"\ }]\ ]],\ - ["string_decoder", [\ - ["npm:1.1.1", {\ - "packageLocation": "./.yarn/cache/string_decoder-npm-1.1.1-e46a6c1353-9ab7e56f9d.zip/node_modules/string_decoder/",\ - "packageDependencies": [\ - ["string_decoder", "npm:1.1.1"],\ - ["safe-buffer", "npm:5.1.2"]\ - ],\ - "linkType": "HARD"\ - }],\ - ["npm:1.3.0", {\ - "packageLocation": "./.yarn/cache/string_decoder-npm-1.3.0-2422117fd0-8417646695.zip/node_modules/string_decoder/",\ + ["json-schema-traverse", [\ + ["npm:0.4.1", {\ + "packageLocation": "./.yarn/cache/json-schema-traverse-npm-0.4.1-4759091693-7486074d3b.zip/node_modules/json-schema-traverse/",\ "packageDependencies": [\ - ["string_decoder", "npm:1.3.0"],\ - ["safe-buffer", "npm:5.2.1"]\ + ["json-schema-traverse", "npm:0.4.1"]\ ],\ "linkType": "HARD"\ }]\ ]],\ - ["strip-ansi", [\ - ["npm:6.0.1", {\ - "packageLocation": "./.yarn/cache/strip-ansi-npm-6.0.1-caddc7cb40-f3cd25890a.zip/node_modules/strip-ansi/",\ - "packageDependencies": [\ - ["strip-ansi", "npm:6.0.1"],\ - ["ansi-regex", "npm:5.0.1"]\ - ],\ - "linkType": "HARD"\ - }],\ - ["npm:7.1.0", {\ - "packageLocation": "./.yarn/cache/strip-ansi-npm-7.1.0-7453b80b79-859c73fcf2.zip/node_modules/strip-ansi/",\ + ["json-stable-stringify-without-jsonify", [\ + ["npm:1.0.1", {\ + "packageLocation": "./.yarn/cache/json-stable-stringify-without-jsonify-npm-1.0.1-b65772b28b-cff44156dd.zip/node_modules/json-stable-stringify-without-jsonify/",\ "packageDependencies": [\ - ["strip-ansi", "npm:7.1.0"],\ - ["ansi-regex", "npm:6.0.1"]\ + ["json-stable-stringify-without-jsonify", "npm:1.0.1"]\ ],\ "linkType": "HARD"\ }]\ ]],\ - ["strip-json-comments", [\ - ["npm:3.1.1", {\ - "packageLocation": "./.yarn/cache/strip-json-comments-npm-3.1.1-dcb2324823-492f73e272.zip/node_modules/strip-json-comments/",\ + ["levn", [\ + ["npm:0.4.1", {\ + "packageLocation": "./.yarn/cache/levn-npm-0.4.1-d183b2d7bb-12c5021c85.zip/node_modules/levn/",\ "packageDependencies": [\ - ["strip-json-comments", "npm:3.1.1"]\ + ["levn", "npm:0.4.1"],\ + ["prelude-ls", "npm:1.2.1"],\ + ["type-check", "npm:0.4.0"]\ ],\ "linkType": "HARD"\ }]\ ]],\ - ["supports-color", [\ - ["npm:7.2.0", {\ - "packageLocation": "./.yarn/cache/supports-color-npm-7.2.0-606bfcf7da-3dda818de0.zip/node_modules/supports-color/",\ + ["locate-path", [\ + ["npm:6.0.0", {\ + "packageLocation": "./.yarn/cache/locate-path-npm-6.0.0-06a1e4c528-72eb661788.zip/node_modules/locate-path/",\ "packageDependencies": [\ - ["supports-color", "npm:7.2.0"],\ - ["has-flag", "npm:4.0.0"]\ + ["locate-path", "npm:6.0.0"],\ + ["p-locate", "npm:5.0.0"]\ ],\ "linkType": "HARD"\ - }],\ - ["npm:8.1.1", {\ - "packageLocation": "./.yarn/cache/supports-color-npm-8.1.1-289e937149-c052193a7e.zip/node_modules/supports-color/",\ + }]\ + ]],\ + ["lodash.merge", [\ + ["npm:4.6.2", {\ + "packageLocation": "./.yarn/cache/lodash.merge-npm-4.6.2-77cb4416bf-ad580b4bdb.zip/node_modules/lodash.merge/",\ "packageDependencies": [\ - ["supports-color", "npm:8.1.1"],\ - ["has-flag", "npm:4.0.0"]\ + ["lodash.merge", "npm:4.6.2"]\ ],\ "linkType": "HARD"\ }]\ ]],\ - ["supports-preserve-symlinks-flag", [\ - ["npm:1.0.0", {\ - "packageLocation": "./.yarn/cache/supports-preserve-symlinks-flag-npm-1.0.0-f17c4d0028-53b1e247e6.zip/node_modules/supports-preserve-symlinks-flag/",\ + ["minimatch", [\ + ["npm:3.1.2", {\ + "packageLocation": "./.yarn/cache/minimatch-npm-3.1.2-9405269906-c154e56640.zip/node_modules/minimatch/",\ "packageDependencies": [\ - ["supports-preserve-symlinks-flag", "npm:1.0.0"]\ + ["minimatch", "npm:3.1.2"],\ + ["brace-expansion", "npm:1.1.11"]\ ],\ "linkType": "HARD"\ }]\ ]],\ - ["tapable", [\ - ["npm:2.2.1", {\ - "packageLocation": "./.yarn/cache/tapable-npm-2.2.1-8cf5ff3039-3b7a1b4d86.zip/node_modules/tapable/",\ + ["ms", [\ + ["npm:2.1.2", {\ + "packageLocation": "./.yarn/cache/ms-npm-2.1.2-ec0c1512ff-673cdb2c31.zip/node_modules/ms/",\ "packageDependencies": [\ - ["tapable", "npm:2.2.1"]\ + ["ms", "npm:2.1.2"]\ ],\ "linkType": "HARD"\ }]\ ]],\ - ["tar", [\ - ["npm:6.1.15", {\ - "packageLocation": "./.yarn/cache/tar-npm-6.1.15-44c3e71720-f23832fcee.zip/node_modules/tar/",\ + ["natural-compare", [\ + ["npm:1.4.0", {\ + "packageLocation": "./.yarn/cache/natural-compare-npm-1.4.0-97b75b362d-23ad088b08.zip/node_modules/natural-compare/",\ "packageDependencies": [\ - ["tar", "npm:6.1.15"],\ - ["chownr", "npm:2.0.0"],\ - ["fs-minipass", "npm:2.1.0"],\ - ["minipass", "npm:5.0.0"],\ - ["minizlib", "npm:2.1.2"],\ - ["mkdirp", "npm:1.0.4"],\ - ["yallist", "npm:4.0.0"]\ + ["natural-compare", "npm:1.4.0"]\ ],\ "linkType": "HARD"\ }]\ ]],\ - ["terser", [\ - ["npm:5.19.2", {\ - "packageLocation": "./.yarn/cache/terser-npm-5.19.2-91391d2f00-e059177775.zip/node_modules/terser/",\ + ["once", [\ + ["npm:1.4.0", {\ + "packageLocation": "./.yarn/cache/once-npm-1.4.0-ccf03ef07a-cd0a885013.zip/node_modules/once/",\ "packageDependencies": [\ - ["terser", "npm:5.19.2"],\ - ["@jridgewell/source-map", "npm:0.3.5"],\ - ["acorn", "npm:8.10.0"],\ - ["commander", "npm:2.20.3"],\ - ["source-map-support", "npm:0.5.21"]\ + ["once", "npm:1.4.0"],\ + ["wrappy", "npm:1.0.2"]\ ],\ "linkType": "HARD"\ }]\ ]],\ - ["terser-webpack-plugin", [\ - ["npm:5.3.9", {\ - "packageLocation": "./.yarn/cache/terser-webpack-plugin-npm-5.3.9-7ba1eb45f4-41705713d6.zip/node_modules/terser-webpack-plugin/",\ - "packageDependencies": [\ - ["terser-webpack-plugin", "npm:5.3.9"]\ - ],\ - "linkType": "SOFT"\ - }],\ - ["virtual:b6bfc672b303c71b5d5814a280178845b040765d1c845e72583b43793cc2d012f6a05337605eb54a3df63863a6a2c58aa0756b0dbc78097799d81600669a675a#npm:5.3.9", {\ - "packageLocation": "./.yarn/__virtual__/terser-webpack-plugin-virtual-8ca572db14/0/cache/terser-webpack-plugin-npm-5.3.9-7ba1eb45f4-41705713d6.zip/node_modules/terser-webpack-plugin/",\ + ["optionator", [\ + ["npm:0.9.3", {\ + "packageLocation": "./.yarn/cache/optionator-npm-0.9.3-56c3a4bf80-0928199944.zip/node_modules/optionator/",\ "packageDependencies": [\ - ["terser-webpack-plugin", "virtual:b6bfc672b303c71b5d5814a280178845b040765d1c845e72583b43793cc2d012f6a05337605eb54a3df63863a6a2c58aa0756b0dbc78097799d81600669a675a#npm:5.3.9"],\ - ["@jridgewell/trace-mapping", "npm:0.3.18"],\ - ["@swc/core", null],\ - ["@types/esbuild", null],\ - ["@types/swc__core", null],\ - ["@types/uglify-js", null],\ - ["@types/webpack", null],\ - ["esbuild", null],\ - ["jest-worker", "npm:27.5.1"],\ - ["schema-utils", "npm:3.3.0"],\ - ["serialize-javascript", "npm:6.0.1"],\ - ["terser", "npm:5.19.2"],\ - ["uglify-js", null],\ - ["webpack", "virtual:1ca5ffe7bd50eeef98202150e5e82f61f0cd48370e28be026fb583fb2f7a661646940189809f3c41a31e7fa741840d72885f5ba9590a9d578183b22f2ea105b5#npm:5.88.2"]\ - ],\ - "packagePeers": [\ - "@swc/core",\ - "@types/esbuild",\ - "@types/swc__core",\ - "@types/uglify-js",\ - "@types/webpack",\ - "esbuild",\ - "uglify-js",\ - "webpack"\ + ["optionator", "npm:0.9.3"],\ + ["@aashutoshrathi/word-wrap", "npm:1.2.6"],\ + ["deep-is", "npm:0.1.4"],\ + ["fast-levenshtein", "npm:2.0.6"],\ + ["levn", "npm:0.4.1"],\ + ["prelude-ls", "npm:1.2.1"],\ + ["type-check", "npm:0.4.0"]\ ],\ "linkType": "HARD"\ }]\ ]],\ - ["test-project-architecture", [\ + ["osmium", [\ ["workspace:.", {\ "packageLocation": "./",\ "packageDependencies": [\ - ["test-project-architecture", "workspace:."],\ + ["osmium", "workspace:."],\ ["husky", "npm:8.0.3"]\ ],\ "linkType": "SOFT"\ }]\ ]],\ - ["text-table", [\ - ["npm:0.2.0", {\ - "packageLocation": "./.yarn/cache/text-table-npm-0.2.0-d92a778b59-b6937a38c8.zip/node_modules/text-table/",\ + ["osmium-manager", [\ + ["workspace:manager", {\ + "packageLocation": "./manager/",\ "packageDependencies": [\ - ["text-table", "npm:0.2.0"]\ + ["osmium-manager", "workspace:manager"]\ ],\ - "linkType": "HARD"\ + "linkType": "SOFT"\ }]\ ]],\ - ["to-regex-range", [\ - ["npm:5.0.1", {\ - "packageLocation": "./.yarn/cache/to-regex-range-npm-5.0.1-f1e8263b00-f76fa01b3d.zip/node_modules/to-regex-range/",\ + ["osmium-solidity-lsp", [\ + ["workspace:toolchains/solidity/lsp", {\ + "packageLocation": "./toolchains/solidity/lsp/",\ "packageDependencies": [\ - ["to-regex-range", "npm:5.0.1"],\ - ["is-number", "npm:7.0.0"]\ + ["osmium-solidity-lsp", "workspace:toolchains/solidity/lsp"]\ ],\ - "linkType": "HARD"\ + "linkType": "SOFT"\ }]\ ]],\ - ["ts-loader", [\ - ["npm:9.4.4", {\ - "packageLocation": "./.yarn/cache/ts-loader-npm-9.4.4-f7a7993559-8e5e6b839b.zip/node_modules/ts-loader/",\ + ["osmium-solidity-toolchain", [\ + ["workspace:toolchains/solidity", {\ + "packageLocation": "./toolchains/solidity/",\ "packageDependencies": [\ - ["ts-loader", "npm:9.4.4"]\ + ["osmium-solidity-toolchain", "workspace:toolchains/solidity"]\ ],\ "linkType": "SOFT"\ - }],\ - ["virtual:1ca5ffe7bd50eeef98202150e5e82f61f0cd48370e28be026fb583fb2f7a661646940189809f3c41a31e7fa741840d72885f5ba9590a9d578183b22f2ea105b5#npm:9.4.4", {\ - "packageLocation": "./.yarn/__virtual__/ts-loader-virtual-d07bfefd0e/0/cache/ts-loader-npm-9.4.4-f7a7993559-8e5e6b839b.zip/node_modules/ts-loader/",\ - "packageDependencies": [\ - ["ts-loader", "virtual:1ca5ffe7bd50eeef98202150e5e82f61f0cd48370e28be026fb583fb2f7a661646940189809f3c41a31e7fa741840d72885f5ba9590a9d578183b22f2ea105b5#npm:9.4.4"],\ - ["@types/typescript", null],\ - ["@types/webpack", null],\ - ["chalk", "npm:4.1.2"],\ - ["enhanced-resolve", "npm:5.15.0"],\ - ["micromatch", "npm:4.0.5"],\ - ["semver", "npm:7.5.4"],\ - ["typescript", "patch:typescript@npm%3A5.1.6#~builtin::version=5.1.6&hash=5da071"],\ - ["webpack", "virtual:1ca5ffe7bd50eeef98202150e5e82f61f0cd48370e28be026fb583fb2f7a661646940189809f3c41a31e7fa741840d72885f5ba9590a9d578183b22f2ea105b5#npm:5.88.2"]\ - ],\ - "packagePeers": [\ - "@types/typescript",\ - "@types/webpack",\ - "typescript",\ - "webpack"\ - ],\ - "linkType": "HARD"\ }]\ ]],\ - ["tslib", [\ - ["npm:1.14.1", {\ - "packageLocation": "./.yarn/cache/tslib-npm-1.14.1-102499115e-dbe628ef87.zip/node_modules/tslib/",\ + ["p-limit", [\ + ["npm:3.1.0", {\ + "packageLocation": "./.yarn/cache/p-limit-npm-3.1.0-05d2ede37f-7c3690c4db.zip/node_modules/p-limit/",\ "packageDependencies": [\ - ["tslib", "npm:1.14.1"]\ + ["p-limit", "npm:3.1.0"],\ + ["yocto-queue", "npm:0.1.0"]\ ],\ "linkType": "HARD"\ }]\ ]],\ - ["tsutils", [\ - ["npm:3.21.0", {\ - "packageLocation": "./.yarn/cache/tsutils-npm-3.21.0-347e6636c5-1843f4c1b2.zip/node_modules/tsutils/",\ - "packageDependencies": [\ - ["tsutils", "npm:3.21.0"]\ - ],\ - "linkType": "SOFT"\ - }],\ - ["virtual:86306585622eaa558a7935143680436b12bcb983114f7f1e70b7a6cbe6b1a02edb5147e3f11f9ac3d79c4e3a3a61b09dfa72db122a5134072ca645ab9675155a#npm:3.21.0", {\ - "packageLocation": "./.yarn/__virtual__/tsutils-virtual-eda6dd3d2c/0/cache/tsutils-npm-3.21.0-347e6636c5-1843f4c1b2.zip/node_modules/tsutils/",\ - "packageDependencies": [\ - ["tsutils", "virtual:86306585622eaa558a7935143680436b12bcb983114f7f1e70b7a6cbe6b1a02edb5147e3f11f9ac3d79c4e3a3a61b09dfa72db122a5134072ca645ab9675155a#npm:3.21.0"],\ - ["@types/typescript", null],\ - ["tslib", "npm:1.14.1"],\ - ["typescript", "patch:typescript@npm%3A5.1.6#~builtin::version=5.1.6&hash=5da071"]\ - ],\ - "packagePeers": [\ - "@types/typescript",\ - "typescript"\ - ],\ - "linkType": "HARD"\ - }],\ - ["virtual:e1b3efbf2a363ce342c579e38d131acc33dc687f2696b030f8279ed649898433c42f766540f5e6287f9f5bcbc5a841d763d4d4c167d089350eb01afdc8aadfdd#npm:3.21.0", {\ - "packageLocation": "./.yarn/__virtual__/tsutils-virtual-5be896342d/0/cache/tsutils-npm-3.21.0-347e6636c5-1843f4c1b2.zip/node_modules/tsutils/",\ + ["p-locate", [\ + ["npm:5.0.0", {\ + "packageLocation": "./.yarn/cache/p-locate-npm-5.0.0-92cc7c7a3e-1623088f36.zip/node_modules/p-locate/",\ "packageDependencies": [\ - ["tsutils", "virtual:e1b3efbf2a363ce342c579e38d131acc33dc687f2696b030f8279ed649898433c42f766540f5e6287f9f5bcbc5a841d763d4d4c167d089350eb01afdc8aadfdd#npm:3.21.0"],\ - ["@types/typescript", null],\ - ["tslib", "npm:1.14.1"],\ - ["typescript", null]\ - ],\ - "packagePeers": [\ - "@types/typescript",\ - "typescript"\ + ["p-locate", "npm:5.0.0"],\ + ["p-limit", "npm:3.1.0"]\ ],\ "linkType": "HARD"\ }]\ ]],\ - ["type-check", [\ - ["npm:0.4.0", {\ - "packageLocation": "./.yarn/cache/type-check-npm-0.4.0-60565800ce-ec688ebfc9.zip/node_modules/type-check/",\ + ["parent-module", [\ + ["npm:1.0.1", {\ + "packageLocation": "./.yarn/cache/parent-module-npm-1.0.1-1fae11b095-6ba8b25514.zip/node_modules/parent-module/",\ "packageDependencies": [\ - ["type-check", "npm:0.4.0"],\ - ["prelude-ls", "npm:1.2.1"]\ + ["parent-module", "npm:1.0.1"],\ + ["callsites", "npm:3.1.0"]\ ],\ "linkType": "HARD"\ }]\ ]],\ - ["type-fest", [\ - ["npm:0.20.2", {\ - "packageLocation": "./.yarn/cache/type-fest-npm-0.20.2-b36432617f-4fb3272df2.zip/node_modules/type-fest/",\ + ["path-exists", [\ + ["npm:4.0.0", {\ + "packageLocation": "./.yarn/cache/path-exists-npm-4.0.0-e9e4f63eb0-505807199d.zip/node_modules/path-exists/",\ "packageDependencies": [\ - ["type-fest", "npm:0.20.2"]\ + ["path-exists", "npm:4.0.0"]\ ],\ "linkType": "HARD"\ }]\ ]],\ - ["typescript", [\ - ["patch:typescript@npm%3A5.1.6#~builtin::version=5.1.6&hash=5da071", {\ - "packageLocation": "./.yarn/cache/typescript-patch-bd21d74a9d-f53bfe97f7.zip/node_modules/typescript/",\ + ["path-is-absolute", [\ + ["npm:1.0.1", {\ + "packageLocation": "./.yarn/cache/path-is-absolute-npm-1.0.1-31bc695ffd-060840f92c.zip/node_modules/path-is-absolute/",\ "packageDependencies": [\ - ["typescript", "patch:typescript@npm%3A5.1.6#~builtin::version=5.1.6&hash=5da071"]\ + ["path-is-absolute", "npm:1.0.1"]\ ],\ "linkType": "HARD"\ }]\ ]],\ - ["unique-filename", [\ - ["npm:3.0.0", {\ - "packageLocation": "./.yarn/cache/unique-filename-npm-3.0.0-77d68e0a45-8e2f59b356.zip/node_modules/unique-filename/",\ + ["path-key", [\ + ["npm:3.1.1", {\ + "packageLocation": "./.yarn/cache/path-key-npm-3.1.1-0e66ea8321-55cd7a9dd4.zip/node_modules/path-key/",\ "packageDependencies": [\ - ["unique-filename", "npm:3.0.0"],\ - ["unique-slug", "npm:4.0.0"]\ + ["path-key", "npm:3.1.1"]\ ],\ "linkType": "HARD"\ }]\ ]],\ - ["unique-slug", [\ - ["npm:4.0.0", {\ - "packageLocation": "./.yarn/cache/unique-slug-npm-4.0.0-e6b08f28aa-0884b58365.zip/node_modules/unique-slug/",\ + ["prelude-ls", [\ + ["npm:1.2.1", {\ + "packageLocation": "./.yarn/cache/prelude-ls-npm-1.2.1-3e4d272a55-cd192ec0d0.zip/node_modules/prelude-ls/",\ "packageDependencies": [\ - ["unique-slug", "npm:4.0.0"],\ - ["imurmurhash", "npm:0.1.4"]\ + ["prelude-ls", "npm:1.2.1"]\ ],\ "linkType": "HARD"\ }]\ ]],\ - ["update-browserslist-db", [\ - ["npm:1.0.11", {\ - "packageLocation": "./.yarn/cache/update-browserslist-db-npm-1.0.11-2c8e64258f-b98327518f.zip/node_modules/update-browserslist-db/",\ - "packageDependencies": [\ - ["update-browserslist-db", "npm:1.0.11"]\ - ],\ - "linkType": "SOFT"\ - }],\ - ["virtual:e2170a875bba2f8fa9e93e47c65f2f250097e101a59d95ea6fd852f32965e8cd6cef3b5662aa7295279d5bc60c9a612ddb8515c7dd1b7e8fb9984dee1823e7d6#npm:1.0.11", {\ - "packageLocation": "./.yarn/__virtual__/update-browserslist-db-virtual-e6fb63e03d/0/cache/update-browserslist-db-npm-1.0.11-2c8e64258f-b98327518f.zip/node_modules/update-browserslist-db/",\ + ["prettier", [\ + ["npm:3.0.0", {\ + "packageLocation": "./.yarn/cache/prettier-npm-3.0.0-7ffbcce680-6a832876a1.zip/node_modules/prettier/",\ "packageDependencies": [\ - ["update-browserslist-db", "virtual:e2170a875bba2f8fa9e93e47c65f2f250097e101a59d95ea6fd852f32965e8cd6cef3b5662aa7295279d5bc60c9a612ddb8515c7dd1b7e8fb9984dee1823e7d6#npm:1.0.11"],\ - ["@types/browserslist", null],\ - ["browserslist", "npm:4.21.10"],\ - ["escalade", "npm:3.1.1"],\ - ["picocolors", "npm:1.0.0"]\ - ],\ - "packagePeers": [\ - "@types/browserslist",\ - "browserslist"\ + ["prettier", "npm:3.0.0"]\ ],\ "linkType": "HARD"\ }]\ ]],\ - ["uri-js", [\ - ["npm:4.4.1", {\ - "packageLocation": "./.yarn/cache/uri-js-npm-4.4.1-66d11cbcaf-7167432de6.zip/node_modules/uri-js/",\ + ["punycode", [\ + ["npm:2.3.0", {\ + "packageLocation": "./.yarn/cache/punycode-npm-2.3.0-df4bdce06b-39f760e09a.zip/node_modules/punycode/",\ "packageDependencies": [\ - ["uri-js", "npm:4.4.1"],\ ["punycode", "npm:2.3.0"]\ ],\ "linkType": "HARD"\ }]\ ]],\ - ["util-deprecate", [\ - ["npm:1.0.2", {\ - "packageLocation": "./.yarn/cache/util-deprecate-npm-1.0.2-e3fe1a219c-474acf1146.zip/node_modules/util-deprecate/",\ - "packageDependencies": [\ - ["util-deprecate", "npm:1.0.2"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["watchpack", [\ - ["npm:2.4.0", {\ - "packageLocation": "./.yarn/cache/watchpack-npm-2.4.0-7ec4b9cc65-23d4bc5863.zip/node_modules/watchpack/",\ + ["queue-microtask", [\ + ["npm:1.2.3", {\ + "packageLocation": "./.yarn/cache/queue-microtask-npm-1.2.3-fcc98e4e2d-b676f8c040.zip/node_modules/queue-microtask/",\ "packageDependencies": [\ - ["watchpack", "npm:2.4.0"],\ - ["glob-to-regexp", "npm:0.4.1"],\ - ["graceful-fs", "npm:4.2.11"]\ + ["queue-microtask", "npm:1.2.3"]\ ],\ "linkType": "HARD"\ }]\ ]],\ - ["webpack", [\ - ["npm:5.88.2", {\ - "packageLocation": "./.yarn/cache/webpack-npm-5.88.2-38717ace6f-79476a782d.zip/node_modules/webpack/",\ - "packageDependencies": [\ - ["webpack", "npm:5.88.2"]\ - ],\ - "linkType": "SOFT"\ - }],\ - ["virtual:1ca5ffe7bd50eeef98202150e5e82f61f0cd48370e28be026fb583fb2f7a661646940189809f3c41a31e7fa741840d72885f5ba9590a9d578183b22f2ea105b5#npm:5.88.2", {\ - "packageLocation": "./.yarn/__virtual__/webpack-virtual-b6bfc672b3/0/cache/webpack-npm-5.88.2-38717ace6f-79476a782d.zip/node_modules/webpack/",\ + ["resolve-from", [\ + ["npm:4.0.0", {\ + "packageLocation": "./.yarn/cache/resolve-from-npm-4.0.0-f758ec21bf-f4ba0b8494.zip/node_modules/resolve-from/",\ "packageDependencies": [\ - ["webpack", "virtual:1ca5ffe7bd50eeef98202150e5e82f61f0cd48370e28be026fb583fb2f7a661646940189809f3c41a31e7fa741840d72885f5ba9590a9d578183b22f2ea105b5#npm:5.88.2"],\ - ["@types/eslint-scope", "npm:3.7.4"],\ - ["@types/estree", "npm:1.0.1"],\ - ["@types/webpack-cli", null],\ - ["@webassemblyjs/ast", "npm:1.11.6"],\ - ["@webassemblyjs/wasm-edit", "npm:1.11.6"],\ - ["@webassemblyjs/wasm-parser", "npm:1.11.6"],\ - ["acorn", "npm:8.10.0"],\ - ["acorn-import-assertions", "virtual:b6bfc672b303c71b5d5814a280178845b040765d1c845e72583b43793cc2d012f6a05337605eb54a3df63863a6a2c58aa0756b0dbc78097799d81600669a675a#npm:1.9.0"],\ - ["browserslist", "npm:4.21.10"],\ - ["chrome-trace-event", "npm:1.0.3"],\ - ["enhanced-resolve", "npm:5.15.0"],\ - ["es-module-lexer", "npm:1.3.0"],\ - ["eslint-scope", "npm:5.1.1"],\ - ["events", "npm:3.3.0"],\ - ["glob-to-regexp", "npm:0.4.1"],\ - ["graceful-fs", "npm:4.2.11"],\ - ["json-parse-even-better-errors", "npm:2.3.1"],\ - ["loader-runner", "npm:4.3.0"],\ - ["mime-types", "npm:2.1.35"],\ - ["neo-async", "npm:2.6.2"],\ - ["schema-utils", "npm:3.3.0"],\ - ["tapable", "npm:2.2.1"],\ - ["terser-webpack-plugin", "virtual:b6bfc672b303c71b5d5814a280178845b040765d1c845e72583b43793cc2d012f6a05337605eb54a3df63863a6a2c58aa0756b0dbc78097799d81600669a675a#npm:5.3.9"],\ - ["watchpack", "npm:2.4.0"],\ - ["webpack-cli", "virtual:1ca5ffe7bd50eeef98202150e5e82f61f0cd48370e28be026fb583fb2f7a661646940189809f3c41a31e7fa741840d72885f5ba9590a9d578183b22f2ea105b5#npm:5.1.4"],\ - ["webpack-sources", "npm:3.2.3"]\ - ],\ - "packagePeers": [\ - "@types/webpack-cli",\ - "webpack-cli"\ + ["resolve-from", "npm:4.0.0"]\ ],\ "linkType": "HARD"\ }]\ ]],\ - ["webpack-cli", [\ - ["npm:5.1.4", {\ - "packageLocation": "./.yarn/cache/webpack-cli-npm-5.1.4-7be5b53b38-3a4ad0d034.zip/node_modules/webpack-cli/",\ - "packageDependencies": [\ - ["webpack-cli", "npm:5.1.4"]\ - ],\ - "linkType": "SOFT"\ - }],\ - ["virtual:1ca5ffe7bd50eeef98202150e5e82f61f0cd48370e28be026fb583fb2f7a661646940189809f3c41a31e7fa741840d72885f5ba9590a9d578183b22f2ea105b5#npm:5.1.4", {\ - "packageLocation": "./.yarn/__virtual__/webpack-cli-virtual-e797243e4a/0/cache/webpack-cli-npm-5.1.4-7be5b53b38-3a4ad0d034.zip/node_modules/webpack-cli/",\ + ["reusify", [\ + ["npm:1.0.4", {\ + "packageLocation": "./.yarn/cache/reusify-npm-1.0.4-95ac4aec11-c3076ebcc2.zip/node_modules/reusify/",\ "packageDependencies": [\ - ["webpack-cli", "virtual:1ca5ffe7bd50eeef98202150e5e82f61f0cd48370e28be026fb583fb2f7a661646940189809f3c41a31e7fa741840d72885f5ba9590a9d578183b22f2ea105b5#npm:5.1.4"],\ - ["@discoveryjs/json-ext", "npm:0.5.7"],\ - ["@types/webpack", null],\ - ["@types/webpack-bundle-analyzer", null],\ - ["@types/webpack-cli__generators", null],\ - ["@types/webpack-dev-server", null],\ - ["@webpack-cli/configtest", "virtual:e797243e4a0090f0f0b78c3ae107e9934ef77ae19f7a9263059d446ab98f3c6c587cd4057de32bf6173e21c30f45852b89da5a717a575720c8bfb5f721456d5f#npm:2.1.1"],\ - ["@webpack-cli/generators", null],\ - ["@webpack-cli/info", "virtual:e797243e4a0090f0f0b78c3ae107e9934ef77ae19f7a9263059d446ab98f3c6c587cd4057de32bf6173e21c30f45852b89da5a717a575720c8bfb5f721456d5f#npm:2.0.2"],\ - ["@webpack-cli/serve", "virtual:e797243e4a0090f0f0b78c3ae107e9934ef77ae19f7a9263059d446ab98f3c6c587cd4057de32bf6173e21c30f45852b89da5a717a575720c8bfb5f721456d5f#npm:2.0.5"],\ - ["colorette", "npm:2.0.20"],\ - ["commander", "npm:10.0.1"],\ - ["cross-spawn", "npm:7.0.3"],\ - ["envinfo", "npm:7.10.0"],\ - ["fastest-levenshtein", "npm:1.0.16"],\ - ["import-local", "npm:3.1.0"],\ - ["interpret", "npm:3.1.1"],\ - ["rechoir", "npm:0.8.0"],\ - ["webpack", "virtual:1ca5ffe7bd50eeef98202150e5e82f61f0cd48370e28be026fb583fb2f7a661646940189809f3c41a31e7fa741840d72885f5ba9590a9d578183b22f2ea105b5#npm:5.88.2"],\ - ["webpack-bundle-analyzer", null],\ - ["webpack-dev-server", null],\ - ["webpack-merge", "npm:5.9.0"]\ - ],\ - "packagePeers": [\ - "@types/webpack-bundle-analyzer",\ - "@types/webpack-cli__generators",\ - "@types/webpack-dev-server",\ - "@types/webpack",\ - "@webpack-cli/generators",\ - "webpack-bundle-analyzer",\ - "webpack-dev-server",\ - "webpack"\ + ["reusify", "npm:1.0.4"]\ ],\ "linkType": "HARD"\ }]\ ]],\ - ["webpack-merge", [\ - ["npm:5.9.0", {\ - "packageLocation": "./.yarn/cache/webpack-merge-npm-5.9.0-9110e650de-64fe2c23aa.zip/node_modules/webpack-merge/",\ + ["rimraf", [\ + ["npm:3.0.2", {\ + "packageLocation": "./.yarn/cache/rimraf-npm-3.0.2-2cb7dac69a-87f4164e39.zip/node_modules/rimraf/",\ "packageDependencies": [\ - ["webpack-merge", "npm:5.9.0"],\ - ["clone-deep", "npm:4.0.1"],\ - ["wildcard", "npm:2.0.1"]\ + ["rimraf", "npm:3.0.2"],\ + ["glob", "npm:7.2.3"]\ ],\ "linkType": "HARD"\ }]\ ]],\ - ["webpack-sources", [\ - ["npm:3.2.3", {\ - "packageLocation": "./.yarn/cache/webpack-sources-npm-3.2.3-6bfb5d9563-989e401b9f.zip/node_modules/webpack-sources/",\ + ["run-parallel", [\ + ["npm:1.2.0", {\ + "packageLocation": "./.yarn/cache/run-parallel-npm-1.2.0-3f47ff2034-cb4f97ad25.zip/node_modules/run-parallel/",\ "packageDependencies": [\ - ["webpack-sources", "npm:3.2.3"]\ + ["run-parallel", "npm:1.2.0"],\ + ["queue-microtask", "npm:1.2.3"]\ ],\ "linkType": "HARD"\ }]\ ]],\ - ["which", [\ - ["npm:2.0.2", {\ - "packageLocation": "./.yarn/cache/which-npm-2.0.2-320ddf72f7-1a5c563d3c.zip/node_modules/which/",\ + ["shebang-command", [\ + ["npm:2.0.0", {\ + "packageLocation": "./.yarn/cache/shebang-command-npm-2.0.0-eb2b01921d-6b52fe8727.zip/node_modules/shebang-command/",\ "packageDependencies": [\ - ["which", "npm:2.0.2"],\ - ["isexe", "npm:2.0.0"]\ + ["shebang-command", "npm:2.0.0"],\ + ["shebang-regex", "npm:3.0.0"]\ ],\ "linkType": "HARD"\ }]\ ]],\ - ["wide-align", [\ - ["npm:1.1.5", {\ - "packageLocation": "./.yarn/cache/wide-align-npm-1.1.5-889d77e592-d5fc37cd56.zip/node_modules/wide-align/",\ + ["shebang-regex", [\ + ["npm:3.0.0", {\ + "packageLocation": "./.yarn/cache/shebang-regex-npm-3.0.0-899a0cd65e-1a2bcae50d.zip/node_modules/shebang-regex/",\ "packageDependencies": [\ - ["wide-align", "npm:1.1.5"],\ - ["string-width", "npm:4.2.3"]\ + ["shebang-regex", "npm:3.0.0"]\ ],\ "linkType": "HARD"\ }]\ ]],\ - ["wildcard", [\ - ["npm:2.0.1", {\ - "packageLocation": "./.yarn/cache/wildcard-npm-2.0.1-7c6a3a3365-e0c60a12a2.zip/node_modules/wildcard/",\ + ["strip-ansi", [\ + ["npm:6.0.1", {\ + "packageLocation": "./.yarn/cache/strip-ansi-npm-6.0.1-caddc7cb40-f3cd25890a.zip/node_modules/strip-ansi/",\ "packageDependencies": [\ - ["wildcard", "npm:2.0.1"]\ + ["strip-ansi", "npm:6.0.1"],\ + ["ansi-regex", "npm:5.0.1"]\ ],\ "linkType": "HARD"\ }]\ ]],\ - ["workerpool", [\ - ["npm:6.2.1", {\ - "packageLocation": "./.yarn/cache/workerpool-npm-6.2.1-1486cb2056-c2c6eebbc5.zip/node_modules/workerpool/",\ + ["strip-json-comments", [\ + ["npm:3.1.1", {\ + "packageLocation": "./.yarn/cache/strip-json-comments-npm-3.1.1-dcb2324823-492f73e272.zip/node_modules/strip-json-comments/",\ "packageDependencies": [\ - ["workerpool", "npm:6.2.1"]\ + ["strip-json-comments", "npm:3.1.1"]\ ],\ "linkType": "HARD"\ }]\ ]],\ - ["wrap-ansi", [\ - ["npm:7.0.0", {\ - "packageLocation": "./.yarn/cache/wrap-ansi-npm-7.0.0-ad6e1a0554-a790b846fd.zip/node_modules/wrap-ansi/",\ - "packageDependencies": [\ - ["wrap-ansi", "npm:7.0.0"],\ - ["ansi-styles", "npm:4.3.0"],\ - ["string-width", "npm:4.2.3"],\ - ["strip-ansi", "npm:6.0.1"]\ - ],\ - "linkType": "HARD"\ - }],\ - ["npm:8.1.0", {\ - "packageLocation": "./.yarn/cache/wrap-ansi-npm-8.1.0-26a4e6ae28-371733296d.zip/node_modules/wrap-ansi/",\ + ["supports-color", [\ + ["npm:7.2.0", {\ + "packageLocation": "./.yarn/cache/supports-color-npm-7.2.0-606bfcf7da-3dda818de0.zip/node_modules/supports-color/",\ "packageDependencies": [\ - ["wrap-ansi", "npm:8.1.0"],\ - ["ansi-styles", "npm:6.2.1"],\ - ["string-width", "npm:5.1.2"],\ - ["strip-ansi", "npm:7.1.0"]\ + ["supports-color", "npm:7.2.0"],\ + ["has-flag", "npm:4.0.0"]\ ],\ "linkType": "HARD"\ }]\ ]],\ - ["wrappy", [\ - ["npm:1.0.2", {\ - "packageLocation": "./.yarn/cache/wrappy-npm-1.0.2-916de4d4b3-159da4805f.zip/node_modules/wrappy/",\ + ["text-table", [\ + ["npm:0.2.0", {\ + "packageLocation": "./.yarn/cache/text-table-npm-0.2.0-d92a778b59-b6937a38c8.zip/node_modules/text-table/",\ "packageDependencies": [\ - ["wrappy", "npm:1.0.2"]\ + ["text-table", "npm:0.2.0"]\ ],\ "linkType": "HARD"\ }]\ ]],\ - ["y18n", [\ - ["npm:5.0.8", {\ - "packageLocation": "./.yarn/cache/y18n-npm-5.0.8-5f3a0a7e62-54f0fb9562.zip/node_modules/y18n/",\ + ["type-check", [\ + ["npm:0.4.0", {\ + "packageLocation": "./.yarn/cache/type-check-npm-0.4.0-60565800ce-ec688ebfc9.zip/node_modules/type-check/",\ "packageDependencies": [\ - ["y18n", "npm:5.0.8"]\ + ["type-check", "npm:0.4.0"],\ + ["prelude-ls", "npm:1.2.1"]\ ],\ "linkType": "HARD"\ }]\ ]],\ - ["yallist", [\ - ["npm:4.0.0", {\ - "packageLocation": "./.yarn/cache/yallist-npm-4.0.0-b493d9e907-343617202a.zip/node_modules/yallist/",\ + ["type-fest", [\ + ["npm:0.20.2", {\ + "packageLocation": "./.yarn/cache/type-fest-npm-0.20.2-b36432617f-4fb3272df2.zip/node_modules/type-fest/",\ "packageDependencies": [\ - ["yallist", "npm:4.0.0"]\ + ["type-fest", "npm:0.20.2"]\ ],\ "linkType": "HARD"\ }]\ ]],\ - ["yargs", [\ - ["npm:16.2.0", {\ - "packageLocation": "./.yarn/cache/yargs-npm-16.2.0-547873d425-b14afbb51e.zip/node_modules/yargs/",\ + ["uri-js", [\ + ["npm:4.4.1", {\ + "packageLocation": "./.yarn/cache/uri-js-npm-4.4.1-66d11cbcaf-7167432de6.zip/node_modules/uri-js/",\ "packageDependencies": [\ - ["yargs", "npm:16.2.0"],\ - ["cliui", "npm:7.0.4"],\ - ["escalade", "npm:3.1.1"],\ - ["get-caller-file", "npm:2.0.5"],\ - ["require-directory", "npm:2.1.1"],\ - ["string-width", "npm:4.2.3"],\ - ["y18n", "npm:5.0.8"],\ - ["yargs-parser", "npm:20.2.9"]\ + ["uri-js", "npm:4.4.1"],\ + ["punycode", "npm:2.3.0"]\ ],\ "linkType": "HARD"\ }]\ ]],\ - ["yargs-parser", [\ - ["npm:20.2.4", {\ - "packageLocation": "./.yarn/cache/yargs-parser-npm-20.2.4-1de20916a6-d251998a37.zip/node_modules/yargs-parser/",\ - "packageDependencies": [\ - ["yargs-parser", "npm:20.2.4"]\ - ],\ - "linkType": "HARD"\ - }],\ - ["npm:20.2.9", {\ - "packageLocation": "./.yarn/cache/yargs-parser-npm-20.2.9-a1d19e598d-8bb69015f2.zip/node_modules/yargs-parser/",\ + ["which", [\ + ["npm:2.0.2", {\ + "packageLocation": "./.yarn/cache/which-npm-2.0.2-320ddf72f7-1a5c563d3c.zip/node_modules/which/",\ "packageDependencies": [\ - ["yargs-parser", "npm:20.2.9"]\ + ["which", "npm:2.0.2"],\ + ["isexe", "npm:2.0.0"]\ ],\ "linkType": "HARD"\ }]\ ]],\ - ["yargs-unparser", [\ - ["npm:2.0.0", {\ - "packageLocation": "./.yarn/cache/yargs-unparser-npm-2.0.0-930f3ff3f6-68f9a542c6.zip/node_modules/yargs-unparser/",\ + ["wrappy", [\ + ["npm:1.0.2", {\ + "packageLocation": "./.yarn/cache/wrappy-npm-1.0.2-916de4d4b3-159da4805f.zip/node_modules/wrappy/",\ "packageDependencies": [\ - ["yargs-unparser", "npm:2.0.0"],\ - ["camelcase", "npm:6.3.0"],\ - ["decamelize", "npm:4.0.0"],\ - ["flat", "npm:5.0.2"],\ - ["is-plain-obj", "npm:2.1.0"]\ + ["wrappy", "npm:1.0.2"]\ ],\ "linkType": "HARD"\ }]\ diff --git a/yarn.lock b/yarn.lock index d92cad31..cc825900 100644 --- a/yarn.lock +++ b/yarn.lock @@ -12,13 +12,6 @@ __metadata: languageName: node linkType: hard -"@discoveryjs/json-ext@npm:^0.5.0": - version: 0.5.7 - resolution: "@discoveryjs/json-ext@npm:0.5.7" - checksum: 2176d301cc258ea5c2324402997cf8134ebb212469c0d397591636cea8d3c02f2b3cf9fd58dcb748c7a0dade77ebdc1b10284fa63e608c033a1db52fddc69918 - languageName: node - linkType: hard - "@eslint-community/eslint-utils@npm:^4.2.0": version: 4.4.0 resolution: "@eslint-community/eslint-utils@npm:4.4.0" @@ -30,7 +23,7 @@ __metadata: languageName: node linkType: hard -"@eslint-community/regexpp@npm:^4.4.0, @eslint-community/regexpp@npm:^4.6.1": +"@eslint-community/regexpp@npm:^4.6.1": version: 4.6.2 resolution: "@eslint-community/regexpp@npm:4.6.2" checksum: a3c341377b46b54fa228f455771b901d1a2717f95d47dcdf40199df30abc000ba020f747f114f08560d119e979d882a94cf46cfc51744544d54b00319c0f2724 @@ -86,85 +79,6 @@ __metadata: languageName: node linkType: hard -"@isaacs/cliui@npm:^8.0.2": - version: 8.0.2 - resolution: "@isaacs/cliui@npm:8.0.2" - dependencies: - string-width: ^5.1.2 - string-width-cjs: "npm:string-width@^4.2.0" - strip-ansi: ^7.0.1 - strip-ansi-cjs: "npm:strip-ansi@^6.0.1" - wrap-ansi: ^8.1.0 - wrap-ansi-cjs: "npm:wrap-ansi@^7.0.0" - checksum: 4a473b9b32a7d4d3cfb7a614226e555091ff0c5a29a1734c28c72a182c2f6699b26fc6b5c2131dfd841e86b185aea714c72201d7c98c2fba5f17709333a67aeb - languageName: node - linkType: hard - -"@jridgewell/gen-mapping@npm:^0.3.0": - version: 0.3.3 - resolution: "@jridgewell/gen-mapping@npm:0.3.3" - dependencies: - "@jridgewell/set-array": ^1.0.1 - "@jridgewell/sourcemap-codec": ^1.4.10 - "@jridgewell/trace-mapping": ^0.3.9 - checksum: 4a74944bd31f22354fc01c3da32e83c19e519e3bbadafa114f6da4522ea77dd0c2842607e923a591d60a76699d819a2fbb6f3552e277efdb9b58b081390b60ab - languageName: node - linkType: hard - -"@jridgewell/resolve-uri@npm:3.1.0": - version: 3.1.0 - resolution: "@jridgewell/resolve-uri@npm:3.1.0" - checksum: b5ceaaf9a110fcb2780d1d8f8d4a0bfd216702f31c988d8042e5f8fbe353c55d9b0f55a1733afdc64806f8e79c485d2464680ac48a0d9fcadb9548ee6b81d267 - languageName: node - linkType: hard - -"@jridgewell/set-array@npm:^1.0.1": - version: 1.1.2 - resolution: "@jridgewell/set-array@npm:1.1.2" - checksum: 69a84d5980385f396ff60a175f7177af0b8da4ddb81824cb7016a9ef914eee9806c72b6b65942003c63f7983d4f39a5c6c27185bbca88eb4690b62075602e28e - languageName: node - linkType: hard - -"@jridgewell/source-map@npm:^0.3.3": - version: 0.3.5 - resolution: "@jridgewell/source-map@npm:0.3.5" - dependencies: - "@jridgewell/gen-mapping": ^0.3.0 - "@jridgewell/trace-mapping": ^0.3.9 - checksum: 1ad4dec0bdafbade57920a50acec6634f88a0eb735851e0dda906fa9894e7f0549c492678aad1a10f8e144bfe87f238307bf2a914a1bc85b7781d345417e9f6f - languageName: node - linkType: hard - -"@jridgewell/sourcemap-codec@npm:1.4.14": - version: 1.4.14 - resolution: "@jridgewell/sourcemap-codec@npm:1.4.14" - checksum: 61100637b6d173d3ba786a5dff019e1a74b1f394f323c1fee337ff390239f053b87266c7a948777f4b1ee68c01a8ad0ab61e5ff4abb5a012a0b091bec391ab97 - languageName: node - linkType: hard - -"@jridgewell/sourcemap-codec@npm:^1.4.10": - version: 1.4.15 - resolution: "@jridgewell/sourcemap-codec@npm:1.4.15" - checksum: b881c7e503db3fc7f3c1f35a1dd2655a188cc51a3612d76efc8a6eb74728bef5606e6758ee77423e564092b4a518aba569bbb21c9bac5ab7a35b0c6ae7e344c8 - languageName: node - linkType: hard - -"@jridgewell/trace-mapping@npm:^0.3.17, @jridgewell/trace-mapping@npm:^0.3.9": - version: 0.3.18 - resolution: "@jridgewell/trace-mapping@npm:0.3.18" - dependencies: - "@jridgewell/resolve-uri": 3.1.0 - "@jridgewell/sourcemap-codec": 1.4.14 - checksum: 0572669f855260808c16fe8f78f5f1b4356463b11d3f2c7c0b5580c8ba1cbf4ae53efe9f627595830856e57dbac2325ac17eb0c3dd0ec42102e6f227cc289c02 - languageName: node - linkType: hard - -"@libs/lsp-launcher@workspace:libs/lsp-launcher": - version: 0.0.0-use.local - resolution: "@libs/lsp-launcher@workspace:libs/lsp-launcher" - languageName: unknown - linkType: soft - "@nodelib/fs.scandir@npm:2.1.5": version: 2.1.5 resolution: "@nodelib/fs.scandir@npm:2.1.5" @@ -175,14 +89,14 @@ __metadata: languageName: node linkType: hard -"@nodelib/fs.stat@npm:2.0.5, @nodelib/fs.stat@npm:^2.0.2": +"@nodelib/fs.stat@npm:2.0.5": version: 2.0.5 resolution: "@nodelib/fs.stat@npm:2.0.5" checksum: 012480b5ca9d97bff9261571dbbec7bbc6033f69cc92908bc1ecfad0792361a5a1994bc48674b9ef76419d056a03efadfce5a6cf6dbc0a36559571a7a483f6f0 languageName: node linkType: hard -"@nodelib/fs.walk@npm:^1.2.3, @nodelib/fs.walk@npm:^1.2.8": +"@nodelib/fs.walk@npm:^1.2.8": version: 1.2.8 resolution: "@nodelib/fs.walk@npm:1.2.8" dependencies: @@ -192,2893 +106,748 @@ __metadata: languageName: node linkType: hard -"@npmcli/fs@npm:^3.1.0": - version: 3.1.0 - resolution: "@npmcli/fs@npm:3.1.0" - dependencies: - semver: ^7.3.5 - checksum: a50a6818de5fc557d0b0e6f50ec780a7a02ab8ad07e5ac8b16bf519e0ad60a144ac64f97d05c443c3367235d337182e1d012bbac0eb8dbae8dc7b40b193efd0e - languageName: node - linkType: hard - -"@osmium-packages/eslint-config@workspace:^, @osmium-packages/eslint-config@workspace:packages/eslint-config": +"@osmium-libs/lsp-launcher@workspace:libs/lsp-launcher": version: 0.0.0-use.local - resolution: "@osmium-packages/eslint-config@workspace:packages/eslint-config" - dependencies: - eslint: ^8.46.0 + resolution: "@osmium-libs/lsp-launcher@workspace:libs/lsp-launcher" languageName: unknown linkType: soft -"@osmium-packages/prettier-config@workspace:^, @osmium-packages/prettier-config@workspace:packages/prettier-config": +"@osmium-packages/eslint-config@workspace:packages/eslint-config": version: 0.0.0-use.local - resolution: "@osmium-packages/prettier-config@workspace:packages/prettier-config" + resolution: "@osmium-packages/eslint-config@workspace:packages/eslint-config" dependencies: - prettier: ^3.0.0 + eslint: ^8.46.0 languageName: unknown linkType: soft -"@osmium-solidity-lsp/extension@workspace:toolchains/solidity/lsp/extension": +"@osmium-packages/prettier-config@workspace:packages/prettier-config": version: 0.0.0-use.local - resolution: "@osmium-solidity-lsp/extension@workspace:toolchains/solidity/lsp/extension" + resolution: "@osmium-packages/prettier-config@workspace:packages/prettier-config" dependencies: - "@osmium-packages/eslint-config": "workspace:^" - "@osmium-packages/prettier-config": "workspace:^" - "@types/glob": ^8.1.0 - "@types/mocha": ^10.0.1 - "@types/node": 20.2.5 - "@types/vscode": ^1.80.0 - "@typescript-eslint/eslint-plugin": ^5.59.8 - "@typescript-eslint/parser": ^5.59.8 - "@vscode/test-electron": ^2.3.2 - eslint: ^8.41.0 - glob: ^8.1.0 - mocha: ^10.2.0 prettier: ^3.0.0 - ts-loader: ^9.4.3 - typescript: ^5.1.3 - webpack: ^5.85.0 - webpack-cli: ^5.1.1 - languageName: unknown - linkType: soft - -"@osmium-solidity/lsp@workspace:toolchains/solidity/lsp": - version: 0.0.0-use.local - resolution: "@osmium-solidity/lsp@workspace:toolchains/solidity/lsp" languageName: unknown linkType: soft -"@osmium-toolchains/solidity@workspace:toolchains/solidity": +"@solidity/linter@workspace:toolchains/solidity/linter": version: 0.0.0-use.local - resolution: "@osmium-toolchains/solidity@workspace:toolchains/solidity" + resolution: "@solidity/linter@workspace:toolchains/solidity/linter" languageName: unknown linkType: soft -"@pkgjs/parseargs@npm:^0.11.0": - version: 0.11.0 - resolution: "@pkgjs/parseargs@npm:0.11.0" - checksum: 6ad6a00fc4f2f2cfc6bff76fb1d88b8ee20bc0601e18ebb01b6d4be583733a860239a521a7fbca73b612e66705078809483549d2b18f370eb346c5155c8e4a0f +"acorn-jsx@npm:^5.3.2": + version: 5.3.2 + resolution: "acorn-jsx@npm:5.3.2" + peerDependencies: + acorn: ^6.0.0 || ^7.0.0 || ^8.0.0 + checksum: c3d3b2a89c9a056b205b69530a37b972b404ee46ec8e5b341666f9513d3163e2a4f214a71f4dfc7370f5a9c07472d2fd1c11c91c3f03d093e37637d95da98950 languageName: node linkType: hard -"@tootallnate/once@npm:1": - version: 1.1.2 - resolution: "@tootallnate/once@npm:1.1.2" - checksum: e1fb1bbbc12089a0cb9433dc290f97bddd062deadb6178ce9bcb93bb7c1aecde5e60184bc7065aec42fe1663622a213493c48bbd4972d931aae48315f18e1be9 +"acorn@npm:^8.9.0": + version: 8.10.0 + resolution: "acorn@npm:8.10.0" + bin: + acorn: bin/acorn + checksum: 538ba38af0cc9e5ef983aee196c4b8b4d87c0c94532334fa7e065b2c8a1f85863467bb774231aae91613fcda5e68740c15d97b1967ae3394d20faddddd8af61d languageName: node linkType: hard -"@tootallnate/once@npm:2": - version: 2.0.0 - resolution: "@tootallnate/once@npm:2.0.0" - checksum: ad87447820dd3f24825d2d947ebc03072b20a42bfc96cbafec16bff8bbda6c1a81fcb0be56d5b21968560c5359a0af4038a68ba150c3e1694fe4c109a063bed8 +"ajv@npm:^6.12.4": + version: 6.12.6 + resolution: "ajv@npm:6.12.6" + dependencies: + fast-deep-equal: ^3.1.1 + fast-json-stable-stringify: ^2.0.0 + json-schema-traverse: ^0.4.1 + uri-js: ^4.2.2 + checksum: 874972efe5c4202ab0a68379481fbd3d1b5d0a7bd6d3cc21d40d3536ebff3352a2a1fabb632d4fd2cc7fe4cbdcd5ed6782084c9bbf7f32a1536d18f9da5007d4 languageName: node linkType: hard -"@types/eslint-scope@npm:^3.7.3": - version: 3.7.4 - resolution: "@types/eslint-scope@npm:3.7.4" - dependencies: - "@types/eslint": "*" - "@types/estree": "*" - checksum: ea6a9363e92f301cd3888194469f9ec9d0021fe0a397a97a6dd689e7545c75de0bd2153dfb13d3ab532853a278b6572c6f678ce846980669e41029d205653460 +"ansi-regex@npm:^5.0.1": + version: 5.0.1 + resolution: "ansi-regex@npm:5.0.1" + checksum: 2aa4bb54caf2d622f1afdad09441695af2a83aa3fe8b8afa581d205e57ed4261c183c4d3877cee25794443fde5876417d859c108078ab788d6af7e4fe52eb66b languageName: node linkType: hard -"@types/eslint@npm:*": - version: 8.44.1 - resolution: "@types/eslint@npm:8.44.1" +"ansi-styles@npm:^4.1.0": + version: 4.3.0 + resolution: "ansi-styles@npm:4.3.0" dependencies: - "@types/estree": "*" - "@types/json-schema": "*" - checksum: 8b45be72d3c22a1ee0b1cc7e7fb0e34e32bbf959e6b7e0e46d160c17894aedf159c1db5c85750f10068884c741eebc37a1cc7ea659de23a8df0c9a3203e2ff9d + color-convert: ^2.0.1 + checksum: 513b44c3b2105dd14cc42a19271e80f386466c4be574bccf60b627432f9198571ebf4ab1e4c3ba17347658f4ee1711c163d574248c0c1cdc2d5917a0ad582ec4 languageName: node linkType: hard -"@types/estree@npm:*, @types/estree@npm:^1.0.0": - version: 1.0.1 - resolution: "@types/estree@npm:1.0.1" - checksum: e9aa175eacb797216fafce4d41e8202c7a75555bc55232dee0f9903d7171f8f19f0ae7d5191bb1a88cb90e65468be508c0df850a9fb81b4433b293a5a749899d +"argparse@npm:^2.0.1": + version: 2.0.1 + resolution: "argparse@npm:2.0.1" + checksum: 83644b56493e89a254bae05702abf3a1101b4fa4d0ca31df1c9985275a5a5bd47b3c27b7fa0b71098d41114d8ca000e6ed90cad764b306f8a503665e4d517ced languageName: node linkType: hard -"@types/glob@npm:^8.1.0": - version: 8.1.0 - resolution: "@types/glob@npm:8.1.0" - dependencies: - "@types/minimatch": ^5.1.2 - "@types/node": "*" - checksum: 9101f3a9061e40137190f70626aa0e202369b5ec4012c3fabe6f5d229cce04772db9a94fa5a0eb39655e2e4ad105c38afbb4af56a56c0996a8c7d4fc72350e3d +"balanced-match@npm:^1.0.0": + version: 1.0.2 + resolution: "balanced-match@npm:1.0.2" + checksum: 9706c088a283058a8a99e0bf91b0a2f75497f185980d9ffa8b304de1d9e58ebda7c72c07ebf01dadedaac5b2907b2c6f566f660d62bd336c3468e960403b9d65 languageName: node linkType: hard -"@types/json-schema@npm:*, @types/json-schema@npm:^7.0.8, @types/json-schema@npm:^7.0.9": - version: 7.0.12 - resolution: "@types/json-schema@npm:7.0.12" - checksum: 00239e97234eeb5ceefb0c1875d98ade6e922bfec39dd365ec6bd360b5c2f825e612ac4f6e5f1d13601b8b30f378f15e6faa805a3a732f4a1bbe61915163d293 +"brace-expansion@npm:^1.1.7": + version: 1.1.11 + resolution: "brace-expansion@npm:1.1.11" + dependencies: + balanced-match: ^1.0.0 + concat-map: 0.0.1 + checksum: faf34a7bb0c3fcf4b59c7808bc5d2a96a40988addf2e7e09dfbb67a2251800e0d14cd2bfc1aa79174f2f5095c54ff27f46fb1289fe2d77dac755b5eb3434cc07 languageName: node linkType: hard -"@types/minimatch@npm:^5.1.2": - version: 5.1.2 - resolution: "@types/minimatch@npm:5.1.2" - checksum: 0391a282860c7cb6fe262c12b99564732401bdaa5e395bee9ca323c312c1a0f45efbf34dce974682036e857db59a5c9b1da522f3d6055aeead7097264c8705a8 +"callsites@npm:^3.0.0": + version: 3.1.0 + resolution: "callsites@npm:3.1.0" + checksum: 072d17b6abb459c2ba96598918b55868af677154bec7e73d222ef95a8fdb9bbf7dae96a8421085cdad8cd190d86653b5b6dc55a4484f2e5b2e27d5e0c3fc15b3 languageName: node linkType: hard -"@types/mocha@npm:^10.0.1": - version: 10.0.1 - resolution: "@types/mocha@npm:10.0.1" - checksum: 224ea9fce7b1734ccdb9aa99a622d902a538ce1847bca7fd22c5fb38adcf3ed536f50f48f587085db988a4bb3c2eb68f4b98e1cd6a38bc5547bd3bbbedc54495 +"chalk@npm:^4.0.0": + version: 4.1.2 + resolution: "chalk@npm:4.1.2" + dependencies: + ansi-styles: ^4.1.0 + supports-color: ^7.1.0 + checksum: fe75c9d5c76a7a98d45495b91b2172fa3b7a09e0cc9370e5c8feb1c567b85c4288e2b3fded7cfdd7359ac28d6b3844feb8b82b8686842e93d23c827c417e83fc languageName: node linkType: hard -"@types/node@npm:*": - version: 20.4.5 - resolution: "@types/node@npm:20.4.5" - checksum: 36a0304a8dc346a1b2d2edac4c4633eecf70875793d61a5274d0df052d7a7af7a8e34f29884eac4fbd094c4f0201477dcb39c0ecd3307ca141688806538d1138 +"color-convert@npm:^2.0.1": + version: 2.0.1 + resolution: "color-convert@npm:2.0.1" + dependencies: + color-name: ~1.1.4 + checksum: 79e6bdb9fd479a205c71d89574fccfb22bd9053bd98c6c4d870d65c132e5e904e6034978e55b43d69fcaa7433af2016ee203ce76eeba9cfa554b373e7f7db336 languageName: node linkType: hard -"@types/node@npm:20.2.5": - version: 20.2.5 - resolution: "@types/node@npm:20.2.5" - checksum: 38ce7c7e9d76880dc632f71d71e0d5914fcda9d5e9a7095d6c339abda55ca4affb0f2a882aeb29398f8e09d2c5151f0b6586c81c8ccdfe529c34b1ea3337425e +"color-name@npm:~1.1.4": + version: 1.1.4 + resolution: "color-name@npm:1.1.4" + checksum: b0445859521eb4021cd0fb0cc1a75cecf67fceecae89b63f62b201cca8d345baf8b952c966862a9d9a2632987d4f6581f0ec8d957dfacece86f0a7919316f610 languageName: node linkType: hard -"@types/semver@npm:^7.3.12": - version: 7.5.0 - resolution: "@types/semver@npm:7.5.0" - checksum: 0a64b9b9c7424d9a467658b18dd70d1d781c2d6f033096a6e05762d20ebbad23c1b69b0083b0484722aabf35640b78ccc3de26368bcae1129c87e9df028a22e2 +"concat-map@npm:0.0.1": + version: 0.0.1 + resolution: "concat-map@npm:0.0.1" + checksum: 902a9f5d8967a3e2faf138d5cb784b9979bad2e6db5357c5b21c568df4ebe62bcb15108af1b2253744844eb964fc023fbd9afbbbb6ddd0bcc204c6fb5b7bf3af languageName: node linkType: hard -"@types/vscode@npm:^1.80.0": - version: 1.80.0 - resolution: "@types/vscode@npm:1.80.0" - checksum: 442c55fb83151d36aa30c895dacb3f2320a7a7a1c8d956f1f1902618b6f3cddec070a88e494fe7e6db4aec481e9f44d4df0077d2598edb815ebffb6e7ea0e176 +"cross-spawn@npm:^7.0.2": + version: 7.0.3 + resolution: "cross-spawn@npm:7.0.3" + dependencies: + path-key: ^3.1.0 + shebang-command: ^2.0.0 + which: ^2.0.1 + checksum: 671cc7c7288c3a8406f3c69a3ae2fc85555c04169e9d611def9a675635472614f1c0ed0ef80955d5b6d4e724f6ced67f0ad1bb006c2ea643488fcfef994d7f52 languageName: node linkType: hard -"@typescript-eslint/eslint-plugin@npm:^5.59.8": - version: 5.62.0 - resolution: "@typescript-eslint/eslint-plugin@npm:5.62.0" +"debug@npm:^4.1.1, debug@npm:^4.3.2": + version: 4.3.4 + resolution: "debug@npm:4.3.4" dependencies: - "@eslint-community/regexpp": ^4.4.0 - "@typescript-eslint/scope-manager": 5.62.0 - "@typescript-eslint/type-utils": 5.62.0 - "@typescript-eslint/utils": 5.62.0 - debug: ^4.3.4 - graphemer: ^1.4.0 - ignore: ^5.2.0 - natural-compare-lite: ^1.4.0 - semver: ^7.3.7 - tsutils: ^3.21.0 - peerDependencies: - "@typescript-eslint/parser": ^5.0.0 - eslint: ^6.0.0 || ^7.0.0 || ^8.0.0 + ms: 2.1.2 peerDependenciesMeta: - typescript: + supports-color: optional: true - checksum: fc104b389c768f9fa7d45a48c86d5c1ad522c1d0512943e782a56b1e3096b2cbcc1eea3fcc590647bf0658eef61aac35120a9c6daf979bf629ad2956deb516a1 + checksum: 3dbad3f94ea64f34431a9cbf0bafb61853eda57bff2880036153438f50fb5a84f27683ba0d8e5426bf41a8c6ff03879488120cf5b3a761e77953169c0600a708 languageName: node linkType: hard -"@typescript-eslint/parser@npm:^5.59.8": - version: 5.62.0 - resolution: "@typescript-eslint/parser@npm:5.62.0" - dependencies: - "@typescript-eslint/scope-manager": 5.62.0 - "@typescript-eslint/types": 5.62.0 - "@typescript-eslint/typescript-estree": 5.62.0 - debug: ^4.3.4 - peerDependencies: - eslint: ^6.0.0 || ^7.0.0 || ^8.0.0 - peerDependenciesMeta: - typescript: - optional: true - checksum: d168f4c7f21a7a63f47002e2d319bcbb6173597af5c60c1cf2de046b46c76b4930a093619e69faf2d30214c29ab27b54dcf1efc7046a6a6bd6f37f59a990e752 +"deep-is@npm:^0.1.3": + version: 0.1.4 + resolution: "deep-is@npm:0.1.4" + checksum: edb65dd0d7d1b9c40b2f50219aef30e116cedd6fc79290e740972c132c09106d2e80aa0bc8826673dd5a00222d4179c84b36a790eef63a4c4bca75a37ef90804 languageName: node linkType: hard -"@typescript-eslint/scope-manager@npm:5.62.0": - version: 5.62.0 - resolution: "@typescript-eslint/scope-manager@npm:5.62.0" +"doctrine@npm:^3.0.0": + version: 3.0.0 + resolution: "doctrine@npm:3.0.0" dependencies: - "@typescript-eslint/types": 5.62.0 - "@typescript-eslint/visitor-keys": 5.62.0 - checksum: 6062d6b797fe1ce4d275bb0d17204c827494af59b5eaf09d8a78cdd39dadddb31074dded4297aaf5d0f839016d601032857698b0e4516c86a41207de606e9573 + esutils: ^2.0.2 + checksum: fd7673ca77fe26cd5cba38d816bc72d641f500f1f9b25b83e8ce28827fe2da7ad583a8da26ab6af85f834138cf8dae9f69b0cd6ab925f52ddab1754db44d99ce languageName: node linkType: hard -"@typescript-eslint/type-utils@npm:5.62.0": - version: 5.62.0 - resolution: "@typescript-eslint/type-utils@npm:5.62.0" - dependencies: - "@typescript-eslint/typescript-estree": 5.62.0 - "@typescript-eslint/utils": 5.62.0 - debug: ^4.3.4 - tsutils: ^3.21.0 - peerDependencies: - eslint: "*" - peerDependenciesMeta: - typescript: - optional: true - checksum: fc41eece5f315dfda14320be0da78d3a971d650ea41300be7196934b9715f3fe1120a80207551eb71d39568275dbbcf359bde540d1ca1439d8be15e9885d2739 +"escape-string-regexp@npm:^4.0.0": + version: 4.0.0 + resolution: "escape-string-regexp@npm:4.0.0" + checksum: 98b48897d93060f2322108bf29db0feba7dd774be96cd069458d1453347b25ce8682ecc39859d4bca2203cc0ab19c237bcc71755eff49a0f8d90beadeeba5cc5 languageName: node linkType: hard -"@typescript-eslint/types@npm:5.62.0": - version: 5.62.0 - resolution: "@typescript-eslint/types@npm:5.62.0" - checksum: 48c87117383d1864766486f24de34086155532b070f6264e09d0e6139449270f8a9559cfef3c56d16e3bcfb52d83d42105d61b36743626399c7c2b5e0ac3b670 +"eslint-scope@npm:^7.2.2": + version: 7.2.2 + resolution: "eslint-scope@npm:7.2.2" + dependencies: + esrecurse: ^4.3.0 + estraverse: ^5.2.0 + checksum: ec97dbf5fb04b94e8f4c5a91a7f0a6dd3c55e46bfc7bbcd0e3138c3a76977570e02ed89a1810c778dcd72072ff0e9621ba1379b4babe53921d71e2e4486fda3e languageName: node linkType: hard -"@typescript-eslint/typescript-estree@npm:5.62.0": - version: 5.62.0 - resolution: "@typescript-eslint/typescript-estree@npm:5.62.0" - dependencies: - "@typescript-eslint/types": 5.62.0 - "@typescript-eslint/visitor-keys": 5.62.0 - debug: ^4.3.4 - globby: ^11.1.0 - is-glob: ^4.0.3 - semver: ^7.3.7 - tsutils: ^3.21.0 - peerDependenciesMeta: - typescript: - optional: true - checksum: 3624520abb5807ed8f57b1197e61c7b1ed770c56dfcaca66372d584ff50175225798bccb701f7ef129d62c5989070e1ee3a0aa2d84e56d9524dcf011a2bb1a52 +"eslint-visitor-keys@npm:^3.3.0, eslint-visitor-keys@npm:^3.4.1, eslint-visitor-keys@npm:^3.4.2": + version: 3.4.2 + resolution: "eslint-visitor-keys@npm:3.4.2" + checksum: 9e0e7e4aaea705c097ae37c97410e5f167d4d2193be2edcb1f0760762ede3df01545e4820ae314f42dcec687745f2c6dcaf6d83575c4a2a241eb0c8517d724f2 languageName: node linkType: hard -"@typescript-eslint/utils@npm:5.62.0": - version: 5.62.0 - resolution: "@typescript-eslint/utils@npm:5.62.0" +"eslint@npm:^8.46.0": + version: 8.46.0 + resolution: "eslint@npm:8.46.0" dependencies: "@eslint-community/eslint-utils": ^4.2.0 - "@types/json-schema": ^7.0.9 - "@types/semver": ^7.3.12 - "@typescript-eslint/scope-manager": 5.62.0 - "@typescript-eslint/types": 5.62.0 - "@typescript-eslint/typescript-estree": 5.62.0 - eslint-scope: ^5.1.1 - semver: ^7.3.7 - peerDependencies: - eslint: ^6.0.0 || ^7.0.0 || ^8.0.0 - checksum: ee9398c8c5db6d1da09463ca7bf36ed134361e20131ea354b2da16a5fdb6df9ba70c62a388d19f6eebb421af1786dbbd79ba95ddd6ab287324fc171c3e28d931 + "@eslint-community/regexpp": ^4.6.1 + "@eslint/eslintrc": ^2.1.1 + "@eslint/js": ^8.46.0 + "@humanwhocodes/config-array": ^0.11.10 + "@humanwhocodes/module-importer": ^1.0.1 + "@nodelib/fs.walk": ^1.2.8 + ajv: ^6.12.4 + chalk: ^4.0.0 + cross-spawn: ^7.0.2 + debug: ^4.3.2 + doctrine: ^3.0.0 + escape-string-regexp: ^4.0.0 + eslint-scope: ^7.2.2 + eslint-visitor-keys: ^3.4.2 + espree: ^9.6.1 + esquery: ^1.4.2 + esutils: ^2.0.2 + fast-deep-equal: ^3.1.3 + file-entry-cache: ^6.0.1 + find-up: ^5.0.0 + glob-parent: ^6.0.2 + globals: ^13.19.0 + graphemer: ^1.4.0 + ignore: ^5.2.0 + imurmurhash: ^0.1.4 + is-glob: ^4.0.0 + is-path-inside: ^3.0.3 + js-yaml: ^4.1.0 + json-stable-stringify-without-jsonify: ^1.0.1 + levn: ^0.4.1 + lodash.merge: ^4.6.2 + minimatch: ^3.1.2 + natural-compare: ^1.4.0 + optionator: ^0.9.3 + strip-ansi: ^6.0.1 + text-table: ^0.2.0 + bin: + eslint: bin/eslint.js + checksum: 7a7d36b1a3bbc12e08fbb5bc36fd482a7a5a1797e62e762499dd45601b9e45aaa53a129f31ce0b4444551a9639b8b681ad535f379893dd1e3ae37b31dccd82aa languageName: node linkType: hard -"@typescript-eslint/visitor-keys@npm:5.62.0": - version: 5.62.0 - resolution: "@typescript-eslint/visitor-keys@npm:5.62.0" +"espree@npm:^9.6.0, espree@npm:^9.6.1": + version: 9.6.1 + resolution: "espree@npm:9.6.1" dependencies: - "@typescript-eslint/types": 5.62.0 - eslint-visitor-keys: ^3.3.0 - checksum: 976b05d103fe8335bef5c93ad3f76d781e3ce50329c0243ee0f00c0fcfb186c81df50e64bfdd34970148113f8ade90887f53e3c4938183afba830b4ba8e30a35 + acorn: ^8.9.0 + acorn-jsx: ^5.3.2 + eslint-visitor-keys: ^3.4.1 + checksum: eb8c149c7a2a77b3f33a5af80c10875c3abd65450f60b8af6db1bfcfa8f101e21c1e56a561c6dc13b848e18148d43469e7cd208506238554fb5395a9ea5a1ab9 languageName: node linkType: hard -"@vscode/test-electron@npm:^2.3.2": - version: 2.3.3 - resolution: "@vscode/test-electron@npm:2.3.3" +"esquery@npm:^1.4.2": + version: 1.5.0 + resolution: "esquery@npm:1.5.0" dependencies: - http-proxy-agent: ^4.0.1 - https-proxy-agent: ^5.0.0 - jszip: ^3.10.1 - semver: ^7.3.8 - checksum: ecb5a52e7a02303c622a4c98b50a387ca3575d586766ab7c4a0cef6248486a0d96f72270a0f9e7321279aabdb8b39a0d770088049f1630dff1908f71946b6835 + estraverse: ^5.1.0 + checksum: aefb0d2596c230118656cd4ec7532d447333a410a48834d80ea648b1e7b5c9bc9ed8b5e33a89cb04e487b60d622f44cf5713bf4abed7c97343edefdc84a35900 languageName: node linkType: hard -"@webassemblyjs/ast@npm:1.11.6, @webassemblyjs/ast@npm:^1.11.5": - version: 1.11.6 - resolution: "@webassemblyjs/ast@npm:1.11.6" +"esrecurse@npm:^4.3.0": + version: 4.3.0 + resolution: "esrecurse@npm:4.3.0" dependencies: - "@webassemblyjs/helper-numbers": 1.11.6 - "@webassemblyjs/helper-wasm-bytecode": 1.11.6 - checksum: 38ef1b526ca47c210f30975b06df2faf1a8170b1636ce239fc5738fc231ce28389dd61ecedd1bacfc03cbe95b16d1af848c805652080cb60982836eb4ed2c6cf + estraverse: ^5.2.0 + checksum: ebc17b1a33c51cef46fdc28b958994b1dc43cd2e86237515cbc3b4e5d2be6a811b2315d0a1a4d9d340b6d2308b15322f5c8291059521cc5f4802f65e7ec32837 languageName: node linkType: hard -"@webassemblyjs/floating-point-hex-parser@npm:1.11.6": - version: 1.11.6 - resolution: "@webassemblyjs/floating-point-hex-parser@npm:1.11.6" - checksum: 29b08758841fd8b299c7152eda36b9eb4921e9c584eb4594437b5cd90ed6b920523606eae7316175f89c20628da14326801090167cc7fbffc77af448ac84b7e2 +"estraverse@npm:^5.1.0, estraverse@npm:^5.2.0": + version: 5.3.0 + resolution: "estraverse@npm:5.3.0" + checksum: 072780882dc8416ad144f8fe199628d2b3e7bbc9989d9ed43795d2c90309a2047e6bc5979d7e2322a341163d22cfad9e21f4110597fe487519697389497e4e2b languageName: node linkType: hard -"@webassemblyjs/helper-api-error@npm:1.11.6": - version: 1.11.6 - resolution: "@webassemblyjs/helper-api-error@npm:1.11.6" - checksum: e8563df85161096343008f9161adb138a6e8f3c2cc338d6a36011aa55eabb32f2fd138ffe63bc278d009ada001cc41d263dadd1c0be01be6c2ed99076103689f +"esutils@npm:^2.0.2": + version: 2.0.3 + resolution: "esutils@npm:2.0.3" + checksum: 22b5b08f74737379a840b8ed2036a5fb35826c709ab000683b092d9054e5c2a82c27818f12604bfc2a9a76b90b6834ef081edbc1c7ae30d1627012e067c6ec87 languageName: node linkType: hard -"@webassemblyjs/helper-buffer@npm:1.11.6": - version: 1.11.6 - resolution: "@webassemblyjs/helper-buffer@npm:1.11.6" - checksum: b14d0573bf680d22b2522e8a341ec451fddd645d1f9c6bd9012ccb7e587a2973b86ab7b89fe91e1c79939ba96095f503af04369a3b356c8023c13a5893221644 +"fast-deep-equal@npm:^3.1.1, fast-deep-equal@npm:^3.1.3": + version: 3.1.3 + resolution: "fast-deep-equal@npm:3.1.3" + checksum: e21a9d8d84f53493b6aa15efc9cfd53dd5b714a1f23f67fb5dc8f574af80df889b3bce25dc081887c6d25457cce704e636395333abad896ccdec03abaf1f3f9d languageName: node linkType: hard -"@webassemblyjs/helper-numbers@npm:1.11.6": - version: 1.11.6 - resolution: "@webassemblyjs/helper-numbers@npm:1.11.6" - dependencies: - "@webassemblyjs/floating-point-hex-parser": 1.11.6 - "@webassemblyjs/helper-api-error": 1.11.6 - "@xtuc/long": 4.2.2 - checksum: f4b562fa219f84368528339e0f8d273ad44e047a07641ffcaaec6f93e5b76fd86490a009aa91a294584e1436d74b0a01fa9fde45e333a4c657b58168b04da424 +"fast-json-stable-stringify@npm:^2.0.0": + version: 2.1.0 + resolution: "fast-json-stable-stringify@npm:2.1.0" + checksum: b191531e36c607977e5b1c47811158733c34ccb3bfde92c44798929e9b4154884378536d26ad90dfecd32e1ffc09c545d23535ad91b3161a27ddbb8ebe0cbecb languageName: node linkType: hard -"@webassemblyjs/helper-wasm-bytecode@npm:1.11.6": - version: 1.11.6 - resolution: "@webassemblyjs/helper-wasm-bytecode@npm:1.11.6" - checksum: 3535ef4f1fba38de3475e383b3980f4bbf3de72bbb631c2b6584c7df45be4eccd62c6ff48b5edd3f1bcff275cfd605a37679ec199fc91fd0a7705d7f1e3972dc +"fast-levenshtein@npm:^2.0.6": + version: 2.0.6 + resolution: "fast-levenshtein@npm:2.0.6" + checksum: 92cfec0a8dfafd9c7a15fba8f2cc29cd0b62b85f056d99ce448bbcd9f708e18ab2764bda4dd5158364f4145a7c72788538994f0d1787b956ef0d1062b0f7c24c languageName: node linkType: hard -"@webassemblyjs/helper-wasm-section@npm:1.11.6": - version: 1.11.6 - resolution: "@webassemblyjs/helper-wasm-section@npm:1.11.6" - dependencies: - "@webassemblyjs/ast": 1.11.6 - "@webassemblyjs/helper-buffer": 1.11.6 - "@webassemblyjs/helper-wasm-bytecode": 1.11.6 - "@webassemblyjs/wasm-gen": 1.11.6 - checksum: b2cf751bf4552b5b9999d27bbb7692d0aca75260140195cb58ea6374d7b9c2dc69b61e10b211a0e773f66209c3ddd612137ed66097e3684d7816f854997682e9 - languageName: node - linkType: hard - -"@webassemblyjs/ieee754@npm:1.11.6": - version: 1.11.6 - resolution: "@webassemblyjs/ieee754@npm:1.11.6" +"fastq@npm:^1.6.0": + version: 1.15.0 + resolution: "fastq@npm:1.15.0" dependencies: - "@xtuc/ieee754": ^1.2.0 - checksum: 13574b8e41f6ca39b700e292d7edf102577db5650fe8add7066a320aa4b7a7c09a5056feccac7a74eb68c10dea9546d4461412af351f13f6b24b5f32379b49de + reusify: ^1.0.4 + checksum: 0170e6bfcd5d57a70412440b8ef600da6de3b2a6c5966aeaf0a852d542daff506a0ee92d6de7679d1de82e644bce69d7a574a6c93f0b03964b5337eed75ada1a languageName: node linkType: hard -"@webassemblyjs/leb128@npm:1.11.6": - version: 1.11.6 - resolution: "@webassemblyjs/leb128@npm:1.11.6" +"file-entry-cache@npm:^6.0.1": + version: 6.0.1 + resolution: "file-entry-cache@npm:6.0.1" dependencies: - "@xtuc/long": 4.2.2 - checksum: 7ea942dc9777d4b18a5ebfa3a937b30ae9e1d2ce1fee637583ed7f376334dd1d4274f813d2e250056cca803e0952def4b954913f1a3c9068bcd4ab4ee5143bf0 - languageName: node - linkType: hard - -"@webassemblyjs/utf8@npm:1.11.6": - version: 1.11.6 - resolution: "@webassemblyjs/utf8@npm:1.11.6" - checksum: 807fe5b5ce10c390cfdd93e0fb92abda8aebabb5199980681e7c3743ee3306a75729bcd1e56a3903980e96c885ee53ef901fcbaac8efdfa480f9c0dae1d08713 + flat-cache: ^3.0.4 + checksum: f49701feaa6314c8127c3c2f6173cfefff17612f5ed2daaafc6da13b5c91fd43e3b2a58fd0d63f9f94478a501b167615931e7200e31485e320f74a33885a9c74 languageName: node linkType: hard -"@webassemblyjs/wasm-edit@npm:^1.11.5": - version: 1.11.6 - resolution: "@webassemblyjs/wasm-edit@npm:1.11.6" +"find-up@npm:^5.0.0": + version: 5.0.0 + resolution: "find-up@npm:5.0.0" dependencies: - "@webassemblyjs/ast": 1.11.6 - "@webassemblyjs/helper-buffer": 1.11.6 - "@webassemblyjs/helper-wasm-bytecode": 1.11.6 - "@webassemblyjs/helper-wasm-section": 1.11.6 - "@webassemblyjs/wasm-gen": 1.11.6 - "@webassemblyjs/wasm-opt": 1.11.6 - "@webassemblyjs/wasm-parser": 1.11.6 - "@webassemblyjs/wast-printer": 1.11.6 - checksum: 29ce75870496d6fad864d815ebb072395a8a3a04dc9c3f4e1ffdc63fc5fa58b1f34304a1117296d8240054cfdbc38aca88e71fb51483cf29ffab0a61ef27b481 + locate-path: ^6.0.0 + path-exists: ^4.0.0 + checksum: 07955e357348f34660bde7920783204ff5a26ac2cafcaa28bace494027158a97b9f56faaf2d89a6106211a8174db650dd9f503f9c0d526b1202d5554a00b9095 languageName: node linkType: hard -"@webassemblyjs/wasm-gen@npm:1.11.6": - version: 1.11.6 - resolution: "@webassemblyjs/wasm-gen@npm:1.11.6" +"flat-cache@npm:^3.0.4": + version: 3.0.4 + resolution: "flat-cache@npm:3.0.4" dependencies: - "@webassemblyjs/ast": 1.11.6 - "@webassemblyjs/helper-wasm-bytecode": 1.11.6 - "@webassemblyjs/ieee754": 1.11.6 - "@webassemblyjs/leb128": 1.11.6 - "@webassemblyjs/utf8": 1.11.6 - checksum: a645a2eecbea24833c3260a249704a7f554ef4a94c6000984728e94bb2bc9140a68dfd6fd21d5e0bbb09f6dfc98e083a45760a83ae0417b41a0196ff6d45a23a + flatted: ^3.1.0 + rimraf: ^3.0.2 + checksum: 4fdd10ecbcbf7d520f9040dd1340eb5dfe951e6f0ecf2252edeec03ee68d989ec8b9a20f4434270e71bcfd57800dc09b3344fca3966b2eb8f613072c7d9a2365 languageName: node linkType: hard -"@webassemblyjs/wasm-opt@npm:1.11.6": - version: 1.11.6 - resolution: "@webassemblyjs/wasm-opt@npm:1.11.6" - dependencies: - "@webassemblyjs/ast": 1.11.6 - "@webassemblyjs/helper-buffer": 1.11.6 - "@webassemblyjs/wasm-gen": 1.11.6 - "@webassemblyjs/wasm-parser": 1.11.6 - checksum: b4557f195487f8e97336ddf79f7bef40d788239169aac707f6eaa2fa5fe243557c2d74e550a8e57f2788e70c7ae4e7d32f7be16101afe183d597b747a3bdd528 +"flatted@npm:^3.1.0": + version: 3.2.7 + resolution: "flatted@npm:3.2.7" + checksum: 427633049d55bdb80201c68f7eb1cbd533e03eac541f97d3aecab8c5526f12a20ccecaeede08b57503e772c769e7f8680b37e8d482d1e5f8d7e2194687f9ea35 languageName: node linkType: hard -"@webassemblyjs/wasm-parser@npm:1.11.6, @webassemblyjs/wasm-parser@npm:^1.11.5": - version: 1.11.6 - resolution: "@webassemblyjs/wasm-parser@npm:1.11.6" - dependencies: - "@webassemblyjs/ast": 1.11.6 - "@webassemblyjs/helper-api-error": 1.11.6 - "@webassemblyjs/helper-wasm-bytecode": 1.11.6 - "@webassemblyjs/ieee754": 1.11.6 - "@webassemblyjs/leb128": 1.11.6 - "@webassemblyjs/utf8": 1.11.6 - checksum: 8200a8d77c15621724a23fdabe58d5571415cda98a7058f542e670ea965dd75499f5e34a48675184947c66f3df23adf55df060312e6d72d57908e3f049620d8a +"fs.realpath@npm:^1.0.0": + version: 1.0.0 + resolution: "fs.realpath@npm:1.0.0" + checksum: 99ddea01a7e75aa276c250a04eedeffe5662bce66c65c07164ad6264f9de18fb21be9433ead460e54cff20e31721c811f4fb5d70591799df5f85dce6d6746fd0 languageName: node linkType: hard -"@webassemblyjs/wast-printer@npm:1.11.6": - version: 1.11.6 - resolution: "@webassemblyjs/wast-printer@npm:1.11.6" +"glob-parent@npm:^6.0.2": + version: 6.0.2 + resolution: "glob-parent@npm:6.0.2" dependencies: - "@webassemblyjs/ast": 1.11.6 - "@xtuc/long": 4.2.2 - checksum: d2fa6a4c427325ec81463e9c809aa6572af6d47f619f3091bf4c4a6fc34f1da3df7caddaac50b8e7a457f8784c62cd58c6311b6cb69b0162ccd8d4c072f79cf8 - languageName: node - linkType: hard - -"@webpack-cli/configtest@npm:^2.1.1": - version: 2.1.1 - resolution: "@webpack-cli/configtest@npm:2.1.1" - peerDependencies: - webpack: 5.x.x - webpack-cli: 5.x.x - checksum: 9f9f9145c2d05471fc83d426db1df85cf49f329836b0c4b9f46b6948bed4b013464c00622b136d2a0a26993ce2306976682592245b08ee717500b1db45009a72 - languageName: node - linkType: hard - -"@webpack-cli/info@npm:^2.0.2": - version: 2.0.2 - resolution: "@webpack-cli/info@npm:2.0.2" - peerDependencies: - webpack: 5.x.x - webpack-cli: 5.x.x - checksum: 8f9a178afca5c82e113aed1efa552d64ee5ae4fdff63fe747c096a981ec74f18a5d07bd6e89bbe6715c3e57d96eea024a410e58977169489fe1df044c10dd94e - languageName: node - linkType: hard - -"@webpack-cli/serve@npm:^2.0.5": - version: 2.0.5 - resolution: "@webpack-cli/serve@npm:2.0.5" - peerDependencies: - webpack: 5.x.x - webpack-cli: 5.x.x - peerDependenciesMeta: - webpack-dev-server: - optional: true - checksum: 75f0e54681796d567a71ac3e2781d2901a8d8cf1cdfc82f261034dddac59a8343e8c3bc5e32b4bb9d6766759ba49fb29a5cd86ef1701d79c506fe886bb63ac75 - languageName: node - linkType: hard - -"@xtuc/ieee754@npm:^1.2.0": - version: 1.2.0 - resolution: "@xtuc/ieee754@npm:1.2.0" - checksum: ac56d4ca6e17790f1b1677f978c0c6808b1900a5b138885d3da21732f62e30e8f0d9120fcf8f6edfff5100ca902b46f8dd7c1e3f903728634523981e80e2885a + is-glob: ^4.0.3 + checksum: c13ee97978bef4f55106b71e66428eb1512e71a7466ba49025fc2aec59a5bfb0954d5abd58fc5ee6c9b076eef4e1f6d3375c2e964b88466ca390da4419a786a8 languageName: node linkType: hard -"@xtuc/long@npm:4.2.2": - version: 4.2.2 - resolution: "@xtuc/long@npm:4.2.2" - checksum: 8ed0d477ce3bc9c6fe2bf6a6a2cc316bb9c4127c5a7827bae947fa8ec34c7092395c5a283cc300c05b5fa01cbbfa1f938f410a7bf75db7c7846fea41949989ec +"glob@npm:^7.1.3": + version: 7.2.3 + resolution: "glob@npm:7.2.3" + dependencies: + fs.realpath: ^1.0.0 + inflight: ^1.0.4 + inherits: 2 + minimatch: ^3.1.1 + once: ^1.3.0 + path-is-absolute: ^1.0.0 + checksum: 29452e97b38fa704dabb1d1045350fb2467cf0277e155aa9ff7077e90ad81d1ea9d53d3ee63bd37c05b09a065e90f16aec4a65f5b8de401d1dac40bc5605d133 languageName: node linkType: hard -"abbrev@npm:^1.0.0": - version: 1.1.1 - resolution: "abbrev@npm:1.1.1" - checksum: a4a97ec07d7ea112c517036882b2ac22f3109b7b19077dc656316d07d308438aac28e4d9746dc4d84bf6b1e75b4a7b0a5f3cb30592419f128ca9a8cee3bcfa17 +"globals@npm:^13.19.0": + version: 13.20.0 + resolution: "globals@npm:13.20.0" + dependencies: + type-fest: ^0.20.2 + checksum: ad1ecf914bd051325faad281d02ea2c0b1df5d01bd94d368dcc5513340eac41d14b3c61af325768e3c7f8d44576e72780ec0b6f2d366121f8eec6e03c3a3b97a languageName: node linkType: hard -"acorn-import-assertions@npm:^1.9.0": - version: 1.9.0 - resolution: "acorn-import-assertions@npm:1.9.0" - peerDependencies: - acorn: ^8 - checksum: 944fb2659d0845c467066bdcda2e20c05abe3aaf11972116df457ce2627628a81764d800dd55031ba19de513ee0d43bb771bc679cc0eda66dc8b4fade143bc0c +"graphemer@npm:^1.4.0": + version: 1.4.0 + resolution: "graphemer@npm:1.4.0" + checksum: bab8f0be9b568857c7bec9fda95a89f87b783546d02951c40c33f84d05bb7da3fd10f863a9beb901463669b6583173a8c8cc6d6b306ea2b9b9d5d3d943c3a673 languageName: node linkType: hard -"acorn-jsx@npm:^5.3.2": - version: 5.3.2 - resolution: "acorn-jsx@npm:5.3.2" - peerDependencies: - acorn: ^6.0.0 || ^7.0.0 || ^8.0.0 - checksum: c3d3b2a89c9a056b205b69530a37b972b404ee46ec8e5b341666f9513d3163e2a4f214a71f4dfc7370f5a9c07472d2fd1c11c91c3f03d093e37637d95da98950 +"has-flag@npm:^4.0.0": + version: 4.0.0 + resolution: "has-flag@npm:4.0.0" + checksum: 261a1357037ead75e338156b1f9452c016a37dcd3283a972a30d9e4a87441ba372c8b81f818cd0fbcd9c0354b4ae7e18b9e1afa1971164aef6d18c2b6095a8ad languageName: node linkType: hard -"acorn@npm:^8.7.1, acorn@npm:^8.8.2, acorn@npm:^8.9.0": - version: 8.10.0 - resolution: "acorn@npm:8.10.0" +"husky@npm:^8.0.0": + version: 8.0.3 + resolution: "husky@npm:8.0.3" bin: - acorn: bin/acorn - checksum: 538ba38af0cc9e5ef983aee196c4b8b4d87c0c94532334fa7e065b2c8a1f85863467bb774231aae91613fcda5e68740c15d97b1967ae3394d20faddddd8af61d - languageName: node - linkType: hard - -"agent-base@npm:6, agent-base@npm:^6.0.2": - version: 6.0.2 - resolution: "agent-base@npm:6.0.2" - dependencies: - debug: 4 - checksum: f52b6872cc96fd5f622071b71ef200e01c7c4c454ee68bc9accca90c98cfb39f2810e3e9aa330435835eedc8c23f4f8a15267f67c6e245d2b33757575bdac49d + husky: lib/bin.js + checksum: 837bc7e4413e58c1f2946d38fb050f5d7324c6f16b0fd66411ffce5703b294bd21429e8ba58711cd331951ee86ed529c5be4f76805959ff668a337dbfa82a1b0 languageName: node linkType: hard -"agentkeepalive@npm:^4.2.1": - version: 4.3.0 - resolution: "agentkeepalive@npm:4.3.0" - dependencies: - debug: ^4.1.0 - depd: ^2.0.0 - humanize-ms: ^1.2.1 - checksum: 982453aa44c11a06826c836025e5162c846e1200adb56f2d075400da7d32d87021b3b0a58768d949d824811f5654223d5a8a3dad120921a2439625eb847c6260 +"ignore@npm:^5.2.0": + version: 5.2.4 + resolution: "ignore@npm:5.2.4" + checksum: 3d4c309c6006e2621659311783eaea7ebcd41fe4ca1d78c91c473157ad6666a57a2df790fe0d07a12300d9aac2888204d7be8d59f9aaf665b1c7fcdb432517ef languageName: node linkType: hard -"aggregate-error@npm:^3.0.0": - version: 3.1.0 - resolution: "aggregate-error@npm:3.1.0" +"import-fresh@npm:^3.2.1": + version: 3.3.0 + resolution: "import-fresh@npm:3.3.0" dependencies: - clean-stack: ^2.0.0 - indent-string: ^4.0.0 - checksum: 1101a33f21baa27a2fa8e04b698271e64616b886795fd43c31068c07533c7b3facfcaf4e9e0cab3624bd88f729a592f1c901a1a229c9e490eafce411a8644b79 + parent-module: ^1.0.0 + resolve-from: ^4.0.0 + checksum: 2cacfad06e652b1edc50be650f7ec3be08c5e5a6f6d12d035c440a42a8cc028e60a5b99ca08a77ab4d6b1346da7d971915828f33cdab730d3d42f08242d09baa languageName: node linkType: hard -"ajv-keywords@npm:^3.5.2": - version: 3.5.2 - resolution: "ajv-keywords@npm:3.5.2" - peerDependencies: - ajv: ^6.9.1 - checksum: 7dc5e5931677a680589050f79dcbe1fefbb8fea38a955af03724229139175b433c63c68f7ae5f86cf8f65d55eb7c25f75a046723e2e58296707617ca690feae9 +"imurmurhash@npm:^0.1.4": + version: 0.1.4 + resolution: "imurmurhash@npm:0.1.4" + checksum: 7cae75c8cd9a50f57dadd77482359f659eaebac0319dd9368bcd1714f55e65badd6929ca58569da2b6494ef13fdd5598cd700b1eba23f8b79c5f19d195a3ecf7 languageName: node linkType: hard -"ajv@npm:^6.12.4, ajv@npm:^6.12.5": - version: 6.12.6 - resolution: "ajv@npm:6.12.6" +"inflight@npm:^1.0.4": + version: 1.0.6 + resolution: "inflight@npm:1.0.6" dependencies: - fast-deep-equal: ^3.1.1 - fast-json-stable-stringify: ^2.0.0 - json-schema-traverse: ^0.4.1 - uri-js: ^4.2.2 - checksum: 874972efe5c4202ab0a68379481fbd3d1b5d0a7bd6d3cc21d40d3536ebff3352a2a1fabb632d4fd2cc7fe4cbdcd5ed6782084c9bbf7f32a1536d18f9da5007d4 - languageName: node - linkType: hard - -"ansi-colors@npm:4.1.1": - version: 4.1.1 - resolution: "ansi-colors@npm:4.1.1" - checksum: 138d04a51076cb085da0a7e2d000c5c0bb09f6e772ed5c65c53cb118d37f6c5f1637506d7155fb5f330f0abcf6f12fa2e489ac3f8cdab9da393bf1bb4f9a32b0 + once: ^1.3.0 + wrappy: 1 + checksum: f4f76aa072ce19fae87ce1ef7d221e709afb59d445e05d47fba710e85470923a75de35bfae47da6de1b18afc3ce83d70facf44cfb0aff89f0a3f45c0a0244dfd languageName: node linkType: hard -"ansi-regex@npm:^5.0.1": - version: 5.0.1 - resolution: "ansi-regex@npm:5.0.1" - checksum: 2aa4bb54caf2d622f1afdad09441695af2a83aa3fe8b8afa581d205e57ed4261c183c4d3877cee25794443fde5876417d859c108078ab788d6af7e4fe52eb66b +"inherits@npm:2": + version: 2.0.4 + resolution: "inherits@npm:2.0.4" + checksum: 4a48a733847879d6cf6691860a6b1e3f0f4754176e4d71494c41f3475553768b10f84b5ce1d40fbd0e34e6bfbb864ee35858ad4dd2cf31e02fc4a154b724d7f1 languageName: node linkType: hard -"ansi-regex@npm:^6.0.1": - version: 6.0.1 - resolution: "ansi-regex@npm:6.0.1" - checksum: 1ff8b7667cded1de4fa2c9ae283e979fc87036864317da86a2e546725f96406746411d0d85e87a2d12fa5abd715d90006de7fa4fa0477c92321ad3b4c7d4e169 +"is-extglob@npm:^2.1.1": + version: 2.1.1 + resolution: "is-extglob@npm:2.1.1" + checksum: df033653d06d0eb567461e58a7a8c9f940bd8c22274b94bf7671ab36df5719791aae15eef6d83bbb5e23283967f2f984b8914559d4449efda578c775c4be6f85 languageName: node linkType: hard -"ansi-styles@npm:^4.0.0, ansi-styles@npm:^4.1.0": - version: 4.3.0 - resolution: "ansi-styles@npm:4.3.0" +"is-glob@npm:^4.0.0, is-glob@npm:^4.0.3": + version: 4.0.3 + resolution: "is-glob@npm:4.0.3" dependencies: - color-convert: ^2.0.1 - checksum: 513b44c3b2105dd14cc42a19271e80f386466c4be574bccf60b627432f9198571ebf4ab1e4c3ba17347658f4ee1711c163d574248c0c1cdc2d5917a0ad582ec4 - languageName: node - linkType: hard - -"ansi-styles@npm:^6.1.0": - version: 6.2.1 - resolution: "ansi-styles@npm:6.2.1" - checksum: ef940f2f0ced1a6347398da88a91da7930c33ecac3c77b72c5905f8b8fe402c52e6fde304ff5347f616e27a742da3f1dc76de98f6866c69251ad0b07a66776d9 + is-extglob: ^2.1.1 + checksum: d381c1319fcb69d341cc6e6c7cd588e17cd94722d9a32dbd60660b993c4fb7d0f19438674e68dfec686d09b7c73139c9166b47597f846af387450224a8101ab4 languageName: node linkType: hard -"anymatch@npm:~3.1.2": - version: 3.1.3 - resolution: "anymatch@npm:3.1.3" - dependencies: - normalize-path: ^3.0.0 - picomatch: ^2.0.4 - checksum: 3e044fd6d1d26545f235a9fe4d7a534e2029d8e59fa7fd9f2a6eb21230f6b5380ea1eaf55136e60cbf8e613544b3b766e7a6fa2102e2a3a117505466e3025dc2 +"is-path-inside@npm:^3.0.3": + version: 3.0.3 + resolution: "is-path-inside@npm:3.0.3" + checksum: abd50f06186a052b349c15e55b182326f1936c89a78bf6c8f2b707412517c097ce04bc49a0ca221787bc44e1049f51f09a2ffb63d22899051988d3a618ba13e9 languageName: node linkType: hard -"aproba@npm:^1.0.3 || ^2.0.0": +"isexe@npm:^2.0.0": version: 2.0.0 - resolution: "aproba@npm:2.0.0" - checksum: 5615cadcfb45289eea63f8afd064ab656006361020e1735112e346593856f87435e02d8dcc7ff0d11928bc7d425f27bc7c2a84f6c0b35ab0ff659c814c138a24 + resolution: "isexe@npm:2.0.0" + checksum: 26bf6c5480dda5161c820c5b5c751ae1e766c587b1f951ea3fcfc973bafb7831ae5b54a31a69bd670220e42e99ec154475025a468eae58ea262f813fdc8d1c62 languageName: node linkType: hard -"are-we-there-yet@npm:^3.0.0": - version: 3.0.1 - resolution: "are-we-there-yet@npm:3.0.1" +"js-yaml@npm:^4.1.0": + version: 4.1.0 + resolution: "js-yaml@npm:4.1.0" dependencies: - delegates: ^1.0.0 - readable-stream: ^3.6.0 - checksum: 52590c24860fa7173bedeb69a4c05fb573473e860197f618b9a28432ee4379049336727ae3a1f9c4cb083114601c1140cee578376164d0e651217a9843f9fe83 + argparse: ^2.0.1 + bin: + js-yaml: bin/js-yaml.js + checksum: c7830dfd456c3ef2c6e355cc5a92e6700ceafa1d14bba54497b34a99f0376cecbb3e9ac14d3e5849b426d5a5140709a66237a8c991c675431271c4ce5504151a languageName: node linkType: hard -"argparse@npm:^2.0.1": - version: 2.0.1 - resolution: "argparse@npm:2.0.1" - checksum: 83644b56493e89a254bae05702abf3a1101b4fa4d0ca31df1c9985275a5a5bd47b3c27b7fa0b71098d41114d8ca000e6ed90cad764b306f8a503665e4d517ced +"json-schema-traverse@npm:^0.4.1": + version: 0.4.1 + resolution: "json-schema-traverse@npm:0.4.1" + checksum: 7486074d3ba247769fda17d5181b345c9fb7d12e0da98b22d1d71a5db9698d8b4bd900a3ec1a4ffdd60846fc2556274a5c894d0c48795f14cb03aeae7b55260b languageName: node linkType: hard -"array-union@npm:^2.1.0": - version: 2.1.0 - resolution: "array-union@npm:2.1.0" - checksum: 5bee12395cba82da674931df6d0fea23c4aa4660cb3b338ced9f828782a65caa232573e6bf3968f23e0c5eb301764a382cef2f128b170a9dc59de0e36c39f98d +"json-stable-stringify-without-jsonify@npm:^1.0.1": + version: 1.0.1 + resolution: "json-stable-stringify-without-jsonify@npm:1.0.1" + checksum: cff44156ddce9c67c44386ad5cddf91925fe06b1d217f2da9c4910d01f358c6e3989c4d5a02683c7a5667f9727ff05831f7aa8ae66c8ff691c556f0884d49215 languageName: node linkType: hard -"balanced-match@npm:^1.0.0": - version: 1.0.2 - resolution: "balanced-match@npm:1.0.2" - checksum: 9706c088a283058a8a99e0bf91b0a2f75497f185980d9ffa8b304de1d9e58ebda7c72c07ebf01dadedaac5b2907b2c6f566f660d62bd336c3468e960403b9d65 +"levn@npm:^0.4.1": + version: 0.4.1 + resolution: "levn@npm:0.4.1" + dependencies: + prelude-ls: ^1.2.1 + type-check: ~0.4.0 + checksum: 12c5021c859bd0f5248561bf139121f0358285ec545ebf48bb3d346820d5c61a4309535c7f387ed7d84361cf821e124ce346c6b7cef8ee09a67c1473b46d0fc4 languageName: node linkType: hard -"binary-extensions@npm:^2.0.0": - version: 2.2.0 - resolution: "binary-extensions@npm:2.2.0" - checksum: ccd267956c58d2315f5d3ea6757cf09863c5fc703e50fbeb13a7dc849b812ef76e3cf9ca8f35a0c48498776a7478d7b4a0418e1e2b8cb9cb9731f2922aaad7f8 +"locate-path@npm:^6.0.0": + version: 6.0.0 + resolution: "locate-path@npm:6.0.0" + dependencies: + p-locate: ^5.0.0 + checksum: 72eb661788a0368c099a184c59d2fee760b3831c9c1c33955e8a19ae4a21b4116e53fa736dc086cdeb9fce9f7cc508f2f92d2d3aae516f133e16a2bb59a39f5a languageName: node linkType: hard -"brace-expansion@npm:^1.1.7": - version: 1.1.11 - resolution: "brace-expansion@npm:1.1.11" - dependencies: - balanced-match: ^1.0.0 - concat-map: 0.0.1 - checksum: faf34a7bb0c3fcf4b59c7808bc5d2a96a40988addf2e7e09dfbb67a2251800e0d14cd2bfc1aa79174f2f5095c54ff27f46fb1289fe2d77dac755b5eb3434cc07 +"lodash.merge@npm:^4.6.2": + version: 4.6.2 + resolution: "lodash.merge@npm:4.6.2" + checksum: ad580b4bdbb7ca1f7abf7e1bce63a9a0b98e370cf40194b03380a46b4ed799c9573029599caebc1b14e3f24b111aef72b96674a56cfa105e0f5ac70546cdc005 languageName: node linkType: hard -"brace-expansion@npm:^2.0.1": - version: 2.0.1 - resolution: "brace-expansion@npm:2.0.1" +"minimatch@npm:^3.0.5, minimatch@npm:^3.1.1, minimatch@npm:^3.1.2": + version: 3.1.2 + resolution: "minimatch@npm:3.1.2" dependencies: - balanced-match: ^1.0.0 - checksum: a61e7cd2e8a8505e9f0036b3b6108ba5e926b4b55089eeb5550cd04a471fe216c96d4fe7e4c7f995c728c554ae20ddfc4244cad10aef255e72b62930afd233d1 + brace-expansion: ^1.1.7 + checksum: c154e566406683e7bcb746e000b84d74465b3a832c45d59912b9b55cd50dee66e5c4b1e5566dba26154040e51672f9aa450a9aef0c97cfc7336b78b7afb9540a languageName: node linkType: hard -"braces@npm:^3.0.2, braces@npm:~3.0.2": - version: 3.0.2 - resolution: "braces@npm:3.0.2" - dependencies: - fill-range: ^7.0.1 - checksum: e2a8e769a863f3d4ee887b5fe21f63193a891c68b612ddb4b68d82d1b5f3ff9073af066c343e9867a393fe4c2555dcb33e89b937195feb9c1613d259edfcd459 +"ms@npm:2.1.2": + version: 2.1.2 + resolution: "ms@npm:2.1.2" + checksum: 673cdb2c3133eb050c745908d8ce632ed2c02d85640e2edb3ace856a2266a813b30c613569bf3354fdf4ea7d1a1494add3bfa95e2713baa27d0c2c71fc44f58f languageName: node linkType: hard -"browser-stdout@npm:1.3.1": - version: 1.3.1 - resolution: "browser-stdout@npm:1.3.1" - checksum: b717b19b25952dd6af483e368f9bcd6b14b87740c3d226c2977a65e84666ffd67000bddea7d911f111a9b6ddc822b234de42d52ab6507bce4119a4cc003ef7b3 +"natural-compare@npm:^1.4.0": + version: 1.4.0 + resolution: "natural-compare@npm:1.4.0" + checksum: 23ad088b08f898fc9b53011d7bb78ec48e79de7627e01ab5518e806033861bef68d5b0cd0e2205c2f36690ac9571ff6bcb05eb777ced2eeda8d4ac5b44592c3d languageName: node linkType: hard -"browserslist@npm:^4.14.5": - version: 4.21.10 - resolution: "browserslist@npm:4.21.10" +"once@npm:^1.3.0": + version: 1.4.0 + resolution: "once@npm:1.4.0" dependencies: - caniuse-lite: ^1.0.30001517 - electron-to-chromium: ^1.4.477 - node-releases: ^2.0.13 - update-browserslist-db: ^1.0.11 - bin: - browserslist: cli.js - checksum: 1e27c0f111a35d1dd0e8fc2c61781b0daefabc2c9471b0b10537ce54843014bceb2a1ce4571af1a82b2bf1e6e6e05d38865916689a158f03bc2c7a4ec2577db8 + wrappy: 1 + checksum: cd0a88501333edd640d95f0d2700fbde6bff20b3d4d9bdc521bdd31af0656b5706570d6c6afe532045a20bb8dc0849f8332d6f2a416e0ba6d3d3b98806c7db68 languageName: node linkType: hard -"buffer-from@npm:^1.0.0": - version: 1.1.2 - resolution: "buffer-from@npm:1.1.2" - checksum: 0448524a562b37d4d7ed9efd91685a5b77a50672c556ea254ac9a6d30e3403a517d8981f10e565db24e8339413b43c97ca2951f10e399c6125a0d8911f5679bb +"optionator@npm:^0.9.3": + version: 0.9.3 + resolution: "optionator@npm:0.9.3" + dependencies: + "@aashutoshrathi/word-wrap": ^1.2.3 + deep-is: ^0.1.3 + fast-levenshtein: ^2.0.6 + levn: ^0.4.1 + prelude-ls: ^1.2.1 + type-check: ^0.4.0 + checksum: 09281999441f2fe9c33a5eeab76700795365a061563d66b098923eb719251a42bdbe432790d35064d0816ead9296dbeb1ad51a733edf4167c96bd5d0882e428a languageName: node linkType: hard -"cacache@npm:^17.0.0": - version: 17.1.3 - resolution: "cacache@npm:17.1.3" - dependencies: - "@npmcli/fs": ^3.1.0 - fs-minipass: ^3.0.0 - glob: ^10.2.2 - lru-cache: ^7.7.1 - minipass: ^5.0.0 - minipass-collect: ^1.0.2 - minipass-flush: ^1.0.5 - minipass-pipeline: ^1.2.4 - p-map: ^4.0.0 - ssri: ^10.0.0 - tar: ^6.1.11 - unique-filename: ^3.0.0 - checksum: 385756781e1e21af089160d89d7462b7ed9883c978e848c7075b90b73cb823680e66092d61513050164588387d2ca87dd6d910e28d64bc13a9ac82cd8580c796 - languageName: node - linkType: hard - -"cairo@workspace:toolchains/cairo": +"osmium-manager@workspace:manager": version: 0.0.0-use.local - resolution: "cairo@workspace:toolchains/cairo" + resolution: "osmium-manager@workspace:manager" languageName: unknown linkType: soft -"callsites@npm:^3.0.0": - version: 3.1.0 - resolution: "callsites@npm:3.1.0" - checksum: 072d17b6abb459c2ba96598918b55868af677154bec7e73d222ef95a8fdb9bbf7dae96a8421085cdad8cd190d86653b5b6dc55a4484f2e5b2e27d5e0c3fc15b3 - languageName: node - linkType: hard - -"camelcase@npm:^6.0.0": - version: 6.3.0 - resolution: "camelcase@npm:6.3.0" - checksum: 8c96818a9076434998511251dcb2761a94817ea17dbdc37f47ac080bd088fc62c7369429a19e2178b993497132c8cbcf5cc1f44ba963e76782ba469c0474938d - languageName: node - linkType: hard - -"caniuse-lite@npm:^1.0.30001517": - version: 1.0.30001517 - resolution: "caniuse-lite@npm:1.0.30001517" - checksum: e4e87436ae1c4408cf4438aac22902b31eb03f3f5bad7f33bc518d12ffb35f3fd9395ccf7efc608ee046f90ce324ec6f7f26f8a8172b8c43c26a06ecee612a29 - languageName: node - linkType: hard - -"chalk@npm:^4.0.0, chalk@npm:^4.1.0": - version: 4.1.2 - resolution: "chalk@npm:4.1.2" - dependencies: - ansi-styles: ^4.1.0 - supports-color: ^7.1.0 - checksum: fe75c9d5c76a7a98d45495b91b2172fa3b7a09e0cc9370e5c8feb1c567b85c4288e2b3fded7cfdd7359ac28d6b3844feb8b82b8686842e93d23c827c417e83fc - languageName: node - linkType: hard - -"chokidar@npm:3.5.3": - version: 3.5.3 - resolution: "chokidar@npm:3.5.3" - dependencies: - anymatch: ~3.1.2 - braces: ~3.0.2 - fsevents: ~2.3.2 - glob-parent: ~5.1.2 - is-binary-path: ~2.1.0 - is-glob: ~4.0.1 - normalize-path: ~3.0.0 - readdirp: ~3.6.0 - dependenciesMeta: - fsevents: - optional: true - checksum: b49fcde40176ba007ff361b198a2d35df60d9bb2a5aab228279eb810feae9294a6b4649ab15981304447afe1e6ffbf4788ad5db77235dc770ab777c6e771980c - languageName: node - linkType: hard - -"chownr@npm:^2.0.0": - version: 2.0.0 - resolution: "chownr@npm:2.0.0" - checksum: c57cf9dd0791e2f18a5ee9c1a299ae6e801ff58fee96dc8bfd0dcb4738a6ce58dd252a3605b1c93c6418fe4f9d5093b28ffbf4d66648cb2a9c67eaef9679be2f - languageName: node - linkType: hard - -"chrome-trace-event@npm:^1.0.2": - version: 1.0.3 - resolution: "chrome-trace-event@npm:1.0.3" - checksum: cb8b1fc7e881aaef973bd0c4a43cd353c2ad8323fb471a041e64f7c2dd849cde4aad15f8b753331a32dda45c973f032c8a03b8177fc85d60eaa75e91e08bfb97 - languageName: node - linkType: hard - -"clean-stack@npm:^2.0.0": - version: 2.2.0 - resolution: "clean-stack@npm:2.2.0" - checksum: 2ac8cd2b2f5ec986a3c743935ec85b07bc174d5421a5efc8017e1f146a1cf5f781ae962618f416352103b32c9cd7e203276e8c28241bbe946160cab16149fb68 - languageName: node - linkType: hard - -"cliui@npm:^7.0.2": - version: 7.0.4 - resolution: "cliui@npm:7.0.4" - dependencies: - string-width: ^4.2.0 - strip-ansi: ^6.0.0 - wrap-ansi: ^7.0.0 - checksum: ce2e8f578a4813806788ac399b9e866297740eecd4ad1823c27fd344d78b22c5f8597d548adbcc46f0573e43e21e751f39446c5a5e804a12aace402b7a315d7f - languageName: node - linkType: hard - -"clone-deep@npm:^4.0.1": - version: 4.0.1 - resolution: "clone-deep@npm:4.0.1" - dependencies: - is-plain-object: ^2.0.4 - kind-of: ^6.0.2 - shallow-clone: ^3.0.0 - checksum: 770f912fe4e6f21873c8e8fbb1e99134db3b93da32df271d00589ea4a29dbe83a9808a322c93f3bcaf8584b8b4fa6fc269fc8032efbaa6728e0c9886c74467d2 - languageName: node - linkType: hard - -"color-convert@npm:^2.0.1": - version: 2.0.1 - resolution: "color-convert@npm:2.0.1" - dependencies: - color-name: ~1.1.4 - checksum: 79e6bdb9fd479a205c71d89574fccfb22bd9053bd98c6c4d870d65c132e5e904e6034978e55b43d69fcaa7433af2016ee203ce76eeba9cfa554b373e7f7db336 - languageName: node - linkType: hard - -"color-name@npm:~1.1.4": - version: 1.1.4 - resolution: "color-name@npm:1.1.4" - checksum: b0445859521eb4021cd0fb0cc1a75cecf67fceecae89b63f62b201cca8d345baf8b952c966862a9d9a2632987d4f6581f0ec8d957dfacece86f0a7919316f610 - languageName: node - linkType: hard - -"color-support@npm:^1.1.3": - version: 1.1.3 - resolution: "color-support@npm:1.1.3" - bin: - color-support: bin.js - checksum: 9b7356817670b9a13a26ca5af1c21615463b500783b739b7634a0c2047c16cef4b2865d7576875c31c3cddf9dd621fa19285e628f20198b233a5cfdda6d0793b - languageName: node - linkType: hard - -"colorette@npm:^2.0.14": - version: 2.0.20 - resolution: "colorette@npm:2.0.20" - checksum: 0c016fea2b91b733eb9f4bcdb580018f52c0bc0979443dad930e5037a968237ac53d9beb98e218d2e9235834f8eebce7f8e080422d6194e957454255bde71d3d - languageName: node - linkType: hard - -"commander@npm:^10.0.1": - version: 10.0.1 - resolution: "commander@npm:10.0.1" - checksum: 436901d64a818295803c1996cd856621a74f30b9f9e28a588e726b2b1670665bccd7c1a77007ebf328729f0139838a88a19265858a0fa7a8728c4656796db948 - languageName: node - linkType: hard - -"commander@npm:^2.20.0": - version: 2.20.3 - resolution: "commander@npm:2.20.3" - checksum: ab8c07884e42c3a8dbc5dd9592c606176c7eb5c1ca5ff274bcf907039b2c41de3626f684ea75ccf4d361ba004bbaff1f577d5384c155f3871e456bdf27becf9e - languageName: node - linkType: hard - -"concat-map@npm:0.0.1": - version: 0.0.1 - resolution: "concat-map@npm:0.0.1" - checksum: 902a9f5d8967a3e2faf138d5cb784b9979bad2e6db5357c5b21c568df4ebe62bcb15108af1b2253744844eb964fc023fbd9afbbbb6ddd0bcc204c6fb5b7bf3af - languageName: node - linkType: hard - -"console-control-strings@npm:^1.1.0": - version: 1.1.0 - resolution: "console-control-strings@npm:1.1.0" - checksum: 8755d76787f94e6cf79ce4666f0c5519906d7f5b02d4b884cf41e11dcd759ed69c57da0670afd9236d229a46e0f9cf519db0cd829c6dca820bb5a5c3def584ed - languageName: node - linkType: hard - -"core-util-is@npm:~1.0.0": - version: 1.0.3 - resolution: "core-util-is@npm:1.0.3" - checksum: 9de8597363a8e9b9952491ebe18167e3b36e7707569eed0ebf14f8bba773611376466ae34575bca8cfe3c767890c859c74056084738f09d4e4a6f902b2ad7d99 - languageName: node - linkType: hard - -"cross-spawn@npm:^7.0.0, cross-spawn@npm:^7.0.2, cross-spawn@npm:^7.0.3": - version: 7.0.3 - resolution: "cross-spawn@npm:7.0.3" - dependencies: - path-key: ^3.1.0 - shebang-command: ^2.0.0 - which: ^2.0.1 - checksum: 671cc7c7288c3a8406f3c69a3ae2fc85555c04169e9d611def9a675635472614f1c0ed0ef80955d5b6d4e724f6ced67f0ad1bb006c2ea643488fcfef994d7f52 - languageName: node - linkType: hard - -"debug@npm:4, debug@npm:4.3.4, debug@npm:^4.1.0, debug@npm:^4.1.1, debug@npm:^4.3.2, debug@npm:^4.3.3, debug@npm:^4.3.4": - version: 4.3.4 - resolution: "debug@npm:4.3.4" - dependencies: - ms: 2.1.2 - peerDependenciesMeta: - supports-color: - optional: true - checksum: 3dbad3f94ea64f34431a9cbf0bafb61853eda57bff2880036153438f50fb5a84f27683ba0d8e5426bf41a8c6ff03879488120cf5b3a761e77953169c0600a708 - languageName: node - linkType: hard - -"decamelize@npm:^4.0.0": - version: 4.0.0 - resolution: "decamelize@npm:4.0.0" - checksum: b7d09b82652c39eead4d6678bb578e3bebd848add894b76d0f6b395bc45b2d692fb88d977e7cfb93c4ed6c119b05a1347cef261174916c2e75c0a8ca57da1809 - languageName: node - linkType: hard - -"deep-is@npm:^0.1.3": - version: 0.1.4 - resolution: "deep-is@npm:0.1.4" - checksum: edb65dd0d7d1b9c40b2f50219aef30e116cedd6fc79290e740972c132c09106d2e80aa0bc8826673dd5a00222d4179c84b36a790eef63a4c4bca75a37ef90804 - languageName: node - linkType: hard - -"delegates@npm:^1.0.0": - version: 1.0.0 - resolution: "delegates@npm:1.0.0" - checksum: a51744d9b53c164ba9c0492471a1a2ffa0b6727451bdc89e31627fdf4adda9d51277cfcbfb20f0a6f08ccb3c436f341df3e92631a3440226d93a8971724771fd - languageName: node - linkType: hard - -"depd@npm:^2.0.0": - version: 2.0.0 - resolution: "depd@npm:2.0.0" - checksum: abbe19c768c97ee2eed6282d8ce3031126662252c58d711f646921c9623f9052e3e1906443066beec1095832f534e57c523b7333f8e7e0d93051ab6baef5ab3a - languageName: node - linkType: hard - -"diff@npm:5.0.0": - version: 5.0.0 - resolution: "diff@npm:5.0.0" - checksum: f19fe29284b633afdb2725c2a8bb7d25761ea54d321d8e67987ac851c5294be4afeab532bd84531e02583a3fe7f4014aa314a3eda84f5590e7a9e6b371ef3b46 - languageName: node - linkType: hard - -"dir-glob@npm:^3.0.1": - version: 3.0.1 - resolution: "dir-glob@npm:3.0.1" - dependencies: - path-type: ^4.0.0 - checksum: fa05e18324510d7283f55862f3161c6759a3f2f8dbce491a2fc14c8324c498286c54282c1f0e933cb930da8419b30679389499b919122952a4f8592362ef4615 - languageName: node - linkType: hard - -"doctrine@npm:^3.0.0": - version: 3.0.0 - resolution: "doctrine@npm:3.0.0" - dependencies: - esutils: ^2.0.2 - checksum: fd7673ca77fe26cd5cba38d816bc72d641f500f1f9b25b83e8ce28827fe2da7ad583a8da26ab6af85f834138cf8dae9f69b0cd6ab925f52ddab1754db44d99ce - languageName: node - linkType: hard - -"eastasianwidth@npm:^0.2.0": - version: 0.2.0 - resolution: "eastasianwidth@npm:0.2.0" - checksum: 7d00d7cd8e49b9afa762a813faac332dee781932d6f2c848dc348939c4253f1d4564341b7af1d041853bc3f32c2ef141b58e0a4d9862c17a7f08f68df1e0f1ed - languageName: node - linkType: hard - -"electron-to-chromium@npm:^1.4.477": - version: 1.4.477 - resolution: "electron-to-chromium@npm:1.4.477" - checksum: 1bf6117b2b58d4f18eff4f019fdffd0a68988142e095d8e59a66dbd0b6587e963b405aefc925b229959de20e3e8483849bcc41e3edb4366a359f825bc0a97377 - languageName: node - linkType: hard - -"emoji-regex@npm:^8.0.0": - version: 8.0.0 - resolution: "emoji-regex@npm:8.0.0" - checksum: d4c5c39d5a9868b5fa152f00cada8a936868fd3367f33f71be515ecee4c803132d11b31a6222b2571b1e5f7e13890156a94880345594d0ce7e3c9895f560f192 - languageName: node - linkType: hard - -"emoji-regex@npm:^9.2.2": - version: 9.2.2 - resolution: "emoji-regex@npm:9.2.2" - checksum: 8487182da74aabd810ac6d6f1994111dfc0e331b01271ae01ec1eb0ad7b5ecc2bbbbd2f053c05cb55a1ac30449527d819bbfbf0e3de1023db308cbcb47f86601 - languageName: node - linkType: hard - -"encoding@npm:^0.1.13": - version: 0.1.13 - resolution: "encoding@npm:0.1.13" - dependencies: - iconv-lite: ^0.6.2 - checksum: bb98632f8ffa823996e508ce6a58ffcf5856330fde839ae42c9e1f436cc3b5cc651d4aeae72222916545428e54fd0f6aa8862fd8d25bdbcc4589f1e3f3715e7f - languageName: node - linkType: hard - -"enhanced-resolve@npm:^5.0.0, enhanced-resolve@npm:^5.15.0": - version: 5.15.0 - resolution: "enhanced-resolve@npm:5.15.0" - dependencies: - graceful-fs: ^4.2.4 - tapable: ^2.2.0 - checksum: fbd8cdc9263be71cc737aa8a7d6c57b43d6aa38f6cc75dde6fcd3598a130cc465f979d2f4d01bb3bf475acb43817749c79f8eef9be048683602ca91ab52e4f11 - languageName: node - linkType: hard - -"env-paths@npm:^2.2.0": - version: 2.2.1 - resolution: "env-paths@npm:2.2.1" - checksum: 65b5df55a8bab92229ab2b40dad3b387fad24613263d103a97f91c9fe43ceb21965cd3392b1ccb5d77088021e525c4e0481adb309625d0cb94ade1d1fb8dc17e - languageName: node - linkType: hard - -"envinfo@npm:^7.7.3": - version: 7.10.0 - resolution: "envinfo@npm:7.10.0" - bin: - envinfo: dist/cli.js - checksum: 05e81a5768c42cbd5c580dc3f274db3401facadd53e9bd52e2aa49dfbb5d8b26f6181c25a6652d79618a6994185bd2b1c137673101690b147f758e4e71d42f7d - languageName: node - linkType: hard - -"err-code@npm:^2.0.2": - version: 2.0.3 - resolution: "err-code@npm:2.0.3" - checksum: 8b7b1be20d2de12d2255c0bc2ca638b7af5171142693299416e6a9339bd7d88fc8d7707d913d78e0993176005405a236b066b45666b27b797252c771156ace54 - languageName: node - linkType: hard - -"es-module-lexer@npm:^1.2.1": - version: 1.3.0 - resolution: "es-module-lexer@npm:1.3.0" - checksum: 48fd9f504a9d2a894126f75c8b7ccc6273a289983e9b67255f165bfd9ae765d50100218251e94e702ca567826905ea2f7b3b4a0c4d74d3ce99cce3a2a606a238 - languageName: node - linkType: hard - -"escalade@npm:^3.1.1": - version: 3.1.1 - resolution: "escalade@npm:3.1.1" - checksum: a3e2a99f07acb74b3ad4989c48ca0c3140f69f923e56d0cba0526240ee470b91010f9d39001f2a4a313841d237ede70a729e92125191ba5d21e74b106800b133 - languageName: node - linkType: hard - -"escape-string-regexp@npm:4.0.0, escape-string-regexp@npm:^4.0.0": - version: 4.0.0 - resolution: "escape-string-regexp@npm:4.0.0" - checksum: 98b48897d93060f2322108bf29db0feba7dd774be96cd069458d1453347b25ce8682ecc39859d4bca2203cc0ab19c237bcc71755eff49a0f8d90beadeeba5cc5 - languageName: node - linkType: hard - -"eslint-scope@npm:5.1.1, eslint-scope@npm:^5.1.1": - version: 5.1.1 - resolution: "eslint-scope@npm:5.1.1" - dependencies: - esrecurse: ^4.3.0 - estraverse: ^4.1.1 - checksum: 47e4b6a3f0cc29c7feedee6c67b225a2da7e155802c6ea13bbef4ac6b9e10c66cd2dcb987867ef176292bf4e64eccc680a49e35e9e9c669f4a02bac17e86abdb - languageName: node - linkType: hard - -"eslint-scope@npm:^7.2.2": - version: 7.2.2 - resolution: "eslint-scope@npm:7.2.2" - dependencies: - esrecurse: ^4.3.0 - estraverse: ^5.2.0 - checksum: ec97dbf5fb04b94e8f4c5a91a7f0a6dd3c55e46bfc7bbcd0e3138c3a76977570e02ed89a1810c778dcd72072ff0e9621ba1379b4babe53921d71e2e4486fda3e - languageName: node - linkType: hard - -"eslint-visitor-keys@npm:^3.3.0, eslint-visitor-keys@npm:^3.4.1, eslint-visitor-keys@npm:^3.4.2": - version: 3.4.2 - resolution: "eslint-visitor-keys@npm:3.4.2" - checksum: 9e0e7e4aaea705c097ae37c97410e5f167d4d2193be2edcb1f0760762ede3df01545e4820ae314f42dcec687745f2c6dcaf6d83575c4a2a241eb0c8517d724f2 - languageName: node - linkType: hard - -"eslint@npm:^8.41.0, eslint@npm:^8.46.0": - version: 8.46.0 - resolution: "eslint@npm:8.46.0" - dependencies: - "@eslint-community/eslint-utils": ^4.2.0 - "@eslint-community/regexpp": ^4.6.1 - "@eslint/eslintrc": ^2.1.1 - "@eslint/js": ^8.46.0 - "@humanwhocodes/config-array": ^0.11.10 - "@humanwhocodes/module-importer": ^1.0.1 - "@nodelib/fs.walk": ^1.2.8 - ajv: ^6.12.4 - chalk: ^4.0.0 - cross-spawn: ^7.0.2 - debug: ^4.3.2 - doctrine: ^3.0.0 - escape-string-regexp: ^4.0.0 - eslint-scope: ^7.2.2 - eslint-visitor-keys: ^3.4.2 - espree: ^9.6.1 - esquery: ^1.4.2 - esutils: ^2.0.2 - fast-deep-equal: ^3.1.3 - file-entry-cache: ^6.0.1 - find-up: ^5.0.0 - glob-parent: ^6.0.2 - globals: ^13.19.0 - graphemer: ^1.4.0 - ignore: ^5.2.0 - imurmurhash: ^0.1.4 - is-glob: ^4.0.0 - is-path-inside: ^3.0.3 - js-yaml: ^4.1.0 - json-stable-stringify-without-jsonify: ^1.0.1 - levn: ^0.4.1 - lodash.merge: ^4.6.2 - minimatch: ^3.1.2 - natural-compare: ^1.4.0 - optionator: ^0.9.3 - strip-ansi: ^6.0.1 - text-table: ^0.2.0 - bin: - eslint: bin/eslint.js - checksum: 7a7d36b1a3bbc12e08fbb5bc36fd482a7a5a1797e62e762499dd45601b9e45aaa53a129f31ce0b4444551a9639b8b681ad535f379893dd1e3ae37b31dccd82aa - languageName: node - linkType: hard - -"espree@npm:^9.6.0, espree@npm:^9.6.1": - version: 9.6.1 - resolution: "espree@npm:9.6.1" - dependencies: - acorn: ^8.9.0 - acorn-jsx: ^5.3.2 - eslint-visitor-keys: ^3.4.1 - checksum: eb8c149c7a2a77b3f33a5af80c10875c3abd65450f60b8af6db1bfcfa8f101e21c1e56a561c6dc13b848e18148d43469e7cd208506238554fb5395a9ea5a1ab9 - languageName: node - linkType: hard - -"esquery@npm:^1.4.2": - version: 1.5.0 - resolution: "esquery@npm:1.5.0" - dependencies: - estraverse: ^5.1.0 - checksum: aefb0d2596c230118656cd4ec7532d447333a410a48834d80ea648b1e7b5c9bc9ed8b5e33a89cb04e487b60d622f44cf5713bf4abed7c97343edefdc84a35900 - languageName: node - linkType: hard - -"esrecurse@npm:^4.3.0": - version: 4.3.0 - resolution: "esrecurse@npm:4.3.0" - dependencies: - estraverse: ^5.2.0 - checksum: ebc17b1a33c51cef46fdc28b958994b1dc43cd2e86237515cbc3b4e5d2be6a811b2315d0a1a4d9d340b6d2308b15322f5c8291059521cc5f4802f65e7ec32837 - languageName: node - linkType: hard - -"estraverse@npm:^4.1.1": - version: 4.3.0 - resolution: "estraverse@npm:4.3.0" - checksum: a6299491f9940bb246124a8d44b7b7a413a8336f5436f9837aaa9330209bd9ee8af7e91a654a3545aee9c54b3308e78ee360cef1d777d37cfef77d2fa33b5827 - languageName: node - linkType: hard - -"estraverse@npm:^5.1.0, estraverse@npm:^5.2.0": - version: 5.3.0 - resolution: "estraverse@npm:5.3.0" - checksum: 072780882dc8416ad144f8fe199628d2b3e7bbc9989d9ed43795d2c90309a2047e6bc5979d7e2322a341163d22cfad9e21f4110597fe487519697389497e4e2b - languageName: node - linkType: hard - -"esutils@npm:^2.0.2": - version: 2.0.3 - resolution: "esutils@npm:2.0.3" - checksum: 22b5b08f74737379a840b8ed2036a5fb35826c709ab000683b092d9054e5c2a82c27818f12604bfc2a9a76b90b6834ef081edbc1c7ae30d1627012e067c6ec87 - languageName: node - linkType: hard - -"events@npm:^3.2.0": - version: 3.3.0 - resolution: "events@npm:3.3.0" - checksum: f6f487ad2198aa41d878fa31452f1a3c00958f46e9019286ff4787c84aac329332ab45c9cdc8c445928fc6d7ded294b9e005a7fce9426488518017831b272780 - languageName: node - linkType: hard - -"exponential-backoff@npm:^3.1.1": - version: 3.1.1 - resolution: "exponential-backoff@npm:3.1.1" - checksum: 3d21519a4f8207c99f7457287291316306255a328770d320b401114ec8481986e4e467e854cb9914dd965e0a1ca810a23ccb559c642c88f4c7f55c55778a9b48 - languageName: node - linkType: hard - -"fast-deep-equal@npm:^3.1.1, fast-deep-equal@npm:^3.1.3": - version: 3.1.3 - resolution: "fast-deep-equal@npm:3.1.3" - checksum: e21a9d8d84f53493b6aa15efc9cfd53dd5b714a1f23f67fb5dc8f574af80df889b3bce25dc081887c6d25457cce704e636395333abad896ccdec03abaf1f3f9d - languageName: node - linkType: hard - -"fast-glob@npm:^3.2.9": - version: 3.3.1 - resolution: "fast-glob@npm:3.3.1" - dependencies: - "@nodelib/fs.stat": ^2.0.2 - "@nodelib/fs.walk": ^1.2.3 - glob-parent: ^5.1.2 - merge2: ^1.3.0 - micromatch: ^4.0.4 - checksum: b6f3add6403e02cf3a798bfbb1183d0f6da2afd368f27456010c0bc1f9640aea308243d4cb2c0ab142f618276e65ecb8be1661d7c62a7b4e5ba774b9ce5432e5 - languageName: node - linkType: hard - -"fast-json-stable-stringify@npm:^2.0.0": - version: 2.1.0 - resolution: "fast-json-stable-stringify@npm:2.1.0" - checksum: b191531e36c607977e5b1c47811158733c34ccb3bfde92c44798929e9b4154884378536d26ad90dfecd32e1ffc09c545d23535ad91b3161a27ddbb8ebe0cbecb - languageName: node - linkType: hard - -"fast-levenshtein@npm:^2.0.6": - version: 2.0.6 - resolution: "fast-levenshtein@npm:2.0.6" - checksum: 92cfec0a8dfafd9c7a15fba8f2cc29cd0b62b85f056d99ce448bbcd9f708e18ab2764bda4dd5158364f4145a7c72788538994f0d1787b956ef0d1062b0f7c24c - languageName: node - linkType: hard - -"fastest-levenshtein@npm:^1.0.12": - version: 1.0.16 - resolution: "fastest-levenshtein@npm:1.0.16" - checksum: a78d44285c9e2ae2c25f3ef0f8a73f332c1247b7ea7fb4a191e6bb51aa6ee1ef0dfb3ed113616dcdc7023e18e35a8db41f61c8d88988e877cf510df8edafbc71 - languageName: node - linkType: hard - -"fastq@npm:^1.6.0": - version: 1.15.0 - resolution: "fastq@npm:1.15.0" - dependencies: - reusify: ^1.0.4 - checksum: 0170e6bfcd5d57a70412440b8ef600da6de3b2a6c5966aeaf0a852d542daff506a0ee92d6de7679d1de82e644bce69d7a574a6c93f0b03964b5337eed75ada1a - languageName: node - linkType: hard - -"file-entry-cache@npm:^6.0.1": - version: 6.0.1 - resolution: "file-entry-cache@npm:6.0.1" - dependencies: - flat-cache: ^3.0.4 - checksum: f49701feaa6314c8127c3c2f6173cfefff17612f5ed2daaafc6da13b5c91fd43e3b2a58fd0d63f9f94478a501b167615931e7200e31485e320f74a33885a9c74 - languageName: node - linkType: hard - -"fill-range@npm:^7.0.1": - version: 7.0.1 - resolution: "fill-range@npm:7.0.1" - dependencies: - to-regex-range: ^5.0.1 - checksum: cc283f4e65b504259e64fd969bcf4def4eb08d85565e906b7d36516e87819db52029a76b6363d0f02d0d532f0033c9603b9e2d943d56ee3b0d4f7ad3328ff917 - languageName: node - linkType: hard - -"find-up@npm:5.0.0, find-up@npm:^5.0.0": - version: 5.0.0 - resolution: "find-up@npm:5.0.0" - dependencies: - locate-path: ^6.0.0 - path-exists: ^4.0.0 - checksum: 07955e357348f34660bde7920783204ff5a26ac2cafcaa28bace494027158a97b9f56faaf2d89a6106211a8174db650dd9f503f9c0d526b1202d5554a00b9095 - languageName: node - linkType: hard - -"find-up@npm:^4.0.0": - version: 4.1.0 - resolution: "find-up@npm:4.1.0" - dependencies: - locate-path: ^5.0.0 - path-exists: ^4.0.0 - checksum: 4c172680e8f8c1f78839486e14a43ef82e9decd0e74145f40707cc42e7420506d5ec92d9a11c22bd2c48fb0c384ea05dd30e10dd152fefeec6f2f75282a8b844 - languageName: node - linkType: hard - -"flat-cache@npm:^3.0.4": - version: 3.0.4 - resolution: "flat-cache@npm:3.0.4" - dependencies: - flatted: ^3.1.0 - rimraf: ^3.0.2 - checksum: 4fdd10ecbcbf7d520f9040dd1340eb5dfe951e6f0ecf2252edeec03ee68d989ec8b9a20f4434270e71bcfd57800dc09b3344fca3966b2eb8f613072c7d9a2365 - languageName: node - linkType: hard - -"flat@npm:^5.0.2": - version: 5.0.2 - resolution: "flat@npm:5.0.2" - bin: - flat: cli.js - checksum: 12a1536ac746db74881316a181499a78ef953632ddd28050b7a3a43c62ef5462e3357c8c29d76072bb635f147f7a9a1f0c02efef6b4be28f8db62ceb3d5c7f5d - languageName: node - linkType: hard - -"flatted@npm:^3.1.0": - version: 3.2.7 - resolution: "flatted@npm:3.2.7" - checksum: 427633049d55bdb80201c68f7eb1cbd533e03eac541f97d3aecab8c5526f12a20ccecaeede08b57503e772c769e7f8680b37e8d482d1e5f8d7e2194687f9ea35 - languageName: node - linkType: hard - -"foreground-child@npm:^3.1.0": - version: 3.1.1 - resolution: "foreground-child@npm:3.1.1" - dependencies: - cross-spawn: ^7.0.0 - signal-exit: ^4.0.1 - checksum: 139d270bc82dc9e6f8bc045fe2aae4001dc2472157044fdfad376d0a3457f77857fa883c1c8b21b491c6caade9a926a4bed3d3d2e8d3c9202b151a4cbbd0bcd5 - languageName: node - linkType: hard - -"fs-minipass@npm:^2.0.0": - version: 2.1.0 - resolution: "fs-minipass@npm:2.1.0" - dependencies: - minipass: ^3.0.0 - checksum: 1b8d128dae2ac6cc94230cc5ead341ba3e0efaef82dab46a33d171c044caaa6ca001364178d42069b2809c35a1c3c35079a32107c770e9ffab3901b59af8c8b1 - languageName: node - linkType: hard - -"fs-minipass@npm:^3.0.0": - version: 3.0.2 - resolution: "fs-minipass@npm:3.0.2" - dependencies: - minipass: ^5.0.0 - checksum: e9cc0e1f2d01c6f6f62f567aee59530aba65c6c7b2ae88c5027bc34c711ebcfcfaefd0caf254afa6adfe7d1fba16bc2537508a6235196bac7276747d078aef0a - languageName: node - linkType: hard - -"fs.realpath@npm:^1.0.0": - version: 1.0.0 - resolution: "fs.realpath@npm:1.0.0" - checksum: 99ddea01a7e75aa276c250a04eedeffe5662bce66c65c07164ad6264f9de18fb21be9433ead460e54cff20e31721c811f4fb5d70591799df5f85dce6d6746fd0 - languageName: node - linkType: hard - -"fsevents@npm:~2.3.2": - version: 2.3.2 - resolution: "fsevents@npm:2.3.2" - dependencies: - node-gyp: latest - checksum: 97ade64e75091afee5265e6956cb72ba34db7819b4c3e94c431d4be2b19b8bb7a2d4116da417950c3425f17c8fe693d25e20212cac583ac1521ad066b77ae31f - conditions: os=darwin - languageName: node - linkType: hard - -"fsevents@patch:fsevents@~2.3.2#~builtin": - version: 2.3.2 - resolution: "fsevents@patch:fsevents@npm%3A2.3.2#~builtin::version=2.3.2&hash=df0bf1" - dependencies: - node-gyp: latest - conditions: os=darwin - languageName: node - linkType: hard - -"function-bind@npm:^1.1.1": - version: 1.1.1 - resolution: "function-bind@npm:1.1.1" - checksum: b32fbaebb3f8ec4969f033073b43f5c8befbb58f1a79e12f1d7490358150359ebd92f49e72ff0144f65f2c48ea2a605bff2d07965f548f6474fd8efd95bf361a - languageName: node - linkType: hard - -"gauge@npm:^4.0.3": - version: 4.0.4 - resolution: "gauge@npm:4.0.4" - dependencies: - aproba: ^1.0.3 || ^2.0.0 - color-support: ^1.1.3 - console-control-strings: ^1.1.0 - has-unicode: ^2.0.1 - signal-exit: ^3.0.7 - string-width: ^4.2.3 - strip-ansi: ^6.0.1 - wide-align: ^1.1.5 - checksum: 788b6bfe52f1dd8e263cda800c26ac0ca2ff6de0b6eee2fe0d9e3abf15e149b651bd27bf5226be10e6e3edb5c4e5d5985a5a1a98137e7a892f75eff76467ad2d - languageName: node - linkType: hard - -"get-caller-file@npm:^2.0.5": - version: 2.0.5 - resolution: "get-caller-file@npm:2.0.5" - checksum: b9769a836d2a98c3ee734a88ba712e62703f1df31b94b784762c433c27a386dd6029ff55c2a920c392e33657d80191edbf18c61487e198844844516f843496b9 - languageName: node - linkType: hard - -"glob-parent@npm:^5.1.2, glob-parent@npm:~5.1.2": - version: 5.1.2 - resolution: "glob-parent@npm:5.1.2" - dependencies: - is-glob: ^4.0.1 - checksum: f4f2bfe2425296e8a47e36864e4f42be38a996db40420fe434565e4480e3322f18eb37589617a98640c5dc8fdec1a387007ee18dbb1f3f5553409c34d17f425e - languageName: node - linkType: hard - -"glob-parent@npm:^6.0.2": - version: 6.0.2 - resolution: "glob-parent@npm:6.0.2" - dependencies: - is-glob: ^4.0.3 - checksum: c13ee97978bef4f55106b71e66428eb1512e71a7466ba49025fc2aec59a5bfb0954d5abd58fc5ee6c9b076eef4e1f6d3375c2e964b88466ca390da4419a786a8 - languageName: node - linkType: hard - -"glob-to-regexp@npm:^0.4.1": - version: 0.4.1 - resolution: "glob-to-regexp@npm:0.4.1" - checksum: e795f4e8f06d2a15e86f76e4d92751cf8bbfcf0157cea5c2f0f35678a8195a750b34096b1256e436f0cebc1883b5ff0888c47348443e69546a5a87f9e1eb1167 - languageName: node - linkType: hard - -"glob@npm:7.2.0": - version: 7.2.0 - resolution: "glob@npm:7.2.0" - dependencies: - fs.realpath: ^1.0.0 - inflight: ^1.0.4 - inherits: 2 - minimatch: ^3.0.4 - once: ^1.3.0 - path-is-absolute: ^1.0.0 - checksum: 78a8ea942331f08ed2e055cb5b9e40fe6f46f579d7fd3d694f3412fe5db23223d29b7fee1575440202e9a7ff9a72ab106a39fee39934c7bedafe5e5f8ae20134 - languageName: node - linkType: hard - -"glob@npm:^10.2.2": - version: 10.3.3 - resolution: "glob@npm:10.3.3" - dependencies: - foreground-child: ^3.1.0 - jackspeak: ^2.0.3 - minimatch: ^9.0.1 - minipass: ^5.0.0 || ^6.0.2 || ^7.0.0 - path-scurry: ^1.10.1 - bin: - glob: dist/cjs/src/bin.js - checksum: 29190d3291f422da0cb40b77a72fc8d2c51a36524e99b8bf412548b7676a6627489528b57250429612b6eec2e6fe7826d328451d3e694a9d15e575389308ec53 - languageName: node - linkType: hard - -"glob@npm:^7.1.3, glob@npm:^7.1.4": - version: 7.2.3 - resolution: "glob@npm:7.2.3" - dependencies: - fs.realpath: ^1.0.0 - inflight: ^1.0.4 - inherits: 2 - minimatch: ^3.1.1 - once: ^1.3.0 - path-is-absolute: ^1.0.0 - checksum: 29452e97b38fa704dabb1d1045350fb2467cf0277e155aa9ff7077e90ad81d1ea9d53d3ee63bd37c05b09a065e90f16aec4a65f5b8de401d1dac40bc5605d133 - languageName: node - linkType: hard - -"glob@npm:^8.1.0": - version: 8.1.0 - resolution: "glob@npm:8.1.0" - dependencies: - fs.realpath: ^1.0.0 - inflight: ^1.0.4 - inherits: 2 - minimatch: ^5.0.1 - once: ^1.3.0 - checksum: 92fbea3221a7d12075f26f0227abac435de868dd0736a17170663783296d0dd8d3d532a5672b4488a439bf5d7fb85cdd07c11185d6cd39184f0385cbdfb86a47 - languageName: node - linkType: hard - -"globals@npm:^13.19.0": - version: 13.20.0 - resolution: "globals@npm:13.20.0" - dependencies: - type-fest: ^0.20.2 - checksum: ad1ecf914bd051325faad281d02ea2c0b1df5d01bd94d368dcc5513340eac41d14b3c61af325768e3c7f8d44576e72780ec0b6f2d366121f8eec6e03c3a3b97a - languageName: node - linkType: hard - -"globby@npm:^11.1.0": - version: 11.1.0 - resolution: "globby@npm:11.1.0" - dependencies: - array-union: ^2.1.0 - dir-glob: ^3.0.1 - fast-glob: ^3.2.9 - ignore: ^5.2.0 - merge2: ^1.4.1 - slash: ^3.0.0 - checksum: b4be8885e0cfa018fc783792942d53926c35c50b3aefd3fdcfb9d22c627639dc26bd2327a40a0b74b074100ce95bb7187bfeae2f236856aa3de183af7a02aea6 - languageName: node - linkType: hard - -"graceful-fs@npm:^4.1.2, graceful-fs@npm:^4.2.4, graceful-fs@npm:^4.2.6, graceful-fs@npm:^4.2.9": - version: 4.2.11 - resolution: "graceful-fs@npm:4.2.11" - checksum: ac85f94da92d8eb6b7f5a8b20ce65e43d66761c55ce85ac96df6865308390da45a8d3f0296dd3a663de65d30ba497bd46c696cc1e248c72b13d6d567138a4fc7 - languageName: node - linkType: hard - -"graphemer@npm:^1.4.0": - version: 1.4.0 - resolution: "graphemer@npm:1.4.0" - checksum: bab8f0be9b568857c7bec9fda95a89f87b783546d02951c40c33f84d05bb7da3fd10f863a9beb901463669b6583173a8c8cc6d6b306ea2b9b9d5d3d943c3a673 - languageName: node - linkType: hard - -"has-flag@npm:^4.0.0": - version: 4.0.0 - resolution: "has-flag@npm:4.0.0" - checksum: 261a1357037ead75e338156b1f9452c016a37dcd3283a972a30d9e4a87441ba372c8b81f818cd0fbcd9c0354b4ae7e18b9e1afa1971164aef6d18c2b6095a8ad - languageName: node - linkType: hard - -"has-unicode@npm:^2.0.1": - version: 2.0.1 - resolution: "has-unicode@npm:2.0.1" - checksum: 1eab07a7436512db0be40a710b29b5dc21fa04880b7f63c9980b706683127e3c1b57cb80ea96d47991bdae2dfe479604f6a1ba410106ee1046a41d1bd0814400 - languageName: node - linkType: hard - -"has@npm:^1.0.3": - version: 1.0.3 - resolution: "has@npm:1.0.3" - dependencies: - function-bind: ^1.1.1 - checksum: b9ad53d53be4af90ce5d1c38331e712522417d017d5ef1ebd0507e07c2fbad8686fffb8e12ddecd4c39ca9b9b47431afbb975b8abf7f3c3b82c98e9aad052792 - languageName: node - linkType: hard - -"he@npm:1.2.0": - version: 1.2.0 - resolution: "he@npm:1.2.0" - bin: - he: bin/he - checksum: 3d4d6babccccd79c5c5a3f929a68af33360d6445587d628087f39a965079d84f18ce9c3d3f917ee1e3978916fc833bb8b29377c3b403f919426f91bc6965e7a7 - languageName: node - linkType: hard - -"http-cache-semantics@npm:^4.1.1": - version: 4.1.1 - resolution: "http-cache-semantics@npm:4.1.1" - checksum: 83ac0bc60b17a3a36f9953e7be55e5c8f41acc61b22583060e8dedc9dd5e3607c823a88d0926f9150e571f90946835c7fe150732801010845c72cd8bbff1a236 - languageName: node - linkType: hard - -"http-proxy-agent@npm:^4.0.1": - version: 4.0.1 - resolution: "http-proxy-agent@npm:4.0.1" - dependencies: - "@tootallnate/once": 1 - agent-base: 6 - debug: 4 - checksum: c6a5da5a1929416b6bbdf77b1aca13888013fe7eb9d59fc292e25d18e041bb154a8dfada58e223fc7b76b9b2d155a87e92e608235201f77d34aa258707963a82 - languageName: node - linkType: hard - -"http-proxy-agent@npm:^5.0.0": - version: 5.0.0 - resolution: "http-proxy-agent@npm:5.0.0" - dependencies: - "@tootallnate/once": 2 - agent-base: 6 - debug: 4 - checksum: e2ee1ff1656a131953839b2a19cd1f3a52d97c25ba87bd2559af6ae87114abf60971e498021f9b73f9fd78aea8876d1fb0d4656aac8a03c6caa9fc175f22b786 - languageName: node - linkType: hard - -"https-proxy-agent@npm:^5.0.0": - version: 5.0.1 - resolution: "https-proxy-agent@npm:5.0.1" - dependencies: - agent-base: 6 - debug: 4 - checksum: 571fccdf38184f05943e12d37d6ce38197becdd69e58d03f43637f7fa1269cf303a7d228aa27e5b27bbd3af8f09fd938e1c91dcfefff2df7ba77c20ed8dfc765 - languageName: node - linkType: hard - -"humanize-ms@npm:^1.2.1": - version: 1.2.1 - resolution: "humanize-ms@npm:1.2.1" - dependencies: - ms: ^2.0.0 - checksum: 9c7a74a2827f9294c009266c82031030eae811ca87b0da3dceb8d6071b9bde22c9f3daef0469c3c533cc67a97d8a167cd9fc0389350e5f415f61a79b171ded16 - languageName: node - linkType: hard - -"husky@npm:^8.0.0": - version: 8.0.3 - resolution: "husky@npm:8.0.3" - bin: - husky: lib/bin.js - checksum: 837bc7e4413e58c1f2946d38fb050f5d7324c6f16b0fd66411ffce5703b294bd21429e8ba58711cd331951ee86ed529c5be4f76805959ff668a337dbfa82a1b0 - languageName: node - linkType: hard - -"iconv-lite@npm:^0.6.2": - version: 0.6.3 - resolution: "iconv-lite@npm:0.6.3" - dependencies: - safer-buffer: ">= 2.1.2 < 3.0.0" - checksum: 3f60d47a5c8fc3313317edfd29a00a692cc87a19cac0159e2ce711d0ebc9019064108323b5e493625e25594f11c6236647d8e256fbe7a58f4a3b33b89e6d30bf - languageName: node - linkType: hard - -"ignore@npm:^5.2.0": - version: 5.2.4 - resolution: "ignore@npm:5.2.4" - checksum: 3d4c309c6006e2621659311783eaea7ebcd41fe4ca1d78c91c473157ad6666a57a2df790fe0d07a12300d9aac2888204d7be8d59f9aaf665b1c7fcdb432517ef - languageName: node - linkType: hard - -"immediate@npm:~3.0.5": - version: 3.0.6 - resolution: "immediate@npm:3.0.6" - checksum: f9b3486477555997657f70318cc8d3416159f208bec4cca3ff3442fd266bc23f50f0c9bd8547e1371a6b5e82b821ec9a7044a4f7b944798b25aa3cc6d5e63e62 - languageName: node - linkType: hard - -"import-fresh@npm:^3.2.1": - version: 3.3.0 - resolution: "import-fresh@npm:3.3.0" - dependencies: - parent-module: ^1.0.0 - resolve-from: ^4.0.0 - checksum: 2cacfad06e652b1edc50be650f7ec3be08c5e5a6f6d12d035c440a42a8cc028e60a5b99ca08a77ab4d6b1346da7d971915828f33cdab730d3d42f08242d09baa - languageName: node - linkType: hard - -"import-local@npm:^3.0.2": - version: 3.1.0 - resolution: "import-local@npm:3.1.0" - dependencies: - pkg-dir: ^4.2.0 - resolve-cwd: ^3.0.0 - bin: - import-local-fixture: fixtures/cli.js - checksum: bfcdb63b5e3c0e245e347f3107564035b128a414c4da1172a20dc67db2504e05ede4ac2eee1252359f78b0bfd7b19ef180aec427c2fce6493ae782d73a04cddd - languageName: node - linkType: hard - -"imurmurhash@npm:^0.1.4": - version: 0.1.4 - resolution: "imurmurhash@npm:0.1.4" - checksum: 7cae75c8cd9a50f57dadd77482359f659eaebac0319dd9368bcd1714f55e65badd6929ca58569da2b6494ef13fdd5598cd700b1eba23f8b79c5f19d195a3ecf7 - languageName: node - linkType: hard - -"indent-string@npm:^4.0.0": - version: 4.0.0 - resolution: "indent-string@npm:4.0.0" - checksum: 824cfb9929d031dabf059bebfe08cf3137365e112019086ed3dcff6a0a7b698cb80cf67ccccde0e25b9e2d7527aa6cc1fed1ac490c752162496caba3e6699612 - languageName: node - linkType: hard - -"inflight@npm:^1.0.4": - version: 1.0.6 - resolution: "inflight@npm:1.0.6" - dependencies: - once: ^1.3.0 - wrappy: 1 - checksum: f4f76aa072ce19fae87ce1ef7d221e709afb59d445e05d47fba710e85470923a75de35bfae47da6de1b18afc3ce83d70facf44cfb0aff89f0a3f45c0a0244dfd - languageName: node - linkType: hard - -"inherits@npm:2, inherits@npm:^2.0.3, inherits@npm:~2.0.3": - version: 2.0.4 - resolution: "inherits@npm:2.0.4" - checksum: 4a48a733847879d6cf6691860a6b1e3f0f4754176e4d71494c41f3475553768b10f84b5ce1d40fbd0e34e6bfbb864ee35858ad4dd2cf31e02fc4a154b724d7f1 - languageName: node - linkType: hard - -"interpret@npm:^3.1.1": - version: 3.1.1 - resolution: "interpret@npm:3.1.1" - checksum: 35cebcf48c7351130437596d9ab8c8fe131ce4038da4561e6d665f25640e0034702a031cf7e3a5cea60ac7ac548bf17465e0571ede126f3d3a6933152171ac82 - languageName: node - linkType: hard - -"ip@npm:^2.0.0": - version: 2.0.0 - resolution: "ip@npm:2.0.0" - checksum: cfcfac6b873b701996d71ec82a7dd27ba92450afdb421e356f44044ed688df04567344c36cbacea7d01b1c39a4c732dc012570ebe9bebfb06f27314bca625349 - languageName: node - linkType: hard - -"is-binary-path@npm:~2.1.0": - version: 2.1.0 - resolution: "is-binary-path@npm:2.1.0" - dependencies: - binary-extensions: ^2.0.0 - checksum: 84192eb88cff70d320426f35ecd63c3d6d495da9d805b19bc65b518984b7c0760280e57dbf119b7e9be6b161784a5a673ab2c6abe83abb5198a432232ad5b35c - languageName: node - linkType: hard - -"is-core-module@npm:^2.12.0": - version: 2.12.1 - resolution: "is-core-module@npm:2.12.1" - dependencies: - has: ^1.0.3 - checksum: f04ea30533b5e62764e7b2e049d3157dc0abd95ef44275b32489ea2081176ac9746ffb1cdb107445cf1ff0e0dfcad522726ca27c27ece64dadf3795428b8e468 - languageName: node - linkType: hard - -"is-extglob@npm:^2.1.1": - version: 2.1.1 - resolution: "is-extglob@npm:2.1.1" - checksum: df033653d06d0eb567461e58a7a8c9f940bd8c22274b94bf7671ab36df5719791aae15eef6d83bbb5e23283967f2f984b8914559d4449efda578c775c4be6f85 - languageName: node - linkType: hard - -"is-fullwidth-code-point@npm:^3.0.0": - version: 3.0.0 - resolution: "is-fullwidth-code-point@npm:3.0.0" - checksum: 44a30c29457c7fb8f00297bce733f0a64cd22eca270f83e58c105e0d015e45c019491a4ab2faef91ab51d4738c670daff901c799f6a700e27f7314029e99e348 - languageName: node - linkType: hard - -"is-glob@npm:^4.0.0, is-glob@npm:^4.0.1, is-glob@npm:^4.0.3, is-glob@npm:~4.0.1": - version: 4.0.3 - resolution: "is-glob@npm:4.0.3" - dependencies: - is-extglob: ^2.1.1 - checksum: d381c1319fcb69d341cc6e6c7cd588e17cd94722d9a32dbd60660b993c4fb7d0f19438674e68dfec686d09b7c73139c9166b47597f846af387450224a8101ab4 - languageName: node - linkType: hard - -"is-lambda@npm:^1.0.1": - version: 1.0.1 - resolution: "is-lambda@npm:1.0.1" - checksum: 93a32f01940220532e5948538699ad610d5924ac86093fcee83022252b363eb0cc99ba53ab084a04e4fb62bf7b5731f55496257a4c38adf87af9c4d352c71c35 - languageName: node - linkType: hard - -"is-number@npm:^7.0.0": - version: 7.0.0 - resolution: "is-number@npm:7.0.0" - checksum: 456ac6f8e0f3111ed34668a624e45315201dff921e5ac181f8ec24923b99e9f32ca1a194912dc79d539c97d33dba17dc635202ff0b2cf98326f608323276d27a - languageName: node - linkType: hard - -"is-path-inside@npm:^3.0.3": - version: 3.0.3 - resolution: "is-path-inside@npm:3.0.3" - checksum: abd50f06186a052b349c15e55b182326f1936c89a78bf6c8f2b707412517c097ce04bc49a0ca221787bc44e1049f51f09a2ffb63d22899051988d3a618ba13e9 - languageName: node - linkType: hard - -"is-plain-obj@npm:^2.1.0": - version: 2.1.0 - resolution: "is-plain-obj@npm:2.1.0" - checksum: cec9100678b0a9fe0248a81743041ed990c2d4c99f893d935545cfbc42876cbe86d207f3b895700c690ad2fa520e568c44afc1605044b535a7820c1d40e38daa - languageName: node - linkType: hard - -"is-plain-object@npm:^2.0.4": - version: 2.0.4 - resolution: "is-plain-object@npm:2.0.4" - dependencies: - isobject: ^3.0.1 - checksum: 2a401140cfd86cabe25214956ae2cfee6fbd8186809555cd0e84574f88de7b17abacb2e477a6a658fa54c6083ecbda1e6ae404c7720244cd198903848fca70ca - languageName: node - linkType: hard - -"is-unicode-supported@npm:^0.1.0": - version: 0.1.0 - resolution: "is-unicode-supported@npm:0.1.0" - checksum: a2aab86ee7712f5c2f999180daaba5f361bdad1efadc9610ff5b8ab5495b86e4f627839d085c6530363c6d6d4ecbde340fb8e54bdb83da4ba8e0865ed5513c52 - languageName: node - linkType: hard - -"isarray@npm:~1.0.0": - version: 1.0.0 - resolution: "isarray@npm:1.0.0" - checksum: f032df8e02dce8ec565cf2eb605ea939bdccea528dbcf565cdf92bfa2da9110461159d86a537388ef1acef8815a330642d7885b29010e8f7eac967c9993b65ab - languageName: node - linkType: hard - -"isexe@npm:^2.0.0": - version: 2.0.0 - resolution: "isexe@npm:2.0.0" - checksum: 26bf6c5480dda5161c820c5b5c751ae1e766c587b1f951ea3fcfc973bafb7831ae5b54a31a69bd670220e42e99ec154475025a468eae58ea262f813fdc8d1c62 - languageName: node - linkType: hard - -"isobject@npm:^3.0.1": - version: 3.0.1 - resolution: "isobject@npm:3.0.1" - checksum: db85c4c970ce30693676487cca0e61da2ca34e8d4967c2e1309143ff910c207133a969f9e4ddb2dc6aba670aabce4e0e307146c310350b298e74a31f7d464703 - languageName: node - linkType: hard - -"jackspeak@npm:^2.0.3": - version: 2.2.2 - resolution: "jackspeak@npm:2.2.2" - dependencies: - "@isaacs/cliui": ^8.0.2 - "@pkgjs/parseargs": ^0.11.0 - dependenciesMeta: - "@pkgjs/parseargs": - optional: true - checksum: 7b1468dd910afc00642db87448f24b062346570b8b47531409aa9012bcb95fdf7ec2b1c48edbb8b57a938c08391f8cc01b5034fc335aa3a2e74dbcc0ee5c555a - languageName: node - linkType: hard - -"jest-worker@npm:^27.4.5": - version: 27.5.1 - resolution: "jest-worker@npm:27.5.1" - dependencies: - "@types/node": "*" - merge-stream: ^2.0.0 - supports-color: ^8.0.0 - checksum: 98cd68b696781caed61c983a3ee30bf880b5bd021c01d98f47b143d4362b85d0737f8523761e2713d45e18b4f9a2b98af1eaee77afade4111bb65c77d6f7c980 - languageName: node - linkType: hard - -"js-yaml@npm:4.1.0, js-yaml@npm:^4.1.0": - version: 4.1.0 - resolution: "js-yaml@npm:4.1.0" - dependencies: - argparse: ^2.0.1 - bin: - js-yaml: bin/js-yaml.js - checksum: c7830dfd456c3ef2c6e355cc5a92e6700ceafa1d14bba54497b34a99f0376cecbb3e9ac14d3e5849b426d5a5140709a66237a8c991c675431271c4ce5504151a - languageName: node - linkType: hard - -"json-parse-even-better-errors@npm:^2.3.1": - version: 2.3.1 - resolution: "json-parse-even-better-errors@npm:2.3.1" - checksum: 798ed4cf3354a2d9ccd78e86d2169515a0097a5c133337807cdf7f1fc32e1391d207ccfc276518cc1d7d8d4db93288b8a50ba4293d212ad1336e52a8ec0a941f - languageName: node - linkType: hard - -"json-schema-traverse@npm:^0.4.1": - version: 0.4.1 - resolution: "json-schema-traverse@npm:0.4.1" - checksum: 7486074d3ba247769fda17d5181b345c9fb7d12e0da98b22d1d71a5db9698d8b4bd900a3ec1a4ffdd60846fc2556274a5c894d0c48795f14cb03aeae7b55260b - languageName: node - linkType: hard - -"json-stable-stringify-without-jsonify@npm:^1.0.1": - version: 1.0.1 - resolution: "json-stable-stringify-without-jsonify@npm:1.0.1" - checksum: cff44156ddce9c67c44386ad5cddf91925fe06b1d217f2da9c4910d01f358c6e3989c4d5a02683c7a5667f9727ff05831f7aa8ae66c8ff691c556f0884d49215 - languageName: node - linkType: hard - -"jszip@npm:^3.10.1": - version: 3.10.1 - resolution: "jszip@npm:3.10.1" - dependencies: - lie: ~3.3.0 - pako: ~1.0.2 - readable-stream: ~2.3.6 - setimmediate: ^1.0.5 - checksum: abc77bfbe33e691d4d1ac9c74c8851b5761fba6a6986630864f98d876f3fcc2d36817dfc183779f32c00157b5d53a016796677298272a714ae096dfe6b1c8b60 - languageName: node - linkType: hard - -"kind-of@npm:^6.0.2": - version: 6.0.3 - resolution: "kind-of@npm:6.0.3" - checksum: 3ab01e7b1d440b22fe4c31f23d8d38b4d9b91d9f291df683476576493d5dfd2e03848a8b05813dd0c3f0e835bc63f433007ddeceb71f05cb25c45ae1b19c6d3b - languageName: node - linkType: hard - -"levn@npm:^0.4.1": - version: 0.4.1 - resolution: "levn@npm:0.4.1" - dependencies: - prelude-ls: ^1.2.1 - type-check: ~0.4.0 - checksum: 12c5021c859bd0f5248561bf139121f0358285ec545ebf48bb3d346820d5c61a4309535c7f387ed7d84361cf821e124ce346c6b7cef8ee09a67c1473b46d0fc4 - languageName: node - linkType: hard - -"lie@npm:~3.3.0": - version: 3.3.0 - resolution: "lie@npm:3.3.0" - dependencies: - immediate: ~3.0.5 - checksum: 33102302cf19766f97919a6a98d481e01393288b17a6aa1f030a3542031df42736edde8dab29ffdbf90bebeffc48c761eb1d064dc77592ca3ba3556f9fe6d2a8 - languageName: node - linkType: hard - -"loader-runner@npm:^4.2.0": - version: 4.3.0 - resolution: "loader-runner@npm:4.3.0" - checksum: a90e00dee9a16be118ea43fec3192d0b491fe03a32ed48a4132eb61d498f5536a03a1315531c19d284392a8726a4ecad71d82044c28d7f22ef62e029bf761569 - languageName: node - linkType: hard - -"locate-path@npm:^5.0.0": - version: 5.0.0 - resolution: "locate-path@npm:5.0.0" - dependencies: - p-locate: ^4.1.0 - checksum: 83e51725e67517287d73e1ded92b28602e3ae5580b301fe54bfb76c0c723e3f285b19252e375712316774cf52006cb236aed5704692c32db0d5d089b69696e30 - languageName: node - linkType: hard - -"locate-path@npm:^6.0.0": - version: 6.0.0 - resolution: "locate-path@npm:6.0.0" - dependencies: - p-locate: ^5.0.0 - checksum: 72eb661788a0368c099a184c59d2fee760b3831c9c1c33955e8a19ae4a21b4116e53fa736dc086cdeb9fce9f7cc508f2f92d2d3aae516f133e16a2bb59a39f5a - languageName: node - linkType: hard - -"lodash.merge@npm:^4.6.2": - version: 4.6.2 - resolution: "lodash.merge@npm:4.6.2" - checksum: ad580b4bdbb7ca1f7abf7e1bce63a9a0b98e370cf40194b03380a46b4ed799c9573029599caebc1b14e3f24b111aef72b96674a56cfa105e0f5ac70546cdc005 - languageName: node - linkType: hard - -"log-symbols@npm:4.1.0": - version: 4.1.0 - resolution: "log-symbols@npm:4.1.0" - dependencies: - chalk: ^4.1.0 - is-unicode-supported: ^0.1.0 - checksum: fce1497b3135a0198803f9f07464165e9eb83ed02ceb2273930a6f8a508951178d8cf4f0378e9d28300a2ed2bc49050995d2bd5f53ab716bb15ac84d58c6ef74 - languageName: node - linkType: hard - -"lru-cache@npm:^6.0.0": - version: 6.0.0 - resolution: "lru-cache@npm:6.0.0" - dependencies: - yallist: ^4.0.0 - checksum: f97f499f898f23e4585742138a22f22526254fdba6d75d41a1c2526b3b6cc5747ef59c5612ba7375f42aca4f8461950e925ba08c991ead0651b4918b7c978297 - languageName: node - linkType: hard - -"lru-cache@npm:^7.7.1": - version: 7.18.3 - resolution: "lru-cache@npm:7.18.3" - checksum: e550d772384709deea3f141af34b6d4fa392e2e418c1498c078de0ee63670f1f46f5eee746e8ef7e69e1c895af0d4224e62ee33e66a543a14763b0f2e74c1356 - languageName: node - linkType: hard - -"lru-cache@npm:^9.1.1 || ^10.0.0": - version: 10.0.0 - resolution: "lru-cache@npm:10.0.0" - checksum: 18f101675fe283bc09cda0ef1e3cc83781aeb8373b439f086f758d1d91b28730950db785999cd060d3c825a8571c03073e8c14512b6655af2188d623031baf50 - languageName: node - linkType: hard - -"make-fetch-happen@npm:^11.0.3": - version: 11.1.1 - resolution: "make-fetch-happen@npm:11.1.1" - dependencies: - agentkeepalive: ^4.2.1 - cacache: ^17.0.0 - http-cache-semantics: ^4.1.1 - http-proxy-agent: ^5.0.0 - https-proxy-agent: ^5.0.0 - is-lambda: ^1.0.1 - lru-cache: ^7.7.1 - minipass: ^5.0.0 - minipass-fetch: ^3.0.0 - minipass-flush: ^1.0.5 - minipass-pipeline: ^1.2.4 - negotiator: ^0.6.3 - promise-retry: ^2.0.1 - socks-proxy-agent: ^7.0.0 - ssri: ^10.0.0 - checksum: 7268bf274a0f6dcf0343829489a4506603ff34bd0649c12058753900b0eb29191dce5dba12680719a5d0a983d3e57810f594a12f3c18494e93a1fbc6348a4540 - languageName: node - linkType: hard - -"manager@workspace:manager": - version: 0.0.0-use.local - resolution: "manager@workspace:manager" - languageName: unknown - linkType: soft - -"merge-stream@npm:^2.0.0": - version: 2.0.0 - resolution: "merge-stream@npm:2.0.0" - checksum: 6fa4dcc8d86629705cea944a4b88ef4cb0e07656ebf223fa287443256414283dd25d91c1cd84c77987f2aec5927af1a9db6085757cb43d90eb170ebf4b47f4f4 - languageName: node - linkType: hard - -"merge2@npm:^1.3.0, merge2@npm:^1.4.1": - version: 1.4.1 - resolution: "merge2@npm:1.4.1" - checksum: 7268db63ed5169466540b6fb947aec313200bcf6d40c5ab722c22e242f651994619bcd85601602972d3c85bd2cc45a358a4c61937e9f11a061919a1da569b0c2 - languageName: node - linkType: hard - -"micromatch@npm:^4.0.0, micromatch@npm:^4.0.4": - version: 4.0.5 - resolution: "micromatch@npm:4.0.5" - dependencies: - braces: ^3.0.2 - picomatch: ^2.3.1 - checksum: 02a17b671c06e8fefeeb6ef996119c1e597c942e632a21ef589154f23898c9c6a9858526246abb14f8bca6e77734aa9dcf65476fca47cedfb80d9577d52843fc - languageName: node - linkType: hard - -"mime-db@npm:1.52.0": - version: 1.52.0 - resolution: "mime-db@npm:1.52.0" - checksum: 0d99a03585f8b39d68182803b12ac601d9c01abfa28ec56204fa330bc9f3d1c5e14beb049bafadb3dbdf646dfb94b87e24d4ec7b31b7279ef906a8ea9b6a513f - languageName: node - linkType: hard - -"mime-types@npm:^2.1.27": - version: 2.1.35 - resolution: "mime-types@npm:2.1.35" - dependencies: - mime-db: 1.52.0 - checksum: 89a5b7f1def9f3af5dad6496c5ed50191ae4331cc5389d7c521c8ad28d5fdad2d06fd81baf38fed813dc4e46bb55c8145bb0ff406330818c9cf712fb2e9b3836 - languageName: node - linkType: hard - -"minimatch@npm:5.0.1": - version: 5.0.1 - resolution: "minimatch@npm:5.0.1" - dependencies: - brace-expansion: ^2.0.1 - checksum: b34b98463da4754bc526b244d680c69d4d6089451ebe512edaf6dd9eeed0279399cfa3edb19233513b8f830bf4bfcad911dddcdf125e75074100d52f724774f0 - languageName: node - linkType: hard - -"minimatch@npm:^3.0.4, minimatch@npm:^3.0.5, minimatch@npm:^3.1.1, minimatch@npm:^3.1.2": - version: 3.1.2 - resolution: "minimatch@npm:3.1.2" - dependencies: - brace-expansion: ^1.1.7 - checksum: c154e566406683e7bcb746e000b84d74465b3a832c45d59912b9b55cd50dee66e5c4b1e5566dba26154040e51672f9aa450a9aef0c97cfc7336b78b7afb9540a - languageName: node - linkType: hard - -"minimatch@npm:^5.0.1": - version: 5.1.6 - resolution: "minimatch@npm:5.1.6" - dependencies: - brace-expansion: ^2.0.1 - checksum: 7564208ef81d7065a370f788d337cd80a689e981042cb9a1d0e6580b6c6a8c9279eba80010516e258835a988363f99f54a6f711a315089b8b42694f5da9d0d77 - languageName: node - linkType: hard - -"minimatch@npm:^9.0.1": - version: 9.0.3 - resolution: "minimatch@npm:9.0.3" - dependencies: - brace-expansion: ^2.0.1 - checksum: 253487976bf485b612f16bf57463520a14f512662e592e95c571afdab1442a6a6864b6c88f248ce6fc4ff0b6de04ac7aa6c8bb51e868e99d1d65eb0658a708b5 - languageName: node - linkType: hard - -"minipass-collect@npm:^1.0.2": - version: 1.0.2 - resolution: "minipass-collect@npm:1.0.2" - dependencies: - minipass: ^3.0.0 - checksum: 14df761028f3e47293aee72888f2657695ec66bd7d09cae7ad558da30415fdc4752bbfee66287dcc6fd5e6a2fa3466d6c484dc1cbd986525d9393b9523d97f10 - languageName: node - linkType: hard - -"minipass-fetch@npm:^3.0.0": - version: 3.0.3 - resolution: "minipass-fetch@npm:3.0.3" - dependencies: - encoding: ^0.1.13 - minipass: ^5.0.0 - minipass-sized: ^1.0.3 - minizlib: ^2.1.2 - dependenciesMeta: - encoding: - optional: true - checksum: af5ab2552a16fcf505d35fd7ffb84b57f4a0eeb269e6e1d9a2a75824dda48b36e527083250b7cca4a4def21d9544e2ade441e4730e233c0bc2133f6abda31e18 - languageName: node - linkType: hard - -"minipass-flush@npm:^1.0.5": - version: 1.0.5 - resolution: "minipass-flush@npm:1.0.5" - dependencies: - minipass: ^3.0.0 - checksum: 56269a0b22bad756a08a94b1ffc36b7c9c5de0735a4dd1ab2b06c066d795cfd1f0ac44a0fcae13eece5589b908ecddc867f04c745c7009be0b566421ea0944cf - languageName: node - linkType: hard - -"minipass-pipeline@npm:^1.2.4": - version: 1.2.4 - resolution: "minipass-pipeline@npm:1.2.4" - dependencies: - minipass: ^3.0.0 - checksum: b14240dac0d29823c3d5911c286069e36d0b81173d7bdf07a7e4a91ecdef92cdff4baaf31ea3746f1c61e0957f652e641223970870e2353593f382112257971b - languageName: node - linkType: hard - -"minipass-sized@npm:^1.0.3": - version: 1.0.3 - resolution: "minipass-sized@npm:1.0.3" - dependencies: - minipass: ^3.0.0 - checksum: 79076749fcacf21b5d16dd596d32c3b6bf4d6e62abb43868fac21674078505c8b15eaca4e47ed844985a4514854f917d78f588fcd029693709417d8f98b2bd60 - languageName: node - linkType: hard - -"minipass@npm:^3.0.0": - version: 3.3.6 - resolution: "minipass@npm:3.3.6" - dependencies: - yallist: ^4.0.0 - checksum: a30d083c8054cee83cdcdc97f97e4641a3f58ae743970457b1489ce38ee1167b3aaf7d815cd39ec7a99b9c40397fd4f686e83750e73e652b21cb516f6d845e48 - languageName: node - linkType: hard - -"minipass@npm:^5.0.0": - version: 5.0.0 - resolution: "minipass@npm:5.0.0" - checksum: 425dab288738853fded43da3314a0b5c035844d6f3097a8e3b5b29b328da8f3c1af6fc70618b32c29ff906284cf6406b6841376f21caaadd0793c1d5a6a620ea - languageName: node - linkType: hard - -"minipass@npm:^5.0.0 || ^6.0.2 || ^7.0.0": - version: 7.0.2 - resolution: "minipass@npm:7.0.2" - checksum: 46776de732eb7cef2c7404a15fb28c41f5c54a22be50d47b03c605bf21f5c18d61a173c0a20b49a97e7a65f78d887245066410642551e45fffe04e9ac9e325bc - languageName: node - linkType: hard - -"minizlib@npm:^2.1.1, minizlib@npm:^2.1.2": - version: 2.1.2 - resolution: "minizlib@npm:2.1.2" - dependencies: - minipass: ^3.0.0 - yallist: ^4.0.0 - checksum: f1fdeac0b07cf8f30fcf12f4b586795b97be856edea22b5e9072707be51fc95d41487faec3f265b42973a304fe3a64acd91a44a3826a963e37b37bafde0212c3 - languageName: node - linkType: hard - -"mkdirp@npm:^1.0.3": - version: 1.0.4 - resolution: "mkdirp@npm:1.0.4" - bin: - mkdirp: bin/cmd.js - checksum: a96865108c6c3b1b8e1d5e9f11843de1e077e57737602de1b82030815f311be11f96f09cce59bd5b903d0b29834733e5313f9301e3ed6d6f6fba2eae0df4298f - languageName: node - linkType: hard - -"mocha@npm:^10.2.0": - version: 10.2.0 - resolution: "mocha@npm:10.2.0" - dependencies: - ansi-colors: 4.1.1 - browser-stdout: 1.3.1 - chokidar: 3.5.3 - debug: 4.3.4 - diff: 5.0.0 - escape-string-regexp: 4.0.0 - find-up: 5.0.0 - glob: 7.2.0 - he: 1.2.0 - js-yaml: 4.1.0 - log-symbols: 4.1.0 - minimatch: 5.0.1 - ms: 2.1.3 - nanoid: 3.3.3 - serialize-javascript: 6.0.0 - strip-json-comments: 3.1.1 - supports-color: 8.1.1 - workerpool: 6.2.1 - yargs: 16.2.0 - yargs-parser: 20.2.4 - yargs-unparser: 2.0.0 - bin: - _mocha: bin/_mocha - mocha: bin/mocha.js - checksum: 406c45eab122ffd6ea2003c2f108b2bc35ba036225eee78e0c784b6fa2c7f34e2b13f1dbacef55a4fdf523255d76e4f22d1b5aacda2394bd11666febec17c719 - languageName: node - linkType: hard - -"ms@npm:2.1.2": - version: 2.1.2 - resolution: "ms@npm:2.1.2" - checksum: 673cdb2c3133eb050c745908d8ce632ed2c02d85640e2edb3ace856a2266a813b30c613569bf3354fdf4ea7d1a1494add3bfa95e2713baa27d0c2c71fc44f58f - languageName: node - linkType: hard - -"ms@npm:2.1.3, ms@npm:^2.0.0": - version: 2.1.3 - resolution: "ms@npm:2.1.3" - checksum: aa92de608021b242401676e35cfa5aa42dd70cbdc082b916da7fb925c542173e36bce97ea3e804923fe92c0ad991434e4a38327e15a1b5b5f945d66df615ae6d - languageName: node - linkType: hard - -"nanoid@npm:3.3.3": - version: 3.3.3 - resolution: "nanoid@npm:3.3.3" - bin: - nanoid: bin/nanoid.cjs - checksum: ada019402a07464a694553c61d2dca8a4353645a7d92f2830f0d487fedff403678a0bee5323a46522752b2eab95a0bc3da98b6cccaa7c0c55cd9975130e6d6f0 - languageName: node - linkType: hard - -"natural-compare-lite@npm:^1.4.0": - version: 1.4.0 - resolution: "natural-compare-lite@npm:1.4.0" - checksum: 5222ac3986a2b78dd6069ac62cbb52a7bf8ffc90d972ab76dfe7b01892485d229530ed20d0c62e79a6b363a663b273db3bde195a1358ce9e5f779d4453887225 - languageName: node - linkType: hard - -"natural-compare@npm:^1.4.0": - version: 1.4.0 - resolution: "natural-compare@npm:1.4.0" - checksum: 23ad088b08f898fc9b53011d7bb78ec48e79de7627e01ab5518e806033861bef68d5b0cd0e2205c2f36690ac9571ff6bcb05eb777ced2eeda8d4ac5b44592c3d - languageName: node - linkType: hard - -"negotiator@npm:^0.6.3": - version: 0.6.3 - resolution: "negotiator@npm:0.6.3" - checksum: b8ffeb1e262eff7968fc90a2b6767b04cfd9842582a9d0ece0af7049537266e7b2506dfb1d107a32f06dd849ab2aea834d5830f7f4d0e5cb7d36e1ae55d021d9 - languageName: node - linkType: hard - -"neo-async@npm:^2.6.2": - version: 2.6.2 - resolution: "neo-async@npm:2.6.2" - checksum: deac9f8d00eda7b2e5cd1b2549e26e10a0faa70adaa6fdadca701cc55f49ee9018e427f424bac0c790b7c7e2d3068db97f3093f1093975f2acb8f8818b936ed9 - languageName: node - linkType: hard - -"node-gyp@npm:latest": - version: 9.4.0 - resolution: "node-gyp@npm:9.4.0" - dependencies: - env-paths: ^2.2.0 - exponential-backoff: ^3.1.1 - glob: ^7.1.4 - graceful-fs: ^4.2.6 - make-fetch-happen: ^11.0.3 - nopt: ^6.0.0 - npmlog: ^6.0.0 - rimraf: ^3.0.2 - semver: ^7.3.5 - tar: ^6.1.2 - which: ^2.0.2 - bin: - node-gyp: bin/node-gyp.js - checksum: 78b404e2e0639d64e145845f7f5a3cb20c0520cdaf6dda2f6e025e9b644077202ea7de1232396ba5bde3fee84cdc79604feebe6ba3ec84d464c85d407bb5da99 - languageName: node - linkType: hard - -"node-releases@npm:^2.0.13": - version: 2.0.13 - resolution: "node-releases@npm:2.0.13" - checksum: 17ec8f315dba62710cae71a8dad3cd0288ba943d2ece43504b3b1aa8625bf138637798ab470b1d9035b0545996f63000a8a926e0f6d35d0996424f8b6d36dda3 - languageName: node - linkType: hard - -"nopt@npm:^6.0.0": - version: 6.0.0 - resolution: "nopt@npm:6.0.0" - dependencies: - abbrev: ^1.0.0 - bin: - nopt: bin/nopt.js - checksum: 82149371f8be0c4b9ec2f863cc6509a7fd0fa729929c009f3a58e4eb0c9e4cae9920e8f1f8eb46e7d032fec8fb01bede7f0f41a67eb3553b7b8e14fa53de1dac - languageName: node - linkType: hard - -"normalize-path@npm:^3.0.0, normalize-path@npm:~3.0.0": - version: 3.0.0 - resolution: "normalize-path@npm:3.0.0" - checksum: 88eeb4da891e10b1318c4b2476b6e2ecbeb5ff97d946815ffea7794c31a89017c70d7f34b3c2ebf23ef4e9fc9fb99f7dffe36da22011b5b5c6ffa34f4873ec20 - languageName: node - linkType: hard - -"npmlog@npm:^6.0.0": - version: 6.0.2 - resolution: "npmlog@npm:6.0.2" - dependencies: - are-we-there-yet: ^3.0.0 - console-control-strings: ^1.1.0 - gauge: ^4.0.3 - set-blocking: ^2.0.0 - checksum: ae238cd264a1c3f22091cdd9e2b106f684297d3c184f1146984ecbe18aaa86343953f26b9520dedd1b1372bc0316905b736c1932d778dbeb1fcf5a1001390e2a - languageName: node - linkType: hard - -"once@npm:^1.3.0": - version: 1.4.0 - resolution: "once@npm:1.4.0" - dependencies: - wrappy: 1 - checksum: cd0a88501333edd640d95f0d2700fbde6bff20b3d4d9bdc521bdd31af0656b5706570d6c6afe532045a20bb8dc0849f8332d6f2a416e0ba6d3d3b98806c7db68 - languageName: node - linkType: hard - -"optionator@npm:^0.9.3": - version: 0.9.3 - resolution: "optionator@npm:0.9.3" - dependencies: - "@aashutoshrathi/word-wrap": ^1.2.3 - deep-is: ^0.1.3 - fast-levenshtein: ^2.0.6 - levn: ^0.4.1 - prelude-ls: ^1.2.1 - type-check: ^0.4.0 - checksum: 09281999441f2fe9c33a5eeab76700795365a061563d66b098923eb719251a42bdbe432790d35064d0816ead9296dbeb1ad51a733edf4167c96bd5d0882e428a - languageName: node - linkType: hard - -"p-limit@npm:^2.2.0": - version: 2.3.0 - resolution: "p-limit@npm:2.3.0" - dependencies: - p-try: ^2.0.0 - checksum: 84ff17f1a38126c3314e91ecfe56aecbf36430940e2873dadaa773ffe072dc23b7af8e46d4b6485d302a11673fe94c6b67ca2cfbb60c989848b02100d0594ac1 - languageName: node - linkType: hard - -"p-limit@npm:^3.0.2": - version: 3.1.0 - resolution: "p-limit@npm:3.1.0" - dependencies: - yocto-queue: ^0.1.0 - checksum: 7c3690c4dbf62ef625671e20b7bdf1cbc9534e83352a2780f165b0d3ceba21907e77ad63401708145ca4e25bfc51636588d89a8c0aeb715e6c37d1c066430360 - languageName: node - linkType: hard - -"p-locate@npm:^4.1.0": - version: 4.1.0 - resolution: "p-locate@npm:4.1.0" - dependencies: - p-limit: ^2.2.0 - checksum: 513bd14a455f5da4ebfcb819ef706c54adb09097703de6aeaa5d26fe5ea16df92b48d1ac45e01e3944ce1e6aa2a66f7f8894742b8c9d6e276e16cd2049a2b870 - languageName: node - linkType: hard - -"p-locate@npm:^5.0.0": - version: 5.0.0 - resolution: "p-locate@npm:5.0.0" - dependencies: - p-limit: ^3.0.2 - checksum: 1623088f36cf1cbca58e9b61c4e62bf0c60a07af5ae1ca99a720837356b5b6c5ba3eb1b2127e47a06865fee59dd0453cad7cc844cda9d5a62ac1a5a51b7c86d3 - languageName: node - linkType: hard - -"p-map@npm:^4.0.0": - version: 4.0.0 - resolution: "p-map@npm:4.0.0" - dependencies: - aggregate-error: ^3.0.0 - checksum: cb0ab21ec0f32ddffd31dfc250e3afa61e103ef43d957cc45497afe37513634589316de4eb88abdfd969fe6410c22c0b93ab24328833b8eb1ccc087fc0442a1c - languageName: node - linkType: hard - -"p-try@npm:^2.0.0": - version: 2.2.0 - resolution: "p-try@npm:2.2.0" - checksum: f8a8e9a7693659383f06aec604ad5ead237c7a261c18048a6e1b5b85a5f8a067e469aa24f5bc009b991ea3b058a87f5065ef4176793a200d4917349881216cae - languageName: node - linkType: hard - -"pako@npm:~1.0.2": - version: 1.0.11 - resolution: "pako@npm:1.0.11" - checksum: 1be2bfa1f807608c7538afa15d6f25baa523c30ec870a3228a89579e474a4d992f4293859524e46d5d87fd30fa17c5edf34dbef0671251d9749820b488660b16 - languageName: node - linkType: hard - -"parent-module@npm:^1.0.0": - version: 1.0.1 - resolution: "parent-module@npm:1.0.1" - dependencies: - callsites: ^3.0.0 - checksum: 6ba8b255145cae9470cf5551eb74be2d22281587af787a2626683a6c20fbb464978784661478dd2a3f1dad74d1e802d403e1b03c1a31fab310259eec8ac560ff - languageName: node - linkType: hard - -"path-exists@npm:^4.0.0": - version: 4.0.0 - resolution: "path-exists@npm:4.0.0" - checksum: 505807199dfb7c50737b057dd8d351b82c033029ab94cb10a657609e00c1bc53b951cfdbccab8de04c5584d5eff31128ce6afd3db79281874a5ef2adbba55ed1 - languageName: node - linkType: hard - -"path-is-absolute@npm:^1.0.0": - version: 1.0.1 - resolution: "path-is-absolute@npm:1.0.1" - checksum: 060840f92cf8effa293bcc1bea81281bd7d363731d214cbe5c227df207c34cd727430f70c6037b5159c8a870b9157cba65e775446b0ab06fd5ecc7e54615a3b8 - languageName: node - linkType: hard - -"path-key@npm:^3.1.0": - version: 3.1.1 - resolution: "path-key@npm:3.1.1" - checksum: 55cd7a9dd4b343412a8386a743f9c746ef196e57c823d90ca3ab917f90ab9f13dd0ded27252ba49dbdfcab2b091d998bc446f6220cd3cea65db407502a740020 - languageName: node - linkType: hard - -"path-parse@npm:^1.0.7": - version: 1.0.7 - resolution: "path-parse@npm:1.0.7" - checksum: 49abf3d81115642938a8700ec580da6e830dde670be21893c62f4e10bd7dd4c3742ddc603fe24f898cba7eb0c6bc1777f8d9ac14185d34540c6d4d80cd9cae8a - languageName: node - linkType: hard - -"path-scurry@npm:^1.10.1": - version: 1.10.1 - resolution: "path-scurry@npm:1.10.1" - dependencies: - lru-cache: ^9.1.1 || ^10.0.0 - minipass: ^5.0.0 || ^6.0.2 || ^7.0.0 - checksum: e2557cff3a8fb8bc07afdd6ab163a92587884f9969b05bbbaf6fe7379348bfb09af9ed292af12ed32398b15fb443e81692047b786d1eeb6d898a51eb17ed7d90 - languageName: node - linkType: hard - -"path-type@npm:^4.0.0": - version: 4.0.0 - resolution: "path-type@npm:4.0.0" - checksum: 5b1e2daa247062061325b8fdbfd1fb56dde0a448fb1455453276ea18c60685bdad23a445dc148cf87bc216be1573357509b7d4060494a6fd768c7efad833ee45 - languageName: node - linkType: hard - -"picocolors@npm:^1.0.0": - version: 1.0.0 - resolution: "picocolors@npm:1.0.0" - checksum: a2e8092dd86c8396bdba9f2b5481032848525b3dc295ce9b57896f931e63fc16f79805144321f72976383fc249584672a75cc18d6777c6b757603f372f745981 - languageName: node - linkType: hard - -"picomatch@npm:^2.0.4, picomatch@npm:^2.2.1, picomatch@npm:^2.3.1": - version: 2.3.1 - resolution: "picomatch@npm:2.3.1" - checksum: 050c865ce81119c4822c45d3c84f1ced46f93a0126febae20737bd05ca20589c564d6e9226977df859ed5e03dc73f02584a2b0faad36e896936238238b0446cf - languageName: node - linkType: hard - -"pkg-dir@npm:^4.2.0": - version: 4.2.0 - resolution: "pkg-dir@npm:4.2.0" - dependencies: - find-up: ^4.0.0 - checksum: 9863e3f35132bf99ae1636d31ff1e1e3501251d480336edb1c211133c8d58906bed80f154a1d723652df1fda91e01c7442c2eeaf9dc83157c7ae89087e43c8d6 - languageName: node - linkType: hard - -"prelude-ls@npm:^1.2.1": - version: 1.2.1 - resolution: "prelude-ls@npm:1.2.1" - checksum: cd192ec0d0a8e4c6da3bb80e4f62afe336df3f76271ac6deb0e6a36187133b6073a19e9727a1ff108cd8b9982e4768850d413baa71214dd80c7979617dca827a - languageName: node - linkType: hard - -"prettier@npm:^3.0.0": - version: 3.0.0 - resolution: "prettier@npm:3.0.0" - bin: - prettier: bin/prettier.cjs - checksum: 6a832876a1552dc58330d2467874e5a0b46b9ccbfc5d3531eb69d15684743e7f83dc9fbd202db6270446deba9c82b79d24383d09924c462b457136a759425e33 - languageName: node - linkType: hard - -"process-nextick-args@npm:~2.0.0": - version: 2.0.1 - resolution: "process-nextick-args@npm:2.0.1" - checksum: 1d38588e520dab7cea67cbbe2efdd86a10cc7a074c09657635e34f035277b59fbb57d09d8638346bf7090f8e8ebc070c96fa5fd183b777fff4f5edff5e9466cf - languageName: node - linkType: hard - -"promise-retry@npm:^2.0.1": - version: 2.0.1 - resolution: "promise-retry@npm:2.0.1" - dependencies: - err-code: ^2.0.2 - retry: ^0.12.0 - checksum: f96a3f6d90b92b568a26f71e966cbbc0f63ab85ea6ff6c81284dc869b41510e6cdef99b6b65f9030f0db422bf7c96652a3fff9f2e8fb4a0f069d8f4430359429 - languageName: node - linkType: hard - -"punycode@npm:^2.1.0": - version: 2.3.0 - resolution: "punycode@npm:2.3.0" - checksum: 39f760e09a2a3bbfe8f5287cf733ecdad69d6af2fe6f97ca95f24b8921858b91e9ea3c9eeec6e08cede96181b3bb33f95c6ffd8c77e63986508aa2e8159fa200 - languageName: node - linkType: hard - -"queue-microtask@npm:^1.2.2": - version: 1.2.3 - resolution: "queue-microtask@npm:1.2.3" - checksum: b676f8c040cdc5b12723ad2f91414d267605b26419d5c821ff03befa817ddd10e238d22b25d604920340fd73efd8ba795465a0377c4adf45a4a41e4234e42dc4 - languageName: node - linkType: hard - -"randombytes@npm:^2.1.0": - version: 2.1.0 - resolution: "randombytes@npm:2.1.0" - dependencies: - safe-buffer: ^5.1.0 - checksum: d779499376bd4cbb435ef3ab9a957006c8682f343f14089ed5f27764e4645114196e75b7f6abf1cbd84fd247c0cb0651698444df8c9bf30e62120fbbc52269d6 - languageName: node - linkType: hard - -"readable-stream@npm:^3.6.0": - version: 3.6.2 - resolution: "readable-stream@npm:3.6.2" - dependencies: - inherits: ^2.0.3 - string_decoder: ^1.1.1 - util-deprecate: ^1.0.1 - checksum: bdcbe6c22e846b6af075e32cf8f4751c2576238c5043169a1c221c92ee2878458a816a4ea33f4c67623c0b6827c8a400409bfb3cf0bf3381392d0b1dfb52ac8d - languageName: node - linkType: hard - -"readable-stream@npm:~2.3.6": - version: 2.3.8 - resolution: "readable-stream@npm:2.3.8" - dependencies: - core-util-is: ~1.0.0 - inherits: ~2.0.3 - isarray: ~1.0.0 - process-nextick-args: ~2.0.0 - safe-buffer: ~5.1.1 - string_decoder: ~1.1.1 - util-deprecate: ~1.0.1 - checksum: 65645467038704f0c8aaf026a72fbb588a9e2ef7a75cd57a01702ee9db1c4a1e4b03aaad36861a6a0926546a74d174149c8c207527963e0c2d3eee2f37678a42 - languageName: node - linkType: hard - -"readdirp@npm:~3.6.0": - version: 3.6.0 - resolution: "readdirp@npm:3.6.0" - dependencies: - picomatch: ^2.2.1 - checksum: 1ced032e6e45670b6d7352d71d21ce7edf7b9b928494dcaba6f11fba63180d9da6cd7061ebc34175ffda6ff529f481818c962952004d273178acd70f7059b320 - languageName: node - linkType: hard - -"rechoir@npm:^0.8.0": - version: 0.8.0 - resolution: "rechoir@npm:0.8.0" - dependencies: - resolve: ^1.20.0 - checksum: ad3caed8afdefbc33fbc30e6d22b86c35b3d51c2005546f4e79bcc03c074df804b3640ad18945e6bef9ed12caedc035655ec1082f64a5e94c849ff939dc0a788 - languageName: node - linkType: hard - -"require-directory@npm:^2.1.1": - version: 2.1.1 - resolution: "require-directory@npm:2.1.1" - checksum: fb47e70bf0001fdeabdc0429d431863e9475e7e43ea5f94ad86503d918423c1543361cc5166d713eaa7029dd7a3d34775af04764bebff99ef413111a5af18c80 - languageName: node - linkType: hard - -"resolve-cwd@npm:^3.0.0": - version: 3.0.0 - resolution: "resolve-cwd@npm:3.0.0" - dependencies: - resolve-from: ^5.0.0 - checksum: 546e0816012d65778e580ad62b29e975a642989108d9a3c5beabfb2304192fa3c9f9146fbdfe213563c6ff51975ae41bac1d3c6e047dd9572c94863a057b4d81 - languageName: node - linkType: hard - -"resolve-from@npm:^4.0.0": - version: 4.0.0 - resolution: "resolve-from@npm:4.0.0" - checksum: f4ba0b8494846a5066328ad33ef8ac173801a51739eb4d63408c847da9a2e1c1de1e6cbbf72699211f3d13f8fc1325648b169bd15eb7da35688e30a5fb0e4a7f - languageName: node - linkType: hard - -"resolve-from@npm:^5.0.0": - version: 5.0.0 - resolution: "resolve-from@npm:5.0.0" - checksum: 4ceeb9113e1b1372d0cd969f3468fa042daa1dd9527b1b6bb88acb6ab55d8b9cd65dbf18819f9f9ddf0db804990901dcdaade80a215e7b2c23daae38e64f5bdf - languageName: node - linkType: hard - -"resolve@npm:^1.20.0": - version: 1.22.3 - resolution: "resolve@npm:1.22.3" - dependencies: - is-core-module: ^2.12.0 - path-parse: ^1.0.7 - supports-preserve-symlinks-flag: ^1.0.0 - bin: - resolve: bin/resolve - checksum: fb834b81348428cb545ff1b828a72ea28feb5a97c026a1cf40aa1008352c72811ff4d4e71f2035273dc536dcfcae20c13604ba6283c612d70fa0b6e44519c374 - languageName: node - linkType: hard - -"resolve@patch:resolve@^1.20.0#~builtin": - version: 1.22.3 - resolution: "resolve@patch:resolve@npm%3A1.22.3#~builtin::version=1.22.3&hash=c3c19d" - dependencies: - is-core-module: ^2.12.0 - path-parse: ^1.0.7 - supports-preserve-symlinks-flag: ^1.0.0 - bin: - resolve: bin/resolve - checksum: ad59734723b596d0891321c951592ed9015a77ce84907f89c9d9307dd0c06e11a67906a3e628c4cae143d3e44898603478af0ddeb2bba3f229a9373efe342665 - languageName: node - linkType: hard - -"retry@npm:^0.12.0": - version: 0.12.0 - resolution: "retry@npm:0.12.0" - checksum: 623bd7d2e5119467ba66202d733ec3c2e2e26568074923bc0585b6b99db14f357e79bdedb63cab56cec47491c4a0da7e6021a7465ca6dc4f481d3898fdd3158c - languageName: node - linkType: hard - -"reusify@npm:^1.0.4": - version: 1.0.4 - resolution: "reusify@npm:1.0.4" - checksum: c3076ebcc22a6bc252cb0b9c77561795256c22b757f40c0d8110b1300723f15ec0fc8685e8d4ea6d7666f36c79ccc793b1939c748bf36f18f542744a4e379fcc - languageName: node - linkType: hard - -"rimraf@npm:^3.0.2": - version: 3.0.2 - resolution: "rimraf@npm:3.0.2" - dependencies: - glob: ^7.1.3 - bin: - rimraf: bin.js - checksum: 87f4164e396f0171b0a3386cc1877a817f572148ee13a7e113b238e48e8a9f2f31d009a92ec38a591ff1567d9662c6b67fd8818a2dbbaed74bc26a87a2a4a9a0 - languageName: node - linkType: hard - -"run-parallel@npm:^1.1.9": - version: 1.2.0 - resolution: "run-parallel@npm:1.2.0" - dependencies: - queue-microtask: ^1.2.2 - checksum: cb4f97ad25a75ebc11a8ef4e33bb962f8af8516bb2001082ceabd8902e15b98f4b84b4f8a9b222e5d57fc3bd1379c483886ed4619367a7680dad65316993021d - languageName: node - linkType: hard - -"safe-buffer@npm:^5.1.0, safe-buffer@npm:~5.2.0": - version: 5.2.1 - resolution: "safe-buffer@npm:5.2.1" - checksum: b99c4b41fdd67a6aaf280fcd05e9ffb0813654894223afb78a31f14a19ad220bba8aba1cb14eddce1fcfb037155fe6de4e861784eb434f7d11ed58d1e70dd491 - languageName: node - linkType: hard - -"safe-buffer@npm:~5.1.0, safe-buffer@npm:~5.1.1": - version: 5.1.2 - resolution: "safe-buffer@npm:5.1.2" - checksum: f2f1f7943ca44a594893a852894055cf619c1fbcb611237fc39e461ae751187e7baf4dc391a72125e0ac4fb2d8c5c0b3c71529622e6a58f46b960211e704903c - languageName: node - linkType: hard - -"safer-buffer@npm:>= 2.1.2 < 3.0.0": - version: 2.1.2 - resolution: "safer-buffer@npm:2.1.2" - checksum: cab8f25ae6f1434abee8d80023d7e72b598cf1327164ddab31003c51215526801e40b66c5e65d658a0af1e9d6478cadcb4c745f4bd6751f97d8644786c0978b0 - languageName: node - linkType: hard - -"schema-utils@npm:^3.1.1, schema-utils@npm:^3.2.0": - version: 3.3.0 - resolution: "schema-utils@npm:3.3.0" - dependencies: - "@types/json-schema": ^7.0.8 - ajv: ^6.12.5 - ajv-keywords: ^3.5.2 - checksum: ea56971926fac2487f0757da939a871388891bc87c6a82220d125d587b388f1704788f3706e7f63a7b70e49fc2db974c41343528caea60444afd5ce0fe4b85c0 - languageName: node - linkType: hard - -"semver@npm:^7.3.4, semver@npm:^7.3.5, semver@npm:^7.3.7, semver@npm:^7.3.8": - version: 7.5.4 - resolution: "semver@npm:7.5.4" - dependencies: - lru-cache: ^6.0.0 - bin: - semver: bin/semver.js - checksum: 12d8ad952fa353b0995bf180cdac205a4068b759a140e5d3c608317098b3575ac2f1e09182206bf2eb26120e1c0ed8fb92c48c592f6099680de56bb071423ca3 - languageName: node - linkType: hard - -"serialize-javascript@npm:6.0.0": - version: 6.0.0 - resolution: "serialize-javascript@npm:6.0.0" - dependencies: - randombytes: ^2.1.0 - checksum: 56f90b562a1bdc92e55afb3e657c6397c01a902c588c0fe3d4c490efdcc97dcd2a3074ba12df9e94630f33a5ce5b76a74784a7041294628a6f4306e0ec84bf93 - languageName: node - linkType: hard - -"serialize-javascript@npm:^6.0.1": - version: 6.0.1 - resolution: "serialize-javascript@npm:6.0.1" - dependencies: - randombytes: ^2.1.0 - checksum: 3c4f4cb61d0893b988415bdb67243637333f3f574e9e9cc9a006a2ced0b390b0b3b44aef8d51c951272a9002ec50885eefdc0298891bc27eb2fe7510ea87dc4f - languageName: node - linkType: hard +"osmium-solidity-lsp@workspace:toolchains/solidity/lsp": + version: 0.0.0-use.local + resolution: "osmium-solidity-lsp@workspace:toolchains/solidity/lsp" + languageName: unknown + linkType: soft -"set-blocking@npm:^2.0.0": - version: 2.0.0 - resolution: "set-blocking@npm:2.0.0" - checksum: 6e65a05f7cf7ebdf8b7c75b101e18c0b7e3dff4940d480efed8aad3a36a4005140b660fa1d804cb8bce911cac290441dc728084a30504d3516ac2ff7ad607b02 - languageName: node - linkType: hard +"osmium-solidity-toolchain@workspace:toolchains/solidity": + version: 0.0.0-use.local + resolution: "osmium-solidity-toolchain@workspace:toolchains/solidity" + languageName: unknown + linkType: soft -"setimmediate@npm:^1.0.5": - version: 1.0.5 - resolution: "setimmediate@npm:1.0.5" - checksum: c9a6f2c5b51a2dabdc0247db9c46460152ffc62ee139f3157440bd48e7c59425093f42719ac1d7931f054f153e2d26cf37dfeb8da17a794a58198a2705e527fd - languageName: node - linkType: hard +"osmium@workspace:.": + version: 0.0.0-use.local + resolution: "osmium@workspace:." + dependencies: + husky: ^8.0.0 + languageName: unknown + linkType: soft -"shallow-clone@npm:^3.0.0": - version: 3.0.1 - resolution: "shallow-clone@npm:3.0.1" +"p-limit@npm:^3.0.2": + version: 3.1.0 + resolution: "p-limit@npm:3.1.0" dependencies: - kind-of: ^6.0.2 - checksum: 39b3dd9630a774aba288a680e7d2901f5c0eae7b8387fc5c8ea559918b29b3da144b7bdb990d7ccd9e11be05508ac9e459ce51d01fd65e583282f6ffafcba2e7 + yocto-queue: ^0.1.0 + checksum: 7c3690c4dbf62ef625671e20b7bdf1cbc9534e83352a2780f165b0d3ceba21907e77ad63401708145ca4e25bfc51636588d89a8c0aeb715e6c37d1c066430360 languageName: node linkType: hard -"shebang-command@npm:^2.0.0": - version: 2.0.0 - resolution: "shebang-command@npm:2.0.0" +"p-locate@npm:^5.0.0": + version: 5.0.0 + resolution: "p-locate@npm:5.0.0" dependencies: - shebang-regex: ^3.0.0 - checksum: 6b52fe87271c12968f6a054e60f6bde5f0f3d2db483a1e5c3e12d657c488a15474121a1d55cd958f6df026a54374ec38a4a963988c213b7570e1d51575cea7fa + p-limit: ^3.0.2 + checksum: 1623088f36cf1cbca58e9b61c4e62bf0c60a07af5ae1ca99a720837356b5b6c5ba3eb1b2127e47a06865fee59dd0453cad7cc844cda9d5a62ac1a5a51b7c86d3 languageName: node linkType: hard -"shebang-regex@npm:^3.0.0": - version: 3.0.0 - resolution: "shebang-regex@npm:3.0.0" - checksum: 1a2bcae50de99034fcd92ad4212d8e01eedf52c7ec7830eedcf886622804fe36884278f2be8be0ea5fde3fd1c23911643a4e0f726c8685b61871c8908af01222 +"parent-module@npm:^1.0.0": + version: 1.0.1 + resolution: "parent-module@npm:1.0.1" + dependencies: + callsites: ^3.0.0 + checksum: 6ba8b255145cae9470cf5551eb74be2d22281587af787a2626683a6c20fbb464978784661478dd2a3f1dad74d1e802d403e1b03c1a31fab310259eec8ac560ff languageName: node linkType: hard -"signal-exit@npm:^3.0.7": - version: 3.0.7 - resolution: "signal-exit@npm:3.0.7" - checksum: a2f098f247adc367dffc27845853e9959b9e88b01cb301658cfe4194352d8d2bb32e18467c786a7fe15f1d44b233ea35633d076d5e737870b7139949d1ab6318 +"path-exists@npm:^4.0.0": + version: 4.0.0 + resolution: "path-exists@npm:4.0.0" + checksum: 505807199dfb7c50737b057dd8d351b82c033029ab94cb10a657609e00c1bc53b951cfdbccab8de04c5584d5eff31128ce6afd3db79281874a5ef2adbba55ed1 languageName: node linkType: hard -"signal-exit@npm:^4.0.1": - version: 4.1.0 - resolution: "signal-exit@npm:4.1.0" - checksum: 64c757b498cb8629ffa5f75485340594d2f8189e9b08700e69199069c8e3070fb3e255f7ab873c05dc0b3cec412aea7402e10a5990cb6a050bd33ba062a6c549 +"path-is-absolute@npm:^1.0.0": + version: 1.0.1 + resolution: "path-is-absolute@npm:1.0.1" + checksum: 060840f92cf8effa293bcc1bea81281bd7d363731d214cbe5c227df207c34cd727430f70c6037b5159c8a870b9157cba65e775446b0ab06fd5ecc7e54615a3b8 languageName: node linkType: hard -"slash@npm:^3.0.0": - version: 3.0.0 - resolution: "slash@npm:3.0.0" - checksum: 94a93fff615f25a999ad4b83c9d5e257a7280c90a32a7cb8b4a87996e4babf322e469c42b7f649fd5796edd8687652f3fb452a86dc97a816f01113183393f11c +"path-key@npm:^3.1.0": + version: 3.1.1 + resolution: "path-key@npm:3.1.1" + checksum: 55cd7a9dd4b343412a8386a743f9c746ef196e57c823d90ca3ab917f90ab9f13dd0ded27252ba49dbdfcab2b091d998bc446f6220cd3cea65db407502a740020 languageName: node linkType: hard -"smart-buffer@npm:^4.2.0": - version: 4.2.0 - resolution: "smart-buffer@npm:4.2.0" - checksum: b5167a7142c1da704c0e3af85c402002b597081dd9575031a90b4f229ca5678e9a36e8a374f1814c8156a725d17008ae3bde63b92f9cfd132526379e580bec8b +"prelude-ls@npm:^1.2.1": + version: 1.2.1 + resolution: "prelude-ls@npm:1.2.1" + checksum: cd192ec0d0a8e4c6da3bb80e4f62afe336df3f76271ac6deb0e6a36187133b6073a19e9727a1ff108cd8b9982e4768850d413baa71214dd80c7979617dca827a languageName: node linkType: hard -"socks-proxy-agent@npm:^7.0.0": - version: 7.0.0 - resolution: "socks-proxy-agent@npm:7.0.0" - dependencies: - agent-base: ^6.0.2 - debug: ^4.3.3 - socks: ^2.6.2 - checksum: 720554370154cbc979e2e9ce6a6ec6ced205d02757d8f5d93fe95adae454fc187a5cbfc6b022afab850a5ce9b4c7d73e0f98e381879cf45f66317a4895953846 +"prettier@npm:^3.0.0": + version: 3.0.0 + resolution: "prettier@npm:3.0.0" + bin: + prettier: bin/prettier.cjs + checksum: 6a832876a1552dc58330d2467874e5a0b46b9ccbfc5d3531eb69d15684743e7f83dc9fbd202db6270446deba9c82b79d24383d09924c462b457136a759425e33 languageName: node linkType: hard -"socks@npm:^2.6.2": - version: 2.7.1 - resolution: "socks@npm:2.7.1" - dependencies: - ip: ^2.0.0 - smart-buffer: ^4.2.0 - checksum: 259d9e3e8e1c9809a7f5c32238c3d4d2a36b39b83851d0f573bfde5f21c4b1288417ce1af06af1452569cd1eb0841169afd4998f0e04ba04656f6b7f0e46d748 +"punycode@npm:^2.1.0": + version: 2.3.0 + resolution: "punycode@npm:2.3.0" + checksum: 39f760e09a2a3bbfe8f5287cf733ecdad69d6af2fe6f97ca95f24b8921858b91e9ea3c9eeec6e08cede96181b3bb33f95c6ffd8c77e63986508aa2e8159fa200 languageName: node linkType: hard -"source-map-support@npm:~0.5.20": - version: 0.5.21 - resolution: "source-map-support@npm:0.5.21" - dependencies: - buffer-from: ^1.0.0 - source-map: ^0.6.0 - checksum: 43e98d700d79af1d36f859bdb7318e601dfc918c7ba2e98456118ebc4c4872b327773e5a1df09b0524e9e5063bb18f0934538eace60cca2710d1fa687645d137 +"queue-microtask@npm:^1.2.2": + version: 1.2.3 + resolution: "queue-microtask@npm:1.2.3" + checksum: b676f8c040cdc5b12723ad2f91414d267605b26419d5c821ff03befa817ddd10e238d22b25d604920340fd73efd8ba795465a0377c4adf45a4a41e4234e42dc4 languageName: node linkType: hard -"source-map@npm:^0.6.0": - version: 0.6.1 - resolution: "source-map@npm:0.6.1" - checksum: 59ce8640cf3f3124f64ac289012c2b8bd377c238e316fb323ea22fbfe83da07d81e000071d7242cad7a23cd91c7de98e4df8830ec3f133cb6133a5f6e9f67bc2 +"resolve-from@npm:^4.0.0": + version: 4.0.0 + resolution: "resolve-from@npm:4.0.0" + checksum: f4ba0b8494846a5066328ad33ef8ac173801a51739eb4d63408c847da9a2e1c1de1e6cbbf72699211f3d13f8fc1325648b169bd15eb7da35688e30a5fb0e4a7f languageName: node linkType: hard -"ssri@npm:^10.0.0": - version: 10.0.4 - resolution: "ssri@npm:10.0.4" - dependencies: - minipass: ^5.0.0 - checksum: fb14da9f8a72b04eab163eb13a9dda11d5962cd2317f85457c4e0b575e9a6e0e3a6a87b5bf122c75cb36565830cd5f263fb457571bf6f1587eb5f95d095d6165 +"reusify@npm:^1.0.4": + version: 1.0.4 + resolution: "reusify@npm:1.0.4" + checksum: c3076ebcc22a6bc252cb0b9c77561795256c22b757f40c0d8110b1300723f15ec0fc8685e8d4ea6d7666f36c79ccc793b1939c748bf36f18f542744a4e379fcc languageName: node linkType: hard -"string-width-cjs@npm:string-width@^4.2.0, string-width@npm:^1.0.2 || 2 || 3 || 4, string-width@npm:^4.1.0, string-width@npm:^4.2.0, string-width@npm:^4.2.3": - version: 4.2.3 - resolution: "string-width@npm:4.2.3" +"rimraf@npm:^3.0.2": + version: 3.0.2 + resolution: "rimraf@npm:3.0.2" dependencies: - emoji-regex: ^8.0.0 - is-fullwidth-code-point: ^3.0.0 - strip-ansi: ^6.0.1 - checksum: e52c10dc3fbfcd6c3a15f159f54a90024241d0f149cf8aed2982a2d801d2e64df0bf1dc351cf8e95c3319323f9f220c16e740b06faecd53e2462df1d2b5443fb + glob: ^7.1.3 + bin: + rimraf: bin.js + checksum: 87f4164e396f0171b0a3386cc1877a817f572148ee13a7e113b238e48e8a9f2f31d009a92ec38a591ff1567d9662c6b67fd8818a2dbbaed74bc26a87a2a4a9a0 languageName: node linkType: hard -"string-width@npm:^5.0.1, string-width@npm:^5.1.2": - version: 5.1.2 - resolution: "string-width@npm:5.1.2" +"run-parallel@npm:^1.1.9": + version: 1.2.0 + resolution: "run-parallel@npm:1.2.0" dependencies: - eastasianwidth: ^0.2.0 - emoji-regex: ^9.2.2 - strip-ansi: ^7.0.1 - checksum: 7369deaa29f21dda9a438686154b62c2c5f661f8dda60449088f9f980196f7908fc39fdd1803e3e01541970287cf5deae336798337e9319a7055af89dafa7193 + queue-microtask: ^1.2.2 + checksum: cb4f97ad25a75ebc11a8ef4e33bb962f8af8516bb2001082ceabd8902e15b98f4b84b4f8a9b222e5d57fc3bd1379c483886ed4619367a7680dad65316993021d languageName: node linkType: hard -"string_decoder@npm:^1.1.1": - version: 1.3.0 - resolution: "string_decoder@npm:1.3.0" +"shebang-command@npm:^2.0.0": + version: 2.0.0 + resolution: "shebang-command@npm:2.0.0" dependencies: - safe-buffer: ~5.2.0 - checksum: 8417646695a66e73aefc4420eb3b84cc9ffd89572861fe004e6aeb13c7bc00e2f616247505d2dbbef24247c372f70268f594af7126f43548565c68c117bdeb56 + shebang-regex: ^3.0.0 + checksum: 6b52fe87271c12968f6a054e60f6bde5f0f3d2db483a1e5c3e12d657c488a15474121a1d55cd958f6df026a54374ec38a4a963988c213b7570e1d51575cea7fa languageName: node linkType: hard -"string_decoder@npm:~1.1.1": - version: 1.1.1 - resolution: "string_decoder@npm:1.1.1" - dependencies: - safe-buffer: ~5.1.0 - checksum: 9ab7e56f9d60a28f2be697419917c50cac19f3e8e6c28ef26ed5f4852289fe0de5d6997d29becf59028556f2c62983790c1d9ba1e2a3cc401768ca12d5183a5b +"shebang-regex@npm:^3.0.0": + version: 3.0.0 + resolution: "shebang-regex@npm:3.0.0" + checksum: 1a2bcae50de99034fcd92ad4212d8e01eedf52c7ec7830eedcf886622804fe36884278f2be8be0ea5fde3fd1c23911643a4e0f726c8685b61871c8908af01222 languageName: node linkType: hard -"strip-ansi-cjs@npm:strip-ansi@^6.0.1, strip-ansi@npm:^6.0.0, strip-ansi@npm:^6.0.1": +"strip-ansi@npm:^6.0.1": version: 6.0.1 resolution: "strip-ansi@npm:6.0.1" dependencies: @@ -3087,31 +856,13 @@ __metadata: languageName: node linkType: hard -"strip-ansi@npm:^7.0.1": - version: 7.1.0 - resolution: "strip-ansi@npm:7.1.0" - dependencies: - ansi-regex: ^6.0.1 - checksum: 859c73fcf27869c22a4e4d8c6acfe690064659e84bef9458aa6d13719d09ca88dcfd40cbf31fd0be63518ea1a643fe070b4827d353e09533a5b0b9fd4553d64d - languageName: node - linkType: hard - -"strip-json-comments@npm:3.1.1, strip-json-comments@npm:^3.1.1": +"strip-json-comments@npm:^3.1.1": version: 3.1.1 resolution: "strip-json-comments@npm:3.1.1" checksum: 492f73e27268f9b1c122733f28ecb0e7e8d8a531a6662efbd08e22cccb3f9475e90a1b82cab06a392f6afae6d2de636f977e231296400d0ec5304ba70f166443 languageName: node linkType: hard -"supports-color@npm:8.1.1, supports-color@npm:^8.0.0": - version: 8.1.1 - resolution: "supports-color@npm:8.1.1" - dependencies: - has-flag: ^4.0.0 - checksum: c052193a7e43c6cdc741eb7f378df605636e01ad434badf7324f17fb60c69a880d8d8fcdcb562cf94c2350e57b937d7425ab5b8326c67c2adc48f7c87c1db406 - languageName: node - linkType: hard - "supports-color@npm:^7.1.0": version: 7.2.0 resolution: "supports-color@npm:7.2.0" @@ -3121,78 +872,6 @@ __metadata: languageName: node linkType: hard -"supports-preserve-symlinks-flag@npm:^1.0.0": - version: 1.0.0 - resolution: "supports-preserve-symlinks-flag@npm:1.0.0" - checksum: 53b1e247e68e05db7b3808b99b892bd36fb096e6fba213a06da7fab22045e97597db425c724f2bbd6c99a3c295e1e73f3e4de78592289f38431049e1277ca0ae - languageName: node - linkType: hard - -"tapable@npm:^2.1.1, tapable@npm:^2.2.0": - version: 2.2.1 - resolution: "tapable@npm:2.2.1" - checksum: 3b7a1b4d86fa940aad46d9e73d1e8739335efd4c48322cb37d073eb6f80f5281889bf0320c6d8ffcfa1a0dd5bfdbd0f9d037e252ef972aca595330538aac4d51 - languageName: node - linkType: hard - -"tar@npm:^6.1.11, tar@npm:^6.1.2": - version: 6.1.15 - resolution: "tar@npm:6.1.15" - dependencies: - chownr: ^2.0.0 - fs-minipass: ^2.0.0 - minipass: ^5.0.0 - minizlib: ^2.1.1 - mkdirp: ^1.0.3 - yallist: ^4.0.0 - checksum: f23832fceeba7578bf31907aac744ae21e74a66f4a17a9e94507acf460e48f6db598c7023882db33bab75b80e027c21f276d405e4a0322d58f51c7088d428268 - languageName: node - linkType: hard - -"terser-webpack-plugin@npm:^5.3.7": - version: 5.3.9 - resolution: "terser-webpack-plugin@npm:5.3.9" - dependencies: - "@jridgewell/trace-mapping": ^0.3.17 - jest-worker: ^27.4.5 - schema-utils: ^3.1.1 - serialize-javascript: ^6.0.1 - terser: ^5.16.8 - peerDependencies: - webpack: ^5.1.0 - peerDependenciesMeta: - "@swc/core": - optional: true - esbuild: - optional: true - uglify-js: - optional: true - checksum: 41705713d6f9cb83287936b21e27c658891c78c4392159f5148b5623f0e8c48559869779619b058382a4c9758e7820ea034695e57dc7c474b4962b79f553bc5f - languageName: node - linkType: hard - -"terser@npm:^5.16.8": - version: 5.19.2 - resolution: "terser@npm:5.19.2" - dependencies: - "@jridgewell/source-map": ^0.3.3 - acorn: ^8.8.2 - commander: ^2.20.0 - source-map-support: ~0.5.20 - bin: - terser: bin/terser - checksum: e059177775b4d4f4cff219ad89293175aefbd1b081252270444dc83e42a2c5f07824eb2a85eae6e22ef6eb7ef04b21af36dd7d1dd7cfb93912310e57d416a205 - languageName: node - linkType: hard - -"test-project-architecture@workspace:.": - version: 0.0.0-use.local - resolution: "test-project-architecture@workspace:." - dependencies: - husky: ^8.0.0 - languageName: unknown - linkType: soft - "text-table@npm:^0.2.0": version: 0.2.0 resolution: "text-table@npm:0.2.0" @@ -3200,48 +879,6 @@ __metadata: languageName: node linkType: hard -"to-regex-range@npm:^5.0.1": - version: 5.0.1 - resolution: "to-regex-range@npm:5.0.1" - dependencies: - is-number: ^7.0.0 - checksum: f76fa01b3d5be85db6a2a143e24df9f60dd047d151062d0ba3df62953f2f697b16fe5dad9b0ac6191c7efc7b1d9dcaa4b768174b7b29da89d4428e64bc0a20ed - languageName: node - linkType: hard - -"ts-loader@npm:^9.4.3": - version: 9.4.4 - resolution: "ts-loader@npm:9.4.4" - dependencies: - chalk: ^4.1.0 - enhanced-resolve: ^5.0.0 - micromatch: ^4.0.0 - semver: ^7.3.4 - peerDependencies: - typescript: "*" - webpack: ^5.0.0 - checksum: 8e5e6b839b0edfa40d2156c880d88ccab58226894ea5978221bc48c7db3215e2e856bfd0093f148e925a2befc42d6c94cafa9a994a7da274541efaa916012b63 - languageName: node - linkType: hard - -"tslib@npm:^1.8.1": - version: 1.14.1 - resolution: "tslib@npm:1.14.1" - checksum: dbe628ef87f66691d5d2959b3e41b9ca0045c3ee3c7c7b906cc1e328b39f199bb1ad9e671c39025bd56122ac57dfbf7385a94843b1cc07c60a4db74795829acd - languageName: node - linkType: hard - -"tsutils@npm:^3.21.0": - version: 3.21.0 - resolution: "tsutils@npm:3.21.0" - dependencies: - tslib: ^1.8.1 - peerDependencies: - typescript: ">=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta" - checksum: 1843f4c1b2e0f975e08c4c21caa4af4f7f65a12ac1b81b3b8489366826259323feb3fc7a243123453d2d1a02314205a7634e048d4a8009921da19f99755cdc48 - languageName: node - linkType: hard - "type-check@npm:^0.4.0, type-check@npm:~0.4.0": version: 0.4.0 resolution: "type-check@npm:0.4.0" @@ -3258,58 +895,6 @@ __metadata: languageName: node linkType: hard -"typescript@npm:^5.1.3": - version: 5.1.6 - resolution: "typescript@npm:5.1.6" - bin: - tsc: bin/tsc - tsserver: bin/tsserver - checksum: b2f2c35096035fe1f5facd1e38922ccb8558996331405eb00a5111cc948b2e733163cc22fab5db46992aba7dd520fff637f2c1df4996ff0e134e77d3249a7350 - languageName: node - linkType: hard - -"typescript@patch:typescript@^5.1.3#~builtin": - version: 5.1.6 - resolution: "typescript@patch:typescript@npm%3A5.1.6#~builtin::version=5.1.6&hash=5da071" - bin: - tsc: bin/tsc - tsserver: bin/tsserver - checksum: f53bfe97f7c8b2b6d23cf572750d4e7d1e0c5fff1c36d859d0ec84556a827b8785077bc27676bf7e71fae538e517c3ecc0f37e7f593be913d884805d931bc8be - languageName: node - linkType: hard - -"unique-filename@npm:^3.0.0": - version: 3.0.0 - resolution: "unique-filename@npm:3.0.0" - dependencies: - unique-slug: ^4.0.0 - checksum: 8e2f59b356cb2e54aab14ff98a51ac6c45781d15ceaab6d4f1c2228b780193dc70fae4463ce9e1df4479cb9d3304d7c2043a3fb905bdeca71cc7e8ce27e063df - languageName: node - linkType: hard - -"unique-slug@npm:^4.0.0": - version: 4.0.0 - resolution: "unique-slug@npm:4.0.0" - dependencies: - imurmurhash: ^0.1.4 - checksum: 0884b58365af59f89739e6f71e3feacb5b1b41f2df2d842d0757933620e6de08eff347d27e9d499b43c40476cbaf7988638d3acb2ffbcb9d35fd035591adfd15 - languageName: node - linkType: hard - -"update-browserslist-db@npm:^1.0.11": - version: 1.0.11 - resolution: "update-browserslist-db@npm:1.0.11" - dependencies: - escalade: ^3.1.1 - picocolors: ^1.0.0 - peerDependencies: - browserslist: ">= 4.21.0" - bin: - update-browserslist-db: cli.js - checksum: b98327518f9a345c7cad5437afae4d2ae7d865f9779554baf2a200fdf4bac4969076b679b1115434bd6557376bdd37ca7583d0f9b8f8e302d7d4cc1e91b5f231 - languageName: node - linkType: hard - "uri-js@npm:^4.2.2": version: 4.4.1 resolution: "uri-js@npm:4.4.1" @@ -3319,110 +904,7 @@ __metadata: languageName: node linkType: hard -"util-deprecate@npm:^1.0.1, util-deprecate@npm:~1.0.1": - version: 1.0.2 - resolution: "util-deprecate@npm:1.0.2" - checksum: 474acf1146cb2701fe3b074892217553dfcf9a031280919ba1b8d651a068c9b15d863b7303cb15bd00a862b498e6cf4ad7b4a08fb134edd5a6f7641681cb54a2 - languageName: node - linkType: hard - -"watchpack@npm:^2.4.0": - version: 2.4.0 - resolution: "watchpack@npm:2.4.0" - dependencies: - glob-to-regexp: ^0.4.1 - graceful-fs: ^4.1.2 - checksum: 23d4bc58634dbe13b86093e01c6a68d8096028b664ab7139d58f0c37d962d549a940e98f2f201cecdabd6f9c340338dc73ef8bf094a2249ef582f35183d1a131 - languageName: node - linkType: hard - -"webpack-cli@npm:^5.1.1": - version: 5.1.4 - resolution: "webpack-cli@npm:5.1.4" - dependencies: - "@discoveryjs/json-ext": ^0.5.0 - "@webpack-cli/configtest": ^2.1.1 - "@webpack-cli/info": ^2.0.2 - "@webpack-cli/serve": ^2.0.5 - colorette: ^2.0.14 - commander: ^10.0.1 - cross-spawn: ^7.0.3 - envinfo: ^7.7.3 - fastest-levenshtein: ^1.0.12 - import-local: ^3.0.2 - interpret: ^3.1.1 - rechoir: ^0.8.0 - webpack-merge: ^5.7.3 - peerDependencies: - webpack: 5.x.x - peerDependenciesMeta: - "@webpack-cli/generators": - optional: true - webpack-bundle-analyzer: - optional: true - webpack-dev-server: - optional: true - bin: - webpack-cli: bin/cli.js - checksum: 3a4ad0d0342a6815c850ee4633cc2a8a5dae04f918e7847f180bf24ab400803cf8a8943707ffbed03eb20fe6ce647f996f60a2aade87b0b4a9954da3da172ce0 - languageName: node - linkType: hard - -"webpack-merge@npm:^5.7.3": - version: 5.9.0 - resolution: "webpack-merge@npm:5.9.0" - dependencies: - clone-deep: ^4.0.1 - wildcard: ^2.0.0 - checksum: 64fe2c23aacc5f19684452a0e84ec02c46b990423aee6fcc5c18d7d471155bd14e9a6adb02bd3656eb3e0ac2532c8e97d69412ad14c97eeafe32fa6d10050872 - languageName: node - linkType: hard - -"webpack-sources@npm:^3.2.3": - version: 3.2.3 - resolution: "webpack-sources@npm:3.2.3" - checksum: 989e401b9fe3536529e2a99dac8c1bdc50e3a0a2c8669cbafad31271eadd994bc9405f88a3039cd2e29db5e6d9d0926ceb7a1a4e7409ece021fe79c37d9c4607 - languageName: node - linkType: hard - -"webpack@npm:^5.85.0": - version: 5.88.2 - resolution: "webpack@npm:5.88.2" - dependencies: - "@types/eslint-scope": ^3.7.3 - "@types/estree": ^1.0.0 - "@webassemblyjs/ast": ^1.11.5 - "@webassemblyjs/wasm-edit": ^1.11.5 - "@webassemblyjs/wasm-parser": ^1.11.5 - acorn: ^8.7.1 - acorn-import-assertions: ^1.9.0 - browserslist: ^4.14.5 - chrome-trace-event: ^1.0.2 - enhanced-resolve: ^5.15.0 - es-module-lexer: ^1.2.1 - eslint-scope: 5.1.1 - events: ^3.2.0 - glob-to-regexp: ^0.4.1 - graceful-fs: ^4.2.9 - json-parse-even-better-errors: ^2.3.1 - loader-runner: ^4.2.0 - mime-types: ^2.1.27 - neo-async: ^2.6.2 - schema-utils: ^3.2.0 - tapable: ^2.1.1 - terser-webpack-plugin: ^5.3.7 - watchpack: ^2.4.0 - webpack-sources: ^3.2.3 - peerDependenciesMeta: - webpack-cli: - optional: true - bin: - webpack: bin/webpack.js - checksum: 79476a782da31a21f6dd38fbbd06b68da93baf6a62f0d08ca99222367f3b8668f5a1f2086b7bb78e23172e31fa6df6fa7ab09b25e827866c4fc4dc2b30443ce2 - languageName: node - linkType: hard - -"which@npm:^2.0.1, which@npm:^2.0.2": +"which@npm:^2.0.1": version: 2.0.2 resolution: "which@npm:2.0.2" dependencies: @@ -3433,51 +915,6 @@ __metadata: languageName: node linkType: hard -"wide-align@npm:^1.1.5": - version: 1.1.5 - resolution: "wide-align@npm:1.1.5" - dependencies: - string-width: ^1.0.2 || 2 || 3 || 4 - checksum: d5fc37cd561f9daee3c80e03b92ed3e84d80dde3365a8767263d03dacfc8fa06b065ffe1df00d8c2a09f731482fcacae745abfbb478d4af36d0a891fad4834d3 - languageName: node - linkType: hard - -"wildcard@npm:^2.0.0": - version: 2.0.1 - resolution: "wildcard@npm:2.0.1" - checksum: e0c60a12a219e4b12065d1199802d81c27b841ed6ad6d9d28240980c73ceec6f856771d575af367cbec2982d9ae7838759168b551776577f155044f5a5ba843c - languageName: node - linkType: hard - -"workerpool@npm:6.2.1": - version: 6.2.1 - resolution: "workerpool@npm:6.2.1" - checksum: c2c6eebbc5225f10f758d599a5c016fa04798bcc44e4c1dffb34050cd361d7be2e97891aa44419e7afe647b1f767b1dc0b85a5e046c409d890163f655028b09d - languageName: node - linkType: hard - -"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0, wrap-ansi@npm:^7.0.0": - version: 7.0.0 - resolution: "wrap-ansi@npm:7.0.0" - dependencies: - ansi-styles: ^4.0.0 - string-width: ^4.1.0 - strip-ansi: ^6.0.0 - checksum: a790b846fd4505de962ba728a21aaeda189b8ee1c7568ca5e817d85930e06ef8d1689d49dbf0e881e8ef84436af3a88bc49115c2e2788d841ff1b8b5b51a608b - languageName: node - linkType: hard - -"wrap-ansi@npm:^8.1.0": - version: 8.1.0 - resolution: "wrap-ansi@npm:8.1.0" - dependencies: - ansi-styles: ^6.1.0 - string-width: ^5.0.1 - strip-ansi: ^7.0.1 - checksum: 371733296dc2d616900ce15a0049dca0ef67597d6394c57347ba334393599e800bab03c41d4d45221b6bc967b8c453ec3ae4749eff3894202d16800fdfe0e238 - languageName: node - linkType: hard - "wrappy@npm:1": version: 1.0.2 resolution: "wrappy@npm:1.0.2" @@ -3485,61 +922,6 @@ __metadata: languageName: node linkType: hard -"y18n@npm:^5.0.5": - version: 5.0.8 - resolution: "y18n@npm:5.0.8" - checksum: 54f0fb95621ee60898a38c572c515659e51cc9d9f787fb109cef6fde4befbe1c4602dc999d30110feee37456ad0f1660fa2edcfde6a9a740f86a290999550d30 - languageName: node - linkType: hard - -"yallist@npm:^4.0.0": - version: 4.0.0 - resolution: "yallist@npm:4.0.0" - checksum: 343617202af32df2a15a3be36a5a8c0c8545208f3d3dfbc6bb7c3e3b7e8c6f8e7485432e4f3b88da3031a6e20afa7c711eded32ddfb122896ac5d914e75848d5 - languageName: node - linkType: hard - -"yargs-parser@npm:20.2.4": - version: 20.2.4 - resolution: "yargs-parser@npm:20.2.4" - checksum: d251998a374b2743a20271c2fd752b9fbef24eb881d53a3b99a7caa5e8227fcafd9abf1f345ac5de46435821be25ec12189a11030c12ee6481fef6863ed8b924 - languageName: node - linkType: hard - -"yargs-parser@npm:^20.2.2": - version: 20.2.9 - resolution: "yargs-parser@npm:20.2.9" - checksum: 8bb69015f2b0ff9e17b2c8e6bfe224ab463dd00ca211eece72a4cd8a906224d2703fb8a326d36fdd0e68701e201b2a60ed7cf81ce0fd9b3799f9fe7745977ae3 - languageName: node - linkType: hard - -"yargs-unparser@npm:2.0.0": - version: 2.0.0 - resolution: "yargs-unparser@npm:2.0.0" - dependencies: - camelcase: ^6.0.0 - decamelize: ^4.0.0 - flat: ^5.0.2 - is-plain-obj: ^2.1.0 - checksum: 68f9a542c6927c3768c2f16c28f71b19008710abd6b8f8efbac6dcce26bbb68ab6503bed1d5994bdbc2df9a5c87c161110c1dfe04c6a3fe5c6ad1b0e15d9a8a3 - languageName: node - linkType: hard - -"yargs@npm:16.2.0": - version: 16.2.0 - resolution: "yargs@npm:16.2.0" - dependencies: - cliui: ^7.0.2 - escalade: ^3.1.1 - get-caller-file: ^2.0.5 - require-directory: ^2.1.1 - string-width: ^4.2.0 - y18n: ^5.0.5 - yargs-parser: ^20.2.2 - checksum: b14afbb51e3251a204d81937c86a7e9d4bdbf9a2bcee38226c900d00f522969ab675703bee2a6f99f8e20103f608382936034e64d921b74df82b63c07c5e8f59 - languageName: node - linkType: hard - "yocto-queue@npm:^0.1.0": version: 0.1.0 resolution: "yocto-queue@npm:0.1.0" From 47e7aeed394061ce17a78cd0a7c35696be936340 Mon Sep 17 00:00:00 2001 From: 0xMemoryGrinder <35138272+0xMemoryGrinder@users.noreply.github.com> Date: Fri, 8 Sep 2023 15:00:54 -0400 Subject: [PATCH 006/325] fix(solidity/linter): added missing rules for CI --- .husky/post-rewrite | 0 .husky/pre-commit | 0 toolchains/solidity/linter/core/package.json | 2 ++ toolchains/solidity/linter/package.json | 2 ++ 4 files changed, 4 insertions(+) mode change 100644 => 100755 .husky/post-rewrite mode change 100644 => 100755 .husky/pre-commit diff --git a/.husky/post-rewrite b/.husky/post-rewrite old mode 100644 new mode 100755 diff --git a/.husky/pre-commit b/.husky/pre-commit old mode 100644 new mode 100755 diff --git a/toolchains/solidity/linter/core/package.json b/toolchains/solidity/linter/core/package.json index 8d2a3507..c92c017c 100644 --- a/toolchains/solidity/linter/core/package.json +++ b/toolchains/solidity/linter/core/package.json @@ -4,6 +4,8 @@ "license": "MIT", "scripts": { "build": "cargo build --release", + "lint": "cargo clippy -- -D warnings", + "format": "cargo fmt", "test": "cargo test" } } diff --git a/toolchains/solidity/linter/package.json b/toolchains/solidity/linter/package.json index 42de7a3e..c4e8dcd1 100644 --- a/toolchains/solidity/linter/package.json +++ b/toolchains/solidity/linter/package.json @@ -4,6 +4,8 @@ "license": "MIT", "scripts": { "build": "yarn --cwd core build", + "lint": "yarn --cwd core lint", + "format": "yarn --cwd core format", "test": "yarn --cwd core test" } } From d24604934531b80663b0e7463934d890e1f443a8 Mon Sep 17 00:00:00 2001 From: 0xMemoryGrinder <35138272+0xMemoryGrinder@users.noreply.github.com> Date: Fri, 8 Sep 2023 15:40:58 -0400 Subject: [PATCH 007/325] fix(solidity/linter): fixed linting and format issues --- .pnp.cjs | 14 +++ .../linter/core/solc-wrapper/src/ast/ast.rs | 1 - .../linter/core/solc-wrapper/src/ast/utils.rs | 1 - .../linter/core/solidhunter-lib/src/linter.rs | 11 +- .../src/rules/best_practises/line_maxlen.rs | 6 +- .../rules/best_practises/max_states_count.rs | 5 +- .../src/rules/best_practises/reason_string.rs | 4 +- .../src/rules/miscellaneous/quotes.rs | 6 +- .../rules/naming/contract_name_pascalcase.rs | 7 +- .../src/rules/naming/func_name_camelcase.rs | 7 +- .../rules/naming/func_param_name_camelcase.rs | 7 +- .../src/rules/naming/use_forbidden_name.rs | 5 +- .../src/rules/order/import_on_top.rs | 7 +- .../solidhunter-lib/src/rules/rule_impl.rs | 10 +- toolchains/solidity/linter/core/src/main.rs | 101 ++++++++++++------ toolchains/solidity/linter/package.json | 12 ++- yarn.lock | 6 ++ 17 files changed, 131 insertions(+), 79 deletions(-) diff --git a/.pnp.cjs b/.pnp.cjs index 8894b437..70dbf47f 100644 --- a/.pnp.cjs +++ b/.pnp.cjs @@ -39,6 +39,10 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { "name": "@solidity/linter",\ "reference": "workspace:toolchains/solidity/linter"\ },\ + {\ + "name": "core",\ + "reference": "workspace:toolchains/solidity/linter/core"\ + },\ {\ "name": "osmium-solidity-lsp",\ "reference": "workspace:toolchains/solidity/lsp"\ @@ -51,6 +55,7 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { ["@osmium-packages/eslint-config", ["workspace:packages/eslint-config"]],\ ["@osmium-packages/prettier-config", ["workspace:packages/prettier-config"]],\ ["@solidity/linter", ["workspace:toolchains/solidity/linter"]],\ + ["core", ["workspace:toolchains/solidity/linter/core"]],\ ["osmium", ["workspace:."]],\ ["osmium-manager", ["workspace:manager"]],\ ["osmium-solidity-lsp", ["workspace:toolchains/solidity/lsp"]],\ @@ -375,6 +380,15 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { "linkType": "HARD"\ }]\ ]],\ + ["core", [\ + ["workspace:toolchains/solidity/linter/core", {\ + "packageLocation": "./toolchains/solidity/linter/core/",\ + "packageDependencies": [\ + ["core", "workspace:toolchains/solidity/linter/core"]\ + ],\ + "linkType": "SOFT"\ + }]\ + ]],\ ["cross-spawn", [\ ["npm:7.0.3", {\ "packageLocation": "./.yarn/cache/cross-spawn-npm-7.0.3-e4ff3e65b3-671cc7c728.zip/node_modules/cross-spawn/",\ diff --git a/toolchains/solidity/linter/core/solc-wrapper/src/ast/ast.rs b/toolchains/solidity/linter/core/solc-wrapper/src/ast/ast.rs index 915518e0..de66585c 100644 --- a/toolchains/solidity/linter/core/solc-wrapper/src/ast/ast.rs +++ b/toolchains/solidity/linter/core/solc-wrapper/src/ast/ast.rs @@ -1,5 +1,4 @@ use std::collections::HashMap; -use std::fs::File; use serde::{Serialize, Deserialize}; #[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] diff --git a/toolchains/solidity/linter/core/solc-wrapper/src/ast/utils.rs b/toolchains/solidity/linter/core/solc-wrapper/src/ast/utils.rs index 4e667f3c..3cbd39eb 100644 --- a/toolchains/solidity/linter/core/solc-wrapper/src/ast/utils.rs +++ b/toolchains/solidity/linter/core/solc-wrapper/src/ast/utils.rs @@ -1,4 +1,3 @@ -use std::ops::Deref; use crate::ast::ast::*; pub enum Nodes { diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/linter.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/linter.rs index 8dbdc91f..172c2117 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/linter.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/linter.rs @@ -43,7 +43,7 @@ impl SolidLinter { self._create_rules(&rules_config, true); } pub fn new() -> SolidLinter { - let mut linter : SolidLinter = SolidLinter { + let linter : SolidLinter = SolidLinter { files: Vec::new(), rule_factory: RuleFactory::new(), rules: Vec::new(), @@ -124,10 +124,11 @@ impl SolidLinter { pub fn parse_folder(&mut self, folder: String) -> Vec { let mut result: Vec = Vec::new(); - - for entry in glob(&*(folder + "/**/*.sol")) { - for path in entry { - result.push(self.parse_file(String::from(path.unwrap().into_os_string().into_string().unwrap()))); + if let Ok(entries) = glob(&*(folder + "/**/*.sol")) { + for entry in entries { + if let Ok(path) = entry { + result.push(self.parse_file(String::from(path.into_os_string().into_string().unwrap()))); + } } } result diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/line_maxlen.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/line_maxlen.rs index 4de2c5ba..5b2f35a9 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/line_maxlen.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/line_maxlen.rs @@ -1,6 +1,4 @@ -use std::ops::Index; use crate::linter::SolidFile; -use solc_wrapper::*; use crate::rules::types::*; use crate::types::*; @@ -11,7 +9,7 @@ pub struct LineMaxLen { impl RuleType for LineMaxLen { - fn diagnose(&self, file: &SolidFile, files: &Vec) -> Vec { + fn diagnose(&self, file: &SolidFile, _files: &Vec) -> Vec { let mut res = Vec::new(); let mut line_idx = 1; @@ -41,7 +39,7 @@ impl RuleType for LineMaxLen { impl LineMaxLen { pub(crate) fn create(data: RuleEntry) -> Box { - let mut rule = LineMaxLen { + let rule = LineMaxLen { max_len: data.data[0].parse::().unwrap(), data }; diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/max_states_count.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/max_states_count.rs index 3da97c95..76a7a046 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/max_states_count.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/max_states_count.rs @@ -1,4 +1,3 @@ -use std::ops::Index; use crate::linter::SolidFile; use solc_wrapper::*; use crate::rules::types::*; @@ -12,7 +11,7 @@ pub struct MaxStatesCount { impl RuleType for MaxStatesCount { - fn diagnose(&self, file: &SolidFile, files: &Vec) -> Vec { + fn diagnose(&self, file: &SolidFile, _files: &Vec) -> Vec { let mut res = Vec::new(); let mut count = 0; @@ -56,7 +55,7 @@ impl MaxStatesCount { pub(crate) const RULE_ID: &'static str = "max-states-count"; pub(crate) fn create(data: RuleEntry) -> Box { - let mut rule = MaxStatesCount { + let rule = MaxStatesCount { max_states: data.data[0].parse::().unwrap(), data }; diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/reason_string.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/reason_string.rs index 04468081..8181c676 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/reason_string.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/reason_string.rs @@ -19,7 +19,7 @@ pub struct ReasonString { impl RuleType for ReasonString { - fn diagnose(&self, file: &SolidFile, files: &Vec) -> Vec { + fn diagnose(&self, file: &SolidFile, _files: &Vec) -> Vec { let mut res = Vec::new(); let nodes = get_all_nodes_by_type(file.data.clone(), NodeType::FunctionCall); @@ -127,7 +127,7 @@ impl RuleType for ReasonString { impl ReasonString { pub fn create(data: RuleEntry) -> Box { - let mut rule = ReasonString { + let rule = ReasonString { max_length: data.data[0].parse::().unwrap(), data }; diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/miscellaneous/quotes.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/miscellaneous/quotes.rs index 6a5e00d9..3b759e66 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/miscellaneous/quotes.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/miscellaneous/quotes.rs @@ -1,6 +1,4 @@ -use std::ops::Index; use crate::linter::SolidFile; -use solc_wrapper::*; use crate::rules::types::*; use crate::types::*; @@ -11,7 +9,7 @@ pub struct Quotes { impl RuleType for Quotes { - fn diagnose(&self, file: &SolidFile, files: &Vec) -> Vec { + fn diagnose(&self, file: &SolidFile, _files: &Vec) -> Vec { let mut res = Vec::new(); let mut line_idx = 1; @@ -42,7 +40,7 @@ impl RuleType for Quotes { impl Quotes { pub(crate) fn create(data: RuleEntry) -> Box { - let mut rule = Quotes { + let rule = Quotes { data }; Box::new(rule) diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/contract_name_pascalcase.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/contract_name_pascalcase.rs index b94c85c6..cb643366 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/contract_name_pascalcase.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/contract_name_pascalcase.rs @@ -1,8 +1,7 @@ -use clap::builder::Str; use crate::linter::SolidFile; use crate::rules::types::*; use crate::types::*; -use solc_wrapper::{ContractDefinitionChildNodes, decode_location, SourceUnit, SourceUnitChildNodes}; +use solc_wrapper::{decode_location, SourceUnitChildNodes}; pub struct ContractNamePascalCase { data: RuleEntry @@ -10,7 +9,7 @@ pub struct ContractNamePascalCase { impl RuleType for ContractNamePascalCase { - fn diagnose(&self, file: &SolidFile, files: &Vec) -> Vec { + fn diagnose(&self, file: &SolidFile, _files: &Vec) -> Vec { let mut res = Vec::new(); @@ -46,7 +45,7 @@ impl RuleType for ContractNamePascalCase { impl ContractNamePascalCase { pub(crate) fn create(data: RuleEntry) -> Box { - let mut rule = ContractNamePascalCase { + let rule = ContractNamePascalCase { data }; Box::new(rule) diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/func_name_camelcase.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/func_name_camelcase.rs index 94c4f146..c92dd551 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/func_name_camelcase.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/func_name_camelcase.rs @@ -1,8 +1,7 @@ -use clap::builder::Str; use crate::linter::SolidFile; use crate::rules::types::*; use crate::types::*; -use solc_wrapper::{ContractDefinitionChildNodes, decode_location, FunctionDefinitionKind, SourceUnit, SourceUnitChildNodes}; +use solc_wrapper::{ContractDefinitionChildNodes, decode_location, FunctionDefinitionKind, SourceUnitChildNodes}; pub struct FuncNameCamelCase { data: RuleEntry @@ -10,7 +9,7 @@ pub struct FuncNameCamelCase { impl RuleType for FuncNameCamelCase { - fn diagnose(&self, file: &SolidFile, files: &Vec) -> Vec { + fn diagnose(&self, file: &SolidFile, _files: &Vec) -> Vec { let mut res = Vec::new(); @@ -54,7 +53,7 @@ impl RuleType for FuncNameCamelCase { impl FuncNameCamelCase { pub(crate) fn create(data: RuleEntry) -> Box { - let mut rule = FuncNameCamelCase { + let rule = FuncNameCamelCase { data }; Box::new(rule) diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/func_param_name_camelcase.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/func_param_name_camelcase.rs index 53e07d87..948520b3 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/func_param_name_camelcase.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/func_param_name_camelcase.rs @@ -1,8 +1,7 @@ -use clap::builder::Str; use crate::linter::SolidFile; use crate::rules::types::*; use crate::types::*; -use solc_wrapper::{ContractDefinitionChildNodes, decode_location, SourceUnit, SourceUnitChildNodes}; +use solc_wrapper::{ContractDefinitionChildNodes, decode_location, SourceUnitChildNodes}; pub struct FuncParamNameCamelcase { data: RuleEntry @@ -10,7 +9,7 @@ pub struct FuncParamNameCamelcase { impl RuleType for FuncParamNameCamelcase { - fn diagnose(&self, file: &SolidFile, files: &Vec) -> Vec { + fn diagnose(&self, file: &SolidFile, _files: &Vec) -> Vec { let mut res = Vec::new(); @@ -56,7 +55,7 @@ impl RuleType for FuncParamNameCamelcase { impl FuncParamNameCamelcase { pub(crate) fn create(data: RuleEntry) -> Box { - let mut rule = FuncParamNameCamelcase { + let rule = FuncParamNameCamelcase { data }; Box::new(rule) diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/use_forbidden_name.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/use_forbidden_name.rs index 99d47eb4..d5563848 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/use_forbidden_name.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/use_forbidden_name.rs @@ -1,4 +1,3 @@ -use std::ops::Index; use crate::linter::SolidFile; use solc_wrapper::*; use solc_wrapper::ast::utils::{get_all_nodes_by_type, Nodes}; @@ -11,7 +10,7 @@ pub struct UseForbiddenName { impl RuleType for UseForbiddenName { - fn diagnose(&self, file: &SolidFile, files: &Vec) -> Vec { + fn diagnose(&self, file: &SolidFile, _files: &Vec) -> Vec { let mut res = Vec::new(); let blacklist = vec!['I', 'l', 'O']; @@ -50,7 +49,7 @@ impl UseForbiddenName { pub const RULE_ID : &'static str = "use-forbidden-name"; pub(crate) fn create(data: RuleEntry) -> Box { - let mut rule = UseForbiddenName { + let rule = UseForbiddenName { data }; Box::new(rule) diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/order/import_on_top.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/order/import_on_top.rs index 21f4ea3e..79b878e7 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/order/import_on_top.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/order/import_on_top.rs @@ -1,8 +1,7 @@ -use clap::builder::Str; use crate::linter::SolidFile; use crate::rules::types::*; use crate::types::*; -use solc_wrapper::{ContractDefinitionChildNodes, decode_location, SourceUnit, SourceUnitChildNodes}; +use solc_wrapper::{decode_location, SourceUnitChildNodes}; pub struct ImportOnTop { data: RuleEntry @@ -10,7 +9,7 @@ pub struct ImportOnTop { impl RuleType for ImportOnTop { - fn diagnose(&self, file: &SolidFile, files: &Vec) -> Vec { + fn diagnose(&self, file: &SolidFile, _files: &Vec) -> Vec { let mut res = Vec::new(); let mut last_import_location = 0; @@ -57,7 +56,7 @@ impl RuleType for ImportOnTop { impl ImportOnTop { pub(crate) fn create(data: RuleEntry) -> Box { - let mut rule = ImportOnTop { + let rule = ImportOnTop { data }; Box::new(rule) diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/rule_impl.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/rule_impl.rs index e2773b1b..5ea5fa82 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/rule_impl.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/rule_impl.rs @@ -1,8 +1,7 @@ -use std::collections::HashMap; use crate::rules::create_default_rules; use crate::rules::types::*; - +/* // Untested fn merge_rules(rules: &mut Vec, new_rules: &Vec) { let mut new_rules_map = HashMap::new(); @@ -17,9 +16,10 @@ fn merge_rules(rules: &mut Vec, new_rules: &Vec) { } } } +*/ pub fn create_rules_file(path: &str) { - let mut rules = Rules { + let rules = Rules { name: "solidhunter".to_string(), includes: vec![], plugins: vec![], @@ -33,12 +33,12 @@ pub fn create_rules_file(path: &str) { type RulesResult = Result; pub fn parse_rules(path: &str) -> RulesResult { - let mut rules = Rules { + /*let mut rules = Rules { name: String::new(), includes: Vec::new(), plugins: Vec::new(), rules: Vec::new(), - }; + };*/ if !std::path::Path::new(&path).is_file() { return Err(RulesError::IoError(std::io::Error::new(std::io::ErrorKind::NotFound, "Rules file not found"))); diff --git a/toolchains/solidity/linter/core/src/main.rs b/toolchains/solidity/linter/core/src/main.rs index 97ae1325..90ffbfe3 100644 --- a/toolchains/solidity/linter/core/src/main.rs +++ b/toolchains/solidity/linter/core/src/main.rs @@ -1,72 +1,108 @@ use clap::Parser; use colored::Colorize; use solidhunter_lib::linter::SolidLinter; -use solidhunter_lib::offset_from_range; -use solidhunter_lib::rules::rule_impl::{create_rules_file, parse_rules}; +use solidhunter_lib::rules::rule_impl::create_rules_file; use solidhunter_lib::types::Severity; #[derive(Parser, Debug)] #[command(author, version, about, long_about = None)] struct Args { - #[arg(short = 'p', long = "path", default_value = ".", help = "Specify project path")] + #[arg( + short = 'p', + long = "path", + default_value = ".", + help = "Specify project path" + )] project_path: Vec, - #[arg(short = 'f', long = "file", default_value = "", help = "Specify a single file to lint")] + #[arg( + short = 'f', + long = "file", + default_value = "", + help = "Specify a single file to lint" + )] file_to_lint: String, - #[arg(short = 'e', long = "exclude", help = "Exclude part of the project path")] + #[arg( + short = 'e', + long = "exclude", + help = "Exclude part of the project path" + )] ignore_path: Vec, - #[arg(short = 'r', long = "rules", default_value = ".solidhunter.json", help = "Specify rules file")] + #[arg( + short = 'r', + long = "rules", + default_value = ".solidhunter.json", + help = "Specify rules file" + )] rules_file: String, - #[arg(short = 'j', long = "json_output", default_value = "false", help = "Outputs a json format instead")] + #[arg( + short = 'j', + long = "json_output", + default_value = "false", + help = "Outputs a json format instead" + )] to_json: bool, - #[arg(short = 'v', long = "verbose", default_value = "false", help = "Verbose output")] + #[arg( + short = 'v', + long = "verbose", + default_value = "false", + help = "Verbose output" + )] verbose: bool, - #[arg(short = 'i', long = "init", default_value = "false", help = "Initialize rules file")] + #[arg( + short = 'i', + long = "init", + default_value = "false", + help = "Initialize rules file" + )] init: bool, } pub fn severity_to_string(severity: Option) -> String { match severity { - Some(Severity::ERROR) => format!("error").red(), - Some(Severity::WARNING) => format!("warning").yellow(), - Some(Severity::INFO) => format!("info").blue(), - Some(Severity::HINT) => format!("hint").green(), - _ => format!("error").red(), + Some(Severity::ERROR) => "error".to_string().red(), + Some(Severity::WARNING) => "warning".to_string().yellow(), + Some(Severity::INFO) => "info".to_string().blue(), + Some(Severity::HINT) => "hint".to_string().green(), + _ => "error".to_string().red(), } .to_string() } fn print_diag(diag: &solidhunter_lib::types::LintDiag) { - let mut padding : String = String::new(); + let padding: String; if diag.range.start.line > 99 { - padding = " ".repeat(0).to_string(); + padding = "".to_string(); } else if diag.range.start.line > 9 { - padding = " ".repeat(1).to_string(); + padding = " ".to_string(); } else { padding = " ".repeat(2).to_string(); } - let line = diag.source_file_content.lines().nth((diag.range.start.line - 1) as usize).unwrap(); + let line = diag + .source_file_content + .lines() + .nth((diag.range.start.line - 1) as usize) + .unwrap(); println!("\n{}: {}", severity_to_string(diag.severity), diag.message); println!( " --> {}:{}:{}", - diag.uri, - diag.range.start.line, - diag.range.start.character, + diag.uri, diag.range.start.line, diag.range.start.character, ); - println!( - " |"); + println!(" |"); //TODO: add code to print + println!("{}{}|{}", diag.range.start.line, padding, line); println!( - "{}{}|{}", diag.range.start.line,padding, line); - println!( - " |{}{}", " ".repeat(diag.range.start.character as usize), "^".repeat(diag.range.length as usize)); + " |{}{}", + " ".repeat(diag.range.start.character as usize), + "^".repeat(diag.range.length as usize) + ); } fn lint_folder(args: Args) { @@ -96,7 +132,11 @@ fn main() { if !args.to_json { println!(); println!("SolidHunter: Fast and efficient Solidity linter"); - println!("By {} - v{} - GNU GPL v3", env!("CARGO_PKG_AUTHORS"), env!("CARGO_PKG_VERSION")); + println!( + "By {} - v{} - GNU GPL v3", + env!("CARGO_PKG_AUTHORS"), + env!("CARGO_PKG_VERSION") + ); println!(); } @@ -115,13 +155,12 @@ fn main() { return; } - if !args.to_json && args.file_to_lint == "" { + if !args.to_json && args.file_to_lint.is_empty() { lint_folder(args); - } - else if args.file_to_lint != "" { + } else if !args.file_to_lint.is_empty() { let mut linter: SolidLinter = SolidLinter::new(); linter.initalize(&args.rules_file); - + let result = linter.parse_file(args.file_to_lint); if !args.to_json { match result { diff --git a/toolchains/solidity/linter/package.json b/toolchains/solidity/linter/package.json index c4e8dcd1..a9bafdfc 100644 --- a/toolchains/solidity/linter/package.json +++ b/toolchains/solidity/linter/package.json @@ -2,10 +2,14 @@ "name": "@solidity/linter", "version": "0.0.1", "license": "MIT", + "private": true, + "workspaces": [ + "core" + ], "scripts": { - "build": "yarn --cwd core build", - "lint": "yarn --cwd core lint", - "format": "yarn --cwd core format", - "test": "yarn --cwd core test" + "build": "yarn workspaces foreach run build", + "lint": "yarn workspaces foreach run lint", + "format": "yarn workspaces foreach run format", + "test": "yarn workspaces foreach run test" } } diff --git a/yarn.lock b/yarn.lock index cc825900..dc7e3231 100644 --- a/yarn.lock +++ b/yarn.lock @@ -244,6 +244,12 @@ __metadata: languageName: node linkType: hard +"core@workspace:toolchains/solidity/linter/core": + version: 0.0.0-use.local + resolution: "core@workspace:toolchains/solidity/linter/core" + languageName: unknown + linkType: soft + "cross-spawn@npm:^7.0.2": version: 7.0.3 resolution: "cross-spawn@npm:7.0.3" From 53fa84455ab8e0dc2633752a6f41c834b84b0f24 Mon Sep 17 00:00:00 2001 From: 0xMemoryGrinder <35138272+0xMemoryGrinder@users.noreply.github.com> Date: Fri, 8 Sep 2023 15:50:13 -0400 Subject: [PATCH 008/325] fix(solidity/linter): renamed core folder package to follow correct format --- toolchains/solidity/linter/core/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/toolchains/solidity/linter/core/package.json b/toolchains/solidity/linter/core/package.json index c92c017c..ba1ab3ca 100644 --- a/toolchains/solidity/linter/core/package.json +++ b/toolchains/solidity/linter/core/package.json @@ -1,5 +1,5 @@ { - "name": "core", + "name": "@solidity/linter-core", "version": "0.0.1", "license": "MIT", "scripts": { From 4bdd829a2da800eb2a72f35dd180f6bec916dfd2 Mon Sep 17 00:00:00 2001 From: 0xMemoryGrinder <35138272+0xMemoryGrinder@users.noreply.github.com> Date: Fri, 8 Sep 2023 16:34:43 -0400 Subject: [PATCH 009/325] refactor: renamed packages to folllow the convention --- .../workflows/detect-workspace-changes.yml | 4 +- .pnp.cjs | 98 +++++++++---------- manager/package.json | 2 +- toolchains/solidity/linter/core/package.json | 2 +- toolchains/solidity/linter/package.json | 4 +- toolchains/solidity/lsp/package.json | 2 +- toolchains/solidity/package.json | 7 +- yarn.lock | 52 +++++----- 8 files changed, 87 insertions(+), 84 deletions(-) diff --git a/.github/workflows/detect-workspace-changes.yml b/.github/workflows/detect-workspace-changes.yml index dc1b871c..c079bc6f 100644 --- a/.github/workflows/detect-workspace-changes.yml +++ b/.github/workflows/detect-workspace-changes.yml @@ -70,10 +70,10 @@ jobs: }) console.log(affectedWorkspaces) const toolchainsWorkspaces = affectedWorkspaces.filter(workspace => { - return workspace.name.endsWith('-toolchain') + return workspace.name.endsWith('@osmium-toolchains/') }) const extensionsWorkspaces = affectedWorkspaces.filter(workspace => { - return workspace.name.match(/osmium-(?!packages)(?:manager|(?:\w+-(?!toolchain)(?!\w+-\w+)))/) + return workspace.name.match(/@osmium\/(?:manager|(?!\w+-\w+-\w+)(?:\w+-\w+))/) }) return { affectedWorkspaces, diff --git a/.pnp.cjs b/.pnp.cjs index 70dbf47f..fca06080 100644 --- a/.pnp.cjs +++ b/.pnp.cjs @@ -20,7 +20,7 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { "reference": "workspace:libs/lsp-launcher"\ },\ {\ - "name": "osmium-manager",\ + "name": "@osmium/manager",\ "reference": "workspace:manager"\ },\ {\ @@ -32,19 +32,19 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { "reference": "workspace:packages/prettier-config"\ },\ {\ - "name": "osmium-solidity-toolchain",\ + "name": "@osmium-toolchains/solidity",\ "reference": "workspace:toolchains/solidity"\ },\ {\ - "name": "@solidity/linter",\ + "name": "@osmium/solidity-linter",\ "reference": "workspace:toolchains/solidity/linter"\ },\ {\ - "name": "core",\ + "name": "@osmium/solidity-linter-core",\ "reference": "workspace:toolchains/solidity/linter/core"\ },\ {\ - "name": "osmium-solidity-lsp",\ + "name": "@osmium/solidity-lsp",\ "reference": "workspace:toolchains/solidity/lsp"\ }\ ],\ @@ -54,12 +54,12 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { ["@osmium-libs/lsp-launcher", ["workspace:libs/lsp-launcher"]],\ ["@osmium-packages/eslint-config", ["workspace:packages/eslint-config"]],\ ["@osmium-packages/prettier-config", ["workspace:packages/prettier-config"]],\ - ["@solidity/linter", ["workspace:toolchains/solidity/linter"]],\ - ["core", ["workspace:toolchains/solidity/linter/core"]],\ - ["osmium", ["workspace:."]],\ - ["osmium-manager", ["workspace:manager"]],\ - ["osmium-solidity-lsp", ["workspace:toolchains/solidity/lsp"]],\ - ["osmium-solidity-toolchain", ["workspace:toolchains/solidity"]]\ + ["@osmium-toolchains/solidity", ["workspace:toolchains/solidity"]],\ + ["@osmium/manager", ["workspace:manager"]],\ + ["@osmium/solidity-linter", ["workspace:toolchains/solidity/linter"]],\ + ["@osmium/solidity-linter-core", ["workspace:toolchains/solidity/linter/core"]],\ + ["@osmium/solidity-lsp", ["workspace:toolchains/solidity/lsp"]],\ + ["osmium", ["workspace:."]]\ ],\ "fallbackPool": [\ ],\ @@ -231,11 +231,47 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { "linkType": "SOFT"\ }]\ ]],\ - ["@solidity/linter", [\ + ["@osmium-toolchains/solidity", [\ + ["workspace:toolchains/solidity", {\ + "packageLocation": "./toolchains/solidity/",\ + "packageDependencies": [\ + ["@osmium-toolchains/solidity", "workspace:toolchains/solidity"]\ + ],\ + "linkType": "SOFT"\ + }]\ + ]],\ + ["@osmium/manager", [\ + ["workspace:manager", {\ + "packageLocation": "./manager/",\ + "packageDependencies": [\ + ["@osmium/manager", "workspace:manager"]\ + ],\ + "linkType": "SOFT"\ + }]\ + ]],\ + ["@osmium/solidity-linter", [\ ["workspace:toolchains/solidity/linter", {\ "packageLocation": "./toolchains/solidity/linter/",\ "packageDependencies": [\ - ["@solidity/linter", "workspace:toolchains/solidity/linter"]\ + ["@osmium/solidity-linter", "workspace:toolchains/solidity/linter"]\ + ],\ + "linkType": "SOFT"\ + }]\ + ]],\ + ["@osmium/solidity-linter-core", [\ + ["workspace:toolchains/solidity/linter/core", {\ + "packageLocation": "./toolchains/solidity/linter/core/",\ + "packageDependencies": [\ + ["@osmium/solidity-linter-core", "workspace:toolchains/solidity/linter/core"]\ + ],\ + "linkType": "SOFT"\ + }]\ + ]],\ + ["@osmium/solidity-lsp", [\ + ["workspace:toolchains/solidity/lsp", {\ + "packageLocation": "./toolchains/solidity/lsp/",\ + "packageDependencies": [\ + ["@osmium/solidity-lsp", "workspace:toolchains/solidity/lsp"]\ ],\ "linkType": "SOFT"\ }]\ @@ -380,15 +416,6 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { "linkType": "HARD"\ }]\ ]],\ - ["core", [\ - ["workspace:toolchains/solidity/linter/core", {\ - "packageLocation": "./toolchains/solidity/linter/core/",\ - "packageDependencies": [\ - ["core", "workspace:toolchains/solidity/linter/core"]\ - ],\ - "linkType": "SOFT"\ - }]\ - ]],\ ["cross-spawn", [\ ["npm:7.0.3", {\ "packageLocation": "./.yarn/cache/cross-spawn-npm-7.0.3-e4ff3e65b3-671cc7c728.zip/node_modules/cross-spawn/",\ @@ -924,33 +951,6 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { "linkType": "SOFT"\ }]\ ]],\ - ["osmium-manager", [\ - ["workspace:manager", {\ - "packageLocation": "./manager/",\ - "packageDependencies": [\ - ["osmium-manager", "workspace:manager"]\ - ],\ - "linkType": "SOFT"\ - }]\ - ]],\ - ["osmium-solidity-lsp", [\ - ["workspace:toolchains/solidity/lsp", {\ - "packageLocation": "./toolchains/solidity/lsp/",\ - "packageDependencies": [\ - ["osmium-solidity-lsp", "workspace:toolchains/solidity/lsp"]\ - ],\ - "linkType": "SOFT"\ - }]\ - ]],\ - ["osmium-solidity-toolchain", [\ - ["workspace:toolchains/solidity", {\ - "packageLocation": "./toolchains/solidity/",\ - "packageDependencies": [\ - ["osmium-solidity-toolchain", "workspace:toolchains/solidity"]\ - ],\ - "linkType": "SOFT"\ - }]\ - ]],\ ["p-limit", [\ ["npm:3.1.0", {\ "packageLocation": "./.yarn/cache/p-limit-npm-3.1.0-05d2ede37f-7c3690c4db.zip/node_modules/p-limit/",\ diff --git a/manager/package.json b/manager/package.json index ad47b474..c5bf7c67 100644 --- a/manager/package.json +++ b/manager/package.json @@ -1,5 +1,5 @@ { - "name": "osmium-manager", + "name": "@osmium/manager", "version": "0.0.1", "main": "index.js", "license": "MIT", diff --git a/toolchains/solidity/linter/core/package.json b/toolchains/solidity/linter/core/package.json index ba1ab3ca..feca568b 100644 --- a/toolchains/solidity/linter/core/package.json +++ b/toolchains/solidity/linter/core/package.json @@ -1,5 +1,5 @@ { - "name": "@solidity/linter-core", + "name": "@osmium/solidity-linter-core", "version": "0.0.1", "license": "MIT", "scripts": { diff --git a/toolchains/solidity/linter/package.json b/toolchains/solidity/linter/package.json index a9bafdfc..b3d5cd61 100644 --- a/toolchains/solidity/linter/package.json +++ b/toolchains/solidity/linter/package.json @@ -1,5 +1,5 @@ { - "name": "@solidity/linter", + "name": "@osmium/solidity-linter", "version": "0.0.1", "license": "MIT", "private": true, @@ -8,7 +8,7 @@ ], "scripts": { "build": "yarn workspaces foreach run build", - "lint": "yarn workspaces foreach run lint", + "lint": "yarn workspaces foreach run lint", "format": "yarn workspaces foreach run format", "test": "yarn workspaces foreach run test" } diff --git a/toolchains/solidity/lsp/package.json b/toolchains/solidity/lsp/package.json index 055b54d5..ecd6562e 100644 --- a/toolchains/solidity/lsp/package.json +++ b/toolchains/solidity/lsp/package.json @@ -1,5 +1,5 @@ { - "name": "osmium-solidity-lsp", + "name": "@osmium/solidity-lsp", "version": "0.0.1", "license": "MIT", "workspaces": [ diff --git a/toolchains/solidity/package.json b/toolchains/solidity/package.json index ef8ca6dd..df4522f4 100644 --- a/toolchains/solidity/package.json +++ b/toolchains/solidity/package.json @@ -1,11 +1,14 @@ { - "name": "osmium-solidity-toolchain", + "name": "@osmium-toolchains/solidity", "version": "0.0.1", "workspaces": [ "*" ], "license": "MIT", "scripts": { - "toolchain:build": "yarn workspaces foreach -pt run build" + "toolchain:build": "yarn workspaces foreach -p run build", + "toolchain:lint": "yarn workspaces foreach -p run lint", + "toolchain:test": "yarn workspaces foreach -p run test", + "toolchain:format": "yarn workspaces foreach -p run format" } } diff --git a/yarn.lock b/yarn.lock index dc7e3231..ce069576 100644 --- a/yarn.lock +++ b/yarn.lock @@ -128,9 +128,33 @@ __metadata: languageName: unknown linkType: soft -"@solidity/linter@workspace:toolchains/solidity/linter": +"@osmium-toolchains/solidity@workspace:toolchains/solidity": version: 0.0.0-use.local - resolution: "@solidity/linter@workspace:toolchains/solidity/linter" + resolution: "@osmium-toolchains/solidity@workspace:toolchains/solidity" + languageName: unknown + linkType: soft + +"@osmium/manager@workspace:manager": + version: 0.0.0-use.local + resolution: "@osmium/manager@workspace:manager" + languageName: unknown + linkType: soft + +"@osmium/solidity-linter-core@workspace:toolchains/solidity/linter/core": + version: 0.0.0-use.local + resolution: "@osmium/solidity-linter-core@workspace:toolchains/solidity/linter/core" + languageName: unknown + linkType: soft + +"@osmium/solidity-linter@workspace:toolchains/solidity/linter": + version: 0.0.0-use.local + resolution: "@osmium/solidity-linter@workspace:toolchains/solidity/linter" + languageName: unknown + linkType: soft + +"@osmium/solidity-lsp@workspace:toolchains/solidity/lsp": + version: 0.0.0-use.local + resolution: "@osmium/solidity-lsp@workspace:toolchains/solidity/lsp" languageName: unknown linkType: soft @@ -244,12 +268,6 @@ __metadata: languageName: node linkType: hard -"core@workspace:toolchains/solidity/linter/core": - version: 0.0.0-use.local - resolution: "core@workspace:toolchains/solidity/linter/core" - languageName: unknown - linkType: soft - "cross-spawn@npm:^7.0.2": version: 7.0.3 resolution: "cross-spawn@npm:7.0.3" @@ -699,24 +717,6 @@ __metadata: languageName: node linkType: hard -"osmium-manager@workspace:manager": - version: 0.0.0-use.local - resolution: "osmium-manager@workspace:manager" - languageName: unknown - linkType: soft - -"osmium-solidity-lsp@workspace:toolchains/solidity/lsp": - version: 0.0.0-use.local - resolution: "osmium-solidity-lsp@workspace:toolchains/solidity/lsp" - languageName: unknown - linkType: soft - -"osmium-solidity-toolchain@workspace:toolchains/solidity": - version: 0.0.0-use.local - resolution: "osmium-solidity-toolchain@workspace:toolchains/solidity" - languageName: unknown - linkType: soft - "osmium@workspace:.": version: 0.0.0-use.local resolution: "osmium@workspace:." From 861949b386b03a1a75bbd47947365003503bc5f4 Mon Sep 17 00:00:00 2001 From: 0xMemoryGrinder <35138272+0xMemoryGrinder@users.noreply.github.com> Date: Fri, 8 Sep 2023 18:05:03 -0400 Subject: [PATCH 010/325] refactor: reworked ci to execute only necessary workspaces refactor: reworked ci --- .github/workflows/ci.yml | 41 +++++++++++++++---- .../workflows/detect-workspace-changes.yml | 24 ++++++++++- 2 files changed, 55 insertions(+), 10 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 04d1f3a5..5dd509cd 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -11,13 +11,38 @@ jobs: from: ${{ github.head_ref }} since: ${{ github.base_ref }} - lint: + flatten-deps: runs-on: ubuntu-latest needs: setup + outputs: + dependencies: ${{ toJson(fromJson(steps.flatten.outputs.result).dependencies) }} + steps: + - uses: actions/github-script@v6 + id: flatten + with: + script: | + const rawExtensions = `${{ needs.setup.outputs.extensions }}` + const rawLibraries = `${{ needs.setup.outputs.libraries }}` + const rawPackages = `${{ needs.setup.outputs.packages }}` + const extensions = JSON.parse(rawExtensions) + const libraries = JSON.parse(rawLibraries) + const packages = JSON.parse(rawPackages) + + console.log(extensions, libraries, packages); + + const deps = [...extensions, ...libraries, ...packages] + + return { + dependencies: deps + } + + lint: + runs-on: ubuntu-latest + needs: flatten-deps strategy: fail-fast: false matrix: - workspace: ${{ fromJson(needs.setup.outputs.workspaces) }} + workspace: ${{ fromJson(needs.flatten-deps.outputs.dependencies) }} steps: - uses: actions/checkout@v3 - uses: actions/setup-node@v3 @@ -31,11 +56,11 @@ jobs: format: runs-on: ubuntu-latest - needs: setup + needs: flatten-deps strategy: fail-fast: false matrix: - workspace: ${{ fromJson(needs.setup.outputs.workspaces) }} + workspace: ${{ fromJson(needs.flatten-deps.outputs.dependencies) }} steps: - uses: actions/checkout@v3 - uses: actions/setup-node@v3 @@ -49,11 +74,11 @@ jobs: build: runs-on: ubuntu-latest - needs: setup + needs: flatten-deps strategy: fail-fast: false matrix: - workspace: ${{ fromJson(needs.setup.outputs.workspaces) }} + workspace: ${{ fromJson(needs.flatten-deps.outputs.dependencies) }} steps: - uses: actions/checkout@v3 - uses: actions/setup-node@v3 @@ -67,11 +92,11 @@ jobs: test: runs-on: ubuntu-latest - needs: setup + needs: flatten-deps strategy: fail-fast: false matrix: - workspace: ${{ fromJson(needs.setup.outputs.workspaces) }} + workspace: ${{ fromJson(needs.flatten-deps.outputs.dependencies) }} steps: - uses: actions/checkout@v3 - uses: actions/setup-node@v3 diff --git a/.github/workflows/detect-workspace-changes.yml b/.github/workflows/detect-workspace-changes.yml index c079bc6f..b055cb2b 100644 --- a/.github/workflows/detect-workspace-changes.yml +++ b/.github/workflows/detect-workspace-changes.yml @@ -19,6 +19,12 @@ on: extensions: description: "Array of affected extensions workspaces" value: ${{ jobs.detect_changes.outputs.extensions }} + libraries: + description: "Array of affected libraries workspaces" + value: ${{ jobs.detect_changes.outputs.libraries }} + packages: + description: "Array of affected packages workspaces" + value: ${{ jobs.detect_changes.outputs.packages }} jobs: detect_changes: @@ -27,6 +33,8 @@ jobs: workspaces: ${{ toJson(fromJson(steps.build-array.outputs.result).affectedWorkspaces) }} toolchains: ${{ toJson(fromJson(steps.build-array.outputs.result).toolchainsWorkspaces) }} extensions: ${{ toJson(fromJson(steps.build-array.outputs.result).extensionsWorkspaces) }} + libraries: ${{ toJson(fromJson(steps.build-array.outputs.result).librariesWorkspaces) }} + packages: ${{ toJson(fromJson(steps.build-array.outputs.result).packagesWorkspaces) }} steps: - uses: actions/checkout@v3 with: @@ -70,7 +78,13 @@ jobs: }) console.log(affectedWorkspaces) const toolchainsWorkspaces = affectedWorkspaces.filter(workspace => { - return workspace.name.endsWith('@osmium-toolchains/') + return workspace.name.startsWith('@osmium-toolchains/') + }) + const librariesWorkspaces = affectedWorkspaces.filter(workspace => { + return workspace.name.startsWith('@osmium-libs/') + }) + const packagesWorkspaces = affectedWorkspaces.filter(workspace => { + return workspace.name.startsWith('@osmium-packages/') }) const extensionsWorkspaces = affectedWorkspaces.filter(workspace => { return workspace.name.match(/@osmium\/(?:manager|(?!\w+-\w+-\w+)(?:\w+-\w+))/) @@ -78,7 +92,9 @@ jobs: return { affectedWorkspaces, toolchainsWorkspaces, - extensionsWorkspaces + extensionsWorkspaces, + librariesWorkspaces, + packagesWorkspaces } - name: debug @@ -88,5 +104,9 @@ jobs: echo "Toolchains workspaces: ${{ toJson(fromJson(steps.build-array.outputs.result).toolchainsWorkspaces) }}" echo "------------------------------------" echo "Extensions workspaces: ${{ toJson(fromJson(steps.build-array.outputs.result).extensionsWorkspaces) }}" + echo "------------------------------------" + echo "Libraries workspaces: ${{ toJson(fromJson(steps.build-array.outputs.result).librariesWorkspaces) }}" + echo "------------------------------------" + echo "Packages workspaces: ${{ toJson(fromJson(steps.build-array.outputs.result).packagesWorkspaces) }}" \ No newline at end of file From 98f8847e5509b43c98a6a9be23395badec16eacb Mon Sep 17 00:00:00 2001 From: 0xMemoryGrinder <35138272+0xMemoryGrinder@users.noreply.github.com> Date: Fri, 8 Sep 2023 18:05:59 -0400 Subject: [PATCH 011/325] fix: added missing scripts in various workspaces --- manager/package.json | 2 ++ toolchains/solidity/lsp/package.json | 2 ++ 2 files changed, 4 insertions(+) diff --git a/manager/package.json b/manager/package.json index c5bf7c67..02deb8d9 100644 --- a/manager/package.json +++ b/manager/package.json @@ -5,6 +5,8 @@ "license": "MIT", "scripts": { "build": "echo 'building manager...'", + "lint": "echo 'linting manager...'", + "format": "echo 'formatting manager...'", "test": "echo 'testing manager...'", "publish": "echo 'publishing manager...'" } diff --git a/toolchains/solidity/lsp/package.json b/toolchains/solidity/lsp/package.json index ecd6562e..e596e7be 100644 --- a/toolchains/solidity/lsp/package.json +++ b/toolchains/solidity/lsp/package.json @@ -7,6 +7,8 @@ ], "scripts": { "build": "echo 'building solidity lsp...'", + "lint": "echo 'linting solidity lsp...'", + "format": "echo 'formatting solidity lsp...'", "test": "echo 'testing solidity lsp...'", "publish": "echo 'publishing solidity lsp...'" } From b0f3b70f85ad8d1fe692c9762d2b09940e671c01 Mon Sep 17 00:00:00 2001 From: 0xMemoryGrinder <35138272+0xMemoryGrinder@users.noreply.github.com> Date: Fri, 8 Sep 2023 22:58:18 -0400 Subject: [PATCH 012/325] chore: delete #47 remove-me file --- remove-me-afed2859e00b4dee9bea.txt | 1 - 1 file changed, 1 deletion(-) delete mode 100644 remove-me-afed2859e00b4dee9bea.txt diff --git a/remove-me-afed2859e00b4dee9bea.txt b/remove-me-afed2859e00b4dee9bea.txt deleted file mode 100644 index bbf6f3de..00000000 --- a/remove-me-afed2859e00b4dee9bea.txt +++ /dev/null @@ -1 +0,0 @@ -afed2859e00b4dee9bea From 700ded42c3687517626c5c5f3743ff8b51919d2f Mon Sep 17 00:00:00 2001 From: Astrodevs CI Date: Wed, 30 Aug 2023 19:49:07 +0000 Subject: [PATCH 013/325] chore: create branch chore/51-linter-rust-crate-for-ast-staging --- remove-me-3ebde08f11694be5b2a3.txt | 1 + 1 file changed, 1 insertion(+) create mode 100644 remove-me-3ebde08f11694be5b2a3.txt diff --git a/remove-me-3ebde08f11694be5b2a3.txt b/remove-me-3ebde08f11694be5b2a3.txt new file mode 100644 index 00000000..b5d657a5 --- /dev/null +++ b/remove-me-3ebde08f11694be5b2a3.txt @@ -0,0 +1 @@ +3ebde08f11694be5b2a3 From d815c38a43dc7c546b4fe2bd14cdf2fbfc876089 Mon Sep 17 00:00:00 2001 From: Astrodevs CI Date: Wed, 30 Aug 2023 19:49:30 +0000 Subject: [PATCH 014/325] chore: create branch chore/51-linter-rust-crate-for-ast/67-create-rust-ast-crate-staging --- remove-me-02fd9ae66d2443f1a92b.txt | 1 + 1 file changed, 1 insertion(+) create mode 100644 remove-me-02fd9ae66d2443f1a92b.txt diff --git a/remove-me-02fd9ae66d2443f1a92b.txt b/remove-me-02fd9ae66d2443f1a92b.txt new file mode 100644 index 00000000..4fd24081 --- /dev/null +++ b/remove-me-02fd9ae66d2443f1a92b.txt @@ -0,0 +1 @@ +02fd9ae66d2443f1a92b From 210503d5e353d21faba9f70bdf1488e302dbfa8e Mon Sep 17 00:00:00 2001 From: 0xMemoryGrinder <35138272+0xMemoryGrinder@users.noreply.github.com> Date: Wed, 6 Sep 2023 19:41:45 -0400 Subject: [PATCH 015/325] feat(libs/ast-extractor): added base project scaffold --- .pnp.cjs | 118 ++++++++++++++++---------------- libs/ast-extractor/.gitignore | 1 + libs/ast-extractor/Cargo.lock | 65 ++++++++++++++++++ libs/ast-extractor/Cargo.toml | 11 +++ libs/ast-extractor/README.md | 1 + libs/ast-extractor/package.json | 9 +++ libs/ast-extractor/src/lib.rs | 14 ++++ yarn.lock | 60 ++++++++-------- 8 files changed, 190 insertions(+), 89 deletions(-) create mode 100644 libs/ast-extractor/.gitignore create mode 100644 libs/ast-extractor/Cargo.lock create mode 100644 libs/ast-extractor/Cargo.toml create mode 100644 libs/ast-extractor/README.md create mode 100644 libs/ast-extractor/package.json create mode 100644 libs/ast-extractor/src/lib.rs diff --git a/.pnp.cjs b/.pnp.cjs index fca06080..31f35683 100644 --- a/.pnp.cjs +++ b/.pnp.cjs @@ -15,12 +15,16 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { "name": "osmium",\ "reference": "workspace:."\ },\ + {\ + "name": "@osmium-libs/ast-extractor",\ + "reference": "workspace:libs/ast-extractor"\ + },\ {\ "name": "@osmium-libs/lsp-launcher",\ "reference": "workspace:libs/lsp-launcher"\ },\ {\ - "name": "@osmium/manager",\ + "name": "osmium-manager",\ "reference": "workspace:manager"\ },\ {\ @@ -32,34 +36,30 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { "reference": "workspace:packages/prettier-config"\ },\ {\ - "name": "@osmium-toolchains/solidity",\ + "name": "osmium-solidity-toolchain",\ "reference": "workspace:toolchains/solidity"\ },\ {\ - "name": "@osmium/solidity-linter",\ + "name": "osmium-solidity-linter",\ "reference": "workspace:toolchains/solidity/linter"\ },\ {\ - "name": "@osmium/solidity-linter-core",\ - "reference": "workspace:toolchains/solidity/linter/core"\ - },\ - {\ - "name": "@osmium/solidity-lsp",\ + "name": "osmium-solidity-lsp",\ "reference": "workspace:toolchains/solidity/lsp"\ }\ ],\ "enableTopLevelFallback": true,\ "ignorePatternData": "(^(?:\\\\.yarn\\\\/sdks(?:\\\\/(?!\\\\.{1,2}(?:\\\\/|$))(?:(?:(?!(?:^|\\\\/)\\\\.{1,2}(?:\\\\/|$)).)*?)|$))$)",\ "fallbackExclusionList": [\ + ["@osmium-libs/ast-extractor", ["workspace:libs/ast-extractor"]],\ ["@osmium-libs/lsp-launcher", ["workspace:libs/lsp-launcher"]],\ ["@osmium-packages/eslint-config", ["workspace:packages/eslint-config"]],\ ["@osmium-packages/prettier-config", ["workspace:packages/prettier-config"]],\ - ["@osmium-toolchains/solidity", ["workspace:toolchains/solidity"]],\ - ["@osmium/manager", ["workspace:manager"]],\ - ["@osmium/solidity-linter", ["workspace:toolchains/solidity/linter"]],\ - ["@osmium/solidity-linter-core", ["workspace:toolchains/solidity/linter/core"]],\ - ["@osmium/solidity-lsp", ["workspace:toolchains/solidity/lsp"]],\ - ["osmium", ["workspace:."]]\ + ["osmium", ["workspace:."]],\ + ["osmium-manager", ["workspace:manager"]],\ + ["osmium-solidity-linter", ["workspace:toolchains/solidity/linter"]],\ + ["osmium-solidity-lsp", ["workspace:toolchains/solidity/lsp"]],\ + ["osmium-solidity-toolchain", ["workspace:toolchains/solidity"]]\ ],\ "fallbackPool": [\ ],\ @@ -202,6 +202,15 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { "linkType": "HARD"\ }]\ ]],\ + ["@osmium-libs/ast-extractor", [\ + ["workspace:libs/ast-extractor", {\ + "packageLocation": "./libs/ast-extractor/",\ + "packageDependencies": [\ + ["@osmium-libs/ast-extractor", "workspace:libs/ast-extractor"]\ + ],\ + "linkType": "SOFT"\ + }]\ + ]],\ ["@osmium-libs/lsp-launcher", [\ ["workspace:libs/lsp-launcher", {\ "packageLocation": "./libs/lsp-launcher/",\ @@ -231,51 +240,6 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { "linkType": "SOFT"\ }]\ ]],\ - ["@osmium-toolchains/solidity", [\ - ["workspace:toolchains/solidity", {\ - "packageLocation": "./toolchains/solidity/",\ - "packageDependencies": [\ - ["@osmium-toolchains/solidity", "workspace:toolchains/solidity"]\ - ],\ - "linkType": "SOFT"\ - }]\ - ]],\ - ["@osmium/manager", [\ - ["workspace:manager", {\ - "packageLocation": "./manager/",\ - "packageDependencies": [\ - ["@osmium/manager", "workspace:manager"]\ - ],\ - "linkType": "SOFT"\ - }]\ - ]],\ - ["@osmium/solidity-linter", [\ - ["workspace:toolchains/solidity/linter", {\ - "packageLocation": "./toolchains/solidity/linter/",\ - "packageDependencies": [\ - ["@osmium/solidity-linter", "workspace:toolchains/solidity/linter"]\ - ],\ - "linkType": "SOFT"\ - }]\ - ]],\ - ["@osmium/solidity-linter-core", [\ - ["workspace:toolchains/solidity/linter/core", {\ - "packageLocation": "./toolchains/solidity/linter/core/",\ - "packageDependencies": [\ - ["@osmium/solidity-linter-core", "workspace:toolchains/solidity/linter/core"]\ - ],\ - "linkType": "SOFT"\ - }]\ - ]],\ - ["@osmium/solidity-lsp", [\ - ["workspace:toolchains/solidity/lsp", {\ - "packageLocation": "./toolchains/solidity/lsp/",\ - "packageDependencies": [\ - ["@osmium/solidity-lsp", "workspace:toolchains/solidity/lsp"]\ - ],\ - "linkType": "SOFT"\ - }]\ - ]],\ ["acorn", [\ ["npm:8.10.0", {\ "packageLocation": "./.yarn/cache/acorn-npm-8.10.0-2230c9e83e-538ba38af0.zip/node_modules/acorn/",\ @@ -951,6 +915,42 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { "linkType": "SOFT"\ }]\ ]],\ + ["osmium-manager", [\ + ["workspace:manager", {\ + "packageLocation": "./manager/",\ + "packageDependencies": [\ + ["osmium-manager", "workspace:manager"]\ + ],\ + "linkType": "SOFT"\ + }]\ + ]],\ + ["osmium-solidity-linter", [\ + ["workspace:toolchains/solidity/linter", {\ + "packageLocation": "./toolchains/solidity/linter/",\ + "packageDependencies": [\ + ["osmium-solidity-linter", "workspace:toolchains/solidity/linter"]\ + ],\ + "linkType": "SOFT"\ + }]\ + ]],\ + ["osmium-solidity-lsp", [\ + ["workspace:toolchains/solidity/lsp", {\ + "packageLocation": "./toolchains/solidity/lsp/",\ + "packageDependencies": [\ + ["osmium-solidity-lsp", "workspace:toolchains/solidity/lsp"]\ + ],\ + "linkType": "SOFT"\ + }]\ + ]],\ + ["osmium-solidity-toolchain", [\ + ["workspace:toolchains/solidity", {\ + "packageLocation": "./toolchains/solidity/",\ + "packageDependencies": [\ + ["osmium-solidity-toolchain", "workspace:toolchains/solidity"]\ + ],\ + "linkType": "SOFT"\ + }]\ + ]],\ ["p-limit", [\ ["npm:3.1.0", {\ "packageLocation": "./.yarn/cache/p-limit-npm-3.1.0-05d2ede37f-7c3690c4db.zip/node_modules/p-limit/",\ diff --git a/libs/ast-extractor/.gitignore b/libs/ast-extractor/.gitignore new file mode 100644 index 00000000..1de56593 --- /dev/null +++ b/libs/ast-extractor/.gitignore @@ -0,0 +1 @@ +target \ No newline at end of file diff --git a/libs/ast-extractor/Cargo.lock b/libs/ast-extractor/Cargo.lock new file mode 100644 index 00000000..4216eeeb --- /dev/null +++ b/libs/ast-extractor/Cargo.lock @@ -0,0 +1,65 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "ast-extractor" +version = "0.1.0" +dependencies = [ + "proc-macro2", + "quote", + "syn-solidity", +] + +[[package]] +name = "paste" +version = "1.0.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "de3145af08024dea9fa9914f381a17b8fc6034dfb00f3a84013f7ff43f29ed4c" + +[[package]] +name = "proc-macro2" +version = "1.0.66" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "18fb31db3f9bddb2ea821cde30a9f70117e3f119938b5ee630b7403aa6e2ead9" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quote" +version = "1.0.33" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "syn" +version = "2.0.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "718fa2415bcb8d8bd775917a1bf12a7931b6dfa890753378538118181e0cb398" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "syn-solidity" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "397f229dc34c7b8231b6ef85502f9ca4e3425b8625e6d403bb74779e6b1917b5" +dependencies = [ + "paste", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "unicode-ident" +version = "1.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "301abaae475aa91687eb82514b328ab47a211a533026cb25fc3e519b86adfc3c" diff --git a/libs/ast-extractor/Cargo.toml b/libs/ast-extractor/Cargo.toml new file mode 100644 index 00000000..2c9639a1 --- /dev/null +++ b/libs/ast-extractor/Cargo.toml @@ -0,0 +1,11 @@ +[package] +name = "ast-extractor" +version = "0.1.0" +edition = "2021" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] +quote = "1.0.33" +proc-macro2 = { version = "1.0.66", features = ["span-locations"]} +syn-solidity = { version = "0.3.1", features = ["visit"] } diff --git a/libs/ast-extractor/README.md b/libs/ast-extractor/README.md new file mode 100644 index 00000000..3b0fcdcd --- /dev/null +++ b/libs/ast-extractor/README.md @@ -0,0 +1 @@ +# ast-extractor diff --git a/libs/ast-extractor/package.json b/libs/ast-extractor/package.json new file mode 100644 index 00000000..ba4ba3ff --- /dev/null +++ b/libs/ast-extractor/package.json @@ -0,0 +1,9 @@ +{ + "name": "@osmium-libs/ast-extractor", + "packageManager": "yarn@3.6.1", + "scripts": { + "build": "cargo build --release", + "test": "cargo test", + "lint": "cargo clippy --all-targets --all-features -- -D warnings" + } +} diff --git a/libs/ast-extractor/src/lib.rs b/libs/ast-extractor/src/lib.rs new file mode 100644 index 00000000..7d12d9af --- /dev/null +++ b/libs/ast-extractor/src/lib.rs @@ -0,0 +1,14 @@ +pub fn add(left: usize, right: usize) -> usize { + left + right +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn it_works() { + let result = add(2, 2); + assert_eq!(result, 4); + } +} diff --git a/yarn.lock b/yarn.lock index ce069576..bccdce78 100644 --- a/yarn.lock +++ b/yarn.lock @@ -106,6 +106,12 @@ __metadata: languageName: node linkType: hard +"@osmium-libs/ast-extractor@workspace:libs/ast-extractor": + version: 0.0.0-use.local + resolution: "@osmium-libs/ast-extractor@workspace:libs/ast-extractor" + languageName: unknown + linkType: soft + "@osmium-libs/lsp-launcher@workspace:libs/lsp-launcher": version: 0.0.0-use.local resolution: "@osmium-libs/lsp-launcher@workspace:libs/lsp-launcher" @@ -128,36 +134,6 @@ __metadata: languageName: unknown linkType: soft -"@osmium-toolchains/solidity@workspace:toolchains/solidity": - version: 0.0.0-use.local - resolution: "@osmium-toolchains/solidity@workspace:toolchains/solidity" - languageName: unknown - linkType: soft - -"@osmium/manager@workspace:manager": - version: 0.0.0-use.local - resolution: "@osmium/manager@workspace:manager" - languageName: unknown - linkType: soft - -"@osmium/solidity-linter-core@workspace:toolchains/solidity/linter/core": - version: 0.0.0-use.local - resolution: "@osmium/solidity-linter-core@workspace:toolchains/solidity/linter/core" - languageName: unknown - linkType: soft - -"@osmium/solidity-linter@workspace:toolchains/solidity/linter": - version: 0.0.0-use.local - resolution: "@osmium/solidity-linter@workspace:toolchains/solidity/linter" - languageName: unknown - linkType: soft - -"@osmium/solidity-lsp@workspace:toolchains/solidity/lsp": - version: 0.0.0-use.local - resolution: "@osmium/solidity-lsp@workspace:toolchains/solidity/lsp" - languageName: unknown - linkType: soft - "acorn-jsx@npm:^5.3.2": version: 5.3.2 resolution: "acorn-jsx@npm:5.3.2" @@ -717,6 +693,30 @@ __metadata: languageName: node linkType: hard +"osmium-manager@workspace:manager": + version: 0.0.0-use.local + resolution: "osmium-manager@workspace:manager" + languageName: unknown + linkType: soft + +"osmium-solidity-linter@workspace:toolchains/solidity/linter": + version: 0.0.0-use.local + resolution: "osmium-solidity-linter@workspace:toolchains/solidity/linter" + languageName: unknown + linkType: soft + +"osmium-solidity-lsp@workspace:toolchains/solidity/lsp": + version: 0.0.0-use.local + resolution: "osmium-solidity-lsp@workspace:toolchains/solidity/lsp" + languageName: unknown + linkType: soft + +"osmium-solidity-toolchain@workspace:toolchains/solidity": + version: 0.0.0-use.local + resolution: "osmium-solidity-toolchain@workspace:toolchains/solidity" + languageName: unknown + linkType: soft + "osmium@workspace:.": version: 0.0.0-use.local resolution: "osmium@workspace:." From 18172d59b2e25dbd53e675ad9d43b20b70eba707 Mon Sep 17 00:00:00 2001 From: Astrodevs CI Date: Thu, 7 Sep 2023 00:05:33 +0000 Subject: [PATCH 016/325] chore: create branch chore/51-linter-rust-crate-for-ast/68-check-alloy-ast-structure-staging --- remove-me-55553ec372c24433af1c.txt | 1 + 1 file changed, 1 insertion(+) create mode 100644 remove-me-55553ec372c24433af1c.txt diff --git a/remove-me-55553ec372c24433af1c.txt b/remove-me-55553ec372c24433af1c.txt new file mode 100644 index 00000000..e8bb8c0c --- /dev/null +++ b/remove-me-55553ec372c24433af1c.txt @@ -0,0 +1 @@ +55553ec372c24433af1c From d7b31898ff5afa3857f2bf7dce841915b42825fd Mon Sep 17 00:00:00 2001 From: 0xMemoryGrinder <35138272+0xMemoryGrinder@users.noreply.github.com> Date: Fri, 8 Sep 2023 12:12:05 -0400 Subject: [PATCH 017/325] feat(libs/ast-extractor): added extract and few retriever functions --- libs/ast-extractor/Cargo.lock | 22 ++++ libs/ast-extractor/Cargo.toml | 2 + libs/ast-extractor/src/extract.rs | 58 ++++++++++ libs/ast-extractor/src/lib.rs | 16 +-- libs/ast-extractor/src/retriever.rs | 11 ++ libs/ast-extractor/src/retriever/contract.rs | 80 +++++++++++++ libs/ast-extractor/src/retriever/function.rs | 106 ++++++++++++++++++ .../tests/files/contracts/one.sol | 10 ++ .../tests/files/contracts/two.sol | 21 ++++ .../tests/files/functions/empty.sol | 1 + .../tests/files/functions/modifier.sol | 12 ++ .../tests/files/functions/one.sol | 7 ++ libs/ast-extractor/tests/files/good.sol | 10 ++ 13 files changed, 342 insertions(+), 14 deletions(-) create mode 100644 libs/ast-extractor/src/extract.rs create mode 100644 libs/ast-extractor/src/retriever.rs create mode 100644 libs/ast-extractor/src/retriever/contract.rs create mode 100644 libs/ast-extractor/src/retriever/function.rs create mode 100644 libs/ast-extractor/tests/files/contracts/one.sol create mode 100644 libs/ast-extractor/tests/files/contracts/two.sol create mode 100644 libs/ast-extractor/tests/files/functions/empty.sol create mode 100644 libs/ast-extractor/tests/files/functions/modifier.sol create mode 100644 libs/ast-extractor/tests/files/functions/one.sol create mode 100644 libs/ast-extractor/tests/files/good.sol diff --git a/libs/ast-extractor/Cargo.lock b/libs/ast-extractor/Cargo.lock index 4216eeeb..fedac976 100644 --- a/libs/ast-extractor/Cargo.lock +++ b/libs/ast-extractor/Cargo.lock @@ -8,7 +8,9 @@ version = "0.1.0" dependencies = [ "proc-macro2", "quote", + "syn", "syn-solidity", + "thiserror", ] [[package]] @@ -58,6 +60,26 @@ dependencies = [ "syn", ] +[[package]] +name = "thiserror" +version = "1.0.48" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d6d7a740b8a666a7e828dd00da9c0dc290dff53154ea77ac109281de90589b7" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.48" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49922ecae66cc8a249b77e68d1d0623c1b2c514f0060c27cdc68bd62a1219d35" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "unicode-ident" version = "1.0.11" diff --git a/libs/ast-extractor/Cargo.toml b/libs/ast-extractor/Cargo.toml index 2c9639a1..e76d6905 100644 --- a/libs/ast-extractor/Cargo.toml +++ b/libs/ast-extractor/Cargo.toml @@ -9,3 +9,5 @@ edition = "2021" quote = "1.0.33" proc-macro2 = { version = "1.0.66", features = ["span-locations"]} syn-solidity = { version = "0.3.1", features = ["visit"] } +thiserror = "1" +syn = "2" \ No newline at end of file diff --git a/libs/ast-extractor/src/extract.rs b/libs/ast-extractor/src/extract.rs new file mode 100644 index 00000000..1610e211 --- /dev/null +++ b/libs/ast-extractor/src/extract.rs @@ -0,0 +1,58 @@ +/** + * extract.rs + * Extract AST from solidity source code + * author: 0xMemoryGrinder +*/ + +use std::str::FromStr; +use proc_macro2::{TokenStream, LexError}; +use thiserror::Error; +use syn::Error; + +#[derive(Error, Debug)] +pub enum ExtractError { + #[error("Tokenization error: {0}")] + Tokenize(#[from] LexError), + #[error("Parsing error")] + Parse(#[from] Error), +} + +pub fn extract_ast_from(source: String) -> Result { + let tokens = TokenStream::from_str(source.as_str())?; + let ast = syn_solidity::parse2(tokens)?; + Ok(ast) +} + +#[cfg(test)] +mod tests { + use super::*; + use std::fs; + use std::path::PathBuf; + + #[test] + fn test_extract_ast_from_good() { + let mut path = PathBuf::from(env!("CARGO_MANIFEST_DIR")); + path.push("tests"); + path.push("files"); + path.push("good.sol"); + let source = fs::read_to_string(path).unwrap(); + let res = extract_ast_from(source); + assert!(res.is_ok()); + } + + #[test] + fn test_extract_ast_from_invalid_token() { + let source = String::from("contract test { function test() public | uint a = 1 } }"); + let result = extract_ast_from(source); + assert!(result.is_err()); + assert_eq!(result.unwrap_err().to_string(), "Tokenization error: cannot parse string into token stream"); + } + + #[test] + fn test_extract_ast_from_missing_semicolumn() { + let source = String::from("contract test { function test() public { uint a = 1 } }"); + let result = extract_ast_from(source); + assert!(result.is_err()); + assert_eq!(result.unwrap_err().to_string(), "Parsing error"); + } +} \ No newline at end of file diff --git a/libs/ast-extractor/src/lib.rs b/libs/ast-extractor/src/lib.rs index 7d12d9af..42163539 100644 --- a/libs/ast-extractor/src/lib.rs +++ b/libs/ast-extractor/src/lib.rs @@ -1,14 +1,2 @@ -pub fn add(left: usize, right: usize) -> usize { - left + right -} - -#[cfg(test)] -mod tests { - use super::*; - - #[test] - fn it_works() { - let result = add(2, 2); - assert_eq!(result, 4); - } -} +pub mod extract; +pub mod retriever; \ No newline at end of file diff --git a/libs/ast-extractor/src/retriever.rs b/libs/ast-extractor/src/retriever.rs new file mode 100644 index 00000000..07b1ca27 --- /dev/null +++ b/libs/ast-extractor/src/retriever.rs @@ -0,0 +1,11 @@ +/** + * retriever.rs + * Module for all AST utils functions + * author: 0xMemoryGrinder +*/ + +mod contract; +pub use contract::*; + +mod function; +pub use function::*; \ No newline at end of file diff --git a/libs/ast-extractor/src/retriever/contract.rs b/libs/ast-extractor/src/retriever/contract.rs new file mode 100644 index 00000000..12793402 --- /dev/null +++ b/libs/ast-extractor/src/retriever/contract.rs @@ -0,0 +1,80 @@ +/** + * contract.rs + * Function to retrieve contract nodes from AST + * author: 0xMemoryGrinder +*/ + +use syn_solidity::{ItemContract, Visit}; + +struct ContractVisitor { + contracts: Vec, +} + +impl ContractVisitor { + pub fn new() -> Self { + Self { + contracts: Vec::new(), + } + } +} + +impl<'ast> Visit<'ast> for ContractVisitor { + fn visit_item_contract(&mut self, i: &ItemContract) { + self.contracts.push(i.clone()); + syn_solidity::visit::visit_item_contract(self, i); + } +} + +pub fn retrieve_contract_nodes(ast: syn_solidity::File) -> Vec { + let mut visitor = ContractVisitor::new(); + visitor.visit_file(&ast); + visitor.contracts +} + + +#[cfg(test)] +mod tests { + use proc_macro2::TokenStream; + + use super::*; + use std::fs; + use std::path::PathBuf; + use std::str::FromStr; + + #[test] + fn test_retrieve_contract_nodes_empty() { + let source = String::from("pragma solidity ^0.8.0;"); + let tokens = TokenStream::from_str(source.as_str()).unwrap(); + let ast = syn_solidity::parse2(tokens).unwrap(); + let res = retrieve_contract_nodes(ast); + assert_eq!(res.len(), 0); + } + + #[test] + fn test_retrieve_contract_nodes_one() { + let mut path = PathBuf::from(env!("CARGO_MANIFEST_DIR")); + path.push("tests"); + path.push("files"); + path.push("contracts"); + path.push("one.sol"); + let source = fs::read_to_string(path).unwrap(); + let tokens = TokenStream::from_str(source.as_str()).unwrap(); + let ast = syn_solidity::parse2(tokens).unwrap(); + let res = retrieve_contract_nodes(ast); + assert_eq!(res.len(), 1); + } + + #[test] + fn test_retrieve_contract_nodes_two() { + let mut path = PathBuf::from(env!("CARGO_MANIFEST_DIR")); + path.push("tests"); + path.push("files"); + path.push("contracts"); + path.push("two.sol"); + let source = fs::read_to_string(path).unwrap(); + let tokens = TokenStream::from_str(source.as_str()).unwrap(); + let ast = syn_solidity::parse2(tokens).unwrap(); + let res = retrieve_contract_nodes(ast); + assert_eq!(res.len(), 2); + } +} \ No newline at end of file diff --git a/libs/ast-extractor/src/retriever/function.rs b/libs/ast-extractor/src/retriever/function.rs new file mode 100644 index 00000000..c611499c --- /dev/null +++ b/libs/ast-extractor/src/retriever/function.rs @@ -0,0 +1,106 @@ +/** + * contract.rs + * Function to retrieve function nodes from contract AST + * author: 0xMemoryGrinder +*/ + +use syn_solidity::{Visit, ItemFunction}; + +struct FunctionVisitor { + functions: Vec, +} + +impl FunctionVisitor { + pub fn new() -> Self { + Self { + functions: Vec::new(), + } + } +} + +impl<'ast> Visit<'ast> for FunctionVisitor { + fn visit_item_function(&mut self, i: &ItemFunction) { + self.functions.push(i.clone()); + syn_solidity::visit::visit_item_function(self, i); + } +} + +pub fn retrieve_functions_nodes(ast: syn_solidity::ItemContract) -> Vec { + let mut visitor = FunctionVisitor::new(); + visitor.visit_item_contract(&ast); + visitor.functions +} + + +#[cfg(test)] +mod tests { + use proc_macro2::TokenStream; + use syn_solidity::Item; + + use super::*; + use std::fs; + use std::path::PathBuf; + use std::str::FromStr; + + #[test] + fn test_retrieve_function_nodes_empty() { + let mut path = PathBuf::from(env!("CARGO_MANIFEST_DIR")); + path.push("tests"); + path.push("files"); + path.push("functions"); + path.push("empty.sol"); + let source = fs::read_to_string(path).unwrap(); + let tokens = TokenStream::from_str(source.as_str()).unwrap(); + let ast = syn_solidity::parse2(tokens).unwrap(); + let item = ast.items.first().unwrap().clone(); + + if let Item::Contract(contract) = item { + let res = retrieve_functions_nodes(contract); + assert_eq!(res.len(), 0); + } else { + panic!("Item is not a contract"); + } + } + + #[test] + fn test_retrieve_function_nodes_one() { + let mut path = PathBuf::from(env!("CARGO_MANIFEST_DIR")); + path.push("tests"); + path.push("files"); + path.push("functions"); + path.push("one.sol"); + let source = fs::read_to_string(path).unwrap(); + let tokens = TokenStream::from_str(source.as_str()).unwrap(); + let ast = syn_solidity::parse2(tokens).unwrap(); + let item = ast.items.first().unwrap().clone(); + + if let Item::Contract(contract) = item { + let res = retrieve_functions_nodes(contract); + assert_eq!(res.len(), 1); + } else { + panic!("Item is not a contract"); + } + } + + #[test] + fn test_retrieve_function_nodes_with_modifier() { + let mut path = PathBuf::from(env!("CARGO_MANIFEST_DIR")); + path.push("tests"); + path.push("files"); + path.push("functions"); + path.push("modifier.sol"); + let source = fs::read_to_string(path).unwrap(); + let tokens = TokenStream::from_str(source.as_str()).unwrap(); + let ast = syn_solidity::parse2(tokens).unwrap(); + let item = ast.items.first().unwrap().clone(); + + if let Item::Contract(contract) = item { + let res = retrieve_functions_nodes(contract); + assert_eq!(res.len(), 2); + } else { + panic!("Item is not a contract"); + } + } + + +} \ No newline at end of file diff --git a/libs/ast-extractor/tests/files/contracts/one.sol b/libs/ast-extractor/tests/files/contracts/one.sol new file mode 100644 index 00000000..a05a6ed9 --- /dev/null +++ b/libs/ast-extractor/tests/files/contracts/one.sol @@ -0,0 +1,10 @@ +abstract contract One { + uint storedData; + function set(uint x) public { + storedData = x; + } + + function get() public view returns (uint) { + return storedData; + } +} \ No newline at end of file diff --git a/libs/ast-extractor/tests/files/contracts/two.sol b/libs/ast-extractor/tests/files/contracts/two.sol new file mode 100644 index 00000000..4c318703 --- /dev/null +++ b/libs/ast-extractor/tests/files/contracts/two.sol @@ -0,0 +1,21 @@ +abstract contract One { + uint storedData; + function set(uint x) public { + storedData = x; + } + + function get() public view returns (uint) { + return storedData; + } +} + +abstract contract Two { + uint storedData; + function set(uint x) public { + storedData = x; + } + + function get() public view returns (uint) { + return storedData; + } +} \ No newline at end of file diff --git a/libs/ast-extractor/tests/files/functions/empty.sol b/libs/ast-extractor/tests/files/functions/empty.sol new file mode 100644 index 00000000..89f8fe40 --- /dev/null +++ b/libs/ast-extractor/tests/files/functions/empty.sol @@ -0,0 +1 @@ +contract Empty {} \ No newline at end of file diff --git a/libs/ast-extractor/tests/files/functions/modifier.sol b/libs/ast-extractor/tests/files/functions/modifier.sol new file mode 100644 index 00000000..726a9b31 --- /dev/null +++ b/libs/ast-extractor/tests/files/functions/modifier.sol @@ -0,0 +1,12 @@ +contract One { + uint storedData; + + modifier onlyOwner() { + require(msg.sender == address(0x123)); + _; + } + + function get() public view returns (uint) { + return storedData; + } +} \ No newline at end of file diff --git a/libs/ast-extractor/tests/files/functions/one.sol b/libs/ast-extractor/tests/files/functions/one.sol new file mode 100644 index 00000000..32ff3475 --- /dev/null +++ b/libs/ast-extractor/tests/files/functions/one.sol @@ -0,0 +1,7 @@ +contract One { + uint storedData; + + function get() public view returns (uint) { + return storedData; + } +} \ No newline at end of file diff --git a/libs/ast-extractor/tests/files/good.sol b/libs/ast-extractor/tests/files/good.sol new file mode 100644 index 00000000..a9f93941 --- /dev/null +++ b/libs/ast-extractor/tests/files/good.sol @@ -0,0 +1,10 @@ +abstract contract SimpleStorage { + uint storedData; + function set(uint x) public { + storedData = x; + } + + function get() public view returns (uint) { + return storedData; + } +} \ No newline at end of file From b813e6e6fba56337e6893093b3991a22c6585e8e Mon Sep 17 00:00:00 2001 From: leon Date: Fri, 8 Sep 2023 20:41:29 +0200 Subject: [PATCH 018/325] feat: add file default functions --- libs/ast-extractor/src/retriever/enum.rs | 29 ++++++++++++++++++++ libs/ast-extractor/src/retriever/error.rs | 29 ++++++++++++++++++++ libs/ast-extractor/src/retriever/event.rs | 29 ++++++++++++++++++++ libs/ast-extractor/src/retriever/struct.rs | 31 ++++++++++++++++++++++ libs/ast-extractor/src/retriever/udt.rs | 29 ++++++++++++++++++++ libs/ast-extractor/src/retriever/using.rs | 29 ++++++++++++++++++++ 6 files changed, 176 insertions(+) create mode 100644 libs/ast-extractor/src/retriever/enum.rs create mode 100644 libs/ast-extractor/src/retriever/error.rs create mode 100644 libs/ast-extractor/src/retriever/event.rs create mode 100644 libs/ast-extractor/src/retriever/struct.rs create mode 100644 libs/ast-extractor/src/retriever/udt.rs create mode 100644 libs/ast-extractor/src/retriever/using.rs diff --git a/libs/ast-extractor/src/retriever/enum.rs b/libs/ast-extractor/src/retriever/enum.rs new file mode 100644 index 00000000..3cc1ca57 --- /dev/null +++ b/libs/ast-extractor/src/retriever/enum.rs @@ -0,0 +1,29 @@ +/** + * enum.rs + * Functions to retrieve enum nodes from contract AST + * author: Leon +*/ +use syn_solidity::{ItemEnum, Visit}; + +struct EnumVisitor { + enums: Vec, +} + +impl EnumVisitor { + pub fn new() -> Self { + Self { enums: Vec::new() } + } +} + +impl<'ast> Visit<'ast> for EnumVisitor { + fn visit_item_enum(&mut self, i: &ItemEnum) { + self.enums.push(i.clone()); + syn_solidity::visit::visit_item_enum(self, i); + } +} + +pub fn retrieve_enums_nodes(ast: syn_solidity::ItemContract) -> Vec { + let mut visitor = EnumVisitor::new(); + visitor.visit_item_contract(&ast); + visitor.enums +} diff --git a/libs/ast-extractor/src/retriever/error.rs b/libs/ast-extractor/src/retriever/error.rs new file mode 100644 index 00000000..d88acc38 --- /dev/null +++ b/libs/ast-extractor/src/retriever/error.rs @@ -0,0 +1,29 @@ +/** + * error.rs + * Functions to retrieve error nodes from contract AST + * author: Leon +*/ +use syn_solidity::{ItemError, Visit}; + +struct ErrorVisitor { + errors: Vec, +} + +impl ErrorVisitor { + pub fn new() -> Self { + Self { errors: Vec::new() } + } +} + +impl<'ast> Visit<'ast> for ErrorVisitor { + fn visit_item_error(&mut self, i: &ItemError) { + self.errors.push(i.clone()); + syn_solidity::visit::visit_item_error(self, i); + } +} + +pub fn retrieve_errors_nodes(ast: syn_solidity::ItemContract) -> Vec { + let mut visitor = ErrorVisitor::new(); + visitor.visit_item_contract(&ast); + visitor.errors +} diff --git a/libs/ast-extractor/src/retriever/event.rs b/libs/ast-extractor/src/retriever/event.rs new file mode 100644 index 00000000..ef855616 --- /dev/null +++ b/libs/ast-extractor/src/retriever/event.rs @@ -0,0 +1,29 @@ +/** + * event.rs + * Functions to retrieve event nodes from contract AST + * author: Leon +*/ +use syn_solidity::{ItemEvent, Visit}; + +struct EventVisitor { + events: Vec, +} + +impl EventVisitor { + pub fn new() -> Self { + Self { events: Vec::new() } + } +} + +impl<'ast> Visit<'ast> for EventVisitor { + fn visit_item_event(&mut self, i: &ItemEvent) { + self.events.push(i.clone()); + syn_solidity::visit::visit_item_event(self, i); + } +} + +pub fn retrieve_events_nodes(ast: syn_solidity::ItemContract) -> Vec { + let mut visitor = EventVisitor::new(); + visitor.visit_item_contract(&ast); + visitor.events +} diff --git a/libs/ast-extractor/src/retriever/struct.rs b/libs/ast-extractor/src/retriever/struct.rs new file mode 100644 index 00000000..60bd574d --- /dev/null +++ b/libs/ast-extractor/src/retriever/struct.rs @@ -0,0 +1,31 @@ +/** + * struct.rs + * Functions to retrieve struct nodes from contract AST + * author: Leon +*/ +use syn_solidity::{ItemStruct, Visit}; + +struct StructVisitor { + structs: Vec, +} + +impl StructVisitor { + pub fn new() -> Self { + Self { + structs: Vec::new(), + } + } +} + +impl<'ast> Visit<'ast> for StructVisitor { + fn visit_item_struct(&mut self, i: &ItemStruct) { + self.structs.push(i.clone()); + syn_solidity::visit::visit_item_struct(self, i); + } +} + +pub fn retrieve_structs_nodes(ast: syn_solidity::ItemContract) -> Vec { + let mut visitor = StructVisitor::new(); + visitor.visit_item_contract(&ast); + visitor.structs +} diff --git a/libs/ast-extractor/src/retriever/udt.rs b/libs/ast-extractor/src/retriever/udt.rs new file mode 100644 index 00000000..4be9abb3 --- /dev/null +++ b/libs/ast-extractor/src/retriever/udt.rs @@ -0,0 +1,29 @@ +/** + * udt.rs + * Functions to retrieve udt nodes from contract AST + * author: Leon +*/ +use syn_solidity::{ItemUdt, Visit}; + +struct UdtVisitor { + udts: Vec, +} + +impl UdtVisitor { + pub fn new() -> Self { + Self { udts: Vec::new() } + } +} + +impl<'ast> Visit<'ast> for UdtVisitor { + fn visit_item_udt(&mut self, i: &ItemUdt) { + self.udts.push(i.clone()); + syn_solidity::visit::visit_item_udt(self, i); + } +} + +pub fn retrieve_udts_nodes(ast: syn_solidity::ItemContract) -> Vec { + let mut visitor = UdtVisitor::new(); + visitor.visit_item_contract(&ast); + visitor.udts +} diff --git a/libs/ast-extractor/src/retriever/using.rs b/libs/ast-extractor/src/retriever/using.rs new file mode 100644 index 00000000..d77700d0 --- /dev/null +++ b/libs/ast-extractor/src/retriever/using.rs @@ -0,0 +1,29 @@ +/** + * using.rs + * Functions to retrieve using nodes from contract AST + * author: Leon +*/ +use syn_solidity::{ItemUsing, Visit}; + +struct UsingVisitor { + usings: Vec, +} + +impl UsingVisitor { + pub fn new() -> Self { + Self { usings: Vec::new() } + } +} + +impl<'ast> Visit<'ast> for UsingVisitor { + fn visit_item_using(&mut self, i: &ItemUsing) { + self.usings.push(i.clone()); + syn_solidity::visit::visit_item_using(self, i); + } +} + +pub fn retrieve_usings_nodes(ast: syn_solidity::ItemContract) -> Vec { + let mut visitor = UsingVisitor::new(); + visitor.visit_item_contract(&ast); + visitor.usings +} From 104f917588cbc3718425855129f0af08458dbd7a Mon Sep 17 00:00:00 2001 From: leon Date: Fri, 8 Sep 2023 21:12:23 +0200 Subject: [PATCH 019/325] feat: add tests inside struct and enums file --- libs/ast-extractor/src/retriever/enum.rs | 51 +++++++++++++++++++ libs/ast-extractor/src/retriever/struct.rs | 51 +++++++++++++++++++ .../ast-extractor/tests/files/enums/empty.sol | 1 + libs/ast-extractor/tests/files/enums/one.sol | 21 ++++++++ .../tests/files/functions/one.sol | 2 +- .../tests/files/structs/empty.sol | 1 + .../ast-extractor/tests/files/structs/one.sol | 11 ++++ 7 files changed, 137 insertions(+), 1 deletion(-) create mode 100644 libs/ast-extractor/tests/files/enums/empty.sol create mode 100644 libs/ast-extractor/tests/files/enums/one.sol create mode 100644 libs/ast-extractor/tests/files/structs/empty.sol create mode 100644 libs/ast-extractor/tests/files/structs/one.sol diff --git a/libs/ast-extractor/src/retriever/enum.rs b/libs/ast-extractor/src/retriever/enum.rs index 3cc1ca57..04d5de89 100644 --- a/libs/ast-extractor/src/retriever/enum.rs +++ b/libs/ast-extractor/src/retriever/enum.rs @@ -27,3 +27,54 @@ pub fn retrieve_enums_nodes(ast: syn_solidity::ItemContract) -> Vec { visitor.visit_item_contract(&ast); visitor.enums } + +#[cfg(test)] +mod tests { + use proc_macro2::TokenStream; + use syn_solidity::Item; + + use super::*; + use std::fs; + use std::path::PathBuf; + use std::str::FromStr; + + #[test] + fn test_retrieve_enum_nodes_empty() { + let mut path = PathBuf::from(env!("CARGO_MANIFEST_DIR")); + path.push("tests"); + path.push("files"); + path.push("enums"); + path.push("empty.sol"); + let source = fs::read_to_string(path).unwrap(); + let tokens = TokenStream::from_str(source.as_str()).unwrap(); + let ast = syn_solidity::parse2(tokens).unwrap(); + let item = ast.items.first().unwrap().clone(); + + if let Item::Contract(contract) = item { + let res = retrieve_enums_nodes(contract); + assert_eq!(res.len(), 0); + } else { + panic!("Item shouldn't have enum"); + } + } + + #[test] + fn test_retrieve_enum_nodes_one() { + let mut path = PathBuf::from(env!("CARGO_MANIFEST_DIR")); + path.push("tests"); + path.push("files"); + path.push("enums"); + path.push("one.sol"); + let source = fs::read_to_string(path).unwrap(); + let tokens = TokenStream::from_str(source.as_str()).unwrap(); + let ast = syn_solidity::parse2(tokens).unwrap(); + let item = ast.items.first().unwrap().clone(); + + if let Item::Contract(contract) = item { + let res = retrieve_enums_nodes(contract); + assert_eq!(res.len(), 1); + } else { + panic!("Item should have an enum"); + } + } +} diff --git a/libs/ast-extractor/src/retriever/struct.rs b/libs/ast-extractor/src/retriever/struct.rs index 60bd574d..c4bdcc72 100644 --- a/libs/ast-extractor/src/retriever/struct.rs +++ b/libs/ast-extractor/src/retriever/struct.rs @@ -29,3 +29,54 @@ pub fn retrieve_structs_nodes(ast: syn_solidity::ItemContract) -> Vec Date: Fri, 8 Sep 2023 23:48:21 +0200 Subject: [PATCH 020/325] add tests for event and erros --- libs/ast-extractor/src/retriever/error.rs | 51 +++++++++++++++++++ libs/ast-extractor/src/retriever/event.rs | 51 +++++++++++++++++++ libs/ast-extractor/src/retriever/struct.rs | 2 +- .../tests/files/errors/empty.sol | 1 + libs/ast-extractor/tests/files/errors/one.sol | 5 ++ .../ast-extractor/tests/files/event/empty.sol | 1 + libs/ast-extractor/tests/files/event/one.sol | 3 ++ 7 files changed, 113 insertions(+), 1 deletion(-) create mode 100644 libs/ast-extractor/tests/files/errors/empty.sol create mode 100644 libs/ast-extractor/tests/files/errors/one.sol create mode 100644 libs/ast-extractor/tests/files/event/empty.sol create mode 100644 libs/ast-extractor/tests/files/event/one.sol diff --git a/libs/ast-extractor/src/retriever/error.rs b/libs/ast-extractor/src/retriever/error.rs index d88acc38..22af845c 100644 --- a/libs/ast-extractor/src/retriever/error.rs +++ b/libs/ast-extractor/src/retriever/error.rs @@ -27,3 +27,54 @@ pub fn retrieve_errors_nodes(ast: syn_solidity::ItemContract) -> Vec visitor.visit_item_contract(&ast); visitor.errors } + +#[cfg(test)] +mod tests { + use proc_macro2::TokenStream; + use syn_solidity::Item; + + use super::*; + use std::fs; + use std::path::PathBuf; + use std::str::FromStr; + + #[test] + fn test_retrieve_error_nodes_empty() { + let mut path = PathBuf::from(env!("CARGO_MANIFEST_DIR")); + path.push("tests"); + path.push("files"); + path.push("errors"); + path.push("empty.sol"); + let source = fs::read_to_string(path).unwrap(); + let tokens = TokenStream::from_str(source.as_str()).unwrap(); + let ast = syn_solidity::parse2(tokens).unwrap(); + let item = ast.items.first().unwrap().clone(); + + if let Item::Contract(contract) = item { + let res = retrieve_errors_nodes(contract); + assert_eq!(res.len(), 0); + } else { + panic!("Item should not have error"); + } + } + + #[test] + fn test_retrieve_error_nodes_one() { + let mut path = PathBuf::from(env!("CARGO_MANIFEST_DIR")); + path.push("tests"); + path.push("files"); + path.push("errors"); + path.push("one.sol"); + let source = fs::read_to_string(path).unwrap(); + let tokens = TokenStream::from_str(source.as_str()).unwrap(); + let ast = syn_solidity::parse2(tokens).unwrap(); + let item = ast.items.first().unwrap().clone(); + + if let Item::Contract(contract) = item { + let res = retrieve_errors_nodes(contract); + assert_eq!(res.len(), 1); + } else { + panic!("Item should have a error"); + } + } +} diff --git a/libs/ast-extractor/src/retriever/event.rs b/libs/ast-extractor/src/retriever/event.rs index ef855616..e546e741 100644 --- a/libs/ast-extractor/src/retriever/event.rs +++ b/libs/ast-extractor/src/retriever/event.rs @@ -27,3 +27,54 @@ pub fn retrieve_events_nodes(ast: syn_solidity::ItemContract) -> Vec visitor.visit_item_contract(&ast); visitor.events } + +#[cfg(test)] +mod tests { + use proc_macro2::TokenStream; + use syn_solidity::Item; + + use super::*; + use std::fs; + use std::path::PathBuf; + use std::str::FromStr; + + #[test] + fn test_retrieve_event_nodes_empty() { + let mut path = PathBuf::from(env!("CARGO_MANIFEST_DIR")); + path.push("tests"); + path.push("files"); + path.push("events"); + path.push("empty.sol"); + let source = fs::read_to_string(path).unwrap(); + let tokens = TokenStream::from_str(source.as_str()).unwrap(); + let ast = syn_solidity::parse2(tokens).unwrap(); + let item = ast.items.first().unwrap().clone(); + + if let Item::Contract(contract) = item { + let res = retrieve_events_nodes(contract); + assert_eq!(res.len(), 0); + } else { + panic!("Item should not have event"); + } + } + + #[test] + fn test_retrieve_event_nodes_one() { + let mut path = PathBuf::from(env!("CARGO_MANIFEST_DIR")); + path.push("tests"); + path.push("files"); + path.push("events"); + path.push("one.sol"); + let source = fs::read_to_string(path).unwrap(); + let tokens = TokenStream::from_str(source.as_str()).unwrap(); + let ast = syn_solidity::parse2(tokens).unwrap(); + let item = ast.items.first().unwrap().clone(); + + if let Item::Contract(contract) = item { + let res = retrieve_events_nodes(contract); + assert_eq!(res.len(), 1); + } else { + panic!("Item should have a event"); + } + } +} diff --git a/libs/ast-extractor/src/retriever/struct.rs b/libs/ast-extractor/src/retriever/struct.rs index c4bdcc72..95ad0397 100644 --- a/libs/ast-extractor/src/retriever/struct.rs +++ b/libs/ast-extractor/src/retriever/struct.rs @@ -41,7 +41,7 @@ mod tests { use std::str::FromStr; #[test] - fn test_retrieve_sruct_nodes_empty() { + fn test_retrieve_struct_nodes_empty() { let mut path = PathBuf::from(env!("CARGO_MANIFEST_DIR")); path.push("tests"); path.push("files"); diff --git a/libs/ast-extractor/tests/files/errors/empty.sol b/libs/ast-extractor/tests/files/errors/empty.sol new file mode 100644 index 00000000..89f8fe40 --- /dev/null +++ b/libs/ast-extractor/tests/files/errors/empty.sol @@ -0,0 +1 @@ +contract Empty {} \ No newline at end of file diff --git a/libs/ast-extractor/tests/files/errors/one.sol b/libs/ast-extractor/tests/files/errors/one.sol new file mode 100644 index 00000000..fbccd3e0 --- /dev/null +++ b/libs/ast-extractor/tests/files/errors/one.sol @@ -0,0 +1,5 @@ +error one(); + +contract One { + error another_one(); +} diff --git a/libs/ast-extractor/tests/files/event/empty.sol b/libs/ast-extractor/tests/files/event/empty.sol new file mode 100644 index 00000000..89f8fe40 --- /dev/null +++ b/libs/ast-extractor/tests/files/event/empty.sol @@ -0,0 +1 @@ +contract Empty {} \ No newline at end of file diff --git a/libs/ast-extractor/tests/files/event/one.sol b/libs/ast-extractor/tests/files/event/one.sol new file mode 100644 index 00000000..b6a4faec --- /dev/null +++ b/libs/ast-extractor/tests/files/event/one.sol @@ -0,0 +1,3 @@ +contract One { + event another_one(); +} From 8feb1e881b33f633ce863c51ca4f8085247a00af Mon Sep 17 00:00:00 2001 From: Louis PIOCHAUD Date: Sun, 10 Sep 2023 21:27:36 -0700 Subject: [PATCH 021/325] [#51] tests: udt.rs --- libs/ast-extractor/src/retriever/udt.rs | 51 +++++++++++++++++++++++++ 1 file changed, 51 insertions(+) diff --git a/libs/ast-extractor/src/retriever/udt.rs b/libs/ast-extractor/src/retriever/udt.rs index 4be9abb3..12083c70 100644 --- a/libs/ast-extractor/src/retriever/udt.rs +++ b/libs/ast-extractor/src/retriever/udt.rs @@ -27,3 +27,54 @@ pub fn retrieve_udts_nodes(ast: syn_solidity::ItemContract) -> Vec { visitor.visit_item_contract(&ast); visitor.udts } + +#[cfg(test)] +mod tests { + use proc_macro2::TokenStream; + use syn_solidity::Item; + + use super::*; + use std::fs; + use std::path::PathBuf; + use std::str::FromStr; + + #[test] + fn test_retrieve_udt_nodes_empty() { + let mut path = PathBuf::from(env!("CARGO_MANIFEST_DIR")); + path.push("tests"); + path.push("files"); + path.push("udt"); + path.push("empty.sol"); + let source = fs::read_to_string(path).unwrap(); + let tokens = TokenStream::from_str(source.as_str()).unwrap(); + let ast = syn_solidity::parse2(tokens).unwrap(); + let item = ast.items.first().unwrap().clone(); + + if let Item::Contract(contract) = item { + let res = retrieve_udts_nodes(contract); + assert_eq!(res.len(), 0); + } else { + panic!("Item should not have any user defined type"); + } + } + + #[test] + fn test_retrieve_udt_nodes_one() { + let mut path = PathBuf::from(env!("CARGO_MANIFEST_DIR")); + path.push("tests"); + path.push("files"); + path.push("udt"); + path.push("one.sol"); + let source = fs::read_to_string(path).unwrap(); + let tokens = TokenStream::from_str(source.as_str()).unwrap(); + let ast = syn_solidity::parse2(tokens).unwrap(); + let item = ast.items.first().unwrap().clone(); + + if let Item::Contract(contract) = item { + let res = retrieve_udts_nodes(contract); + assert_eq!(res.len(), 1); + } else { + panic!("Item should have atleast 1 user defined type"); + } + } +} \ No newline at end of file From 568c59a8820bd947389877c9790fcef522da070b Mon Sep 17 00:00:00 2001 From: Louis PIOCHAUD Date: Sun, 10 Sep 2023 21:29:32 -0700 Subject: [PATCH 022/325] [#51] tests: using.rs --- libs/ast-extractor/src/retriever/using.rs | 52 +++++++++++++++++++++++ 1 file changed, 52 insertions(+) diff --git a/libs/ast-extractor/src/retriever/using.rs b/libs/ast-extractor/src/retriever/using.rs index d77700d0..e6419ab5 100644 --- a/libs/ast-extractor/src/retriever/using.rs +++ b/libs/ast-extractor/src/retriever/using.rs @@ -27,3 +27,55 @@ pub fn retrieve_usings_nodes(ast: syn_solidity::ItemContract) -> Vec visitor.visit_item_contract(&ast); visitor.usings } + + +#[cfg(test)] +mod tests { + use proc_macro2::TokenStream; + use syn_solidity::Item; + + use super::*; + use std::fs; + use std::path::PathBuf; + use std::str::FromStr; + + #[test] + fn test_retrieve_using_nodes_empty() { + let mut path = PathBuf::from(env!("CARGO_MANIFEST_DIR")); + path.push("tests"); + path.push("files"); + path.push("using"); + path.push("empty.sol"); + let source = fs::read_to_string(path).unwrap(); + let tokens = TokenStream::from_str(source.as_str()).unwrap(); + let ast = syn_solidity::parse2(tokens).unwrap(); + let item = ast.items.first().unwrap().clone(); + + if let Item::Contract(contract) = item { + let res = retrieve_usings_nodes(contract); + assert_eq!(res.len(), 0); + } else { + panic!("Item should not have any using directive"); + } + } + + #[test] + fn test_retrieve_using_nodes_one() { + let mut path = PathBuf::from(env!("CARGO_MANIFEST_DIR")); + path.push("tests"); + path.push("files"); + path.push("using"); + path.push("one.sol"); + let source = fs::read_to_string(path).unwrap(); + let tokens = TokenStream::from_str(source.as_str()).unwrap(); + let ast = syn_solidity::parse2(tokens).unwrap(); + let item = ast.items.first().unwrap().clone(); + + if let Item::Contract(contract) = item { + let res = retrieve_usings_nodes(contract); + assert_eq!(res.len(), 1); + } else { + panic!("Item should have a a using directive"); + } + } +} \ No newline at end of file From b896da7d4696aea011cd3bbbef8509fa68ae0da6 Mon Sep 17 00:00:00 2001 From: Louis PIOCHAUD Date: Sun, 10 Sep 2023 21:29:50 -0700 Subject: [PATCH 023/325] [#51] tests: tests files for udts --- .../ast-extractor/tests/files/using/empty.sol | 1 + libs/ast-extractor/tests/files/using/one.sol | 31 +++++++++++++++++++ 2 files changed, 32 insertions(+) create mode 100644 libs/ast-extractor/tests/files/using/empty.sol create mode 100644 libs/ast-extractor/tests/files/using/one.sol diff --git a/libs/ast-extractor/tests/files/using/empty.sol b/libs/ast-extractor/tests/files/using/empty.sol new file mode 100644 index 00000000..182e47d8 --- /dev/null +++ b/libs/ast-extractor/tests/files/using/empty.sol @@ -0,0 +1 @@ +contract Empty {} diff --git a/libs/ast-extractor/tests/files/using/one.sol b/libs/ast-extractor/tests/files/using/one.sol new file mode 100644 index 00000000..b6ba9c7c --- /dev/null +++ b/libs/ast-extractor/tests/files/using/one.sol @@ -0,0 +1,31 @@ +// ERC20 Token interface +interface ERC20 { + function balanceOf(address account) external view returns (uint256); +} + +// Library to work with token balances +library TokenBalanceLibrary { + function checkBalance( + ERC20 token, + address account + ) internal view returns (uint256) { + return token.balanceOf(account); + } +} + +// Contract that uses the TokenBalanceLibrary +contract Wallet { + using TokenBalanceLibrary for ERC20; // Use the TokenBalanceLibrary for ERC20 interface + + address public owner; + ERC20 public token; + + constructor(address _token) { + owner = msg.sender; + token = ERC20(_token); + } + + function getBalance() public view returns (uint256) { + return token.checkBalance(msg.sender); // Use the checkBalance function from TokenBalanceLibrary + } +} From f10ab29ec8e60516cb15a0b078bbda5dcd585fba Mon Sep 17 00:00:00 2001 From: Louis PIOCHAUD Date: Sun, 10 Sep 2023 21:30:27 -0700 Subject: [PATCH 024/325] [#51] tests: tests files for usings --- libs/ast-extractor/tests/files/udt/empty.sol | 0 libs/ast-extractor/tests/files/udt/one.sol | 4 ++++ 2 files changed, 4 insertions(+) create mode 100644 libs/ast-extractor/tests/files/udt/empty.sol create mode 100644 libs/ast-extractor/tests/files/udt/one.sol diff --git a/libs/ast-extractor/tests/files/udt/empty.sol b/libs/ast-extractor/tests/files/udt/empty.sol new file mode 100644 index 00000000..e69de29b diff --git a/libs/ast-extractor/tests/files/udt/one.sol b/libs/ast-extractor/tests/files/udt/one.sol new file mode 100644 index 00000000..6b1d491f --- /dev/null +++ b/libs/ast-extractor/tests/files/udt/one.sol @@ -0,0 +1,4 @@ +struct Person { + string name; + uint age; +} From 47359d695d90a7e1fcd9731e8542aff64910817d Mon Sep 17 00:00:00 2001 From: 0xMemoryGrinder <35138272+0xMemoryGrinder@users.noreply.github.com> Date: Tue, 12 Sep 2023 19:50:11 -0400 Subject: [PATCH 025/325] fix(libs/ast-extractor): made tests pass --- libs/ast-extractor/src/retriever.rs | 20 +++++- libs/ast-extractor/src/retriever/enum.rs | 9 ++- libs/ast-extractor/src/retriever/error.rs | 7 +- libs/ast-extractor/src/retriever/event.rs | 4 +- libs/ast-extractor/src/retriever/struct.rs | 72 +++++++++++++++++--- libs/ast-extractor/src/retriever/udt.rs | 33 ++------- libs/ast-extractor/src/retriever/using.rs | 15 ++-- libs/ast-extractor/tests/files/udt/empty.sol | 0 libs/ast-extractor/tests/files/udt/one.sol | 5 +- 9 files changed, 108 insertions(+), 57 deletions(-) delete mode 100644 libs/ast-extractor/tests/files/udt/empty.sol diff --git a/libs/ast-extractor/src/retriever.rs b/libs/ast-extractor/src/retriever.rs index 07b1ca27..d842a34e 100644 --- a/libs/ast-extractor/src/retriever.rs +++ b/libs/ast-extractor/src/retriever.rs @@ -7,5 +7,23 @@ mod contract; pub use contract::*; +mod r#enum; +pub use r#enum::*; + +mod error; +pub use error::*; + +mod event; +pub use event::*; + mod function; -pub use function::*; \ No newline at end of file +pub use function::*; + +mod r#struct; +pub use r#struct::*; + +mod udt; +pub use udt::*; + +mod using; +pub use using::*; \ No newline at end of file diff --git a/libs/ast-extractor/src/retriever/enum.rs b/libs/ast-extractor/src/retriever/enum.rs index 04d5de89..af1cd6a2 100644 --- a/libs/ast-extractor/src/retriever/enum.rs +++ b/libs/ast-extractor/src/retriever/enum.rs @@ -68,13 +68,16 @@ mod tests { let source = fs::read_to_string(path).unwrap(); let tokens = TokenStream::from_str(source.as_str()).unwrap(); let ast = syn_solidity::parse2(tokens).unwrap(); - let item = ast.items.first().unwrap().clone(); + let contract = ast.items.iter().find(|i| match i { + Item::Contract(_) => true, + _ => false, + }).unwrap().clone(); - if let Item::Contract(contract) = item { + if let Item::Contract(contract) = contract { let res = retrieve_enums_nodes(contract); assert_eq!(res.len(), 1); } else { - panic!("Item should have an enum"); + panic!("Item should have a contract"); } } } diff --git a/libs/ast-extractor/src/retriever/error.rs b/libs/ast-extractor/src/retriever/error.rs index 22af845c..f16a6ef7 100644 --- a/libs/ast-extractor/src/retriever/error.rs +++ b/libs/ast-extractor/src/retriever/error.rs @@ -68,13 +68,16 @@ mod tests { let source = fs::read_to_string(path).unwrap(); let tokens = TokenStream::from_str(source.as_str()).unwrap(); let ast = syn_solidity::parse2(tokens).unwrap(); - let item = ast.items.first().unwrap().clone(); + let item = ast.items.iter().find(|i| match i { + Item::Contract(_) => true, + _ => false, + }).unwrap().clone(); if let Item::Contract(contract) = item { let res = retrieve_errors_nodes(contract); assert_eq!(res.len(), 1); } else { - panic!("Item should have a error"); + panic!("Item should have a contract"); } } } diff --git a/libs/ast-extractor/src/retriever/event.rs b/libs/ast-extractor/src/retriever/event.rs index e546e741..fa8818a2 100644 --- a/libs/ast-extractor/src/retriever/event.rs +++ b/libs/ast-extractor/src/retriever/event.rs @@ -43,7 +43,7 @@ mod tests { let mut path = PathBuf::from(env!("CARGO_MANIFEST_DIR")); path.push("tests"); path.push("files"); - path.push("events"); + path.push("event"); path.push("empty.sol"); let source = fs::read_to_string(path).unwrap(); let tokens = TokenStream::from_str(source.as_str()).unwrap(); @@ -63,7 +63,7 @@ mod tests { let mut path = PathBuf::from(env!("CARGO_MANIFEST_DIR")); path.push("tests"); path.push("files"); - path.push("events"); + path.push("event"); path.push("one.sol"); let source = fs::read_to_string(path).unwrap(); let tokens = TokenStream::from_str(source.as_str()).unwrap(); diff --git a/libs/ast-extractor/src/retriever/struct.rs b/libs/ast-extractor/src/retriever/struct.rs index 95ad0397..5e1a3948 100644 --- a/libs/ast-extractor/src/retriever/struct.rs +++ b/libs/ast-extractor/src/retriever/struct.rs @@ -6,28 +6,47 @@ use syn_solidity::{ItemStruct, Visit}; struct StructVisitor { - structs: Vec, + contract_structs: Vec, + file_structs: Vec, + inside_contract: bool, } impl StructVisitor { pub fn new() -> Self { Self { - structs: Vec::new(), + contract_structs: Vec::new(), + file_structs: Vec::new(), + inside_contract: false, } } } impl<'ast> Visit<'ast> for StructVisitor { + fn visit_item_contract(&mut self, i: &syn_solidity::ItemContract) { + self.inside_contract = true; + syn_solidity::visit::visit_item_contract(self, i); + self.inside_contract = false; + } fn visit_item_struct(&mut self, i: &ItemStruct) { - self.structs.push(i.clone()); + if self.inside_contract { + self.contract_structs.push(i.clone()); + } else { + self.file_structs.push(i.clone()); + } syn_solidity::visit::visit_item_struct(self, i); } } -pub fn retrieve_structs_nodes(ast: syn_solidity::ItemContract) -> Vec { +pub fn retrieve_structs_contract_nodes(ast: syn_solidity::ItemContract) -> Vec { let mut visitor = StructVisitor::new(); visitor.visit_item_contract(&ast); - visitor.structs + visitor.contract_structs +} + +pub fn retrieve_structs_file_nodes(ast: syn_solidity::File) -> Vec { + let mut visitor = StructVisitor::new(); + visitor.visit_file(&ast); + visitor.file_structs } #[cfg(test)] @@ -41,7 +60,7 @@ mod tests { use std::str::FromStr; #[test] - fn test_retrieve_struct_nodes_empty() { + fn test_retrieve_struct_contract_nodes_empty() { let mut path = PathBuf::from(env!("CARGO_MANIFEST_DIR")); path.push("tests"); path.push("files"); @@ -53,7 +72,7 @@ mod tests { let item = ast.items.first().unwrap().clone(); if let Item::Contract(contract) = item { - let res = retrieve_structs_nodes(contract); + let res = retrieve_structs_contract_nodes(contract); assert_eq!(res.len(), 0); } else { panic!("Item should not have struct"); @@ -61,7 +80,7 @@ mod tests { } #[test] - fn test_retrieve_struct_nodes_one() { + fn test_retrieve_struct_contract_nodes_one() { let mut path = PathBuf::from(env!("CARGO_MANIFEST_DIR")); path.push("tests"); path.push("files"); @@ -70,13 +89,46 @@ mod tests { let source = fs::read_to_string(path).unwrap(); let tokens = TokenStream::from_str(source.as_str()).unwrap(); let ast = syn_solidity::parse2(tokens).unwrap(); - let item = ast.items.first().unwrap().clone(); + let item = ast.items.iter().find(|i| match i { + Item::Contract(_) => true, + _ => false, + }).unwrap().clone(); if let Item::Contract(contract) = item { - let res = retrieve_structs_nodes(contract); + let res = retrieve_structs_contract_nodes(contract); assert_eq!(res.len(), 1); } else { panic!("Item should have a struct"); } } + + #[test] + fn test_retrieve_struct_file_nodes_empty() { + let mut path = PathBuf::from(env!("CARGO_MANIFEST_DIR")); + path.push("tests"); + path.push("files"); + path.push("structs"); + path.push("empty.sol"); + let source = fs::read_to_string(path).unwrap(); + let tokens = TokenStream::from_str(source.as_str()).unwrap(); + let ast = syn_solidity::parse2(tokens).unwrap(); + + let res = retrieve_structs_file_nodes(ast); + assert_eq!(res.len(), 0); + } + + #[test] + fn test_retrieve_struct_file_nodes_one() { + let mut path = PathBuf::from(env!("CARGO_MANIFEST_DIR")); + path.push("tests"); + path.push("files"); + path.push("structs"); + path.push("one.sol"); + let source = fs::read_to_string(path).unwrap(); + let tokens = TokenStream::from_str(source.as_str()).unwrap(); + let ast = syn_solidity::parse2(tokens).unwrap(); + + let res = retrieve_structs_file_nodes(ast); + assert_eq!(res.len(), 1); + } } diff --git a/libs/ast-extractor/src/retriever/udt.rs b/libs/ast-extractor/src/retriever/udt.rs index 12083c70..00a9bd25 100644 --- a/libs/ast-extractor/src/retriever/udt.rs +++ b/libs/ast-extractor/src/retriever/udt.rs @@ -22,9 +22,9 @@ impl<'ast> Visit<'ast> for UdtVisitor { } } -pub fn retrieve_udts_nodes(ast: syn_solidity::ItemContract) -> Vec { +pub fn retrieve_udts_nodes(ast: syn_solidity::File) -> Vec { let mut visitor = UdtVisitor::new(); - visitor.visit_item_contract(&ast); + visitor.visit_file(&ast); visitor.udts } @@ -38,26 +38,6 @@ mod tests { use std::path::PathBuf; use std::str::FromStr; - #[test] - fn test_retrieve_udt_nodes_empty() { - let mut path = PathBuf::from(env!("CARGO_MANIFEST_DIR")); - path.push("tests"); - path.push("files"); - path.push("udt"); - path.push("empty.sol"); - let source = fs::read_to_string(path).unwrap(); - let tokens = TokenStream::from_str(source.as_str()).unwrap(); - let ast = syn_solidity::parse2(tokens).unwrap(); - let item = ast.items.first().unwrap().clone(); - - if let Item::Contract(contract) = item { - let res = retrieve_udts_nodes(contract); - assert_eq!(res.len(), 0); - } else { - panic!("Item should not have any user defined type"); - } - } - #[test] fn test_retrieve_udt_nodes_one() { let mut path = PathBuf::from(env!("CARGO_MANIFEST_DIR")); @@ -68,13 +48,8 @@ mod tests { let source = fs::read_to_string(path).unwrap(); let tokens = TokenStream::from_str(source.as_str()).unwrap(); let ast = syn_solidity::parse2(tokens).unwrap(); - let item = ast.items.first().unwrap().clone(); - if let Item::Contract(contract) = item { - let res = retrieve_udts_nodes(contract); - assert_eq!(res.len(), 1); - } else { - panic!("Item should have atleast 1 user defined type"); - } + let res = retrieve_udts_nodes(ast); + assert_eq!(res.len(), 1); } } \ No newline at end of file diff --git a/libs/ast-extractor/src/retriever/using.rs b/libs/ast-extractor/src/retriever/using.rs index e6419ab5..9b699e9f 100644 --- a/libs/ast-extractor/src/retriever/using.rs +++ b/libs/ast-extractor/src/retriever/using.rs @@ -3,10 +3,10 @@ * Functions to retrieve using nodes from contract AST * author: Leon */ -use syn_solidity::{ItemUsing, Visit}; +use syn_solidity::{UsingDirective, Visit}; struct UsingVisitor { - usings: Vec, + usings: Vec, } impl UsingVisitor { @@ -16,13 +16,13 @@ impl UsingVisitor { } impl<'ast> Visit<'ast> for UsingVisitor { - fn visit_item_using(&mut self, i: &ItemUsing) { + fn visit_using_directive(&mut self, i: &UsingDirective) { self.usings.push(i.clone()); - syn_solidity::visit::visit_item_using(self, i); + syn_solidity::visit::visit_using_directive(self, i); } } -pub fn retrieve_usings_nodes(ast: syn_solidity::ItemContract) -> Vec { +pub fn retrieve_usings_nodes(ast: syn_solidity::ItemContract) -> Vec { let mut visitor = UsingVisitor::new(); visitor.visit_item_contract(&ast); visitor.usings @@ -69,7 +69,10 @@ mod tests { let source = fs::read_to_string(path).unwrap(); let tokens = TokenStream::from_str(source.as_str()).unwrap(); let ast = syn_solidity::parse2(tokens).unwrap(); - let item = ast.items.first().unwrap().clone(); + let item = ast.items.iter().find(|i| match i { + Item::Contract(ctr) => ctr.name == "Wallet", + _ => false, + }).unwrap().clone(); if let Item::Contract(contract) = item { let res = retrieve_usings_nodes(contract); diff --git a/libs/ast-extractor/tests/files/udt/empty.sol b/libs/ast-extractor/tests/files/udt/empty.sol deleted file mode 100644 index e69de29b..00000000 diff --git a/libs/ast-extractor/tests/files/udt/one.sol b/libs/ast-extractor/tests/files/udt/one.sol index 6b1d491f..b305420f 100644 --- a/libs/ast-extractor/tests/files/udt/one.sol +++ b/libs/ast-extractor/tests/files/udt/one.sol @@ -1,4 +1 @@ -struct Person { - string name; - uint age; -} +type Test is uint256; \ No newline at end of file From 586f54bcfbe842d785921806ca9d85e58f8a16a5 Mon Sep 17 00:00:00 2001 From: 0xMemoryGrinder <35138272+0xMemoryGrinder@users.noreply.github.com> Date: Tue, 12 Sep 2023 20:12:42 -0400 Subject: [PATCH 026/325] feat(libs/ast-extractor): added functions to differentiate enum and events in file and contracts --- libs/ast-extractor/src/retriever/enum.rs | 70 +++++++++++++++--- libs/ast-extractor/src/retriever/event.rs | 76 +++++++++++++++++--- libs/ast-extractor/tests/files/event/one.sol | 2 + 3 files changed, 129 insertions(+), 19 deletions(-) diff --git a/libs/ast-extractor/src/retriever/enum.rs b/libs/ast-extractor/src/retriever/enum.rs index af1cd6a2..98d91e67 100644 --- a/libs/ast-extractor/src/retriever/enum.rs +++ b/libs/ast-extractor/src/retriever/enum.rs @@ -6,26 +6,48 @@ use syn_solidity::{ItemEnum, Visit}; struct EnumVisitor { - enums: Vec, + contract_enums: Vec, + file_enums: Vec, + inside_contract: bool, } impl EnumVisitor { pub fn new() -> Self { - Self { enums: Vec::new() } + Self { + contract_enums: Vec::new(), + file_enums: Vec::new(), + inside_contract: false, + } } } impl<'ast> Visit<'ast> for EnumVisitor { + fn visit_item_contract(&mut self, i: &syn_solidity::ItemContract) { + self.inside_contract = true; + syn_solidity::visit::visit_item_contract(self, i); + self.inside_contract = false; + } + fn visit_item_enum(&mut self, i: &ItemEnum) { - self.enums.push(i.clone()); + if self.inside_contract { + self.contract_enums.push(i.clone()); + } else { + self.file_enums.push(i.clone()); + } syn_solidity::visit::visit_item_enum(self, i); } } -pub fn retrieve_enums_nodes(ast: syn_solidity::ItemContract) -> Vec { +pub fn retrieve_enums_contract_nodes(ast: syn_solidity::ItemContract) -> Vec { let mut visitor = EnumVisitor::new(); visitor.visit_item_contract(&ast); - visitor.enums + visitor.contract_enums +} + +pub fn retrieve_enums_file_nodes(ast: syn_solidity::File) -> Vec { + let mut visitor = EnumVisitor::new(); + visitor.visit_file(&ast); + visitor.file_enums } #[cfg(test)] @@ -39,7 +61,7 @@ mod tests { use std::str::FromStr; #[test] - fn test_retrieve_enum_nodes_empty() { + fn test_retrieve_enum_contract_nodes_empty() { let mut path = PathBuf::from(env!("CARGO_MANIFEST_DIR")); path.push("tests"); path.push("files"); @@ -51,7 +73,7 @@ mod tests { let item = ast.items.first().unwrap().clone(); if let Item::Contract(contract) = item { - let res = retrieve_enums_nodes(contract); + let res = retrieve_enums_contract_nodes(contract); assert_eq!(res.len(), 0); } else { panic!("Item shouldn't have enum"); @@ -59,7 +81,7 @@ mod tests { } #[test] - fn test_retrieve_enum_nodes_one() { + fn test_retrieve_enum_contract_nodes_one() { let mut path = PathBuf::from(env!("CARGO_MANIFEST_DIR")); path.push("tests"); path.push("files"); @@ -74,10 +96,40 @@ mod tests { }).unwrap().clone(); if let Item::Contract(contract) = contract { - let res = retrieve_enums_nodes(contract); + let res = retrieve_enums_contract_nodes(contract); assert_eq!(res.len(), 1); } else { panic!("Item should have a contract"); } } + + #[test] + fn test_retrieve_enum_file_nodes_empty() { + let mut path = PathBuf::from(env!("CARGO_MANIFEST_DIR")); + path.push("tests"); + path.push("files"); + path.push("enums"); + path.push("empty.sol"); + let source = fs::read_to_string(path).unwrap(); + let tokens = TokenStream::from_str(source.as_str()).unwrap(); + let ast = syn_solidity::parse2(tokens).unwrap(); + + let res = retrieve_enums_file_nodes(ast); + assert_eq!(res.len(), 0); + } + + #[test] + fn test_retrieve_enum_file_nodes_one() { + let mut path = PathBuf::from(env!("CARGO_MANIFEST_DIR")); + path.push("tests"); + path.push("files"); + path.push("enums"); + path.push("one.sol"); + let source = fs::read_to_string(path).unwrap(); + let tokens = TokenStream::from_str(source.as_str()).unwrap(); + let ast = syn_solidity::parse2(tokens).unwrap(); + + let res = retrieve_enums_file_nodes(ast); + assert_eq!(res.len(), 1); + } } diff --git a/libs/ast-extractor/src/retriever/event.rs b/libs/ast-extractor/src/retriever/event.rs index fa8818a2..672d294e 100644 --- a/libs/ast-extractor/src/retriever/event.rs +++ b/libs/ast-extractor/src/retriever/event.rs @@ -6,26 +6,48 @@ use syn_solidity::{ItemEvent, Visit}; struct EventVisitor { - events: Vec, + contract_events: Vec, + file_events: Vec, + inside_contract: bool, } impl EventVisitor { pub fn new() -> Self { - Self { events: Vec::new() } + Self { + contract_events: Vec::new(), + file_events: Vec::new(), + inside_contract: false, + } } } impl<'ast> Visit<'ast> for EventVisitor { + fn visit_item_contract(&mut self, i: &syn_solidity::ItemContract) { + self.inside_contract = true; + syn_solidity::visit::visit_item_contract(self, i); + self.inside_contract = false; + } + fn visit_item_event(&mut self, i: &ItemEvent) { - self.events.push(i.clone()); + if self.inside_contract { + self.contract_events.push(i.clone()); + } else { + self.file_events.push(i.clone()); + } syn_solidity::visit::visit_item_event(self, i); } } -pub fn retrieve_events_nodes(ast: syn_solidity::ItemContract) -> Vec { +pub fn retrieve_events_contract_nodes(ast: syn_solidity::ItemContract) -> Vec { let mut visitor = EventVisitor::new(); visitor.visit_item_contract(&ast); - visitor.events + visitor.contract_events +} + +pub fn retrieve_events_file_nodes(ast: syn_solidity::File) -> Vec { + let mut visitor = EventVisitor::new(); + visitor.visit_file(&ast); + visitor.file_events } #[cfg(test)] @@ -34,12 +56,13 @@ mod tests { use syn_solidity::Item; use super::*; + use std::fs; use std::path::PathBuf; use std::str::FromStr; #[test] - fn test_retrieve_event_nodes_empty() { + fn test_retrieve_event_contract_nodes_empty() { let mut path = PathBuf::from(env!("CARGO_MANIFEST_DIR")); path.push("tests"); path.push("files"); @@ -51,7 +74,7 @@ mod tests { let item = ast.items.first().unwrap().clone(); if let Item::Contract(contract) = item { - let res = retrieve_events_nodes(contract); + let res = retrieve_events_contract_nodes(contract); assert_eq!(res.len(), 0); } else { panic!("Item should not have event"); @@ -59,7 +82,7 @@ mod tests { } #[test] - fn test_retrieve_event_nodes_one() { + fn test_retrieve_event_contract_nodes_one() { let mut path = PathBuf::from(env!("CARGO_MANIFEST_DIR")); path.push("tests"); path.push("files"); @@ -68,13 +91,46 @@ mod tests { let source = fs::read_to_string(path).unwrap(); let tokens = TokenStream::from_str(source.as_str()).unwrap(); let ast = syn_solidity::parse2(tokens).unwrap(); - let item = ast.items.first().unwrap().clone(); + let item = ast.items.iter().find(|i| match i { + Item::Contract(_) => true, + _ => false, + }).unwrap().clone(); if let Item::Contract(contract) = item { - let res = retrieve_events_nodes(contract); + let res = retrieve_events_contract_nodes(contract); assert_eq!(res.len(), 1); } else { panic!("Item should have a event"); } } + + #[test] + fn test_retrieve_event_file_nodes_empty() { + let mut path = PathBuf::from(env!("CARGO_MANIFEST_DIR")); + path.push("tests"); + path.push("files"); + path.push("event"); + path.push("empty.sol"); + let source = fs::read_to_string(path).unwrap(); + let tokens = TokenStream::from_str(source.as_str()).unwrap(); + let ast = syn_solidity::parse2(tokens).unwrap(); + + let res = retrieve_events_file_nodes(ast); + assert_eq!(res.len(), 0); + } + + #[test] + fn test_retrieve_event_file_nodes_one() { + let mut path = PathBuf::from(env!("CARGO_MANIFEST_DIR")); + path.push("tests"); + path.push("files"); + path.push("event"); + path.push("one.sol"); + let source = fs::read_to_string(path).unwrap(); + let tokens = TokenStream::from_str(source.as_str()).unwrap(); + let ast = syn_solidity::parse2(tokens).unwrap(); + + let res = retrieve_events_file_nodes(ast); + assert_eq!(res.len(), 1); + } } diff --git a/libs/ast-extractor/tests/files/event/one.sol b/libs/ast-extractor/tests/files/event/one.sol index b6a4faec..4b054318 100644 --- a/libs/ast-extractor/tests/files/event/one.sol +++ b/libs/ast-extractor/tests/files/event/one.sol @@ -1,3 +1,5 @@ +event one(); + contract One { event another_one(); } From 2d32d62476f770128f58c99c818d6ff455b34653 Mon Sep 17 00:00:00 2001 From: 0xMemoryGrinder <35138272+0xMemoryGrinder@users.noreply.github.com> Date: Tue, 12 Sep 2023 20:13:39 -0400 Subject: [PATCH 027/325] style(libs/ast-extractor): formatted code --- libs/ast-extractor/package.json | 1 + libs/ast-extractor/src/extract.rs | 12 +++++++----- libs/ast-extractor/src/lib.rs | 2 +- libs/ast-extractor/src/retriever.rs | 3 +-- libs/ast-extractor/src/retriever/contract.rs | 4 +--- libs/ast-extractor/src/retriever/enum.rs | 15 ++++++++++----- libs/ast-extractor/src/retriever/error.rs | 13 +++++++++---- libs/ast-extractor/src/retriever/event.rs | 15 ++++++++++----- libs/ast-extractor/src/retriever/function.rs | 8 ++------ libs/ast-extractor/src/retriever/struct.rs | 13 +++++++++---- libs/ast-extractor/src/retriever/udt.rs | 2 +- libs/ast-extractor/src/retriever/using.rs | 16 ++++++++++------ 12 files changed, 62 insertions(+), 42 deletions(-) diff --git a/libs/ast-extractor/package.json b/libs/ast-extractor/package.json index ba4ba3ff..5a876afb 100644 --- a/libs/ast-extractor/package.json +++ b/libs/ast-extractor/package.json @@ -3,6 +3,7 @@ "packageManager": "yarn@3.6.1", "scripts": { "build": "cargo build --release", + "format": "cargo fmt", "test": "cargo test", "lint": "cargo clippy --all-targets --all-features -- -D warnings" } diff --git a/libs/ast-extractor/src/extract.rs b/libs/ast-extractor/src/extract.rs index 1610e211..0e462890 100644 --- a/libs/ast-extractor/src/extract.rs +++ b/libs/ast-extractor/src/extract.rs @@ -1,13 +1,12 @@ +use proc_macro2::{LexError, TokenStream}; /** * extract.rs * Extract AST from solidity source code * author: 0xMemoryGrinder */ - use std::str::FromStr; -use proc_macro2::{TokenStream, LexError}; -use thiserror::Error; use syn::Error; +use thiserror::Error; #[derive(Error, Debug)] pub enum ExtractError { @@ -45,7 +44,10 @@ mod tests { let source = String::from("contract test { function test() public | uint a = 1 } }"); let result = extract_ast_from(source); assert!(result.is_err()); - assert_eq!(result.unwrap_err().to_string(), "Tokenization error: cannot parse string into token stream"); + assert_eq!( + result.unwrap_err().to_string(), + "Tokenization error: cannot parse string into token stream" + ); } #[test] @@ -55,4 +57,4 @@ mod tests { assert!(result.is_err()); assert_eq!(result.unwrap_err().to_string(), "Parsing error"); } -} \ No newline at end of file +} diff --git a/libs/ast-extractor/src/lib.rs b/libs/ast-extractor/src/lib.rs index 42163539..0bc0b9b5 100644 --- a/libs/ast-extractor/src/lib.rs +++ b/libs/ast-extractor/src/lib.rs @@ -1,2 +1,2 @@ pub mod extract; -pub mod retriever; \ No newline at end of file +pub mod retriever; diff --git a/libs/ast-extractor/src/retriever.rs b/libs/ast-extractor/src/retriever.rs index d842a34e..97e6cd01 100644 --- a/libs/ast-extractor/src/retriever.rs +++ b/libs/ast-extractor/src/retriever.rs @@ -3,7 +3,6 @@ * Module for all AST utils functions * author: 0xMemoryGrinder */ - mod contract; pub use contract::*; @@ -26,4 +25,4 @@ mod udt; pub use udt::*; mod using; -pub use using::*; \ No newline at end of file +pub use using::*; diff --git a/libs/ast-extractor/src/retriever/contract.rs b/libs/ast-extractor/src/retriever/contract.rs index 12793402..f3fd7189 100644 --- a/libs/ast-extractor/src/retriever/contract.rs +++ b/libs/ast-extractor/src/retriever/contract.rs @@ -3,7 +3,6 @@ * Function to retrieve contract nodes from AST * author: 0xMemoryGrinder */ - use syn_solidity::{ItemContract, Visit}; struct ContractVisitor { @@ -31,7 +30,6 @@ pub fn retrieve_contract_nodes(ast: syn_solidity::File) -> Vec { visitor.contracts } - #[cfg(test)] mod tests { use proc_macro2::TokenStream; @@ -77,4 +75,4 @@ mod tests { let res = retrieve_contract_nodes(ast); assert_eq!(res.len(), 2); } -} \ No newline at end of file +} diff --git a/libs/ast-extractor/src/retriever/enum.rs b/libs/ast-extractor/src/retriever/enum.rs index 98d91e67..d937631a 100644 --- a/libs/ast-extractor/src/retriever/enum.rs +++ b/libs/ast-extractor/src/retriever/enum.rs @@ -13,7 +13,7 @@ struct EnumVisitor { impl EnumVisitor { pub fn new() -> Self { - Self { + Self { contract_enums: Vec::new(), file_enums: Vec::new(), inside_contract: false, @@ -90,10 +90,15 @@ mod tests { let source = fs::read_to_string(path).unwrap(); let tokens = TokenStream::from_str(source.as_str()).unwrap(); let ast = syn_solidity::parse2(tokens).unwrap(); - let contract = ast.items.iter().find(|i| match i { - Item::Contract(_) => true, - _ => false, - }).unwrap().clone(); + let contract = ast + .items + .iter() + .find(|i| match i { + Item::Contract(_) => true, + _ => false, + }) + .unwrap() + .clone(); if let Item::Contract(contract) = contract { let res = retrieve_enums_contract_nodes(contract); diff --git a/libs/ast-extractor/src/retriever/error.rs b/libs/ast-extractor/src/retriever/error.rs index f16a6ef7..9f44472c 100644 --- a/libs/ast-extractor/src/retriever/error.rs +++ b/libs/ast-extractor/src/retriever/error.rs @@ -68,10 +68,15 @@ mod tests { let source = fs::read_to_string(path).unwrap(); let tokens = TokenStream::from_str(source.as_str()).unwrap(); let ast = syn_solidity::parse2(tokens).unwrap(); - let item = ast.items.iter().find(|i| match i { - Item::Contract(_) => true, - _ => false, - }).unwrap().clone(); + let item = ast + .items + .iter() + .find(|i| match i { + Item::Contract(_) => true, + _ => false, + }) + .unwrap() + .clone(); if let Item::Contract(contract) = item { let res = retrieve_errors_nodes(contract); diff --git a/libs/ast-extractor/src/retriever/event.rs b/libs/ast-extractor/src/retriever/event.rs index 672d294e..66db366b 100644 --- a/libs/ast-extractor/src/retriever/event.rs +++ b/libs/ast-extractor/src/retriever/event.rs @@ -13,7 +13,7 @@ struct EventVisitor { impl EventVisitor { pub fn new() -> Self { - Self { + Self { contract_events: Vec::new(), file_events: Vec::new(), inside_contract: false, @@ -91,10 +91,15 @@ mod tests { let source = fs::read_to_string(path).unwrap(); let tokens = TokenStream::from_str(source.as_str()).unwrap(); let ast = syn_solidity::parse2(tokens).unwrap(); - let item = ast.items.iter().find(|i| match i { - Item::Contract(_) => true, - _ => false, - }).unwrap().clone(); + let item = ast + .items + .iter() + .find(|i| match i { + Item::Contract(_) => true, + _ => false, + }) + .unwrap() + .clone(); if let Item::Contract(contract) = item { let res = retrieve_events_contract_nodes(contract); diff --git a/libs/ast-extractor/src/retriever/function.rs b/libs/ast-extractor/src/retriever/function.rs index c611499c..4e4937da 100644 --- a/libs/ast-extractor/src/retriever/function.rs +++ b/libs/ast-extractor/src/retriever/function.rs @@ -3,8 +3,7 @@ * Function to retrieve function nodes from contract AST * author: 0xMemoryGrinder */ - -use syn_solidity::{Visit, ItemFunction}; +use syn_solidity::{ItemFunction, Visit}; struct FunctionVisitor { functions: Vec, @@ -31,7 +30,6 @@ pub fn retrieve_functions_nodes(ast: syn_solidity::ItemContract) -> Vec true, - _ => false, - }).unwrap().clone(); + let item = ast + .items + .iter() + .find(|i| match i { + Item::Contract(_) => true, + _ => false, + }) + .unwrap() + .clone(); if let Item::Contract(contract) = item { let res = retrieve_structs_contract_nodes(contract); diff --git a/libs/ast-extractor/src/retriever/udt.rs b/libs/ast-extractor/src/retriever/udt.rs index 00a9bd25..7709e0a6 100644 --- a/libs/ast-extractor/src/retriever/udt.rs +++ b/libs/ast-extractor/src/retriever/udt.rs @@ -52,4 +52,4 @@ mod tests { let res = retrieve_udts_nodes(ast); assert_eq!(res.len(), 1); } -} \ No newline at end of file +} diff --git a/libs/ast-extractor/src/retriever/using.rs b/libs/ast-extractor/src/retriever/using.rs index 9b699e9f..7e9f8d14 100644 --- a/libs/ast-extractor/src/retriever/using.rs +++ b/libs/ast-extractor/src/retriever/using.rs @@ -28,7 +28,6 @@ pub fn retrieve_usings_nodes(ast: syn_solidity::ItemContract) -> Vec ctr.name == "Wallet", - _ => false, - }).unwrap().clone(); + let item = ast + .items + .iter() + .find(|i| match i { + Item::Contract(ctr) => ctr.name == "Wallet", + _ => false, + }) + .unwrap() + .clone(); if let Item::Contract(contract) = item { let res = retrieve_usings_nodes(contract); @@ -81,4 +85,4 @@ mod tests { panic!("Item should have a a using directive"); } } -} \ No newline at end of file +} From eec2a57c4e2521985aba9c01e098948c82e977c4 Mon Sep 17 00:00:00 2001 From: 0xMemoryGrinder <35138272+0xMemoryGrinder@users.noreply.github.com> Date: Tue, 12 Sep 2023 20:14:38 -0400 Subject: [PATCH 028/325] chore(libs/ast-extractor): removed remove-me.txt file before oppening PR --- remove-me-55553ec372c24433af1c.txt | 1 - 1 file changed, 1 deletion(-) delete mode 100644 remove-me-55553ec372c24433af1c.txt diff --git a/remove-me-55553ec372c24433af1c.txt b/remove-me-55553ec372c24433af1c.txt deleted file mode 100644 index e8bb8c0c..00000000 --- a/remove-me-55553ec372c24433af1c.txt +++ /dev/null @@ -1 +0,0 @@ -55553ec372c24433af1c From b3fb4bd727cacf6972a60970dc434f876bebc2e2 Mon Sep 17 00:00:00 2001 From: 0xMemoryGrinder <35138272+0xMemoryGrinder@users.noreply.github.com> Date: Wed, 13 Sep 2023 00:44:44 -0400 Subject: [PATCH 029/325] chore: ran yarn install to fix workspaces dependencies issues --- .pnp.cjs | 104 +++++++++++++++++++++++++++++++----------------------- yarn.lock | 54 +++++++++++++++------------- 2 files changed, 89 insertions(+), 69 deletions(-) diff --git a/.pnp.cjs b/.pnp.cjs index 31f35683..bfacf3bc 100644 --- a/.pnp.cjs +++ b/.pnp.cjs @@ -24,7 +24,7 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { "reference": "workspace:libs/lsp-launcher"\ },\ {\ - "name": "osmium-manager",\ + "name": "@osmium/manager",\ "reference": "workspace:manager"\ },\ {\ @@ -36,15 +36,19 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { "reference": "workspace:packages/prettier-config"\ },\ {\ - "name": "osmium-solidity-toolchain",\ + "name": "@osmium-toolchains/solidity",\ "reference": "workspace:toolchains/solidity"\ },\ {\ - "name": "osmium-solidity-linter",\ + "name": "@osmium/solidity-linter",\ "reference": "workspace:toolchains/solidity/linter"\ },\ {\ - "name": "osmium-solidity-lsp",\ + "name": "@osmium/solidity-linter-core",\ + "reference": "workspace:toolchains/solidity/linter/core"\ + },\ + {\ + "name": "@osmium/solidity-lsp",\ "reference": "workspace:toolchains/solidity/lsp"\ }\ ],\ @@ -55,11 +59,12 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { ["@osmium-libs/lsp-launcher", ["workspace:libs/lsp-launcher"]],\ ["@osmium-packages/eslint-config", ["workspace:packages/eslint-config"]],\ ["@osmium-packages/prettier-config", ["workspace:packages/prettier-config"]],\ - ["osmium", ["workspace:."]],\ - ["osmium-manager", ["workspace:manager"]],\ - ["osmium-solidity-linter", ["workspace:toolchains/solidity/linter"]],\ - ["osmium-solidity-lsp", ["workspace:toolchains/solidity/lsp"]],\ - ["osmium-solidity-toolchain", ["workspace:toolchains/solidity"]]\ + ["@osmium-toolchains/solidity", ["workspace:toolchains/solidity"]],\ + ["@osmium/manager", ["workspace:manager"]],\ + ["@osmium/solidity-linter", ["workspace:toolchains/solidity/linter"]],\ + ["@osmium/solidity-linter-core", ["workspace:toolchains/solidity/linter/core"]],\ + ["@osmium/solidity-lsp", ["workspace:toolchains/solidity/lsp"]],\ + ["osmium", ["workspace:."]]\ ],\ "fallbackPool": [\ ],\ @@ -240,6 +245,51 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { "linkType": "SOFT"\ }]\ ]],\ + ["@osmium-toolchains/solidity", [\ + ["workspace:toolchains/solidity", {\ + "packageLocation": "./toolchains/solidity/",\ + "packageDependencies": [\ + ["@osmium-toolchains/solidity", "workspace:toolchains/solidity"]\ + ],\ + "linkType": "SOFT"\ + }]\ + ]],\ + ["@osmium/manager", [\ + ["workspace:manager", {\ + "packageLocation": "./manager/",\ + "packageDependencies": [\ + ["@osmium/manager", "workspace:manager"]\ + ],\ + "linkType": "SOFT"\ + }]\ + ]],\ + ["@osmium/solidity-linter", [\ + ["workspace:toolchains/solidity/linter", {\ + "packageLocation": "./toolchains/solidity/linter/",\ + "packageDependencies": [\ + ["@osmium/solidity-linter", "workspace:toolchains/solidity/linter"]\ + ],\ + "linkType": "SOFT"\ + }]\ + ]],\ + ["@osmium/solidity-linter-core", [\ + ["workspace:toolchains/solidity/linter/core", {\ + "packageLocation": "./toolchains/solidity/linter/core/",\ + "packageDependencies": [\ + ["@osmium/solidity-linter-core", "workspace:toolchains/solidity/linter/core"]\ + ],\ + "linkType": "SOFT"\ + }]\ + ]],\ + ["@osmium/solidity-lsp", [\ + ["workspace:toolchains/solidity/lsp", {\ + "packageLocation": "./toolchains/solidity/lsp/",\ + "packageDependencies": [\ + ["@osmium/solidity-lsp", "workspace:toolchains/solidity/lsp"]\ + ],\ + "linkType": "SOFT"\ + }]\ + ]],\ ["acorn", [\ ["npm:8.10.0", {\ "packageLocation": "./.yarn/cache/acorn-npm-8.10.0-2230c9e83e-538ba38af0.zip/node_modules/acorn/",\ @@ -915,42 +965,6 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { "linkType": "SOFT"\ }]\ ]],\ - ["osmium-manager", [\ - ["workspace:manager", {\ - "packageLocation": "./manager/",\ - "packageDependencies": [\ - ["osmium-manager", "workspace:manager"]\ - ],\ - "linkType": "SOFT"\ - }]\ - ]],\ - ["osmium-solidity-linter", [\ - ["workspace:toolchains/solidity/linter", {\ - "packageLocation": "./toolchains/solidity/linter/",\ - "packageDependencies": [\ - ["osmium-solidity-linter", "workspace:toolchains/solidity/linter"]\ - ],\ - "linkType": "SOFT"\ - }]\ - ]],\ - ["osmium-solidity-lsp", [\ - ["workspace:toolchains/solidity/lsp", {\ - "packageLocation": "./toolchains/solidity/lsp/",\ - "packageDependencies": [\ - ["osmium-solidity-lsp", "workspace:toolchains/solidity/lsp"]\ - ],\ - "linkType": "SOFT"\ - }]\ - ]],\ - ["osmium-solidity-toolchain", [\ - ["workspace:toolchains/solidity", {\ - "packageLocation": "./toolchains/solidity/",\ - "packageDependencies": [\ - ["osmium-solidity-toolchain", "workspace:toolchains/solidity"]\ - ],\ - "linkType": "SOFT"\ - }]\ - ]],\ ["p-limit", [\ ["npm:3.1.0", {\ "packageLocation": "./.yarn/cache/p-limit-npm-3.1.0-05d2ede37f-7c3690c4db.zip/node_modules/p-limit/",\ diff --git a/yarn.lock b/yarn.lock index bccdce78..86f581f8 100644 --- a/yarn.lock +++ b/yarn.lock @@ -134,6 +134,36 @@ __metadata: languageName: unknown linkType: soft +"@osmium-toolchains/solidity@workspace:toolchains/solidity": + version: 0.0.0-use.local + resolution: "@osmium-toolchains/solidity@workspace:toolchains/solidity" + languageName: unknown + linkType: soft + +"@osmium/manager@workspace:manager": + version: 0.0.0-use.local + resolution: "@osmium/manager@workspace:manager" + languageName: unknown + linkType: soft + +"@osmium/solidity-linter-core@workspace:toolchains/solidity/linter/core": + version: 0.0.0-use.local + resolution: "@osmium/solidity-linter-core@workspace:toolchains/solidity/linter/core" + languageName: unknown + linkType: soft + +"@osmium/solidity-linter@workspace:toolchains/solidity/linter": + version: 0.0.0-use.local + resolution: "@osmium/solidity-linter@workspace:toolchains/solidity/linter" + languageName: unknown + linkType: soft + +"@osmium/solidity-lsp@workspace:toolchains/solidity/lsp": + version: 0.0.0-use.local + resolution: "@osmium/solidity-lsp@workspace:toolchains/solidity/lsp" + languageName: unknown + linkType: soft + "acorn-jsx@npm:^5.3.2": version: 5.3.2 resolution: "acorn-jsx@npm:5.3.2" @@ -693,30 +723,6 @@ __metadata: languageName: node linkType: hard -"osmium-manager@workspace:manager": - version: 0.0.0-use.local - resolution: "osmium-manager@workspace:manager" - languageName: unknown - linkType: soft - -"osmium-solidity-linter@workspace:toolchains/solidity/linter": - version: 0.0.0-use.local - resolution: "osmium-solidity-linter@workspace:toolchains/solidity/linter" - languageName: unknown - linkType: soft - -"osmium-solidity-lsp@workspace:toolchains/solidity/lsp": - version: 0.0.0-use.local - resolution: "osmium-solidity-lsp@workspace:toolchains/solidity/lsp" - languageName: unknown - linkType: soft - -"osmium-solidity-toolchain@workspace:toolchains/solidity": - version: 0.0.0-use.local - resolution: "osmium-solidity-toolchain@workspace:toolchains/solidity" - languageName: unknown - linkType: soft - "osmium@workspace:.": version: 0.0.0-use.local resolution: "osmium@workspace:." From 01c444162695631ee1027ec4a7b7b7c210d7c8c3 Mon Sep 17 00:00:00 2001 From: 0xMemoryGrinder <35138272+0xMemoryGrinder@users.noreply.github.com> Date: Wed, 13 Sep 2023 00:59:10 -0400 Subject: [PATCH 030/325] refactor(libs/ast-extractor): fixed linting errors --- libs/ast-extractor/src/retriever/enum.rs | 5 +---- libs/ast-extractor/src/retriever/error.rs | 5 +---- libs/ast-extractor/src/retriever/event.rs | 5 +---- libs/ast-extractor/src/retriever/struct.rs | 5 +---- libs/ast-extractor/src/retriever/udt.rs | 1 - 5 files changed, 4 insertions(+), 17 deletions(-) diff --git a/libs/ast-extractor/src/retriever/enum.rs b/libs/ast-extractor/src/retriever/enum.rs index d937631a..484a61b4 100644 --- a/libs/ast-extractor/src/retriever/enum.rs +++ b/libs/ast-extractor/src/retriever/enum.rs @@ -93,10 +93,7 @@ mod tests { let contract = ast .items .iter() - .find(|i| match i { - Item::Contract(_) => true, - _ => false, - }) + .find(|i| matches!(i, Item::Contract(_))) .unwrap() .clone(); diff --git a/libs/ast-extractor/src/retriever/error.rs b/libs/ast-extractor/src/retriever/error.rs index 9f44472c..4ebc0605 100644 --- a/libs/ast-extractor/src/retriever/error.rs +++ b/libs/ast-extractor/src/retriever/error.rs @@ -71,10 +71,7 @@ mod tests { let item = ast .items .iter() - .find(|i| match i { - Item::Contract(_) => true, - _ => false, - }) + .find(|i| matches!(i, Item::Contract(_))) .unwrap() .clone(); diff --git a/libs/ast-extractor/src/retriever/event.rs b/libs/ast-extractor/src/retriever/event.rs index 66db366b..c2642e4a 100644 --- a/libs/ast-extractor/src/retriever/event.rs +++ b/libs/ast-extractor/src/retriever/event.rs @@ -94,10 +94,7 @@ mod tests { let item = ast .items .iter() - .find(|i| match i { - Item::Contract(_) => true, - _ => false, - }) + .find(|i| matches!(i, Item::Contract(_))) .unwrap() .clone(); diff --git a/libs/ast-extractor/src/retriever/struct.rs b/libs/ast-extractor/src/retriever/struct.rs index 0fc3407f..1c59b6ae 100644 --- a/libs/ast-extractor/src/retriever/struct.rs +++ b/libs/ast-extractor/src/retriever/struct.rs @@ -92,10 +92,7 @@ mod tests { let item = ast .items .iter() - .find(|i| match i { - Item::Contract(_) => true, - _ => false, - }) + .find(|i| matches!(i, Item::Contract(_))) .unwrap() .clone(); diff --git a/libs/ast-extractor/src/retriever/udt.rs b/libs/ast-extractor/src/retriever/udt.rs index 7709e0a6..7c633064 100644 --- a/libs/ast-extractor/src/retriever/udt.rs +++ b/libs/ast-extractor/src/retriever/udt.rs @@ -31,7 +31,6 @@ pub fn retrieve_udts_nodes(ast: syn_solidity::File) -> Vec { #[cfg(test)] mod tests { use proc_macro2::TokenStream; - use syn_solidity::Item; use super::*; use std::fs; From fe3771bfeee2aff81c136ad7f59d5f95330d33d4 Mon Sep 17 00:00:00 2001 From: Astrodevs CI Date: Wed, 30 Aug 2023 19:53:23 +0000 Subject: [PATCH 031/325] chore: create branch feature/49-solidity-linter-staging --- remove-me-34219c48b31d404ab611.txt | 1 + 1 file changed, 1 insertion(+) create mode 100644 remove-me-34219c48b31d404ab611.txt diff --git a/remove-me-34219c48b31d404ab611.txt b/remove-me-34219c48b31d404ab611.txt new file mode 100644 index 00000000..78564588 --- /dev/null +++ b/remove-me-34219c48b31d404ab611.txt @@ -0,0 +1 @@ +34219c48b31d404ab611 From d795be7e091f980879305bbf0d5a830829c7a2f2 Mon Sep 17 00:00:00 2001 From: Astrodevs CI Date: Wed, 30 Aug 2023 19:53:37 +0000 Subject: [PATCH 032/325] chore: create branch feature/49-solidity-linter/75-refactor-solidhunter-staging --- remove-me-ca154a86e5b94f5db084.txt | 1 + 1 file changed, 1 insertion(+) create mode 100644 remove-me-ca154a86e5b94f5db084.txt diff --git a/remove-me-ca154a86e5b94f5db084.txt b/remove-me-ca154a86e5b94f5db084.txt new file mode 100644 index 00000000..d92993f9 --- /dev/null +++ b/remove-me-ca154a86e5b94f5db084.txt @@ -0,0 +1 @@ +ca154a86e5b94f5db084 From e260003b74e21c2e84a0a113e19adcc9cda25821 Mon Sep 17 00:00:00 2001 From: 0xtekgrinder <0xtekgrinder@protonmail.com> Date: Mon, 4 Sep 2023 19:15:39 +0200 Subject: [PATCH 033/325] refactor: fix all lint errors and a few compiler warnings --- toolchains/solidity/linter/core/solidhunter-lib/src/lib.rs | 2 +- .../solidity/linter/core/solidhunter-lib/src/linter.rs | 2 +- .../solidhunter-lib/src/rules/naming/use_forbidden_name.rs | 6 +++--- .../core/solidhunter-lib/src/rules/order/import_on_top.rs | 2 +- .../linter/core/solidhunter-lib/src/rules/rule_impl.rs | 1 + .../solidity/linter/core/solidhunter-lib/src/types.rs | 1 - toolchains/solidity/linter/core/src/main.rs | 2 +- 7 files changed, 8 insertions(+), 8 deletions(-) diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/lib.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/lib.rs index a0791e93..f76099ce 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/lib.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/lib.rs @@ -1,4 +1,4 @@ -use crate::types::{Range}; +use crate::types::Range; use solc_wrapper::ast::ast::{CodeLocation, offset_from_location}; pub mod linter; diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/linter.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/linter.rs index 172c2117..ae939ef3 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/linter.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/linter.rs @@ -79,7 +79,7 @@ impl SolidLinter { pub fn parse_file(&mut self, filepath: String) -> LintResult{ let res = Solc::default().extract_ast_file(filepath.clone()); - + if res.is_err() { println!("{:?}", res); return Err(LintError::SolcError(res.err().unwrap())); diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/use_forbidden_name.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/use_forbidden_name.rs index d5563848..367ee0c2 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/use_forbidden_name.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/use_forbidden_name.rs @@ -41,8 +41,8 @@ impl RuleType for UseForbiddenName { res } - -} + +} impl UseForbiddenName { @@ -54,7 +54,7 @@ impl UseForbiddenName { }; Box::new(rule) } - + pub(crate) fn create_default() -> RuleEntry { RuleEntry { id: UseForbiddenName::RULE_ID.to_string(), diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/order/import_on_top.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/order/import_on_top.rs index 79b878e7..53763bd4 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/order/import_on_top.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/order/import_on_top.rs @@ -30,7 +30,7 @@ impl RuleType for ImportOnTop { SourceUnitChildNodes::ImportDirective(import) => { if i > last_import_location { let location = decode_location(&import.src, &file.content); - + res.push(LintDiag { range: Range { start: Position { line: location.0.line as u64, character: location.0.column as u64 }, diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/rule_impl.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/rule_impl.rs index 5ea5fa82..b34b2396 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/rule_impl.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/rule_impl.rs @@ -3,6 +3,7 @@ use crate::rules::types::*; /* // Untested +/* fn merge_rules(rules: &mut Vec, new_rules: &Vec) { let mut new_rules_map = HashMap::new(); for rule in new_rules { diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/types.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/types.rs index 7ad3fa87..e9fffcbe 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/types.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/types.rs @@ -74,7 +74,6 @@ pub struct Range { pub length: u64, } - #[derive(Clone, Serialize, Deserialize, Debug)] pub enum NumberOrString { Number(i32), diff --git a/toolchains/solidity/linter/core/src/main.rs b/toolchains/solidity/linter/core/src/main.rs index 90ffbfe3..8e71c76b 100644 --- a/toolchains/solidity/linter/core/src/main.rs +++ b/toolchains/solidity/linter/core/src/main.rs @@ -82,7 +82,7 @@ fn print_diag(diag: &solidhunter_lib::types::LintDiag) { } else if diag.range.start.line > 9 { padding = " ".to_string(); } else { - padding = " ".repeat(2).to_string(); + padding = " ".repeat(2); } let line = diag .source_file_content From f7389383c91f983d59f811d690c434660c6a6200 Mon Sep 17 00:00:00 2001 From: leon Date: Thu, 7 Sep 2023 19:02:54 +0200 Subject: [PATCH 034/325] refactor: rename LintError to SolidHunterError --- .../linter/core/solidhunter-lib/src/linter.rs | 41 +++++++++++-------- .../linter/core/solidhunter-lib/src/types.rs | 24 +++++------ 2 files changed, 35 insertions(+), 30 deletions(-) diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/linter.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/linter.rs index ae939ef3..91bc184c 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/linter.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/linter.rs @@ -1,8 +1,8 @@ -use std::fs; -use crate::types::*; -use crate::rules::types::*; use crate::rules::factory::RuleFactory; use crate::rules::rule_impl::{create_rules_file, parse_rules}; +use crate::rules::types::*; +use crate::types::*; +use std::fs; use glob::glob; use solc_wrapper::{Solc, SourceUnit}; @@ -16,12 +16,11 @@ pub struct SolidFile { pub struct SolidLinter { files: Vec, rule_factory: RuleFactory, - rules : Vec>, + rules: Vec>, } impl SolidLinter { - fn _create_rules(&mut self, rules_config:& String, _first: bool) - { + fn _create_rules(&mut self, rules_config: &String, _first: bool) { let res = parse_rules(rules_config.as_str()); match res { Ok(rules) => { @@ -37,8 +36,7 @@ impl SolidLinter { } } } - pub fn initalize(&mut self, rules_config: &String) - { + pub fn initalize(&mut self, rules_config: &String) { self.rule_factory.register_rules(); self._create_rules(&rules_config, true); } @@ -77,20 +75,25 @@ impl SolidLinter { self.files.push(file); } - pub fn parse_file(&mut self, filepath: String) -> LintResult{ + pub fn parse_file(&mut self, filepath: String) -> LintResult { let res = Solc::default().extract_ast_file(filepath.clone()); if res.is_err() { println!("{:?}", res); - return Err(LintError::SolcError(res.err().unwrap())); + return Err(SolidHunterError::SolcError(res.err().unwrap())); } if self.file_exists(filepath.as_str()) { self.update_file_ast(filepath.as_str(), res.expect("ast not found")); } else { - let content = fs::read_to_string(filepath.clone()).map_err(|e| LintError::IoError(e))?; - self.add_file(filepath.as_str(), res.expect("ast not found"), content.as_str()); + let content = + fs::read_to_string(filepath.clone()).map_err(|e| SolidHunterError::IoError(e))?; + self.add_file( + filepath.as_str(), + res.expect("ast not found"), + content.as_str(), + ); } - let mut res : Vec = Vec::new(); + let mut res: Vec = Vec::new(); for rule in &self.rules { let mut diags = rule.diagnose(&self.files[0], &self.files); @@ -99,21 +102,25 @@ impl SolidLinter { Ok(res) } - pub fn parse_content(&mut self, filepath: String, content : &String) -> LintResult { + pub fn parse_content(&mut self, filepath: String, content: &String) -> LintResult { let res = Solc::default().extract_ast_content(content.to_string()); if res.is_err() { println!("{:?}", res); - return Err(LintError::SolcError(res.err().unwrap())); + return Err(SolidHunterError::SolcError(res.err().unwrap())); } if self.file_exists(filepath.as_str()) { self.update_file_ast(filepath.as_str(), res.expect("ast not found")); } else { - self.add_file(filepath.as_str(), res.expect("ast not found"), content.as_str()); + self.add_file( + filepath.as_str(), + res.expect("ast not found"), + content.as_str(), + ); } - let mut res : Vec = Vec::new(); + let mut res: Vec = Vec::new(); for rule in &self.rules { let mut diags = rule.diagnose(&self.files[0], &self.files); diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/types.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/types.rs index e9fffcbe..d311f656 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/types.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/types.rs @@ -1,22 +1,22 @@ -use serde::{Serialize, Deserialize}; +use serde::{Deserialize, Serialize}; use thiserror::Error; #[derive(Error, Debug)] -pub enum LintError { - #[error("LintError: Solc error occured")] +pub enum SolidHunterError { + // Linter errors + #[error("SolidHunterError: Solc error occured")] SolcError(#[from] solc_wrapper::SolcError), - #[error("LintError: Something went wrong with the file")] + #[error("SolidHunterError: Something went wrong with the file")] IoError(#[from] std::io::Error), - #[error("LintError: Something went wrong")] + #[error("SolidHunterError: Something went wrong")] LinterError(String), + // } - -pub type LintResult = Result, LintError>; +pub type LintResult = Result, SolidHunterError>; #[derive(Clone, Serialize, Deserialize, Debug)] pub struct LintDiag { - /// The range at which the message applies. pub range: Range, @@ -29,7 +29,6 @@ pub struct LintDiag { /// The diagnostic's code. Can be omitted. pub code: Option, - #[serde(skip_serializing_if = "Option::is_none")] /// A human-readable string describing the source of this /// diagnostic, e.g. 'typescript' or 'super lint'. @@ -40,11 +39,10 @@ pub struct LintDiag { pub uri: Uri, - #[serde(rename="sourceFileContent")] - pub source_file_content: String + #[serde(rename = "sourceFileContent")] + pub source_file_content: String, } - //////////////////////////////////////////////////////////// /////////////////// RELATED TYPES: ///////////////////////// //////////////////////////////////////////////////////////// @@ -64,7 +62,7 @@ pub enum Severity { /// Reports an information. INFO = 3, /// Reports a hint. - HINT = 4 + HINT = 4, } #[derive(Clone, Serialize, Deserialize, Debug)] From 7f3438b5093f59143ab33fb06f7c8ff4d57ea904 Mon Sep 17 00:00:00 2001 From: leon Date: Thu, 7 Sep 2023 19:13:03 +0200 Subject: [PATCH 035/325] refactor: rename and move errors --- .../linter/core/solidhunter-lib/src/linter.rs | 4 ++-- .../core/solidhunter-lib/src/rules/rule_impl.rs | 12 +++++++----- .../core/solidhunter-lib/src/rules/types.rs | 16 ++++------------ .../linter/core/solidhunter-lib/src/types.rs | 9 +++++++-- 4 files changed, 20 insertions(+), 21 deletions(-) diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/linter.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/linter.rs index 91bc184c..6cc2a3f9 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/linter.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/linter.rs @@ -85,8 +85,8 @@ impl SolidLinter { if self.file_exists(filepath.as_str()) { self.update_file_ast(filepath.as_str(), res.expect("ast not found")); } else { - let content = - fs::read_to_string(filepath.clone()).map_err(|e| SolidHunterError::IoError(e))?; + let content = fs::read_to_string(filepath.clone()) + .map_err(|e| SolidHunterError::ParsingError(e))?; self.add_file( filepath.as_str(), res.expect("ast not found"), diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/rule_impl.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/rule_impl.rs index b34b2396..caedf3b2 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/rule_impl.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/rule_impl.rs @@ -1,7 +1,7 @@ use crate::rules::create_default_rules; use crate::rules::types::*; +use crate::types::*; -/* // Untested /* fn merge_rules(rules: &mut Vec, new_rules: &Vec) { @@ -31,7 +31,7 @@ pub fn create_rules_file(path: &str) { std::fs::write(path, serialized).unwrap(); } -type RulesResult = Result; +type RulesResult = Result; pub fn parse_rules(path: &str) -> RulesResult { /*let mut rules = Rules { @@ -42,7 +42,10 @@ pub fn parse_rules(path: &str) -> RulesResult { };*/ if !std::path::Path::new(&path).is_file() { - return Err(RulesError::IoError(std::io::Error::new(std::io::ErrorKind::NotFound, "Rules file not found"))); + return Err(SolidHunterError::IoError(std::io::Error::new( + std::io::ErrorKind::NotFound, + "Rules file not found", + ))); } let file = std::fs::read_to_string(path).unwrap(); let parsed: Rules = serde_json::from_str(&file).unwrap(); @@ -61,7 +64,6 @@ pub fn parse_rules(path: &str) -> RulesResult { Ok(parsed) } - // create rules /* #[macro_export] @@ -85,4 +87,4 @@ macro_rules! create_rule { } } }; -}*/ \ No newline at end of file +}*/ diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/types.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/types.rs index fec52ecf..722e547f 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/types.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/types.rs @@ -1,11 +1,9 @@ -use serde::{Serialize, Deserialize}; use crate::linter::SolidFile; use crate::types::*; - +use serde::{Deserialize, Serialize}; #[derive(Serialize, Deserialize, Debug)] -pub struct RuleEntry -{ +pub struct RuleEntry { pub id: String, pub severity: Severity, pub data: Vec, @@ -16,15 +14,9 @@ pub struct Rules { pub name: String, pub includes: Vec, pub plugins: Vec, - pub rules: Vec -} - -#[derive(Debug)] -pub enum RulesError { - IoError(std::io::Error), + pub rules: Vec, } pub trait RuleType: Send + Sync + 'static { - fn diagnose(&self, file: &SolidFile, files: &Vec) -> Vec; -} \ No newline at end of file +} diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/types.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/types.rs index d311f656..c17dacb3 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/types.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/types.rs @@ -6,11 +6,16 @@ pub enum SolidHunterError { // Linter errors #[error("SolidHunterError: Solc error occured")] SolcError(#[from] solc_wrapper::SolcError), - #[error("SolidHunterError: Something went wrong with the file")] - IoError(#[from] std::io::Error), + #[error("SolidHunterError: Something went wrong with the file during parsing")] + ParsingError(#[from] std::io::Error), #[error("SolidHunterError: Something went wrong")] LinterError(String), // + + // RulesError + #[error("SolidHunterError: IO error occured with Rules")] + IoError(std::io::Error), + // } pub type LintResult = Result, SolidHunterError>; From 864cd347e7eb9006765d2f19aba76981bb97d09f Mon Sep 17 00:00:00 2001 From: 0xtekgrinder <0xtekgrinder@protonmail.com> Date: Wed, 6 Sep 2023 22:51:31 +0200 Subject: [PATCH 036/325] refactor(solidhunter): clean linter.rs --- .../linter/core/solc-wrapper/src/lib.rs | 1 - .../linter/core/solidhunter-lib/src/linter.rs | 68 ++++++++++--------- toolchains/solidity/linter/core/src/main.rs | 6 +- 3 files changed, 37 insertions(+), 38 deletions(-) diff --git a/toolchains/solidity/linter/core/solc-wrapper/src/lib.rs b/toolchains/solidity/linter/core/solc-wrapper/src/lib.rs index 320924d0..451ecf6b 100644 --- a/toolchains/solidity/linter/core/solc-wrapper/src/lib.rs +++ b/toolchains/solidity/linter/core/solc-wrapper/src/lib.rs @@ -15,7 +15,6 @@ pub use error::SolcError; use crate::solc::parsing_error::ParsingError; use crate::utils::{get_error_location, get_error_message}; - pub enum ExecuteResult { Ast(String), ParsingError(ParsingError), diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/linter.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/linter.rs index 6cc2a3f9..8ff681ac 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/linter.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/linter.rs @@ -19,8 +19,30 @@ pub struct SolidLinter { rules: Vec>, } +impl Default for SolidLinter { + + fn default() -> Self + { + let linter = SolidLinter::new(&String::new()); + linter + } +} + impl SolidLinter { - fn _create_rules(&mut self, rules_config: &String, _first: bool) { + + pub fn new(rules_config: &String) -> Self { + let mut linter = SolidLinter { + files: Vec::new(), + rule_factory: RuleFactory::new(), + rules: Vec::new(), + }; + linter.rule_factory.register_rules(); + linter._create_rules(&rules_config, true); + return linter; + } + + fn _create_rules(&mut self, rules_config: &String, first: bool) + { let res = parse_rules(rules_config.as_str()); match res { Ok(rules) => { @@ -30,26 +52,14 @@ impl SolidLinter { } Err(_) => { create_rules_file(rules_config.as_str()); - if _first { + if first { self._create_rules(rules_config, false); } } } } - pub fn initalize(&mut self, rules_config: &String) { - self.rule_factory.register_rules(); - self._create_rules(&rules_config, true); - } - pub fn new() -> SolidLinter { - let linter : SolidLinter = SolidLinter { - files: Vec::new(), - rule_factory: RuleFactory::new(), - rules: Vec::new(), - }; - return linter; - } - fn file_exists(&self, path: &str) -> bool { + fn _file_exists(&self, path: &str) -> bool { for file in &self.files { if file.path == path { return true; @@ -58,7 +68,7 @@ impl SolidLinter { false } - fn update_file_ast(&mut self, path: &str, ast: SourceUnit) { + fn _update_file_ast(&mut self, path: &str, ast: SourceUnit) { for file in &mut self.files { if file.path == path { file.data = ast.clone(); @@ -66,7 +76,7 @@ impl SolidLinter { } } - fn add_file(&mut self, path: &str, ast: SourceUnit, content: &str) { + fn _add_file(&mut self, path: &str, ast: SourceUnit, content: &str) { let file = SolidFile { data: ast, path: String::from(path), @@ -82,16 +92,11 @@ impl SolidLinter { println!("{:?}", res); return Err(SolidHunterError::SolcError(res.err().unwrap())); } - if self.file_exists(filepath.as_str()) { - self.update_file_ast(filepath.as_str(), res.expect("ast not found")); + if self._file_exists(filepath.as_str()) { + self._update_file_ast(filepath.as_str(), res.expect("ast not found")); } else { - let content = fs::read_to_string(filepath.clone()) - .map_err(|e| SolidHunterError::ParsingError(e))?; - self.add_file( - filepath.as_str(), - res.expect("ast not found"), - content.as_str(), - ); + let content = fs::read_to_string(filepath.clone()).map_err(|e| LintError::IoError(e))?; + self._add_file(filepath.as_str(), res.expect("ast not found"), content.as_str()); } let mut res: Vec = Vec::new(); @@ -110,14 +115,10 @@ impl SolidLinter { return Err(SolidHunterError::SolcError(res.err().unwrap())); } - if self.file_exists(filepath.as_str()) { - self.update_file_ast(filepath.as_str(), res.expect("ast not found")); + if self._file_exists(filepath.as_str()) { + self._update_file_ast(filepath.as_str(), res.expect("ast not found")); } else { - self.add_file( - filepath.as_str(), - res.expect("ast not found"), - content.as_str(), - ); + self._add_file(filepath.as_str(), res.expect("ast not found"), content.as_str()); } let mut res: Vec = Vec::new(); @@ -140,6 +141,7 @@ impl SolidLinter { } result } + pub fn delete_file(&mut self, path: String) { loop { let idx = self.files.iter().position(|x| x.path == path); diff --git a/toolchains/solidity/linter/core/src/main.rs b/toolchains/solidity/linter/core/src/main.rs index 8e71c76b..81eab428 100644 --- a/toolchains/solidity/linter/core/src/main.rs +++ b/toolchains/solidity/linter/core/src/main.rs @@ -106,8 +106,7 @@ fn print_diag(diag: &solidhunter_lib::types::LintDiag) { } fn lint_folder(args: Args) { - let mut linter: SolidLinter = SolidLinter::new(); - linter.initalize(&args.rules_file); + let mut linter: SolidLinter = SolidLinter::new(&args.rules_file); let mut result = Vec::new(); for path in args.project_path { result.append(&mut linter.parse_folder(path)); @@ -158,8 +157,7 @@ fn main() { if !args.to_json && args.file_to_lint.is_empty() { lint_folder(args); } else if !args.file_to_lint.is_empty() { - let mut linter: SolidLinter = SolidLinter::new(); - linter.initalize(&args.rules_file); + let mut linter: SolidLinter = SolidLinter::new(&args.rules_file); let result = linter.parse_file(args.file_to_lint); if !args.to_json { From 97dfb1459ef5a2519f12826bd17fc62207e63729 Mon Sep 17 00:00:00 2001 From: 0xtekgrinder <0xtekgrinder@protonmail.com> Date: Thu, 7 Sep 2023 19:35:12 +0200 Subject: [PATCH 037/325] refactor(solidhunter): refactor LintDiag and a few other things --- toolchains/solidity/linter/core/Cargo.toml | 2 - .../linter/core/solidhunter-lib/Cargo.toml | 2 - .../linter/core/solidhunter-lib/src/lib.rs | 12 ----- .../best_practises/function_max_lines.rs | 4 +- .../core/solidhunter-lib/src/rules/factory.rs | 4 +- .../linter/core/solidhunter-lib/src/types.rs | 35 +++++++++++++ toolchains/solidity/linter/core/src/main.rs | 50 ++----------------- 7 files changed, 42 insertions(+), 67 deletions(-) diff --git a/toolchains/solidity/linter/core/Cargo.toml b/toolchains/solidity/linter/core/Cargo.toml index 89fee01d..468a65a1 100644 --- a/toolchains/solidity/linter/core/Cargo.toml +++ b/toolchains/solidity/linter/core/Cargo.toml @@ -5,8 +5,6 @@ edition = "2021" authors = ["Astrodevs Labs"] license = "GPL-3.0-or-later" -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html - [dependencies] clap = { version = "4.0.29", features = ["derive"] } colored = "2" diff --git a/toolchains/solidity/linter/core/solidhunter-lib/Cargo.toml b/toolchains/solidity/linter/core/solidhunter-lib/Cargo.toml index 3e4aa694..e128998e 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/Cargo.toml +++ b/toolchains/solidity/linter/core/solidhunter-lib/Cargo.toml @@ -5,8 +5,6 @@ edition = "2021" authors = ["Astrodevs Labs"] license = "GPL-3.0-or-later" -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html - [dependencies] clap = { version = "4.0.29", features = ["derive"] } colored = "2" diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/lib.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/lib.rs index f76099ce..aa12c366 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/lib.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/lib.rs @@ -1,19 +1,7 @@ -use crate::types::Range; -use solc_wrapper::ast::ast::{CodeLocation, offset_from_location}; - pub mod linter; pub mod types; pub mod rules; -pub fn offset_from_range(content: &str, range: &Range) -> usize { - let loc = CodeLocation { - line: range.start.line as usize, - column: range.start.character as usize, - length: range.length as usize, - }; - offset_from_location(content, &loc) -} - #[cfg(test)] mod tests { use super::*; diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/function_max_lines.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/function_max_lines.rs index bd122394..0b9cdc24 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/function_max_lines.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/function_max_lines.rs @@ -117,13 +117,13 @@ impl FunctionMaxLines { }; Box::new(rule) } - + pub fn create_default() -> RuleEntry { RuleEntry { id: FunctionMaxLines::RULE_ID.to_string(), severity: Severity::WARNING, data: vec![DEFAULT_MAX_LINES.to_string()] - + } } } diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/factory.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/factory.rs index 5c060655..90962a44 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/factory.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/factory.rs @@ -14,12 +14,12 @@ impl RuleFactory { _rules: Vec::new(), } } - + pub fn register_rules(&mut self) { self._buildables = create_rules() } - + pub fn create_rule(&self, rule: RuleEntry) -> Box { let rule_type = self._buildables.get(&rule.id); diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/types.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/types.rs index c17dacb3..0660e8d3 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/types.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/types.rs @@ -1,5 +1,7 @@ use serde::{Deserialize, Serialize}; use thiserror::Error; +use std::fmt; +use colored::Colorize; #[derive(Error, Debug)] pub enum SolidHunterError { @@ -48,6 +50,39 @@ pub struct LintDiag { pub source_file_content: String, } +fn severity_to_string(severity: Option) -> String { + match severity { + Some(Severity::ERROR) => "error".to_string().red(), + Some(Severity::WARNING) => "warning".to_string().yellow(), + Some(Severity::INFO) => "info".to_string().blue(), + Some(Severity::HINT) => "hint".to_string().green(), + _ => "error".to_string().red(), + } + .to_string() +} + +impl fmt::Display for LintDiag { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + let padding: String; + if self.range.start.line > 99 { + padding = " ".repeat(0); + } else if self.range.start.line > 9 { + padding = " ".to_string(); + } else { + padding = " ".repeat(2); + } + let line = self + .source_file_content + .lines() + .nth((self.range.start.line - 1) as usize) + .unwrap(); + + write!(f, "\n{}: {}\n --> {}:{}:{}\n |\n{}{}|{}\n |{}{}", severity_to_string(self.severity), self.message, self.uri, self.range.start.line, self.range.start.character, self.range.start.line, padding, line, " ".repeat(self.range.start.character as usize), + "^".repeat(self.range.length as usize)) + } +} + + //////////////////////////////////////////////////////////// /////////////////// RELATED TYPES: ///////////////////////// //////////////////////////////////////////////////////////// diff --git a/toolchains/solidity/linter/core/src/main.rs b/toolchains/solidity/linter/core/src/main.rs index 81eab428..16cc95ea 100644 --- a/toolchains/solidity/linter/core/src/main.rs +++ b/toolchains/solidity/linter/core/src/main.rs @@ -1,9 +1,6 @@ use clap::Parser; -use colored::Colorize; use solidhunter_lib::linter::SolidLinter; - -use solidhunter_lib::rules::rule_impl::create_rules_file; -use solidhunter_lib::types::Severity; +use solidhunter_lib::rules::rule_impl::{create_rules_file}; #[derive(Parser, Debug)] #[command(author, version, about, long_about = None)] @@ -64,47 +61,6 @@ struct Args { init: bool, } -pub fn severity_to_string(severity: Option) -> String { - match severity { - Some(Severity::ERROR) => "error".to_string().red(), - Some(Severity::WARNING) => "warning".to_string().yellow(), - Some(Severity::INFO) => "info".to_string().blue(), - Some(Severity::HINT) => "hint".to_string().green(), - _ => "error".to_string().red(), - } - .to_string() -} - -fn print_diag(diag: &solidhunter_lib::types::LintDiag) { - let padding: String; - if diag.range.start.line > 99 { - padding = "".to_string(); - } else if diag.range.start.line > 9 { - padding = " ".to_string(); - } else { - padding = " ".repeat(2); - } - let line = diag - .source_file_content - .lines() - .nth((diag.range.start.line - 1) as usize) - .unwrap(); - - println!("\n{}: {}", severity_to_string(diag.severity), diag.message); - println!( - " --> {}:{}:{}", - diag.uri, diag.range.start.line, diag.range.start.character, - ); - println!(" |"); - //TODO: add code to print - println!("{}{}|{}", diag.range.start.line, padding, line); - println!( - " |{}{}", - " ".repeat(diag.range.start.character as usize), - "^".repeat(diag.range.length as usize) - ); -} - fn lint_folder(args: Args) { let mut linter: SolidLinter = SolidLinter::new(&args.rules_file); let mut result = Vec::new(); @@ -115,7 +71,7 @@ fn lint_folder(args: Args) { match res { Ok(diags) => { for diag in diags { - print_diag(&diag); + println!("{}", &diag); } } Err(e) => { @@ -164,7 +120,7 @@ fn main() { match result { Ok(diags) => { for diag in diags { - print_diag(&diag); + println!("{}", &diag); } } Err(e) => { From 9b2df104ae58dde642d00b1c1b9e8ca1e591d934 Mon Sep 17 00:00:00 2001 From: EnergyCube Date: Thu, 7 Sep 2023 19:43:45 +0200 Subject: [PATCH 038/325] refactor: renamed invalid error enum name --- toolchains/solidity/linter/core/solidhunter-lib/src/linter.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/linter.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/linter.rs index 8ff681ac..e6c78f98 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/linter.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/linter.rs @@ -95,7 +95,7 @@ impl SolidLinter { if self._file_exists(filepath.as_str()) { self._update_file_ast(filepath.as_str(), res.expect("ast not found")); } else { - let content = fs::read_to_string(filepath.clone()).map_err(|e| LintError::IoError(e))?; + let content = fs::read_to_string(filepath.clone()).map_err(|e| SolidHunterError::IoError(e))?; self._add_file(filepath.as_str(), res.expect("ast not found"), content.as_str()); } let mut res: Vec = Vec::new(); From 0ffd4888c519ccf37174139b3cc62f2474f14f9b Mon Sep 17 00:00:00 2001 From: 0xtekgrinder <0xtekgrinder@protonmail.com> Date: Thu, 7 Sep 2023 20:01:31 +0200 Subject: [PATCH 039/325] refactor(solidhunter): clean up the Factory and apply a default impl --- .../linter/core/solidhunter-lib/src/linter.rs | 3 +-- .../core/solidhunter-lib/src/rules/factory.rs | 14 +++++++++----- .../core/solidhunter-lib/src/rules/rule_impl.rs | 7 +++---- toolchains/solidity/linter/core/src/main.rs | 2 +- 4 files changed, 14 insertions(+), 12 deletions(-) diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/linter.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/linter.rs index e6c78f98..1a8f1285 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/linter.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/linter.rs @@ -33,10 +33,9 @@ impl SolidLinter { pub fn new(rules_config: &String) -> Self { let mut linter = SolidLinter { files: Vec::new(), - rule_factory: RuleFactory::new(), + rule_factory: RuleFactory::default(), rules: Vec::new(), }; - linter.rule_factory.register_rules(); linter._create_rules(&rules_config, true); return linter; } diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/factory.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/factory.rs index 90962a44..33d9ddcd 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/factory.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/factory.rs @@ -7,6 +7,15 @@ pub struct RuleFactory { _rules : Vec>, } +impl Default for RuleFactory { + fn default() -> Self { + RuleFactory { + _buildables: create_rules(), + _rules: Vec::new(), + } + } +} + impl RuleFactory { pub fn new() -> RuleFactory { RuleFactory { @@ -15,11 +24,6 @@ impl RuleFactory { } } - pub fn register_rules(&mut self) - { - self._buildables = create_rules() - } - pub fn create_rule(&self, rule: RuleEntry) -> Box { let rule_type = self._buildables.get(&rule.id); diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/rule_impl.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/rule_impl.rs index caedf3b2..53aa647e 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/rule_impl.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/rule_impl.rs @@ -31,10 +31,9 @@ pub fn create_rules_file(path: &str) { std::fs::write(path, serialized).unwrap(); } -type RulesResult = Result; - -pub fn parse_rules(path: &str) -> RulesResult { - /*let mut rules = Rules { +pub fn parse_rules(path: &str) -> Result { + /* + let rules = Rules { name: String::new(), includes: Vec::new(), plugins: Vec::new(), diff --git a/toolchains/solidity/linter/core/src/main.rs b/toolchains/solidity/linter/core/src/main.rs index 16cc95ea..92aba6bc 100644 --- a/toolchains/solidity/linter/core/src/main.rs +++ b/toolchains/solidity/linter/core/src/main.rs @@ -1,6 +1,6 @@ use clap::Parser; use solidhunter_lib::linter::SolidLinter; -use solidhunter_lib::rules::rule_impl::{create_rules_file}; +use solidhunter_lib::rules::rule_impl::create_rules_file; #[derive(Parser, Debug)] #[command(author, version, about, long_about = None)] From c6dc87cd21181ffa22052b5947fbf9e69fd44d10 Mon Sep 17 00:00:00 2001 From: EnergyCube Date: Thu, 7 Sep 2023 20:05:19 +0200 Subject: [PATCH 040/325] refactor(solidhunter): SolidHunterError moved to errors.rs & fixed warnings & styled lib --- .../linter/core/solidhunter-lib/src/errors.rs | 16 ++++ .../linter/core/solidhunter-lib/src/lib.rs | 6 +- .../linter/core/solidhunter-lib/src/linter.rs | 24 +++-- .../best_practises/function_max_lines.rs | 43 +++++---- .../src/rules/best_practises/line_maxlen.rs | 27 +++--- .../rules/best_practises/max_states_count.rs | 33 +++---- .../src/rules/best_practises/mod.rs | 17 ++-- .../src/rules/best_practises/reason_string.rs | 87 +++++++++---------- .../core/solidhunter-lib/src/rules/factory.rs | 11 ++- .../src/rules/miscellaneous/mod.rs | 6 +- .../src/rules/miscellaneous/quotes.rs | 27 +++--- .../core/solidhunter-lib/src/rules/mod.rs | 10 +-- .../rules/naming/contract_name_pascalcase.rs | 39 +++++---- .../src/rules/naming/func_name_camelcase.rs | 47 ++++++---- .../rules/naming/func_param_name_camelcase.rs | 50 +++++++---- .../solidhunter-lib/src/rules/naming/mod.rs | 26 ++++-- .../src/rules/naming/use_forbidden_name.rs | 34 ++++---- .../src/rules/order/import_on_top.rs | 24 ++--- .../solidhunter-lib/src/rules/order/mod.rs | 8 +- .../solidhunter-lib/src/rules/rule_impl.rs | 1 - .../linter/core/solidhunter-lib/src/types.rs | 38 ++++---- 21 files changed, 323 insertions(+), 251 deletions(-) create mode 100644 toolchains/solidity/linter/core/solidhunter-lib/src/errors.rs diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/errors.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/errors.rs new file mode 100644 index 00000000..6373641d --- /dev/null +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/errors.rs @@ -0,0 +1,16 @@ +use thiserror::Error; + +#[derive(Error, Debug)] +pub enum SolidHunterError { + // Linter errors + #[error("SolidHunterError: Solc error occured")] + SolcError(#[from] solc_wrapper::SolcError), + #[error("SolidHunterError: Something went wrong with the file during parsing")] + ParsingError(#[from] std::io::Error), + #[error("SolidHunterError: Something went wrong")] + LinterError(String), + + // RulesError + #[error("SolidHunterError: IO error occured with Rules")] + IoError(std::io::Error), +} diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/lib.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/lib.rs index aa12c366..d2ebe5f7 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/lib.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/lib.rs @@ -1,12 +1,12 @@ +pub mod errors; pub mod linter; -pub mod types; pub mod rules; +pub mod types; #[cfg(test)] mod tests { use super::*; #[test] - fn it_works() { - } + fn it_works() {} } diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/linter.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/linter.rs index 1a8f1285..51734a82 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/linter.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/linter.rs @@ -1,3 +1,4 @@ +use crate::errors::SolidHunterError; use crate::rules::factory::RuleFactory; use crate::rules::rule_impl::{create_rules_file, parse_rules}; use crate::rules::types::*; @@ -20,16 +21,13 @@ pub struct SolidLinter { } impl Default for SolidLinter { - - fn default() -> Self - { + fn default() -> Self { let linter = SolidLinter::new(&String::new()); linter } } impl SolidLinter { - pub fn new(rules_config: &String) -> Self { let mut linter = SolidLinter { files: Vec::new(), @@ -40,8 +38,7 @@ impl SolidLinter { return linter; } - fn _create_rules(&mut self, rules_config: &String, first: bool) - { + fn _create_rules(&mut self, rules_config: &String, first: bool) { let res = parse_rules(rules_config.as_str()); match res { Ok(rules) => { @@ -94,8 +91,13 @@ impl SolidLinter { if self._file_exists(filepath.as_str()) { self._update_file_ast(filepath.as_str(), res.expect("ast not found")); } else { - let content = fs::read_to_string(filepath.clone()).map_err(|e| SolidHunterError::IoError(e))?; - self._add_file(filepath.as_str(), res.expect("ast not found"), content.as_str()); + let content = + fs::read_to_string(filepath.clone()).map_err(|e| SolidHunterError::IoError(e))?; + self._add_file( + filepath.as_str(), + res.expect("ast not found"), + content.as_str(), + ); } let mut res: Vec = Vec::new(); @@ -117,7 +119,11 @@ impl SolidLinter { if self._file_exists(filepath.as_str()) { self._update_file_ast(filepath.as_str(), res.expect("ast not found")); } else { - self._add_file(filepath.as_str(), res.expect("ast not found"), content.as_str()); + self._add_file( + filepath.as_str(), + res.expect("ast not found"), + content.as_str(), + ); } let mut res: Vec = Vec::new(); diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/function_max_lines.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/function_max_lines.rs index 0b9cdc24..7a7fcd29 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/function_max_lines.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/function_max_lines.rs @@ -11,11 +11,10 @@ pub const DEFAULT_MAX_LINES: usize = 20; pub struct FunctionMaxLines { number_max_lines: usize, - _data: RuleEntry + _data: RuleEntry, } impl RuleType for FunctionMaxLines { - fn diagnose(&self, _file: &SolidFile, _files: &Vec) -> Vec { let mut res = Vec::new(); @@ -30,7 +29,7 @@ impl RuleType for FunctionMaxLines { source: None, message: DEFAULT_MESSAGE.to_string(), uri: _file.path.clone(), - source_file_content: _file.content.clone() + source_file_content: _file.content.clone(), }); } } @@ -38,17 +37,24 @@ impl RuleType for FunctionMaxLines { } } - // returns a struct containing the line number of the start and end of the function if it is too long -fn check_function_lines(_file: &SolidFile, function: Box, nb_max_line: usize) -> Option { +fn check_function_lines( + _file: &SolidFile, + function: Box, + nb_max_line: usize, +) -> Option { let mut res: Option = None; let function_copy_name_location = &function.src; let (_start, _) = decode_location(function_copy_name_location.as_str(), _file.content.as_str()); - let index = function_copy_name_location.split(":").collect::>()[0].parse::().unwrap(); - let mut function_lines:usize = 0; - let mut left_bracket:usize = 0; - let mut right_bracket:usize = 0; - let mut last_bracket_line:usize = 0; + let index = function_copy_name_location + .split(":") + .collect::>()[0] + .parse::() + .unwrap(); + let mut function_lines: usize = 0; + let mut left_bracket: usize = 0; + let mut right_bracket: usize = 0; + let mut last_bracket_line: usize = 0; for (_, c) in _file.content.chars().enumerate().skip(index) { if c == '{' { @@ -75,13 +81,15 @@ fn check_function_lines(_file: &SolidFile, function: Box, nb line: last_bracket_line as u64, character: 1, }, - length: _file.content.lines().nth(_start.line - 1)?.len() as u64 + length: _file.content.lines().nth(_start.line - 1)?.len() as u64, }); } res } -fn get_all_functions_from_ast(ast_nodes: &Vec) -> Vec> { +fn get_all_functions_from_ast( + ast_nodes: &Vec, +) -> Vec> { let mut res = Vec::new(); for node in ast_nodes { @@ -100,20 +108,18 @@ fn get_all_functions_from_ast(ast_nodes: &Vec) -> Vec Box { let max_number_lines = match data.data[0].parse::() { Ok(v) => v, - Err(_) => DEFAULT_MAX_LINES + Err(_) => DEFAULT_MAX_LINES, }; - let rule = FunctionMaxLines { + let rule = FunctionMaxLines { number_max_lines: max_number_lines, - _data: data + _data: data, }; Box::new(rule) } @@ -122,8 +128,7 @@ impl FunctionMaxLines { RuleEntry { id: FunctionMaxLines::RULE_ID.to_string(), severity: Severity::WARNING, - data: vec![DEFAULT_MAX_LINES.to_string()] - + data: vec![DEFAULT_MAX_LINES.to_string()], } } } diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/line_maxlen.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/line_maxlen.rs index 5b2f35a9..dff8cd56 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/line_maxlen.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/line_maxlen.rs @@ -4,11 +4,10 @@ use crate::types::*; pub struct LineMaxLen { max_len: usize, - data: RuleEntry + data: RuleEntry, } impl RuleType for LineMaxLen { - fn diagnose(&self, file: &SolidFile, _files: &Vec) -> Vec { let mut res = Vec::new(); let mut line_idx = 1; @@ -17,31 +16,35 @@ impl RuleType for LineMaxLen { if line.len() > self.max_len { res.push(LintDiag { range: Range { - start: Position { line: line_idx, character: self.max_len as u64}, - end: Position { line: line_idx, character: line.len() as u64 }, - length: (line.len() - self.max_len) as u64 + start: Position { + line: line_idx, + character: self.max_len as u64, + }, + end: Position { + line: line_idx, + character: line.len() as u64, + }, + length: (line.len() - self.max_len) as u64, }, message: format!("Line is too long: {}", line.len()), severity: Some(self.data.severity), code: None, source: None, uri: file.path.clone(), - source_file_content: file.content.clone() + source_file_content: file.content.clone(), }); } line_idx += 1; } res } - - } impl LineMaxLen { pub(crate) fn create(data: RuleEntry) -> Box { - let rule = LineMaxLen { + let rule = LineMaxLen { max_len: data.data[0].parse::().unwrap(), - data + data, }; Box::new(rule) } @@ -50,7 +53,7 @@ impl LineMaxLen { RuleEntry { id: "line-max-len".to_string(), severity: Severity::WARNING, - data: vec!["80".to_string()] + data: vec!["80".to_string()], } } -} \ No newline at end of file +} diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/max_states_count.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/max_states_count.rs index 76a7a046..bbd424cd 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/max_states_count.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/max_states_count.rs @@ -1,16 +1,14 @@ use crate::linter::SolidFile; -use solc_wrapper::*; use crate::rules::types::*; use crate::types::*; - +use solc_wrapper::*; pub struct MaxStatesCount { max_states: usize, - data: RuleEntry + data: RuleEntry, } impl RuleType for MaxStatesCount { - fn diagnose(&self, file: &SolidFile, _files: &Vec) -> Vec { let mut res = Vec::new(); @@ -20,28 +18,34 @@ impl RuleType for MaxStatesCount { for node in file.data.nodes.iter() { let contract = match node { SourceUnitChildNodes::ContractDefinition(contract) => contract, - _ => continue + _ => continue, }; for node_var in contract.nodes.iter() { let var = match node_var { ContractDefinitionChildNodes::VariableDeclaration(var) => var, - _ => continue + _ => continue, }; count += 1; if count > self.max_states { let location = decode_location(&var.src, &file.content); res.push(LintDiag { range: Range { - start: Position { line: location.0.line as u64, character: location.0.column as u64}, - end: Position { line: location.1.line as u64, character: location.1.column as u64 }, - length: location.0.length as u64 + start: Position { + line: location.0.line as u64, + character: location.0.column as u64, + }, + end: Position { + line: location.1.line as u64, + character: location.1.column as u64, + }, + length: location.0.length as u64, }, message: format!("Too many states: {}", count), severity: Some(self.data.severity), code: None, source: None, uri: file.path.clone(), - source_file_content: file.content.clone() + source_file_content: file.content.clone(), }); } } @@ -51,13 +55,12 @@ impl RuleType for MaxStatesCount { } impl MaxStatesCount { - pub(crate) const RULE_ID: &'static str = "max-states-count"; pub(crate) fn create(data: RuleEntry) -> Box { - let rule = MaxStatesCount { + let rule = MaxStatesCount { max_states: data.data[0].parse::().unwrap(), - data + data, }; Box::new(rule) } @@ -66,7 +69,7 @@ impl MaxStatesCount { RuleEntry { id: MaxStatesCount::RULE_ID.to_string(), severity: Severity::WARNING, - data: vec!["15".to_string()] + data: vec!["15".to_string()], } } -} \ No newline at end of file +} diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/mod.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/mod.rs index 62398701..845683f9 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/mod.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/mod.rs @@ -1,18 +1,18 @@ -use std::collections::HashMap; use crate::rules::types::{RuleEntry, RuleType}; +use std::collections::HashMap; #[macro_use] pub mod line_maxlen; -pub mod max_states_count; pub mod function_max_lines; +pub mod max_states_count; pub mod reason_string; // List all rules +use crate::rules::best_practises::function_max_lines::FunctionMaxLines; use crate::rules::best_practises::line_maxlen::LineMaxLen; use crate::rules::best_practises::max_states_count::MaxStatesCount; use crate::rules::best_practises::reason_string::ReasonString; -use crate::rules::best_practises::function_max_lines::FunctionMaxLines; use crate::rules::RuleBuilder; pub fn create_default_rules() -> Vec { @@ -27,12 +27,15 @@ pub fn create_default_rules() -> Vec { } pub fn create_rules() -> HashMap Box> { - let mut rules : HashMap = HashMap::new(); + let mut rules: HashMap = HashMap::new(); - rules.insert( "line-max-len".to_string(), LineMaxLen::create); + rules.insert("line-max-len".to_string(), LineMaxLen::create); rules.insert(MaxStatesCount::RULE_ID.to_string(), MaxStatesCount::create); - rules.insert(FunctionMaxLines::RULE_ID.to_string(), FunctionMaxLines::create); + rules.insert( + FunctionMaxLines::RULE_ID.to_string(), + FunctionMaxLines::create, + ); rules.insert(reason_string::RULE_ID.to_string(), ReasonString::create); rules -} \ No newline at end of file +} diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/reason_string.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/reason_string.rs index 8181c676..767bb3f4 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/reason_string.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/reason_string.rs @@ -1,9 +1,9 @@ -use solc_wrapper::{NodeType, Expression, decode_location}; -use solc_wrapper::ast::utils::{get_all_nodes_by_type, self}; +use solc_wrapper::ast::utils::{self, get_all_nodes_by_type}; +use solc_wrapper::{decode_location, Expression, NodeType}; use crate::linter::SolidFile; use crate::rules::types::{RuleEntry, RuleType}; -use crate::types::{LintDiag, Range, Position, Severity}; +use crate::types::{LintDiag, Position, Range, Severity}; pub const RULE_ID: &str = "reason-string"; const DEFAULT_SEVERITY: Severity = Severity::WARNING; @@ -11,27 +11,24 @@ const DEFAULT_SEVERITY: Severity = Severity::WARNING; // Specific const DEFAULT_LENGTH: u32 = 32; - pub struct ReasonString { max_length: u32, - data: RuleEntry + data: RuleEntry, } impl RuleType for ReasonString { - fn diagnose(&self, file: &SolidFile, _files: &Vec) -> Vec { let mut res = Vec::new(); let nodes = get_all_nodes_by_type(file.data.clone(), NodeType::FunctionCall); for i in &nodes { match i { - utils::Nodes::FunctionCall(j) => { - match &j.expression { - Expression::Identifier(v) => { - if v.name == "require" { - if j.arguments.len() != 2 { - let location = decode_location(&j.src, &file.content); - let diag = LintDiag { + utils::Nodes::FunctionCall(j) => match &j.expression { + Expression::Identifier(v) => { + if v.name == "require" { + if j.arguments.len() != 2 { + let location = decode_location(&j.src, &file.content); + let diag = LintDiag { range: Range { start: Position { line: location.0.line as u64, character: location.0.column as u64 }, end: Position { line: location.1.line as u64, character: location.1.column as u64 }, @@ -44,14 +41,17 @@ impl RuleType for ReasonString { uri: file.path.clone(), source_file_content: file.content.clone(), }; - res.push(diag); - } else { - for nj in &j.arguments { - match nj { - Expression::Literal(z) => { - if z.value.clone().unwrap().len() > self.max_length as usize { - let location = decode_location(&z.src, &file.content); - let diag = LintDiag { + res.push(diag); + } else { + for nj in &j.arguments { + match nj { + Expression::Literal(z) => { + if z.value.clone().unwrap().len() + > self.max_length as usize + { + let location = + decode_location(&z.src, &file.content); + let diag = LintDiag { range: Range { start: Position { line: location.0.line as u64, character: location.0.column as u64 }, end: Position { line: location.1.line as u64, character: location.1.column as u64 }, @@ -64,17 +64,17 @@ impl RuleType for ReasonString { uri: file.path.clone(), source_file_content: file.content.clone(), }; - res.push(diag); - } + res.push(diag); } - _ => {} } + _ => {} } } - } else if v.name == "revert" { - if j.arguments.len() == 0 { - let location = decode_location(&j.src, &file.content); - let diag = LintDiag { + } + } else if v.name == "revert" { + if j.arguments.len() == 0 { + let location = decode_location(&j.src, &file.content); + let diag = LintDiag { range: Range { start: Position { line: location.0.line as u64, character: location.0.column as u64 }, end: Position { line: location.1.line as u64, character: location.1.column as u64 }, @@ -87,13 +87,14 @@ impl RuleType for ReasonString { uri: file.path.clone(), source_file_content: file.content.clone(), }; - res.push(diag); - } else { - match &j.arguments[0] { - Expression::Literal(z) => { - if z.value.clone().unwrap().len() > self.max_length as usize { - let location = decode_location(&z.src, &file.content); - let diag = LintDiag { + res.push(diag); + } else { + match &j.arguments[0] { + Expression::Literal(z) => { + if z.value.clone().unwrap().len() > self.max_length as usize + { + let location = decode_location(&z.src, &file.content); + let diag = LintDiag { range: Range { start: Position { line: location.0.line as u64, character: location.0.column as u64 }, end: Position { line: location.1.line as u64, character: location.1.column as u64 }, @@ -106,30 +107,28 @@ impl RuleType for ReasonString { uri: file.path.clone(), source_file_content: file.content.clone(), }; - res.push(diag); - } + res.push(diag); } - _ => {} } + _ => {} } } } - _ => {} } - } + _ => {} + }, _ => {} } } res } - } impl ReasonString { pub fn create(data: RuleEntry) -> Box { - let rule = ReasonString { + let rule = ReasonString { max_length: data.data[0].parse::().unwrap(), - data + data, }; Box::new(rule) } @@ -138,7 +137,7 @@ impl ReasonString { RuleEntry { id: RULE_ID.to_string(), severity: DEFAULT_SEVERITY, - data: vec![DEFAULT_LENGTH.to_string()] + data: vec![DEFAULT_LENGTH.to_string()], } } } diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/factory.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/factory.rs index 33d9ddcd..0e94596a 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/factory.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/factory.rs @@ -1,10 +1,10 @@ -use std::collections::HashMap; -use crate::rules::types::*; use crate::rules::create_rules; +use crate::rules::types::*; +use std::collections::HashMap; pub struct RuleFactory { _buildables: HashMap Box>, - _rules : Vec>, + _rules: Vec>, } impl Default for RuleFactory { @@ -24,12 +24,11 @@ impl RuleFactory { } } - pub fn create_rule(&self, rule: RuleEntry) -> Box - { + pub fn create_rule(&self, rule: RuleEntry) -> Box { let rule_type = self._buildables.get(&rule.id); if rule_type.is_none() { panic!("Rule {} not found", &rule.id); } rule_type.unwrap()(rule) } -} \ No newline at end of file +} diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/miscellaneous/mod.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/miscellaneous/mod.rs index 09c71213..2db97300 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/miscellaneous/mod.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/miscellaneous/mod.rs @@ -1,5 +1,5 @@ -use std::collections::HashMap; use crate::rules::types::{RuleEntry, RuleType}; +use std::collections::HashMap; #[macro_use] pub mod quotes; @@ -18,9 +18,9 @@ pub fn create_default_rules() -> Vec { } pub fn create_rules() -> HashMap Box> { - let mut rules : HashMap = HashMap::new(); + let mut rules: HashMap = HashMap::new(); rules.insert("quotes".to_string(), Quotes::create); rules -} \ No newline at end of file +} diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/miscellaneous/quotes.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/miscellaneous/quotes.rs index 3b759e66..59bec4a7 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/miscellaneous/quotes.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/miscellaneous/quotes.rs @@ -2,13 +2,11 @@ use crate::linter::SolidFile; use crate::rules::types::*; use crate::types::*; - pub struct Quotes { - data: RuleEntry + data: RuleEntry, } impl RuleType for Quotes { - fn diagnose(&self, file: &SolidFile, _files: &Vec) -> Vec { let mut res = Vec::new(); let mut line_idx = 1; @@ -18,8 +16,14 @@ impl RuleType for Quotes { if c == '\'' && line.chars().nth(idx - 1).unwrap_or(' ') != '\\' { res.push(LintDiag { range: Range { - start: Position { line: line_idx, character: idx as u64}, - end: Position { line: line_idx, character: idx as u64 }, + start: Position { + line: line_idx, + character: idx as u64, + }, + end: Position { + line: line_idx, + character: idx as u64, + }, length: 1 as u64, }, message: format!("Use double quotes instead of single quote"), @@ -27,7 +31,7 @@ impl RuleType for Quotes { code: None, source: None, uri: file.path.clone(), - source_file_content: file.content.clone() + source_file_content: file.content.clone(), }); } }); @@ -35,14 +39,11 @@ impl RuleType for Quotes { } res } - -} +} impl Quotes { pub(crate) fn create(data: RuleEntry) -> Box { - let rule = Quotes { - data - }; + let rule = Quotes { data }; Box::new(rule) } @@ -50,7 +51,7 @@ impl Quotes { RuleEntry { id: "quotes".to_string(), severity: Severity::ERROR, - data: vec![] + data: vec![], } } -} \ No newline at end of file +} diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/mod.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/mod.rs index f78c49ec..30c3eef0 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/mod.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/mod.rs @@ -1,9 +1,9 @@ -use std::collections::HashMap; use crate::rules::types::{RuleEntry, RuleType}; +use std::collections::HashMap; -pub mod types; -pub mod rule_impl; pub mod factory; +pub mod rule_impl; +pub mod types; // List all rules pub mod best_practises; @@ -24,7 +24,7 @@ pub fn create_default_rules() -> Vec { type RuleBuilder = fn(RuleEntry) -> Box; -pub fn add_rules(rules : &mut HashMap, to_add: HashMap) { +pub fn add_rules(rules: &mut HashMap, to_add: HashMap) { for (key, value) in to_add { rules.insert(key, value); } @@ -39,4 +39,4 @@ pub fn create_rules() -> HashMap Box> { add_rules(&mut rules, miscellaneous::create_rules()); rules -} \ No newline at end of file +} diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/contract_name_pascalcase.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/contract_name_pascalcase.rs index cb643366..dbbc0742 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/contract_name_pascalcase.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/contract_name_pascalcase.rs @@ -4,27 +4,36 @@ use crate::types::*; use solc_wrapper::{decode_location, SourceUnitChildNodes}; pub struct ContractNamePascalCase { - data: RuleEntry + data: RuleEntry, } impl RuleType for ContractNamePascalCase { - fn diagnose(&self, file: &SolidFile, _files: &Vec) -> Vec { - let mut res = Vec::new(); for node in &file.data.nodes { match node { SourceUnitChildNodes::ContractDefinition(contract) => { - if (contract.name.chars().nth(0).unwrap() >= 'a' && contract.name.chars().nth(0).unwrap() <= 'z') || - contract.name.contains("_") || - contract.name.contains("-") { + if (contract.name.chars().nth(0).unwrap() >= 'a' + && contract.name.chars().nth(0).unwrap() <= 'z') + || contract.name.contains("_") + || contract.name.contains("-") + { //Untested - let location = decode_location(contract.name_location.as_ref().unwrap(), &file.content); + let location = decode_location( + contract.name_location.as_ref().unwrap(), + &file.content, + ); res.push(LintDiag { range: Range { - start: Position { line: location.0.line as u64, character: location.0.column as u64 }, - end: Position { line: location.1.line as u64, character: location.1.column as u64 }, + start: Position { + line: location.0.line as u64, + character: location.0.column as u64, + }, + end: Position { + line: location.1.line as u64, + character: location.1.column as u64, + }, length: location.0.length as u64, }, message: format!("Contract name need to be in pascal case"), @@ -36,7 +45,9 @@ impl RuleType for ContractNamePascalCase { }); } } - _ => { continue; } + _ => { + continue; + } } } res @@ -45,9 +56,7 @@ impl RuleType for ContractNamePascalCase { impl ContractNamePascalCase { pub(crate) fn create(data: RuleEntry) -> Box { - let rule = ContractNamePascalCase { - data - }; + let rule = ContractNamePascalCase { data }; Box::new(rule) } @@ -55,7 +64,7 @@ impl ContractNamePascalCase { RuleEntry { id: "contract-name-pascalcase".to_string(), severity: Severity::WARNING, - data: vec![] + data: vec![], } } -} \ No newline at end of file +} diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/func_name_camelcase.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/func_name_camelcase.rs index c92dd551..41c9df3d 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/func_name_camelcase.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/func_name_camelcase.rs @@ -1,16 +1,16 @@ use crate::linter::SolidFile; use crate::rules::types::*; use crate::types::*; -use solc_wrapper::{ContractDefinitionChildNodes, decode_location, FunctionDefinitionKind, SourceUnitChildNodes}; +use solc_wrapper::{ + decode_location, ContractDefinitionChildNodes, FunctionDefinitionKind, SourceUnitChildNodes, +}; pub struct FuncNameCamelCase { - data: RuleEntry + data: RuleEntry, } impl RuleType for FuncNameCamelCase { - fn diagnose(&self, file: &SolidFile, _files: &Vec) -> Vec { - let mut res = Vec::new(); for node in &file.data.nodes { @@ -20,16 +20,27 @@ impl RuleType for FuncNameCamelCase { match node { ContractDefinitionChildNodes::FunctionDefinition(function) => { if function.kind != FunctionDefinitionKind::Constructor - && (!(function.name.chars().nth(0).unwrap_or(' ') >= 'a' && function.name.chars().nth(0).unwrap_or(' ') <= 'z') + && (!(function.name.chars().nth(0).unwrap_or(' ') >= 'a' + && function.name.chars().nth(0).unwrap_or(' ') <= 'z') || function.name.contains('_') - || function.name.contains('-')) { + || function.name.contains('-')) + { //Untested - let location = decode_location(function.name_location.as_ref().unwrap(), &file.content); + let location = decode_location( + function.name_location.as_ref().unwrap(), + &file.content, + ); res.push(LintDiag { range: Range { - start: Position { line: location.0.line as u64, character: location.0.column as u64 }, - end: Position { line: location.1.line as u64, character: location.1.column as u64 }, - length: location.0.length as u64 + start: Position { + line: location.0.line as u64, + character: location.0.column as u64, + }, + end: Position { + line: location.1.line as u64, + character: location.1.column as u64, + }, + length: location.0.length as u64, }, message: format!("Function name need to be in camel case"), severity: Some(self.data.severity), @@ -40,11 +51,15 @@ impl RuleType for FuncNameCamelCase { }); } } - _ => { continue; } + _ => { + continue; + } } } } - _ => { continue; } + _ => { + continue; + } } } res @@ -53,9 +68,7 @@ impl RuleType for FuncNameCamelCase { impl FuncNameCamelCase { pub(crate) fn create(data: RuleEntry) -> Box { - let rule = FuncNameCamelCase { - data - }; + let rule = FuncNameCamelCase { data }; Box::new(rule) } @@ -63,7 +76,7 @@ impl FuncNameCamelCase { RuleEntry { id: "func-name-camelcase".to_string(), severity: Severity::WARNING, - data: vec![] + data: vec![], } } -} \ No newline at end of file +} diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/func_param_name_camelcase.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/func_param_name_camelcase.rs index 948520b3..9eef6df9 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/func_param_name_camelcase.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/func_param_name_camelcase.rs @@ -1,16 +1,14 @@ use crate::linter::SolidFile; use crate::rules::types::*; use crate::types::*; -use solc_wrapper::{ContractDefinitionChildNodes, decode_location, SourceUnitChildNodes}; +use solc_wrapper::{decode_location, ContractDefinitionChildNodes, SourceUnitChildNodes}; pub struct FuncParamNameCamelcase { - data: RuleEntry + data: RuleEntry, } impl RuleType for FuncParamNameCamelcase { - fn diagnose(&self, file: &SolidFile, _files: &Vec) -> Vec { - let mut res = Vec::new(); for node in &file.data.nodes { @@ -20,18 +18,31 @@ impl RuleType for FuncParamNameCamelcase { match node { ContractDefinitionChildNodes::FunctionDefinition(function) => { for parameter in &function.parameters.parameters { - if !(parameter.name.chars().nth(0).unwrap() >= 'a' && parameter.name.chars().nth(0).unwrap() <= 'z') || - parameter.name.contains("_") || - parameter.name.contains("-") { + if !(parameter.name.chars().nth(0).unwrap() >= 'a' + && parameter.name.chars().nth(0).unwrap() <= 'z') + || parameter.name.contains("_") + || parameter.name.contains("-") + { //Untested - let location = decode_location(parameter.name_location.as_ref().unwrap(), &file.content); + let location = decode_location( + parameter.name_location.as_ref().unwrap(), + &file.content, + ); res.push(LintDiag { range: Range { - start: Position { line: location.0.line as u64, character: location.0.column as u64 }, - end: Position { line: location.1.line as u64, character: location.1.column as u64 }, + start: Position { + line: location.0.line as u64, + character: location.0.column as u64, + }, + end: Position { + line: location.1.line as u64, + character: location.1.column as u64, + }, length: location.0.length as u64, }, - message: format!("Parameter name need to be in camel case"), + message: format!( + "Parameter name need to be in camel case" + ), severity: Some(self.data.severity), code: None, source: None, @@ -41,12 +52,15 @@ impl RuleType for FuncParamNameCamelcase { } } } - _ => { continue; } + _ => { + continue; + } } } - } - _ => { continue; } + _ => { + continue; + } } } res @@ -55,9 +69,7 @@ impl RuleType for FuncParamNameCamelcase { impl FuncParamNameCamelcase { pub(crate) fn create(data: RuleEntry) -> Box { - let rule = FuncParamNameCamelcase { - data - }; + let rule = FuncParamNameCamelcase { data }; Box::new(rule) } @@ -65,7 +77,7 @@ impl FuncParamNameCamelcase { RuleEntry { id: "func-param-name-camelcase".to_string(), severity: Severity::WARNING, - data: vec![] + data: vec![], } } -} \ No newline at end of file +} diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/mod.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/mod.rs index a066a16b..011499a8 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/mod.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/mod.rs @@ -1,10 +1,10 @@ -use std::collections::HashMap; use crate::rules::naming::contract_name_pascalcase::ContractNamePascalCase; use crate::rules::naming::func_name_camelcase::FuncNameCamelCase; +use crate::rules::naming::func_param_name_camelcase::FuncParamNameCamelcase; use crate::rules::naming::use_forbidden_name::UseForbiddenName; use crate::rules::types::{RuleEntry, RuleType}; -use crate::rules::naming::func_param_name_camelcase::FuncParamNameCamelcase; use crate::rules::RuleBuilder; +use std::collections::HashMap; #[macro_use] pub(crate) mod func_param_name_camelcase; @@ -14,7 +14,6 @@ pub(crate) mod use_forbidden_name; // List all rules - pub fn create_default_rules() -> Vec { let mut rules = Vec::new(); @@ -27,12 +26,21 @@ pub fn create_default_rules() -> Vec { } pub fn create_rules() -> HashMap Box> { - let mut rules : HashMap = HashMap::new(); - - rules.insert( "func-param-name-camelcase".to_string(), FuncParamNameCamelcase::create); - rules.insert( "contract-name-pascalcase".to_string(), ContractNamePascalCase::create); - rules.insert( "func-name-camelcase".to_string(), FuncNameCamelCase::create); - rules.insert( UseForbiddenName::RULE_ID.to_string(), UseForbiddenName::create); + let mut rules: HashMap = HashMap::new(); + + rules.insert( + "func-param-name-camelcase".to_string(), + FuncParamNameCamelcase::create, + ); + rules.insert( + "contract-name-pascalcase".to_string(), + ContractNamePascalCase::create, + ); + rules.insert("func-name-camelcase".to_string(), FuncNameCamelCase::create); + rules.insert( + UseForbiddenName::RULE_ID.to_string(), + UseForbiddenName::create, + ); rules } diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/use_forbidden_name.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/use_forbidden_name.rs index 367ee0c2..c2a3cf08 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/use_forbidden_name.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/use_forbidden_name.rs @@ -1,15 +1,14 @@ use crate::linter::SolidFile; -use solc_wrapper::*; -use solc_wrapper::ast::utils::{get_all_nodes_by_type, Nodes}; use crate::rules::types::*; use crate::types::*; +use solc_wrapper::ast::utils::{get_all_nodes_by_type, Nodes}; +use solc_wrapper::*; pub struct UseForbiddenName { - data: RuleEntry + data: RuleEntry, } impl RuleType for UseForbiddenName { - fn diagnose(&self, file: &SolidFile, _files: &Vec) -> Vec { let mut res = Vec::new(); let blacklist = vec!['I', 'l', 'O']; @@ -19,39 +18,40 @@ impl RuleType for UseForbiddenName { for node in nodes { let var = match node { Nodes::VariableDeclaration(var) => var, - _ => continue + _ => continue, }; if var.name.len() == 1 && blacklist.contains(&var.name.chars().next().unwrap()) { let location = decode_location(&var.src, &file.content); res.push(LintDiag { range: Range { - start: Position { line: location.0.line as u64, character: location.0.column as u64}, - end: Position { line: location.1.line as u64, character: location.1.column as u64 }, - length: location.0.length as u64 + start: Position { + line: location.0.line as u64, + character: location.0.column as u64, + }, + end: Position { + line: location.1.line as u64, + character: location.1.column as u64, + }, + length: location.0.length as u64, }, message: format!("Forbidden variable name: {}", var.name), severity: Some(self.data.severity), code: None, source: None, uri: file.path.clone(), - source_file_content: file.content.clone() + source_file_content: file.content.clone(), }); } } res } - - } impl UseForbiddenName { - - pub const RULE_ID : &'static str = "use-forbidden-name"; + pub const RULE_ID: &'static str = "use-forbidden-name"; pub(crate) fn create(data: RuleEntry) -> Box { - let rule = UseForbiddenName { - data - }; + let rule = UseForbiddenName { data }; Box::new(rule) } @@ -62,4 +62,4 @@ impl UseForbiddenName { data: vec![], } } -} \ No newline at end of file +} diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/order/import_on_top.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/order/import_on_top.rs index 53763bd4..11829a80 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/order/import_on_top.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/order/import_on_top.rs @@ -4,13 +4,11 @@ use crate::types::*; use solc_wrapper::{decode_location, SourceUnitChildNodes}; pub struct ImportOnTop { - data: RuleEntry + data: RuleEntry, } impl RuleType for ImportOnTop { - fn diagnose(&self, file: &SolidFile, _files: &Vec) -> Vec { - let mut res = Vec::new(); let mut last_import_location = 0; @@ -33,9 +31,15 @@ impl RuleType for ImportOnTop { res.push(LintDiag { range: Range { - start: Position { line: location.0.line as u64, character: location.0.column as u64 }, - end: Position { line: location.1.line as u64, character: location.1.column as u64 }, - length: location.0.length as u64 + start: Position { + line: location.0.line as u64, + character: location.0.column as u64, + }, + end: Position { + line: location.1.line as u64, + character: location.1.column as u64, + }, + length: location.0.length as u64, }, message: format!("Import must be on top in the file"), severity: Some(self.data.severity), @@ -56,9 +60,7 @@ impl RuleType for ImportOnTop { impl ImportOnTop { pub(crate) fn create(data: RuleEntry) -> Box { - let rule = ImportOnTop { - data - }; + let rule = ImportOnTop { data }; Box::new(rule) } @@ -66,7 +68,7 @@ impl ImportOnTop { RuleEntry { id: "import-on-top".to_string(), severity: Severity::WARNING, - data: vec![] + data: vec![], } } -} \ No newline at end of file +} diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/order/mod.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/order/mod.rs index 0fa313d3..8956cfb6 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/order/mod.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/order/mod.rs @@ -1,5 +1,5 @@ -use std::collections::HashMap; use crate::rules::types::{RuleEntry, RuleType}; +use std::collections::HashMap; #[macro_use] pub(crate) mod import_on_top; @@ -18,9 +18,9 @@ pub fn create_default_rules() -> Vec { } pub fn create_rules() -> HashMap Box> { - let mut rules : HashMap = HashMap::new(); + let mut rules: HashMap = HashMap::new(); - rules.insert( "import-on-top".to_string(), ImportOnTop::create); + rules.insert("import-on-top".to_string(), ImportOnTop::create); rules -} \ No newline at end of file +} diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/rule_impl.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/rule_impl.rs index 53aa647e..c183992f 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/rule_impl.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/rule_impl.rs @@ -1,6 +1,5 @@ use crate::rules::create_default_rules; use crate::rules::types::*; -use crate::types::*; // Untested /* diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/types.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/types.rs index 0660e8d3..0db55003 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/types.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/types.rs @@ -1,24 +1,7 @@ +use crate::errors::SolidHunterError; +use colored::Colorize; use serde::{Deserialize, Serialize}; -use thiserror::Error; use std::fmt; -use colored::Colorize; - -#[derive(Error, Debug)] -pub enum SolidHunterError { - // Linter errors - #[error("SolidHunterError: Solc error occured")] - SolcError(#[from] solc_wrapper::SolcError), - #[error("SolidHunterError: Something went wrong with the file during parsing")] - ParsingError(#[from] std::io::Error), - #[error("SolidHunterError: Something went wrong")] - LinterError(String), - // - - // RulesError - #[error("SolidHunterError: IO error occured with Rules")] - IoError(std::io::Error), - // -} pub type LintResult = Result, SolidHunterError>; @@ -77,12 +60,23 @@ impl fmt::Display for LintDiag { .nth((self.range.start.line - 1) as usize) .unwrap(); - write!(f, "\n{}: {}\n --> {}:{}:{}\n |\n{}{}|{}\n |{}{}", severity_to_string(self.severity), self.message, self.uri, self.range.start.line, self.range.start.character, self.range.start.line, padding, line, " ".repeat(self.range.start.character as usize), - "^".repeat(self.range.length as usize)) + write!( + f, + "\n{}: {}\n --> {}:{}:{}\n |\n{}{}|{}\n |{}{}", + severity_to_string(self.severity), + self.message, + self.uri, + self.range.start.line, + self.range.start.character, + self.range.start.line, + padding, + line, + " ".repeat(self.range.start.character as usize), + "^".repeat(self.range.length as usize) + ) } } - //////////////////////////////////////////////////////////// /////////////////// RELATED TYPES: ///////////////////////// //////////////////////////////////////////////////////////// From dac30495e4949562cc9a25ac4564213884af3f0a Mon Sep 17 00:00:00 2001 From: leon Date: Thu, 7 Sep 2023 20:15:02 +0200 Subject: [PATCH 041/325] refactor(solidity/linter/core): unified error types --- .../solidity/linter/core/solidhunter-lib/src/errors.rs | 2 +- .../solidity/linter/core/solidhunter-lib/src/linter.rs | 4 ++-- .../linter/core/solidhunter-lib/src/rules/rule_impl.rs | 7 +++---- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/errors.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/errors.rs index 6373641d..dae5d75e 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/errors.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/errors.rs @@ -12,5 +12,5 @@ pub enum SolidHunterError { // RulesError #[error("SolidHunterError: IO error occured with Rules")] - IoError(std::io::Error), + IoError(String), } diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/linter.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/linter.rs index 51734a82..8c569d7d 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/linter.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/linter.rs @@ -91,8 +91,8 @@ impl SolidLinter { if self._file_exists(filepath.as_str()) { self._update_file_ast(filepath.as_str(), res.expect("ast not found")); } else { - let content = - fs::read_to_string(filepath.clone()).map_err(|e| SolidHunterError::IoError(e))?; + let content = fs::read_to_string(filepath.clone()) + .map_err(|e| SolidHunterError::IoError(e.to_string()))?; self._add_file( filepath.as_str(), res.expect("ast not found"), diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/rule_impl.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/rule_impl.rs index c183992f..4fb6231e 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/rule_impl.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/rule_impl.rs @@ -40,10 +40,9 @@ pub fn parse_rules(path: &str) -> Result { };*/ if !std::path::Path::new(&path).is_file() { - return Err(SolidHunterError::IoError(std::io::Error::new( - std::io::ErrorKind::NotFound, - "Rules file not found", - ))); + return Err(SolidHunterError::IoError( + "Rules file not found".to_string(), + )); } let file = std::fs::read_to_string(path).unwrap(); let parsed: Rules = serde_json::from_str(&file).unwrap(); From 7a522cd55bf806a3abd3b6b0bf8a20931a98749b Mon Sep 17 00:00:00 2001 From: 0xtekgrinder <0xtekgrinder@protonmail.com> Date: Thu, 7 Sep 2023 22:46:43 +0200 Subject: [PATCH 042/325] refactor(solidhunter): remove usless unwrap --- toolchains/solidity/linter/core/solidhunter-lib/src/errors.rs | 2 ++ toolchains/solidity/linter/core/solidhunter-lib/src/linter.rs | 4 ++-- .../linter/core/solidhunter-lib/src/rules/rule_impl.rs | 4 ++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/errors.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/errors.rs index dae5d75e..b76e67a8 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/errors.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/errors.rs @@ -7,6 +7,8 @@ pub enum SolidHunterError { SolcError(#[from] solc_wrapper::SolcError), #[error("SolidHunterError: Something went wrong with the file during parsing")] ParsingError(#[from] std::io::Error), + #[error("SolidHunterError: Serde error occured")] + SerdeError(#[from] serde_json::Error), #[error("SolidHunterError: Something went wrong")] LinterError(String), diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/linter.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/linter.rs index 8c569d7d..66e1b773 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/linter.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/linter.rs @@ -86,7 +86,7 @@ impl SolidLinter { if res.is_err() { println!("{:?}", res); - return Err(SolidHunterError::SolcError(res.err().unwrap())); + return Err(SolidHunterError::SolcError(res.unwrap_err())); } if self._file_exists(filepath.as_str()) { self._update_file_ast(filepath.as_str(), res.expect("ast not found")); @@ -113,7 +113,7 @@ impl SolidLinter { if res.is_err() { println!("{:?}", res); - return Err(SolidHunterError::SolcError(res.err().unwrap())); + return Err(SolidHunterError::SolcError(res.unwrap_err())); } if self._file_exists(filepath.as_str()) { diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/rule_impl.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/rule_impl.rs index 4fb6231e..b2e78534 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/rule_impl.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/rule_impl.rs @@ -44,8 +44,8 @@ pub fn parse_rules(path: &str) -> Result { "Rules file not found".to_string(), )); } - let file = std::fs::read_to_string(path).unwrap(); - let parsed: Rules = serde_json::from_str(&file).unwrap(); + let file = std::fs::read_to_string(path)?; + let parsed: Rules = serde_json::from_str(&file)?; /* // Danger zone From 54ef01e037fcefd25185ceaa434d1cbebaa83e1e Mon Sep 17 00:00:00 2001 From: 0xSwapFeeder Date: Fri, 8 Sep 2023 17:18:56 -0400 Subject: [PATCH 043/325] chore(solidity/linter): cleaned and linted code --- .../linter/core/solc-wrapper/src/ast/ast.rs | 4 +- .../linter/core/solc-wrapper/src/utils.rs | 2 +- .../linter/core/solidhunter-lib/src/lib.rs | 1 - .../src/rules/miscellaneous/quotes.rs | 2 +- .../solidhunter-lib/src/rules/rule_impl.rs | 61 +------------------ toolchains/solidity/linter/core/src/main.rs | 32 +++++----- 6 files changed, 19 insertions(+), 83 deletions(-) diff --git a/toolchains/solidity/linter/core/solc-wrapper/src/ast/ast.rs b/toolchains/solidity/linter/core/solc-wrapper/src/ast/ast.rs index de66585c..b1ea0e5b 100644 --- a/toolchains/solidity/linter/core/solc-wrapper/src/ast/ast.rs +++ b/toolchains/solidity/linter/core/solc-wrapper/src/ast/ast.rs @@ -1571,7 +1571,7 @@ mod tests { assert_eq!(res.src, "33:23:0".to_string()); assert_eq!(res.literals, vec!["solidity".to_string(), "0.8".to_string(), - ".16".to_string()] as Vec); + ".16".to_string()]); Ok(assert_eq!(res.node_type, NodeType::PragmaDirective)) } @@ -2045,7 +2045,7 @@ mod tests { assert_eq!(res.id, 21); assert_eq!(res.src, "236:36:0".to_string()); - assert_eq!(res.names, vec!["value".to_string()] as Vec); + assert_eq!(res.names, vec!["value".to_string()]); assert_eq!(res.node_type, NodeType::FunctionCallOptions); Ok(()) } diff --git a/toolchains/solidity/linter/core/solc-wrapper/src/utils.rs b/toolchains/solidity/linter/core/solc-wrapper/src/utils.rs index bad6ebd2..0f62f9e3 100644 --- a/toolchains/solidity/linter/core/solc-wrapper/src/utils.rs +++ b/toolchains/solidity/linter/core/solc-wrapper/src/utils.rs @@ -65,7 +65,7 @@ pub fn get_error_location(stderr: &str) -> Result { file, line: line.parse().unwrap(), //unwrap is safe due to the regex that matches only number column: column.parse().unwrap(), //unwrap is safe due to the regex that matches only number - length: length + length } ) } \ No newline at end of file diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/lib.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/lib.rs index d2ebe5f7..0ba72c7b 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/lib.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/lib.rs @@ -5,7 +5,6 @@ pub mod types; #[cfg(test)] mod tests { - use super::*; #[test] fn it_works() {} diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/miscellaneous/quotes.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/miscellaneous/quotes.rs index 59bec4a7..2b45091f 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/miscellaneous/quotes.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/miscellaneous/quotes.rs @@ -24,7 +24,7 @@ impl RuleType for Quotes { line: line_idx, character: idx as u64, }, - length: 1 as u64, + length: 1u64, }, message: format!("Use double quotes instead of single quote"), severity: Some(self.data.severity), diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/rule_impl.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/rule_impl.rs index b2e78534..025a219e 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/rule_impl.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/rule_impl.rs @@ -1,22 +1,7 @@ +use crate::errors::SolidHunterError; use crate::rules::create_default_rules; use crate::rules::types::*; -// Untested -/* -fn merge_rules(rules: &mut Vec, new_rules: &Vec) { - let mut new_rules_map = HashMap::new(); - for rule in new_rules { - new_rules_map.insert(rule.id.clone(), rule); - } - - for rule in rules { - if let Some(new_rule) = new_rules_map.get(&rule.id) { - rule.severity = new_rule.severity.clone(); - rule.data = new_rule.data.clone(); - } - } -} -*/ pub fn create_rules_file(path: &str) { let rules = Rules { @@ -31,14 +16,6 @@ pub fn create_rules_file(path: &str) { } pub fn parse_rules(path: &str) -> Result { - /* - let rules = Rules { - name: String::new(), - includes: Vec::new(), - plugins: Vec::new(), - rules: Vec::new(), - };*/ - if !std::path::Path::new(&path).is_file() { return Err(SolidHunterError::IoError( "Rules file not found".to_string(), @@ -47,41 +24,5 @@ pub fn parse_rules(path: &str) -> Result { let file = std::fs::read_to_string(path)?; let parsed: Rules = serde_json::from_str(&file)?; - /* - // Danger zone - for include in parsed.includes { - let include_rules = parse_rules(include.as_str()); - merge_rules(&mut rules.rules, &include_rules.unwrap().rules); - } - - merge_rules(&mut rules.rules, &parsed.rules); - // End of danger zone - */ - Ok(parsed) } - -// create rules -/* -#[macro_export] -macro_rules! create_rule { - ($rule_name:ident, $rule_id:expr, $default_severity:expr, $custom_data:expr, $message:expr) => { - pub struct $rule_name { - id: String, - message: String, - severity: RuleSeverity, - data: Vec, - } - - impl $rule_name { - pub fn new(severity: Severity, data: Vec) -> $rule_name { - $rule_name { - id: $rule_id.to_string(), - message: $message.to_string(), - severity, - data, - } - } - } - }; -}*/ diff --git a/toolchains/solidity/linter/core/src/main.rs b/toolchains/solidity/linter/core/src/main.rs index 92aba6bc..2531a2f9 100644 --- a/toolchains/solidity/linter/core/src/main.rs +++ b/toolchains/solidity/linter/core/src/main.rs @@ -1,6 +1,7 @@ use clap::Parser; use solidhunter_lib::linter::SolidLinter; use solidhunter_lib::rules::rule_impl::create_rules_file; +use solidhunter_lib::types::LintResult; #[derive(Parser, Debug)] #[command(author, version, about, long_about = None)] @@ -68,16 +69,20 @@ fn lint_folder(args: Args) { result.append(&mut linter.parse_folder(path)); } for res in result { - match res { - Ok(diags) => { - for diag in diags { - println!("{}", &diag); - } - } - Err(e) => { - println!("{}", e); + print_result(res); + } +} + +fn print_result(result: LintResult) { + match result { + Ok(diags) => { + for diag in diags { + println!("{}", &diag); } } + Err(e) => { + println!("{}", e); + } } } @@ -117,16 +122,7 @@ fn main() { let result = linter.parse_file(args.file_to_lint); if !args.to_json { - match result { - Ok(diags) => { - for diag in diags { - println!("{}", &diag); - } - } - Err(e) => { - println!("{}", e); - } - } + print_result(result); } else { match result { Ok(diags) => { From 40eb1d8aea83775baa646f42447671d70f5ed709 Mon Sep 17 00:00:00 2001 From: 0xMemoryGrinder <35138272+0xMemoryGrinder@users.noreply.github.com> Date: Fri, 8 Sep 2023 23:08:00 -0400 Subject: [PATCH 044/325] refactor(solidity/linter/core): added missing indentation --- toolchains/solidity/linter/core/src/main.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/toolchains/solidity/linter/core/src/main.rs b/toolchains/solidity/linter/core/src/main.rs index 2531a2f9..439254e2 100644 --- a/toolchains/solidity/linter/core/src/main.rs +++ b/toolchains/solidity/linter/core/src/main.rs @@ -122,7 +122,7 @@ fn main() { let result = linter.parse_file(args.file_to_lint); if !args.to_json { - print_result(result); + print_result(result); } else { match result { Ok(diags) => { From 38b541ba123c00eca3fe1198ca0d5c68bc6d5b72 Mon Sep 17 00:00:00 2001 From: 0xSwapFeeder Date: Sat, 9 Sep 2023 11:01:35 -0400 Subject: [PATCH 045/325] chore(solidity/linter): extracted linter diag creation from naming and miscellaneous rules --- .../src/rules/miscellaneous/quotes.rs | 44 ++++++++++------- .../rules/naming/contract_name_pascalcase.rs | 45 +++++++++-------- .../src/rules/naming/func_name_camelcase.rs | 46 ++++++++--------- .../rules/naming/func_param_name_camelcase.rs | 49 ++++++++++--------- .../src/rules/naming/use_forbidden_name.rs | 43 +++++++++------- 5 files changed, 125 insertions(+), 102 deletions(-) diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/miscellaneous/quotes.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/miscellaneous/quotes.rs index 2b45091f..1e0a2a88 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/miscellaneous/quotes.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/miscellaneous/quotes.rs @@ -1,3 +1,4 @@ +use solc_wrapper::{CodeLocation, decode_location}; use crate::linter::SolidFile; use crate::rules::types::*; use crate::types::*; @@ -7,6 +8,29 @@ pub struct Quotes { } impl RuleType for Quotes { + + fn create_diag(&self, file: SolidFile, idx: usize, line_idx: u32) { + LintDiag { + range: Range { + start: Position { + line: line_idx, + character: idx as u64, + }, + end: Position { + line: line_idx, + character: idx as u64, + }, + length: 1u64, + }, + message: format!("Use double quotes instead of single quote"), + severity: Some(self.data.severity), + code: None, + source: None, + uri: file.path.clone(), + source_file_content: file.content.clone(), + } + } + fn diagnose(&self, file: &SolidFile, _files: &Vec) -> Vec { let mut res = Vec::new(); let mut line_idx = 1; @@ -14,25 +38,7 @@ impl RuleType for Quotes { for line in file.content.lines() { line.chars().enumerate().for_each(|(idx, c)| { if c == '\'' && line.chars().nth(idx - 1).unwrap_or(' ') != '\\' { - res.push(LintDiag { - range: Range { - start: Position { - line: line_idx, - character: idx as u64, - }, - end: Position { - line: line_idx, - character: idx as u64, - }, - length: 1u64, - }, - message: format!("Use double quotes instead of single quote"), - severity: Some(self.data.severity), - code: None, - source: None, - uri: file.path.clone(), - source_file_content: file.content.clone(), - }); + res.push(self.create_diag(file, idx, line_idx)); } }); line_idx += 1; diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/contract_name_pascalcase.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/contract_name_pascalcase.rs index dbbc0742..48231353 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/contract_name_pascalcase.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/contract_name_pascalcase.rs @@ -1,13 +1,36 @@ use crate::linter::SolidFile; use crate::rules::types::*; use crate::types::*; -use solc_wrapper::{decode_location, SourceUnitChildNodes}; +use solc_wrapper::{CodeLocation, decode_location, SourceUnitChildNodes}; pub struct ContractNamePascalCase { data: RuleEntry, } impl RuleType for ContractNamePascalCase { + + fn create_diag(&self, location: (CodeLocation, CodeLocation), file: SolidFile) { + LintDiag { + range: Range { + start: Position { + line: location.0.line as u64, + character: location.0.column as u64, + }, + end: Position { + line: location.1.line as u64, + character: location.1.column as u64, + }, + length: location.0.length as u64, + }, + message: format!("Contract name need to be in pascal case"), + severity: Some(self.data.severity), + code: None, + source: None, + uri: file.path.clone(), + source_file_content: file.content.clone(), + } + } + fn diagnose(&self, file: &SolidFile, _files: &Vec) -> Vec { let mut res = Vec::new(); @@ -24,25 +47,7 @@ impl RuleType for ContractNamePascalCase { contract.name_location.as_ref().unwrap(), &file.content, ); - res.push(LintDiag { - range: Range { - start: Position { - line: location.0.line as u64, - character: location.0.column as u64, - }, - end: Position { - line: location.1.line as u64, - character: location.1.column as u64, - }, - length: location.0.length as u64, - }, - message: format!("Contract name need to be in pascal case"), - severity: Some(self.data.severity), - code: None, - source: None, - uri: file.path.clone(), - source_file_content: file.content.clone(), - }); + res.push(self.create_diag(location, file)); } } _ => { diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/func_name_camelcase.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/func_name_camelcase.rs index 41c9df3d..5a9e8b24 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/func_name_camelcase.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/func_name_camelcase.rs @@ -1,15 +1,35 @@ use crate::linter::SolidFile; use crate::rules::types::*; use crate::types::*; -use solc_wrapper::{ - decode_location, ContractDefinitionChildNodes, FunctionDefinitionKind, SourceUnitChildNodes, -}; +use solc_wrapper::{decode_location, ContractDefinitionChildNodes, FunctionDefinitionKind, SourceUnitChildNodes, CodeLocation}; pub struct FuncNameCamelCase { data: RuleEntry, } impl RuleType for FuncNameCamelCase { + fn create_diag(&self, location: (CodeLocation, CodeLocation), file: SolidFile) { + LintDiag { + range: Range { + start: Position { + line: location.0.line as u64, + character: location.0.column as u64, + }, + end: Position { + line: location.1.line as u64, + character: location.1.column as u64, + }, + length: location.0.length as u64, + }, + message: format!("Function name need to be in camel case"), + severity: Some(self.data.severity), + code: None, + source: None, + uri: file.path.clone(), + source_file_content: file.content.clone(), + } + } + fn diagnose(&self, file: &SolidFile, _files: &Vec) -> Vec { let mut res = Vec::new(); @@ -30,25 +50,7 @@ impl RuleType for FuncNameCamelCase { function.name_location.as_ref().unwrap(), &file.content, ); - res.push(LintDiag { - range: Range { - start: Position { - line: location.0.line as u64, - character: location.0.column as u64, - }, - end: Position { - line: location.1.line as u64, - character: location.1.column as u64, - }, - length: location.0.length as u64, - }, - message: format!("Function name need to be in camel case"), - severity: Some(self.data.severity), - code: None, - source: None, - uri: file.path.clone(), - source_file_content: file.content.clone(), - }); + res.push(self.create_diag(location, file)); } } _ => { diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/func_param_name_camelcase.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/func_param_name_camelcase.rs index 9eef6df9..4b4c4fa2 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/func_param_name_camelcase.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/func_param_name_camelcase.rs @@ -1,13 +1,38 @@ use crate::linter::SolidFile; use crate::rules::types::*; use crate::types::*; -use solc_wrapper::{decode_location, ContractDefinitionChildNodes, SourceUnitChildNodes}; +use solc_wrapper::{decode_location, ContractDefinitionChildNodes, SourceUnitChildNodes, CodeLocation}; pub struct FuncParamNameCamelcase { data: RuleEntry, } impl RuleType for FuncParamNameCamelcase { + + fn create_diag(&self, location: (CodeLocation, CodeLocation), file: SolidFile) { + LintDiag { + range: Range { + start: Position { + line: location.0.line as u64, + character: location.0.column as u64, + }, + end: Position { + line: location.1.line as u64, + character: location.1.column as u64, + }, + length: location.0.length as u64, + }, + message: format!( + "Parameter name need to be in camel case" + ), + severity: Some(self.data.severity), + code: None, + source: None, + uri: file.path.clone(), + source_file_content: file.content.clone(), + } + } + fn diagnose(&self, file: &SolidFile, _files: &Vec) -> Vec { let mut res = Vec::new(); @@ -28,27 +53,7 @@ impl RuleType for FuncParamNameCamelcase { parameter.name_location.as_ref().unwrap(), &file.content, ); - res.push(LintDiag { - range: Range { - start: Position { - line: location.0.line as u64, - character: location.0.column as u64, - }, - end: Position { - line: location.1.line as u64, - character: location.1.column as u64, - }, - length: location.0.length as u64, - }, - message: format!( - "Parameter name need to be in camel case" - ), - severity: Some(self.data.severity), - code: None, - source: None, - uri: file.path.clone(), - source_file_content: file.content.clone(), - }); + res.push(self.create_diag(location, file)); } } } diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/use_forbidden_name.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/use_forbidden_name.rs index c2a3cf08..8e296fde 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/use_forbidden_name.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/use_forbidden_name.rs @@ -9,6 +9,29 @@ pub struct UseForbiddenName { } impl RuleType for UseForbiddenName { + + fn create_diag(&self, location: (CodeLocation, CodeLocation), var: Box, file: SolidFile) { + LintDiag { + range: Range { + start: Position { + line: location.0.line as u64, + character: location.0.column as u64, + }, + end: Position { + line: location.1.line as u64, + character: location.1.column as u64, + }, + length: location.0.length as u64, + }, + message: format!("Forbidden variable name: {}", var.name), + severity: Some(self.data.severity), + code: None, + source: None, + uri: file.path.clone(), + source_file_content: file.content.clone(), + } + } + fn diagnose(&self, file: &SolidFile, _files: &Vec) -> Vec { let mut res = Vec::new(); let blacklist = vec!['I', 'l', 'O']; @@ -22,25 +45,7 @@ impl RuleType for UseForbiddenName { }; if var.name.len() == 1 && blacklist.contains(&var.name.chars().next().unwrap()) { let location = decode_location(&var.src, &file.content); - res.push(LintDiag { - range: Range { - start: Position { - line: location.0.line as u64, - character: location.0.column as u64, - }, - end: Position { - line: location.1.line as u64, - character: location.1.column as u64, - }, - length: location.0.length as u64, - }, - message: format!("Forbidden variable name: {}", var.name), - severity: Some(self.data.severity), - code: None, - source: None, - uri: file.path.clone(), - source_file_content: file.content.clone(), - }); + res.push(self.create_diag(location, var, file)); } } res From 7092cccc5af0b8923805ac280fba6c5e7824b60b Mon Sep 17 00:00:00 2001 From: EnergyCube Date: Sat, 9 Sep 2023 19:03:23 +0200 Subject: [PATCH 046/325] chore(solidity/linter): extracted linter diag creation from best practises and order rules --- .../src/rules/best_practises/line_maxlen.rs | 43 +++++----- .../rules/best_practises/max_states_count.rs | 44 +++++----- .../src/rules/best_practises/reason_string.rs | 83 ++++++------------- .../src/rules/order/import_on_top.rs | 45 +++++----- 4 files changed, 101 insertions(+), 114 deletions(-) diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/line_maxlen.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/line_maxlen.rs index dff8cd56..50ddb2fd 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/line_maxlen.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/line_maxlen.rs @@ -8,31 +8,36 @@ pub struct LineMaxLen { } impl RuleType for LineMaxLen { + + fn create_diag(&self, file: &SolidFile, line_idx: usize, line: &str) -> LintDiag { + LintDiag { + range: Range { + start: Position { + line: line_idx as u64, + character: self.max_len as u64, + }, + end: Position { + line: line_idx as u64, + character: line.len() as u64, + }, + length: (line.len() - self.max_len) as u64, + }, + message: format!("Line is too long: {}", line.len()), + severity: Some(self.data.severity), + code: None, + source: None, + uri: file.path.clone(), + source_file_content: file.content.clone(), + } + } + fn diagnose(&self, file: &SolidFile, _files: &Vec) -> Vec { let mut res = Vec::new(); let mut line_idx = 1; for line in file.content.lines() { if line.len() > self.max_len { - res.push(LintDiag { - range: Range { - start: Position { - line: line_idx, - character: self.max_len as u64, - }, - end: Position { - line: line_idx, - character: line.len() as u64, - }, - length: (line.len() - self.max_len) as u64, - }, - message: format!("Line is too long: {}", line.len()), - severity: Some(self.data.severity), - code: None, - source: None, - uri: file.path.clone(), - source_file_content: file.content.clone(), - }); + res.push(self.create_diag(file, line_idx, line)); } line_idx += 1; } diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/max_states_count.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/max_states_count.rs index bbd424cd..3c225219 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/max_states_count.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/max_states_count.rs @@ -9,6 +9,30 @@ pub struct MaxStatesCount { } impl RuleType for MaxStatesCount { + + fn create_diag(&self, file: &SolidFile, var: &ContractDefinitionChildNodes, + location: (CodeLocation, CodeLocation)) -> LintDiag { + LintDiag { + range: Range { + start: Position { + line: location.0.line as u64, + character: location.0.column as u64, + }, + end: Position { + line: location.1.line as u64, + character: location.1.column as u64, + }, + length: location.0.length as u64, + }, + message: format!("Too many states: {}", count), + severity: Some(self.data.severity), + code: None, + source: None, + uri: file.path.clone(), + source_file_content: file.content.clone(), + } + } + fn diagnose(&self, file: &SolidFile, _files: &Vec) -> Vec { let mut res = Vec::new(); @@ -28,25 +52,7 @@ impl RuleType for MaxStatesCount { count += 1; if count > self.max_states { let location = decode_location(&var.src, &file.content); - res.push(LintDiag { - range: Range { - start: Position { - line: location.0.line as u64, - character: location.0.column as u64, - }, - end: Position { - line: location.1.line as u64, - character: location.1.column as u64, - }, - length: location.0.length as u64, - }, - message: format!("Too many states: {}", count), - severity: Some(self.data.severity), - code: None, - source: None, - uri: file.path.clone(), - source_file_content: file.content.clone(), - }); + res.push(self.create_diag(file, var, location)); } } } diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/reason_string.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/reason_string.rs index 767bb3f4..fe3670a0 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/reason_string.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/reason_string.rs @@ -17,6 +17,29 @@ pub struct ReasonString { } impl RuleType for ReasonString { + + fn create_diag(&self, file: &SolidFile, location: (CodeLocation, CodeLocation), message: String) -> LintDiag { + LintDiag { + range: Range { + start: Position { + line: location.0.line as u64, + character: location.0.column as u64, + }, + end: Position { + line: location.1.line as u64, + character: location.1.column as u64, + }, + length: location.0.length as u64, + }, + message: message, + severity: Some(self.data.severity), + code: None, + source: None, + uri: file.path.clone(), + source_file_content: file.content.clone(), + } + } + fn diagnose(&self, file: &SolidFile, _files: &Vec) -> Vec { let mut res = Vec::new(); @@ -28,20 +51,7 @@ impl RuleType for ReasonString { if v.name == "require" { if j.arguments.len() != 2 { let location = decode_location(&j.src, &file.content); - let diag = LintDiag { - range: Range { - start: Position { line: location.0.line as u64, character: location.0.column as u64 }, - end: Position { line: location.1.line as u64, character: location.1.column as u64 }, - length: location.0.length as u64 - }, - message: format!("reason-string: A require statement must have a reason string"), - severity: Some(self.data.severity), - code: None, - source: None, - uri: file.path.clone(), - source_file_content: file.content.clone(), - }; - res.push(diag); + res.push(self.create_diag(file, location, format!("reason-string: A require statement must have a reason string"))); } else { for nj in &j.arguments { match nj { @@ -51,20 +61,7 @@ impl RuleType for ReasonString { { let location = decode_location(&z.src, &file.content); - let diag = LintDiag { - range: Range { - start: Position { line: location.0.line as u64, character: location.0.column as u64 }, - end: Position { line: location.1.line as u64, character: location.1.column as u64 }, - length: location.0.length as u64 - }, - message: format!("reason-string: A revert statement must have a reason string of length less than {}", self.max_length), - severity: Some(self.data.severity), - code: None, - source: None, - uri: file.path.clone(), - source_file_content: file.content.clone(), - }; - res.push(diag); + res.push(self.create_diag(file, location, format!("reason-string: A revert statement must have a reason string of length less than {}", self.max_length))); } } _ => {} @@ -74,40 +71,14 @@ impl RuleType for ReasonString { } else if v.name == "revert" { if j.arguments.len() == 0 { let location = decode_location(&j.src, &file.content); - let diag = LintDiag { - range: Range { - start: Position { line: location.0.line as u64, character: location.0.column as u64 }, - end: Position { line: location.1.line as u64, character: location.1.column as u64 }, - length: location.0.length as u64 - }, - message: format!("reason-string: A revert statement must have a reason string"), - severity: Some(self.data.severity), - code: None, - source: None, - uri: file.path.clone(), - source_file_content: file.content.clone(), - }; - res.push(diag); + res.push(self.create_diag(file, location, format!("reason-string: A revert statement must have a reason string"))); } else { match &j.arguments[0] { Expression::Literal(z) => { if z.value.clone().unwrap().len() > self.max_length as usize { let location = decode_location(&z.src, &file.content); - let diag = LintDiag { - range: Range { - start: Position { line: location.0.line as u64, character: location.0.column as u64 }, - end: Position { line: location.1.line as u64, character: location.1.column as u64 }, - length: location.0.length as u64 - }, - message: format!("reason-string: A revert statement must have a reason string of length less than {}", self.max_length), - severity: Some(self.data.severity), - code: None, - source: None, - uri: file.path.clone(), - source_file_content: file.content.clone(), - }; - res.push(diag); + res.push(self.create_diag(file, location, format!("reason-string: A revert statement must have a reason string of length less than {}", self.max_length))); } } _ => {} diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/order/import_on_top.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/order/import_on_top.rs index 11829a80..7b297ea7 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/order/import_on_top.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/order/import_on_top.rs @@ -8,6 +8,30 @@ pub struct ImportOnTop { } impl RuleType for ImportOnTop { + + fn create_diag(&self, file: &SolidFile, import: &SourceUnitChildNodes, + location: (CodeLocation, CodeLocation)) -> LintDiag { + LintDiag { + range: Range { + start: Position { + line: location.0.line as u64, + character: location.0.column as u64, + }, + end: Position { + line: location.1.line as u64, + character: location.1.column as u64, + }, + length: location.0.length as u64, + }, + message: String("Import must be on top in the file"), + severity: Some(self.data.severity), + code: None, + source: None, + uri: file.path.clone(), + source_file_content: file.content.clone(), + } + } + fn diagnose(&self, file: &SolidFile, _files: &Vec) -> Vec { let mut res = Vec::new(); let mut last_import_location = 0; @@ -28,26 +52,7 @@ impl RuleType for ImportOnTop { SourceUnitChildNodes::ImportDirective(import) => { if i > last_import_location { let location = decode_location(&import.src, &file.content); - - res.push(LintDiag { - range: Range { - start: Position { - line: location.0.line as u64, - character: location.0.column as u64, - }, - end: Position { - line: location.1.line as u64, - character: location.1.column as u64, - }, - length: location.0.length as u64, - }, - message: format!("Import must be on top in the file"), - severity: Some(self.data.severity), - code: None, - source: None, - uri: file.path.clone(), - source_file_content: file.content.clone(), - }); + res.push(self.generate_diagnostic(file, import)); } } _ => {} From 3ca620c58f64f5957d5a4d46c1f8b555d48bde89 Mon Sep 17 00:00:00 2001 From: 0xtekgrinder <72015889+0xtekgrinder@users.noreply.github.com> Date: Sat, 9 Sep 2023 23:19:45 -0400 Subject: [PATCH 047/325] refactor(solidhunter): rename errors file into error --- .../linter/core/solidhunter-lib/src/{errors.rs => error.rs} | 0 toolchains/solidity/linter/core/solidhunter-lib/src/lib.rs | 2 +- toolchains/solidity/linter/core/solidhunter-lib/src/linter.rs | 2 +- .../solidity/linter/core/solidhunter-lib/src/rules/rule_impl.rs | 2 +- toolchains/solidity/linter/core/solidhunter-lib/src/types.rs | 2 +- 5 files changed, 4 insertions(+), 4 deletions(-) rename toolchains/solidity/linter/core/solidhunter-lib/src/{errors.rs => error.rs} (100%) diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/errors.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/error.rs similarity index 100% rename from toolchains/solidity/linter/core/solidhunter-lib/src/errors.rs rename to toolchains/solidity/linter/core/solidhunter-lib/src/error.rs diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/lib.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/lib.rs index 0ba72c7b..87a653a1 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/lib.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/lib.rs @@ -1,4 +1,4 @@ -pub mod errors; +pub mod error; pub mod linter; pub mod rules; pub mod types; diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/linter.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/linter.rs index 66e1b773..415ad961 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/linter.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/linter.rs @@ -1,4 +1,4 @@ -use crate::errors::SolidHunterError; +use crate::error::SolidHunterError; use crate::rules::factory::RuleFactory; use crate::rules::rule_impl::{create_rules_file, parse_rules}; use crate::rules::types::*; diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/rule_impl.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/rule_impl.rs index 025a219e..98b0692d 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/rule_impl.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/rule_impl.rs @@ -1,4 +1,4 @@ -use crate::errors::SolidHunterError; +use crate::error::SolidHunterError; use crate::rules::create_default_rules; use crate::rules::types::*; diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/types.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/types.rs index 0db55003..a360625b 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/types.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/types.rs @@ -1,4 +1,4 @@ -use crate::errors::SolidHunterError; +use crate::error::SolidHunterError; use colored::Colorize; use serde::{Deserialize, Serialize}; use std::fmt; From f58af1e961d96e49662f1711614918a1c80fab33 Mon Sep 17 00:00:00 2001 From: 0xMemoryGrinder <35138272+0xMemoryGrinder@users.noreply.github.com> Date: Sun, 10 Sep 2023 01:44:18 -0400 Subject: [PATCH 048/325] fix(solidity/linter/core): fixed all compilation issues --- .../src/rules/best_practises/line_maxlen.rs | 6 ++++-- .../rules/best_practises/max_states_count.rs | 11 ++++++----- .../src/rules/best_practises/reason_string.rs | 8 +++++--- .../src/rules/miscellaneous/quotes.rs | 9 +++++---- .../rules/naming/contract_name_pascalcase.rs | 8 +++++--- .../src/rules/naming/func_name_camelcase.rs | 8 ++++++-- .../rules/naming/func_param_name_camelcase.rs | 8 +++++--- .../src/rules/naming/use_forbidden_name.rs | 10 +++++++--- .../src/rules/order/import_on_top.rs | 17 ++++++++++------- 9 files changed, 53 insertions(+), 32 deletions(-) diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/line_maxlen.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/line_maxlen.rs index 50ddb2fd..d208edd5 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/line_maxlen.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/line_maxlen.rs @@ -7,8 +7,7 @@ pub struct LineMaxLen { data: RuleEntry, } -impl RuleType for LineMaxLen { - +impl LineMaxLen { fn create_diag(&self, file: &SolidFile, line_idx: usize, line: &str) -> LintDiag { LintDiag { range: Range { @@ -30,7 +29,10 @@ impl RuleType for LineMaxLen { source_file_content: file.content.clone(), } } +} +impl RuleType for LineMaxLen { + fn diagnose(&self, file: &SolidFile, _files: &Vec) -> Vec { let mut res = Vec::new(); let mut line_idx = 1; diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/max_states_count.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/max_states_count.rs index 3c225219..08cde0ec 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/max_states_count.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/max_states_count.rs @@ -8,10 +8,8 @@ pub struct MaxStatesCount { data: RuleEntry, } -impl RuleType for MaxStatesCount { - - fn create_diag(&self, file: &SolidFile, var: &ContractDefinitionChildNodes, - location: (CodeLocation, CodeLocation)) -> LintDiag { +impl MaxStatesCount { + fn create_diag(&self, file: &SolidFile, location: (CodeLocation, CodeLocation), count: usize) -> LintDiag { LintDiag { range: Range { start: Position { @@ -32,6 +30,9 @@ impl RuleType for MaxStatesCount { source_file_content: file.content.clone(), } } +} + +impl RuleType for MaxStatesCount { fn diagnose(&self, file: &SolidFile, _files: &Vec) -> Vec { let mut res = Vec::new(); @@ -52,7 +53,7 @@ impl RuleType for MaxStatesCount { count += 1; if count > self.max_states { let location = decode_location(&var.src, &file.content); - res.push(self.create_diag(file, var, location)); + res.push(self.create_diag(file, location, count)); } } } diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/reason_string.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/reason_string.rs index fe3670a0..5eb664a8 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/reason_string.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/reason_string.rs @@ -1,5 +1,5 @@ use solc_wrapper::ast::utils::{self, get_all_nodes_by_type}; -use solc_wrapper::{decode_location, Expression, NodeType}; +use solc_wrapper::{decode_location, Expression, NodeType, CodeLocation}; use crate::linter::SolidFile; use crate::rules::types::{RuleEntry, RuleType}; @@ -16,8 +16,7 @@ pub struct ReasonString { data: RuleEntry, } -impl RuleType for ReasonString { - +impl ReasonString { fn create_diag(&self, file: &SolidFile, location: (CodeLocation, CodeLocation), message: String) -> LintDiag { LintDiag { range: Range { @@ -39,6 +38,9 @@ impl RuleType for ReasonString { source_file_content: file.content.clone(), } } +} + +impl RuleType for ReasonString { fn diagnose(&self, file: &SolidFile, _files: &Vec) -> Vec { let mut res = Vec::new(); diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/miscellaneous/quotes.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/miscellaneous/quotes.rs index 1e0a2a88..fa572dc8 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/miscellaneous/quotes.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/miscellaneous/quotes.rs @@ -1,4 +1,3 @@ -use solc_wrapper::{CodeLocation, decode_location}; use crate::linter::SolidFile; use crate::rules::types::*; use crate::types::*; @@ -7,9 +6,8 @@ pub struct Quotes { data: RuleEntry, } -impl RuleType for Quotes { - - fn create_diag(&self, file: SolidFile, idx: usize, line_idx: u32) { +impl Quotes { + fn create_diag(&self, file: &SolidFile, idx: usize, line_idx: u64) -> LintDiag { LintDiag { range: Range { start: Position { @@ -30,6 +28,9 @@ impl RuleType for Quotes { source_file_content: file.content.clone(), } } +} + +impl RuleType for Quotes { fn diagnose(&self, file: &SolidFile, _files: &Vec) -> Vec { let mut res = Vec::new(); diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/contract_name_pascalcase.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/contract_name_pascalcase.rs index 48231353..f798a934 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/contract_name_pascalcase.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/contract_name_pascalcase.rs @@ -7,9 +7,8 @@ pub struct ContractNamePascalCase { data: RuleEntry, } -impl RuleType for ContractNamePascalCase { - - fn create_diag(&self, location: (CodeLocation, CodeLocation), file: SolidFile) { +impl ContractNamePascalCase { + fn create_diag(&self, location: (CodeLocation, CodeLocation), file: &SolidFile) -> LintDiag { LintDiag { range: Range { start: Position { @@ -30,6 +29,9 @@ impl RuleType for ContractNamePascalCase { source_file_content: file.content.clone(), } } +} + +impl RuleType for ContractNamePascalCase { fn diagnose(&self, file: &SolidFile, _files: &Vec) -> Vec { let mut res = Vec::new(); diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/func_name_camelcase.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/func_name_camelcase.rs index 5a9e8b24..ab0c6cc7 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/func_name_camelcase.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/func_name_camelcase.rs @@ -7,8 +7,8 @@ pub struct FuncNameCamelCase { data: RuleEntry, } -impl RuleType for FuncNameCamelCase { - fn create_diag(&self, location: (CodeLocation, CodeLocation), file: SolidFile) { +impl FuncNameCamelCase { + fn create_diag(&self, location: (CodeLocation, CodeLocation), file: &SolidFile) -> LintDiag { LintDiag { range: Range { start: Position { @@ -29,6 +29,10 @@ impl RuleType for FuncNameCamelCase { source_file_content: file.content.clone(), } } +} + +impl RuleType for FuncNameCamelCase { + fn diagnose(&self, file: &SolidFile, _files: &Vec) -> Vec { let mut res = Vec::new(); diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/func_param_name_camelcase.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/func_param_name_camelcase.rs index 4b4c4fa2..19faa8a4 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/func_param_name_camelcase.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/func_param_name_camelcase.rs @@ -7,9 +7,8 @@ pub struct FuncParamNameCamelcase { data: RuleEntry, } -impl RuleType for FuncParamNameCamelcase { - - fn create_diag(&self, location: (CodeLocation, CodeLocation), file: SolidFile) { +impl FuncParamNameCamelcase { + fn create_diag(&self, location: (CodeLocation, CodeLocation), file: &SolidFile) -> LintDiag { LintDiag { range: Range { start: Position { @@ -32,6 +31,9 @@ impl RuleType for FuncParamNameCamelcase { source_file_content: file.content.clone(), } } +} + +impl RuleType for FuncParamNameCamelcase { fn diagnose(&self, file: &SolidFile, _files: &Vec) -> Vec { let mut res = Vec::new(); diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/use_forbidden_name.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/use_forbidden_name.rs index 8e296fde..38ecb51b 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/use_forbidden_name.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/use_forbidden_name.rs @@ -8,9 +8,8 @@ pub struct UseForbiddenName { data: RuleEntry, } -impl RuleType for UseForbiddenName { - - fn create_diag(&self, location: (CodeLocation, CodeLocation), var: Box, file: SolidFile) { +impl UseForbiddenName { + fn create_diag(&self, location: (CodeLocation, CodeLocation), var: Box, file: &SolidFile) -> LintDiag { LintDiag { range: Range { start: Position { @@ -31,6 +30,11 @@ impl RuleType for UseForbiddenName { source_file_content: file.content.clone(), } } +} + +impl RuleType for UseForbiddenName { + + fn diagnose(&self, file: &SolidFile, _files: &Vec) -> Vec { let mut res = Vec::new(); diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/order/import_on_top.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/order/import_on_top.rs index 7b297ea7..d5bc85b4 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/order/import_on_top.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/order/import_on_top.rs @@ -1,16 +1,14 @@ use crate::linter::SolidFile; use crate::rules::types::*; use crate::types::*; -use solc_wrapper::{decode_location, SourceUnitChildNodes}; +use solc_wrapper::{decode_location, SourceUnitChildNodes, CodeLocation}; pub struct ImportOnTop { data: RuleEntry, } -impl RuleType for ImportOnTop { - - fn create_diag(&self, file: &SolidFile, import: &SourceUnitChildNodes, - location: (CodeLocation, CodeLocation)) -> LintDiag { +impl ImportOnTop { + fn create_diag(&self, file: &SolidFile, location: (CodeLocation, CodeLocation)) -> LintDiag { LintDiag { range: Range { start: Position { @@ -23,7 +21,7 @@ impl RuleType for ImportOnTop { }, length: location.0.length as u64, }, - message: String("Import must be on top in the file"), + message: String::from("Import must be on top in the file"), severity: Some(self.data.severity), code: None, source: None, @@ -31,6 +29,11 @@ impl RuleType for ImportOnTop { source_file_content: file.content.clone(), } } +} + +impl RuleType for ImportOnTop { + + fn diagnose(&self, file: &SolidFile, _files: &Vec) -> Vec { let mut res = Vec::new(); @@ -52,7 +55,7 @@ impl RuleType for ImportOnTop { SourceUnitChildNodes::ImportDirective(import) => { if i > last_import_location { let location = decode_location(&import.src, &file.content); - res.push(self.generate_diagnostic(file, import)); + res.push(self.create_diag(file, location)); } } _ => {} From 644b521b68f902c76c0a22ad9abbce6dedd3ee15 Mon Sep 17 00:00:00 2001 From: 0xtekgrinder <0xtekgrinder@protonmail.com> Date: Tue, 12 Sep 2023 08:20:43 +0200 Subject: [PATCH 049/325] tests(solidhunter): add test engine --- toolchains/solidity/linter/core/.gitignore | 3 +- .../linter/core/solidhunter-lib/src/linter.rs | 4 +- .../best_practises/function_max_lines.rs | 1 + .../src/rules/best_practises/line_maxlen.rs | 2 +- .../rules/best_practises/max_states_count.rs | 9 +- .../src/rules/best_practises/reason_string.rs | 11 +- .../src/rules/miscellaneous/quotes.rs | 2 +- .../rules/naming/contract_name_pascalcase.rs | 154 +++++++-------- .../src/rules/naming/func_name_camelcase.rs | 178 ++++++++--------- .../rules/naming/func_param_name_camelcase.rs | 180 +++++++++--------- .../src/rules/naming/use_forbidden_name.rs | 11 +- .../src/rules/order/import_on_top.rs | 162 ++++++++-------- .../solidhunter-lib/src/rules/rule_impl.rs | 1 - .../linter/core/solidhunter-lib/src/types.rs | 8 + .../testdata/LineMaxLen/.solidhunter.json | 65 +++++++ .../testdata/LineMaxLen/findings.csv | 1 + .../core/solidhunter-lib/tests/linter.rs | 81 ++++++++ 17 files changed, 522 insertions(+), 351 deletions(-) create mode 100644 toolchains/solidity/linter/core/solidhunter-lib/testdata/LineMaxLen/.solidhunter.json create mode 100644 toolchains/solidity/linter/core/solidhunter-lib/testdata/LineMaxLen/findings.csv create mode 100644 toolchains/solidity/linter/core/solidhunter-lib/tests/linter.rs diff --git a/toolchains/solidity/linter/core/.gitignore b/toolchains/solidity/linter/core/.gitignore index 4940fa07..9f672f43 100644 --- a/toolchains/solidity/linter/core/.gitignore +++ b/toolchains/solidity/linter/core/.gitignore @@ -10,4 +10,5 @@ target # These are backup files generated by rustfmt **/*.rs.bk -.solidhunter.json \ No newline at end of file +.solidhunter.json +!/solidhunter-lib/**/**/.solidhunter.json diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/linter.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/linter.rs index 415ad961..fd326bd1 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/linter.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/linter.rs @@ -140,7 +140,9 @@ impl SolidLinter { if let Ok(entries) = glob(&*(folder + "/**/*.sol")) { for entry in entries { if let Ok(path) = entry { - result.push(self.parse_file(String::from(path.into_os_string().into_string().unwrap()))); + result.push( + self.parse_file(String::from(path.into_os_string().into_string().unwrap())), + ); } } } diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/function_max_lines.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/function_max_lines.rs index 7a7fcd29..b2b5febd 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/function_max_lines.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/function_max_lines.rs @@ -23,6 +23,7 @@ impl RuleType for FunctionMaxLines { let _report = check_function_lines(_file, function, self.number_max_lines); if let Some(report) = _report { res.push(LintDiag { + id: Self::RULE_ID.to_string(), range: report, severity: Some(Severity::WARNING), code: None, diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/line_maxlen.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/line_maxlen.rs index d208edd5..b4d2be23 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/line_maxlen.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/line_maxlen.rs @@ -21,6 +21,7 @@ impl LineMaxLen { }, length: (line.len() - self.max_len) as u64, }, + id: "line-max-len".to_string(), message: format!("Line is too long: {}", line.len()), severity: Some(self.data.severity), code: None, @@ -32,7 +33,6 @@ impl LineMaxLen { } impl RuleType for LineMaxLen { - fn diagnose(&self, file: &SolidFile, _files: &Vec) -> Vec { let mut res = Vec::new(); let mut line_idx = 1; diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/max_states_count.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/max_states_count.rs index 08cde0ec..793ef258 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/max_states_count.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/max_states_count.rs @@ -9,8 +9,14 @@ pub struct MaxStatesCount { } impl MaxStatesCount { - fn create_diag(&self, file: &SolidFile, location: (CodeLocation, CodeLocation), count: usize) -> LintDiag { + fn create_diag( + &self, + file: &SolidFile, + location: (CodeLocation, CodeLocation), + count: usize, + ) -> LintDiag { LintDiag { + id: Self::RULE_ID.to_string(), range: Range { start: Position { line: location.0.line as u64, @@ -33,7 +39,6 @@ impl MaxStatesCount { } impl RuleType for MaxStatesCount { - fn diagnose(&self, file: &SolidFile, _files: &Vec) -> Vec { let mut res = Vec::new(); diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/reason_string.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/reason_string.rs index 5eb664a8..7ad81518 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/reason_string.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/reason_string.rs @@ -1,5 +1,5 @@ use solc_wrapper::ast::utils::{self, get_all_nodes_by_type}; -use solc_wrapper::{decode_location, Expression, NodeType, CodeLocation}; +use solc_wrapper::{decode_location, CodeLocation, Expression, NodeType}; use crate::linter::SolidFile; use crate::rules::types::{RuleEntry, RuleType}; @@ -17,8 +17,14 @@ pub struct ReasonString { } impl ReasonString { - fn create_diag(&self, file: &SolidFile, location: (CodeLocation, CodeLocation), message: String) -> LintDiag { + fn create_diag( + &self, + file: &SolidFile, + location: (CodeLocation, CodeLocation), + message: String, + ) -> LintDiag { LintDiag { + id: RULE_ID.to_string(), range: Range { start: Position { line: location.0.line as u64, @@ -41,7 +47,6 @@ impl ReasonString { } impl RuleType for ReasonString { - fn diagnose(&self, file: &SolidFile, _files: &Vec) -> Vec { let mut res = Vec::new(); diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/miscellaneous/quotes.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/miscellaneous/quotes.rs index fa572dc8..e1dabdad 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/miscellaneous/quotes.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/miscellaneous/quotes.rs @@ -9,6 +9,7 @@ pub struct Quotes { impl Quotes { fn create_diag(&self, file: &SolidFile, idx: usize, line_idx: u64) -> LintDiag { LintDiag { + id: "quotes".to_string(), range: Range { start: Position { line: line_idx, @@ -31,7 +32,6 @@ impl Quotes { } impl RuleType for Quotes { - fn diagnose(&self, file: &SolidFile, _files: &Vec) -> Vec { let mut res = Vec::new(); let mut line_idx = 1; diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/contract_name_pascalcase.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/contract_name_pascalcase.rs index f798a934..2f5463bf 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/contract_name_pascalcase.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/contract_name_pascalcase.rs @@ -1,77 +1,77 @@ -use crate::linter::SolidFile; -use crate::rules::types::*; -use crate::types::*; -use solc_wrapper::{CodeLocation, decode_location, SourceUnitChildNodes}; - -pub struct ContractNamePascalCase { - data: RuleEntry, -} - -impl ContractNamePascalCase { - fn create_diag(&self, location: (CodeLocation, CodeLocation), file: &SolidFile) -> LintDiag { - LintDiag { - range: Range { - start: Position { - line: location.0.line as u64, - character: location.0.column as u64, - }, - end: Position { - line: location.1.line as u64, - character: location.1.column as u64, - }, - length: location.0.length as u64, - }, - message: format!("Contract name need to be in pascal case"), - severity: Some(self.data.severity), - code: None, - source: None, - uri: file.path.clone(), - source_file_content: file.content.clone(), - } - } -} - -impl RuleType for ContractNamePascalCase { - - fn diagnose(&self, file: &SolidFile, _files: &Vec) -> Vec { - let mut res = Vec::new(); - - for node in &file.data.nodes { - match node { - SourceUnitChildNodes::ContractDefinition(contract) => { - if (contract.name.chars().nth(0).unwrap() >= 'a' - && contract.name.chars().nth(0).unwrap() <= 'z') - || contract.name.contains("_") - || contract.name.contains("-") - { - //Untested - let location = decode_location( - contract.name_location.as_ref().unwrap(), - &file.content, - ); - res.push(self.create_diag(location, file)); - } - } - _ => { - continue; - } - } - } - res - } -} - -impl ContractNamePascalCase { - pub(crate) fn create(data: RuleEntry) -> Box { - let rule = ContractNamePascalCase { data }; - Box::new(rule) - } - - pub(crate) fn create_default() -> RuleEntry { - RuleEntry { - id: "contract-name-pascalcase".to_string(), - severity: Severity::WARNING, - data: vec![], - } - } -} +use crate::linter::SolidFile; +use crate::rules::types::*; +use crate::types::*; +use solc_wrapper::{decode_location, CodeLocation, SourceUnitChildNodes}; + +pub struct ContractNamePascalCase { + data: RuleEntry, +} + +impl ContractNamePascalCase { + fn create_diag(&self, location: (CodeLocation, CodeLocation), file: &SolidFile) -> LintDiag { + LintDiag { + id: "contract-name-pascalcase".to_string(), + range: Range { + start: Position { + line: location.0.line as u64, + character: location.0.column as u64, + }, + end: Position { + line: location.1.line as u64, + character: location.1.column as u64, + }, + length: location.0.length as u64, + }, + message: format!("Contract name need to be in pascal case"), + severity: Some(self.data.severity), + code: None, + source: None, + uri: file.path.clone(), + source_file_content: file.content.clone(), + } + } +} + +impl RuleType for ContractNamePascalCase { + fn diagnose(&self, file: &SolidFile, _files: &Vec) -> Vec { + let mut res = Vec::new(); + + for node in &file.data.nodes { + match node { + SourceUnitChildNodes::ContractDefinition(contract) => { + if (contract.name.chars().nth(0).unwrap() >= 'a' + && contract.name.chars().nth(0).unwrap() <= 'z') + || contract.name.contains("_") + || contract.name.contains("-") + { + //Untested + let location = decode_location( + contract.name_location.as_ref().unwrap(), + &file.content, + ); + res.push(self.create_diag(location, file)); + } + } + _ => { + continue; + } + } + } + res + } +} + +impl ContractNamePascalCase { + pub(crate) fn create(data: RuleEntry) -> Box { + let rule = ContractNamePascalCase { data }; + Box::new(rule) + } + + pub(crate) fn create_default() -> RuleEntry { + RuleEntry { + id: "contract-name-pascalcase".to_string(), + severity: Severity::WARNING, + data: vec![], + } + } +} diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/func_name_camelcase.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/func_name_camelcase.rs index ab0c6cc7..cb43efcc 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/func_name_camelcase.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/func_name_camelcase.rs @@ -1,88 +1,90 @@ -use crate::linter::SolidFile; -use crate::rules::types::*; -use crate::types::*; -use solc_wrapper::{decode_location, ContractDefinitionChildNodes, FunctionDefinitionKind, SourceUnitChildNodes, CodeLocation}; - -pub struct FuncNameCamelCase { - data: RuleEntry, -} - -impl FuncNameCamelCase { - fn create_diag(&self, location: (CodeLocation, CodeLocation), file: &SolidFile) -> LintDiag { - LintDiag { - range: Range { - start: Position { - line: location.0.line as u64, - character: location.0.column as u64, - }, - end: Position { - line: location.1.line as u64, - character: location.1.column as u64, - }, - length: location.0.length as u64, - }, - message: format!("Function name need to be in camel case"), - severity: Some(self.data.severity), - code: None, - source: None, - uri: file.path.clone(), - source_file_content: file.content.clone(), - } - } -} - -impl RuleType for FuncNameCamelCase { - - - fn diagnose(&self, file: &SolidFile, _files: &Vec) -> Vec { - let mut res = Vec::new(); - - for node in &file.data.nodes { - match node { - SourceUnitChildNodes::ContractDefinition(contract) => { - for node in &contract.nodes { - match node { - ContractDefinitionChildNodes::FunctionDefinition(function) => { - if function.kind != FunctionDefinitionKind::Constructor - && (!(function.name.chars().nth(0).unwrap_or(' ') >= 'a' - && function.name.chars().nth(0).unwrap_or(' ') <= 'z') - || function.name.contains('_') - || function.name.contains('-')) - { - //Untested - let location = decode_location( - function.name_location.as_ref().unwrap(), - &file.content, - ); - res.push(self.create_diag(location, file)); - } - } - _ => { - continue; - } - } - } - } - _ => { - continue; - } - } - } - res - } -} - -impl FuncNameCamelCase { - pub(crate) fn create(data: RuleEntry) -> Box { - let rule = FuncNameCamelCase { data }; - Box::new(rule) - } - - pub(crate) fn create_default() -> RuleEntry { - RuleEntry { - id: "func-name-camelcase".to_string(), - severity: Severity::WARNING, - data: vec![], - } - } -} +use crate::linter::SolidFile; +use crate::rules::types::*; +use crate::types::*; +use solc_wrapper::{ + decode_location, CodeLocation, ContractDefinitionChildNodes, FunctionDefinitionKind, + SourceUnitChildNodes, +}; + +pub struct FuncNameCamelCase { + data: RuleEntry, +} + +impl FuncNameCamelCase { + fn create_diag(&self, location: (CodeLocation, CodeLocation), file: &SolidFile) -> LintDiag { + LintDiag { + id: "func-name-camelcase".to_string(), + range: Range { + start: Position { + line: location.0.line as u64, + character: location.0.column as u64, + }, + end: Position { + line: location.1.line as u64, + character: location.1.column as u64, + }, + length: location.0.length as u64, + }, + message: format!("Function name need to be in camel case"), + severity: Some(self.data.severity), + code: None, + source: None, + uri: file.path.clone(), + source_file_content: file.content.clone(), + } + } +} + +impl RuleType for FuncNameCamelCase { + fn diagnose(&self, file: &SolidFile, _files: &Vec) -> Vec { + let mut res = Vec::new(); + + for node in &file.data.nodes { + match node { + SourceUnitChildNodes::ContractDefinition(contract) => { + for node in &contract.nodes { + match node { + ContractDefinitionChildNodes::FunctionDefinition(function) => { + if function.kind != FunctionDefinitionKind::Constructor + && (!(function.name.chars().nth(0).unwrap_or(' ') >= 'a' + && function.name.chars().nth(0).unwrap_or(' ') <= 'z') + || function.name.contains('_') + || function.name.contains('-')) + { + //Untested + let location = decode_location( + function.name_location.as_ref().unwrap(), + &file.content, + ); + res.push(self.create_diag(location, file)); + } + } + _ => { + continue; + } + } + } + } + _ => { + continue; + } + } + } + res + } +} + +impl FuncNameCamelCase { + pub(crate) fn create(data: RuleEntry) -> Box { + let rule = FuncNameCamelCase { data }; + Box::new(rule) + } + + pub(crate) fn create_default() -> RuleEntry { + RuleEntry { + id: "func-name-camelcase".to_string(), + severity: Severity::WARNING, + data: vec![], + } + } +} diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/func_param_name_camelcase.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/func_param_name_camelcase.rs index 19faa8a4..5c7779ac 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/func_param_name_camelcase.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/func_param_name_camelcase.rs @@ -1,90 +1,90 @@ -use crate::linter::SolidFile; -use crate::rules::types::*; -use crate::types::*; -use solc_wrapper::{decode_location, ContractDefinitionChildNodes, SourceUnitChildNodes, CodeLocation}; - -pub struct FuncParamNameCamelcase { - data: RuleEntry, -} - -impl FuncParamNameCamelcase { - fn create_diag(&self, location: (CodeLocation, CodeLocation), file: &SolidFile) -> LintDiag { - LintDiag { - range: Range { - start: Position { - line: location.0.line as u64, - character: location.0.column as u64, - }, - end: Position { - line: location.1.line as u64, - character: location.1.column as u64, - }, - length: location.0.length as u64, - }, - message: format!( - "Parameter name need to be in camel case" - ), - severity: Some(self.data.severity), - code: None, - source: None, - uri: file.path.clone(), - source_file_content: file.content.clone(), - } - } -} - -impl RuleType for FuncParamNameCamelcase { - - fn diagnose(&self, file: &SolidFile, _files: &Vec) -> Vec { - let mut res = Vec::new(); - - for node in &file.data.nodes { - match node { - SourceUnitChildNodes::ContractDefinition(contract) => { - for node in &contract.nodes { - match node { - ContractDefinitionChildNodes::FunctionDefinition(function) => { - for parameter in &function.parameters.parameters { - if !(parameter.name.chars().nth(0).unwrap() >= 'a' - && parameter.name.chars().nth(0).unwrap() <= 'z') - || parameter.name.contains("_") - || parameter.name.contains("-") - { - //Untested - let location = decode_location( - parameter.name_location.as_ref().unwrap(), - &file.content, - ); - res.push(self.create_diag(location, file)); - } - } - } - _ => { - continue; - } - } - } - } - _ => { - continue; - } - } - } - res - } -} - -impl FuncParamNameCamelcase { - pub(crate) fn create(data: RuleEntry) -> Box { - let rule = FuncParamNameCamelcase { data }; - Box::new(rule) - } - - pub(crate) fn create_default() -> RuleEntry { - RuleEntry { - id: "func-param-name-camelcase".to_string(), - severity: Severity::WARNING, - data: vec![], - } - } -} +use crate::linter::SolidFile; +use crate::rules::types::*; +use crate::types::*; +use solc_wrapper::{ + decode_location, CodeLocation, ContractDefinitionChildNodes, SourceUnitChildNodes, +}; + +pub struct FuncParamNameCamelcase { + data: RuleEntry, +} + +impl FuncParamNameCamelcase { + fn create_diag(&self, location: (CodeLocation, CodeLocation), file: &SolidFile) -> LintDiag { + LintDiag { + id: "func-param-name-camelcase".to_string(), + range: Range { + start: Position { + line: location.0.line as u64, + character: location.0.column as u64, + }, + end: Position { + line: location.1.line as u64, + character: location.1.column as u64, + }, + length: location.0.length as u64, + }, + message: format!("Parameter name need to be in camel case"), + severity: Some(self.data.severity), + code: None, + source: None, + uri: file.path.clone(), + source_file_content: file.content.clone(), + } + } +} + +impl RuleType for FuncParamNameCamelcase { + fn diagnose(&self, file: &SolidFile, _files: &Vec) -> Vec { + let mut res = Vec::new(); + + for node in &file.data.nodes { + match node { + SourceUnitChildNodes::ContractDefinition(contract) => { + for node in &contract.nodes { + match node { + ContractDefinitionChildNodes::FunctionDefinition(function) => { + for parameter in &function.parameters.parameters { + if !(parameter.name.chars().nth(0).unwrap() >= 'a' + && parameter.name.chars().nth(0).unwrap() <= 'z') + || parameter.name.contains("_") + || parameter.name.contains("-") + { + //Untested + let location = decode_location( + parameter.name_location.as_ref().unwrap(), + &file.content, + ); + res.push(self.create_diag(location, file)); + } + } + } + _ => { + continue; + } + } + } + } + _ => { + continue; + } + } + } + res + } +} + +impl FuncParamNameCamelcase { + pub(crate) fn create(data: RuleEntry) -> Box { + let rule = FuncParamNameCamelcase { data }; + Box::new(rule) + } + + pub(crate) fn create_default() -> RuleEntry { + RuleEntry { + id: "func-param-name-camelcase".to_string(), + severity: Severity::WARNING, + data: vec![], + } + } +} diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/use_forbidden_name.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/use_forbidden_name.rs index 38ecb51b..acc8d4d8 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/use_forbidden_name.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/use_forbidden_name.rs @@ -9,8 +9,14 @@ pub struct UseForbiddenName { } impl UseForbiddenName { - fn create_diag(&self, location: (CodeLocation, CodeLocation), var: Box, file: &SolidFile) -> LintDiag { + fn create_diag( + &self, + location: (CodeLocation, CodeLocation), + var: Box, + file: &SolidFile, + ) -> LintDiag { LintDiag { + id: "use-forbidden-name".to_string(), range: Range { start: Position { line: location.0.line as u64, @@ -33,9 +39,6 @@ impl UseForbiddenName { } impl RuleType for UseForbiddenName { - - - fn diagnose(&self, file: &SolidFile, _files: &Vec) -> Vec { let mut res = Vec::new(); let blacklist = vec!['I', 'l', 'O']; diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/order/import_on_top.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/order/import_on_top.rs index d5bc85b4..b9ea19ae 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/order/import_on_top.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/order/import_on_top.rs @@ -1,82 +1,80 @@ -use crate::linter::SolidFile; -use crate::rules::types::*; -use crate::types::*; -use solc_wrapper::{decode_location, SourceUnitChildNodes, CodeLocation}; - -pub struct ImportOnTop { - data: RuleEntry, -} - -impl ImportOnTop { - fn create_diag(&self, file: &SolidFile, location: (CodeLocation, CodeLocation)) -> LintDiag { - LintDiag { - range: Range { - start: Position { - line: location.0.line as u64, - character: location.0.column as u64, - }, - end: Position { - line: location.1.line as u64, - character: location.1.column as u64, - }, - length: location.0.length as u64, - }, - message: String::from("Import must be on top in the file"), - severity: Some(self.data.severity), - code: None, - source: None, - uri: file.path.clone(), - source_file_content: file.content.clone(), - } - } -} - -impl RuleType for ImportOnTop { - - - - fn diagnose(&self, file: &SolidFile, _files: &Vec) -> Vec { - let mut res = Vec::new(); - let mut last_import_location = 0; - - for i in 1..file.data.nodes.len() { - match &file.data.nodes[i] { - SourceUnitChildNodes::ImportDirective(_) => { - last_import_location = i; - } - _ => { - break; - } - } - } - - for i in 1..file.data.nodes.len() { - match &file.data.nodes[i] { - SourceUnitChildNodes::ImportDirective(import) => { - if i > last_import_location { - let location = decode_location(&import.src, &file.content); - res.push(self.create_diag(file, location)); - } - } - _ => {} - } - } - - res - } -} - -impl ImportOnTop { - pub(crate) fn create(data: RuleEntry) -> Box { - let rule = ImportOnTop { data }; - Box::new(rule) - } - - pub(crate) fn create_default() -> RuleEntry { - RuleEntry { - id: "import-on-top".to_string(), - severity: Severity::WARNING, - data: vec![], - } - } -} +use crate::linter::SolidFile; +use crate::rules::types::*; +use crate::types::*; +use solc_wrapper::{decode_location, CodeLocation, SourceUnitChildNodes}; + +pub struct ImportOnTop { + data: RuleEntry, +} + +impl ImportOnTop { + fn create_diag(&self, file: &SolidFile, location: (CodeLocation, CodeLocation)) -> LintDiag { + LintDiag { + id: "import-on-top".to_string(), + range: Range { + start: Position { + line: location.0.line as u64, + character: location.0.column as u64, + }, + end: Position { + line: location.1.line as u64, + character: location.1.column as u64, + }, + length: location.0.length as u64, + }, + message: String::from("Import must be on top in the file"), + severity: Some(self.data.severity), + code: None, + source: None, + uri: file.path.clone(), + source_file_content: file.content.clone(), + } + } +} + +impl RuleType for ImportOnTop { + fn diagnose(&self, file: &SolidFile, _files: &Vec) -> Vec { + let mut res = Vec::new(); + let mut last_import_location = 0; + + for i in 1..file.data.nodes.len() { + match &file.data.nodes[i] { + SourceUnitChildNodes::ImportDirective(_) => { + last_import_location = i; + } + _ => { + break; + } + } + } + + for i in 1..file.data.nodes.len() { + match &file.data.nodes[i] { + SourceUnitChildNodes::ImportDirective(import) => { + if i > last_import_location { + let location = decode_location(&import.src, &file.content); + res.push(self.create_diag(file, location)); + } + } + _ => {} + } + } + + res + } +} + +impl ImportOnTop { + pub(crate) fn create(data: RuleEntry) -> Box { + let rule = ImportOnTop { data }; + Box::new(rule) + } + + pub(crate) fn create_default() -> RuleEntry { + RuleEntry { + id: "import-on-top".to_string(), + severity: Severity::WARNING, + data: vec![], + } + } +} diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/rule_impl.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/rule_impl.rs index 98b0692d..5f2fbac4 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/rule_impl.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/rule_impl.rs @@ -2,7 +2,6 @@ use crate::error::SolidHunterError; use crate::rules::create_default_rules; use crate::rules::types::*; - pub fn create_rules_file(path: &str) { let rules = Rules { name: "solidhunter".to_string(), diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/types.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/types.rs index a360625b..0662777c 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/types.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/types.rs @@ -27,6 +27,8 @@ pub struct LintDiag { /// The diagnostic's message. pub message: String, + pub id: String, + pub uri: Uri, #[serde(rename = "sourceFileContent")] @@ -81,6 +83,12 @@ impl fmt::Display for LintDiag { /////////////////// RELATED TYPES: ///////////////////////// //////////////////////////////////////////////////////////// +impl PartialEq for Position { + fn eq(&self, other: &Self) -> bool { + self.line == other.line && self.character == other.character + } +} + #[derive(Clone, Serialize, Deserialize, Debug)] pub struct Position { pub line: u64, diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/LineMaxLen/.solidhunter.json b/toolchains/solidity/linter/core/solidhunter-lib/testdata/LineMaxLen/.solidhunter.json new file mode 100644 index 00000000..b4a09fbf --- /dev/null +++ b/toolchains/solidity/linter/core/solidhunter-lib/testdata/LineMaxLen/.solidhunter.json @@ -0,0 +1,65 @@ +{ + "name": "solidhunter", + "includes": [], + "plugins": [], + "rules": [ + { + "id": "line-max-len", + "severity": "WARNING", + "data": [ + "80" + ] + }, + { + "id": "max-states-count", + "severity": "WARNING", + "data": [ + "15" + ] + }, + { + "id": "function-max-lines", + "severity": "WARNING", + "data": [ + "20" + ] + }, + { + "id": "reason-string", + "severity": "WARNING", + "data": [ + "32" + ] + }, + { + "id": "quotes", + "severity": "ERROR", + "data": [] + }, + { + "id": "func-param-name-camelcase", + "severity": "WARNING", + "data": [] + }, + { + "id": "contract-name-pascalcase", + "severity": "WARNING", + "data": [] + }, + { + "id": "func-name-camelcase", + "severity": "WARNING", + "data": [] + }, + { + "id": "use-forbidden-name", + "severity": "WARNING", + "data": [] + }, + { + "id": "import-on-top", + "severity": "WARNING", + "data": [] + } + ] +} \ No newline at end of file diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/LineMaxLen/findings.csv b/toolchains/solidity/linter/core/solidhunter-lib/testdata/LineMaxLen/findings.csv new file mode 100644 index 00000000..35a86c33 --- /dev/null +++ b/toolchains/solidity/linter/core/solidhunter-lib/testdata/LineMaxLen/findings.csv @@ -0,0 +1 @@ +line-max-len:4:80:12 \ No newline at end of file diff --git a/toolchains/solidity/linter/core/solidhunter-lib/tests/linter.rs b/toolchains/solidity/linter/core/solidhunter-lib/tests/linter.rs new file mode 100644 index 00000000..e4ceae98 --- /dev/null +++ b/toolchains/solidity/linter/core/solidhunter-lib/tests/linter.rs @@ -0,0 +1,81 @@ +use solidhunter_lib::linter::SolidLinter; +use solidhunter_lib::types::Position; +use std::{fs, path::PathBuf}; + +struct Finding { + start: Position, + length: u64, + id: String, +} + +fn test_directory(base_name: &str) { + let mut source = String::new(); + let mut config = String::new(); + let mut expected_findings: Vec = Vec::new(); + + for path in fs::read_dir( + PathBuf::from(env!("CARGO_MANIFEST_DIR")) + .join("testdata") + .join(base_name), + ) + .unwrap() + { + let path = path.unwrap().path(); + + if let Some(filename) = path.file_name().and_then(|name| name.to_str()) { + if filename == "file.sol" { + source = path.to_str().unwrap().to_string(); + } else if filename == ".solidhunter.json" { + config = path.to_str().unwrap().to_string(); + } else if filename == "findings.csv" { + for line in fs::read_to_string(path).unwrap().lines() { + let splitted_line: Vec<&str> = line.split(':').collect(); + expected_findings.push(Finding { + start: Position { + line: splitted_line[1].parse::().unwrap(), + character: splitted_line[2].parse::().unwrap(), + }, + length: splitted_line[3].parse::().unwrap(), + id: splitted_line[0].to_string(), + }); + } + } + } + } + + test_linter(&config, &source, &expected_findings); +} + +fn test_linter(config: &str, source: &str, expected_findings: &Vec) { + println!("{}", config); + let mut linter: SolidLinter = SolidLinter::new(&String::from(config)); + + let result = linter.parse_file(String::from(source)); + match result { + Ok(diags) => { + assert_eq!(diags.len(), expected_findings.len()); + for (i, el) in diags.iter().enumerate() { + assert_eq!(el.id, expected_findings[i].id); + assert_eq!(el.range.start, expected_findings[i].start); + assert_eq!(el.range.length, expected_findings[i].length); + } + } + Err(e) => { + panic!("{}", e); + } + } +} + +macro_rules! test_directories { + ($($dir:ident),+ $(,)?) => {$( + #[allow(non_snake_case)] + #[test] + fn $dir() { + test_directory(stringify!($dir)); + } + )+}; +} + +test_directories! { + LineMaxLen +} From 2d59a35753108844fe28249d89acb0001f5ff92d Mon Sep 17 00:00:00 2001 From: 0xtekgrinder <0xtekgrinder@protonmail.com> Date: Tue, 12 Sep 2023 08:51:43 +0200 Subject: [PATCH 050/325] refactor(solidhunter): clean solidhunter-lib --- .../linter/core/solidhunter-lib/src/linter.rs | 25 ++++++++----------- .../best_practises/function_max_lines.rs | 10 +++----- .../src/rules/best_practises/mod.rs | 14 +++++------ .../src/rules/best_practises/reason_string.rs | 8 +++--- .../src/rules/miscellaneous/mod.rs | 6 +---- .../rules/naming/contract_name_pascalcase.rs | 6 ++--- .../src/rules/naming/func_name_camelcase.rs | 2 +- .../rules/naming/func_param_name_camelcase.rs | 6 ++--- .../solidhunter-lib/src/rules/naming/mod.rs | 14 +++++------ .../src/rules/naming/use_forbidden_name.rs | 2 +- .../solidhunter-lib/src/rules/order/mod.rs | 6 +---- 11 files changed, 40 insertions(+), 59 deletions(-) diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/linter.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/linter.rs index fd326bd1..794f519d 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/linter.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/linter.rs @@ -22,8 +22,7 @@ pub struct SolidLinter { impl Default for SolidLinter { fn default() -> Self { - let linter = SolidLinter::new(&String::new()); - linter + SolidLinter::new(&String::new()) } } @@ -34,8 +33,8 @@ impl SolidLinter { rule_factory: RuleFactory::default(), rules: Vec::new(), }; - linter._create_rules(&rules_config, true); - return linter; + linter._create_rules(rules_config, true); + linter } fn _create_rules(&mut self, rules_config: &String, first: bool) { @@ -84,9 +83,9 @@ impl SolidLinter { pub fn parse_file(&mut self, filepath: String) -> LintResult { let res = Solc::default().extract_ast_file(filepath.clone()); - if res.is_err() { + if let Err(res) = res { println!("{:?}", res); - return Err(SolidHunterError::SolcError(res.unwrap_err())); + return Err(SolidHunterError::SolcError(res)); } if self._file_exists(filepath.as_str()) { self._update_file_ast(filepath.as_str(), res.expect("ast not found")); @@ -111,9 +110,9 @@ impl SolidLinter { pub fn parse_content(&mut self, filepath: String, content: &String) -> LintResult { let res = Solc::default().extract_ast_content(content.to_string()); - if res.is_err() { + if let Err(res) = res { println!("{:?}", res); - return Err(SolidHunterError::SolcError(res.unwrap_err())); + return Err(SolidHunterError::SolcError(res)); } if self._file_exists(filepath.as_str()) { @@ -137,13 +136,9 @@ impl SolidLinter { pub fn parse_folder(&mut self, folder: String) -> Vec { let mut result: Vec = Vec::new(); - if let Ok(entries) = glob(&*(folder + "/**/*.sol")) { - for entry in entries { - if let Ok(path) = entry { - result.push( - self.parse_file(String::from(path.into_os_string().into_string().unwrap())), - ); - } + if let Ok(entries) = glob(&(folder + "/**/*.sol")) { + for entry in entries.flatten() { + result.push(self.parse_file(entry.into_os_string().into_string().unwrap())); } } result diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/function_max_lines.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/function_max_lines.rs index b2b5febd..14b57627 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/function_max_lines.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/function_max_lines.rs @@ -20,7 +20,7 @@ impl RuleType for FunctionMaxLines { let functions = get_all_functions_from_ast(&_file.data.nodes); for function in functions { - let _report = check_function_lines(_file, function, self.number_max_lines); + let _report = check_function_lines(_file, Box::new(function), self.number_max_lines); if let Some(report) = _report { res.push(LintDiag { id: Self::RULE_ID.to_string(), @@ -48,7 +48,7 @@ fn check_function_lines( let function_copy_name_location = &function.src; let (_start, _) = decode_location(function_copy_name_location.as_str(), _file.content.as_str()); let index = function_copy_name_location - .split(":") + .split(':') .collect::>()[0] .parse::() .unwrap(); @@ -88,9 +88,7 @@ fn check_function_lines( res } -fn get_all_functions_from_ast( - ast_nodes: &Vec, -) -> Vec> { +fn get_all_functions_from_ast(ast_nodes: &Vec) -> Vec { let mut res = Vec::new(); for node in ast_nodes { @@ -103,7 +101,7 @@ fn get_all_functions_from_ast( ContractDefinitionChildNodes::FunctionDefinition(function) => function, _ => continue, }; - res.push(function.clone()); + res.push(*function.clone()); } } res diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/mod.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/mod.rs index 845683f9..7ab23cfb 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/mod.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/mod.rs @@ -16,14 +16,12 @@ use crate::rules::best_practises::reason_string::ReasonString; use crate::rules::RuleBuilder; pub fn create_default_rules() -> Vec { - let mut rules = Vec::new(); - - rules.push(LineMaxLen::create_default()); - rules.push(MaxStatesCount::create_default()); - rules.push(FunctionMaxLines::create_default()); - rules.push(ReasonString::create_default()); - - rules + vec![ + LineMaxLen::create_default(), + MaxStatesCount::create_default(), + FunctionMaxLines::create_default(), + ReasonString::create_default(), + ] } pub fn create_rules() -> HashMap Box> { diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/reason_string.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/reason_string.rs index 7ad81518..e5a67338 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/reason_string.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/reason_string.rs @@ -36,7 +36,7 @@ impl ReasonString { }, length: location.0.length as u64, }, - message: message, + message, severity: Some(self.data.severity), code: None, source: None, @@ -58,7 +58,7 @@ impl RuleType for ReasonString { if v.name == "require" { if j.arguments.len() != 2 { let location = decode_location(&j.src, &file.content); - res.push(self.create_diag(file, location, format!("reason-string: A require statement must have a reason string"))); + res.push(self.create_diag(file, location, "reason-string: A require statement must have a reason string".to_string())); } else { for nj in &j.arguments { match nj { @@ -76,9 +76,9 @@ impl RuleType for ReasonString { } } } else if v.name == "revert" { - if j.arguments.len() == 0 { + if j.arguments.is_empty() { let location = decode_location(&j.src, &file.content); - res.push(self.create_diag(file, location, format!("reason-string: A revert statement must have a reason string"))); + res.push(self.create_diag(file, location, "reason-string: A revert statement must have a reason string".to_string())); } else { match &j.arguments[0] { Expression::Literal(z) => { diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/miscellaneous/mod.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/miscellaneous/mod.rs index 2db97300..a2ff21c0 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/miscellaneous/mod.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/miscellaneous/mod.rs @@ -10,11 +10,7 @@ use crate::rules::miscellaneous::quotes::Quotes; use crate::rules::RuleBuilder; pub fn create_default_rules() -> Vec { - let mut rules = Vec::new(); - - rules.push(Quotes::create_default()); - - rules + vec![Quotes::create_default()] } pub fn create_rules() -> HashMap Box> { diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/contract_name_pascalcase.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/contract_name_pascalcase.rs index 2f5463bf..e85e5aa1 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/contract_name_pascalcase.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/contract_name_pascalcase.rs @@ -22,7 +22,7 @@ impl ContractNamePascalCase { }, length: location.0.length as u64, }, - message: format!("Contract name need to be in pascal case"), + message: "Contract name need to be in pascal case".to_string(), severity: Some(self.data.severity), code: None, source: None, @@ -41,8 +41,8 @@ impl RuleType for ContractNamePascalCase { SourceUnitChildNodes::ContractDefinition(contract) => { if (contract.name.chars().nth(0).unwrap() >= 'a' && contract.name.chars().nth(0).unwrap() <= 'z') - || contract.name.contains("_") - || contract.name.contains("-") + || contract.name.contains('_') + || contract.name.contains('-') { //Untested let location = decode_location( diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/func_name_camelcase.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/func_name_camelcase.rs index cb43efcc..4c99c920 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/func_name_camelcase.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/func_name_camelcase.rs @@ -25,7 +25,7 @@ impl FuncNameCamelCase { }, length: location.0.length as u64, }, - message: format!("Function name need to be in camel case"), + message: "Function name need to be in camel case".to_string(), severity: Some(self.data.severity), code: None, source: None, diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/func_param_name_camelcase.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/func_param_name_camelcase.rs index 5c7779ac..1b06ca49 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/func_param_name_camelcase.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/func_param_name_camelcase.rs @@ -24,7 +24,7 @@ impl FuncParamNameCamelcase { }, length: location.0.length as u64, }, - message: format!("Parameter name need to be in camel case"), + message: "Parameter name need to be in camel case".to_string(), severity: Some(self.data.severity), code: None, source: None, @@ -47,8 +47,8 @@ impl RuleType for FuncParamNameCamelcase { for parameter in &function.parameters.parameters { if !(parameter.name.chars().nth(0).unwrap() >= 'a' && parameter.name.chars().nth(0).unwrap() <= 'z') - || parameter.name.contains("_") - || parameter.name.contains("-") + || parameter.name.contains('_') + || parameter.name.contains('-') { //Untested let location = decode_location( diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/mod.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/mod.rs index 011499a8..6c29aec3 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/mod.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/mod.rs @@ -15,14 +15,12 @@ pub(crate) mod use_forbidden_name; // List all rules pub fn create_default_rules() -> Vec { - let mut rules = Vec::new(); - - rules.push(FuncParamNameCamelcase::create_default()); - rules.push(ContractNamePascalCase::create_default()); - rules.push(FuncNameCamelCase::create_default()); - rules.push(UseForbiddenName::create_default()); - - rules + vec![ + FuncParamNameCamelcase::create_default(), + ContractNamePascalCase::create_default(), + FuncNameCamelCase::create_default(), + UseForbiddenName::create_default(), + ] } pub fn create_rules() -> HashMap Box> { diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/use_forbidden_name.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/use_forbidden_name.rs index acc8d4d8..982caf52 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/use_forbidden_name.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/use_forbidden_name.rs @@ -41,7 +41,7 @@ impl UseForbiddenName { impl RuleType for UseForbiddenName { fn diagnose(&self, file: &SolidFile, _files: &Vec) -> Vec { let mut res = Vec::new(); - let blacklist = vec!['I', 'l', 'O']; + let blacklist = ['I', 'l', 'O']; let nodes = get_all_nodes_by_type(file.data.clone(), NodeType::VariableDeclaration); diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/order/mod.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/order/mod.rs index 8956cfb6..a235f67d 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/order/mod.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/order/mod.rs @@ -10,11 +10,7 @@ use crate::rules::order::import_on_top::ImportOnTop; use crate::rules::RuleBuilder; pub fn create_default_rules() -> Vec { - let mut rules = Vec::new(); - - rules.push(ImportOnTop::create_default()); - - rules + vec![ImportOnTop::create_default()] } pub fn create_rules() -> HashMap Box> { From e8ade81d11325c4fbbc3afdf22df9e7594fe24bf Mon Sep 17 00:00:00 2001 From: 0xtekgrinder <0xtekgrinder@protonmail.com> Date: Tue, 12 Sep 2023 09:05:40 +0200 Subject: [PATCH 051/325] revert: SolidHunter::IoError --- toolchains/solidity/linter/core/solidhunter-lib/src/error.rs | 2 +- toolchains/solidity/linter/core/solidhunter-lib/src/linter.rs | 2 +- .../solidity/linter/core/solidhunter-lib/src/rules/rule_impl.rs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/error.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/error.rs index b76e67a8..49e0d7a3 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/error.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/error.rs @@ -14,5 +14,5 @@ pub enum SolidHunterError { // RulesError #[error("SolidHunterError: IO error occured with Rules")] - IoError(String), + IoError(std::io::Error), } diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/linter.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/linter.rs index 794f519d..159a6616 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/linter.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/linter.rs @@ -91,7 +91,7 @@ impl SolidLinter { self._update_file_ast(filepath.as_str(), res.expect("ast not found")); } else { let content = fs::read_to_string(filepath.clone()) - .map_err(|e| SolidHunterError::IoError(e.to_string()))?; + .map_err(|e| SolidHunterError::IoError(e))?; self._add_file( filepath.as_str(), res.expect("ast not found"), diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/rule_impl.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/rule_impl.rs index 5f2fbac4..ef52aa07 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/rule_impl.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/rule_impl.rs @@ -17,7 +17,7 @@ pub fn create_rules_file(path: &str) { pub fn parse_rules(path: &str) -> Result { if !std::path::Path::new(&path).is_file() { return Err(SolidHunterError::IoError( - "Rules file not found".to_string(), + std::io::Error::new(std::io::ErrorKind::NotFound, "Rules file not found") )); } let file = std::fs::read_to_string(path)?; From 6e1b2cf4feab34570c1e1cd707c97d4c51b2d842 Mon Sep 17 00:00:00 2001 From: 0xtekgrinder <0xtekgrinder@protonmail.com> Date: Wed, 13 Sep 2023 06:18:41 +0200 Subject: [PATCH 052/325] feat(solidhunter): update test engine to search for the finding --- .../testdata/LineMaxLen/file.sol | 5 +++++ .../testdata/LineMaxLen/findings.csv | 2 +- .../core/solidhunter-lib/tests/linter.rs | 20 +++++++++++++------ 3 files changed, 20 insertions(+), 7 deletions(-) create mode 100644 toolchains/solidity/linter/core/solidhunter-lib/testdata/LineMaxLen/file.sol diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/LineMaxLen/file.sol b/toolchains/solidity/linter/core/solidhunter-lib/testdata/LineMaxLen/file.sol new file mode 100644 index 00000000..b75e6422 --- /dev/null +++ b/toolchains/solidity/linter/core/solidhunter-lib/testdata/LineMaxLen/file.sol @@ -0,0 +1,5 @@ +pragma solidity 0.8.0; + +contract Test { + event ThisIsATooLongEventNameToBeAllowedByTheLinterSoItShouldThrowAnErrorPrettySoon(); +} \ No newline at end of file diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/LineMaxLen/findings.csv b/toolchains/solidity/linter/core/solidhunter-lib/testdata/LineMaxLen/findings.csv index 35a86c33..66932d7e 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/testdata/LineMaxLen/findings.csv +++ b/toolchains/solidity/linter/core/solidhunter-lib/testdata/LineMaxLen/findings.csv @@ -1 +1 @@ -line-max-len:4:80:12 \ No newline at end of file +line-max-len:4:80:10 \ No newline at end of file diff --git a/toolchains/solidity/linter/core/solidhunter-lib/tests/linter.rs b/toolchains/solidity/linter/core/solidhunter-lib/tests/linter.rs index e4ceae98..85cbc3c5 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/tests/linter.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/tests/linter.rs @@ -47,18 +47,26 @@ fn test_directory(base_name: &str) { } fn test_linter(config: &str, source: &str, expected_findings: &Vec) { - println!("{}", config); let mut linter: SolidLinter = SolidLinter::new(&String::from(config)); let result = linter.parse_file(String::from(source)); match result { Ok(diags) => { - assert_eq!(diags.len(), expected_findings.len()); - for (i, el) in diags.iter().enumerate() { - assert_eq!(el.id, expected_findings[i].id); - assert_eq!(el.range.start, expected_findings[i].start); - assert_eq!(el.range.length, expected_findings[i].length); + assert_eq!(diags.len(), expected_findings.len(), "Wrong number of findings for {}", source); + let mut found = false; + + for (_, diag) in diags.iter().enumerate() { + for (_, expected_finding) in expected_findings.iter().enumerate() { + if (diag.range.start == expected_finding.start) + && (diag.range.length == expected_finding.length) + && (diag.id == expected_finding.id) + { + found = true; + break; + } + } } + assert_eq!(found, true, "Can't find the diagnostic for {}", source); } Err(e) => { panic!("{}", e); From 511e80cabdd887face98e483e06b45a48dbd84d4 Mon Sep 17 00:00:00 2001 From: 0xtekgrinder <0xtekgrinder@protonmail.com> Date: Wed, 13 Sep 2023 06:20:42 +0200 Subject: [PATCH 053/325] chore(solidhunter): remove removeme file --- remove-me-ca154a86e5b94f5db084.txt | 1 - .../solidity/linter/core/solidhunter-lib/src/lib.rs | 9 +-------- 2 files changed, 1 insertion(+), 9 deletions(-) delete mode 100644 remove-me-ca154a86e5b94f5db084.txt diff --git a/remove-me-ca154a86e5b94f5db084.txt b/remove-me-ca154a86e5b94f5db084.txt deleted file mode 100644 index d92993f9..00000000 --- a/remove-me-ca154a86e5b94f5db084.txt +++ /dev/null @@ -1 +0,0 @@ -ca154a86e5b94f5db084 diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/lib.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/lib.rs index 87a653a1..460aae37 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/lib.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/lib.rs @@ -1,11 +1,4 @@ pub mod error; pub mod linter; pub mod rules; -pub mod types; - -#[cfg(test)] -mod tests { - - #[test] - fn it_works() {} -} +pub mod types; \ No newline at end of file From cbf13510bad8d5b028e8e5aa3e5bd2003386bb83 Mon Sep 17 00:00:00 2001 From: Astrodevs CI Date: Wed, 13 Sep 2023 23:00:22 +0000 Subject: [PATCH 054/325] chore: create branch feature/49-solidity-linter/69-use-ast-crate-in-solidhunter-staging --- remove-me-1b9390d0431343b6a1aa.txt | 1 + 1 file changed, 1 insertion(+) create mode 100644 remove-me-1b9390d0431343b6a1aa.txt diff --git a/remove-me-1b9390d0431343b6a1aa.txt b/remove-me-1b9390d0431343b6a1aa.txt new file mode 100644 index 00000000..3313bfdf --- /dev/null +++ b/remove-me-1b9390d0431343b6a1aa.txt @@ -0,0 +1 @@ +1b9390d0431343b6a1aa From 06e4dfa1930b603e31392bcee7d2d8d3c54aac11 Mon Sep 17 00:00:00 2001 From: 0xtekgrinder <0xtekgrinder@protonmail.com> Date: Thu, 14 Sep 2023 19:41:50 -0400 Subject: [PATCH 055/325] refactor(ast-extractor): make the lib easier to use with errors aside and expose syn-solidity --- libs/ast-extractor/src/errors.rs | 11 +++++++ libs/ast-extractor/src/extract.rs | 32 +++++++------------ libs/ast-extractor/src/lib.rs | 4 +++ .../src/{retriever.rs => retriever/mod.rs} | 5 --- 4 files changed, 27 insertions(+), 25 deletions(-) create mode 100644 libs/ast-extractor/src/errors.rs rename libs/ast-extractor/src/{retriever.rs => retriever/mod.rs} (74%) diff --git a/libs/ast-extractor/src/errors.rs b/libs/ast-extractor/src/errors.rs new file mode 100644 index 00000000..c8192a38 --- /dev/null +++ b/libs/ast-extractor/src/errors.rs @@ -0,0 +1,11 @@ +use syn::Error; +use thiserror::Error; +use proc_macro2::LexError; + +#[derive(Error, Debug)] +pub enum ExtractError { + #[error("Tokenization error: {0}")] + Tokenize(#[from] LexError), + #[error("Parsing error")] + Parse(#[from] Error), +} \ No newline at end of file diff --git a/libs/ast-extractor/src/extract.rs b/libs/ast-extractor/src/extract.rs index 0e462890..7c76aabe 100644 --- a/libs/ast-extractor/src/extract.rs +++ b/libs/ast-extractor/src/extract.rs @@ -1,23 +1,15 @@ -use proc_macro2::{LexError, TokenStream}; /** * extract.rs * Extract AST from solidity source code * author: 0xMemoryGrinder -*/ -use std::str::FromStr; -use syn::Error; -use thiserror::Error; + */ -#[derive(Error, Debug)] -pub enum ExtractError { - #[error("Tokenization error: {0}")] - Tokenize(#[from] LexError), - #[error("Parsing error")] - Parse(#[from] Error), -} +use crate::errors::ExtractError; +use proc_macro2::TokenStream; +use std::str::FromStr; -pub fn extract_ast_from(source: String) -> Result { - let tokens = TokenStream::from_str(source.as_str())?; +pub fn extract_ast_from_content(content: String) -> Result { + let tokens = TokenStream::from_str(content.as_str())?; let ast = syn_solidity::parse2(tokens)?; Ok(ast) } @@ -29,20 +21,20 @@ mod tests { use std::path::PathBuf; #[test] - fn test_extract_ast_from_good() { + fn test_extract_ast_from_content_good() { let mut path = PathBuf::from(env!("CARGO_MANIFEST_DIR")); path.push("tests"); path.push("files"); path.push("good.sol"); let source = fs::read_to_string(path).unwrap(); - let res = extract_ast_from(source); + let res = extract_ast_from_content(source); assert!(res.is_ok()); } #[test] - fn test_extract_ast_from_invalid_token() { + fn test_extract_ast_from_content_invalid_token() { let source = String::from("contract test { function test() public | uint a = 1 } }"); - let result = extract_ast_from(source); + let result = extract_ast_from_content(source); assert!(result.is_err()); assert_eq!( result.unwrap_err().to_string(), @@ -51,9 +43,9 @@ mod tests { } #[test] - fn test_extract_ast_from_missing_semicolumn() { + fn test_extract_ast_from_content_missing_semicolumn() { let source = String::from("contract test { function test() public { uint a = 1 } }"); - let result = extract_ast_from(source); + let result = extract_ast_from_content(source); assert!(result.is_err()); assert_eq!(result.unwrap_err().to_string(), "Parsing error"); } diff --git a/libs/ast-extractor/src/lib.rs b/libs/ast-extractor/src/lib.rs index 0bc0b9b5..3e452dc2 100644 --- a/libs/ast-extractor/src/lib.rs +++ b/libs/ast-extractor/src/lib.rs @@ -1,2 +1,6 @@ pub mod extract; pub mod retriever; +pub mod errors; + +// Expose syn_solidity crate +pub use syn_solidity::*; \ No newline at end of file diff --git a/libs/ast-extractor/src/retriever.rs b/libs/ast-extractor/src/retriever/mod.rs similarity index 74% rename from libs/ast-extractor/src/retriever.rs rename to libs/ast-extractor/src/retriever/mod.rs index 97e6cd01..6b71da32 100644 --- a/libs/ast-extractor/src/retriever.rs +++ b/libs/ast-extractor/src/retriever/mod.rs @@ -1,8 +1,3 @@ -/** - * retriever.rs - * Module for all AST utils functions - * author: 0xMemoryGrinder -*/ mod contract; pub use contract::*; From 6294a4ca48f5cd5d44406fe14bafb1efd304080f Mon Sep 17 00:00:00 2001 From: 0xtekgrinder <0xtekgrinder@protonmail.com> Date: Thu, 14 Sep 2023 19:42:39 -0400 Subject: [PATCH 056/325] =?UTF-8?q?refactor(solidhunter):=20remove=20solc?= =?UTF-8?q?=5Fwrapp=C3=AAr=20and=20replace=20it=20with=20ast=5Fextractor?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- toolchains/solidity/linter/core/Cargo.lock | 1870 ++------------- .../linter/core/solc-wrapper/.gitignore | 1 - .../linter/core/solc-wrapper/Cargo.toml | 19 - .../linter/core/solc-wrapper/src/ast/ast.rs | 2100 ----------------- .../linter/core/solc-wrapper/src/ast/error.rs | 7 - .../linter/core/solc-wrapper/src/ast/mod.rs | 4 - .../linter/core/solc-wrapper/src/ast/parse.rs | 7 - .../linter/core/solc-wrapper/src/ast/utils.rs | 731 ------ .../linter/core/solc-wrapper/src/error.rs | 28 - .../linter/core/solc-wrapper/src/lib.rs | 145 -- .../core/solc-wrapper/src/solc/command.rs | 66 - .../core/solc-wrapper/src/solc/error.rs | 19 - .../linter/core/solc-wrapper/src/solc/mod.rs | 3 - .../solc-wrapper/src/solc/parsing_error.rs | 29 - .../linter/core/solc-wrapper/src/utils.rs | 71 - .../core/solc-wrapper/src/version/error.rs | 19 - .../core/solc-wrapper/src/version/mod.rs | 2 - .../core/solc-wrapper/src/version/version.rs | 87 - .../tests/files/ast/Assignment.json | 23 - .../tests/files/ast/BinaryOperation.json | 42 - .../solc-wrapper/tests/files/ast/Block.json | 6 - .../solc-wrapper/tests/files/ast/Break.json | 5 - .../tests/files/ast/Conditional.json | 61 - .../tests/files/ast/Continue.json | 5 - .../tests/files/ast/ContractDefinition.json | 13 - .../tests/files/ast/DoWhileStatement.json | 33 - .../tests/files/ast/ElementaryTypeName.json | 8 - .../ast/ElementaryTypeNameExpression.json | 17 - .../tests/files/ast/EmitStatement.json | 42 - .../tests/files/ast/EnumDefinition.json | 24 - .../tests/files/ast/EnumValue.json | 7 - .../tests/files/ast/ErrorDefinition.json | 15 - .../tests/files/ast/EventDefinition.json | 20 - .../tests/files/ast/ExpressionStatement.json | 29 - .../tests/files/ast/ForStatement.json | 148 -- .../tests/files/ast/FunctionCall.json | 39 - .../tests/files/ast/FunctionCallOptions.json | 57 - .../tests/files/ast/FunctionDefinition.json | 31 - .../tests/files/ast/FunctionTypeName.json | 72 - .../tests/files/ast/Identifier.json | 12 - .../tests/files/ast/IfStatement.json | 167 -- .../tests/files/ast/ImportDirective.json | 10 - .../tests/files/ast/IndexAccess.json | 32 - .../tests/files/ast/IndexRangeAccess.json | 31 - .../tests/files/ast/InheritanceSpecifier.json | 14 - .../tests/files/ast/InlineAssembly.json | 12 - .../solc-wrapper/tests/files/ast/Literal.json | 9 - .../tests/files/ast/MemberAccess.json | 16 - .../tests/files/ast/ModifierDefinition.json | 74 - .../tests/files/ast/ModifierInvocation.json | 14 - .../tests/files/ast/NewExpression.json | 25 - .../tests/files/ast/ParameterList.json | 27 - .../tests/files/ast/PlaceholderStatement.json | 5 - .../tests/files/ast/PragmaDirective.json | 10 - .../solc-wrapper/tests/files/ast/Return.json | 13 - .../tests/files/ast/RevertStatement.json | 36 - .../tests/files/ast/SourceUnit.json | 8 - .../tests/files/ast/StructDefinition.json | 66 - .../files/ast/StructuredDocumentation.json | 6 - .../tests/files/ast/TryStatement.json | 244 -- .../tests/files/ast/TupleExpression.json | 44 - .../tests/files/ast/TypeDescriptions.json | 4 - .../tests/files/ast/UnaryOperation.json | 22 - .../tests/files/ast/UncheckedBlock.json | 34 - .../ast/UserDefinedValueTypeDefinition.json | 16 - .../tests/files/ast/UsingForDirective.json | 31 - .../tests/files/ast/VariableDeclaration.json | 20 - .../tests/files/ast/WhileStatement.json | 33 - .../linter/core/solidhunter-lib/Cargo.toml | 2 +- .../linter/core/solidhunter-lib/src/error.rs | 4 +- .../linter/core/solidhunter-lib/src/linter.rs | 78 +- 71 files changed, 244 insertions(+), 6780 deletions(-) delete mode 100644 toolchains/solidity/linter/core/solc-wrapper/.gitignore delete mode 100644 toolchains/solidity/linter/core/solc-wrapper/Cargo.toml delete mode 100644 toolchains/solidity/linter/core/solc-wrapper/src/ast/ast.rs delete mode 100644 toolchains/solidity/linter/core/solc-wrapper/src/ast/error.rs delete mode 100644 toolchains/solidity/linter/core/solc-wrapper/src/ast/mod.rs delete mode 100644 toolchains/solidity/linter/core/solc-wrapper/src/ast/parse.rs delete mode 100644 toolchains/solidity/linter/core/solc-wrapper/src/ast/utils.rs delete mode 100644 toolchains/solidity/linter/core/solc-wrapper/src/error.rs delete mode 100644 toolchains/solidity/linter/core/solc-wrapper/src/lib.rs delete mode 100644 toolchains/solidity/linter/core/solc-wrapper/src/solc/command.rs delete mode 100644 toolchains/solidity/linter/core/solc-wrapper/src/solc/error.rs delete mode 100644 toolchains/solidity/linter/core/solc-wrapper/src/solc/mod.rs delete mode 100644 toolchains/solidity/linter/core/solc-wrapper/src/solc/parsing_error.rs delete mode 100644 toolchains/solidity/linter/core/solc-wrapper/src/utils.rs delete mode 100644 toolchains/solidity/linter/core/solc-wrapper/src/version/error.rs delete mode 100644 toolchains/solidity/linter/core/solc-wrapper/src/version/mod.rs delete mode 100644 toolchains/solidity/linter/core/solc-wrapper/src/version/version.rs delete mode 100644 toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/Assignment.json delete mode 100644 toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/BinaryOperation.json delete mode 100644 toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/Block.json delete mode 100644 toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/Break.json delete mode 100644 toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/Conditional.json delete mode 100644 toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/Continue.json delete mode 100644 toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/ContractDefinition.json delete mode 100644 toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/DoWhileStatement.json delete mode 100644 toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/ElementaryTypeName.json delete mode 100644 toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/ElementaryTypeNameExpression.json delete mode 100644 toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/EmitStatement.json delete mode 100644 toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/EnumDefinition.json delete mode 100644 toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/EnumValue.json delete mode 100644 toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/ErrorDefinition.json delete mode 100644 toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/EventDefinition.json delete mode 100644 toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/ExpressionStatement.json delete mode 100644 toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/ForStatement.json delete mode 100644 toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/FunctionCall.json delete mode 100644 toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/FunctionCallOptions.json delete mode 100644 toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/FunctionDefinition.json delete mode 100644 toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/FunctionTypeName.json delete mode 100644 toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/Identifier.json delete mode 100644 toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/IfStatement.json delete mode 100644 toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/ImportDirective.json delete mode 100644 toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/IndexAccess.json delete mode 100644 toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/IndexRangeAccess.json delete mode 100644 toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/InheritanceSpecifier.json delete mode 100644 toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/InlineAssembly.json delete mode 100644 toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/Literal.json delete mode 100644 toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/MemberAccess.json delete mode 100644 toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/ModifierDefinition.json delete mode 100644 toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/ModifierInvocation.json delete mode 100644 toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/NewExpression.json delete mode 100644 toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/ParameterList.json delete mode 100644 toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/PlaceholderStatement.json delete mode 100644 toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/PragmaDirective.json delete mode 100644 toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/Return.json delete mode 100644 toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/RevertStatement.json delete mode 100644 toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/SourceUnit.json delete mode 100644 toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/StructDefinition.json delete mode 100644 toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/StructuredDocumentation.json delete mode 100644 toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/TryStatement.json delete mode 100644 toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/TupleExpression.json delete mode 100644 toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/TypeDescriptions.json delete mode 100644 toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/UnaryOperation.json delete mode 100644 toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/UncheckedBlock.json delete mode 100644 toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/UserDefinedValueTypeDefinition.json delete mode 100644 toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/UsingForDirective.json delete mode 100644 toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/VariableDeclaration.json delete mode 100644 toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/WhileStatement.json diff --git a/toolchains/solidity/linter/core/Cargo.lock b/toolchains/solidity/linter/core/Cargo.lock index d9d49b76..6d557624 100644 --- a/toolchains/solidity/linter/core/Cargo.lock +++ b/toolchains/solidity/linter/core/Cargo.lock @@ -3,1795 +3,393 @@ version = 3 [[package]] -name = "adler" -version = "1.0.2" +name = "anstream" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" - -[[package]] -name = "aes" -version = "0.7.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e8b47f52ea9bae42228d07ec09eb676433d7c4ed1ebdf0f1d1c29ed446f1ab8" -dependencies = [ - "cfg-if", - "cipher", - "cpufeatures", - "opaque-debug", -] - -[[package]] -name = "aho-corasick" -version = "0.7.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc936419f96fa211c1b9166887b38e5e40b19958e5b895be7c1f93adec7071ac" -dependencies = [ - "memchr", -] - -[[package]] -name = "anyhow" -version = "1.0.66" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "216261ddc8289130e551ddcd5ce8a064710c0d064a4d2895c67151c92b5443f6" - -[[package]] -name = "arrayvec" -version = "0.7.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8da52d66c7071e2e3fa2a1e5c6d088fec47b593032b254f5e980de8ea54454d6" - -[[package]] -name = "atty" -version = "0.2.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" -dependencies = [ - "hermit-abi 0.1.19", - "libc", - "winapi", -] - -[[package]] -name = "auto_impl" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a8c1df849285fbacd587de7818cc7d13be6cd2cbcd47a04fb1801b0e2706e33" -dependencies = [ - "proc-macro-error", - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "autocfg" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" - -[[package]] -name = "base64" -version = "0.13.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" - -[[package]] -name = "base64ct" -version = "1.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b645a089122eccb6111b4f81cbc1a49f5900ac4666bb93ac027feaecf15607bf" - -[[package]] -name = "binstall-zip" -version = "0.6.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7d6964f4bcc7bf2b07f47bc20245b08997b5be470e450b5b511d72164151894" -dependencies = [ - "aes", - "byteorder", - "bzip2", - "constant_time_eq", - "crc32fast", - "crossbeam-utils", - "flate2", - "hmac", - "pbkdf2", - "sha1", - "time", - "zstd", -] - -[[package]] -name = "bitflags" -version = "1.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" - -[[package]] -name = "block-buffer" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4152116fd6e9dadb291ae18fc1ec3575ed6d84c29642d97890f4b4a3417297e4" -dependencies = [ - "generic-array", -] - -[[package]] -name = "block-buffer" -version = "0.10.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69cce20737498f97b993470a6e536b8523f0af7892a4f928cceb1ac5e52ebe7e" -dependencies = [ - "generic-array", -] - -[[package]] -name = "bumpalo" -version = "3.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "572f695136211188308f16ad2ca5c851a712c464060ae6974944458eb83880ba" - -[[package]] -name = "byteorder" -version = "1.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" - -[[package]] -name = "bytes" -version = "1.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dfb24e866b15a1af2a1b663f10c6b6b8f397a84aadb828f12e5b289ec23a3a3c" - -[[package]] -name = "bzip2" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6afcd980b5f3a45017c57e57a2fcccbb351cc43a356ce117ef760ef8052b89b0" -dependencies = [ - "bzip2-sys", - "libc", -] - -[[package]] -name = "bzip2-sys" -version = "0.1.11+1.0.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "736a955f3fa7875102d57c82b8cac37ec45224a07fd32d58f9f7a186b6cd4cdc" -dependencies = [ - "cc", - "libc", - "pkg-config", -] - -[[package]] -name = "cc" -version = "1.0.77" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e9f73505338f7d905b19d18738976aae232eb46b8efc15554ffc56deb5d9ebe4" -dependencies = [ - "jobserver", -] - -[[package]] -name = "cfg-if" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" - -[[package]] -name = "cipher" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ee52072ec15386f770805afd189a01c8841be8696bed250fa2f13c4c0d6dfb7" -dependencies = [ - "generic-array", -] - -[[package]] -name = "clap" -version = "3.2.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "71655c45cb9845d3270c9d6df84ebe72b4dad3c2ba3f7023ad47c144e4e473a5" -dependencies = [ - "atty", - "bitflags", - "clap_derive 3.2.18", - "clap_lex 0.2.4", - "indexmap", - "once_cell", - "strsim", - "termcolor", - "textwrap", -] - -[[package]] -name = "clap" -version = "4.0.29" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d63b9e9c07271b9957ad22c173bae2a4d9a81127680962039296abcd2f8251d" -dependencies = [ - "bitflags", - "clap_derive 4.0.21", - "clap_lex 0.3.0", - "is-terminal", - "once_cell", - "strsim", - "termcolor", -] - -[[package]] -name = "clap_derive" -version = "3.2.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea0c8bce528c4be4da13ea6fead8965e95b6073585a2f05204bd8f4119f82a65" -dependencies = [ - "heck", - "proc-macro-error", - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "clap_derive" -version = "4.0.21" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0177313f9f02afc995627906bbd8967e2be069f5261954222dac78290c2b9014" -dependencies = [ - "heck", - "proc-macro-error", - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "clap_lex" -version = "0.2.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2850f2f5a82cbf437dd5af4d49848fbdfc27c157c3d010345776f952765261c5" -dependencies = [ - "os_str_bytes", -] - -[[package]] -name = "clap_lex" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d4198f73e42b4936b35b5bb248d81d2b595ecb170da0bac7655c54eedfa8da8" -dependencies = [ - "os_str_bytes", -] - -[[package]] -name = "colored" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3616f750b84d8f0de8a58bda93e08e2a81ad3f523089b05f1dffecab48c6cbd" -dependencies = [ - "atty", - "lazy_static", - "winapi", -] - -[[package]] -name = "console" -version = "0.14.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3993e6445baa160675931ec041a5e03ca84b9c6e32a056150d3aa2bdda0a1f45" -dependencies = [ - "encode_unicode", - "lazy_static", - "libc", - "regex", - "terminal_size", - "unicode-width", - "winapi", -] - -[[package]] -name = "console" -version = "0.15.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c050367d967ced717c04b65d8c619d863ef9292ce0c5760028655a2fb298718c" -dependencies = [ - "encode_unicode", - "lazy_static", - "libc", - "terminal_size", - "winapi", -] - -[[package]] -name = "constant_time_eq" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "245097e9a4535ee1e3e3931fcfcd55a796a44c643e8596ff6566d68f09b87bbc" - -[[package]] -name = "cpufeatures" -version = "0.2.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28d997bd5e24a5928dd43e46dc529867e207907fe0b239c3477d924f7f2ca320" -dependencies = [ - "libc", -] - -[[package]] -name = "crc32fast" -version = "1.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b540bd8bc810d3885c6ea91e2018302f68baba2129ab3e88f32389ee9370880d" -dependencies = [ - "cfg-if", -] - -[[package]] -name = "crossbeam-utils" -version = "0.8.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fb766fa798726286dbbb842f174001dab8abc7b627a1dd86e0b7222a95d929f" -dependencies = [ - "cfg-if", -] - -[[package]] -name = "crypto-common" -version = "0.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" -dependencies = [ - "generic-array", - "typenum", -] - -[[package]] -name = "dialoguer" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c9dd058f8b65922819fabb4a41e7d1964e56344042c26efbccd465202c23fa0c" -dependencies = [ - "console 0.14.1", - "lazy_static", - "tempfile", - "zeroize", -] - -[[package]] -name = "digest" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3dd60d1080a57a05ab032377049e0591415d2b31afd7028356dbf3cc6dcb066" -dependencies = [ - "generic-array", -] - -[[package]] -name = "digest" -version = "0.10.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8168378f4e5023e7218c89c891c0fd8ecdb5e5e4f18cb78f38cf245dd021e76f" -dependencies = [ - "block-buffer 0.10.3", - "crypto-common", - "subtle", -] - -[[package]] -name = "either" -version = "1.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90e5c1c8368803113bf0c9584fc495a58b86dc8a29edbf8fe877d21d9507e797" - -[[package]] -name = "encode_unicode" -version = "0.3.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a357d28ed41a50f9c765dbfe56cbc04a64e53e5fc58ba79fbc34c10ef3df831f" - -[[package]] -name = "encoding_rs" -version = "0.8.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9852635589dc9f9ea1b6fe9f05b50ef208c85c834a562f0c6abb1c475736ec2b" -dependencies = [ - "cfg-if", -] - -[[package]] -name = "errno" -version = "0.2.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f639046355ee4f37944e44f60642c6f3a7efa3cf6b78c78a0d989a8ce6c396a1" -dependencies = [ - "errno-dragonfly", - "libc", - "winapi", -] - -[[package]] -name = "errno-dragonfly" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa68f1b12764fab894d2755d2518754e71b4fd80ecfb822714a1206c2aab39bf" -dependencies = [ - "cc", - "libc", -] - -[[package]] -name = "fastrand" -version = "1.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7a407cfaa3385c4ae6b23e84623d48c2798d06e3e6a1878f7f59f17b3f86499" -dependencies = [ - "instant", -] - -[[package]] -name = "flate2" -version = "1.0.25" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8a2db397cb1c8772f31494cb8917e48cd1e64f0fa7efac59fbd741a0a8ce841" -dependencies = [ - "crc32fast", - "miniz_oxide", -] - -[[package]] -name = "fnv" -version = "1.0.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" - -[[package]] -name = "form_urlencoded" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9c384f161156f5260c24a097c56119f9be8c798586aecc13afbcbe7b7e26bf8" -dependencies = [ - "percent-encoding", -] - -[[package]] -name = "fs2" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9564fc758e15025b46aa6643b1b77d047d1a56a1aea6e01002ac0c7026876213" -dependencies = [ - "libc", - "winapi", -] - -[[package]] -name = "futures-channel" -version = "0.3.25" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "52ba265a92256105f45b719605a571ffe2d1f0fea3807304b522c1d778f79eed" -dependencies = [ - "futures-core", -] - -[[package]] -name = "futures-core" -version = "0.3.25" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04909a7a7e4633ae6c4a9ab280aeb86da1236243a77b694a49eacd659a4bd3ac" - -[[package]] -name = "futures-io" -version = "0.3.25" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00f5fb52a06bdcadeb54e8d3671f8888a39697dcb0b81b23b55174030427f4eb" - -[[package]] -name = "futures-sink" -version = "0.3.25" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39c15cf1a4aa79df40f1bb462fb39676d0ad9e366c2a33b590d7c66f4f81fcf9" - -[[package]] -name = "futures-task" -version = "0.3.25" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2ffb393ac5d9a6eaa9d3fdf37ae2776656b706e200c8e16b1bdb227f5198e6ea" - -[[package]] -name = "futures-util" -version = "0.3.25" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "197676987abd2f9cadff84926f410af1c183608d36641465df73ae8211dc65d6" -dependencies = [ - "futures-core", - "futures-io", - "futures-task", - "memchr", - "pin-project-lite", - "pin-utils", - "slab", -] - -[[package]] -name = "generic-array" -version = "0.14.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bff49e947297f3312447abdca79f45f4738097cc82b06e72054d2223f601f1b9" -dependencies = [ - "typenum", - "version_check", -] - -[[package]] -name = "glob" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b919933a397b79c37e33b77bb2aa3dc8eb6e165ad809e58ff75bc7db2e34574" - -[[package]] -name = "h2" -version = "0.3.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f9f29bc9dda355256b2916cf526ab02ce0aeaaaf2bad60d65ef3f12f11dd0f4" -dependencies = [ - "bytes", - "fnv", - "futures-core", - "futures-sink", - "futures-util", - "http", - "indexmap", - "slab", - "tokio", - "tokio-util", - "tracing", -] - -[[package]] -name = "hashbrown" -version = "0.12.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" - -[[package]] -name = "heck" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2540771e65fc8cb83cd6e8a237f70c319bd5c29f78ed1084ba5d50eeac86f7f9" - -[[package]] -name = "hermit-abi" -version = "0.1.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" -dependencies = [ - "libc", -] - -[[package]] -name = "hermit-abi" -version = "0.2.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee512640fe35acbfb4bb779db6f0d80704c2cacfa2e39b601ef3e3f47d1ae4c7" -dependencies = [ - "libc", -] - -[[package]] -name = "hex" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" - -[[package]] -name = "hmac" -version = "0.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" -dependencies = [ - "digest 0.10.6", -] - -[[package]] -name = "home" -version = "0.5.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "747309b4b440c06d57b0b25f2aee03ee9b5e5397d288c60e21fc709bb98a7408" -dependencies = [ - "winapi", -] - -[[package]] -name = "http" -version = "0.2.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75f43d41e26995c17e71ee126451dd3941010b0514a81a9d11f3b341debc2399" -dependencies = [ - "bytes", - "fnv", - "itoa", -] - -[[package]] -name = "http-body" -version = "0.4.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d5f38f16d184e36f2408a55281cd658ecbd3ca05cce6d6510a176eca393e26d1" -dependencies = [ - "bytes", - "http", - "pin-project-lite", -] - -[[package]] -name = "httparse" -version = "1.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904" - -[[package]] -name = "httpdate" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4a1e36c821dbe04574f602848a19f742f4fb3c98d40449f11bcad18d6b17421" - -[[package]] -name = "hyper" -version = "0.14.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "034711faac9d2166cb1baf1a2fb0b60b1f277f8492fd72176c17f3515e1abd3c" -dependencies = [ - "bytes", - "futures-channel", - "futures-core", - "futures-util", - "h2", - "http", - "http-body", - "httparse", - "httpdate", - "itoa", - "pin-project-lite", - "socket2", - "tokio", - "tower-service", - "tracing", - "want", -] - -[[package]] -name = "hyper-rustls" -version = "0.23.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1788965e61b367cd03a62950836d5cd41560c3577d90e40e0819373194d1661c" -dependencies = [ - "http", - "hyper", - "rustls", - "tokio", - "tokio-rustls", -] - -[[package]] -name = "idna" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e14ddfc70884202db2244c223200c204c2bda1bc6e0998d11b5e024d657209e6" -dependencies = [ - "unicode-bidi", - "unicode-normalization", -] - -[[package]] -name = "indexmap" -version = "1.9.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1885e79c1fc4b10f0e172c475f458b7f7b93061064d98c3293e98c5ba0c8b399" -dependencies = [ - "autocfg", - "hashbrown", -] - -[[package]] -name = "indicatif" -version = "0.16.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d207dc617c7a380ab07ff572a6e52fa202a2a8f355860ac9c38e23f8196be1b" -dependencies = [ - "console 0.15.2", - "lazy_static", - "number_prefix", - "regex", -] - -[[package]] -name = "instant" -version = "0.1.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" -dependencies = [ - "cfg-if", -] - -[[package]] -name = "io-lifetimes" -version = "1.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46112a93252b123d31a119a8d1a1ac19deac4fac6e0e8b0df58f0d4e5870e63c" -dependencies = [ - "libc", - "windows-sys", -] - -[[package]] -name = "ipnet" -version = "2.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "11b0d96e660696543b251e58030cf9787df56da39dab19ad60eae7353040917e" - -[[package]] -name = "is-terminal" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "927609f78c2913a6f6ac3c27a4fe87f43e2a35367c0c4b0f8265e8f49a104330" -dependencies = [ - "hermit-abi 0.2.6", - "io-lifetimes", - "rustix", - "windows-sys", -] - -[[package]] -name = "itertools" -version = "0.10.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" -dependencies = [ - "either", -] - -[[package]] -name = "itoa" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4217ad341ebadf8d8e724e264f13e593e0648f5b3e94b3896a5df283be015ecc" - -[[package]] -name = "jobserver" -version = "0.1.25" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "068b1ee6743e4d11fb9c6a1e6064b3693a1b600e7f5f5988047d98b3dc9fb90b" -dependencies = [ - "libc", -] - -[[package]] -name = "js-sys" -version = "0.3.60" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49409df3e3bf0856b916e2ceaca09ee28e6871cf7d9ce97a692cacfdb2a25a47" -dependencies = [ - "wasm-bindgen", -] - -[[package]] -name = "lazy_static" -version = "1.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" - -[[package]] -name = "libc" -version = "0.2.138" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db6d7e329c562c5dfab7a46a2afabc8b987ab9a4834c9d1ca04dc54c1546cef8" - -[[package]] -name = "linux-raw-sys" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f9f08d8963a6c613f4b1a78f4f4a4dbfadf8e6545b2d72861731e4858b8b47f" - -[[package]] -name = "lock_api" -version = "0.4.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "435011366fe56583b16cf956f9df0095b405b82d76425bc8981c0e22e60ec4df" -dependencies = [ - "autocfg", - "scopeguard", -] - -[[package]] -name = "log" -version = "0.4.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "abb12e687cfb44aa40f41fc3978ef76448f9b6038cad6aef4259d3c095a2382e" -dependencies = [ - "cfg-if", -] - -[[package]] -name = "memchr" -version = "2.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" - -[[package]] -name = "mime" -version = "0.3.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a60c7ce501c71e03a9c9c0d35b861413ae925bd979cc7a4e30d060069aaac8d" - -[[package]] -name = "miniz_oxide" -version = "0.6.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b275950c28b37e794e8c55d88aeb5e139d0ce23fdbbeda68f8d7174abdf9e8fa" -dependencies = [ - "adler", -] - -[[package]] -name = "mio" -version = "0.8.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5d732bc30207a6423068df043e3d02e0735b155ad7ce1a6f76fe2baa5b158de" -dependencies = [ - "libc", - "log", - "wasi", - "windows-sys", -] - -[[package]] -name = "num_cpus" -version = "1.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6058e64324c71e02bc2b150e4f3bc8286db6c83092132ffa3f6b1eab0f9def5" -dependencies = [ - "hermit-abi 0.1.19", - "libc", -] - -[[package]] -name = "number_prefix" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "830b246a0e5f20af87141b25c173cd1b609bd7779a4617d6ec582abaf90870f3" - -[[package]] -name = "once_cell" -version = "1.16.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86f0b0d4bf799edbc74508c1e8bf170ff5f41238e5f8225603ca7caaae2b7860" - -[[package]] -name = "opaque-debug" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5" - -[[package]] -name = "open-fastrlp" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "786393f80485445794f6043fd3138854dd109cc6c4bd1a6383db304c9ce9b9ce" -dependencies = [ - "arrayvec", - "auto_impl", - "bytes", -] - -[[package]] -name = "os_str_bytes" -version = "6.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b7820b9daea5457c9f21c69448905d723fbd21136ccf521748f23fd49e723ee" - -[[package]] -name = "parking_lot" -version = "0.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" -dependencies = [ - "lock_api", - "parking_lot_core", -] - -[[package]] -name = "parking_lot_core" -version = "0.9.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ff9f3fef3968a3ec5945535ed654cb38ff72d7495a25619e2247fb15a2ed9ba" -dependencies = [ - "cfg-if", - "libc", - "redox_syscall", - "smallvec", - "windows-sys", -] - -[[package]] -name = "password-hash" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7676374caaee8a325c9e7a2ae557f216c5563a171d6997b0ef8a65af35147700" -dependencies = [ - "base64ct", - "rand_core", - "subtle", -] - -[[package]] -name = "pbkdf2" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83a0692ec44e4cf1ef28ca317f14f8f07da2d95ec3fa01f86e4467b725e60917" -dependencies = [ - "digest 0.10.6", - "hmac", - "password-hash", - "sha2 0.10.6", -] - -[[package]] -name = "percent-encoding" -version = "2.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "478c572c3d73181ff3c2539045f6eb99e5491218eae919370993b890cdbdd98e" - -[[package]] -name = "pin-project-lite" -version = "0.2.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0a7ae3ac2f1173085d398531c705756c94a4c56843785df85a60c1a0afac116" - -[[package]] -name = "pin-utils" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" - -[[package]] -name = "pkg-config" -version = "0.3.26" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ac9a59f73473f1b8d852421e59e64809f025994837ef743615c6d0c5b305160" - -[[package]] -name = "proc-macro-error" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" -dependencies = [ - "proc-macro-error-attr", - "proc-macro2", - "quote", - "syn", - "version_check", -] - -[[package]] -name = "proc-macro-error-attr" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" -dependencies = [ - "proc-macro2", - "quote", - "version_check", -] - -[[package]] -name = "proc-macro2" -version = "1.0.47" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ea3d908b0e36316caf9e9e2c4625cdde190a7e6f440d794667ed17a1855e725" -dependencies = [ - "unicode-ident", -] - -[[package]] -name = "quote" -version = "1.0.21" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbe448f377a7d6961e30f5955f9b8d106c3f5e449d493ee1b125c1d43c2b5179" -dependencies = [ - "proc-macro2", -] - -[[package]] -name = "rand" -version = "0.8.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" -dependencies = [ - "rand_core", -] - -[[package]] -name = "rand_core" -version = "0.6.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" - -[[package]] -name = "redox_syscall" -version = "0.2.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a" -dependencies = [ - "bitflags", -] - -[[package]] -name = "regex" -version = "1.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e076559ef8e241f2ae3479e36f97bd5741c0330689e217ad51ce2c76808b868a" -dependencies = [ - "aho-corasick", - "memchr", - "regex-syntax", -] - -[[package]] -name = "regex-syntax" -version = "0.6.28" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "456c603be3e8d448b072f410900c09faf164fbce2d480456f50eea6e25f9c848" - -[[package]] -name = "remove_dir_all" -version = "0.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3acd125665422973a33ac9d3dd2df85edad0f4ae9b00dafb1a05e43a9f5ef8e7" -dependencies = [ - "winapi", -] - -[[package]] -name = "reqwest" -version = "0.11.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68cc60575865c7831548863cc02356512e3f1dc2f3f82cb837d7fc4cc8f3c97c" -dependencies = [ - "base64", - "bytes", - "encoding_rs", - "futures-core", - "futures-util", - "h2", - "http", - "http-body", - "hyper", - "hyper-rustls", - "ipnet", - "js-sys", - "log", - "mime", - "once_cell", - "percent-encoding", - "pin-project-lite", - "rustls", - "rustls-pemfile", - "serde", - "serde_json", - "serde_urlencoded", - "tokio", - "tokio-rustls", - "tower-service", - "url", - "wasm-bindgen", - "wasm-bindgen-futures", - "web-sys", - "webpki-roots", - "winreg", -] - -[[package]] -name = "ring" -version = "0.16.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3053cf52e236a3ed746dfc745aa9cacf1b791d846bdaf412f60a8d7d6e17c8fc" -dependencies = [ - "cc", - "libc", - "once_cell", - "spin", - "untrusted", - "web-sys", - "winapi", -] - -[[package]] -name = "rustix" -version = "0.36.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3807b5d10909833d3e9acd1eb5fb988f79376ff10fce42937de71a449c4c588" -dependencies = [ - "bitflags", - "errno", - "io-lifetimes", - "libc", - "linux-raw-sys", - "windows-sys", -] - -[[package]] -name = "rustls" -version = "0.20.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "539a2bfe908f471bfa933876bd1eb6a19cf2176d375f82ef7f99530a40e48c2c" -dependencies = [ - "log", - "ring", - "sct", - "webpki", -] - -[[package]] -name = "rustls-pemfile" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0864aeff53f8c05aa08d86e5ef839d3dfcf07aeba2db32f12db0ef716e87bd55" -dependencies = [ - "base64", -] - -[[package]] -name = "ryu" -version = "1.0.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4501abdff3ae82a1c1b477a17252eb69cee9e66eb915c1abaa4f44d873df9f09" - -[[package]] -name = "scopeguard" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" - -[[package]] -name = "sct" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d53dcdb7c9f8158937a7981b48accfd39a43af418591a5d008c7b22b5e1b7ca4" -dependencies = [ - "ring", - "untrusted", -] - -[[package]] -name = "semver" -version = "1.0.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e25dfac463d778e353db5be2449d1cce89bd6fd23c9f1ea21310ce6e5a1b29c4" -dependencies = [ - "serde", -] - -[[package]] -name = "serde" -version = "1.0.150" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e326c9ec8042f1b5da33252c8a37e9ffbd2c9bef0155215b6e6c80c790e05f91" -dependencies = [ - "serde_derive", -] - -[[package]] -name = "serde_derive" -version = "1.0.150" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42a3df25b0713732468deadad63ab9da1f1fd75a48a15024b50363f128db627e" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "serde_json" -version = "1.0.89" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "020ff22c755c2ed3f8cf162dbb41a7268d934702f3ed3631656ea597e08fc3db" -dependencies = [ - "itoa", - "ryu", - "serde", -] - -[[package]] -name = "serde_urlencoded" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd" -dependencies = [ - "form_urlencoded", - "itoa", - "ryu", - "serde", -] - -[[package]] -name = "sha1" -version = "0.10.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f04293dc80c3993519f2d7f6f511707ee7094fe0c6d3406feb330cdb3540eba3" +checksum = "b1f58811cfac344940f1a400b6e6231ce35171f614f26439e80f8c1465c5cc0c" dependencies = [ - "cfg-if", - "cpufeatures", - "digest 0.10.6", + "anstyle", + "anstyle-parse", + "anstyle-query", + "anstyle-wincon", + "colorchoice", + "utf8parse", ] [[package]] -name = "sha2" -version = "0.9.9" +name = "anstyle" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d58a1e1bf39749807d89cf2d98ac2dfa0ff1cb3faa38fbb64dd88ac8013d800" -dependencies = [ - "block-buffer 0.9.0", - "cfg-if", - "cpufeatures", - "digest 0.9.0", - "opaque-debug", -] +checksum = "b84bf0a05bbb2a83e5eb6fa36bb6e87baa08193c35ff52bbf6b38d8af2890e46" [[package]] -name = "sha2" -version = "0.10.6" +name = "anstyle-parse" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "82e6b795fe2e3b1e845bafcb27aa35405c4d47cdfc92af5fc8d3002f76cebdc0" +checksum = "938874ff5980b03a87c5524b3ae5b59cf99b1d6bc836848df7bc5ada9643c333" dependencies = [ - "cfg-if", - "cpufeatures", - "digest 0.10.6", + "utf8parse", ] [[package]] -name = "signal-hook-registry" -version = "1.4.0" +name = "anstyle-query" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e51e73328dc4ac0c7ccbda3a494dfa03df1de2f46018127f60c693f2648455b0" +checksum = "5ca11d4be1bab0c8bc8734a9aa7bf4ee8316d462a08c6ac5052f888fef5b494b" dependencies = [ - "libc", + "windows-sys", ] [[package]] -name = "slab" -version = "0.4.7" +name = "anstyle-wincon" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4614a76b2a8be0058caa9dbbaf66d988527d86d003c11a94fbd335d7661edcef" +checksum = "58f54d10c6dfa51283a066ceab3ec1ab78d13fae00aa49243a45e4571fb79dfd" dependencies = [ - "autocfg", + "anstyle", + "windows-sys", ] [[package]] -name = "smallvec" -version = "1.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a507befe795404456341dfab10cef66ead4c041f62b8b11bbb92bffe5d0953e0" - -[[package]] -name = "socket2" -version = "0.4.7" +name = "anyhow" +version = "1.0.75" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02e2d2db9033d13a1567121ddd7a095ee144db4e1ca1b1bda3419bc0da294ebd" -dependencies = [ - "libc", - "winapi", -] +checksum = "a4668cab20f66d8d020e1fbc0ebe47217433c1b6c8f2040faf858554e394ace6" [[package]] -name = "solc-wrapper" +name = "ast-extractor" version = "0.1.0" -dependencies = [ - "anyhow", - "hex", - "home", - "once_cell", - "open-fastrlp", - "regex", - "semver", - "serde", - "serde_json", - "svm-rs", - "thiserror", -] - -[[package]] -name = "solidhunter" -version = "0.0.1" -dependencies = [ - "anyhow", - "clap 4.0.29", - "colored", - "glob", - "serde", - "serde_json", - "solidhunter-lib", - "thiserror", -] - -[[package]] -name = "solidhunter-lib" -version = "0.0.1" -dependencies = [ - "anyhow", - "clap 4.0.29", - "colored", - "glob", - "serde", - "serde_json", - "solc-wrapper", - "thiserror", -] - -[[package]] -name = "spin" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" - -[[package]] -name = "strsim" -version = "0.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" - -[[package]] -name = "subtle" -version = "2.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6bdef32e8150c2a081110b42772ffe7d7c9032b606bc226c8260fd97e0976601" - -[[package]] -name = "svm-rs" -version = "0.2.18" -source = "git+https://github.com/roynalnaruto/svm-rs#ad9434b9fe1aee6e87cbbebb4eb15f6182663f52" -dependencies = [ - "anyhow", - "binstall-zip", - "cfg-if", - "clap 3.2.23", - "console 0.14.1", - "dialoguer", - "fs2", - "hex", - "home", - "indicatif", - "itertools", - "once_cell", - "rand", - "reqwest", - "semver", - "serde", - "serde_json", - "sha2 0.9.9", - "tempfile", - "thiserror", - "tokio", - "tracing", - "url", -] - -[[package]] -name = "syn" -version = "1.0.105" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60b9b43d45702de4c839cb9b51d9f529c5dd26a4aff255b42b1ebc03e88ee908" dependencies = [ "proc-macro2", "quote", - "unicode-ident", + "syn", + "syn-solidity", + "thiserror", ] [[package]] -name = "tempfile" -version = "3.3.0" +name = "bitflags" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5cdb1ef4eaeeaddc8fbd371e5017057064af0911902ef36b39801f67cc6d79e4" -dependencies = [ - "cfg-if", - "fastrand", - "libc", - "redox_syscall", - "remove_dir_all", - "winapi", -] +checksum = "b4682ae6287fcf752ecaabbfcc7b6f9b72aa33933dc23a554d853aea8eea8635" [[package]] -name = "termcolor" -version = "1.1.3" +name = "cc" +version = "1.0.83" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bab24d30b911b2376f3a13cc2cd443142f0c81dda04c118693e35b3835757755" +checksum = "f1174fb0b6ec23863f8b971027804a42614e347eafb0a95bf0b12cdae21fc4d0" dependencies = [ - "winapi-util", + "libc", ] [[package]] -name = "terminal_size" -version = "0.1.17" +name = "clap" +version = "4.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "633c1a546cee861a1a6d0dc69ebeca693bf4296661ba7852b9d21d159e0506df" +checksum = "84ed82781cea27b43c9b106a979fe450a13a31aab0500595fb3fc06616de08e6" dependencies = [ - "libc", - "winapi", + "clap_builder", + "clap_derive", ] [[package]] -name = "textwrap" -version = "0.16.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "222a222a5bfe1bba4a77b45ec488a741b3cb8872e5e499451fd7d0129c9c7c3d" - -[[package]] -name = "thiserror" -version = "1.0.37" +name = "clap_builder" +version = "4.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "10deb33631e3c9018b9baf9dcbbc4f737320d2b576bac10f6aefa048fa407e3e" +checksum = "2bb9faaa7c2ef94b2743a21f5a29e6f0010dff4caa69ac8e9d6cf8b6fa74da08" dependencies = [ - "thiserror-impl", + "anstream", + "anstyle", + "clap_lex", + "strsim", ] [[package]] -name = "thiserror-impl" -version = "1.0.37" +name = "clap_derive" +version = "4.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "982d17546b47146b28f7c22e3d08465f6b8903d0ea13c1660d9d84a6e7adcdbb" +checksum = "0862016ff20d69b84ef8247369fabf5c008a7417002411897d40ee1f4532b873" dependencies = [ + "heck", "proc-macro2", "quote", "syn", ] [[package]] -name = "time" -version = "0.3.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a561bf4617eebd33bca6434b988f39ed798e527f51a1e797d0ee4f61c0a38376" -dependencies = [ - "itoa", - "serde", - "time-core", - "time-macros", -] - -[[package]] -name = "time-core" -version = "0.1.0" +name = "clap_lex" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e153e1f1acaef8acc537e68b44906d2db6436e2b35ac2c6b42640fff91f00fd" +checksum = "cd7cc57abe963c6d3b9d8be5b06ba7c8957a930305ca90304f24ef040aa6f961" [[package]] -name = "time-macros" -version = "0.2.6" +name = "colorchoice" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d967f99f534ca7e495c575c62638eebc2898a8c84c119b89e250477bc4ba16b2" -dependencies = [ - "time-core", -] +checksum = "acbf1af155f9b9ef647e42cdc158db4b64a1b61f743629225fde6f3e0be2a7c7" [[package]] -name = "tinyvec" -version = "1.6.0" +name = "colored" +version = "2.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" +checksum = "2674ec482fbc38012cf31e6c42ba0177b431a0cb6f15fe40efa5aab1bda516f6" dependencies = [ - "tinyvec_macros", + "is-terminal", + "lazy_static", + "windows-sys", ] [[package]] -name = "tinyvec_macros" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c" - -[[package]] -name = "tokio" -version = "1.23.0" +name = "errno" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eab6d665857cc6ca78d6e80303a02cea7a7851e85dfbd77cbdc09bd129f1ef46" +checksum = "136526188508e25c6fef639d7927dfb3e0e3084488bf202267829cf7fc23dbdd" dependencies = [ - "autocfg", - "bytes", + "errno-dragonfly", "libc", - "memchr", - "mio", - "num_cpus", - "parking_lot", - "pin-project-lite", - "signal-hook-registry", - "socket2", - "tokio-macros", "windows-sys", ] [[package]] -name = "tokio-macros" -version = "1.8.2" +name = "errno-dragonfly" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d266c00fde287f55d3f1c3e96c500c362a2b8c695076ec180f27918820bc6df8" +checksum = "aa68f1b12764fab894d2755d2518754e71b4fd80ecfb822714a1206c2aab39bf" dependencies = [ - "proc-macro2", - "quote", - "syn", + "cc", + "libc", ] [[package]] -name = "tokio-rustls" -version = "0.23.4" +name = "glob" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c43ee83903113e03984cb9e5cebe6c04a5116269e900e3ddba8f068a62adda59" -dependencies = [ - "rustls", - "tokio", - "webpki", -] +checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" [[package]] -name = "tokio-util" -version = "0.7.4" +name = "heck" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0bb2e075f03b3d66d8d8785356224ba688d2906a371015e225beeb65ca92c740" -dependencies = [ - "bytes", - "futures-core", - "futures-sink", - "pin-project-lite", - "tokio", - "tracing", -] +checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" [[package]] -name = "tower-service" +name = "hermit-abi" version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" - -[[package]] -name = "tracing" -version = "0.1.37" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ce8c33a8d48bd45d624a6e523445fd21ec13d3653cd51f681abf67418f54eb8" -dependencies = [ - "cfg-if", - "pin-project-lite", - "tracing-attributes", - "tracing-core", -] +checksum = "443144c8cdadd93ebf52ddb4056d257f5b52c04d3c804e657d19eb73fc33668b" [[package]] -name = "tracing-attributes" -version = "0.1.23" +name = "is-terminal" +version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4017f8f45139870ca7e672686113917c71c7a6e02d4924eda67186083c03081a" +checksum = "cb0889898416213fab133e1d33a0e5858a48177452750691bde3666d0fdbaf8b" dependencies = [ - "proc-macro2", - "quote", - "syn", + "hermit-abi", + "rustix", + "windows-sys", ] [[package]] -name = "tracing-core" -version = "0.1.30" +name = "itoa" +version = "1.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24eb03ba0eab1fd845050058ce5e616558e8f8d8fca633e6b163fe25c797213a" -dependencies = [ - "once_cell", -] +checksum = "af150ab688ff2122fcef229be89cb50dd66af9e01a4ff320cc137eecc9bacc38" [[package]] -name = "try-lock" -version = "0.2.3" +name = "lazy_static" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59547bce71d9c38b83d9c0e92b6066c4253371f15005def0c30d9657f50c7642" +checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" [[package]] -name = "typenum" -version = "1.16.0" +name = "libc" +version = "0.2.148" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "497961ef93d974e23eb6f433eb5fe1b7930b659f06d12dec6fc44a8f554c0bba" +checksum = "9cdc71e17332e86d2e1d38c1f99edcb6288ee11b815fb1a4b049eaa2114d369b" [[package]] -name = "unicode-bidi" -version = "0.3.8" +name = "linux-raw-sys" +version = "0.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "099b7128301d285f79ddd55b9a83d5e6b9e97c92e0ea0daebee7263e932de992" +checksum = "1a9bad9f94746442c783ca431b22403b519cd7fbeed0533fdd6328b2f2212128" [[package]] -name = "unicode-ident" -version = "1.0.5" +name = "paste" +version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ceab39d59e4c9499d4e5a8ee0e2735b891bb7308ac83dfb4e80cad195c9f6f3" +checksum = "de3145af08024dea9fa9914f381a17b8fc6034dfb00f3a84013f7ff43f29ed4c" [[package]] -name = "unicode-normalization" -version = "0.1.22" +name = "proc-macro2" +version = "1.0.67" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c5713f0fc4b5db668a2ac63cdb7bb4469d8c9fed047b1d0292cc7b0ce2ba921" +checksum = "3d433d9f1a3e8c1263d9456598b16fec66f4acc9a74dacffd35c7bb09b3a1328" dependencies = [ - "tinyvec", + "unicode-ident", ] [[package]] -name = "unicode-width" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0edd1e5b14653f783770bce4a4dabb4a5108a5370a5f5d8cfe8710c361f6c8b" - -[[package]] -name = "untrusted" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a156c684c91ea7d62626509bce3cb4e1d9ed5c4d978f7b4352658f96a4c26b4a" - -[[package]] -name = "url" -version = "2.3.1" +name = "quote" +version = "1.0.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d68c799ae75762b8c3fe375feb6600ef5602c883c5d21eb51c09f22b83c4643" +checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" dependencies = [ - "form_urlencoded", - "idna", - "percent-encoding", + "proc-macro2", ] [[package]] -name = "version_check" -version = "0.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" - -[[package]] -name = "want" -version = "0.3.0" +name = "rustix" +version = "0.38.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ce8a968cb1cd110d136ff8b819a556d6fb6d919363c61534f6860c7eb172ba0" +checksum = "d7db8590df6dfcd144d22afd1b83b36c21a18d7cbc1dc4bb5295a8712e9eb662" dependencies = [ - "log", - "try-lock", + "bitflags", + "errno", + "libc", + "linux-raw-sys", + "windows-sys", ] [[package]] -name = "wasi" -version = "0.11.0+wasi-snapshot-preview1" +name = "ryu" +version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" +checksum = "1ad4cc8da4ef723ed60bced201181d83791ad433213d8c24efffda1eec85d741" [[package]] -name = "wasm-bindgen" -version = "0.2.83" +name = "serde" +version = "1.0.188" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eaf9f5aceeec8be17c128b2e93e031fb8a4d469bb9c4ae2d7dc1888b26887268" +checksum = "cf9e0fcba69a370eed61bcf2b728575f726b50b55cba78064753d708ddc7549e" dependencies = [ - "cfg-if", - "wasm-bindgen-macro", + "serde_derive", ] [[package]] -name = "wasm-bindgen-backend" -version = "0.2.83" +name = "serde_derive" +version = "1.0.188" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c8ffb332579b0557b52d268b91feab8df3615f265d5270fec2a8c95b17c1142" +checksum = "4eca7ac642d82aa35b60049a6eccb4be6be75e599bd2e9adb5f875a737654af2" dependencies = [ - "bumpalo", - "log", - "once_cell", "proc-macro2", "quote", "syn", - "wasm-bindgen-shared", ] [[package]] -name = "wasm-bindgen-futures" -version = "0.4.33" +name = "serde_json" +version = "1.0.107" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23639446165ca5a5de86ae1d8896b737ae80319560fbaa4c2887b7da6e7ebd7d" +checksum = "6b420ce6e3d8bd882e9b243c6eed35dbc9a6110c9769e74b584e0d68d1f20c65" dependencies = [ - "cfg-if", - "js-sys", - "wasm-bindgen", - "web-sys", + "itoa", + "ryu", + "serde", ] [[package]] -name = "wasm-bindgen-macro" -version = "0.2.83" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "052be0f94026e6cbc75cdefc9bae13fd6052cdcaf532fa6c45e7ae33a1e6c810" +name = "solidhunter" +version = "0.0.1" dependencies = [ - "quote", - "wasm-bindgen-macro-support", + "anyhow", + "clap", + "colored", + "glob", + "serde", + "serde_json", + "solidhunter-lib", + "thiserror", ] [[package]] -name = "wasm-bindgen-macro-support" -version = "0.2.83" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07bc0c051dc5f23e307b13285f9d75df86bfdf816c5721e573dec1f9b8aa193c" +name = "solidhunter-lib" +version = "0.0.1" dependencies = [ - "proc-macro2", - "quote", - "syn", - "wasm-bindgen-backend", - "wasm-bindgen-shared", + "anyhow", + "ast-extractor", + "clap", + "colored", + "glob", + "serde", + "serde_json", + "thiserror", ] [[package]] -name = "wasm-bindgen-shared" -version = "0.2.83" +name = "strsim" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c38c045535d93ec4f0b4defec448e4291638ee608530863b1e2ba115d4fff7f" +checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" [[package]] -name = "web-sys" -version = "0.3.60" +name = "syn" +version = "2.0.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bcda906d8be16e728fd5adc5b729afad4e444e106ab28cd1c7256e54fa61510f" +checksum = "9caece70c63bfba29ec2fed841a09851b14a235c60010fa4de58089b6c025668" dependencies = [ - "js-sys", - "wasm-bindgen", + "proc-macro2", + "quote", + "unicode-ident", ] [[package]] -name = "webpki" -version = "0.22.0" +name = "syn-solidity" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f095d78192e208183081cc07bc5515ef55216397af48b873e5edcd72637fa1bd" +checksum = "397f229dc34c7b8231b6ef85502f9ca4e3425b8625e6d403bb74779e6b1917b5" dependencies = [ - "ring", - "untrusted", + "paste", + "proc-macro2", + "quote", + "syn", ] [[package]] -name = "webpki-roots" -version = "0.22.6" +name = "thiserror" +version = "1.0.48" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6c71e40d7d2c34a5106301fb632274ca37242cd0c9d3e64dbece371a40a2d87" +checksum = "9d6d7a740b8a666a7e828dd00da9c0dc290dff53154ea77ac109281de90589b7" dependencies = [ - "webpki", + "thiserror-impl", ] [[package]] -name = "winapi" -version = "0.3.9" +name = "thiserror-impl" +version = "1.0.48" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" +checksum = "49922ecae66cc8a249b77e68d1d0623c1b2c514f0060c27cdc68bd62a1219d35" dependencies = [ - "winapi-i686-pc-windows-gnu", - "winapi-x86_64-pc-windows-gnu", + "proc-macro2", + "quote", + "syn", ] [[package]] -name = "winapi-i686-pc-windows-gnu" -version = "0.4.0" +name = "unicode-ident" +version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" +checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" [[package]] -name = "winapi-util" -version = "0.1.5" +name = "utf8parse" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" -dependencies = [ - "winapi", -] +checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a" [[package]] -name = "winapi-x86_64-pc-windows-gnu" -version = "0.4.0" +name = "windows-sys" +version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" +checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" +dependencies = [ + "windows-targets", +] [[package]] -name = "windows-sys" -version = "0.42.0" +name = "windows-targets" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a3e1820f08b8513f676f7ab6c1f99ff312fb97b553d30ff4dd86f9f15728aa7" +checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" dependencies = [ "windows_aarch64_gnullvm", "windows_aarch64_msvc", @@ -1804,86 +402,42 @@ dependencies = [ [[package]] name = "windows_aarch64_gnullvm" -version = "0.42.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41d2aa71f6f0cbe00ae5167d90ef3cfe66527d6f613ca78ac8024c3ccab9a19e" +checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" [[package]] name = "windows_aarch64_msvc" -version = "0.42.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd0f252f5a35cac83d6311b2e795981f5ee6e67eb1f9a7f64eb4500fbc4dcdb4" +checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" [[package]] name = "windows_i686_gnu" -version = "0.42.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fbeae19f6716841636c28d695375df17562ca208b2b7d0dc47635a50ae6c5de7" +checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" [[package]] name = "windows_i686_msvc" -version = "0.42.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "84c12f65daa39dd2babe6e442988fc329d6243fdce47d7d2d155b8d874862246" +checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" [[package]] name = "windows_x86_64_gnu" -version = "0.42.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf7b1b21b5362cbc318f686150e5bcea75ecedc74dd157d874d754a2ca44b0ed" +checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" [[package]] name = "windows_x86_64_gnullvm" -version = "0.42.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09d525d2ba30eeb3297665bd434a54297e4170c7f1a44cad4ef58095b4cd2028" +checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" [[package]] name = "windows_x86_64_msvc" -version = "0.42.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f40009d85759725a34da6d89a94e63d7bdc50a862acf0dbc7c8e488f1edcb6f5" - -[[package]] -name = "winreg" -version = "0.10.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "80d0f4e272c85def139476380b12f9ac60926689dd2e01d4923222f40580869d" -dependencies = [ - "winapi", -] - -[[package]] -name = "zeroize" -version = "1.5.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c394b5bd0c6f669e7275d9c20aa90ae064cb22e75a1cad54e1b34088034b149f" - -[[package]] -name = "zstd" -version = "0.11.2+zstd.1.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "20cc960326ece64f010d2d2107537f26dc589a6573a316bd5b1dba685fa5fde4" -dependencies = [ - "zstd-safe", -] - -[[package]] -name = "zstd-safe" -version = "5.0.2+zstd.1.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d2a5585e04f9eea4b2a3d1eca508c4dee9592a89ef6f450c11719da0726f4db" -dependencies = [ - "libc", - "zstd-sys", -] - -[[package]] -name = "zstd-sys" -version = "2.0.4+zstd.1.5.2" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fa202f2ef00074143e219d15b62ffc317d17cc33909feac471c044087cad7b0" -dependencies = [ - "cc", - "libc", -] +checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" diff --git a/toolchains/solidity/linter/core/solc-wrapper/.gitignore b/toolchains/solidity/linter/core/solc-wrapper/.gitignore deleted file mode 100644 index ffa3bbd2..00000000 --- a/toolchains/solidity/linter/core/solc-wrapper/.gitignore +++ /dev/null @@ -1 +0,0 @@ -Cargo.lock \ No newline at end of file diff --git a/toolchains/solidity/linter/core/solc-wrapper/Cargo.toml b/toolchains/solidity/linter/core/solc-wrapper/Cargo.toml deleted file mode 100644 index 9735382b..00000000 --- a/toolchains/solidity/linter/core/solc-wrapper/Cargo.toml +++ /dev/null @@ -1,19 +0,0 @@ -[package] -name = "solc-wrapper" -version = "0.1.0" -edition = "2021" - -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html - -[dependencies] -svm-rs = { git = "https://github.com/roynalnaruto/svm-rs", features = ["blocking"] } -home = "0.5.4" -semver = { version = "1.0.14", features = ["serde"] } -regex = "1.7.0" -once_cell = "1.16.0" -thiserror = "1.0" -serde_json = "1.0" -serde = { version = "1.0", features = ["derive"] } -open-fastrlp = "0.1.4" -hex = "0.4.3" -anyhow = "1.0" \ No newline at end of file diff --git a/toolchains/solidity/linter/core/solc-wrapper/src/ast/ast.rs b/toolchains/solidity/linter/core/solc-wrapper/src/ast/ast.rs deleted file mode 100644 index b1ea0e5b..00000000 --- a/toolchains/solidity/linter/core/solc-wrapper/src/ast/ast.rs +++ /dev/null @@ -1,2100 +0,0 @@ -use std::collections::HashMap; -use serde::{Serialize, Deserialize}; - -#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] -pub enum StateMutability { - #[serde(rename = "payable")] - Payable, - - #[serde(rename = "pure")] - Pure, - - #[serde(rename = "nonpayable")] - NonPayable, - - #[serde(rename = "view")] - View, -} - -pub type SourceLocation = String; - -#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] -pub enum Mutability { - #[serde(rename = "mutable")] - Mutable, - - #[serde(rename = "immutable")] - Immutable, - - #[serde(rename = "constant")] - Constant, -} - -#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] -pub enum StorageLocation { - #[serde(rename = "default")] - Default, - - #[serde(rename = "storage")] - Storage, - - #[serde(rename = "memory")] - Memory, - - #[serde(rename = "calldata")] - Calldata, -} - -#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] -pub enum Visibility { - #[serde(rename = "public")] - Public, - - #[serde(rename = "external")] - External, - - #[serde(rename = "internal")] - Internal, - - #[serde(rename = "private")] - Private, -} - -#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] -pub enum AssignmentOperator { - #[serde(rename = "=")] - Equal, - - #[serde(rename = "+=")] - PlusEqual, - - #[serde(rename = "-=")] - MinusEqual, - - #[serde(rename = "*=")] - StarEqual, - - #[serde(rename = "/=")] - SlashEqual, - - #[serde(rename = "%=")] - PercentEqual, - - #[serde(rename = "|=")] - PipeEqual, - - #[serde(rename = "&=")] - AmpersandEqual, - - #[serde(rename = "^=")] - CaretEqual, - - #[serde(rename = ">>=")] - RightShiftEqual, - - #[serde(rename = "<<=")] - LeftShiftEqual, -} - -#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] -pub enum BinaryOperator { - #[serde(rename = "+")] - Plus, - - #[serde(rename = "-")] - Minus, - - #[serde(rename = "*")] - Star, - - #[serde(rename = "/")] - Slash, - - #[serde(rename = "%")] - Percent, - - #[serde(rename = "**")] - DoubleStar, - - #[serde(rename = "&&")] - DoubleAmpersand, - - #[serde(rename = "||")] - DoublePipe, - - #[serde(rename = "!=")] - ExclamationEqual, - - #[serde(rename = "==")] - DoubleEqual, - - #[serde(rename = "<")] - LessThan, - - #[serde(rename = "<=")] - LessThanOrEqual, - - #[serde(rename = ">")] - GreaterThan, - - #[serde(rename = ">=")] - GreaterThanOrEqual, - - #[serde(rename = "^")] - Caret, - - #[serde(rename = "&")] - Ampersand, - - #[serde(rename = "|")] - Pipe, - - #[serde(rename = "<<")] - LeftShift, - - #[serde(rename = ">>")] - RightShift, -} - -#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] -pub enum UnaryOperator { - #[serde(rename = "!")] - Exclamation, - - #[serde(rename = "-")] - Minus, - - #[serde(rename = "+")] - Plus, - - #[serde(rename = "++")] - DoublePlus, - - #[serde(rename = "--")] - DoubleMinus, - - #[serde(rename = "delete")] - Delete, -} - -#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] -pub enum FunctionCallKind { - #[serde(rename = "functionCall")] - FunctionCall, - - #[serde(rename = "structConstructorCall")] - StructConstructorCall, - - #[serde(rename = "typeConversion")] - TypeConversion, -} - -#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] -pub enum LiteralKind { - #[serde(rename = "number")] - Number, - - #[serde(rename = "string")] - String, - - #[serde(rename = "hexString")] - HexString, - - #[serde(rename = "unicodeString")] - UnicodeString, - - #[serde(rename = "bool")] - Bool, -} - -#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] -pub enum FunctionDefinitionKind { - #[serde(rename = "function")] - Function, - - #[serde(rename = "constructor")] - Constructor, - - #[serde(rename = "fallback")] - Fallback, - - #[serde(rename = "receive")] - Receive, - - #[serde(rename = "modifier")] - Modifier, - - #[serde(rename = "event")] - Event, - - #[serde(rename = "freeFunction")] - FreeFunction -} - -#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] -#[serde(untagged)] -pub enum TypeName { - ArrayTypeName(Box), - ElementaryTypeName(Box), - FunctionTypeName(Box), - Mapping(Box), - UserDefinedTypeName(Box), -} - -#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] -#[serde(untagged)] -pub enum Expression { - Assignment(Box), - BinaryOperation(Box), - Conditional(Box), - ElementaryTypeNameExpression(Box), - FunctionCall(Box), - FunctionCallOptions(Box), - Identifier(Box), - IdentifierPath(Box), - IndexAccess(Box), - IndexRangeAccess(Box), - Literal(Box), - MemberAccess(Box), - NewExpression(Box), - TupleExpression(Box), - UnaryOperation(Box), -} - -#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] -#[serde(untagged)] -pub enum Statement { - VariableDeclarationStatement(Box), - ForStatement(Box), - IfStatement(Box), - DoWhileStatement(Box), - Return(Box), - TryStatement(Box), - WhileStatement(Box), - UncheckedBlock(Box), - EmitStatement(Box), - RevertStatement(Box), - ExpressionStatement(Box), - Block(Box), - Continue(Box), - Break(Box), - PlaceholderStatement(Box), -} - -#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] -pub enum NodeType { - // Expressions - Assignment, - BinaryOperation, - Conditional, - ElementaryTypeNameExpression, - FunctionCall, - FunctionCallOptions, - Identifier, - IdentifierPath, - IndexAccess, - IndexRangeAccess, - Literal, - MemberAccess, - NewExpression, - TupleExpression, - UnaryOperation, - - // Statements - Block, - Break, - Continue, - DoWhileStatement, - EmitStatement, - ExpressionStatement, - ForStatement, - IfStatement, - InlineAssembly, - PlaceholderStatement, - Return, - RevertStatement, - TryStatement, - UncheckedBlock, - VariableDeclarationStatement, - VariableDeclaration, - WhileStatement, - - // Definitions - ContractDefinition, - FunctionDefinition, - EventDefinition, - ErrorDefinition, - ModifierDefinition, - StructDefinition, - EnumDefinition, - EnumValue, - UserDefinedValueTypeDefinition, - - // Directives - PragmaDirective, - ImportDirective, - UsingForDirective, - - // Misc - SourceUnit, - InheritanceSpecifier, - ElementaryTypeName, - FunctionTypeName, - ParameterList, - TryCatchClause, - ModifierInvocation, - StructuredDocumentation, - UserDefinedTypeName, - OverrideSpecifier, - Mapping, - - /// An unknown AST node type. - Other(String), -} - -#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] -pub struct EnumDefinition { - pub id: usize, - pub src: SourceLocation, - pub name: String, - #[serde(rename = "nameLocation", skip_serializing_if = "Option::is_none")] - pub name_location: Option, - #[serde(rename = "canonicalName")] - pub canonical_name: String, - pub members: Vec, - #[serde(rename = "nodeType")] - pub node_type: NodeType, -} - -#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] -pub struct EnumValue { - pub id: usize, - pub src: SourceLocation, - pub name: String, - #[serde(rename = "nameLocation", skip_serializing_if = "Option::is_none")] - pub name_location: Option, - #[serde(rename = "nodeType")] - pub node_type: NodeType, -} - -#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] -pub struct TypeDescriptions { - #[serde(rename = "typeIdentifier", skip_serializing_if = "Option::is_none")] - pub type_identifier: Option, - #[serde(rename = "typeString", skip_serializing_if = "Option::is_none")] - pub type_string: Option -} - -#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] -pub struct StructuredDocumentation { - pub id: usize, - pub src: SourceLocation, - pub text: String, - #[serde(rename = "nodeType")] - pub node_type: NodeType, -} - -#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] -pub struct StructureFunction { - pub function: IdentifierPath -} - -#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] -#[serde(untagged)] -pub enum SourceUnitChildNodes { - ContractDefinition(Box), - StructDefinition(Box), - EnumDefinition(Box), - ErrorDefinition(Box), - PragmaDirective(Box), - ImportDirective(Box), - UsingForDirective(Box), - Other(String) -} - -#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] -pub struct SourceUnit { - pub id: usize, - pub src: SourceLocation, - #[serde(rename = "absolutePath")] - pub absolute_path: String, - #[serde(rename = "exportedSymbols")] - pub exported_symbols: Option>>, - #[serde(rename = "license", skip_serializing_if = "Option::is_none")] - pub license: Option, - #[serde(rename = "nodes")] - pub nodes: Vec, - #[serde(rename = "nodeType")] - pub node_type: NodeType, -} - -#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] -#[serde(untagged)] -pub enum ContractDefinitionChildNodes { - FunctionDefinition(Box), - ModifierDefinition(Box), - StructDefinition(Box), - UserDefinedValueTypeDefinition(Box), - VariableDeclaration(Box), - EnumDefinition(Box), - ErrorDefinition(Box), - EventDefinition(Box), - UsingForDirective(Box), -} - -#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] -pub enum ContractKind { - #[serde(rename = "contract")] - Contract, - #[serde(rename = "interface")] - Interface, - #[serde(rename = "library")] - Library, - Other(String) -} - -#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] -pub struct ContractDefinition { - pub id: usize, - pub src: SourceLocation, - pub name: String, - #[serde(rename = "nameLocation", skip_serializing_if = "Option::is_none")] - pub name_location: Option, - #[serde(rename = "abstract")] - pub is_abstract: bool, - #[serde(rename = "baseContracts")] - pub base_contracts: Vec, - #[serde(rename = "canonicalName", skip_serializing_if = "Option::is_none")] - pub canonical_name: Option, - #[serde(rename = "contractDependencies")] - pub contract_dependencies: Vec, - #[serde(rename = "contractKind")] - pub contract_kind: ContractKind, - #[serde(rename = "documentation", skip_serializing_if = "Option::is_none")] - pub documentation: Option, - #[serde(rename = "fullyImplemented")] - pub is_fully_implemented: Option, - #[serde(rename = "linearizedBaseContracts")] - pub linearized_base_contracts: Option>, - #[serde(rename = "nodes")] - pub nodes: Vec, - #[serde(rename = "scope")] - pub scope: Option, - #[serde(rename = "usedErrors")] - pub used_errors: Vec, - #[serde(rename = "nodeType")] - pub node_type: NodeType, -} - -#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] -#[serde(untagged)] -pub enum BaseName { - UserDefinedTypeName(UserDefinedTypeName), - IdentifierPath(IdentifierPath), -} - -#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] -pub struct InheritanceSpecifier { - pub id: usize, - pub src: SourceLocation, - #[serde(rename = "arguments")] - pub arguments: Option>, - #[serde(rename = "baseName")] - pub base_name: BaseName, - #[serde(rename = "nodeType")] - pub node_type: NodeType, -} - -#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] -pub struct Assignment { - pub id: usize, - pub src: SourceLocation, - #[serde(rename = "argumentTypes", skip_serializing_if = "Option::is_none")] - pub argument_types: Option>, - #[serde(rename = "isConstant")] - pub is_constant: Option, - #[serde(rename = "isLValue")] - pub is_l_value: Option, - #[serde(rename = "isPure")] - pub is_pure: Option, - #[serde(rename = "lValueRequested")] - pub l_value_requested: Option, - #[serde(rename = "typeDescriptions")] - pub type_descriptions: TypeDescriptions, - #[serde(rename = "leftHandSide")] - pub left_hand_side: Expression, - pub operator: AssignmentOperator, - #[serde(rename = "rightHandSide")] - pub right_hand_side: Expression, - #[serde(rename = "nodeType")] - pub node_type: NodeType, -} - -#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] -pub struct BinaryOperation { - pub id: usize, - pub src: SourceLocation, - #[serde(rename = "argumentTypes", skip_serializing_if = "Option::is_none")] - pub argument_types: Option>, - #[serde(rename = "isConstant")] - pub is_constant: bool, - #[serde(rename = "isLValue")] - pub is_l_value: bool, - #[serde(rename = "isPure")] - pub is_pure: bool, - #[serde(rename = "lValueRequested")] - pub l_value_requested: bool, - #[serde(rename = "typeDescriptions")] - pub type_descriptions: TypeDescriptions, - #[serde(rename = "commonType")] - pub common_type: TypeDescriptions, - #[serde(rename = "leftExpression")] - pub left_expression: Expression, - pub operator: BinaryOperator, - #[serde(rename = "rightExpression")] - pub right_expression: Expression, - #[serde(rename = "nodeType")] - pub node_type: NodeType, -} - -#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] -pub struct Conditional { - pub id: usize, - pub src: SourceLocation, - #[serde(rename = "argumentTypes", skip_serializing_if = "Option::is_none")] - pub argument_types: Option>, - #[serde(rename = "isConstant")] - pub is_constant: bool, - #[serde(rename = "isLValue")] - pub is_l_value: bool, - #[serde(rename = "isPure")] - pub is_pure: bool, - #[serde(rename = "lValueRequested")] - pub l_value_requested: bool, - #[serde(rename = "typeDescriptions")] - pub type_descriptions: TypeDescriptions, - #[serde(rename = "condition")] - pub condition: Expression, - #[serde(rename = "falseExpression")] - pub false_expression: Expression, - #[serde(rename = "trueExpression")] - pub true_expression: Expression, - #[serde(rename = "nodeType")] - pub node_type: NodeType, -} - -#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] -pub struct ElementaryTypeNameExpression { - pub id: usize, - pub src: SourceLocation, - #[serde(rename = "argumentTypes", skip_serializing_if = "Option::is_none")] - pub argument_types: Option>, - #[serde(rename = "isConstant")] - pub is_constant: Option, - #[serde(rename = "isLValue")] - pub is_l_value: Option, - #[serde(rename = "isPure")] - pub is_pure: Option, - #[serde(rename = "lValueRequested")] - pub l_value_requested: Option, - #[serde(rename = "typeDescriptions")] - pub type_descriptions: TypeDescriptions, - #[serde(rename = "typeName")] - pub type_name: ElementaryTypeName, - #[serde(rename = "nodeType")] - pub node_type: NodeType, -} - -#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] -pub struct ElementaryTypeName { - pub id: usize, - pub src: SourceLocation, - #[serde(rename = "typeDescriptions")] - pub type_descriptions: TypeDescriptions, - pub name: String, - #[serde(rename = "stateMutability")] - pub state_mutability: Option, - #[serde(rename = "nodeType")] - pub node_type: NodeType, -} - -#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] -pub struct FunctionCall { - pub id: usize, - pub src: SourceLocation, - #[serde(rename = "argumentTypes", skip_serializing_if = "Option::is_none")] - pub argument_types: Option>, - #[serde(rename = "isConstant")] - pub is_constant: Option, - #[serde(rename = "isLValue")] - pub is_l_value: Option, - #[serde(rename = "isPure")] - pub is_pure: Option, - #[serde(rename = "lValueRequested")] - pub l_value_requested: Option, - #[serde(rename = "typeDescriptions")] - pub type_descriptions: TypeDescriptions, - #[serde(rename = "arguments")] - pub arguments: Vec, - #[serde(rename = "expression")] - pub expression: Expression, - pub kind: Option, - pub names: Vec, - #[serde(rename = "tryCall")] - pub try_call: bool, - #[serde(rename = "nodeType")] - pub node_type: NodeType, -} - -#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] -pub struct FunctionCallOptions { - pub id: usize, - pub src: SourceLocation, - #[serde(rename = "argumentTypes", skip_serializing_if = "Option::is_none")] - pub argument_types: Option>, - #[serde(rename = "isConstant")] - pub is_constant: Option, - #[serde(rename = "isLValue")] - pub is_l_value: Option, - #[serde(rename = "isPure")] - pub is_pure: Option, - #[serde(rename = "lValueRequested")] - pub l_value_requested: Option, - #[serde(rename = "typeDescriptions")] - pub type_descriptions: TypeDescriptions, - pub expression: Expression, - pub names: Vec, - pub options: Vec, - #[serde(rename = "nodeType")] - pub node_type: NodeType, -} - -#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] -pub struct Identifier { - pub id: usize, - pub src: SourceLocation, - #[serde(rename = "argumentTypes", skip_serializing_if = "Option::is_none")] - pub argument_types: Option>, - pub name: String, - #[serde(rename = "overloadedDeclarations")] - pub overloaded_declarations: Vec, - #[serde(rename = "referencedDeclaration")] - pub referenced_declaration: Option, - #[serde(rename = "typeDescriptions")] - pub type_descriptions: TypeDescriptions, - #[serde(rename = "nodeType")] - pub node_type: NodeType, -} - -#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] -pub struct IndexAccess { - pub id: usize, - pub src: SourceLocation, - #[serde(rename = "argumentTypes", skip_serializing_if = "Option::is_none")] - pub argument_types: Option>, - #[serde(rename = "isConstant")] - pub is_constant: Option, - #[serde(rename = "isLValue")] - pub is_l_value: Option, - #[serde(rename = "isPure")] - pub is_pure: Option, - #[serde(rename = "lValueRequested")] - pub l_value_requested: Option, - #[serde(rename = "typeDescriptions")] - pub type_descriptions: TypeDescriptions, - #[serde(rename = "baseExpression")] - pub base_expression: Expression, - #[serde(rename = "indexExpression", skip_serializing_if = "Option::is_none")] - pub index_expression: Option, - #[serde(rename = "nodeType")] - pub node_type: NodeType, -} - -#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] -pub struct IndexRangeAccess { - pub id: usize, - pub src: SourceLocation, - #[serde(rename = "argumentTypes", skip_serializing_if = "Option::is_none")] - pub argument_types: Option>, - #[serde(rename = "isConstant")] - pub is_constant: Option, - #[serde(rename = "isLValue")] - pub is_l_value: Option, - #[serde(rename = "isPure")] - pub is_pure: Option, - #[serde(rename = "lValueRequested")] - pub l_value_requested: Option, - #[serde(rename = "typeDescriptions")] - pub type_descriptions: TypeDescriptions, - #[serde(rename = "baseExpression")] - pub base_expression: Expression, - #[serde(rename = "endExpression", skip_serializing_if = "Option::is_none")] - pub end_expression: Option, - #[serde(rename = "startExpression", skip_serializing_if = "Option::is_none")] - pub start_expression: Option, - #[serde(rename = "nodeType")] - pub node_type: NodeType, -} - -#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] -pub struct Literal { - pub id: usize, - pub src: SourceLocation, - #[serde(rename = "argumentTypes", skip_serializing_if = "Option::is_none")] - pub argument_types: Option>, - #[serde(rename = "isConstant")] - pub is_constant: Option, - #[serde(rename = "isLValue")] - pub is_l_value: Option, - #[serde(rename = "isPure")] - pub is_pure: Option, - #[serde(rename = "lValueRequested")] - pub l_value_requested: Option, - #[serde(rename = "typeDescriptions")] - pub type_descriptions: TypeDescriptions, - #[serde(rename = "hexValue")] - pub hex_value: String, - pub kind: LiteralKind, - //#[serde(rename = "subdenomination", skip_serializing_if = "Option::is_none")] - //subdenomination: Option, - pub value: Option, - #[serde(rename = "nodeType")] - pub node_type: NodeType, -} - -#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] -pub struct MemberAccess { - pub id: usize, - pub src: SourceLocation, - #[serde(rename = "argumentTypes", skip_serializing_if = "Option::is_none")] - pub argument_types: Option>, - #[serde(rename = "isConstant")] - pub is_constant: Option, - #[serde(rename = "isLValue")] - pub is_l_value: Option, - #[serde(rename = "isPure")] - pub is_pure: Option, - #[serde(rename = "lValueRequested")] - pub l_value_requested: Option, - #[serde(rename = "typeDescriptions")] - pub type_descriptions: TypeDescriptions, - #[serde(rename = "expression")] - pub expression: Expression, - #[serde(rename = "memberLocation")] - pub member_location: SourceLocation, - #[serde(rename = "memberName")] - pub member_name: String, - #[serde(rename = "referencedDeclaration")] - pub referenced_declaration: Option, - #[serde(rename = "nodeType")] - pub node_type: NodeType, -} - -#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] -pub struct NewExpression { - pub id: usize, - pub src: SourceLocation, - #[serde(rename = "argumentTypes", skip_serializing_if = "Option::is_none")] - pub argument_types: Option>, - #[serde(rename = "isConstant")] - pub is_constant: Option, - #[serde(rename = "isLValue")] - pub is_l_value: Option, - #[serde(rename = "isPure")] - pub is_pure: Option, - #[serde(rename = "lValueRequested")] - pub l_value_requested: Option, - #[serde(rename = "typeDescriptions")] - pub type_descriptions: TypeDescriptions, - #[serde(rename = "typeName")] - pub type_name: TypeName, - #[serde(rename = "nodeType")] - pub node_type: NodeType, -} - -#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] -pub struct ArrayTypeName { - pub id: usize, - pub src: SourceLocation, - #[serde(rename = "typeDescriptions")] - pub type_descriptions: TypeDescriptions, - #[serde(rename = "baseType")] - pub base_type: TypeName, - pub length: Option, - #[serde(rename = "nodeType")] - pub node_type: NodeType, -} - -#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] -pub struct FunctionTypeName { - id : usize, - pub src: SourceLocation, - #[serde(rename = "typeDescriptions")] - pub type_descriptions: TypeDescriptions, - #[serde(rename = "parameterTypes")] - pub parameter_types: ParameterList, - #[serde(rename = "returnParameterTypes")] - pub return_parameter_types: ParameterList, - #[serde(rename = "stateMutability")] - pub state_mutability: StateMutability, - pub visibility: Visibility, - #[serde(rename = "nodeType")] - pub node_type: NodeType, -} - -#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] -pub struct ParameterList { - pub id: usize, - pub src: SourceLocation, - pub parameters: Vec, - #[serde(rename = "nodeType")] - pub node_type: NodeType, -} - -#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] -pub struct VariableDeclaration { - pub id: usize, - pub src: SourceLocation, - pub name: String, - #[serde(rename = "nameLocation")] - pub name_location: Option, - #[serde(rename = "baseFunctions", skip_serializing_if = "Option::is_none")] - pub base_functions: Option>, - #[serde(rename = "constant")] - pub is_constant: bool, - pub documentation: Option, - #[serde(rename = "functionSelector")] - pub function_selector: Option, - pub indexed: Option, - pub mutability: Mutability, - pub overrides: Option, - pub scope: Option, - #[serde(rename = "stateVariable")] - pub state_variable: bool, - #[serde(rename = "storageLocation")] - pub storage_location: StorageLocation, - #[serde(rename = "typeDescriptions")] - pub type_descriptions: TypeDescriptions, - #[serde(rename = "typeName", skip_serializing_if = "Option::is_none")] - pub type_name: Option, - #[serde(rename = "value", skip_serializing_if = "Option::is_none")] - pub value: Option, - pub visibility: Visibility, - #[serde(rename = "nodeType")] - pub node_type: NodeType, -} - -#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] -#[serde(untagged)] -pub enum OverridesEnum { - UserDefinedTypeName(Vec), - Identifier(Vec), -} - -#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] -pub struct OverrideSpecifier { - pub id: usize, - pub src: SourceLocation, - pub overrides: OverridesEnum, - #[serde(rename = "nodeType")] - pub node_type: NodeType, -} - -#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] -pub struct UserDefinedTypeName { - pub id: usize, - pub src: SourceLocation, - #[serde(rename = "typeDescriptions")] - pub type_descriptions: TypeDescriptions, - //#[serde(rename = "contractScope")] - //contract_scope: Option, - pub name: Option, - #[serde(rename = "pathNode")] - pub path_node: Option, - #[serde(rename = "referencedDeclaration")] - pub referenced_declaration: Option, - #[serde(rename = "nodeType")] - pub node_type: NodeType, -} - -#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] -pub struct IdentifierPath { - pub id: usize, - pub src: SourceLocation, - pub name: String, - #[serde(rename = "nameLocations")] - pub name_locations: Option>, - #[serde(rename = "referencedDeclaration")] - pub referenced_declaration: Option, - #[serde(rename = "nodeType")] - pub node_type: NodeType, -} - -#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] -pub struct Mapping { - pub id: usize, - pub src: SourceLocation, - #[serde(rename = "typeDescriptions")] - pub type_descriptions: TypeDescriptions, - #[serde(rename = "keyType")] - pub key_type: TypeName, - #[serde(rename = "valueType")] - pub value_type: TypeName, - #[serde(rename = "nodeType")] - pub node_type: NodeType, -} - -#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] -pub struct TupleExpression { - pub id: usize, - pub src: SourceLocation, - #[serde(rename = "argumentTypes")] - pub argument_types: Option>, - #[serde(rename = "isConstant")] - pub is_constant: Option, - #[serde(rename = "isLValue")] - pub is_l_value: Option, - #[serde(rename = "isPure")] - pub is_pure: Option, - #[serde(rename = "lValueRequested")] - pub l_value_requested: Option, - #[serde(rename = "typeDescriptions")] - pub type_descriptions: TypeDescriptions, - pub components: Vec, - #[serde(rename = "isInlineArray")] - pub is_inline_array: bool, - #[serde(rename = "nodeType")] - pub node_type: NodeType, -} - -#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] -pub struct UnaryOperation { - pub id: usize, - pub src: SourceLocation, - #[serde(rename = "argumentTypes")] - pub argument_types: Option>, - #[serde(rename = "isConstant")] - pub is_constant: Option, - #[serde(rename = "isLValue")] - pub is_l_value: Option, - #[serde(rename = "isPure")] - pub is_pure: Option, - #[serde(rename = "lValueRequested")] - pub l_value_requested: Option, - #[serde(rename = "typeDescriptions")] - pub type_descriptions: TypeDescriptions, - #[serde(rename = "operator")] - pub operator: UnaryOperator, - pub prefix: bool, - #[serde(rename = "subExpression")] - pub sub_expression: Expression, - #[serde(rename = "nodeType")] - pub node_type: NodeType, -} - -#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] -pub struct ErrorDefinition { - pub id: usize, - pub src: SourceLocation, - pub name: String, - #[serde(rename = "nameLocation")] - pub name_location: String, - pub documentation: Option, - #[serde(rename = "errorSelector")] - pub error_selector: Option, - pub parameters: Option, - #[serde(rename = "nodeType")] - pub node_type: NodeType, -} - -#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] -pub struct EventDefinition { - pub id: usize, - pub src: SourceLocation, - pub name: String, - #[serde(rename = "nameLocation")] - pub name_location: Option, - pub anonymous: bool, - #[serde(rename = "eventSelector")] - pub event_selector: Option, - pub documentation: Option, - pub parameters: Option, - #[serde(rename = "nodeType")] - pub node_type: NodeType, -} - -#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] -pub struct FunctionDefinition { - pub id: usize, - pub src: SourceLocation, - pub name: String, - #[serde(rename = "nameLocation")] - pub name_location: Option, - #[serde(rename = "baseFunctions")] - pub base_functions: Option>, - pub body: Option, - #[serde(rename = "documentation")] - pub documentation: Option, - #[serde(rename = "functionSelector")] - pub function_selector: Option, - pub implemented: bool, - pub kind: FunctionDefinitionKind, - pub modifiers: Vec, - pub overrides: Option, - pub parameters: ParameterList, - #[serde(rename = "returnParameters")] - pub return_parameters: ParameterList, - #[serde(rename = "scope")] - pub scope: Option, - #[serde(rename = "stateMutability")] - pub state_mutability: StateMutability, - #[serde(rename = "virtual")] - pub is_virtual: bool, - pub visibility: Option, - #[serde(rename = "nodeType")] - pub node_type: NodeType, -} - -#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] -pub struct Block { - pub id: usize, - pub src: SourceLocation, - pub documentation: Option, - pub statements: Option>, - #[serde(rename = "nodeType")] - pub node_type: NodeType, -} - - -#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] -pub struct Break { - pub id: usize, - pub src: SourceLocation, - pub documentation: Option, - #[serde(rename = "nodeType")] - pub node_type: NodeType, -} - -#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] -pub struct Continue { - pub id: usize, - pub src: SourceLocation, - pub documentation: Option, - #[serde(rename = "nodeType")] - pub node_type: NodeType, -} - -#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] -#[serde(untagged)] -pub enum Body { - Block(Box), - Statement(Box), -} - -#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] -pub struct DoWhileStatement { - pub id: usize, - pub src: SourceLocation, - pub documentation: Option, - #[serde(rename = "condition")] - pub condition: Expression, - #[serde(rename = "body")] - pub body: Body, - #[serde(rename = "nodeType")] - pub node_type: NodeType, -} - -#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] -pub struct EmitStatement { - pub id: usize, - pub src: SourceLocation, - pub documentation: Option, - #[serde(rename = "eventCall")] - pub event_call: FunctionCall, - #[serde(rename = "nodeType")] - pub node_type: NodeType, -} - -#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] -pub struct ExpressionStatement { - pub id: usize, - pub src: SourceLocation, - pub documentation: Option, - pub expression: Expression, - #[serde(rename = "nodeType")] - pub node_type: NodeType, -} - -#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] -#[serde(untagged)] -pub enum InitializationExpression { - ExpressionStatement(ExpressionStatement), - VariableDeclarationStatement(VariableDeclarationStatement) -} - -#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] -pub struct ForStatement { - pub id: usize, - pub src: SourceLocation, - pub documentation: Option, - pub body: Body, - pub condition: Option, - #[serde(rename = "initializationExpression")] - pub initialization_expression: Option, - #[serde(rename = "loopExpression")] - pub loop_expression: Option, - #[serde(rename = "nodeType")] - pub node_type: NodeType, -} - -#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] -pub struct VariableDeclarationStatement { - pub id: usize, - pub src: SourceLocation, - pub documentation: Option, - pub assignments: Vec>, - #[serde(rename = "declarations")] - pub declarations: Vec>, - #[serde(rename = "initialValue")] - pub initial_value: Option, - #[serde(rename = "nodeType")] - pub node_type: NodeType, -} - -#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] -pub struct IfStatement { - pub id: usize, - pub src: SourceLocation, - pub documentation: Option, - #[serde(rename = "condition")] - pub condition: Expression, - #[serde(rename = "trueBody")] - pub true_body: Body, - #[serde(rename = "falseBody")] - pub false_body: Option, - #[serde(rename = "nodeType")] - pub node_type: NodeType, -} - -#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] -pub struct PlaceholderStatement { - pub id: usize, - pub src: SourceLocation, - pub documentation: Option, - #[serde(rename = "nodeType")] - pub node_type: NodeType, -} - -#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] -pub struct Return { - pub id: usize, - pub src: SourceLocation, - pub documentation: Option, - pub expression: Option, - #[serde(rename = "functionReturnParameters")] - pub function_return_parameters: Option, - #[serde(rename = "nodeType")] - pub node_type: NodeType, -} - -#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] -pub struct RevertStatement { - pub id: usize, - pub src: SourceLocation, - pub documentation: Option, - #[serde(rename = "errorCall")] - pub error_call: Statement, - #[serde(rename = "nodeType")] - pub node_type: NodeType, -} - -#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] -pub struct TryStatement { - pub id: usize, - pub src: SourceLocation, - pub documentation: Option, - pub clauses: Vec, - #[serde(rename = "externalCall")] - pub external_call: Expression, - #[serde(rename = "nodeType")] - pub node_type: NodeType, -} - -#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] -pub struct TryCatchClause { - pub id: usize, - pub src: SourceLocation, - pub block: Block, - #[serde(rename = "errorName")] - pub error_name: String, - pub parameters: Option, - #[serde(rename = "nodeType")] - pub node_type: NodeType, -} - -#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] -pub struct UncheckedBlock { - pub id: usize, - pub src: SourceLocation, - pub documentation: Option, - pub statements: Vec, - #[serde(rename = "nodeType")] - pub node_type: NodeType, -} - -#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] -pub struct WhileStatement { - pub id: usize, - pub src: SourceLocation, - pub documentation: Option, - pub body: Statement, - pub condition: Expression, - #[serde(rename = "nodeType")] - pub node_type: NodeType, -} - -#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] -#[serde(untagged)] -pub enum ModifierName { - Identifier(Identifier), - IdentifierPath(IdentifierPath), -} - -#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] -pub enum ModifierInvocationKind { - #[serde(rename = "modifierInvocation")] - ModifierInvocation, - #[serde(rename = "baseConstructorSpecifier")] - BaseConstructorSpecifier, -} - -#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] -pub struct ModifierInvocation { - pub id: usize, - pub src: SourceLocation, - pub arguments: Option, - pub kind: Option, - #[serde(rename = "modifierName")] - pub modifier_name: ModifierName, - #[serde(rename = "nodeType")] - pub node_type: NodeType, -} - -#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] -pub struct ModifierDefinition { - pub id: usize, - pub src: SourceLocation, - pub name: String, - #[serde(rename = "nameLocation")] - pub name_location: Option, - #[serde(rename = "baseModifiers")] - pub base_modifiers: Option>, - pub body: Statement, - pub documentation: Option, - pub overrides: Option, - pub parameters: ParameterList, - #[serde(rename = "virtual")] - pub is_virtual: bool, - pub visibility: Visibility, - #[serde(rename = "nodeType")] - pub node_type: NodeType, -} - -#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] -pub struct StructDefinition { - pub id: usize, - pub src: SourceLocation, - pub name: String, - #[serde(rename = "nameLocation")] - pub name_location: Option, - #[serde(rename = "canonicalName")] - pub canonical_name: String, - pub members: Vec, - pub scope: usize, - pub visibility: Visibility, - #[serde(rename = "nodeType")] - pub node_type: NodeType, -} - -#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] -pub struct UserDefinedValueTypeDefinition { - pub id: usize, - pub src: SourceLocation, - pub name: String, - #[serde(rename = "nameLocation")] - pub name_location: Option, - #[serde(rename = "canonicalName")] - pub canonical_name: Option, - #[serde(rename = "underlyingType")] - pub underlying_type: TypeName, - #[serde(rename = "nodeType")] - pub node_type: NodeType, -} - -#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] -pub struct UsingForDirective { - pub id: usize, - pub src: SourceLocation, - #[serde(rename = "functionList")] - pub function_list: Option>, - pub function: Option, - pub global: Option, - #[serde(rename = "libraryName")] - pub library_name: Option, - #[serde(rename = "typeName")] - pub type_name: Option, - #[serde(rename = "nodeType")] - pub node_type: NodeType, -} - -#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] -pub struct SymbolAlias { - pub foreign: Identifier, - pub local: Option, - pub name_location: Option, -} - -#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] -pub struct ImportDirective { - pub id: usize, - pub src: SourceLocation, - #[serde(rename = "absolutePath")] - pub absolute_path: String, - pub file: String, - #[serde(rename = "nameLocation")] - pub name_location: Option, - pub scope: Option, - #[serde(rename = "sourceUnit")] - pub source_unit: Option, - #[serde(rename = "symbolAliases")] - pub symbol_aliases: Vec, - #[serde(rename = "unitAlias")] - pub unit_alias: String, - #[serde(rename = "nodeType")] - pub node_type: NodeType, -} - -#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] -pub struct PragmaDirective { - pub id: usize, - pub src: SourceLocation, - pub literals: Vec, - #[serde(rename = "nodeType")] - pub node_type: NodeType, -} - -#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] -pub enum EvmVersion { - #[serde(rename = "homestead")] - Homestead, - #[serde(rename = "tangerineWhistle")] - TangerineWhistle, - #[serde(rename = "spuriousDragon")] - SpuriousDragon, - #[serde(rename = "byzantium")] - Byzantium, - #[serde(rename = "constantinople")] - Constantinople, - #[serde(rename = "petersburg")] - Petersburg, - #[serde(rename = "istanbul")] - Istanbul, - #[serde(rename = "berlin")] - Berlin, - #[serde(rename = "london")] - London, -} - -#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] -pub enum Suffix { - #[serde(rename = "slot")] - Slot, - #[serde(rename = "offset")] - Offset -} - -#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] -pub struct ExternalReference { - pub declaration: usize, - #[serde(rename = "isOffset")] - pub is_offset: bool, - #[serde(rename = "isSlot")] - pub is_slot: bool, - pub src: SourceLocation, - #[serde(rename = "valueSize")] - pub value_size: usize, - pub suffix: Option -} - -#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] -pub struct InlineAssembly { - pub id: usize, - pub src: SourceLocation, - pub documentation: Option, - #[serde(rename = "evmVersion")] - pub evm_version: EvmVersion, - #[serde(rename = "externalReferences")] - pub external_references: Vec, - pub flags: Option>, - #[serde(rename = "nodeType")] - pub node_type: NodeType -} - -#[derive(Debug, Clone, PartialEq, Eq)] -pub struct CodeLocation { - pub line: usize, - pub column: usize, - pub length: usize, -} - -pub fn get_line_from_offset(content: &str, offset: usize) -> (usize, usize) { - let mut nb_line = 1; - let mut tmp = offset; - - for line in content.split('\n') { - if line.len() < tmp { - tmp -= line.len() + 1; - nb_line += 1; - continue; - } - return (nb_line, tmp); - } - return (0, 0); -} - -pub fn decode_begin_location(src: &str, content: &str) -> CodeLocation { - let mut split = src.split(':'); - let offset = split.next().unwrap().parse().unwrap(); - let (line, column) = get_line_from_offset(&content, offset); - let length = split.next().unwrap().parse().unwrap(); - CodeLocation { line, column, length } -} - -pub fn decode_end_location(src: &str, content: &str) -> CodeLocation { - let mut split = src.split(':'); - let offset = split.next().unwrap().parse().unwrap(); - let (line, _column) = get_line_from_offset(&content, offset); - let length = split.next().unwrap().parse().unwrap(); - let extract = content[offset..offset + length].to_string(); - let (diff_line, new_column) = get_line_from_offset(&extract, length); - CodeLocation { - line: line + diff_line, - column: new_column, - length - } -} - -pub fn offset_from_location(content: &str, location: &CodeLocation) -> usize { - let mut offset = 0; - - for (i, line) in content.split('\n').enumerate() { - if i == location.line - 1 { - return offset + location.column; - } - offset += line.len() + 1; - } - offset -} - -pub fn decode_location(src: &str, content: &str) -> (CodeLocation, CodeLocation) { - (decode_begin_location(src, content), decode_end_location(src, content)) -} - -#[cfg(test)] -mod tests { - use std::fs; - use super::*; - - #[test] - fn test_correct_EnumValue_parsing() -> Result<(), String> { - let ast = fs::read_to_string("../solc-wrapper/tests/files/ast/EnumValue.json").expect("Could not find test data file"); - let res = serde_json::from_str::(&ast).map_err(|_| "Error deserializing EnumValue".to_string())?; - assert_eq!(res.name, "item1"); - assert_eq!(res.name_location, Some("72:5:0".to_string())); - Ok(assert_eq!(res.node_type, NodeType::EnumValue)) - } - - #[test] - fn test_correct_enum_definition_parsing() -> Result<(), String> { - let ast = fs::read_to_string("../solc-wrapper/tests/files/ast/EnumDefinition.json").expect("Could not find test data file"); - let res = serde_json::from_str::(&ast).map_err(|_| "Error deserializing EnumDefinition".to_string())?; - assert_eq!(res.canonical_name, "Test"); - assert_eq!(res.name_location, Some("66:4:0".to_string())); - Ok(assert_eq!(res.node_type, NodeType::EnumDefinition)) - } - - #[test] - fn test_correct_event_definition_parsing() -> Result<(), String> { - let ast = fs::read_to_string("../solc-wrapper/tests/files/ast/EventDefinition.json").expect("Could not find test data file"); - let res = serde_json::from_str::(&ast).map_err(|_| "Error deserializing EventDefinition".to_string())?; - assert_eq!(res.anonymous, false); - assert_eq!(res.id, 67); - assert_eq!(res.name, "MintingLocked".to_string()); - assert_eq!(res.src, "1582:45:0".to_string()); - assert_eq!(res.name_location, Some("1588:13:0".to_string())); - Ok(assert_eq!(res.node_type, NodeType::EventDefinition)) - } - - #[test] - fn test_correct_return_parsing() -> Result<(), String> { - let ast = fs::read_to_string("../solc-wrapper/tests/files/ast/Return.json").expect("Could not find test data file"); - let res = serde_json::from_str::(&ast).map_err(|_| "Error deserializing Return".to_string())?; - assert_eq!(res.id, 296); - assert_eq!(res.src, "5761:19:0".to_string()); - Ok(assert_eq!(res.node_type, NodeType::Return)) - } - - #[test] - fn test_correct_emit_statement_parsing() -> Result<(), String> { - let ast = fs::read_to_string("../solc-wrapper/tests/files/ast/EmitStatement.json").expect("Could not find test data file"); - let res = serde_json::from_str::(&ast).map_err(|_| "Error deserializing EmitStatement".to_string())?; - assert_eq!(res.id, 287); - assert_eq!(res.src, "5537:33:0".to_string()); - Ok(assert_eq!(res.node_type, NodeType::EmitStatement)) - } - - #[test] - fn test_correct_modifier_invocation_parsing() -> Result<(), String> { - let ast = fs::read_to_string("../solc-wrapper/tests/files/ast/ModifierInvocation.json").expect("Could not find test data file"); - let res = serde_json::from_str::(&ast).map_err(|_| "Error deserializing ModifierInvocation".to_string())?; - - assert_eq!(res.id, 274); - assert_eq!(res.src, "5445:13:0".to_string()); - Ok(assert_eq!(res.node_type, NodeType::ModifierInvocation)) - } - - #[test] - fn test_correct_pragma_directive_parsing() -> Result<(), String> { - let ast = fs::read_to_string("../solc-wrapper/tests/files/ast/PragmaDirective.json").expect("Could not find test data file"); - let res = serde_json::from_str::(&ast).map_err(|_| "Error deserializing PragmaDirective".to_string())?; - assert_eq!(res.id, 1); - assert_eq!(res.src, "33:23:0".to_string()); - assert_eq!(res.literals, vec!["solidity".to_string(), - "0.8".to_string(), - ".16".to_string()]); - Ok(assert_eq!(res.node_type, NodeType::PragmaDirective)) - } - - #[test] - fn test_correct_tuple_expression_parsing() -> Result<(), String> { - let ast = fs::read_to_string("../solc-wrapper/tests/files/ast/TupleExpression.json").expect("Could not find test data file"); - let res = serde_json::from_str::(&ast).map_err(|_| "Error deserializing TupleExpression".to_string())?; - assert_eq!(res.id, 16); - assert_eq!(res.src, "150:12:0".to_string()); - assert_eq!(res.is_inline_array, false); - Ok(assert_eq!(res.node_type, NodeType::TupleExpression)) - } - - #[test] - fn test_correct_using_for_directive_parsing() -> Result<(), String> { - let ast = fs::read_to_string("../solc-wrapper/tests/files/ast/UsingForDirective.json").expect("Could not find test data file"); - let res = serde_json::from_str::(&ast).map_err(|_| "Error deserializing UsingForDirective".to_string())?; - assert_eq!(res.id, 31); - assert_eq!(res.global, Some(false)); - assert_eq!(res.src, "1007:36:0".to_string()); - Ok(assert_eq!(res.node_type, NodeType::UsingForDirective)) - } - - #[test] - fn test_correct_modifier_definition_parsing() -> Result<(), String> { - let ast = fs::read_to_string("../solc-wrapper/tests/files/ast/ModifierDefinition.json").expect("Could not find test data file"); - let res = serde_json::from_str::(&ast).map_err(|_| "Error deserializing ModifierDefinition".to_string())?; - assert_eq!(res.id, 92); - assert_eq!(res.name, "metadataNotLocked".to_string()); - assert_eq!(res.name_location, Some("1995:17:0".to_string())); - assert_eq!(res.src, "1986:104:0".to_string()); - assert_eq!(res.is_virtual, false); - assert_eq!(res.visibility, Visibility::Internal); - Ok(assert_eq!(res.node_type, NodeType::ModifierDefinition)) - } - - #[test] - fn test_correct_parameter_list_parsing() -> Result<(), String> { - let ast = fs::read_to_string("../solc-wrapper/tests/files/ast/ParameterList.json").expect("Could not find test data file"); - let res = serde_json::from_str::(&ast).map_err(|_| "Error deserializing ParameterList".to_string())?; - assert_eq!(res.id, 197); - assert_eq!(res.src, "3904:30:0".to_string()); - Ok(assert_eq!(res.node_type, NodeType::ParameterList)) - } - - #[test] - fn test_correct_assignment_list_parsing() -> Result<(), String> { - let ast = fs::read_to_string("../solc-wrapper/tests/files/ast/Assignment.json").expect("Could not find test data file"); - let res = serde_json::from_str::(&ast).map_err(|_| "Error deserializing Assignment".to_string())?; - - assert_eq!(res.id, 141); - assert_eq!(res.src, "2849:35:0".to_string()); - assert_eq!(res.operator, AssignmentOperator::Equal); - Ok(assert_eq!(res.node_type, NodeType::Assignment)) - } - - #[test] - fn test_correct_inheritance_specifier_parsing() -> Result<(), String> { - let ast = fs::read_to_string("../solc-wrapper/tests/files/ast/InheritanceSpecifier.json").expect("Could not find test data file"); - let res = serde_json::from_str::(&ast).map_err(|_| "Error deserializing InheritanceSpecifier".to_string())?; - - assert_eq!(res.id, 13); - assert_eq!(res.src, "828:16:0".to_string()); - Ok(assert_eq!(res.node_type, NodeType::InheritanceSpecifier)) - } - - #[test] - fn test_correct_variable_declaration_parsing() -> Result<(), String> { - let ast = fs::read_to_string("../solc-wrapper/tests/files/ast/VariableDeclaration.json").expect("Could not find test data file"); - let res = serde_json::from_str::(&ast).map_err(|_| "Error deserializing VariableDeclaration".to_string())?; - assert_eq!(res.is_constant, false); - assert_eq!(res.id, 293); - assert_eq!(res.mutability, Mutability::Mutable); - assert_eq!(res.src, "5736:13:0".to_string()); - assert_eq!(res.name_location, Some("-1:-1:-1".to_string())); - assert_eq!(res.state_variable, false); - assert_eq!(res.storage_location, StorageLocation::Memory); - assert_eq!(res.visibility, Visibility::Internal); - Ok(assert_eq!(res.node_type, NodeType::VariableDeclaration)) - } - - #[test] - fn test_correct_if_statement_parsing() -> Result<(), String> { - let ast = fs::read_to_string("../solc-wrapper/tests/files/ast/IfStatement.json").expect("Could not find test data file"); - let res = serde_json::from_str::(&ast).map_err(|_| "Error deserializing IfStatement".to_string())?; - assert_eq!(res.id, 19); - assert_eq!(res.src, "145:103:0".to_string()); - Ok(assert_eq!(res.node_type, NodeType::IfStatement)) - } - - #[test] - fn test_correct_binary_operation_parsing() -> Result<(), String> { - let ast = fs::read_to_string("../solc-wrapper/tests/files/ast/BinaryOperation.json").expect("Could not find test data file"); - let res = serde_json::from_str::(&ast).map_err(|_| "Error deserializing TypeDescriptions".to_string())?; - - assert_eq!(res.id, 18); - assert_eq!(res.src, "203:5:0".to_string()); - assert_eq!(res.argument_types, None); - assert_eq!(res.is_constant, false); - assert_eq!(res.is_l_value, false); - assert_eq!(res.is_pure, false); - assert_eq!(res.l_value_requested, false); - assert_eq!(res.operator, BinaryOperator::Ampersand); - Ok(assert_eq!(res.node_type, NodeType::BinaryOperation)) - } - - #[test] - fn test_correct_unary_operation_parsing() -> Result<(), String> { - let ast = fs::read_to_string("../solc-wrapper/tests/files/ast/UnaryOperation.json").expect("Could not find test data file"); - let res = serde_json::from_str::(&ast).map_err(|_| "Error deserializing UnaryOperation".to_string())?; - - assert_eq!(res.id, 7); - assert_eq!(res.src, "104:6:0".to_string()); - assert_eq!(res.operator, UnaryOperator::DoublePlus); - assert_eq!(res.prefix, false); - Ok(assert_eq!(res.node_type, NodeType::UnaryOperation)) - } - - #[test] - fn test_correct_unchecked_block_parsing() -> Result<(), String> { - let ast = fs::read_to_string("../solc-wrapper/tests/files/ast/UncheckedBlock.json").expect("Could not find test data file"); - let res = serde_json::from_str::(&ast).map_err(|_| "Error deserializing UncheckedBlock".to_string())?; - - assert_eq!(res.id, 9); - assert_eq!(res.src, "104:21:0".to_string()); - Ok(assert_eq!(res.node_type, NodeType::UncheckedBlock)) - } - - #[test] - fn test_correct_identifier_parsing() -> Result<(), String> { - let ast = fs::read_to_string("../solc-wrapper/tests/files/ast/Identifier.json").expect("Could not find test data file"); - let res = serde_json::from_str::(&ast).map_err(|_| "Error deserializing TypeDescriptions".to_string())?; - - assert_eq!(res.id, 16); - assert_eq!(res.src, "203:1:0".to_string()); - assert_eq!(res.name, "a".to_string()); - assert_eq!(res.overloaded_declarations, vec![] as Vec); - assert_eq!(res.referenced_declaration, Some(7)); - Ok(assert_eq!(res.node_type, NodeType::Identifier)) - } - - #[test] - fn test_correct_conditional_parsing() -> Result<(), String> { - let ast = fs::read_to_string("../solc-wrapper/tests/files/ast/Conditional.json").expect("Could not find test data file"); - let res = serde_json::from_str::(&ast).map_err(|_| "Error deserializing Conditional".to_string())?; - - assert_eq!(res.id, 10); - assert_eq!(res.src, "158:20:0".to_string()); - assert_eq!(res.is_constant, false); - assert_eq!(res.is_l_value, false); - assert_eq!(res.is_pure, true); - assert_eq!(res.l_value_requested, false); - assert_eq!(res.node_type, NodeType::Conditional); - Ok(()) - } - - #[test] - fn test_correct_type_descriptions_parsing() -> Result<(), String> { - let ast = fs::read_to_string("../solc-wrapper/tests/files/ast/TypeDescriptions.json").expect("Could not find test data file"); - let res = serde_json::from_str::(&ast).map_err(|_| "Error deserializing Conditional".to_string())?; - - assert_eq!(res.type_identifier, Some("t_bool".to_string())); - assert_eq!(res.type_string, Some("bool".to_string())); - Ok(()) - } - - #[test] - fn test_correct_elementary_type_name_parsing() -> Result<(), String> { - let ast = fs::read_to_string("../solc-wrapper/tests/files/ast/ElementaryTypeName.json").expect("Could not find test data file"); - let res = serde_json::from_str::(&ast).map_err(|_| "Error deserializing ElementaryTypeName".to_string())?; - - assert_eq!(res.id, 64); - assert_eq!(res.src, "1602:7:0".to_string()); - assert_eq!(res.name, "address".to_string()); - assert_eq!(res.state_mutability, Some(StateMutability::NonPayable)); - assert_eq!(res.node_type, NodeType::ElementaryTypeName); - Ok(()) - } - - #[test] - fn test_correct_function_call_parsing() -> Result<(), String> { - let ast = fs::read_to_string("../solc-wrapper/tests/files/ast/FunctionCall.json").expect("Could not find test data file"); - let res = serde_json::from_str::(&ast).map_err(|_| "Error deserializing FunctionCall".to_string())?; - - assert_eq!(res.id, 78); - assert_eq!(res.src, "1850:44:0".to_string()); - assert_eq!(res.try_call, false); - assert_eq!(res.node_type, NodeType::FunctionCall); - Ok(()) - } - - #[test] - fn test_correct_literal_parsing() -> Result<(), String> { - let ast = fs::read_to_string("../solc-wrapper/tests/files/ast/Literal.json").expect("Could not find test data file"); - let res = serde_json::from_str::(&ast).map_err(|_| "Error deserializing Literal".to_string())?; - - assert_eq!(res.id, 77); - assert_eq!(res.src, "1874:19:0".to_string()); - assert_eq!(res.value, Some("Minting is locked".to_string())); - assert_eq!(res.hex_value, "4d696e74696e67206973206c6f636b6564".to_string()); - assert_eq!(res.kind, LiteralKind::String); - assert_eq!(res.node_type, NodeType::Literal); - Ok(()) - } - - #[test] - fn test_correct_member_access_parsing() -> Result<(), String> { - let ast = fs::read_to_string("../solc-wrapper/tests/files/ast/MemberAccess.json").expect("Could not find test data file"); - let res = serde_json::from_str::(&ast).map_err(|_| "Error deserializing Literal".to_string())?; - - assert_eq!(res.id, 176); - assert_eq!(res.src, "3535:23:0".to_string()); - assert_eq!(res.member_name, "current".to_string()); - assert_eq!(res.member_location, "3551:7:0".to_string()); - assert_eq!(res.node_type, NodeType::MemberAccess); - Ok(()) - } - - #[test] - fn test_correct_block_parsing() -> Result<(), String> { - let ast = fs::read_to_string("../solc-wrapper/tests/files/ast/Block.json").expect("Could not find test data file"); - let res = serde_json::from_str::(&ast).map_err(|_| "Error deserializing Block".to_string())?; - - assert_eq!(res.id, 192); - assert_eq!(res.src, "3511:148:0".to_string()); - assert_eq!(res.statements, Some(vec![] as Vec)); - assert_eq!(res.node_type, NodeType::Block); - Ok(()) - } - - #[test] - fn test_correct_expression_statement_parsing() -> Result<(), String> { - let ast = fs::read_to_string("../solc-wrapper/tests/files/ast/ExpressionStatement.json").expect("Could not find test data file"); - let res = serde_json::from_str::(&ast).map_err(|_| "Error deserializing Expression Statement".to_string())?; - - assert_eq!(res.id, 154); - assert_eq!(res.src, "2968:35:0".to_string()); - assert_eq!(res.node_type, NodeType::ExpressionStatement); - Ok(()) - } - - #[test] - fn test_correct_placeholder_statement_parsing() -> Result<(), String> { - let ast = fs::read_to_string("../solc-wrapper/tests/files/ast/PlaceholderStatement.json").expect("Could not find test data file"); - let res = serde_json::from_str::(&ast).map_err(|_| "Error deserializing PlaceholderStatement".to_string())?; - - assert_eq!(res.id, 80); - assert_eq!(res.src, "1904:1:0".to_string()); - assert_eq!(res.node_type, NodeType::PlaceholderStatement); - Ok(()) - } - - #[test] - fn test_correct_contract_definition_parsing() -> Result<(), String> { - let ast = fs::read_to_string("../solc-wrapper/tests/files/ast/ContractDefinition.json").expect("Could not find test data file"); - let res = serde_json::from_str::(&ast).map_err(|_| "Error deserializing ContractDefinition".to_string())?; - - assert_eq!(res.id, 427); - assert_eq!(res.src, "783:7774:0".to_string()); - assert_eq!(res.name_location, Some("792:28:0".to_string())); - assert_eq!(res.name, "StartonERC721MetaTransaction".to_string()); - assert_eq!(res.contract_kind, ContractKind::Contract); - assert_eq!(res.is_abstract, false); - assert_eq!(res.node_type, NodeType::ContractDefinition); - Ok(()) - } - - #[test] - fn test_correct_function_definition_parsing() -> Result<(), String> { - let ast = fs::read_to_string("../solc-wrapper/tests/files/ast/FunctionDefinition.json").expect("Could not find test data file"); - let res = serde_json::from_str::(&ast).map_err(|_| "Error deserializing FunctionDefinition".to_string())?; - - assert_eq!(res.id, 193); - assert_eq!(res.src, "3392:267:0".to_string()); - assert_eq!(res.name, "mint".to_string()); - assert_eq!(res.name_location, Some("3401:4:0".to_string())); - assert_eq!(res.implemented, true); - assert_eq!(res.kind, FunctionDefinitionKind::Function); - assert_eq!(res.visibility, Some(Visibility::Public)); - assert_eq!(res.is_virtual, false); - assert_eq!(res.state_mutability, StateMutability::NonPayable); - assert_eq!(res.node_type, NodeType::FunctionDefinition); - Ok(()) - } - - #[test] - fn test_correct_import_directive_parsing() -> Result<(), String> { - let ast = fs::read_to_string("../solc-wrapper/tests/files/ast/ImportDirective.json").expect("Could not find test data file"); - let res = serde_json::from_str::(&ast).map_err(|_| "Error deserializing ImportDirective".to_string())?; - - assert_eq!(res.id, 2); - assert_eq!(res.src, "58:78:0".to_string()); - assert_eq!(res.name_location, Some("-1:-1:-1".to_string())); - assert_eq!(res.file, "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol".to_string()); - assert_eq!(res.absolute_path, "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol".to_string()); - assert_eq!(res.unit_alias, "".to_string()); - assert_eq!(res.symbol_aliases, vec![] as Vec); - assert_eq!(res.node_type, NodeType::ImportDirective); - Ok(()) - } - - #[test] - fn test_correct_source_unit_parsing() -> Result<(), String> { - let ast = fs::read_to_string("../solc-wrapper/tests/files/ast/SourceUnit.json").expect("Could not find test data file"); - let res = serde_json::from_str::(&ast).map_err(|_| "Error deserializing SourceUnit".to_string())?; - - assert_eq!(res.id, 428); - assert_eq!(res.src, "33:8524:0".to_string()); - assert_eq!(res.absolute_path, "wow.sol".to_string()); - assert_eq!(res.license, Some("MIT".to_string())); - assert_eq!(res.node_type, NodeType::SourceUnit); - Ok(()) - } - - #[test] - fn test_correct_structured_documentation_parsing() -> Result<(), String> { - let ast = fs::read_to_string("../solc-wrapper/tests/files/ast/StructuredDocumentation.json").expect("Could not find test data file"); - let res = serde_json::from_str::(&ast).map_err(|_| "Error deserializing StructuredDocumentation".to_string())?; - - assert_eq!(res.id, 63); - assert_eq!(res.src, "1522:55:0".to_string()); - assert_eq!(res.text, "@notice Event emitted when the minting is locked ".to_string()); - assert_eq!(res.node_type, NodeType::StructuredDocumentation); - Ok(()) - } - - #[test] - fn test_correct_break_parsing() -> Result<(), String> { - let ast = fs::read_to_string("../solc-wrapper/tests/files/ast/Break.json").expect("Could not find test data file"); - let res = serde_json::from_str::(&ast).map_err(|_| "Error deserializing Break".to_string())?; - - assert_eq!(res.id, 7); - assert_eq!(res.src, "172:5:0".to_string()); - assert_eq!(res.node_type, NodeType::Break); - Ok(()) - } - - #[test] - fn test_correct_continue_parsing() -> Result<(), String> { - let ast = fs::read_to_string("../solc-wrapper/tests/files/ast/Continue.json").expect("Could not find test data file"); - let res = serde_json::from_str::(&ast).map_err(|_| "Error deserializing Continue".to_string())?; - - assert_eq!(res.id, 7); - assert_eq!(res.src, "172:8:0".to_string()); - assert_eq!(res.node_type, NodeType::Continue); - Ok(()) - } - - #[test] - fn test_correct_while_statement_parsing() -> Result<(), String> { - let ast = fs::read_to_string("../solc-wrapper/tests/files/ast/WhileStatement.json").expect("Could not find test data file"); - let res = serde_json::from_str::(&ast).map_err(|_| "Error deserializing WhileStatement".to_string())?; - - assert_eq!(res.id, 9); - assert_eq!(res.src, "145:46:0".to_string()); - assert_eq!(res.node_type, NodeType::WhileStatement); - Ok(()) - } - - #[test] - fn test_correct_do_while_statement_parsing() -> Result<(), String> { - let ast = fs::read_to_string("../solc-wrapper/tests/files/ast/DoWhileStatement.json").expect("Could not find test data file"); - let res = serde_json::from_str::(&ast).map_err(|_| "Error deserializing DoWhileStatement".to_string())?; - - assert_eq!(res.id, 9); - assert_eq!(res.src, "145:50:0".to_string()); - assert_eq!(res.node_type, NodeType::DoWhileStatement); - Ok(()) - } - - #[test] - fn test_correct_for_statement_parsing() -> Result<(), String> { - let ast = fs::read_to_string("../solc-wrapper/tests/files/ast/ForStatement.json").expect("Could not find test data file"); - let res = serde_json::from_str::(&ast).map_err(|_| "Error deserializing ForStatement".to_string())?; - - assert_eq!(res.id, 18); - assert_eq!(res.src, "145:60:0".to_string()); - assert_eq!(res.node_type, NodeType::ForStatement); - Ok(()) - } - - #[test] - fn test_correct_struct_definition_parsing() -> Result<(), String> { - let ast = fs::read_to_string("../solc-wrapper/tests/files/ast/StructDefinition.json").expect("Could not find test data file"); - let res = serde_json::from_str::(&ast).map_err(|_| "Error deserializing StructDefinition".to_string())?; - - assert_eq!(res.id, 6); - assert_eq!(res.src, "62:36:0".to_string()); - assert_eq!(res.name_location, Some("69:1:0".to_string())); - assert_eq!(res.name, "S".to_string()); - assert_eq!(res.scope, 27); - assert_eq!(res.visibility, Visibility::Public); - assert_eq!(res.canonical_name, "S".to_string()); - assert_eq!(res.node_type, NodeType::StructDefinition); - Ok(()) - } - - #[test] - fn test_correct_try_statement_parsing() -> Result<(), String> { - let ast = fs::read_to_string("../solc-wrapper/tests/files/ast/TryStatement.json").expect("Could not find test data file"); - let res = serde_json::from_str::(&ast).map_err(|_| "Error deserializing TryStatement".to_string())?; - - assert_eq!(res.id, 95); - assert_eq!(res.src, "976:155:0".to_string()); - assert_eq!(res.node_type, NodeType::TryStatement); - Ok(()) - } - - #[test] - fn test_correct_revert_statement_parsing() -> Result<(), String> { - let ast = fs::read_to_string("../solc-wrapper/tests/files/ast/RevertStatement.json").expect("Could not find test data file"); - let res = serde_json::from_str::(&ast).map_err(|_| "Error deserializing RevertStatement".to_string())?; - - assert_eq!(res.id, 8); - assert_eq!(res.src, "118:12:0".to_string()); - assert_eq!(res.node_type, NodeType::RevertStatement); - Ok(()) - } - - #[test] - fn test_correct_inline_assembly_parsing() -> Result<(), String> { - let ast = fs::read_to_string("../solc-wrapper/tests/files/ast/InlineAssembly.json").expect("Could not find test data file"); - let res = serde_json::from_str::(&ast).map_err(|_| "Error deserializing InlineAssembly".to_string())?; - - assert_eq!(res.id, 9); - assert_eq!(res.src, "176:50:0".to_string()); - assert_eq!(res.evm_version, EvmVersion::London); - assert_eq!(res.node_type, NodeType::InlineAssembly); - Ok(()) - } - - #[test] - fn test_correct_error_definition_parsing() -> Result<(), String> { - let ast = fs::read_to_string("../solc-wrapper/tests/files/ast/ErrorDefinition.json").expect("Could not find test data file"); - let res = serde_json::from_str::(&ast).map_err(|_| "Error deserializing ErrorDefinition".to_string())?; - - assert_eq!(res.id, 3); - assert_eq!(res.name, "No".to_string()); - assert_eq!(res.name_location, "92:2:0".to_string()); - assert_eq!(res.src, "86:11:0".to_string()); - assert_eq!(res.node_type, NodeType::ErrorDefinition); - Ok(()) - } - - #[test] - fn test_correct_index_access_parsing() -> Result<(), String> { - let ast = fs::read_to_string("../solc-wrapper/tests/files/ast/IndexAccess.json").expect("Could not find test data file"); - let res = serde_json::from_str::(&ast).map_err(|_| "Error deserializing IndexAccess".to_string())?; - - assert_eq!(res.id, 14); - assert_eq!(res.src, "203:10:0".to_string()); - assert_eq!(res.node_type, NodeType::IndexAccess); - Ok(()) - } - - #[test] - fn test_correct_new_expression_parsing() -> Result<(), String> { - let ast = fs::read_to_string("../solc-wrapper/tests/files/ast/NewExpression.json").expect("Could not find test data file"); - let res = serde_json::from_str::(&ast).map_err(|_| "Error deserializing NewExpression".to_string())?; - - assert_eq!(res.id, 7); - assert_eq!(res.src, "131:6:0".to_string()); - assert_eq!(res.node_type, NodeType::NewExpression); - Ok(()) - } - - #[test] - fn test_correct_function_call_options_parsing() -> Result<(), String> { - let ast = fs::read_to_string("../solc-wrapper/tests/files/ast/FunctionCallOptions.json").expect("Could not find test data file"); - let res = serde_json::from_str::(&ast).map_err(|_| "Error deserializing FunctionCallOptions".to_string())?; - - assert_eq!(res.id, 21); - assert_eq!(res.src, "236:36:0".to_string()); - assert_eq!(res.names, vec!["value".to_string()]); - assert_eq!(res.node_type, NodeType::FunctionCallOptions); - Ok(()) - } - - #[test] - fn test_correct_function_type_name_options_parsing() -> Result<(), String> { - let ast = fs::read_to_string("../solc-wrapper/tests/files/ast/FunctionTypeName.json").expect("Could not find test data file"); - let res = serde_json::from_str::(&ast).map_err(|_| "Error deserializing FunctionTypeName".to_string())?; - - assert_eq!(res.id, 11); - assert_eq!(res.src, "260:37:0".to_string()); - assert_eq!(res.state_mutability, StateMutability::Pure); - assert_eq!(res.visibility, Visibility::Internal); - assert_eq!(res.node_type, NodeType::FunctionTypeName); - Ok(()) - } - - #[test] - fn test_correct_user_defined_value_type_definition_parsing() -> Result<(), String> { - let ast = fs::read_to_string("../solc-wrapper/tests/files/ast/UserDefinedValueTypeDefinition.json").expect("Could not find test data file"); - let res = serde_json::from_str::(&ast).map_err(|_| "Error deserializing UserDefinedValueTypeDefinition".to_string())?; - - assert_eq!(res.id, 3); - assert_eq!(res.name, "UFixed256x18".to_string()); - assert_eq!(res.name_location, Some("160:12:0".to_string())); - assert_eq!(res.src, "155:29:0".to_string()); - assert_eq!(res.node_type, NodeType::UserDefinedValueTypeDefinition); - Ok(()) - } - - #[test] - fn test_correct_elementary_type_name_expression_parsing() -> Result<(), String> { - let ast = fs::read_to_string("../solc-wrapper/tests/files/ast/ElementaryTypeNameExpression.json").expect("Could not find test data file"); - let res = serde_json::from_str::(&ast).map_err(|_| "Error deserializing ElementaryTypeNameExpression".to_string())?; - - assert_eq!(res.id, 10); - assert_eq!(res.src, "156:7:0".to_string()); - assert_eq!(res.node_type, NodeType::ElementaryTypeNameExpression); - Ok(()) - } - - #[test] - fn test_correct_index_range_access_expression_parsing() -> Result<(), String> { - let ast = fs::read_to_string("../solc-wrapper/tests/files/ast/IndexRangeAccess.json").expect("Could not find test data file"); - let res = serde_json::from_str::(&ast).map_err(|_| "Error deserializing IndexRangeAccess".to_string())?; - - assert_eq!(res.id, 12); - assert_eq!(res.src, "174:8:0".to_string()); - assert_eq!(res.node_type, NodeType::IndexRangeAccess); - Ok(()) - } -} \ No newline at end of file diff --git a/toolchains/solidity/linter/core/solc-wrapper/src/ast/error.rs b/toolchains/solidity/linter/core/solc-wrapper/src/ast/error.rs deleted file mode 100644 index 2e16d955..00000000 --- a/toolchains/solidity/linter/core/solc-wrapper/src/ast/error.rs +++ /dev/null @@ -1,7 +0,0 @@ -use thiserror::Error; - -#[derive(Error, Debug)] -pub enum AstError { - #[error("AstError: cannot parse the json to AST")] - JsonParseFailed(#[from] serde_json::Error), -} diff --git a/toolchains/solidity/linter/core/solc-wrapper/src/ast/mod.rs b/toolchains/solidity/linter/core/solc-wrapper/src/ast/mod.rs deleted file mode 100644 index 6b8c7b6c..00000000 --- a/toolchains/solidity/linter/core/solc-wrapper/src/ast/mod.rs +++ /dev/null @@ -1,4 +0,0 @@ -pub mod parse; -pub mod ast; -pub mod error; -pub mod utils; \ No newline at end of file diff --git a/toolchains/solidity/linter/core/solc-wrapper/src/ast/parse.rs b/toolchains/solidity/linter/core/solc-wrapper/src/ast/parse.rs deleted file mode 100644 index 6c03cd37..00000000 --- a/toolchains/solidity/linter/core/solc-wrapper/src/ast/parse.rs +++ /dev/null @@ -1,7 +0,0 @@ -use crate::ast::ast::SourceUnit; - -use super::error::AstError; - -pub fn parse_ast(json: &str) -> Result { - Ok(serde_json::from_str(json)?) -} diff --git a/toolchains/solidity/linter/core/solc-wrapper/src/ast/utils.rs b/toolchains/solidity/linter/core/solc-wrapper/src/ast/utils.rs deleted file mode 100644 index 3cbd39eb..00000000 --- a/toolchains/solidity/linter/core/solc-wrapper/src/ast/utils.rs +++ /dev/null @@ -1,731 +0,0 @@ -use crate::ast::ast::*; - -pub enum Nodes { - SourceUnit(SourceUnit), - ContractDefinition(Box), - Assignment(Box), - BinaryOperation(Box), - Conditional(Box), - ElementaryTypeNameExpression(Box), - FunctionCall(Box), - FunctionCallOptions(Box), - Identifier(Box), - IdentifierPath(Box), - IndexAccess(Box), - IndexRangeAccess(Box), - Literal(Box), - MemberAccess(Box), - NewExpression(Box), - TupleExpression(Box), - UnaryOperation(Box), - Block(Box), - Break(Box), - Continue(Box), - DoWhileStatement(Box), - EmitStatement(Box), - ExpressionStatement(Box), - ForStatement(Box), - IfStatement(Box), - PlaceholderStatement(Box), - Return(Box), - RevertStatement(Box), - TryStatement(Box), - TryCatchClause(Box), - UncheckedBlock(Box), - VariableDeclarationStatement(Box), - WhileStatement(Box), - FunctionDefinition(Box), - ModifierDefinition(Box), - StructDefinition(Box), - UserDefinedValueTypeDefinition(Box), - VariableDeclaration(Box), - EnumDefinition(Box), - EnumValue(Box), - ErrorDefinition(Box), - EventDefinition(Box), - UsingForDirective(Box), - UserDefinedTypeName(Box), - ImportDirective(Box), - PragmaDirective(Box), - FunctionTypeName(Box), - Mapping(Box), - ElementaryTypeName(Box), - ParameterList(Box), - OverrideSpecifier(Box), - InheritanceSpecifier(Box), - ModifierInvocation(Box) -} - -fn check_statement_node(node: Statement, nodes: &mut Vec, node_type: NodeType) { - match node { - Statement::Block(block) => { - check_block_node(block, nodes, node_type); - } - Statement::Break(break_statement) => { - check_break_node(break_statement, nodes, node_type); - } - Statement::Continue(continue_statement) => { - check_continue_node(continue_statement, nodes, node_type); - } - Statement::DoWhileStatement(do_while_statement) => { - check_do_while_statement_node(do_while_statement, nodes, node_type); - } - Statement::EmitStatement(emit_statement) => { - check_emit_statement_node(emit_statement, nodes, node_type); - } - Statement::ExpressionStatement(expression_statement) => { - check_expression_statement_node(expression_statement, nodes, node_type); - } - Statement::ForStatement(for_statement) => { - check_for_statement_node(for_statement, nodes, node_type); - } - Statement::IfStatement(if_statement) => { - check_if_statement_node(if_statement, nodes, node_type); - } - Statement::PlaceholderStatement(placeholder_statement) => { - check_placeholder_statement_node(placeholder_statement, nodes, node_type); - } - Statement::Return(return_statement) => { - check_return_node(return_statement, nodes, node_type); - } - Statement::RevertStatement(revert_statement) => { - check_revert_statement_node(revert_statement, nodes, node_type); - } - Statement::TryStatement(try_statement) => { - check_try_statement_node(try_statement, nodes, node_type); - } - Statement::UncheckedBlock(unchecked_block) => { - check_unchecked_block_node(unchecked_block, nodes, node_type); - } - Statement::VariableDeclarationStatement(variable_declaration_statement) => { - check_variable_declaration_statement_node(variable_declaration_statement, nodes, node_type); - } - Statement::WhileStatement(while_statement) => { - check_while_statement_node(while_statement, nodes, node_type); - } - } -} - -fn check_body_node(body: Body, nodes: &mut Vec, node_type: NodeType) { - match body { - Body::Block(block) => { - check_block_node(block, nodes, node_type); - } - Body::Statement(statement) => { - check_statement_node(*statement, nodes, node_type); - } - } -} - -fn check_function_type_name_node(node: Box, nodes: &mut Vec, node_type: NodeType) { - if node_type == NodeType::FunctionTypeName { - nodes.push(Nodes::FunctionTypeName(node.clone())); - } - check_parameter_list_node(Box::new(node.parameter_types), nodes, node_type.clone()); - check_parameter_list_node(Box::new(node.return_parameter_types), nodes, node_type); -} - -fn check_typename_node(node: TypeName, nodes: &mut Vec, node_type: NodeType) { - match node { - TypeName::ArrayTypeName(node) => { - check_typename_node(node.base_type, nodes, node_type); - }, - TypeName::ElementaryTypeName(node) => { - check_elementary_type_name_node(node, nodes, node_type); - }, - TypeName::FunctionTypeName(node) => { - check_function_type_name_node(node, nodes, node_type); - }, - TypeName::Mapping(node) => { - check_mapping_node(node, nodes, node_type); - }, - TypeName::UserDefinedTypeName(node) => { - nodes.push(Nodes::UserDefinedTypeName(node)); - }, - } -} - -fn check_mapping_node(node: Box, nodes: &mut Vec, node_type: NodeType) { - if node_type == NodeType::Mapping { - nodes.push(Nodes::Mapping(node.clone())); - } - check_typename_node(node.key_type, nodes, node_type.clone()); - check_typename_node(node.value_type, nodes, node_type.clone()); -} - -fn check_expression_node(node: Expression, nodes: &mut Vec, node_type: NodeType) { - match node { - Expression::Assignment(node) => { - check_assignment_node(node, nodes, node_type); - } - Expression::BinaryOperation(node) => { - check_binary_operation_node(node, nodes, node_type); - } - Expression::Conditional(node) => { - check_conditional_node(node, nodes, node_type); - } - Expression::ElementaryTypeNameExpression(node) => { - check_elementary_type_name_expression_node(node, nodes, node_type); - } - Expression::FunctionCall(node) => { - check_function_call_node(node, nodes, node_type); - } - Expression::FunctionCallOptions(node) => { - check_function_call_options_node(node, nodes, node_type); - } - Expression::Identifier(node) => { - check_identifier_node(node, nodes, node_type); - } - Expression::IdentifierPath(node) => { - check_identifier_path_node(node, nodes, node_type); - } - Expression::IndexAccess(node) => { - check_index_access_node(node, nodes, node_type); - } - Expression::IndexRangeAccess(node) => { - check_index_range_access_node(node, nodes, node_type); - } - Expression::Literal(node) => { - check_literal_node(node, nodes, node_type); - } - Expression::MemberAccess(node) => { - check_member_access_node(node, nodes, node_type); - } - Expression::NewExpression(node) => { - check_new_expression_node(node, nodes, node_type); - } - Expression::TupleExpression(node) => { - check_tuple_expression_node(node, nodes, node_type); - } - Expression::UnaryOperation(node) => { - check_unary_operation_node(node, nodes, node_type); - } - } -} - -fn check_parameter_list_node(node: Box, nodes: &mut Vec, node_type: NodeType) { - if node_type == NodeType::ParameterList { - nodes.push(Nodes::ParameterList(node.clone())); - } - for parameter in node.parameters { - check_variable_declaration_node(Box::new(parameter), nodes, node_type.clone()); - } -} - -fn check_assignment_node(node: Box, nodes: &mut Vec, node_type: NodeType) { - if node_type == NodeType::Assignment { - nodes.push(Nodes::Assignment(node.clone())); - } - check_expression_node(node.left_hand_side, nodes, node_type.clone()); - check_expression_node(node.right_hand_side, nodes, node_type); -} - -fn check_binary_operation_node(node: Box, nodes: &mut Vec, node_type: NodeType) { - if node_type == NodeType::BinaryOperation { - nodes.push(Nodes::BinaryOperation(node.clone())); - } - check_expression_node(node.left_expression, nodes, node_type.clone()); - check_expression_node(node.right_expression, nodes, node_type.clone()); -} - -fn check_conditional_node(node: Box, nodes: &mut Vec, node_type: NodeType) { - if node_type == NodeType::Conditional { - nodes.push(Nodes::Conditional(node.clone())); - } - check_expression_node(node.condition, nodes, node_type.clone()); - check_expression_node(node.true_expression, nodes, node_type.clone()); - check_expression_node(node.false_expression, nodes, node_type); -} - -fn check_elementary_type_name_expression_node(node: Box, nodes: &mut Vec, node_type: NodeType) { - if node_type == NodeType::ElementaryTypeNameExpression { - nodes.push(Nodes::ElementaryTypeNameExpression(node.clone())); - } - check_elementary_type_name_node(Box::new(node.type_name), nodes, node_type); -} - -fn check_elementary_type_name_node(node: Box, nodes: &mut Vec, node_type: NodeType) { - if node_type == NodeType::ElementaryTypeName { - nodes.push(Nodes::ElementaryTypeName(node.clone())); - } -} - -fn check_function_call_node(node: Box, nodes: &mut Vec, node_type: NodeType) { - if node_type == NodeType::FunctionCall { - nodes.push(Nodes::FunctionCall(node.clone())); - } - check_expression_node(node.expression, nodes, node_type.clone()); - for argument in node.arguments { - check_expression_node(argument, nodes, node_type.clone()); - } -} - -fn check_function_call_options_node(node: Box, nodes: &mut Vec, node_type: NodeType) { - if node_type == NodeType::FunctionCallOptions { - nodes.push(Nodes::FunctionCallOptions(node.clone())); - } - check_expression_node(node.expression, nodes, node_type.clone()); - for option in node.options { - check_expression_node(option, nodes, node_type.clone()); - } -} - -fn check_identifier_node(node: Box, nodes: &mut Vec, node_type: NodeType) { - if node_type == NodeType::Identifier { - nodes.push(Nodes::Identifier(node.clone())); - } -} - -fn check_identifier_path_node(node: Box, nodes: &mut Vec, node_type: NodeType) { - if node_type == NodeType::IdentifierPath { - nodes.push(Nodes::IdentifierPath(node.clone())); - } -} - -fn check_index_access_node(node: Box, nodes: &mut Vec, node_type: NodeType) { - if node_type == NodeType::IndexAccess { - nodes.push(Nodes::IndexAccess(node.clone())); - } - check_expression_node(node.base_expression, nodes, node_type.clone()); - if node.index_expression.is_some() { - check_expression_node(node.index_expression.unwrap(), nodes, node_type); - } -} - -fn check_index_range_access_node(node: Box, nodes: &mut Vec, node_type: NodeType) { - if node_type == NodeType::IndexRangeAccess { - nodes.push(Nodes::IndexRangeAccess(node.clone())); - } - check_expression_node(node.base_expression, nodes, node_type.clone()); - if node.start_expression.is_some() { - check_expression_node(node.start_expression.unwrap(), nodes, node_type.clone()); - } - if node.end_expression.is_some() { - check_expression_node(node.end_expression.unwrap(), nodes, node_type); - } -} - -fn check_literal_node(node: Box, nodes: &mut Vec, node_type: NodeType) { - if node_type == NodeType::Literal { - nodes.push(Nodes::Literal(node.clone())); - } -} - -fn check_member_access_node(node: Box, nodes: &mut Vec, node_type: NodeType) { - if node_type == NodeType::MemberAccess { - nodes.push(Nodes::MemberAccess(node.clone())); - } - check_expression_node(node.expression, nodes, node_type); -} - -fn check_new_expression_node(node: Box, nodes: &mut Vec, node_type: NodeType) { - if node_type == NodeType::NewExpression { - nodes.push(Nodes::NewExpression(node.clone())); - } -} - -fn check_tuple_expression_node(node: Box, nodes: &mut Vec, node_type: NodeType) { - if node_type == NodeType::TupleExpression { - nodes.push(Nodes::TupleExpression(node.clone())); - } - for expression in node.components { - check_expression_node(expression, nodes, node_type.clone()); - } -} - -fn check_unary_operation_node(node: Box, nodes: &mut Vec, node_type: NodeType) { - if node_type == NodeType::UnaryOperation { - nodes.push(Nodes::UnaryOperation(node.clone())); - } - check_expression_node(node.sub_expression, nodes, node_type); -} - -fn check_block_node(node: Box, nodes: &mut Vec, node_type: NodeType) { - if node_type == NodeType::Block { - nodes.push(Nodes::Block(node.clone())); - } - if node.statements.is_some() { - for statement in node.statements.unwrap() { - check_statement_node(statement, nodes, node_type.clone()); - } - } -} - -fn check_break_node(node: Box, nodes: &mut Vec, node_type: NodeType) { - if node_type == NodeType::Break { - nodes.push(Nodes::Break(node.clone())); - } -} - -fn check_continue_node(node: Box, nodes: &mut Vec, node_type: NodeType) { - if node_type == NodeType::Continue { - nodes.push(Nodes::Continue(node.clone())); - } -} - -fn check_do_while_statement_node(node: Box, nodes: &mut Vec, node_type: NodeType) { - if node_type == NodeType::DoWhileStatement { - nodes.push(Nodes::DoWhileStatement(node.clone())); - } - check_body_node(node.body, nodes, node_type.clone()); - check_expression_node(node.condition, nodes, node_type); -} - -fn check_emit_statement_node(node: Box, nodes: &mut Vec, node_type: NodeType) { - if node_type == NodeType::EmitStatement { - nodes.push(Nodes::EmitStatement(node.clone())); - } - check_function_call_node(Box::new(node.event_call), nodes, node_type); -} - -fn check_expression_statement_node(node: Box, nodes: &mut Vec, node_type: NodeType) { - if node_type == NodeType::ExpressionStatement { - nodes.push(Nodes::ExpressionStatement(node.clone())); - } - check_expression_node(node.expression, nodes, node_type); -} - -fn check_for_statement_node(node: Box, nodes: &mut Vec, node_type: NodeType) { - if node_type == NodeType::ForStatement { - nodes.push(Nodes::ForStatement(node.clone())); - } - check_body_node(node.body, nodes, node_type.clone()); - if node.condition.is_some() { - check_expression_node(node.condition.unwrap(), nodes, node_type.clone()); - } - if node.loop_expression.is_some() { - check_expression_statement_node(Box::new(node.loop_expression.unwrap()), nodes, node_type.clone()); - } - if node.initialization_expression.is_some() { - let initialization_expression = node.initialization_expression.unwrap(); - match initialization_expression { - InitializationExpression::VariableDeclarationStatement(variable_declaration_statement) => { - check_variable_declaration_statement_node(Box::new(variable_declaration_statement), nodes, node_type.clone()); - }, - InitializationExpression::ExpressionStatement(expression_statement) => { - check_expression_statement_node(Box::new(expression_statement), nodes, node_type.clone()); - }, - } - } -} - -fn check_if_statement_node(node: Box, nodes: &mut Vec, node_type: NodeType) { - if node_type == NodeType::IfStatement { - nodes.push(Nodes::IfStatement(node.clone())); - } - check_expression_node(node.condition, nodes, node_type.clone()); - check_body_node(node.true_body, nodes, node_type.clone()); - if node.false_body.is_some() { - check_body_node(node.false_body.unwrap(), nodes, node_type); - } -} - -fn check_placeholder_statement_node(node: Box, nodes: &mut Vec, node_type: NodeType) { - if node_type == NodeType::PlaceholderStatement { - nodes.push(Nodes::PlaceholderStatement(node.clone())); - } -} - -fn check_return_node(node: Box, nodes: &mut Vec, node_type: NodeType) { - if node_type == NodeType::Return { - nodes.push(Nodes::Return(node.clone())); - } - if node.expression.is_some() { - check_expression_node(node.expression.unwrap(), nodes, node_type); - } -} - -fn check_revert_statement_node(node: Box, nodes: &mut Vec, node_type: NodeType) { - if node_type == NodeType::RevertStatement { - nodes.push(Nodes::RevertStatement(node.clone())); - } - check_statement_node(node.error_call, nodes, node_type); -} - -fn check_try_statement_node(node: Box, nodes: &mut Vec, node_type: NodeType) { - if node_type == NodeType::TryStatement { - nodes.push(Nodes::TryStatement(node.clone())); - } - check_expression_node(node.external_call, nodes, node_type.clone()); - for catch_clause in node.clauses { - check_try_catch_clause_node(Box::new(catch_clause), nodes, node_type.clone()); - } -} - -fn check_try_catch_clause_node(node: Box, nodes: &mut Vec, node_type: NodeType) { - if node_type == NodeType::TryCatchClause { - nodes.push(Nodes::TryCatchClause(node.clone())); - } - check_block_node(Box::new(node.block), nodes, node_type); -} - -fn check_unchecked_block_node(node: Box, nodes: &mut Vec, node_type: NodeType) { - if node_type == NodeType::UncheckedBlock { - nodes.push(Nodes::UncheckedBlock(node.clone())); - } - for statement in node.statements { - check_statement_node(statement, nodes, node_type.clone()); - } -} - -fn check_variable_declaration_statement_node(node: Box, nodes: &mut Vec, node_type: NodeType) { - if node_type == NodeType::VariableDeclarationStatement { - nodes.push(Nodes::VariableDeclarationStatement(node.clone())); - } - for variable_declaration in node.declarations { - if variable_declaration.is_some() { - check_variable_declaration_node(Box::new(variable_declaration.unwrap()), nodes, node_type.clone()); - } - } -} - -fn check_while_statement_node(node: Box, nodes: &mut Vec, node_type: NodeType) { - if node_type == NodeType::WhileStatement { - nodes.push(Nodes::WhileStatement(node.clone())); - } - check_statement_node(node.body, nodes, node_type.clone()); - check_expression_node(node.condition, nodes, node_type); -} - -fn check_modifier_invocation_node(node: Box, nodes: &mut Vec, node_type: NodeType) { - if node_type == NodeType::ModifierInvocation { - nodes.push(Nodes::ModifierInvocation(node.clone())); - } - if node.arguments.is_some() { - check_expression_node(node.arguments.unwrap(), nodes, node_type.clone()); - } - match node.modifier_name { - ModifierName::Identifier(identifier) => { - check_identifier_node(Box::new(identifier), nodes, node_type); - }, - ModifierName::IdentifierPath(identifier_path) => { - check_identifier_path_node(Box::new(identifier_path), nodes, node_type); - } - }; -} - -fn check_function_definition_node(node: Box, nodes: &mut Vec, node_type: NodeType) { - if node_type == NodeType::FunctionDefinition { - nodes.push(Nodes::FunctionDefinition(node.clone())); - } - if node.body.is_some() { - check_block_node(Box::new(node.body.unwrap()), nodes, node_type.clone()); - } - for modifier in node.modifiers { - check_modifier_invocation_node(Box::new(modifier), nodes, node_type.clone()); - } - if node.overrides.is_some() { - check_override_specifier_node(Box::new(node.overrides.unwrap()), nodes, node_type.clone()); - } - check_parameter_list_node(Box::new(node.parameters), nodes, node_type.clone()); - check_parameter_list_node(Box::new(node.return_parameters), nodes, node_type); -} - -fn check_override_specifier_node(node: Box, nodes: &mut Vec, node_type: NodeType) { - if node_type == NodeType::OverrideSpecifier { - nodes.push(Nodes::OverrideSpecifier(node.clone())); - } - match node.overrides { - OverridesEnum::Identifier(identifier_list) => { - for identifier in identifier_list { - check_identifier_path_node(Box::new(identifier), nodes, node_type.clone()); - } - }, - OverridesEnum::UserDefinedTypeName(user_defined_type_name) => { - for user_defined_type in user_defined_type_name { - check_user_defined_type_name_node(Box::new(user_defined_type), nodes, node_type.clone()); - } - }, - } -} - -fn check_modifier_definition_node(node: Box, nodes: &mut Vec, node_type: NodeType) { - if node_type == NodeType::ModifierDefinition { - nodes.push(Nodes::ModifierDefinition(node.clone())); - } - check_statement_node(node.body, nodes, node_type.clone()); - if node.overrides.is_some() { - check_override_specifier_node(Box::new(node.overrides.unwrap()), nodes, node_type.clone()); - } - check_parameter_list_node(Box::new(node.parameters), nodes, node_type); -} - -fn check_struct_definition_node(node: Box, nodes: &mut Vec, node_type: NodeType) { - if node_type == NodeType::StructDefinition { - nodes.push(Nodes::StructDefinition(node.clone())); - } - for member in node.members { - check_variable_declaration_node(Box::new(member), nodes, node_type.clone()); - } -} - -fn check_user_defined_value_type_definition_node(node: Box, nodes: &mut Vec, node_type: NodeType) { - if node_type == NodeType::UserDefinedValueTypeDefinition { - nodes.push(Nodes::UserDefinedValueTypeDefinition(node.clone())); - } - check_typename_node(node.underlying_type, nodes, node_type); -} - -fn check_variable_declaration_node(node: Box, nodes: &mut Vec, node_type: NodeType) { - if node_type == NodeType::VariableDeclaration { - nodes.push(Nodes::VariableDeclaration(node.clone())); - } - if node.value.is_some() { - check_expression_node(node.value.unwrap(), nodes, node_type.clone()); - } - if node.type_name.is_some() { - check_typename_node(node.type_name.unwrap(), nodes, node_type); - } -} - -fn check_enum_definition_node(node: Box, nodes: &mut Vec, node_type: NodeType) { - if node_type == NodeType::EnumDefinition { - nodes.push(Nodes::EnumDefinition(node.clone())); - } - for member in node.members { - check_enum_value_node(Box::new(member), nodes, node_type.clone()); - } -} - -fn check_enum_value_node(node: Box, nodes: &mut Vec, node_type: NodeType) { - if node_type == NodeType::EnumValue { - nodes.push(Nodes::EnumValue(node.clone())); - } -} - -fn check_error_definition_node(node: Box, nodes: &mut Vec, node_type: NodeType) { - if node_type == NodeType::ErrorDefinition { - nodes.push(Nodes::ErrorDefinition(node.clone())); - } - if node.parameters.is_some() { - check_parameter_list_node(Box::new(node.parameters.unwrap()), nodes, node_type); - } -} - -fn check_event_definition_node(node: Box, nodes: &mut Vec, node_type: NodeType) { - if node_type == NodeType::EventDefinition { - nodes.push(Nodes::EventDefinition(node.clone())); - } - if node.parameters.is_some() { - check_parameter_list_node(Box::new(node.parameters.unwrap()), nodes, node_type); - } -} - -fn check_using_for_directive_node(node: Box, nodes: &mut Vec, node_type: NodeType) { - if node_type == NodeType::UsingForDirective { - nodes.push(Nodes::UsingForDirective(node.clone())); - } - if node.function_list.is_some() { - let function_list = node.function_list.unwrap(); - for function in function_list { - check_identifier_path_node(Box::new(function.function), nodes, node_type.clone()); - } - } - if node.function.is_some() { - check_identifier_path_node(Box::new(node.function.unwrap()), nodes, node_type.clone()); - } - if node.library_name.is_some() { - check_expression_node(node.library_name.unwrap(), nodes, node_type.clone()); - } - if node.type_name.is_some() { - check_typename_node(node.type_name.unwrap(), nodes, node_type); - } -} - -fn check_inheritance_specifier_node(node: Box, nodes: &mut Vec, node_type: NodeType) { - if node_type == NodeType::InheritanceSpecifier { - nodes.push(Nodes::InheritanceSpecifier(node.clone())); - } - if node.arguments.is_some() { - for argument in node.arguments.unwrap() { - check_expression_node(argument, nodes, node_type.clone()); - } - } -} - -fn check_contract_definition_node(node: Box, nodes: &mut Vec, node_type: NodeType) { - if node_type == NodeType::ContractDefinition { - nodes.push(Nodes::ContractDefinition(node.clone())); - } - for base in node.base_contracts { - check_inheritance_specifier_node(Box::new(base), nodes, node_type.clone()); - } - for node in node.nodes { - check_contract_definition_child_node(Box::new(node), nodes, node_type.clone()); - } -} - -fn check_contract_definition_child_node(node: Box, nodes: &mut Vec, node_type: NodeType) { - match *node { - ContractDefinitionChildNodes::UsingForDirective(node) => check_using_for_directive_node(node, nodes, node_type), - ContractDefinitionChildNodes::StructDefinition(node) => check_struct_definition_node(node, nodes, node_type), - ContractDefinitionChildNodes::EnumDefinition(node) => check_enum_definition_node(node, nodes, node_type), - ContractDefinitionChildNodes::EventDefinition(node) => check_event_definition_node(node, nodes, node_type), - ContractDefinitionChildNodes::FunctionDefinition(node) => check_function_definition_node(node, nodes, node_type), - ContractDefinitionChildNodes::ModifierDefinition(node) => check_modifier_definition_node(node, nodes, node_type), - ContractDefinitionChildNodes::ErrorDefinition(node) => check_error_definition_node(node, nodes, node_type), - ContractDefinitionChildNodes::UserDefinedValueTypeDefinition(node) => check_user_defined_value_type_definition_node(node, nodes, node_type), - ContractDefinitionChildNodes::VariableDeclaration(node) => check_variable_declaration_node(node, nodes, node_type), - } -} - - -fn check_user_defined_type_name_node(node: Box, nodes: &mut Vec, node_type: NodeType) { - if node_type == NodeType::UserDefinedTypeName { - nodes.push(Nodes::UserDefinedTypeName(node.clone())); - } - if node.path_node.is_some() { - check_identifier_path_node(Box::new(node.path_node.unwrap()), nodes, node_type); - } -} - -fn check_import_directive_node(node: Box, nodes: &mut Vec, node_type: NodeType) { - if node_type == NodeType::ImportDirective { - nodes.push(Nodes::ImportDirective(node.clone())); - } -} - -fn check_pragma_directive_node(node: Box, nodes: &mut Vec, node_type: NodeType) { - if node_type == NodeType::PragmaDirective { - nodes.push(Nodes::PragmaDirective(node.clone())); - } -} - -fn check_source_unit_child_node(ast: SourceUnitChildNodes, nodes: &mut Vec, node_type: NodeType) { - match ast { - SourceUnitChildNodes::ContractDefinition(node) => { - check_contract_definition_node(node, nodes, node_type); - } - SourceUnitChildNodes::EnumDefinition(node) => { - check_enum_definition_node(node, nodes, node_type); - } - SourceUnitChildNodes::ErrorDefinition(node) => { - check_error_definition_node(node, nodes, node_type); - } - SourceUnitChildNodes::ImportDirective(node) => { - check_import_directive_node(node, nodes, node_type); - } - SourceUnitChildNodes::PragmaDirective(node) => { - check_pragma_directive_node(node, nodes, node_type); - } - SourceUnitChildNodes::StructDefinition(node) => { - check_struct_definition_node(node, nodes, node_type); - } - SourceUnitChildNodes::UsingForDirective(node) => { - check_using_for_directive_node(node, nodes, node_type); - } - _ => {} - } -} - -pub fn get_all_nodes_by_type(ast: SourceUnit, node_type: NodeType) -> Vec { - let mut nodes = Vec::new(); - if ast.node_type == node_type { - nodes.push(Nodes::SourceUnit(ast)); - return nodes; - } - for node in ast.nodes { - check_source_unit_child_node(node, &mut nodes, node_type.clone()); - } - nodes -} \ No newline at end of file diff --git a/toolchains/solidity/linter/core/solc-wrapper/src/error.rs b/toolchains/solidity/linter/core/solc-wrapper/src/error.rs deleted file mode 100644 index 4ce0fcb0..00000000 --- a/toolchains/solidity/linter/core/solc-wrapper/src/error.rs +++ /dev/null @@ -1,28 +0,0 @@ -use thiserror::Error; -use crate::{solc::error::CommandError, version::error::SolcVersionError, ast::error::AstError}; -use anyhow; -use crate::solc::parsing_error::ParsingError; - -#[derive(Error, Debug)] -pub enum SolcError { - #[error("SolcError: Something went wrong with sevm")] - SevmFailed(#[from] SolcVersionError), - - #[error("SolcError: Error from solc")] - SolcFailed(#[from] CommandError), - - #[error("SolcError: Can't do the compuation")] - ComputationFailed, - - #[error("SolcError: Error from ast pasing")] - AstFailed(#[from] AstError), - - #[error("SolcError: Output is empty")] - OutputIsEmpty, - - #[error("SolcError: compiler returned an error without outputing AST")] - ParsingFailed(#[from] ParsingError), - - #[error(transparent)] - Other(#[from] anyhow::Error), -} diff --git a/toolchains/solidity/linter/core/solc-wrapper/src/lib.rs b/toolchains/solidity/linter/core/solc-wrapper/src/lib.rs deleted file mode 100644 index 451ecf6b..00000000 --- a/toolchains/solidity/linter/core/solc-wrapper/src/lib.rs +++ /dev/null @@ -1,145 +0,0 @@ -mod solc; - -pub mod ast; -pub use ast::ast::*; - -mod utils; -mod version; - -use solc::command::SolcCommand; -use version::version::SolcVersion; -use ast::parse::parse_ast; - -mod error; -pub use error::SolcError; -use crate::solc::parsing_error::ParsingError; -use crate::utils::{get_error_location, get_error_message}; - -pub enum ExecuteResult { - Ast(String), - ParsingError(ParsingError), -} - -pub struct Solc { - version: SolcVersion -} - -impl Default for Solc { - fn default() -> Self { - Solc::new() - } -} - -impl Solc { - pub fn new() -> Self { - Solc { version: SolcVersion::default() } - } - - fn skip_output_header(output: &str) -> &str { - let idx = output.find("{").expect("No { found"); - &output[idx..] - } - - fn check_stderr(stderr: &str) -> Result<(), ParsingError> { - if !stderr.contains("Error") { - return Ok(()); - } - let location = get_error_location(stderr); - let location = match location { - Ok(e) => e, - Err(_) => return Ok(()) - }; - let error = get_error_message(stderr); - let error = match error { - Ok(e) => e, - Err(_) => return Ok(()) - }; - - Err( - ParsingError { - error, - location - } - ) - } - - pub fn execute_on_file(&self, path: &str) -> Result { - let content = std::fs::read_to_string(path).map_err(|e| SolcError::Other(anyhow::Error::new(e)))?; - - let version = self.version.find_matching_version( content.as_str())?; - let version_path = self.version.find_version_and_install(&version)?; - - let output = SolcCommand::new(version_path) - .args(["--ast-compact-json", "--stop-after", "parsing", path]) - .execute()?; - let stderr = String::from_utf8(output.clone().stderr) - .map_err(|e| SolcError::Other(anyhow::Error::new(e)))?; - let output = match Solc::check_stderr(stderr.as_str()).map_err(|e| SolcError::ParsingFailed(e)) { - Ok(_) => output, - Err(e) => return Err(e) - }; - let res = String::from_utf8(output.stdout) - .map_err(|e| SolcError::Other(anyhow::Error::new(e)))?; - Ok(String::from(Self::skip_output_header(&res))) - } - - pub fn execute_on_content(&self, content: &str) -> Result { - let version = self.version.find_matching_version( content)?; - let version_path = self.version.find_version_and_install(&version)?; - - let output = SolcCommand::new(version_path) - .args(["--ast-compact-json", "--stop-after", "parsing", "-"]) - .execute_with_input(content)?; - let stderr = String::from_utf8(output.clone().stderr) - .map_err(|e| SolcError::Other(anyhow::Error::new(e)))?; - let output = match Solc::check_stderr(stderr.as_str()).map_err(|e| SolcError::ParsingFailed(e)) { - Ok(_) => output, - Err(e) => return Err(e) - }; - let res = String::from_utf8(output.stdout) - .map_err(|e| SolcError::Other(anyhow::Error::new(e)))?; - Ok(String::from(Self::skip_output_header(&res))) - } - - pub fn extract_ast_file(&self, filepath: String) -> Result { - let output = self.execute_on_file(filepath.as_str())?; - Ok(parse_ast(output.as_str())?) - } - - pub fn extract_ast_content(&self, content: String) -> Result { - let output = self.execute_on_content(&content)?; - Ok(parse_ast(output.as_str())?) - } - -} - - -#[cfg(test)] -mod tests { - use super::*; - - #[test] - fn test_skip_output_header_already_formatted() { - let output = r#"{ - "contracts": {}, - "sources": {}, - "errors": [] - }"#; - assert_eq!(Solc::skip_output_header(output), output); - } - - #[test] - fn test_skip_output_header() { - let output = r#"ok ======= test ====== \n awesome { - "contracts": {}, - "sources": {}, - "errors": [] - }"#; - let expected = r#"{ - "contracts": {}, - "sources": {}, - "errors": [] - }"#; - assert_eq!(Solc::skip_output_header(output), expected); - } -} diff --git a/toolchains/solidity/linter/core/solc-wrapper/src/solc/command.rs b/toolchains/solidity/linter/core/solc-wrapper/src/solc/command.rs deleted file mode 100644 index 426253e8..00000000 --- a/toolchains/solidity/linter/core/solc-wrapper/src/solc/command.rs +++ /dev/null @@ -1,66 +0,0 @@ -use std::{process::Command}; -use std::io::Write; -use std::process::{Output, Stdio}; -use std::{path::PathBuf}; - -use super::error::{CommandError, CommandType}; - -pub struct SolcCommand { - args: Vec, - bin_path : PathBuf -} - -impl Default for SolcCommand { - fn default() -> Self { - SolcCommand::new("solc") - } -} - -impl SolcCommand { - - pub fn new(path: impl Into) -> Self { - SolcCommand { - args: Vec::new(), - bin_path: path.into() - } - } - - pub fn arg>(mut self, arg: T) -> Self { - self.args.push(arg.into()); - self - } - - pub fn args(mut self, args: I) -> Self - where - I: IntoIterator, - S: Into, - { - for arg in args { - self = self.arg(arg); - } - self - } - - pub fn execute(&self) -> Result { - Command::new(&self.bin_path) - .args(&self.args) - .stdout(Stdio::piped()) - .output() - .map_err(|e| CommandError { error: e.to_string(), command_type: CommandType::ParseFile }) - } - - pub fn execute_with_input(&self, input: &str) -> Result { - let mut cmd = Command::new(&self.bin_path) - .args(&self.args) - .stdin(Stdio::piped()) - .stdout(Stdio::piped()) - .spawn() - .map_err(|e| CommandError { error: e.to_string(), command_type: CommandType::ParseStdin })?; - - { - let child_stdin = cmd.stdin.as_mut().unwrap(); - child_stdin.write_all(input.as_bytes()).map_err(|e| CommandError { error: e.to_string(), command_type: CommandType::ParseStdin })?; - } - cmd.wait_with_output().map_err(|e| CommandError { error: e.to_string(), command_type: CommandType::ParseStdin }) - } -} \ No newline at end of file diff --git a/toolchains/solidity/linter/core/solc-wrapper/src/solc/error.rs b/toolchains/solidity/linter/core/solc-wrapper/src/solc/error.rs deleted file mode 100644 index 6efc974c..00000000 --- a/toolchains/solidity/linter/core/solc-wrapper/src/solc/error.rs +++ /dev/null @@ -1,19 +0,0 @@ -use thiserror::Error; - -#[derive(Debug)] -pub enum CommandType { - ParseFile, - ParseStdin, -} - -#[derive(Error, Debug)] -pub struct CommandError { - pub command_type: CommandType, - pub error: String, -} - -impl std::fmt::Display for CommandError { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - write!(f, "CommandError: {}", self.error) - } -} \ No newline at end of file diff --git a/toolchains/solidity/linter/core/solc-wrapper/src/solc/mod.rs b/toolchains/solidity/linter/core/solc-wrapper/src/solc/mod.rs deleted file mode 100644 index fb5cfd3e..00000000 --- a/toolchains/solidity/linter/core/solc-wrapper/src/solc/mod.rs +++ /dev/null @@ -1,3 +0,0 @@ -pub mod error; -pub mod command; -pub mod parsing_error; \ No newline at end of file diff --git a/toolchains/solidity/linter/core/solc-wrapper/src/solc/parsing_error.rs b/toolchains/solidity/linter/core/solc-wrapper/src/solc/parsing_error.rs deleted file mode 100644 index 199776d8..00000000 --- a/toolchains/solidity/linter/core/solc-wrapper/src/solc/parsing_error.rs +++ /dev/null @@ -1,29 +0,0 @@ -use thiserror::Error; - - - -#[derive(Error, Debug)] -pub struct ErrorLocation { - pub file: String, - pub line: usize, - pub column: usize, - pub length: usize -} - -#[derive(Error, Debug)] -pub struct ParsingError { - pub error: String, - pub location: ErrorLocation, -} - -impl std::fmt::Display for ErrorLocation { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - write!(f, "ErrorLocation in {} at line {}, column {}", self.file, self.line, self.column) - } -} - -impl std::fmt::Display for ParsingError { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - write!(f, "ParsingError: {}", self.error) - } -} \ No newline at end of file diff --git a/toolchains/solidity/linter/core/solc-wrapper/src/utils.rs b/toolchains/solidity/linter/core/solc-wrapper/src/utils.rs deleted file mode 100644 index 0f62f9e3..00000000 --- a/toolchains/solidity/linter/core/solc-wrapper/src/utils.rs +++ /dev/null @@ -1,71 +0,0 @@ -use regex::{Match, Regex}; -use once_cell::sync::Lazy; -use crate::solc::parsing_error::{ErrorLocation}; - -pub static RE_SOL_ERROR_PRINT: Lazy = Lazy::new(|| Regex::new(r"Error: (.*)\n").unwrap()); -pub static RE_SOL_ERROR_FILE: Lazy = Lazy::new(|| Regex::new(r"--> (?P.*):(?P\d+):(?P\d+):").unwrap()); -pub static RE_SOL_PRAGMA_VERSION: Lazy = Lazy::new(|| Regex::new(r"pragma\s+solidity\s+(?P\^?\d+\.\d+(?:\.\d+)?);").unwrap()); - -pub fn find_version_pragma(contract: &str) -> Option { - RE_SOL_PRAGMA_VERSION.captures(contract)?.name("version") -} - -fn count_length(error: String) -> usize { - let mut count = 0; - let mut n = error.len() - 3; - - while n > 0 { - if error.chars().nth(n).unwrap() == '\n' { - return count; - } - if error.chars().nth(n).unwrap() == '^' { - count += 1; - } - n-=1; - } - return count; -} - -pub fn get_error_message(stderr: &str) -> Result { - let error = RE_SOL_ERROR_PRINT.captures(stderr); - let error = match error { - Some(error) => error.get(0), - None => return Err(()) - }; - let error = match error { - Some(error) => error.as_str(), - None => return Err(()) - }; - let error = error.to_string(); - Ok(error) -} - -pub fn get_error_location(stderr: &str) -> Result { - let error = RE_SOL_ERROR_FILE.captures(stderr); - let error = match error { - Some(error) => error, - None => return Err(()) - }; - let file = match error.name("file") { - Some(file) => file.as_str().to_string(), - None => return Err(()) - }; - let line = match error.name("line") { - Some(line) => line.as_str().to_string(), - None => return Err(()) - }; - let column = match error.name("column") { - Some(line) => line.as_str().to_string(), - None => return Err(()) - }; - let length = count_length(stderr.to_string()); - - Ok( - ErrorLocation { - file, - line: line.parse().unwrap(), //unwrap is safe due to the regex that matches only number - column: column.parse().unwrap(), //unwrap is safe due to the regex that matches only number - length - } - ) -} \ No newline at end of file diff --git a/toolchains/solidity/linter/core/solc-wrapper/src/version/error.rs b/toolchains/solidity/linter/core/solc-wrapper/src/version/error.rs deleted file mode 100644 index 00d14e80..00000000 --- a/toolchains/solidity/linter/core/solc-wrapper/src/version/error.rs +++ /dev/null @@ -1,19 +0,0 @@ -use svm_lib::SolcVmError; -use thiserror::Error; - -use semver::Error; - -#[derive(Error, Debug)] -pub enum SolcVersionError { - #[error("SolcVersionError: Something went wrong with sevm")] - SevmFailed(#[from] SolcVmError), - - #[error("SolcVersionError: Can't do the compuation")] - ComputationFailed, - - #[error("SolcVersionError: Version failed")] - VersionFailed(#[from] Error), - - #[error("SolcVersionError: Wrong version of solidity")] - WrongVersion, -} diff --git a/toolchains/solidity/linter/core/solc-wrapper/src/version/mod.rs b/toolchains/solidity/linter/core/solc-wrapper/src/version/mod.rs deleted file mode 100644 index b4e1bd83..00000000 --- a/toolchains/solidity/linter/core/solc-wrapper/src/version/mod.rs +++ /dev/null @@ -1,2 +0,0 @@ -pub mod error; -pub mod version; \ No newline at end of file diff --git a/toolchains/solidity/linter/core/solc-wrapper/src/version/version.rs b/toolchains/solidity/linter/core/solc-wrapper/src/version/version.rs deleted file mode 100644 index fb22722b..00000000 --- a/toolchains/solidity/linter/core/solc-wrapper/src/version/version.rs +++ /dev/null @@ -1,87 +0,0 @@ -use crate::utils; - -use semver::{Version, VersionReq}; -use std::{path::PathBuf}; - -use super::error::SolcVersionError; - -pub struct SolcVersion { - global_version_path: PathBuf -} - -impl Default for SolcVersion { - fn default() -> Self { - SolcVersion::new(Self::get_global_version_path()) - } -} - -impl SolcVersion { - pub fn new(path: impl Into) -> Self { - SolcVersion { global_version_path: path.into() } - } - - pub fn find_matching_version(&self, source: &str) -> Result { - let version_req = Self::source_version_req(source)?; - - if self.global_version_path.is_file() { - let installed_versions = Self::list_installed_versions()?; - let version = installed_versions.iter().find(|v| version_req.matches(v)); - if !version.is_none() { - return version.cloned().ok_or(SolcVersionError::ComputationFailed); - } - } - let remote_versions = Self::list_remote_versions()?; - let version = remote_versions.iter().find(|v| version_req.matches(v)); - version.cloned().ok_or(SolcVersionError::ComputationFailed) - } - - pub fn list_installed_versions() -> Result, SolcVersionError> { - Ok(svm_lib::installed_versions()?) - } - - pub fn get_global_version_path() -> PathBuf { - svm_lib::global_version_path() - } - - pub fn list_remote_versions() -> Result, SolcVersionError> { - Ok(svm_lib::blocking_all_versions()?) - } - - pub fn install_version(version: &Version) -> Result { - Ok(svm_lib::blocking_install(version)?) - } - - pub fn find_version_and_install(&self, version: &Version) -> Result { - // TODO optimize the code to only have to run it once and outside this function possibly - if self.global_version_path.is_file() { - let versions = svm_lib::installed_versions()?; - if !versions.is_empty() && versions.contains(&version) { - return Ok(svm_lib::version_path(&version.to_string()).join("solc-".to_owned() + version.to_string().as_str())); - } - } - Self::install_version(version) - } - - pub fn source_version_req(source: &str) -> Result { - let version = - utils::find_version_pragma(source).ok_or(SolcVersionError::WrongVersion)?; - Self::version_req(version.as_str()) - } - - /// Returns the corresponding SemVer version requirement for the solidity version - pub fn version_req(version: &str) -> Result { - let version = version.replace(' ', ","); - - // Somehow, Solidity semver without an operator is considered to be "exact", - // but lack of operator automatically marks the operator as Caret, so we need - // to manually patch it? :shrug: - let exact = !matches!(&version[0..1], "*" | "^" | "=" | ">" | "<" | "~"); - let mut version = VersionReq::parse(&version)?; - if exact { - version.comparators[0].op = semver::Op::Exact; - } - - Ok(version) - } - -} \ No newline at end of file diff --git a/toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/Assignment.json b/toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/Assignment.json deleted file mode 100644 index ff0e828a..00000000 --- a/toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/Assignment.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "id": 141, - "leftHandSide": { - "id": 139, - "name": "_baseTokenURI", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "src": "2849:13:0", - "typeDescriptions": {} - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "id": 140, - "name": "initialBaseTokenURI", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "src": "2865:19:0", - "typeDescriptions": {} - }, - "src": "2849:35:0", - "typeDescriptions": {} -} \ No newline at end of file diff --git a/toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/BinaryOperation.json b/toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/BinaryOperation.json deleted file mode 100644 index 16df1b7f..00000000 --- a/toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/BinaryOperation.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 18, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "id": 16, - "name": "a", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 7, - "src": "203:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "&", - "rightExpression": { - "id": 17, - "name": "b", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 11, - "src": "207:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "203:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } -} \ No newline at end of file diff --git a/toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/Block.json b/toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/Block.json deleted file mode 100644 index 1e5d02e4..00000000 --- a/toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/Block.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "id": 192, - "nodeType": "Block", - "src": "3511:148:0", - "statements": [] -} \ No newline at end of file diff --git a/toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/Break.json b/toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/Break.json deleted file mode 100644 index 714cc6c5..00000000 --- a/toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/Break.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "id": 7, - "nodeType": "Break", - "src": "172:5:0" -} \ No newline at end of file diff --git a/toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/Conditional.json b/toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/Conditional.json deleted file mode 100644 index 14695b37..00000000 --- a/toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/Conditional.json +++ /dev/null @@ -1,61 +0,0 @@ -{ - "condition": { - "hexValue": "74727565", - "id": 7, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "bool", - "lValueRequested": false, - "nodeType": "Literal", - "src": "158:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "value": "true" - }, - "falseExpression": { - "hexValue": "66616c7365", - "id": 9, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "bool", - "lValueRequested": false, - "nodeType": "Literal", - "src": "173:5:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "value": "false" - }, - "id": 10, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "nodeType": "Conditional", - "src": "158:20:0", - "trueExpression": { - "hexValue": "74727565", - "id": 8, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "bool", - "lValueRequested": false, - "nodeType": "Literal", - "src": "166:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "value": "true" - }, - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } -} \ No newline at end of file diff --git a/toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/Continue.json b/toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/Continue.json deleted file mode 100644 index ec2f7f48..00000000 --- a/toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/Continue.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "id": 7, - "nodeType": "Continue", - "src": "172:8:0" -} \ No newline at end of file diff --git a/toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/ContractDefinition.json b/toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/ContractDefinition.json deleted file mode 100644 index be9b8e3b..00000000 --- a/toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/ContractDefinition.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "abstract": false, - "baseContracts": [], - "contractDependencies": [], - "contractKind": "contract", - "id": 427, - "name": "StartonERC721MetaTransaction", - "nameLocation": "792:28:0", - "nodeType": "ContractDefinition", - "nodes": [], - "src": "783:7774:0", - "usedErrors": [] -} \ No newline at end of file diff --git a/toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/DoWhileStatement.json b/toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/DoWhileStatement.json deleted file mode 100644 index 4eb3773d..00000000 --- a/toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/DoWhileStatement.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "body": { - "id": 7, - "nodeType": "Block", - "src": "148:33:0", - "statements": [ - { - "id": 6, - "nodeType": "Continue", - "src": "162:8:0" - } - ] - }, - "condition": { - "hexValue": "74727565", - "id": 8, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "bool", - "lValueRequested": false, - "nodeType": "Literal", - "src": "189:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "value": "true" - }, - "id": 9, - "nodeType": "DoWhileStatement", - "src": "145:50:0" -} \ No newline at end of file diff --git a/toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/ElementaryTypeName.json b/toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/ElementaryTypeName.json deleted file mode 100644 index ed5e54f9..00000000 --- a/toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/ElementaryTypeName.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "id": 64, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "1602:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": {} -} \ No newline at end of file diff --git a/toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/ElementaryTypeNameExpression.json b/toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/ElementaryTypeNameExpression.json deleted file mode 100644 index cd4213f9..00000000 --- a/toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/ElementaryTypeNameExpression.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "id":10, - "nodeType":"ElementaryTypeNameExpression", - "src":"156:7:0", - "typeDescriptions":{ - - }, - "typeName":{ - "id":9, - "name":"bytes32", - "nodeType":"ElementaryTypeName", - "src":"156:7:0", - "typeDescriptions":{ - - } - } -} \ No newline at end of file diff --git a/toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/EmitStatement.json b/toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/EmitStatement.json deleted file mode 100644 index fbee8ec6..00000000 --- a/toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/EmitStatement.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "eventCall": { - "arguments": [ - { - "arguments": [], - "expression": { - "id": 284, - "name": "_msgSender", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "src": "5557:10:0", - "typeDescriptions": {} - }, - "id": 285, - "nameLocations": [], - "names": [], - "nodeType": "FunctionCall", - "src": "5557:12:0", - "tryCall": false, - "typeDescriptions": {} - } - ], - "expression": { - "id": 283, - "name": "MetadataLocked", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "src": "5542:14:0", - "typeDescriptions": {} - }, - "id": 286, - "nameLocations": [], - "names": [], - "nodeType": "FunctionCall", - "src": "5542:28:0", - "tryCall": false, - "typeDescriptions": {} - }, - "id": 287, - "nodeType": "EmitStatement", - "src": "5537:33:0" -} diff --git a/toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/EnumDefinition.json b/toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/EnumDefinition.json deleted file mode 100644 index a52239c5..00000000 --- a/toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/EnumDefinition.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "canonicalName":"Test", - "id":4, - "members":[ - { - "id":2, - "name":"item1", - "nameLocation":"72:5:0", - "nodeType":"EnumValue", - "src":"72:5:0" - }, - { - "id":3, - "name":"item2", - "nameLocation":"79:5:0", - "nodeType":"EnumValue", - "src":"79:5:0" - } - ], - "name":"Test", - "nameLocation":"66:4:0", - "nodeType":"EnumDefinition", - "src":"61:25:0" -} \ No newline at end of file diff --git a/toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/EnumValue.json b/toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/EnumValue.json deleted file mode 100644 index a3e3a12c..00000000 --- a/toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/EnumValue.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "id":2, - "name": "item1", - "nameLocation": "72:5:0", - "nodeType": "EnumValue", - "src": "72:5:0" -} \ No newline at end of file diff --git a/toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/ErrorDefinition.json b/toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/ErrorDefinition.json deleted file mode 100644 index d93579bb..00000000 --- a/toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/ErrorDefinition.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "id":3, - "name":"No", - "nameLocation":"92:2:0", - "nodeType":"ErrorDefinition", - "parameters":{ - "id":2, - "nodeType":"ParameterList", - "parameters":[ - - ], - "src":"94:2:0" - }, - "src":"86:11:0" -} \ No newline at end of file diff --git a/toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/EventDefinition.json b/toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/EventDefinition.json deleted file mode 100644 index f204ee06..00000000 --- a/toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/EventDefinition.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "anonymous": false, - "documentation": { - "id": 63, - "nodeType": "StructuredDocumentation", - "src": "1522:55:0", - "text": "@notice Event emitted when the minting is locked " - }, - "id": 67, - "name": "MintingLocked", - "nameLocation": "1588:13:0", - "nodeType": "EventDefinition", - "parameters": { - "id": 66, - "nodeType": "ParameterList", - "parameters": [], - "src": "1601:25:0" - }, - "src": "1582:45:0" -} diff --git a/toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/ExpressionStatement.json b/toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/ExpressionStatement.json deleted file mode 100644 index efd8766d..00000000 --- a/toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/ExpressionStatement.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "expression": { - "id": 153, - "leftHandSide": { - "id": 151, - "name": "_isMetatadataChangingAllowed", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "src": "2968:28:0", - "typeDescriptions": {} - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "hexValue": "74727565", - "id": 152, - "kind": "bool", - "nodeType": "Literal", - "src": "2999:4:0", - "typeDescriptions": {}, - "value": "true" - }, - "src": "2968:35:0", - "typeDescriptions": {} - }, - "id": 154, - "nodeType": "ExpressionStatement", - "src": "2968:35:0" -} \ No newline at end of file diff --git a/toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/ForStatement.json b/toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/ForStatement.json deleted file mode 100644 index 21dfa622..00000000 --- a/toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/ForStatement.json +++ /dev/null @@ -1,148 +0,0 @@ -{ - "body": { - "id": 17, - "nodeType": "Block", - "src": "175:30:0", - "statements": [ - { - "id": 16, - "nodeType": "Break", - "src": "189:5:0" - } - ] - }, - "condition": { - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 12, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "id": 10, - "name": "i", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 7, - "src": "162:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "<", - "rightExpression": { - "hexValue": "3130", - "id": 11, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "166:2:0", - "typeDescriptions": { - "typeIdentifier": "t_rational_10_by_1", - "typeString": "int_const 10" - }, - "value": "10" - }, - "src": "162:6:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "id": 18, - "initializationExpression": { - "assignments": [ - 7 - ], - "declarations": [ - { - "constant": false, - "id": 7, - "mutability": "mutable", - "name": "i", - "nameLocation": "155:1:0", - "nodeType": "VariableDeclaration", - "scope": 18, - "src": "150:6:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 6, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "150:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "id": 9, - "initialValue": { - "hexValue": "30", - "id": 8, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "159:1:0", - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "nodeType": "VariableDeclarationStatement", - "src": "150:10:0" - }, - "loopExpression": { - "expression": { - "id": 14, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "nodeType": "UnaryOperation", - "operator": "++", - "prefix": false, - "src": "170:3:0", - "subExpression": { - "id": 13, - "name": "i", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 7, - "src": "170:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 15, - "nodeType": "ExpressionStatement", - "src": "170:3:0" - }, - "nodeType": "ForStatement", - "src": "145:60:0" -} \ No newline at end of file diff --git a/toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/FunctionCall.json b/toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/FunctionCall.json deleted file mode 100644 index 391d05f5..00000000 --- a/toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/FunctionCall.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "arguments": [ - { - "hexValue": "4d696e74696e67206973206c6f636b6564", - "id": 76, - "name": "_isMintAllowed", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "src": "1858:14:0", - "typeDescriptions": {}, - "kind": "string", - "value": "Minting is locked" - }, - { - "hexValue": "4d696e74696e67206973206c6f636b6564", - "id": 77, - "kind": "string", - "nodeType": "Literal", - "src": "1874:19:0", - "typeDescriptions": {}, - "value": "Minting is locked" - } - ], - "expression": { - "id": 75, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "src": "1850:7:0", - "typeDescriptions": {} - }, - "id": 78, - "nameLocations": [], - "names": [], - "nodeType": "FunctionCall", - "src": "1850:44:0", - "tryCall": false, - "typeDescriptions": {} -} \ No newline at end of file diff --git a/toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/FunctionCallOptions.json b/toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/FunctionCallOptions.json deleted file mode 100644 index 64fe122e..00000000 --- a/toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/FunctionCallOptions.json +++ /dev/null @@ -1,57 +0,0 @@ -{ - "expression":{ - "expression":{ - "id":16, - "name":"otherContract", - "nodeType":"Identifier", - "overloadedDeclarations":[ - - ], - "src":"236:13:0", - "typeDescriptions":{ - - } - }, - "id":18, - "memberLocation":"250:4:0", - "memberName":"call", - "nodeType":"MemberAccess", - "src":"236:18:0", - "typeDescriptions":{ - - } - }, - "id":21, - "names":[ - "value" - ], - "nodeType":"FunctionCallOptions", - "options":[ - { - "expression":{ - "id":19, - "name":"msg", - "nodeType":"Identifier", - "overloadedDeclarations":[ - - ], - "src":"262:3:0", - "typeDescriptions":{ - - } - }, - "id":20, - "memberLocation":"266:5:0", - "memberName":"value", - "nodeType":"MemberAccess", - "src":"262:9:0", - "typeDescriptions":{ - - } - } - ], - "src":"236:36:0", - "typeDescriptions":{ - - } -} \ No newline at end of file diff --git a/toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/FunctionDefinition.json b/toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/FunctionDefinition.json deleted file mode 100644 index 3158d372..00000000 --- a/toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/FunctionDefinition.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "body": { - "id": 192, - "nodeType": "Block", - "src": "3511:148:0", - "statements": [] - }, - "id": 193, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "mint", - "nameLocation": "3401:4:0", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 166, - "nodeType": "ParameterList", - "parameters": [], - "src": "3405:31:0" - }, - "returnParameters": { - "id": 172, - "nodeType": "ParameterList", - "parameters": [], - "src": "3511:0:0" - }, - "src": "3392:267:0", - "stateMutability": "nonpayable", - "virtual": false, - "visibility": "public" -} \ No newline at end of file diff --git a/toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/FunctionTypeName.json b/toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/FunctionTypeName.json deleted file mode 100644 index 2a593dc7..00000000 --- a/toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/FunctionTypeName.json +++ /dev/null @@ -1,72 +0,0 @@ -{ - "id":11, - "nodeType":"FunctionTypeName", - "parameterTypes":{ - "id":7, - "nodeType":"ParameterList", - "parameters":[ - { - "constant":false, - "id":6, - "mutability":"mutable", - "name":"", - "nameLocation":"-1:-1:-1", - "nodeType":"VariableDeclaration", - "src":"270:4:0", - "stateVariable":false, - "storageLocation":"default", - "typeDescriptions":{ - - }, - "typeName":{ - "id":5, - "name":"uint", - "nodeType":"ElementaryTypeName", - "src":"270:4:0", - "typeDescriptions":{ - - } - }, - "visibility":"internal" - } - ], - "src":"269:6:0" - }, - "returnParameterTypes":{ - "id":10, - "nodeType":"ParameterList", - "parameters":[ - { - "constant":false, - "id":9, - "mutability":"mutable", - "name":"", - "nameLocation":"-1:-1:-1", - "nodeType":"VariableDeclaration", - "src":"290:4:0", - "stateVariable":false, - "storageLocation":"default", - "typeDescriptions":{ - - }, - "typeName":{ - "id":8, - "name":"uint", - "nodeType":"ElementaryTypeName", - "src":"290:4:0", - "typeDescriptions":{ - - } - }, - "visibility":"internal" - } - ], - "src":"289:6:0" - }, - "src":"260:37:0", - "stateMutability":"pure", - "typeDescriptions":{ - - }, - "visibility":"internal" -} diff --git a/toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/Identifier.json b/toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/Identifier.json deleted file mode 100644 index b2a4cccb..00000000 --- a/toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/Identifier.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "id": 16, - "name": "a", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 7, - "src": "203:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } -} \ No newline at end of file diff --git a/toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/IfStatement.json b/toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/IfStatement.json deleted file mode 100644 index aee61e1c..00000000 --- a/toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/IfStatement.json +++ /dev/null @@ -1,167 +0,0 @@ -{ - "condition":{ - "commonType":{ - "typeIdentifier":"t_uint8", - "typeString":"uint8" - }, - "id":8, - "isConstant":false, - "isLValue":false, - "isPure":true, - "lValueRequested":false, - "leftExpression":{ - "hexValue":"31", - "id":6, - "isConstant":false, - "isLValue":false, - "isPure":true, - "kind":"number", - "lValueRequested":false, - "nodeType":"Literal", - "src":"149:1:0", - "typeDescriptions":{ - "typeIdentifier":"t_rational_1_by_1", - "typeString":"int_const 1" - }, - "value":"1" - }, - "nodeType":"BinaryOperation", - "operator":"==", - "rightExpression":{ - "hexValue":"32", - "id":7, - "isConstant":false, - "isLValue":false, - "isPure":true, - "kind":"number", - "lValueRequested":false, - "nodeType":"Literal", - "src":"154:1:0", - "typeDescriptions":{ - "typeIdentifier":"t_rational_2_by_1", - "typeString":"int_const 2" - }, - "value":"2" - }, - "src":"149:6:0", - "typeDescriptions":{ - "typeIdentifier":"t_bool", - "typeString":"bool" - } - }, - "falseBody":{ - "id":18, - "nodeType":"Block", - "src":"205:43:0", - "statements":[ - { - "expression":{ - "id":16, - "isConstant":false, - "isLValue":false, - "isPure":false, - "lValueRequested":false, - "leftHandSide":{ - "id":14, - "name":"goStraight", - "nodeType":"Identifier", - "overloadedDeclarations":[ - - ], - "referencedDeclaration":3, - "src":"219:10:0", - "typeDescriptions":{ - "typeIdentifier":"t_bool", - "typeString":"bool" - } - }, - "nodeType":"Assignment", - "operator":"=", - "rightHandSide":{ - "hexValue":"66616c7365", - "id":15, - "isConstant":false, - "isLValue":false, - "isPure":true, - "kind":"bool", - "lValueRequested":false, - "nodeType":"Literal", - "src":"232:5:0", - "typeDescriptions":{ - "typeIdentifier":"t_bool", - "typeString":"bool" - }, - "value":"false" - }, - "src":"219:18:0", - "typeDescriptions":{ - "typeIdentifier":"t_bool", - "typeString":"bool" - } - }, - "id":17, - "nodeType":"ExpressionStatement", - "src":"219:18:0" - } - ] - }, - "id":19, - "nodeType":"IfStatement", - "src":"145:103:0", - "trueBody":{ - "id":13, - "nodeType":"Block", - "src":"157:42:0", - "statements":[ - { - "expression":{ - "id":11, - "isConstant":false, - "isLValue":false, - "isPure":false, - "lValueRequested":false, - "leftHandSide":{ - "id":9, - "name":"goStraight", - "nodeType":"Identifier", - "overloadedDeclarations":[ - - ], - "referencedDeclaration":3, - "src":"171:10:0", - "typeDescriptions":{ - "typeIdentifier":"t_bool", - "typeString":"bool" - } - }, - "nodeType":"Assignment", - "operator":"=", - "rightHandSide":{ - "hexValue":"74727565", - "id":10, - "isConstant":false, - "isLValue":false, - "isPure":true, - "kind":"bool", - "lValueRequested":false, - "nodeType":"Literal", - "src":"184:4:0", - "typeDescriptions":{ - "typeIdentifier":"t_bool", - "typeString":"bool" - }, - "value":"true" - }, - "src":"171:17:0", - "typeDescriptions":{ - "typeIdentifier":"t_bool", - "typeString":"bool" - } - }, - "id":12, - "nodeType":"ExpressionStatement", - "src":"171:17:0" - } - ] - } -} \ No newline at end of file diff --git a/toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/ImportDirective.json b/toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/ImportDirective.json deleted file mode 100644 index 64f0a282..00000000 --- a/toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/ImportDirective.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "absolutePath": "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol", - "file": "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol", - "id": 2, - "nameLocation": "-1:-1:-1", - "nodeType": "ImportDirective", - "src": "58:78:0", - "symbolAliases": [], - "unitAlias": "" -} \ No newline at end of file diff --git a/toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/IndexAccess.json b/toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/IndexAccess.json deleted file mode 100644 index aa2ea6d6..00000000 --- a/toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/IndexAccess.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "baseExpression":{ - "id":12, - "name":"pls", - "nodeType":"Identifier", - "overloadedDeclarations":[ - - ], - "src":"203:3:0", - "typeDescriptions":{ - - } - }, - "id":14, - "indexExpression":{ - "id":13, - "name":"index", - "nodeType":"Identifier", - "overloadedDeclarations":[ - - ], - "src":"207:5:0", - "typeDescriptions":{ - - } - }, - "nodeType":"IndexAccess", - "src":"203:10:0", - "typeDescriptions":{ - - } -} \ No newline at end of file diff --git a/toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/IndexRangeAccess.json b/toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/IndexRangeAccess.json deleted file mode 100644 index 6799147e..00000000 --- a/toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/IndexRangeAccess.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "baseExpression":{ - "id":10, - "name":"cheh", - "nodeType":"Identifier", - "overloadedDeclarations":[ - - ], - "src":"174:4:0", - "typeDescriptions":{ - - } - }, - "endExpression":{ - "hexValue":"33", - "id":11, - "kind":"number", - "nodeType":"Literal", - "src":"180:1:0", - "typeDescriptions":{ - - }, - "value":"3" - }, - "id":12, - "nodeType":"IndexRangeAccess", - "src":"174:8:0", - "typeDescriptions":{ - - } -} \ No newline at end of file diff --git a/toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/InheritanceSpecifier.json b/toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/InheritanceSpecifier.json deleted file mode 100644 index 4d7ace84..00000000 --- a/toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/InheritanceSpecifier.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "baseName": { - "id": 12, - "name": "ERC721Enumerable", - "nameLocations": [ - "828:16:0" - ], - "nodeType": "IdentifierPath", - "src": "828:16:0" - }, - "id": 13, - "nodeType": "InheritanceSpecifier", - "src": "828:16:0" -} diff --git a/toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/InlineAssembly.json b/toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/InlineAssembly.json deleted file mode 100644 index 57caaa4e..00000000 --- a/toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/InlineAssembly.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "AST":{ - - }, - "evmVersion":"london", - "externalReferences":[ - - ], - "id":9, - "nodeType":"InlineAssembly", - "src":"176:50:0" -} diff --git a/toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/Literal.json b/toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/Literal.json deleted file mode 100644 index 2485266e..00000000 --- a/toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/Literal.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "hexValue": "4d696e74696e67206973206c6f636b6564", - "id": 77, - "kind": "string", - "nodeType": "Literal", - "src": "1874:19:0", - "typeDescriptions": {}, - "value": "Minting is locked" -} \ No newline at end of file diff --git a/toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/MemberAccess.json b/toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/MemberAccess.json deleted file mode 100644 index bd935f36..00000000 --- a/toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/MemberAccess.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "expression": { - "id": 175, - "name": "_tokenIdCounter", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "src": "3535:15:0", - "typeDescriptions": {} - }, - "id": 176, - "memberLocation": "3551:7:0", - "memberName": "current", - "nodeType": "MemberAccess", - "src": "3535:23:0", - "typeDescriptions": {} -} \ No newline at end of file diff --git a/toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/ModifierDefinition.json b/toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/ModifierDefinition.json deleted file mode 100644 index 033a6ecf..00000000 --- a/toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/ModifierDefinition.json +++ /dev/null @@ -1,74 +0,0 @@ -{ - "body": { - "id": 91, - "nodeType": "Block", - "src": "2015:75:0", - "statements": [ - { - "expression": { - "arguments": [ - { - "id": 86, - "name": "_isMintAllowed", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "src": "2033:14:0", - "typeDescriptions": {} - }, - { - "hexValue": "4d657461646174617320617265206c6f636b6564", - "id": 87, - "kind": "string", - "nodeType": "Literal", - "src": "2049:22:0", - "typeDescriptions": {}, - "value": "Metadatas are locked" - } - ], - "expression": { - "id": 85, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "src": "2025:7:0", - "typeDescriptions": {} - }, - "id": 88, - "nameLocations": [], - "names": [], - "nodeType": "FunctionCall", - "src": "2025:47:0", - "tryCall": false, - "typeDescriptions": {} - }, - "id": 89, - "nodeType": "ExpressionStatement", - "src": "2025:47:0" - }, - { - "id": 90, - "nodeType": "PlaceholderStatement", - "src": "2082:1:0" - } - ] - }, - "documentation": { - "id": 83, - "nodeType": "StructuredDocumentation", - "src": "1918:63:0", - "text": "@dev Modifier that reverts when the metadatas are locked " - }, - "id": 92, - "name": "metadataNotLocked", - "nameLocation": "1995:17:0", - "nodeType": "ModifierDefinition", - "parameters": { - "id": 84, - "nodeType": "ParameterList", - "parameters": [], - "src": "2012:2:0" - }, - "src": "1986:104:0", - "virtual": false, - "visibility": "internal" -} diff --git a/toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/ModifierInvocation.json b/toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/ModifierInvocation.json deleted file mode 100644 index 3e8f4eee..00000000 --- a/toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/ModifierInvocation.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "id": 274, - "modifierName": { - "id": 273, - "name": "whenNotPaused", - "nameLocations": [ - "5445:13:0" - ], - "nodeType": "IdentifierPath", - "src": "5445:13:0" - }, - "nodeType": "ModifierInvocation", - "src": "5445:13:0" -} diff --git a/toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/NewExpression.json b/toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/NewExpression.json deleted file mode 100644 index fb6494e7..00000000 --- a/toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/NewExpression.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "id":7, - "nodeType":"NewExpression", - "src":"131:6:0", - "typeDescriptions":{ - - }, - "typeName":{ - "id":6, - "nodeType":"UserDefinedTypeName", - "pathNode":{ - "id":5, - "name":"Ok", - "nameLocations":[ - "135:2:0" - ], - "nodeType":"IdentifierPath", - "src":"135:2:0" - }, - "src":"135:2:0", - "typeDescriptions":{ - - } - } -} \ No newline at end of file diff --git a/toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/ParameterList.json b/toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/ParameterList.json deleted file mode 100644 index 6b6abd8b..00000000 --- a/toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/ParameterList.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "id": 197, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 196, - "mutability": "mutable", - "name": "newContractURI", - "nameLocation": "3919:14:0", - "nodeType": "VariableDeclaration", - "src": "3905:28:0", - "stateVariable": false, - "storageLocation": "memory", - "typeDescriptions": {}, - "typeName": { - "id": 195, - "name": "string", - "nodeType": "ElementaryTypeName", - "src": "3905:6:0", - "typeDescriptions": {} - }, - "visibility": "internal" - } - ], - "src": "3904:30:0" -} \ No newline at end of file diff --git a/toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/PlaceholderStatement.json b/toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/PlaceholderStatement.json deleted file mode 100644 index b2c8fac2..00000000 --- a/toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/PlaceholderStatement.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "id": 80, - "nodeType": "PlaceholderStatement", - "src": "1904:1:0" -} \ No newline at end of file diff --git a/toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/PragmaDirective.json b/toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/PragmaDirective.json deleted file mode 100644 index 88b94d2e..00000000 --- a/toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/PragmaDirective.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "id": 1, - "literals": [ - "solidity", - "0.8", - ".16" - ], - "nodeType": "PragmaDirective", - "src": "33:23:0" -} diff --git a/toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/Return.json b/toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/Return.json deleted file mode 100644 index 94882bcc..00000000 --- a/toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/Return.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "expression": { - "id": 295, - "name": "_contractURI", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "src": "5768:12:0", - "typeDescriptions": {} - }, - "id": 296, - "nodeType": "Return", - "src": "5761:19:0" -} diff --git a/toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/RevertStatement.json b/toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/RevertStatement.json deleted file mode 100644 index 674afc60..00000000 --- a/toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/RevertStatement.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "errorCall": { - "arguments": [], - "expression": { - "argumentTypes": [], - "id": 6, - "name": "Pls", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 3, - "src": "125:3:0", - "typeDescriptions": { - "typeIdentifier": "t_function_error_pure$__$returns$__$", - "typeString": "function () pure" - } - }, - "id": 7, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "nameLocations": [], - "names": [], - "nodeType": "FunctionCall", - "src": "125:5:0", - "tryCall": false, - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 8, - "nodeType": "RevertStatement", - "src": "118:12:0" -} diff --git a/toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/SourceUnit.json b/toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/SourceUnit.json deleted file mode 100644 index cfb0f0b2..00000000 --- a/toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/SourceUnit.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "absolutePath": "wow.sol", - "id": 428, - "license": "MIT", - "nodeType": "SourceUnit", - "nodes": [], - "src": "33:8524:0" -} \ No newline at end of file diff --git a/toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/StructDefinition.json b/toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/StructDefinition.json deleted file mode 100644 index c28ab437..00000000 --- a/toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/StructDefinition.json +++ /dev/null @@ -1,66 +0,0 @@ -{ - "canonicalName": "S", - "id": 6, - "members": [ - { - "constant": false, - "id": 3, - "mutability": "mutable", - "name": "x", - "nameLocation": "82:1:0", - "nodeType": "VariableDeclaration", - "scope": 6, - "src": "77:6:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 2, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "77:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 5, - "mutability": "mutable", - "name": "y", - "nameLocation": "94:1:0", - "nodeType": "VariableDeclaration", - "scope": 6, - "src": "89:6:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 4, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "89:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "name": "S", - "nameLocation": "69:1:0", - "nodeType": "StructDefinition", - "scope": 27, - "src": "62:36:0", - "visibility": "public" -} \ No newline at end of file diff --git a/toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/StructuredDocumentation.json b/toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/StructuredDocumentation.json deleted file mode 100644 index 9263e3f1..00000000 --- a/toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/StructuredDocumentation.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "id": 63, - "nodeType": "StructuredDocumentation", - "src": "1522:55:0", - "text": "@notice Event emitted when the minting is locked " -} \ No newline at end of file diff --git a/toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/TryStatement.json b/toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/TryStatement.json deleted file mode 100644 index 6cda0cc1..00000000 --- a/toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/TryStatement.json +++ /dev/null @@ -1,244 +0,0 @@ -{ - "clauses": [ - { - "block": { - "id": 87, - "nodeType": "Block", - "src": "1026:41:0", - "statements": [ - { - "eventCall": { - "arguments": [ - { - "id": 84, - "name": "result", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 81, - "src": "1049:6:0", - "typeDescriptions": { - "typeIdentifier": "t_string_memory_ptr", - "typeString": "string memory" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_string_memory_ptr", - "typeString": "string memory" - } - ], - "id": 83, - "name": "Log", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 51, - "src": "1045:3:0", - "typeDescriptions": { - "typeIdentifier": "t_function_event_nonpayable$_t_string_memory_ptr_$returns$__$", - "typeString": "function (string memory)" - } - }, - "id": 85, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "nameLocations": [], - "names": [], - "nodeType": "FunctionCall", - "src": "1045:11:0", - "tryCall": false, - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 86, - "nodeType": "EmitStatement", - "src": "1040:16:0" - } - ] - }, - "errorName": "", - "id": 88, - "nodeType": "TryCatchClause", - "parameters": { - "id": 82, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 81, - "mutability": "mutable", - "name": "result", - "nameLocation": "1018:6:0", - "nodeType": "VariableDeclaration", - "scope": 88, - "src": "1004:20:0", - "stateVariable": false, - "storageLocation": "memory", - "typeDescriptions": { - "typeIdentifier": "t_string_memory_ptr", - "typeString": "string" - }, - "typeName": { - "id": 80, - "name": "string", - "nodeType": "ElementaryTypeName", - "src": "1004:6:0", - "typeDescriptions": { - "typeIdentifier": "t_string_storage_ptr", - "typeString": "string" - } - }, - "visibility": "internal" - } - ], - "src": "1003:22:0" - }, - "src": "995:72:0" - }, - { - "block": { - "id": 93, - "nodeType": "Block", - "src": "1074:57:0", - "statements": [ - { - "eventCall": { - "arguments": [ - { - "hexValue": "65787465726e616c2063616c6c206661696c6564", - "id": 90, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "1097:22:0", - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_e0e3f7224ce5e493e1d6652b2633dc31e8929d0dd88f4f97ce03f976e5157351", - "typeString": "literal_string \"external call failed\"" - }, - "value": "external call failed" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_stringliteral_e0e3f7224ce5e493e1d6652b2633dc31e8929d0dd88f4f97ce03f976e5157351", - "typeString": "literal_string \"external call failed\"" - } - ], - "id": 89, - "name": "Log", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 51, - "src": "1093:3:0", - "typeDescriptions": { - "typeIdentifier": "t_function_event_nonpayable$_t_string_memory_ptr_$returns$__$", - "typeString": "function (string memory)" - } - }, - "id": 91, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "nameLocations": [], - "names": [], - "nodeType": "FunctionCall", - "src": "1093:27:0", - "tryCall": false, - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 92, - "nodeType": "EmitStatement", - "src": "1088:32:0" - } - ] - }, - "errorName": "", - "id": 94, - "nodeType": "TryCatchClause", - "src": "1068:63:0" - } - ], - "externalCall": { - "arguments": [ - { - "id": 78, - "name": "_i", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 73, - "src": "991:2:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "expression": { - "id": 76, - "name": "foo", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 58, - "src": "980:3:0", - "typeDescriptions": { - "typeIdentifier": "t_contract$_Foo_$47", - "typeString": "contract Foo" - } - }, - "id": 77, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberLocation": "984:6:0", - "memberName": "myFunc", - "nodeType": "MemberAccess", - "referencedDeclaration": 46, - "src": "980:10:0", - "typeDescriptions": { - "typeIdentifier": "t_function_external_pure$_t_uint256_$returns$_t_string_memory_ptr_$", - "typeString": "function (uint256) pure external returns (string memory)" - } - }, - "id": 79, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "nameLocations": [], - "names": [], - "nodeType": "FunctionCall", - "src": "980:14:0", - "tryCall": true, - "typeDescriptions": { - "typeIdentifier": "t_string_memory_ptr", - "typeString": "string memory" - } - }, - "id": 95, - "nodeType": "TryStatement", - "src": "976:155:0" -} \ No newline at end of file diff --git a/toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/TupleExpression.json b/toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/TupleExpression.json deleted file mode 100644 index 83397dc2..00000000 --- a/toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/TupleExpression.json +++ /dev/null @@ -1,44 +0,0 @@ -{ - "components":[ - { - "hexValue":"37", - "id":13, - "kind":"number", - "nodeType":"Literal", - "src":"151:1:0", - "typeDescriptions":{ - - }, - "value":"7" - }, - { - "hexValue":"74727565", - "id":14, - "kind":"bool", - "nodeType":"Literal", - "src":"154:4:0", - "typeDescriptions":{ - - }, - "value":"true" - }, - { - "hexValue":"32", - "id":15, - "kind":"number", - "nodeType":"Literal", - "src":"160:1:0", - "typeDescriptions":{ - - }, - "value":"2" - } - ], - "id":16, - "isInlineArray":false, - "nodeType":"TupleExpression", - "src":"150:12:0", - "typeDescriptions":{ - - } -} \ No newline at end of file diff --git a/toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/TypeDescriptions.json b/toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/TypeDescriptions.json deleted file mode 100644 index 622d7e8f..00000000 --- a/toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/TypeDescriptions.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "typeIdentifier": "t_bool", - "typeString": "bool" -} \ No newline at end of file diff --git a/toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/UnaryOperation.json b/toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/UnaryOperation.json deleted file mode 100644 index 84ecbd0f..00000000 --- a/toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/UnaryOperation.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "id":7, - "nodeType":"UnaryOperation", - "operator":"++", - "prefix":false, - "src":"104:6:0", - "subExpression":{ - "id":6, - "name":"test", - "nodeType":"Identifier", - "overloadedDeclarations":[ - - ], - "src":"104:4:0", - "typeDescriptions":{ - - } - }, - "typeDescriptions":{ - - } -} \ No newline at end of file diff --git a/toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/UncheckedBlock.json b/toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/UncheckedBlock.json deleted file mode 100644 index e3be941a..00000000 --- a/toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/UncheckedBlock.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "id":9, - "nodeType":"UncheckedBlock", - "src":"104:21:0", - "statements":[ - { - "expression":{ - "id":7, - "nodeType":"UnaryOperation", - "operator":"++", - "prefix":false, - "src":"116:6:0", - "subExpression":{ - "id":6, - "name":"test", - "nodeType":"Identifier", - "overloadedDeclarations":[ - - ], - "src":"116:4:0", - "typeDescriptions":{ - - } - }, - "typeDescriptions":{ - - } - }, - "id":8, - "nodeType":"ExpressionStatement", - "src":"116:6:0" - } - ] -} \ No newline at end of file diff --git a/toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/UserDefinedValueTypeDefinition.json b/toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/UserDefinedValueTypeDefinition.json deleted file mode 100644 index 6177c970..00000000 --- a/toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/UserDefinedValueTypeDefinition.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "id":3, - "name":"UFixed256x18", - "nameLocation":"160:12:0", - "nodeType":"UserDefinedValueTypeDefinition", - "src":"155:29:0", - "underlyingType":{ - "id":2, - "name":"uint256", - "nodeType":"ElementaryTypeName", - "src":"176:7:0", - "typeDescriptions":{ - - } - } -} \ No newline at end of file diff --git a/toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/UsingForDirective.json b/toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/UsingForDirective.json deleted file mode 100644 index 2e2090fb..00000000 --- a/toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/UsingForDirective.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "global": false, - "id": 31, - "libraryName": { - "id": 28, - "name": "Counters", - "nameLocations": [ - "1013:8:0" - ], - "nodeType": "IdentifierPath", - "src": "1013:8:0" - }, - "nodeType": "UsingForDirective", - "src": "1007:36:0", - "typeName": { - "id": 30, - "nodeType": "UserDefinedTypeName", - "pathNode": { - "id": 29, - "name": "Counters.Counter", - "nameLocations": [ - "1026:8:0", - "1035:7:0" - ], - "nodeType": "IdentifierPath", - "src": "1026:16:0" - }, - "src": "1026:16:0", - "typeDescriptions": {} - } -} diff --git a/toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/VariableDeclaration.json b/toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/VariableDeclaration.json deleted file mode 100644 index d283e5b1..00000000 --- a/toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/VariableDeclaration.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "constant": false, - "id": 293, - "mutability": "mutable", - "name": "", - "nameLocation": "-1:-1:-1", - "nodeType": "VariableDeclaration", - "src": "5736:13:0", - "stateVariable": false, - "storageLocation": "memory", - "typeDescriptions": {}, - "typeName": { - "id": 292, - "name": "string", - "nodeType": "ElementaryTypeName", - "src": "5736:6:0", - "typeDescriptions": {} - }, - "visibility": "internal" -} diff --git a/toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/WhileStatement.json b/toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/WhileStatement.json deleted file mode 100644 index 2aa8ae02..00000000 --- a/toolchains/solidity/linter/core/solc-wrapper/tests/files/ast/WhileStatement.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "body": { - "id": 8, - "nodeType": "Block", - "src": "158:33:0", - "statements": [ - { - "id": 7, - "nodeType": "Continue", - "src": "172:8:0" - } - ] - }, - "condition": { - "hexValue": "74727565", - "id": 6, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "bool", - "lValueRequested": false, - "nodeType": "Literal", - "src": "152:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "value": "true" - }, - "id": 9, - "nodeType": "WhileStatement", - "src": "145:46:0" -} \ No newline at end of file diff --git a/toolchains/solidity/linter/core/solidhunter-lib/Cargo.toml b/toolchains/solidity/linter/core/solidhunter-lib/Cargo.toml index e128998e..ea598b75 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/Cargo.toml +++ b/toolchains/solidity/linter/core/solidhunter-lib/Cargo.toml @@ -9,8 +9,8 @@ license = "GPL-3.0-or-later" clap = { version = "4.0.29", features = ["derive"] } colored = "2" serde = { version = "1.0.149", features = ["derive"] } -solc-wrapper = { path = "../solc-wrapper" } serde_json = "1.0.89" anyhow = "1.0" glob = "0.3.0" thiserror = "1.0" +ast-extractor = { path = "../../../../../libs/ast-extractor" } diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/error.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/error.rs index 49e0d7a3..b7489377 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/error.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/error.rs @@ -3,8 +3,8 @@ use thiserror::Error; #[derive(Error, Debug)] pub enum SolidHunterError { // Linter errors - #[error("SolidHunterError: Solc error occured")] - SolcError(#[from] solc_wrapper::SolcError), + #[error("SolidHunterError: Ast Extractor error occured")] + AstError(#[from] ast_extractor::errors::ExtractError), #[error("SolidHunterError: Something went wrong with the file during parsing")] ParsingError(#[from] std::io::Error), #[error("SolidHunterError: Serde error occured")] diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/linter.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/linter.rs index 159a6616..6331b93a 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/linter.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/linter.rs @@ -1,4 +1,3 @@ -use crate::error::SolidHunterError; use crate::rules::factory::RuleFactory; use crate::rules::rule_impl::{create_rules_file, parse_rules}; use crate::rules::types::*; @@ -6,10 +5,9 @@ use crate::types::*; use std::fs; use glob::glob; -use solc_wrapper::{Solc, SourceUnit}; pub struct SolidFile { - pub data: SourceUnit, + pub data: ast_extractor::File, pub path: String, pub content: String, } @@ -63,41 +61,33 @@ impl SolidLinter { false } - fn _update_file_ast(&mut self, path: &str, ast: SourceUnit) { - for file in &mut self.files { - if file.path == path { - file.data = ast.clone(); + fn _add_file(&mut self, path: &str, ast: ast_extractor::File, content: &str) { + if self._file_exists(path) { + for file in &mut self.files { + if file.path == path { + file.data = ast.clone(); + file.content = String::from(content); + } } + } else { + let file = SolidFile { + data: ast, + path: String::from(path), + content: String::from(content), + }; + self.files.push(file); } } - fn _add_file(&mut self, path: &str, ast: SourceUnit, content: &str) { - let file = SolidFile { - data: ast, - path: String::from(path), - content: String::from(content), - }; - self.files.push(file); - } - pub fn parse_file(&mut self, filepath: String) -> LintResult { - let res = Solc::default().extract_ast_file(filepath.clone()); - - if let Err(res) = res { - println!("{:?}", res); - return Err(SolidHunterError::SolcError(res)); - } - if self._file_exists(filepath.as_str()) { - self._update_file_ast(filepath.as_str(), res.expect("ast not found")); - } else { - let content = fs::read_to_string(filepath.clone()) - .map_err(|e| SolidHunterError::IoError(e))?; - self._add_file( - filepath.as_str(), - res.expect("ast not found"), - content.as_str(), - ); - } + let content = fs::read_to_string(filepath.clone())?; + let res = ast_extractor::extract::extract_ast_from_content(content)?; + + self._add_file( + filepath.as_str(), + res, + content.as_str(), + ); let mut res: Vec = Vec::new(); for rule in &self.rules { @@ -108,23 +98,13 @@ impl SolidLinter { } pub fn parse_content(&mut self, filepath: String, content: &String) -> LintResult { - let res = Solc::default().extract_ast_content(content.to_string()); - - if let Err(res) = res { - println!("{:?}", res); - return Err(SolidHunterError::SolcError(res)); - } - - if self._file_exists(filepath.as_str()) { - self._update_file_ast(filepath.as_str(), res.expect("ast not found")); - } else { - self._add_file( - filepath.as_str(), - res.expect("ast not found"), - content.as_str(), - ); - } + let res = extract::extract_ast_from_content(content.to_string())?; + self._add_file( + filepath.as_str(), + res, + content.as_str(), + ); let mut res: Vec = Vec::new(); for rule in &self.rules { From 40fd9063cc22523f309c894ca20ccec7384c6c49 Mon Sep 17 00:00:00 2001 From: 0xtekgrinder <0xtekgrinder@protonmail.com> Date: Thu, 14 Sep 2023 19:51:06 -0400 Subject: [PATCH 057/325] refactor(ast-extractor): change mod.rd into retriever.rs --- libs/ast-extractor/src/{retriever/mod.rs => retriever.rs} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename libs/ast-extractor/src/{retriever/mod.rs => retriever.rs} (100%) diff --git a/libs/ast-extractor/src/retriever/mod.rs b/libs/ast-extractor/src/retriever.rs similarity index 100% rename from libs/ast-extractor/src/retriever/mod.rs rename to libs/ast-extractor/src/retriever.rs From c97828c7063dd0778ca223f9352b8e34976eee9b Mon Sep 17 00:00:00 2001 From: 0xMemoryGrinder <35138272+0xMemoryGrinder@users.noreply.github.com> Date: Thu, 14 Sep 2023 22:43:35 -0400 Subject: [PATCH 058/325] feat(libs/ast-extractor): export LineColumn type for code location --- libs/ast-extractor/src/lib.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libs/ast-extractor/src/lib.rs b/libs/ast-extractor/src/lib.rs index 3e452dc2..fb6764d5 100644 --- a/libs/ast-extractor/src/lib.rs +++ b/libs/ast-extractor/src/lib.rs @@ -3,4 +3,7 @@ pub mod retriever; pub mod errors; // Expose syn_solidity crate -pub use syn_solidity::*; \ No newline at end of file +pub use syn_solidity::*; + +// Publish span location type +pub use proc_macro2::LineColumn; \ No newline at end of file From 5b6130e7b12ebc204664dcae16c433705e6875f7 Mon Sep 17 00:00:00 2001 From: 0xMemoryGrinder <35138272+0xMemoryGrinder@users.noreply.github.com> Date: Thu, 14 Sep 2023 22:44:30 -0400 Subject: [PATCH 059/325] feat(libs/ast-extractor): added util method on range to compute easily its length --- .../linter/core/solidhunter-lib/src/linter.rs | 2 +- .../linter/core/solidhunter-lib/src/types.rs | 22 +++++++++++++++++++ 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/linter.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/linter.rs index 6331b93a..ca45cd8d 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/linter.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/linter.rs @@ -98,7 +98,7 @@ impl SolidLinter { } pub fn parse_content(&mut self, filepath: String, content: &String) -> LintResult { - let res = extract::extract_ast_from_content(content.to_string())?; + let res = ast_extractor::extract::extract_ast_from_content(content.to_string())?; self._add_file( filepath.as_str(), diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/types.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/types.rs index 0662777c..09b56b23 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/types.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/types.rs @@ -114,6 +114,28 @@ pub struct Range { pub length: u64, } +impl Range { + // Compue the number of characters between the start and end of the range + pub fn compute_length(&mut self, content: &str) { + if self.start.line == self.end.line { + self.length = self.end.character - self.start.character; + } else { + let mut length = 0; + let mut line = self.start.line; + let mut character = self.start.character; + while line < self.end.line { + let line_content = content.lines().nth(line as usize - 1).unwrap(); + length += line_content.len() + 1 - character as usize; + line += 1; + character = 0; + } + let line_content = content.lines().nth(line as usize - 1).unwrap(); + length += self.end.character as usize - character as usize; + self.length = length as u64; + } + } +} + #[derive(Clone, Serialize, Deserialize, Debug)] pub enum NumberOrString { Number(i32), From 9acf77d000c17d88585b4d75d72fa5f1d5c74df8 Mon Sep 17 00:00:00 2001 From: 0xMemoryGrinder <35138272+0xMemoryGrinder@users.noreply.github.com> Date: Thu, 14 Sep 2023 23:07:09 -0400 Subject: [PATCH 060/325] refactor(solidity/linter/core): import-on-top rule now uses ast crate types --- libs/ast-extractor/src/extract.rs | 2 +- .../linter/core/solidhunter-lib/src/linter.rs | 4 +- .../src/rules/order/import_on_top.rs | 43 ++++++++++--------- .../linter/core/solidhunter-lib/src/types.rs | 1 - .../testdata/ImportOnTop/.solidhunter.json | 12 ++++++ .../testdata/ImportOnTop/file.sol | 7 +++ .../testdata/ImportOnTop/findings.csv | 1 + .../core/solidhunter-lib/tests/linter.rs | 3 +- 8 files changed, 48 insertions(+), 25 deletions(-) create mode 100644 toolchains/solidity/linter/core/solidhunter-lib/testdata/ImportOnTop/.solidhunter.json create mode 100644 toolchains/solidity/linter/core/solidhunter-lib/testdata/ImportOnTop/file.sol create mode 100644 toolchains/solidity/linter/core/solidhunter-lib/testdata/ImportOnTop/findings.csv diff --git a/libs/ast-extractor/src/extract.rs b/libs/ast-extractor/src/extract.rs index 7c76aabe..99e52f4e 100644 --- a/libs/ast-extractor/src/extract.rs +++ b/libs/ast-extractor/src/extract.rs @@ -8,7 +8,7 @@ use crate::errors::ExtractError; use proc_macro2::TokenStream; use std::str::FromStr; -pub fn extract_ast_from_content(content: String) -> Result { +pub fn extract_ast_from_content(content: &String) -> Result { let tokens = TokenStream::from_str(content.as_str())?; let ast = syn_solidity::parse2(tokens)?; Ok(ast) diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/linter.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/linter.rs index ca45cd8d..70d9ab48 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/linter.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/linter.rs @@ -81,7 +81,7 @@ impl SolidLinter { pub fn parse_file(&mut self, filepath: String) -> LintResult { let content = fs::read_to_string(filepath.clone())?; - let res = ast_extractor::extract::extract_ast_from_content(content)?; + let res = ast_extractor::extract::extract_ast_from_content(&content)?; self._add_file( filepath.as_str(), @@ -98,7 +98,7 @@ impl SolidLinter { } pub fn parse_content(&mut self, filepath: String, content: &String) -> LintResult { - let res = ast_extractor::extract::extract_ast_from_content(content.to_string())?; + let res = ast_extractor::extract::extract_ast_from_content(&content.to_string())?; self._add_file( filepath.as_str(), diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/order/import_on_top.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/order/import_on_top.rs index b9ea19ae..4bb49314 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/order/import_on_top.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/order/import_on_top.rs @@ -1,27 +1,30 @@ +use ast_extractor::Spanned; + use crate::linter::SolidFile; use crate::rules::types::*; use crate::types::*; -use solc_wrapper::{decode_location, CodeLocation, SourceUnitChildNodes}; pub struct ImportOnTop { data: RuleEntry, } impl ImportOnTop { - fn create_diag(&self, file: &SolidFile, location: (CodeLocation, CodeLocation)) -> LintDiag { + fn create_diag(&self, file: &SolidFile, location: (ast_extractor::LineColumn, ast_extractor::LineColumn)) -> LintDiag { + let mut range = Range { + start: Position { + line: location.0.line as u64, + character: location.0.column as u64, + }, + end: Position { + line: location.1.line as u64, + character: location.1.column as u64, + }, + length: 0, + }; + range.compute_length(&file.content); LintDiag { id: "import-on-top".to_string(), - range: Range { - start: Position { - line: location.0.line as u64, - character: location.0.column as u64, - }, - end: Position { - line: location.1.line as u64, - character: location.1.column as u64, - }, - length: location.0.length as u64, - }, + range, message: String::from("Import must be on top in the file"), severity: Some(self.data.severity), code: None, @@ -37,9 +40,9 @@ impl RuleType for ImportOnTop { let mut res = Vec::new(); let mut last_import_location = 0; - for i in 1..file.data.nodes.len() { - match &file.data.nodes[i] { - SourceUnitChildNodes::ImportDirective(_) => { + for i in 1..file.data.items.len() { + match &file.data.items[i] { + ast_extractor::Item::Import(_) => { last_import_location = i; } _ => { @@ -48,11 +51,11 @@ impl RuleType for ImportOnTop { } } - for i in 1..file.data.nodes.len() { - match &file.data.nodes[i] { - SourceUnitChildNodes::ImportDirective(import) => { + for i in 1..file.data.items.len() { + match &file.data.items[i] { + ast_extractor::Item::Import(import) => { if i > last_import_location { - let location = decode_location(&import.src, &file.content); + let location = (import.span().start(), import.span().end()); res.push(self.create_diag(file, location)); } } diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/types.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/types.rs index 09b56b23..207b024c 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/types.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/types.rs @@ -129,7 +129,6 @@ impl Range { line += 1; character = 0; } - let line_content = content.lines().nth(line as usize - 1).unwrap(); length += self.end.character as usize - character as usize; self.length = length as u64; } diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/ImportOnTop/.solidhunter.json b/toolchains/solidity/linter/core/solidhunter-lib/testdata/ImportOnTop/.solidhunter.json new file mode 100644 index 00000000..3f5b34e6 --- /dev/null +++ b/toolchains/solidity/linter/core/solidhunter-lib/testdata/ImportOnTop/.solidhunter.json @@ -0,0 +1,12 @@ +{ + "name": "solidhunter", + "includes": [], + "plugins": [], + "rules": [ + { + "id": "import-on-top", + "severity": "WARNING", + "data": [] + } + ] +} \ No newline at end of file diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/ImportOnTop/file.sol b/toolchains/solidity/linter/core/solidhunter-lib/testdata/ImportOnTop/file.sol new file mode 100644 index 00000000..9a64dbc0 --- /dev/null +++ b/toolchains/solidity/linter/core/solidhunter-lib/testdata/ImportOnTop/file.sol @@ -0,0 +1,7 @@ +pragma solidity 0.8.0; + +contract Test {} + +import "hardhat/console.sol"; + +contract Test2 {} \ No newline at end of file diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/ImportOnTop/findings.csv b/toolchains/solidity/linter/core/solidhunter-lib/testdata/ImportOnTop/findings.csv new file mode 100644 index 00000000..7c54c760 --- /dev/null +++ b/toolchains/solidity/linter/core/solidhunter-lib/testdata/ImportOnTop/findings.csv @@ -0,0 +1 @@ +import-on-top:5:0:29 \ No newline at end of file diff --git a/toolchains/solidity/linter/core/solidhunter-lib/tests/linter.rs b/toolchains/solidity/linter/core/solidhunter-lib/tests/linter.rs index 85cbc3c5..b096cf29 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/tests/linter.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/tests/linter.rs @@ -85,5 +85,6 @@ macro_rules! test_directories { } test_directories! { - LineMaxLen + LineMaxLen, + ImportOnTop } From 7dc005f9f9736e899f112e299fbb6402e8cef30f Mon Sep 17 00:00:00 2001 From: 0xtekgrinder <0xtekgrinder@protonmail.com> Date: Thu, 14 Sep 2023 23:37:45 -0400 Subject: [PATCH 061/325] feat(ast-extractor): use refs for all retrievers --- libs/ast-extractor/src/extract.rs | 6 +++--- libs/ast-extractor/src/retriever/contract.rs | 8 ++++---- libs/ast-extractor/src/retriever/enum.rs | 12 ++++++------ libs/ast-extractor/src/retriever/error.rs | 6 +++--- libs/ast-extractor/src/retriever/event.rs | 12 ++++++------ libs/ast-extractor/src/retriever/function.rs | 8 ++++---- libs/ast-extractor/src/retriever/struct.rs | 12 ++++++------ libs/ast-extractor/src/retriever/udt.rs | 4 ++-- libs/ast-extractor/src/retriever/using.rs | 6 +++--- 9 files changed, 37 insertions(+), 37 deletions(-) diff --git a/libs/ast-extractor/src/extract.rs b/libs/ast-extractor/src/extract.rs index 99e52f4e..4e61bc5c 100644 --- a/libs/ast-extractor/src/extract.rs +++ b/libs/ast-extractor/src/extract.rs @@ -27,14 +27,14 @@ mod tests { path.push("files"); path.push("good.sol"); let source = fs::read_to_string(path).unwrap(); - let res = extract_ast_from_content(source); + let res = extract_ast_from_content(&source); assert!(res.is_ok()); } #[test] fn test_extract_ast_from_content_invalid_token() { let source = String::from("contract test { function test() public | uint a = 1 } }"); - let result = extract_ast_from_content(source); + let result = extract_ast_from_content(&source); assert!(result.is_err()); assert_eq!( result.unwrap_err().to_string(), @@ -45,7 +45,7 @@ mod tests { #[test] fn test_extract_ast_from_content_missing_semicolumn() { let source = String::from("contract test { function test() public { uint a = 1 } }"); - let result = extract_ast_from_content(source); + let result = extract_ast_from_content(&source); assert!(result.is_err()); assert_eq!(result.unwrap_err().to_string(), "Parsing error"); } diff --git a/libs/ast-extractor/src/retriever/contract.rs b/libs/ast-extractor/src/retriever/contract.rs index f3fd7189..5062ecbf 100644 --- a/libs/ast-extractor/src/retriever/contract.rs +++ b/libs/ast-extractor/src/retriever/contract.rs @@ -24,7 +24,7 @@ impl<'ast> Visit<'ast> for ContractVisitor { } } -pub fn retrieve_contract_nodes(ast: syn_solidity::File) -> Vec { +pub fn retrieve_contract_nodes(ast: &syn_solidity::File) -> Vec { let mut visitor = ContractVisitor::new(); visitor.visit_file(&ast); visitor.contracts @@ -44,7 +44,7 @@ mod tests { let source = String::from("pragma solidity ^0.8.0;"); let tokens = TokenStream::from_str(source.as_str()).unwrap(); let ast = syn_solidity::parse2(tokens).unwrap(); - let res = retrieve_contract_nodes(ast); + let res = retrieve_contract_nodes(&ast); assert_eq!(res.len(), 0); } @@ -58,7 +58,7 @@ mod tests { let source = fs::read_to_string(path).unwrap(); let tokens = TokenStream::from_str(source.as_str()).unwrap(); let ast = syn_solidity::parse2(tokens).unwrap(); - let res = retrieve_contract_nodes(ast); + let res = retrieve_contract_nodes(&ast); assert_eq!(res.len(), 1); } @@ -72,7 +72,7 @@ mod tests { let source = fs::read_to_string(path).unwrap(); let tokens = TokenStream::from_str(source.as_str()).unwrap(); let ast = syn_solidity::parse2(tokens).unwrap(); - let res = retrieve_contract_nodes(ast); + let res = retrieve_contract_nodes(&ast); assert_eq!(res.len(), 2); } } diff --git a/libs/ast-extractor/src/retriever/enum.rs b/libs/ast-extractor/src/retriever/enum.rs index 484a61b4..7f219f21 100644 --- a/libs/ast-extractor/src/retriever/enum.rs +++ b/libs/ast-extractor/src/retriever/enum.rs @@ -38,13 +38,13 @@ impl<'ast> Visit<'ast> for EnumVisitor { } } -pub fn retrieve_enums_contract_nodes(ast: syn_solidity::ItemContract) -> Vec { +pub fn retrieve_enums_contract_nodes(ast: &syn_solidity::ItemContract) -> Vec { let mut visitor = EnumVisitor::new(); visitor.visit_item_contract(&ast); visitor.contract_enums } -pub fn retrieve_enums_file_nodes(ast: syn_solidity::File) -> Vec { +pub fn retrieve_enums_file_nodes(ast: &syn_solidity::File) -> Vec { let mut visitor = EnumVisitor::new(); visitor.visit_file(&ast); visitor.file_enums @@ -73,7 +73,7 @@ mod tests { let item = ast.items.first().unwrap().clone(); if let Item::Contract(contract) = item { - let res = retrieve_enums_contract_nodes(contract); + let res = retrieve_enums_contract_nodes(&contract); assert_eq!(res.len(), 0); } else { panic!("Item shouldn't have enum"); @@ -98,7 +98,7 @@ mod tests { .clone(); if let Item::Contract(contract) = contract { - let res = retrieve_enums_contract_nodes(contract); + let res = retrieve_enums_contract_nodes(&contract); assert_eq!(res.len(), 1); } else { panic!("Item should have a contract"); @@ -116,7 +116,7 @@ mod tests { let tokens = TokenStream::from_str(source.as_str()).unwrap(); let ast = syn_solidity::parse2(tokens).unwrap(); - let res = retrieve_enums_file_nodes(ast); + let res = retrieve_enums_file_nodes(&ast); assert_eq!(res.len(), 0); } @@ -131,7 +131,7 @@ mod tests { let tokens = TokenStream::from_str(source.as_str()).unwrap(); let ast = syn_solidity::parse2(tokens).unwrap(); - let res = retrieve_enums_file_nodes(ast); + let res = retrieve_enums_file_nodes(&ast); assert_eq!(res.len(), 1); } } diff --git a/libs/ast-extractor/src/retriever/error.rs b/libs/ast-extractor/src/retriever/error.rs index 4ebc0605..d8b4e514 100644 --- a/libs/ast-extractor/src/retriever/error.rs +++ b/libs/ast-extractor/src/retriever/error.rs @@ -22,7 +22,7 @@ impl<'ast> Visit<'ast> for ErrorVisitor { } } -pub fn retrieve_errors_nodes(ast: syn_solidity::ItemContract) -> Vec { +pub fn retrieve_errors_nodes(ast: &syn_solidity::ItemContract) -> Vec { let mut visitor = ErrorVisitor::new(); visitor.visit_item_contract(&ast); visitor.errors @@ -51,7 +51,7 @@ mod tests { let item = ast.items.first().unwrap().clone(); if let Item::Contract(contract) = item { - let res = retrieve_errors_nodes(contract); + let res = retrieve_errors_nodes(&contract); assert_eq!(res.len(), 0); } else { panic!("Item should not have error"); @@ -76,7 +76,7 @@ mod tests { .clone(); if let Item::Contract(contract) = item { - let res = retrieve_errors_nodes(contract); + let res = retrieve_errors_nodes(&contract); assert_eq!(res.len(), 1); } else { panic!("Item should have a contract"); diff --git a/libs/ast-extractor/src/retriever/event.rs b/libs/ast-extractor/src/retriever/event.rs index c2642e4a..96946da6 100644 --- a/libs/ast-extractor/src/retriever/event.rs +++ b/libs/ast-extractor/src/retriever/event.rs @@ -38,13 +38,13 @@ impl<'ast> Visit<'ast> for EventVisitor { } } -pub fn retrieve_events_contract_nodes(ast: syn_solidity::ItemContract) -> Vec { +pub fn retrieve_events_contract_nodes(ast: &syn_solidity::ItemContract) -> Vec { let mut visitor = EventVisitor::new(); visitor.visit_item_contract(&ast); visitor.contract_events } -pub fn retrieve_events_file_nodes(ast: syn_solidity::File) -> Vec { +pub fn retrieve_events_file_nodes(ast: &syn_solidity::File) -> Vec { let mut visitor = EventVisitor::new(); visitor.visit_file(&ast); visitor.file_events @@ -74,7 +74,7 @@ mod tests { let item = ast.items.first().unwrap().clone(); if let Item::Contract(contract) = item { - let res = retrieve_events_contract_nodes(contract); + let res = retrieve_events_contract_nodes(&contract); assert_eq!(res.len(), 0); } else { panic!("Item should not have event"); @@ -99,7 +99,7 @@ mod tests { .clone(); if let Item::Contract(contract) = item { - let res = retrieve_events_contract_nodes(contract); + let res = retrieve_events_contract_nodes(&contract); assert_eq!(res.len(), 1); } else { panic!("Item should have a event"); @@ -117,7 +117,7 @@ mod tests { let tokens = TokenStream::from_str(source.as_str()).unwrap(); let ast = syn_solidity::parse2(tokens).unwrap(); - let res = retrieve_events_file_nodes(ast); + let res = retrieve_events_file_nodes(&ast); assert_eq!(res.len(), 0); } @@ -132,7 +132,7 @@ mod tests { let tokens = TokenStream::from_str(source.as_str()).unwrap(); let ast = syn_solidity::parse2(tokens).unwrap(); - let res = retrieve_events_file_nodes(ast); + let res = retrieve_events_file_nodes(&ast); assert_eq!(res.len(), 1); } } diff --git a/libs/ast-extractor/src/retriever/function.rs b/libs/ast-extractor/src/retriever/function.rs index 4e4937da..06079a28 100644 --- a/libs/ast-extractor/src/retriever/function.rs +++ b/libs/ast-extractor/src/retriever/function.rs @@ -24,7 +24,7 @@ impl<'ast> Visit<'ast> for FunctionVisitor { } } -pub fn retrieve_functions_nodes(ast: syn_solidity::ItemContract) -> Vec { +pub fn retrieve_functions_nodes(ast: &syn_solidity::ItemContract) -> Vec { let mut visitor = FunctionVisitor::new(); visitor.visit_item_contract(&ast); visitor.functions @@ -53,7 +53,7 @@ mod tests { let item = ast.items.first().unwrap().clone(); if let Item::Contract(contract) = item { - let res = retrieve_functions_nodes(contract); + let res = retrieve_functions_nodes(&contract); assert_eq!(res.len(), 0); } else { panic!("Item is not a contract"); @@ -73,7 +73,7 @@ mod tests { let item = ast.items.first().unwrap().clone(); if let Item::Contract(contract) = item { - let res = retrieve_functions_nodes(contract); + let res = retrieve_functions_nodes(&contract); assert_eq!(res.len(), 1); } else { panic!("Item is not a contract"); @@ -93,7 +93,7 @@ mod tests { let item = ast.items.first().unwrap().clone(); if let Item::Contract(contract) = item { - let res = retrieve_functions_nodes(contract); + let res = retrieve_functions_nodes(&contract); assert_eq!(res.len(), 2); } else { panic!("Item is not a contract"); diff --git a/libs/ast-extractor/src/retriever/struct.rs b/libs/ast-extractor/src/retriever/struct.rs index 1c59b6ae..dadbdf1c 100644 --- a/libs/ast-extractor/src/retriever/struct.rs +++ b/libs/ast-extractor/src/retriever/struct.rs @@ -37,13 +37,13 @@ impl<'ast> Visit<'ast> for StructVisitor { } } -pub fn retrieve_structs_contract_nodes(ast: syn_solidity::ItemContract) -> Vec { +pub fn retrieve_structs_contract_nodes(ast: &syn_solidity::ItemContract) -> Vec { let mut visitor = StructVisitor::new(); visitor.visit_item_contract(&ast); visitor.contract_structs } -pub fn retrieve_structs_file_nodes(ast: syn_solidity::File) -> Vec { +pub fn retrieve_structs_file_nodes(ast: &syn_solidity::File) -> Vec { let mut visitor = StructVisitor::new(); visitor.visit_file(&ast); visitor.file_structs @@ -72,7 +72,7 @@ mod tests { let item = ast.items.first().unwrap().clone(); if let Item::Contract(contract) = item { - let res = retrieve_structs_contract_nodes(contract); + let res = retrieve_structs_contract_nodes(&contract); assert_eq!(res.len(), 0); } else { panic!("Item should not have struct"); @@ -97,7 +97,7 @@ mod tests { .clone(); if let Item::Contract(contract) = item { - let res = retrieve_structs_contract_nodes(contract); + let res = retrieve_structs_contract_nodes(&contract); assert_eq!(res.len(), 1); } else { panic!("Item should have a struct"); @@ -115,7 +115,7 @@ mod tests { let tokens = TokenStream::from_str(source.as_str()).unwrap(); let ast = syn_solidity::parse2(tokens).unwrap(); - let res = retrieve_structs_file_nodes(ast); + let res = retrieve_structs_file_nodes(&ast); assert_eq!(res.len(), 0); } @@ -130,7 +130,7 @@ mod tests { let tokens = TokenStream::from_str(source.as_str()).unwrap(); let ast = syn_solidity::parse2(tokens).unwrap(); - let res = retrieve_structs_file_nodes(ast); + let res = retrieve_structs_file_nodes(&ast); assert_eq!(res.len(), 1); } } diff --git a/libs/ast-extractor/src/retriever/udt.rs b/libs/ast-extractor/src/retriever/udt.rs index 7c633064..872d02ed 100644 --- a/libs/ast-extractor/src/retriever/udt.rs +++ b/libs/ast-extractor/src/retriever/udt.rs @@ -22,7 +22,7 @@ impl<'ast> Visit<'ast> for UdtVisitor { } } -pub fn retrieve_udts_nodes(ast: syn_solidity::File) -> Vec { +pub fn retrieve_udts_nodes(ast: &syn_solidity::File) -> Vec { let mut visitor = UdtVisitor::new(); visitor.visit_file(&ast); visitor.udts @@ -48,7 +48,7 @@ mod tests { let tokens = TokenStream::from_str(source.as_str()).unwrap(); let ast = syn_solidity::parse2(tokens).unwrap(); - let res = retrieve_udts_nodes(ast); + let res = retrieve_udts_nodes(&ast); assert_eq!(res.len(), 1); } } diff --git a/libs/ast-extractor/src/retriever/using.rs b/libs/ast-extractor/src/retriever/using.rs index 7e9f8d14..07b798b9 100644 --- a/libs/ast-extractor/src/retriever/using.rs +++ b/libs/ast-extractor/src/retriever/using.rs @@ -22,7 +22,7 @@ impl<'ast> Visit<'ast> for UsingVisitor { } } -pub fn retrieve_usings_nodes(ast: syn_solidity::ItemContract) -> Vec { +pub fn retrieve_usings_nodes(ast: &syn_solidity::ItemContract) -> Vec { let mut visitor = UsingVisitor::new(); visitor.visit_item_contract(&ast); visitor.usings @@ -51,7 +51,7 @@ mod tests { let item = ast.items.first().unwrap().clone(); if let Item::Contract(contract) = item { - let res = retrieve_usings_nodes(contract); + let res = retrieve_usings_nodes(&contract); assert_eq!(res.len(), 0); } else { panic!("Item should not have any using directive"); @@ -79,7 +79,7 @@ mod tests { .clone(); if let Item::Contract(contract) = item { - let res = retrieve_usings_nodes(contract); + let res = retrieve_usings_nodes(&contract); assert_eq!(res.len(), 1); } else { panic!("Item should have a a using directive"); From d020796d50b7d1edf366b38c72c08407faaeac20 Mon Sep 17 00:00:00 2001 From: 0xtekgrinder <0xtekgrinder@protonmail.com> Date: Fri, 15 Sep 2023 00:13:24 -0400 Subject: [PATCH 062/325] refactor(solidhunter): remove length attribute from Range type --- .../linter/core/solidhunter-lib/src/linter.rs | 4 ++-- .../rules/best_practises/function_max_lines.rs | 6 ++++-- .../src/rules/best_practises/line_maxlen.rs | 11 +++++++---- .../rules/best_practises/max_states_count.rs | 5 +++-- .../src/rules/best_practises/mod.rs | 13 +++++++++---- .../src/rules/best_practises/reason_string.rs | 7 +++---- .../src/rules/miscellaneous/quotes.rs | 1 - .../src/rules/naming/func_name_camelcase.rs | 9 ++++----- .../rules/naming/func_param_name_camelcase.rs | 8 ++++---- .../solidhunter-lib/src/rules/naming/mod.rs | 17 ++++++++++++----- .../src/rules/naming/use_forbidden_name.rs | 7 ++++--- .../src/rules/order/import_on_top.rs | 11 ++++++----- .../core/solidhunter-lib/src/rules/order/mod.rs | 3 +-- .../linter/core/solidhunter-lib/src/types.rs | 9 ++++----- 14 files changed, 63 insertions(+), 48 deletions(-) diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/linter.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/linter.rs index 70d9ab48..aa63991f 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/linter.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/linter.rs @@ -86,7 +86,7 @@ impl SolidLinter { self._add_file( filepath.as_str(), res, - content.as_str(), + &content.as_str(), ); let mut res: Vec = Vec::new(); @@ -98,7 +98,7 @@ impl SolidLinter { } pub fn parse_content(&mut self, filepath: String, content: &String) -> LintResult { - let res = ast_extractor::extract::extract_ast_from_content(&content.to_string())?; + let res = ast_extractor::extract::extract_ast_from_content(content)?; self._add_file( filepath.as_str(), diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/function_max_lines.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/function_max_lines.rs index 14b57627..a6980d9d 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/function_max_lines.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/function_max_lines.rs @@ -1,7 +1,8 @@ use crate::linter::SolidFile; use crate::rules::types::*; use crate::types::*; -use solc_wrapper::ast::ast::*; + +/* // const DEFAULT_SEVERITY: &str = "warn"; const DEFAULT_MESSAGE: &str = "Function contains too much lines"; @@ -82,7 +83,6 @@ fn check_function_lines( line: last_bracket_line as u64, character: 1, }, - length: _file.content.lines().nth(_start.line - 1)?.len() as u64, }); } res @@ -131,3 +131,5 @@ impl FunctionMaxLines { } } } + +*/ \ No newline at end of file diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/line_maxlen.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/line_maxlen.rs index b4d2be23..3085df0a 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/line_maxlen.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/line_maxlen.rs @@ -2,6 +2,10 @@ use crate::linter::SolidFile; use crate::rules::types::*; use crate::types::*; +pub const RULE_ID: &str = "line-max-len"; + +const DEFAULT_LENGTH: u32 = 80; + pub struct LineMaxLen { max_len: usize, data: RuleEntry, @@ -19,9 +23,8 @@ impl LineMaxLen { line: line_idx as u64, character: line.len() as u64, }, - length: (line.len() - self.max_len) as u64, }, - id: "line-max-len".to_string(), + id: RULE_ID.to_string(), message: format!("Line is too long: {}", line.len()), severity: Some(self.data.severity), code: None, @@ -58,9 +61,9 @@ impl LineMaxLen { pub(crate) fn create_default() -> RuleEntry { RuleEntry { - id: "line-max-len".to_string(), + id: RULE_ID.to_string(), severity: Severity::WARNING, - data: vec!["80".to_string()], + data: vec![DEFAULT_LENGTH.to_string()], } } } diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/max_states_count.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/max_states_count.rs index 793ef258..5b1eeb16 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/max_states_count.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/max_states_count.rs @@ -1,8 +1,8 @@ use crate::linter::SolidFile; use crate::rules::types::*; use crate::types::*; -use solc_wrapper::*; +/* pub struct MaxStatesCount { max_states: usize, data: RuleEntry, @@ -26,7 +26,6 @@ impl MaxStatesCount { line: location.1.line as u64, character: location.1.column as u64, }, - length: location.0.length as u64, }, message: format!("Too many states: {}", count), severity: Some(self.data.severity), @@ -85,3 +84,5 @@ impl MaxStatesCount { } } } + +*/ \ No newline at end of file diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/mod.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/mod.rs index 7ab23cfb..eb53d044 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/mod.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/mod.rs @@ -9,31 +9,36 @@ pub mod reason_string; // List all rules -use crate::rules::best_practises::function_max_lines::FunctionMaxLines; +// use crate::rules::best_practises::function_max_lines::FunctionMaxLines; use crate::rules::best_practises::line_maxlen::LineMaxLen; -use crate::rules::best_practises::max_states_count::MaxStatesCount; -use crate::rules::best_practises::reason_string::ReasonString; +// use crate::rules::best_practises::max_states_count::MaxStatesCount; +// use crate::rules::best_practises::reason_string::ReasonString; use crate::rules::RuleBuilder; pub fn create_default_rules() -> Vec { vec![ LineMaxLen::create_default(), + /* MaxStatesCount::create_default(), FunctionMaxLines::create_default(), ReasonString::create_default(), + */ ] } pub fn create_rules() -> HashMap Box> { let mut rules: HashMap = HashMap::new(); - rules.insert("line-max-len".to_string(), LineMaxLen::create); + rules.insert(line_maxlen::RULE_ID.to_string(), LineMaxLen::create); + + /* rules.insert(MaxStatesCount::RULE_ID.to_string(), MaxStatesCount::create); rules.insert( FunctionMaxLines::RULE_ID.to_string(), FunctionMaxLines::create, ); rules.insert(reason_string::RULE_ID.to_string(), ReasonString::create); + */ rules } diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/reason_string.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/reason_string.rs index e5a67338..9921407b 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/reason_string.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/reason_string.rs @@ -1,10 +1,8 @@ -use solc_wrapper::ast::utils::{self, get_all_nodes_by_type}; -use solc_wrapper::{decode_location, CodeLocation, Expression, NodeType}; - use crate::linter::SolidFile; use crate::rules::types::{RuleEntry, RuleType}; use crate::types::{LintDiag, Position, Range, Severity}; +/* pub const RULE_ID: &str = "reason-string"; const DEFAULT_SEVERITY: Severity = Severity::WARNING; @@ -34,7 +32,6 @@ impl ReasonString { line: location.1.line as u64, character: location.1.column as u64, }, - length: location.0.length as u64, }, message, severity: Some(self.data.severity), @@ -119,3 +116,5 @@ impl ReasonString { } } } + +*/ \ No newline at end of file diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/miscellaneous/quotes.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/miscellaneous/quotes.rs index e1dabdad..270cbc29 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/miscellaneous/quotes.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/miscellaneous/quotes.rs @@ -19,7 +19,6 @@ impl Quotes { line: line_idx, character: idx as u64, }, - length: 1u64, }, message: format!("Use double quotes instead of single quote"), severity: Some(self.data.severity), diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/func_name_camelcase.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/func_name_camelcase.rs index 4c99c920..f4815546 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/func_name_camelcase.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/func_name_camelcase.rs @@ -1,10 +1,8 @@ use crate::linter::SolidFile; use crate::rules::types::*; use crate::types::*; -use solc_wrapper::{ - decode_location, CodeLocation, ContractDefinitionChildNodes, FunctionDefinitionKind, - SourceUnitChildNodes, -}; + +/* pub struct FuncNameCamelCase { data: RuleEntry, @@ -23,7 +21,6 @@ impl FuncNameCamelCase { line: location.1.line as u64, character: location.1.column as u64, }, - length: location.0.length as u64, }, message: "Function name need to be in camel case".to_string(), severity: Some(self.data.severity), @@ -88,3 +85,5 @@ impl FuncNameCamelCase { } } } + +*/ \ No newline at end of file diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/func_param_name_camelcase.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/func_param_name_camelcase.rs index 1b06ca49..6fea45ad 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/func_param_name_camelcase.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/func_param_name_camelcase.rs @@ -1,9 +1,8 @@ use crate::linter::SolidFile; use crate::rules::types::*; use crate::types::*; -use solc_wrapper::{ - decode_location, CodeLocation, ContractDefinitionChildNodes, SourceUnitChildNodes, -}; + +/* pub struct FuncParamNameCamelcase { data: RuleEntry, @@ -22,7 +21,6 @@ impl FuncParamNameCamelcase { line: location.1.line as u64, character: location.1.column as u64, }, - length: location.0.length as u64, }, message: "Parameter name need to be in camel case".to_string(), severity: Some(self.data.severity), @@ -88,3 +86,5 @@ impl FuncParamNameCamelcase { } } } + +*/ \ No newline at end of file diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/mod.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/mod.rs index 6c29aec3..5c5de3c9 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/mod.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/mod.rs @@ -1,7 +1,10 @@ use crate::rules::naming::contract_name_pascalcase::ContractNamePascalCase; + +/* use crate::rules::naming::func_name_camelcase::FuncNameCamelCase; use crate::rules::naming::func_param_name_camelcase::FuncParamNameCamelcase; use crate::rules::naming::use_forbidden_name::UseForbiddenName; +*/ use crate::rules::types::{RuleEntry, RuleType}; use crate::rules::RuleBuilder; use std::collections::HashMap; @@ -16,10 +19,12 @@ pub(crate) mod use_forbidden_name; pub fn create_default_rules() -> Vec { vec![ - FuncParamNameCamelcase::create_default(), ContractNamePascalCase::create_default(), + /* + FuncParamNameCamelcase::create_default(), FuncNameCamelCase::create_default(), UseForbiddenName::create_default(), + */ ] } @@ -27,18 +32,20 @@ pub fn create_rules() -> HashMap Box> { let mut rules: HashMap = HashMap::new(); rules.insert( - "func-param-name-camelcase".to_string(), - FuncParamNameCamelcase::create, + contract_name_pascalcase::RULE_ID.to_string(), + ContractNamePascalCase::create, ); + /* rules.insert( - "contract-name-pascalcase".to_string(), - ContractNamePascalCase::create, + "func-param-name-camelcase".to_string(), + FuncParamNameCamelcase::create, ); rules.insert("func-name-camelcase".to_string(), FuncNameCamelCase::create); rules.insert( UseForbiddenName::RULE_ID.to_string(), UseForbiddenName::create, ); + */ rules } diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/use_forbidden_name.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/use_forbidden_name.rs index 982caf52..46d3fb5b 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/use_forbidden_name.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/use_forbidden_name.rs @@ -1,8 +1,8 @@ use crate::linter::SolidFile; use crate::rules::types::*; use crate::types::*; -use solc_wrapper::ast::utils::{get_all_nodes_by_type, Nodes}; -use solc_wrapper::*; + +/* pub struct UseForbiddenName { data: RuleEntry, @@ -26,7 +26,6 @@ impl UseForbiddenName { line: location.1.line as u64, character: location.1.column as u64, }, - length: location.0.length as u64, }, message: format!("Forbidden variable name: {}", var.name), severity: Some(self.data.severity), @@ -75,3 +74,5 @@ impl UseForbiddenName { } } } + +*/ \ No newline at end of file diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/order/import_on_top.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/order/import_on_top.rs index 4bb49314..d7757d40 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/order/import_on_top.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/order/import_on_top.rs @@ -4,6 +4,9 @@ use crate::linter::SolidFile; use crate::rules::types::*; use crate::types::*; +pub const RULE_ID: &str = "import-on-top"; +const MESSAGE: &str = "Import must be on top in the file"; + pub struct ImportOnTop { data: RuleEntry, } @@ -19,13 +22,11 @@ impl ImportOnTop { line: location.1.line as u64, character: location.1.column as u64, }, - length: 0, }; - range.compute_length(&file.content); LintDiag { - id: "import-on-top".to_string(), + id: RULE_ID.to_string(), range, - message: String::from("Import must be on top in the file"), + message: MESSAGE.to_string(), severity: Some(self.data.severity), code: None, source: None, @@ -75,7 +76,7 @@ impl ImportOnTop { pub(crate) fn create_default() -> RuleEntry { RuleEntry { - id: "import-on-top".to_string(), + id: RULE_ID.to_string(), severity: Severity::WARNING, data: vec![], } diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/order/mod.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/order/mod.rs index a235f67d..e9b8017d 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/order/mod.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/order/mod.rs @@ -5,7 +5,6 @@ use std::collections::HashMap; pub(crate) mod import_on_top; // List all rules - use crate::rules::order::import_on_top::ImportOnTop; use crate::rules::RuleBuilder; @@ -16,7 +15,7 @@ pub fn create_default_rules() -> Vec { pub fn create_rules() -> HashMap Box> { let mut rules: HashMap = HashMap::new(); - rules.insert("import-on-top".to_string(), ImportOnTop::create); + rules.insert(import_on_top::RULE_ID.to_string(), ImportOnTop::create); rules } diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/types.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/types.rs index 207b024c..8b8ea3fd 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/types.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/types.rs @@ -74,7 +74,7 @@ impl fmt::Display for LintDiag { padding, line, " ".repeat(self.range.start.character as usize), - "^".repeat(self.range.length as usize) + "^".repeat(self.range.compute_length(line) as usize) ) } } @@ -111,14 +111,13 @@ pub enum Severity { pub struct Range { pub start: Position, pub end: Position, - pub length: u64, } impl Range { // Compue the number of characters between the start and end of the range - pub fn compute_length(&mut self, content: &str) { + pub fn compute_length(&self, content: &str) -> u64 { if self.start.line == self.end.line { - self.length = self.end.character - self.start.character; + self.end.character - self.start.character } else { let mut length = 0; let mut line = self.start.line; @@ -130,7 +129,7 @@ impl Range { character = 0; } length += self.end.character as usize - character as usize; - self.length = length as u64; + length as u64 } } } From 92d4ffc5094683e2a5c65a7c3c4d005da68dd380 Mon Sep 17 00:00:00 2001 From: 0xtekgrinder <0xtekgrinder@protonmail.com> Date: Fri, 15 Sep 2023 00:14:06 -0400 Subject: [PATCH 063/325] refactor(solidhunter): contract_name_pascalcase use ast_extractor --- .../rules/naming/contract_name_pascalcase.rs | 63 +++++++++---------- .../ContractNamePascalCase/.solidhunter.json | 24 +++++++ .../testdata/ContractNamePascalCase/file.sol | 4 ++ .../ContractNamePascalCase/findings.csv | 1 + 4 files changed, 58 insertions(+), 34 deletions(-) create mode 100644 toolchains/solidity/linter/core/solidhunter-lib/testdata/ContractNamePascalCase/.solidhunter.json create mode 100644 toolchains/solidity/linter/core/solidhunter-lib/testdata/ContractNamePascalCase/file.sol create mode 100644 toolchains/solidity/linter/core/solidhunter-lib/testdata/ContractNamePascalCase/findings.csv diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/contract_name_pascalcase.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/contract_name_pascalcase.rs index e85e5aa1..c8cd9b19 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/contract_name_pascalcase.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/contract_name_pascalcase.rs @@ -1,28 +1,22 @@ +use ast_extractor::Spanned; + use crate::linter::SolidFile; use crate::rules::types::*; use crate::types::*; -use solc_wrapper::{decode_location, CodeLocation, SourceUnitChildNodes}; + +pub const RULE_ID: &str = "contract-name-pascalcase"; +const MESSAGE: &str = "Contract name need to be in pascal case"; pub struct ContractNamePascalCase { data: RuleEntry, } impl ContractNamePascalCase { - fn create_diag(&self, location: (CodeLocation, CodeLocation), file: &SolidFile) -> LintDiag { + fn create_diag(&self, location: Range, file: &SolidFile) -> LintDiag { LintDiag { - id: "contract-name-pascalcase".to_string(), - range: Range { - start: Position { - line: location.0.line as u64, - character: location.0.column as u64, - }, - end: Position { - line: location.1.line as u64, - character: location.1.column as u64, - }, - length: location.0.length as u64, - }, - message: "Contract name need to be in pascal case".to_string(), + id: RULE_ID.to_string(), + range: location, + message: MESSAGE.to_string(), severity: Some(self.data.severity), code: None, source: None, @@ -35,27 +29,28 @@ impl ContractNamePascalCase { impl RuleType for ContractNamePascalCase { fn diagnose(&self, file: &SolidFile, _files: &Vec) -> Vec { let mut res = Vec::new(); + let contracts = ast_extractor::retriever::retrieve_contract_nodes(&file.data); - for node in &file.data.nodes { - match node { - SourceUnitChildNodes::ContractDefinition(contract) => { - if (contract.name.chars().nth(0).unwrap() >= 'a' - && contract.name.chars().nth(0).unwrap() <= 'z') - || contract.name.contains('_') - || contract.name.contains('-') + for contract in contracts { + if (contract.name.as_string().chars().nth(0).unwrap() >= 'a' + && contract.name.as_string().chars().nth(0).unwrap() <= 'z') + || contract.name.as_string().contains('_') + || contract.name.as_string().contains('-') { - //Untested - let location = decode_location( - contract.name_location.as_ref().unwrap(), - &file.content, - ); - res.push(self.create_diag(location, file)); + res.push(self.create_diag({ + let location = contract.name.span(); + Range { + start: Position { + line: location.start().line as u64, + character: location.start().column as u64, + }, + end: Position { + line: location.end().line as u64, + character: location.end().column as u64, + }, + } + }, file)); } - } - _ => { - continue; - } - } } res } @@ -69,7 +64,7 @@ impl ContractNamePascalCase { pub(crate) fn create_default() -> RuleEntry { RuleEntry { - id: "contract-name-pascalcase".to_string(), + id: RULE_ID.to_string(), severity: Severity::WARNING, data: vec![], } diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/ContractNamePascalCase/.solidhunter.json b/toolchains/solidity/linter/core/solidhunter-lib/testdata/ContractNamePascalCase/.solidhunter.json new file mode 100644 index 00000000..464becc6 --- /dev/null +++ b/toolchains/solidity/linter/core/solidhunter-lib/testdata/ContractNamePascalCase/.solidhunter.json @@ -0,0 +1,24 @@ +{ + "name": "solidhunter", + "includes": [], + "plugins": [], + "rules": [ + { + "id": "line-max-len", + "severity": "WARNING", + "data": [ + "80" + ] + }, + { + "id": "quotes", + "severity": "ERROR", + "data": [] + }, + { + "id": "contract-name-pascalcase", + "severity": "WARNING", + "data": [] + } + ] +} \ No newline at end of file diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/ContractNamePascalCase/file.sol b/toolchains/solidity/linter/core/solidhunter-lib/testdata/ContractNamePascalCase/file.sol new file mode 100644 index 00000000..09d51106 --- /dev/null +++ b/toolchains/solidity/linter/core/solidhunter-lib/testdata/ContractNamePascalCase/file.sol @@ -0,0 +1,4 @@ +pragma solidity 0.8.0; + +contract test { +} \ No newline at end of file diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/ContractNamePascalCase/findings.csv b/toolchains/solidity/linter/core/solidhunter-lib/testdata/ContractNamePascalCase/findings.csv new file mode 100644 index 00000000..7d0c6be6 --- /dev/null +++ b/toolchains/solidity/linter/core/solidhunter-lib/testdata/ContractNamePascalCase/findings.csv @@ -0,0 +1 @@ +contract-name-pascalcase:3:9:3:13 \ No newline at end of file From cfc05e015b018b7ace884383ad61f714b4ae10e9 Mon Sep 17 00:00:00 2001 From: 0xtekgrinder <0xtekgrinder@protonmail.com> Date: Fri, 15 Sep 2023 00:14:32 -0400 Subject: [PATCH 064/325] tests(solidhunter): update tests accordingly to last few changes --- .../testdata/ImportOnTop/findings.csv | 2 +- .../testdata/LineMaxLen/.solidhunter.json | 51 ------------------- .../testdata/LineMaxLen/findings.csv | 2 +- .../core/solidhunter-lib/tests/linter.rs | 12 +++-- 4 files changed, 10 insertions(+), 57 deletions(-) diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/ImportOnTop/findings.csv b/toolchains/solidity/linter/core/solidhunter-lib/testdata/ImportOnTop/findings.csv index 7c54c760..276c78a7 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/testdata/ImportOnTop/findings.csv +++ b/toolchains/solidity/linter/core/solidhunter-lib/testdata/ImportOnTop/findings.csv @@ -1 +1 @@ -import-on-top:5:0:29 \ No newline at end of file +import-on-top:5:0:5:29 \ No newline at end of file diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/LineMaxLen/.solidhunter.json b/toolchains/solidity/linter/core/solidhunter-lib/testdata/LineMaxLen/.solidhunter.json index b4a09fbf..4fd69780 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/testdata/LineMaxLen/.solidhunter.json +++ b/toolchains/solidity/linter/core/solidhunter-lib/testdata/LineMaxLen/.solidhunter.json @@ -9,57 +9,6 @@ "data": [ "80" ] - }, - { - "id": "max-states-count", - "severity": "WARNING", - "data": [ - "15" - ] - }, - { - "id": "function-max-lines", - "severity": "WARNING", - "data": [ - "20" - ] - }, - { - "id": "reason-string", - "severity": "WARNING", - "data": [ - "32" - ] - }, - { - "id": "quotes", - "severity": "ERROR", - "data": [] - }, - { - "id": "func-param-name-camelcase", - "severity": "WARNING", - "data": [] - }, - { - "id": "contract-name-pascalcase", - "severity": "WARNING", - "data": [] - }, - { - "id": "func-name-camelcase", - "severity": "WARNING", - "data": [] - }, - { - "id": "use-forbidden-name", - "severity": "WARNING", - "data": [] - }, - { - "id": "import-on-top", - "severity": "WARNING", - "data": [] } ] } \ No newline at end of file diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/LineMaxLen/findings.csv b/toolchains/solidity/linter/core/solidhunter-lib/testdata/LineMaxLen/findings.csv index 66932d7e..a92c1fc3 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/testdata/LineMaxLen/findings.csv +++ b/toolchains/solidity/linter/core/solidhunter-lib/testdata/LineMaxLen/findings.csv @@ -1 +1 @@ -line-max-len:4:80:10 \ No newline at end of file +line-max-len:4:80:4:90 \ No newline at end of file diff --git a/toolchains/solidity/linter/core/solidhunter-lib/tests/linter.rs b/toolchains/solidity/linter/core/solidhunter-lib/tests/linter.rs index b096cf29..750ba587 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/tests/linter.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/tests/linter.rs @@ -4,7 +4,7 @@ use std::{fs, path::PathBuf}; struct Finding { start: Position, - length: u64, + end: Position, id: String, } @@ -35,7 +35,10 @@ fn test_directory(base_name: &str) { line: splitted_line[1].parse::().unwrap(), character: splitted_line[2].parse::().unwrap(), }, - length: splitted_line[3].parse::().unwrap(), + end: Position { + line: splitted_line[3].parse::().unwrap(), + character: splitted_line[4].parse::().unwrap(), + }, id: splitted_line[0].to_string(), }); } @@ -58,7 +61,7 @@ fn test_linter(config: &str, source: &str, expected_findings: &Vec) { for (_, diag) in diags.iter().enumerate() { for (_, expected_finding) in expected_findings.iter().enumerate() { if (diag.range.start == expected_finding.start) - && (diag.range.length == expected_finding.length) + && (diag.range.end == expected_finding.end) && (diag.id == expected_finding.id) { found = true; @@ -86,5 +89,6 @@ macro_rules! test_directories { test_directories! { LineMaxLen, - ImportOnTop + ImportOnTop, + ContractNamePascalCase } From c881d068b55f96f8eec4c63fe477a23449269aa9 Mon Sep 17 00:00:00 2001 From: 0xMemoryGrinder <35138272+0xMemoryGrinder@users.noreply.github.com> Date: Fri, 15 Sep 2023 00:59:59 -0400 Subject: [PATCH 065/325] refactor(solidity/linter/core): made function-max-lines use ast crate --- .../best_practises/function_max_lines.rs | 67 +++++++++---------- .../src/rules/best_practises/mod.rs | 9 ++- .../core/solidhunter-lib/src/rules/mod.rs | 1 + .../core/solidhunter-lib/src/rules/utils.rs | 21 ++++++ .../ContractNamePascalCase/.solidhunter.json | 12 ---- .../FunctionMaxLines/.solidhunter.json | 12 ++++ .../testdata/FunctionMaxLines/file.sol | 29 ++++++++ .../testdata/FunctionMaxLines/findings.csv | 1 + .../core/solidhunter-lib/tests/linter.rs | 6 +- 9 files changed, 102 insertions(+), 56 deletions(-) create mode 100644 toolchains/solidity/linter/core/solidhunter-lib/src/rules/utils.rs create mode 100644 toolchains/solidity/linter/core/solidhunter-lib/testdata/FunctionMaxLines/.solidhunter.json create mode 100644 toolchains/solidity/linter/core/solidhunter-lib/testdata/FunctionMaxLines/file.sol create mode 100644 toolchains/solidity/linter/core/solidhunter-lib/testdata/FunctionMaxLines/findings.csv diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/function_max_lines.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/function_max_lines.rs index a6980d9d..bee00885 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/function_max_lines.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/function_max_lines.rs @@ -1,9 +1,9 @@ +use ast_extractor::Spanned; + use crate::linter::SolidFile; use crate::rules::types::*; use crate::types::*; -/* - // const DEFAULT_SEVERITY: &str = "warn"; const DEFAULT_MESSAGE: &str = "Function contains too much lines"; @@ -19,9 +19,9 @@ impl RuleType for FunctionMaxLines { fn diagnose(&self, _file: &SolidFile, _files: &Vec) -> Vec { let mut res = Vec::new(); - let functions = get_all_functions_from_ast(&_file.data.nodes); + let functions = get_all_functions_from_ast(&_file.data); for function in functions { - let _report = check_function_lines(_file, Box::new(function), self.number_max_lines); + let _report = check_function_lines(_file, &function, self.number_max_lines); if let Some(report) = _report { res.push(LintDiag { id: Self::RULE_ID.to_string(), @@ -41,24 +41,19 @@ impl RuleType for FunctionMaxLines { // returns a struct containing the line number of the start and end of the function if it is too long fn check_function_lines( - _file: &SolidFile, - function: Box, + file: &SolidFile, + function: &ast_extractor::ItemFunction, nb_max_line: usize, ) -> Option { let mut res: Option = None; - let function_copy_name_location = &function.src; - let (_start, _) = decode_location(function_copy_name_location.as_str(), _file.content.as_str()); - let index = function_copy_name_location - .split(':') - .collect::>()[0] - .parse::() - .unwrap(); + let start_span = function.span().start(); + let index = crate::rules::utils::absolute_index_from_location(start_span, &file.content); let mut function_lines: usize = 0; let mut left_bracket: usize = 0; let mut right_bracket: usize = 0; let mut last_bracket_line: usize = 0; - for (_, c) in _file.content.chars().enumerate().skip(index) { + for (_, c) in file.content.chars().enumerate().skip(index) { if c == '{' { left_bracket += 1; } @@ -69,15 +64,15 @@ fn check_function_lines( function_lines += 1; } if right_bracket > 0 && left_bracket == right_bracket { - last_bracket_line = _start.line + function_lines; + last_bracket_line = start_span.line + function_lines; break; } } if function_lines > nb_max_line { res = Some(Range { start: Position { - line: _start.line as u64, - character: _start.column as u64, + line: start_span.line as u64, + character: start_span.column as u64, }, end: Position { line: last_bracket_line as u64, @@ -88,21 +83,19 @@ fn check_function_lines( res } -fn get_all_functions_from_ast(ast_nodes: &Vec) -> Vec { +fn get_all_functions_from_ast(ast_nodes: &ast_extractor::File) -> Vec { let mut res = Vec::new(); + let contract = ast_nodes + .items + .iter() + .filter_map(|item| match item { + ast_extractor::Item::Contract(contract) => Some(contract), + _ => None, + }) + .next(); - for node in ast_nodes { - let contract = match node { - SourceUnitChildNodes::ContractDefinition(contract) => contract, - _ => continue, - }; - for contract_node in &contract.nodes { - let function = match contract_node { - ContractDefinitionChildNodes::FunctionDefinition(function) => function, - _ => continue, - }; - res.push(*function.clone()); - } + if let Some(contract) = contract { + res = ast_extractor::retriever::retrieve_functions_nodes(contract); } res } @@ -111,11 +104,14 @@ impl FunctionMaxLines { pub(crate) const RULE_ID: &'static str = "function-max-lines"; pub fn create(data: RuleEntry) -> Box { - let max_number_lines = match data.data[0].parse::() { - Ok(v) => v, - Err(_) => DEFAULT_MAX_LINES, - }; - + let mut max_number_lines = DEFAULT_MAX_LINES; + + if data.data.len() > 0 { + max_number_lines = match data.data[0].parse::() { + Ok(v) => v, + Err(_) => DEFAULT_MAX_LINES, + }; + } let rule = FunctionMaxLines { number_max_lines: max_number_lines, _data: data, @@ -132,4 +128,3 @@ impl FunctionMaxLines { } } -*/ \ No newline at end of file diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/mod.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/mod.rs index eb53d044..63c87040 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/mod.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/mod.rs @@ -9,7 +9,7 @@ pub mod reason_string; // List all rules -// use crate::rules::best_practises::function_max_lines::FunctionMaxLines; +use crate::rules::best_practises::function_max_lines::FunctionMaxLines; use crate::rules::best_practises::line_maxlen::LineMaxLen; // use crate::rules::best_practises::max_states_count::MaxStatesCount; // use crate::rules::best_practises::reason_string::ReasonString; @@ -18,8 +18,7 @@ use crate::rules::RuleBuilder; pub fn create_default_rules() -> Vec { vec![ LineMaxLen::create_default(), - /* - MaxStatesCount::create_default(), +// MaxStatesCount::create_default(), FunctionMaxLines::create_default(), ReasonString::create_default(), */ @@ -31,8 +30,8 @@ pub fn create_rules() -> HashMap Box> { rules.insert(line_maxlen::RULE_ID.to_string(), LineMaxLen::create); - /* - rules.insert(MaxStatesCount::RULE_ID.to_string(), MaxStatesCount::create); + +// rules.insert(MaxStatesCount::RULE_ID.to_string(), MaxStatesCount::create); rules.insert( FunctionMaxLines::RULE_ID.to_string(), FunctionMaxLines::create, diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/mod.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/mod.rs index 30c3eef0..a8f8bc3a 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/mod.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/mod.rs @@ -4,6 +4,7 @@ use std::collections::HashMap; pub mod factory; pub mod rule_impl; pub mod types; +pub mod utils; // List all rules pub mod best_practises; diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/utils.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/utils.rs new file mode 100644 index 00000000..e637bcc7 --- /dev/null +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/utils.rs @@ -0,0 +1,21 @@ +use ast_extractor::LineColumn; + +pub fn absolute_index_from_location(location: LineColumn, content: &str) -> usize { + let mut index = 0; + let mut line = 1; + let mut column = 1; + + for c in content.chars() { + if line == location.line && column == location.column { + return index; + } + if c == '\n' { + line += 1; + column = 1; + } else { + column += 1; + } + index += 1; + } + index +} \ No newline at end of file diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/ContractNamePascalCase/.solidhunter.json b/toolchains/solidity/linter/core/solidhunter-lib/testdata/ContractNamePascalCase/.solidhunter.json index 464becc6..9871b2e8 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/testdata/ContractNamePascalCase/.solidhunter.json +++ b/toolchains/solidity/linter/core/solidhunter-lib/testdata/ContractNamePascalCase/.solidhunter.json @@ -3,18 +3,6 @@ "includes": [], "plugins": [], "rules": [ - { - "id": "line-max-len", - "severity": "WARNING", - "data": [ - "80" - ] - }, - { - "id": "quotes", - "severity": "ERROR", - "data": [] - }, { "id": "contract-name-pascalcase", "severity": "WARNING", diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/FunctionMaxLines/.solidhunter.json b/toolchains/solidity/linter/core/solidhunter-lib/testdata/FunctionMaxLines/.solidhunter.json new file mode 100644 index 00000000..9097ed1c --- /dev/null +++ b/toolchains/solidity/linter/core/solidhunter-lib/testdata/FunctionMaxLines/.solidhunter.json @@ -0,0 +1,12 @@ +{ + "name": "solidhunter", + "includes": [], + "plugins": [], + "rules": [ + { + "id": "function-max-lines", + "severity": "WARNING", + "data": [] + } + ] +} \ No newline at end of file diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/FunctionMaxLines/file.sol b/toolchains/solidity/linter/core/solidhunter-lib/testdata/FunctionMaxLines/file.sol new file mode 100644 index 00000000..54ae6076 --- /dev/null +++ b/toolchains/solidity/linter/core/solidhunter-lib/testdata/FunctionMaxLines/file.sol @@ -0,0 +1,29 @@ +pragma solidity 0.8.0; + +contract Test { + function test() { + uint a = 1; + uint b = 2; + uint c = 3; + uint d = 4; + uint e = 5; + uint f = 6; + uint g = 7; + uint h = 8; + uint i = 9; + uint j = 10; + uint k = 11; + uint l = 12; + uint m = 13; + uint n = 14; + uint o = 15; + uint p = 16; + uint q = 17; + uint r = 18; + uint s = 19; + uint t = 20; + uint u = 21; + uint v = 22; + + } +} \ No newline at end of file diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/FunctionMaxLines/findings.csv b/toolchains/solidity/linter/core/solidhunter-lib/testdata/FunctionMaxLines/findings.csv new file mode 100644 index 00000000..eb4ddda0 --- /dev/null +++ b/toolchains/solidity/linter/core/solidhunter-lib/testdata/FunctionMaxLines/findings.csv @@ -0,0 +1 @@ +function-max-lines:4:13:28:1 \ No newline at end of file diff --git a/toolchains/solidity/linter/core/solidhunter-lib/tests/linter.rs b/toolchains/solidity/linter/core/solidhunter-lib/tests/linter.rs index 750ba587..f38ba20d 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/tests/linter.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/tests/linter.rs @@ -88,7 +88,7 @@ macro_rules! test_directories { } test_directories! { - LineMaxLen, - ImportOnTop, - ContractNamePascalCase + ContractNamePascalCase, + FunctionMaxLines, + ImportOnTop } From e0c268df5a0995da5026185f162336f28679510f Mon Sep 17 00:00:00 2001 From: 0xMemoryGrinder <35138272+0xMemoryGrinder@users.noreply.github.com> Date: Fri, 15 Sep 2023 01:01:00 -0400 Subject: [PATCH 066/325] refactor(solidity/linter/core): max-states-count rule now uses ast crate --- .../rules/best_practises/max_states_count.rs | 37 +++++++++++-------- .../src/rules/best_practises/mod.rs | 14 +++---- .../testdata/MaxStatesCount/.solidhunter.json | 12 ++++++ .../testdata/MaxStatesCount/file.sol | 20 ++++++++++ .../testdata/MaxStatesCount/findings.csv | 1 + .../core/solidhunter-lib/tests/linter.rs | 3 +- 6 files changed, 63 insertions(+), 24 deletions(-) create mode 100644 toolchains/solidity/linter/core/solidhunter-lib/testdata/MaxStatesCount/.solidhunter.json create mode 100644 toolchains/solidity/linter/core/solidhunter-lib/testdata/MaxStatesCount/file.sol create mode 100644 toolchains/solidity/linter/core/solidhunter-lib/testdata/MaxStatesCount/findings.csv diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/max_states_count.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/max_states_count.rs index 5b1eeb16..71825232 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/max_states_count.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/max_states_count.rs @@ -1,8 +1,12 @@ use crate::linter::SolidFile; use crate::rules::types::*; use crate::types::*; +use ast_extractor::*; + + +pub const RULE_ID: &'static str = "max-states-count"; +const DEFAULT_MAX_STATES: usize = 15; -/* pub struct MaxStatesCount { max_states: usize, data: RuleEntry, @@ -12,11 +16,11 @@ impl MaxStatesCount { fn create_diag( &self, file: &SolidFile, - location: (CodeLocation, CodeLocation), + location: (LineColumn, LineColumn), count: usize, ) -> LintDiag { LintDiag { - id: Self::RULE_ID.to_string(), + id: RULE_ID.to_string(), range: Range { start: Position { line: location.0.line as u64, @@ -42,35 +46,39 @@ impl RuleType for MaxStatesCount { let mut res = Vec::new(); let mut count = 0; + let contracts = retriever::retrieve_contract_nodes(&file.data); // var def => contract def - for node in file.data.nodes.iter() { - let contract = match node { - SourceUnitChildNodes::ContractDefinition(contract) => contract, - _ => continue, - }; - for node_var in contract.nodes.iter() { + for contract in contracts.iter() { + for node_var in contract.body.iter() { let var = match node_var { - ContractDefinitionChildNodes::VariableDeclaration(var) => var, + Item::Variable(var) => var, _ => continue, }; count += 1; if count > self.max_states { - let location = decode_location(&var.src, &file.content); + let location = (var.span().start(), var.span().end()); res.push(self.create_diag(file, location, count)); } } } + println!("res: {:?}", res); res } } impl MaxStatesCount { - pub(crate) const RULE_ID: &'static str = "max-states-count"; pub(crate) fn create(data: RuleEntry) -> Box { + let mut max_states = DEFAULT_MAX_STATES; + if data.data.len() > 0 { + max_states = match data.data[0].parse::() { + Ok(v) => v, + Err(_) => DEFAULT_MAX_STATES, + }; + } let rule = MaxStatesCount { - max_states: data.data[0].parse::().unwrap(), + max_states, data, }; Box::new(rule) @@ -78,11 +86,10 @@ impl MaxStatesCount { pub(crate) fn create_default() -> RuleEntry { RuleEntry { - id: MaxStatesCount::RULE_ID.to_string(), + id: RULE_ID.to_string(), severity: Severity::WARNING, data: vec!["15".to_string()], } } } -*/ \ No newline at end of file diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/mod.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/mod.rs index 63c87040..0dd8233a 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/mod.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/mod.rs @@ -5,23 +5,22 @@ use std::collections::HashMap; pub mod line_maxlen; pub mod function_max_lines; pub mod max_states_count; -pub mod reason_string; +//pub mod reason_string; // List all rules use crate::rules::best_practises::function_max_lines::FunctionMaxLines; use crate::rules::best_practises::line_maxlen::LineMaxLen; -// use crate::rules::best_practises::max_states_count::MaxStatesCount; +use crate::rules::best_practises::max_states_count::MaxStatesCount; // use crate::rules::best_practises::reason_string::ReasonString; use crate::rules::RuleBuilder; pub fn create_default_rules() -> Vec { vec![ LineMaxLen::create_default(), -// MaxStatesCount::create_default(), + MaxStatesCount::create_default(), FunctionMaxLines::create_default(), - ReasonString::create_default(), - */ +// ReasonString::create_default(), ] } @@ -31,13 +30,12 @@ pub fn create_rules() -> HashMap Box> { rules.insert(line_maxlen::RULE_ID.to_string(), LineMaxLen::create); -// rules.insert(MaxStatesCount::RULE_ID.to_string(), MaxStatesCount::create); + rules.insert(max_states_count::RULE_ID.to_string(), MaxStatesCount::create); rules.insert( FunctionMaxLines::RULE_ID.to_string(), FunctionMaxLines::create, ); - rules.insert(reason_string::RULE_ID.to_string(), ReasonString::create); - */ +// rules.insert(reason_string::RULE_ID.to_string(), ReasonString::create); rules } diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/MaxStatesCount/.solidhunter.json b/toolchains/solidity/linter/core/solidhunter-lib/testdata/MaxStatesCount/.solidhunter.json new file mode 100644 index 00000000..9a520219 --- /dev/null +++ b/toolchains/solidity/linter/core/solidhunter-lib/testdata/MaxStatesCount/.solidhunter.json @@ -0,0 +1,12 @@ +{ + "name": "solidhunter", + "includes": [], + "plugins": [], + "rules": [ + { + "id": "max-states-count", + "severity": "WARNING", + "data": [] + } + ] +} \ No newline at end of file diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/MaxStatesCount/file.sol b/toolchains/solidity/linter/core/solidhunter-lib/testdata/MaxStatesCount/file.sol new file mode 100644 index 00000000..d7a4124d --- /dev/null +++ b/toolchains/solidity/linter/core/solidhunter-lib/testdata/MaxStatesCount/file.sol @@ -0,0 +1,20 @@ +pragma solidity 0.8.0; + +contract Test { + uint a = 1; + uint b = 2; + uint c = 3; + uint d = 4; + uint e = 5; + uint f = 6; + uint g = 7; + uint h = 8; + uint i = 9; + uint j = 10; + uint k = 11; + uint l = 12; + uint m = 13; + uint n = 14; + uint o = 15; + uint p = 16; +} \ No newline at end of file diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/MaxStatesCount/findings.csv b/toolchains/solidity/linter/core/solidhunter-lib/testdata/MaxStatesCount/findings.csv new file mode 100644 index 00000000..8969b615 --- /dev/null +++ b/toolchains/solidity/linter/core/solidhunter-lib/testdata/MaxStatesCount/findings.csv @@ -0,0 +1 @@ +max-states-count:19:4:19:16 \ No newline at end of file diff --git a/toolchains/solidity/linter/core/solidhunter-lib/tests/linter.rs b/toolchains/solidity/linter/core/solidhunter-lib/tests/linter.rs index f38ba20d..c9feb289 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/tests/linter.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/tests/linter.rs @@ -90,5 +90,6 @@ macro_rules! test_directories { test_directories! { ContractNamePascalCase, FunctionMaxLines, - ImportOnTop + ImportOnTop, + MaxStatesCount } From ee0ba07dfaa3ffeb92f2b30303b433e3a72b607e Mon Sep 17 00:00:00 2001 From: 0xtekgrinder <0xtekgrinder@protonmail.com> Date: Fri, 15 Sep 2023 01:12:34 -0400 Subject: [PATCH 067/325] refactor(solidity/linter/core): use LineColumn instead of Range --- .../rules/naming/contract_name_pascalcase.rs | 42 ++++++++++--------- 1 file changed, 22 insertions(+), 20 deletions(-) diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/contract_name_pascalcase.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/contract_name_pascalcase.rs index c8cd9b19..4a6cc9af 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/contract_name_pascalcase.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/contract_name_pascalcase.rs @@ -12,10 +12,23 @@ pub struct ContractNamePascalCase { } impl ContractNamePascalCase { - fn create_diag(&self, location: Range, file: &SolidFile) -> LintDiag { + fn create_diag( + &self, + location: (ast_extractor::LineColumn, ast_extractor::LineColumn), + file: &SolidFile, + ) -> LintDiag { LintDiag { id: RULE_ID.to_string(), - range: location, + range: Range { + start: Position { + line: location.0.line as u64, + character: location.0.column as u64, + }, + end: Position { + line: location.1.line as u64, + character: location.1.column as u64, + }, + }, message: MESSAGE.to_string(), severity: Some(self.data.severity), code: None, @@ -33,24 +46,13 @@ impl RuleType for ContractNamePascalCase { for contract in contracts { if (contract.name.as_string().chars().nth(0).unwrap() >= 'a' - && contract.name.as_string().chars().nth(0).unwrap() <= 'z') - || contract.name.as_string().contains('_') - || contract.name.as_string().contains('-') - { - res.push(self.create_diag({ - let location = contract.name.span(); - Range { - start: Position { - line: location.start().line as u64, - character: location.start().column as u64, - }, - end: Position { - line: location.end().line as u64, - character: location.end().column as u64, - }, - } - }, file)); - } + && contract.name.as_string().chars().nth(0).unwrap() <= 'z') + || contract.name.as_string().contains('_') + || contract.name.as_string().contains('-') + { + let span = contract.name.span(); + res.push(self.create_diag((span.start(), span.end()), file)); + } } res } From d745f20548f847fc9c2d33823dfb31293fa37efa Mon Sep 17 00:00:00 2001 From: 0xtekgrinder <0xtekgrinder@protonmail.com> Date: Fri, 15 Sep 2023 01:13:04 -0400 Subject: [PATCH 068/325] feat(solidity/linter/core): FunctionNameCamelCase rule with alloy --- .../src/rules/naming/func_name_camelcase.rs | 57 ++++++++----------- .../solidhunter-lib/src/rules/naming/mod.rs | 9 ++- .../solidhunter-lib/src/rules/rule_impl.rs | 7 ++- .../FunctionNameCamelCase/.solidhunter.json | 12 ++++ .../testdata/FunctionNameCamelCase/file.sol | 7 +++ .../FunctionNameCamelCase/findings.csv | 1 + .../core/solidhunter-lib/tests/linter.rs | 10 +++- 7 files changed, 61 insertions(+), 42 deletions(-) create mode 100644 toolchains/solidity/linter/core/solidhunter-lib/testdata/FunctionNameCamelCase/.solidhunter.json create mode 100644 toolchains/solidity/linter/core/solidhunter-lib/testdata/FunctionNameCamelCase/file.sol create mode 100644 toolchains/solidity/linter/core/solidhunter-lib/testdata/FunctionNameCamelCase/findings.csv diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/func_name_camelcase.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/func_name_camelcase.rs index f4815546..2017b9f2 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/func_name_camelcase.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/func_name_camelcase.rs @@ -1,17 +1,24 @@ +use ast_extractor::Spanned; + use crate::linter::SolidFile; use crate::rules::types::*; use crate::types::*; -/* +pub const RULE_ID: &str = "func-name-camelcase"; +const MESSAGE: &str = "Function name need to be in camel case"; pub struct FuncNameCamelCase { data: RuleEntry, } impl FuncNameCamelCase { - fn create_diag(&self, location: (CodeLocation, CodeLocation), file: &SolidFile) -> LintDiag { + fn create_diag( + &self, + location: (ast_extractor::LineColumn, ast_extractor::LineColumn), + file: &SolidFile, + ) -> LintDiag { LintDiag { - id: "func-name-camelcase".to_string(), + id: RULE_ID.to_string(), range: Range { start: Position { line: location.0.line as u64, @@ -22,7 +29,7 @@ impl FuncNameCamelCase { character: location.1.column as u64, }, }, - message: "Function name need to be in camel case".to_string(), + message: MESSAGE.to_string(), severity: Some(self.data.severity), code: None, source: None, @@ -35,36 +42,20 @@ impl FuncNameCamelCase { impl RuleType for FuncNameCamelCase { fn diagnose(&self, file: &SolidFile, _files: &Vec) -> Vec { let mut res = Vec::new(); + let contracts = ast_extractor::retriever::retrieve_contract_nodes(&file.data); - for node in &file.data.nodes { - match node { - SourceUnitChildNodes::ContractDefinition(contract) => { - for node in &contract.nodes { - match node { - ContractDefinitionChildNodes::FunctionDefinition(function) => { - if function.kind != FunctionDefinitionKind::Constructor - && (!(function.name.chars().nth(0).unwrap_or(' ') >= 'a' - && function.name.chars().nth(0).unwrap_or(' ') <= 'z') - || function.name.contains('_') - || function.name.contains('-')) - { - //Untested - let location = decode_location( - function.name_location.as_ref().unwrap(), - &file.content, - ); - res.push(self.create_diag(location, file)); - } - } - _ => { - continue; - } - } + for contract in contracts { + for function in ast_extractor::retriever::retrieve_functions_nodes(&contract) { + if let Some(name) = function.name { + if !(name.as_string().chars().nth(0).unwrap_or(' ') >= 'a' + && name.as_string().chars().nth(0).unwrap_or(' ') <= 'z') + || name.as_string().contains('_') + || name.as_string().contains('-') + { + let span = name.span(); + res.push(self.create_diag((span.start(), span.end()), file)); } } - _ => { - continue; - } } } res @@ -79,11 +70,9 @@ impl FuncNameCamelCase { pub(crate) fn create_default() -> RuleEntry { RuleEntry { - id: "func-name-camelcase".to_string(), + id: RULE_ID.to_string(), severity: Severity::WARNING, data: vec![], } } } - -*/ \ No newline at end of file diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/mod.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/mod.rs index 5c5de3c9..0bca8472 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/mod.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/mod.rs @@ -1,7 +1,7 @@ use crate::rules::naming::contract_name_pascalcase::ContractNamePascalCase; +use crate::rules::naming::func_name_camelcase::FuncNameCamelCase; /* -use crate::rules::naming::func_name_camelcase::FuncNameCamelCase; use crate::rules::naming::func_param_name_camelcase::FuncParamNameCamelcase; use crate::rules::naming::use_forbidden_name::UseForbiddenName; */ @@ -20,9 +20,9 @@ pub(crate) mod use_forbidden_name; pub fn create_default_rules() -> Vec { vec![ ContractNamePascalCase::create_default(), + FuncNameCamelCase::create_default(), /* FuncParamNameCamelcase::create_default(), - FuncNameCamelCase::create_default(), UseForbiddenName::create_default(), */ ] @@ -35,12 +35,15 @@ pub fn create_rules() -> HashMap Box> { contract_name_pascalcase::RULE_ID.to_string(), ContractNamePascalCase::create, ); + rules.insert( + func_name_camelcase::RULE_ID.to_string(), + FuncNameCamelCase::create, + ); /* rules.insert( "func-param-name-camelcase".to_string(), FuncParamNameCamelcase::create, ); - rules.insert("func-name-camelcase".to_string(), FuncNameCamelCase::create); rules.insert( UseForbiddenName::RULE_ID.to_string(), UseForbiddenName::create, diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/rule_impl.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/rule_impl.rs index ef52aa07..a8a36e3a 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/rule_impl.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/rule_impl.rs @@ -16,9 +16,10 @@ pub fn create_rules_file(path: &str) { pub fn parse_rules(path: &str) -> Result { if !std::path::Path::new(&path).is_file() { - return Err(SolidHunterError::IoError( - std::io::Error::new(std::io::ErrorKind::NotFound, "Rules file not found") - )); + return Err(SolidHunterError::IoError(std::io::Error::new( + std::io::ErrorKind::NotFound, + "Rules file not found", + ))); } let file = std::fs::read_to_string(path)?; let parsed: Rules = serde_json::from_str(&file)?; diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/FunctionNameCamelCase/.solidhunter.json b/toolchains/solidity/linter/core/solidhunter-lib/testdata/FunctionNameCamelCase/.solidhunter.json new file mode 100644 index 00000000..f623e561 --- /dev/null +++ b/toolchains/solidity/linter/core/solidhunter-lib/testdata/FunctionNameCamelCase/.solidhunter.json @@ -0,0 +1,12 @@ +{ + "name": "solidhunter", + "includes": [], + "plugins": [], + "rules": [ + { + "id": "func-name-camelcase", + "severity": "WARNING", + "data": [] + } + ] +} \ No newline at end of file diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/FunctionNameCamelCase/file.sol b/toolchains/solidity/linter/core/solidhunter-lib/testdata/FunctionNameCamelCase/file.sol new file mode 100644 index 00000000..de8ffdb7 --- /dev/null +++ b/toolchains/solidity/linter/core/solidhunter-lib/testdata/FunctionNameCamelCase/file.sol @@ -0,0 +1,7 @@ +pragma solidity 0.8.0; + +contract Test { + function test_shbs() public pure returns (uint) { + return 1; + } +} diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/FunctionNameCamelCase/findings.csv b/toolchains/solidity/linter/core/solidhunter-lib/testdata/FunctionNameCamelCase/findings.csv new file mode 100644 index 00000000..58982bcd --- /dev/null +++ b/toolchains/solidity/linter/core/solidhunter-lib/testdata/FunctionNameCamelCase/findings.csv @@ -0,0 +1 @@ +func-name-camelcase:4:13:4:22 \ No newline at end of file diff --git a/toolchains/solidity/linter/core/solidhunter-lib/tests/linter.rs b/toolchains/solidity/linter/core/solidhunter-lib/tests/linter.rs index c9feb289..7c989d52 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/tests/linter.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/tests/linter.rs @@ -55,7 +55,12 @@ fn test_linter(config: &str, source: &str, expected_findings: &Vec) { let result = linter.parse_file(String::from(source)); match result { Ok(diags) => { - assert_eq!(diags.len(), expected_findings.len(), "Wrong number of findings for {}", source); + assert_eq!( + diags.len(), + expected_findings.len(), + "Wrong number of findings for {}", + source + ); let mut found = false; for (_, diag) in diags.iter().enumerate() { @@ -91,5 +96,6 @@ test_directories! { ContractNamePascalCase, FunctionMaxLines, ImportOnTop, - MaxStatesCount + MaxStatesCount, + FunctionNameCamelCase } From 9fd70220de0cce6744f1b792abfbac393162d309 Mon Sep 17 00:00:00 2001 From: 0xtekgrinder <0xtekgrinder@protonmail.com> Date: Fri, 15 Sep 2023 15:20:37 -0400 Subject: [PATCH 069/325] feat(solidity/linter/core): func-param-camel-case rule --- .../rules/naming/func_param_name_camelcase.rs | 57 ++++++++----------- .../solidhunter-lib/src/rules/naming/mod.rs | 8 +-- .../.solidhunter.json | 12 ++++ .../FunctionParamNameCamelCase/file.sol | 7 +++ .../FunctionParamNameCamelCase/findings.csv | 1 + .../core/solidhunter-lib/tests/linter.rs | 3 +- 6 files changed, 49 insertions(+), 39 deletions(-) create mode 100644 toolchains/solidity/linter/core/solidhunter-lib/testdata/FunctionParamNameCamelCase/.solidhunter.json create mode 100644 toolchains/solidity/linter/core/solidhunter-lib/testdata/FunctionParamNameCamelCase/file.sol create mode 100644 toolchains/solidity/linter/core/solidhunter-lib/testdata/FunctionParamNameCamelCase/findings.csv diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/func_param_name_camelcase.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/func_param_name_camelcase.rs index 6fea45ad..1f617ea5 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/func_param_name_camelcase.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/func_param_name_camelcase.rs @@ -1,17 +1,23 @@ use crate::linter::SolidFile; use crate::rules::types::*; use crate::types::*; +use ast_extractor::Spanned; -/* +pub const RULE_ID: &str = "func-param-name-camelcase"; +const MESSAGE: &str = "Parameter name need to be in camel case"; pub struct FuncParamNameCamelcase { data: RuleEntry, } impl FuncParamNameCamelcase { - fn create_diag(&self, location: (CodeLocation, CodeLocation), file: &SolidFile) -> LintDiag { + fn create_diag( + &self, + location: (ast_extractor::LineColumn, ast_extractor::LineColumn), + file: &SolidFile, + ) -> LintDiag { LintDiag { - id: "func-param-name-camelcase".to_string(), + id: RULE_ID.to_string(), range: Range { start: Position { line: location.0.line as u64, @@ -22,7 +28,7 @@ impl FuncParamNameCamelcase { character: location.1.column as u64, }, }, - message: "Parameter name need to be in camel case".to_string(), + message: MESSAGE.to_string(), severity: Some(self.data.severity), code: None, source: None, @@ -35,37 +41,22 @@ impl FuncParamNameCamelcase { impl RuleType for FuncParamNameCamelcase { fn diagnose(&self, file: &SolidFile, _files: &Vec) -> Vec { let mut res = Vec::new(); + let contracts = ast_extractor::retriever::retrieve_contract_nodes(&file.data); - for node in &file.data.nodes { - match node { - SourceUnitChildNodes::ContractDefinition(contract) => { - for node in &contract.nodes { - match node { - ContractDefinitionChildNodes::FunctionDefinition(function) => { - for parameter in &function.parameters.parameters { - if !(parameter.name.chars().nth(0).unwrap() >= 'a' - && parameter.name.chars().nth(0).unwrap() <= 'z') - || parameter.name.contains('_') - || parameter.name.contains('-') - { - //Untested - let location = decode_location( - parameter.name_location.as_ref().unwrap(), - &file.content, - ); - res.push(self.create_diag(location, file)); - } - } - } - _ => { - continue; - } + for contract in contracts { + for function in ast_extractor::retriever::retrieve_functions_nodes(&contract) { + for arg in function.arguments.iter() { + if let Some(name) = &arg.name { + if !(name.as_string().chars().nth(0).unwrap() >= 'a' + && name.as_string().chars().nth(0).unwrap() <= 'z') + || name.as_string().contains('_') + || name.as_string().contains('-') + { + let span = name.span(); + res.push(self.create_diag((span.start(), span.end()), file)); } } } - _ => { - continue; - } } } res @@ -80,11 +71,9 @@ impl FuncParamNameCamelcase { pub(crate) fn create_default() -> RuleEntry { RuleEntry { - id: "func-param-name-camelcase".to_string(), + id: RULE_ID.to_string(), severity: Severity::WARNING, data: vec![], } } } - -*/ \ No newline at end of file diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/mod.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/mod.rs index 0bca8472..ee04c057 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/mod.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/mod.rs @@ -2,9 +2,9 @@ use crate::rules::naming::contract_name_pascalcase::ContractNamePascalCase; use crate::rules::naming::func_name_camelcase::FuncNameCamelCase; /* -use crate::rules::naming::func_param_name_camelcase::FuncParamNameCamelcase; use crate::rules::naming::use_forbidden_name::UseForbiddenName; */ +use crate::rules::naming::func_param_name_camelcase::FuncParamNameCamelcase; use crate::rules::types::{RuleEntry, RuleType}; use crate::rules::RuleBuilder; use std::collections::HashMap; @@ -21,8 +21,8 @@ pub fn create_default_rules() -> Vec { vec![ ContractNamePascalCase::create_default(), FuncNameCamelCase::create_default(), - /* FuncParamNameCamelcase::create_default(), + /* UseForbiddenName::create_default(), */ ] @@ -39,11 +39,11 @@ pub fn create_rules() -> HashMap Box> { func_name_camelcase::RULE_ID.to_string(), FuncNameCamelCase::create, ); - /* rules.insert( - "func-param-name-camelcase".to_string(), + func_param_name_camelcase::RULE_ID.to_string(), FuncParamNameCamelcase::create, ); + /* rules.insert( UseForbiddenName::RULE_ID.to_string(), UseForbiddenName::create, diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/FunctionParamNameCamelCase/.solidhunter.json b/toolchains/solidity/linter/core/solidhunter-lib/testdata/FunctionParamNameCamelCase/.solidhunter.json new file mode 100644 index 00000000..cc4a2a76 --- /dev/null +++ b/toolchains/solidity/linter/core/solidhunter-lib/testdata/FunctionParamNameCamelCase/.solidhunter.json @@ -0,0 +1,12 @@ +{ + "name": "solidhunter", + "includes": [], + "plugins": [], + "rules": [ + { + "id": "func-param-name-camelcase", + "severity": "WARNING", + "data": [] + } + ] +} \ No newline at end of file diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/FunctionParamNameCamelCase/file.sol b/toolchains/solidity/linter/core/solidhunter-lib/testdata/FunctionParamNameCamelCase/file.sol new file mode 100644 index 00000000..7399dec8 --- /dev/null +++ b/toolchains/solidity/linter/core/solidhunter-lib/testdata/FunctionParamNameCamelCase/file.sol @@ -0,0 +1,7 @@ +pragma solidity 0.8.0; + +contract Test { + function test(uint256 snake_case) public pure returns (uint256) { + return snake_case; + } +} diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/FunctionParamNameCamelCase/findings.csv b/toolchains/solidity/linter/core/solidhunter-lib/testdata/FunctionParamNameCamelCase/findings.csv new file mode 100644 index 00000000..2011650b --- /dev/null +++ b/toolchains/solidity/linter/core/solidhunter-lib/testdata/FunctionParamNameCamelCase/findings.csv @@ -0,0 +1 @@ +func-param-name-camelcase:4:26:4:36 \ No newline at end of file diff --git a/toolchains/solidity/linter/core/solidhunter-lib/tests/linter.rs b/toolchains/solidity/linter/core/solidhunter-lib/tests/linter.rs index 7c989d52..723e5588 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/tests/linter.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/tests/linter.rs @@ -97,5 +97,6 @@ test_directories! { FunctionMaxLines, ImportOnTop, MaxStatesCount, - FunctionNameCamelCase + FunctionNameCamelCase, + FunctionParamNameCamelCase } From ca53f87d08f48583fa29f4e1a496d8ba1f0f2988 Mon Sep 17 00:00:00 2001 From: 0xtekgrinder <0xtekgrinder@protonmail.com> Date: Fri, 15 Sep 2023 16:06:31 -0400 Subject: [PATCH 070/325] feat(solidity/linter/core): add UseForbiddenName rule with alloy --- .../solidhunter-lib/src/rules/naming/mod.rs | 10 +---- .../src/rules/naming/use_forbidden_name.rs | 41 ++++++++++--------- .../UseForbiddenName/.solidhunter.json | 12 ++++++ .../testdata/UseForbiddenName/file.sol | 7 ++++ .../testdata/UseForbiddenName/findings.csv | 3 ++ .../core/solidhunter-lib/tests/linter.rs | 3 +- 6 files changed, 48 insertions(+), 28 deletions(-) create mode 100644 toolchains/solidity/linter/core/solidhunter-lib/testdata/UseForbiddenName/.solidhunter.json create mode 100644 toolchains/solidity/linter/core/solidhunter-lib/testdata/UseForbiddenName/file.sol create mode 100644 toolchains/solidity/linter/core/solidhunter-lib/testdata/UseForbiddenName/findings.csv diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/mod.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/mod.rs index ee04c057..4248b2d7 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/mod.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/mod.rs @@ -1,10 +1,8 @@ use crate::rules::naming::contract_name_pascalcase::ContractNamePascalCase; use crate::rules::naming::func_name_camelcase::FuncNameCamelCase; -/* -use crate::rules::naming::use_forbidden_name::UseForbiddenName; -*/ use crate::rules::naming::func_param_name_camelcase::FuncParamNameCamelcase; +use crate::rules::naming::use_forbidden_name::UseForbiddenName; use crate::rules::types::{RuleEntry, RuleType}; use crate::rules::RuleBuilder; use std::collections::HashMap; @@ -22,9 +20,7 @@ pub fn create_default_rules() -> Vec { ContractNamePascalCase::create_default(), FuncNameCamelCase::create_default(), FuncParamNameCamelcase::create_default(), - /* UseForbiddenName::create_default(), - */ ] } @@ -43,12 +39,10 @@ pub fn create_rules() -> HashMap Box> { func_param_name_camelcase::RULE_ID.to_string(), FuncParamNameCamelcase::create, ); - /* rules.insert( - UseForbiddenName::RULE_ID.to_string(), + use_forbidden_name::RULE_ID.to_string(), UseForbiddenName::create, ); - */ rules } diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/use_forbidden_name.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/use_forbidden_name.rs index 46d3fb5b..2924f955 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/use_forbidden_name.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/use_forbidden_name.rs @@ -1,8 +1,10 @@ use crate::linter::SolidFile; use crate::rules::types::*; use crate::types::*; +use ast_extractor::Spanned; +use ast_extractor::*; -/* +pub const RULE_ID: &str = "use-forbidden-name"; pub struct UseForbiddenName { data: RuleEntry, @@ -11,12 +13,12 @@ pub struct UseForbiddenName { impl UseForbiddenName { fn create_diag( &self, - location: (CodeLocation, CodeLocation), - var: Box, file: &SolidFile, + location: (LineColumn, LineColumn), + name: &String, ) -> LintDiag { LintDiag { - id: "use-forbidden-name".to_string(), + id: RULE_ID.to_string(), range: Range { start: Position { line: location.0.line as u64, @@ -27,7 +29,7 @@ impl UseForbiddenName { character: location.1.column as u64, }, }, - message: format!("Forbidden variable name: {}", var.name), + message: format!("Forbidden variable name: {}", name), severity: Some(self.data.severity), code: None, source: None, @@ -42,16 +44,21 @@ impl RuleType for UseForbiddenName { let mut res = Vec::new(); let blacklist = ['I', 'l', 'O']; - let nodes = get_all_nodes_by_type(file.data.clone(), NodeType::VariableDeclaration); + let contracts = retriever::retrieve_contract_nodes(&file.data); - for node in nodes { - let var = match node { - Nodes::VariableDeclaration(var) => var, - _ => continue, - }; - if var.name.len() == 1 && blacklist.contains(&var.name.chars().next().unwrap()) { - let location = decode_location(&var.src, &file.content); - res.push(self.create_diag(location, var, file)); + // var def => contract def + for contract in contracts.iter() { + for node_var in contract.body.iter() { + let var = match node_var { + Item::Variable(var) => var, + _ => continue, + }; + if var.name.as_string().len() == 1 + && blacklist.contains(&var.name.as_string().chars().next().unwrap()) + { + let location = (var.name.span().start(), var.name.span().end()); + res.push(self.create_diag(file, location, &var.name.as_string())); + } } } res @@ -59,8 +66,6 @@ impl RuleType for UseForbiddenName { } impl UseForbiddenName { - pub const RULE_ID: &'static str = "use-forbidden-name"; - pub(crate) fn create(data: RuleEntry) -> Box { let rule = UseForbiddenName { data }; Box::new(rule) @@ -68,11 +73,9 @@ impl UseForbiddenName { pub(crate) fn create_default() -> RuleEntry { RuleEntry { - id: UseForbiddenName::RULE_ID.to_string(), + id: RULE_ID.to_string(), severity: Severity::WARNING, data: vec![], } } } - -*/ \ No newline at end of file diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/UseForbiddenName/.solidhunter.json b/toolchains/solidity/linter/core/solidhunter-lib/testdata/UseForbiddenName/.solidhunter.json new file mode 100644 index 00000000..0cbc855f --- /dev/null +++ b/toolchains/solidity/linter/core/solidhunter-lib/testdata/UseForbiddenName/.solidhunter.json @@ -0,0 +1,12 @@ +{ + "name": "solidhunter", + "includes": [], + "plugins": [], + "rules": [ + { + "id": "use-forbidden-name", + "severity": "WARNING", + "data": [] + } + ] +} \ No newline at end of file diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/UseForbiddenName/file.sol b/toolchains/solidity/linter/core/solidhunter-lib/testdata/UseForbiddenName/file.sol new file mode 100644 index 00000000..f99f3eab --- /dev/null +++ b/toolchains/solidity/linter/core/solidhunter-lib/testdata/UseForbiddenName/file.sol @@ -0,0 +1,7 @@ +pragma solidity 0.8.0; + +contract Test { + uint256 public I; + uint256 public l; + uint256 public O; +} \ No newline at end of file diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/UseForbiddenName/findings.csv b/toolchains/solidity/linter/core/solidhunter-lib/testdata/UseForbiddenName/findings.csv new file mode 100644 index 00000000..5f69d1f9 --- /dev/null +++ b/toolchains/solidity/linter/core/solidhunter-lib/testdata/UseForbiddenName/findings.csv @@ -0,0 +1,3 @@ +use-forbidden-name:4:19:4:20 +use-forbidden-name:5:19:5:20 +use-forbidden-name:5:19:5:20 \ No newline at end of file diff --git a/toolchains/solidity/linter/core/solidhunter-lib/tests/linter.rs b/toolchains/solidity/linter/core/solidhunter-lib/tests/linter.rs index 723e5588..f44e4517 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/tests/linter.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/tests/linter.rs @@ -98,5 +98,6 @@ test_directories! { ImportOnTop, MaxStatesCount, FunctionNameCamelCase, - FunctionParamNameCamelCase + FunctionParamNameCamelCase, + UseForbiddenName } From 9299e15dd1da0e9e9aefe44b486dc920a097e9cb Mon Sep 17 00:00:00 2001 From: EnergyCube Date: Sat, 16 Sep 2023 19:28:55 +0200 Subject: [PATCH 071/325] feat(solidity/linter/core): added WIP ReasonString rule with alloy --- .../src/rules/best_practises/mod.rs | 14 ++- .../src/rules/best_practises/reason_string.rs | 104 +++++++++--------- .../testdata/ReasonString/.solidhunter.json | 14 +++ .../testdata/ReasonString/file.sol | 13 +++ .../testdata/ReasonString/findings.csv | 2 + .../core/solidhunter-lib/tests/linter.rs | 1 + 6 files changed, 90 insertions(+), 58 deletions(-) create mode 100644 toolchains/solidity/linter/core/solidhunter-lib/testdata/ReasonString/.solidhunter.json create mode 100644 toolchains/solidity/linter/core/solidhunter-lib/testdata/ReasonString/file.sol create mode 100644 toolchains/solidity/linter/core/solidhunter-lib/testdata/ReasonString/findings.csv diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/mod.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/mod.rs index 0dd8233a..dc12d3de 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/mod.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/mod.rs @@ -5,14 +5,14 @@ use std::collections::HashMap; pub mod line_maxlen; pub mod function_max_lines; pub mod max_states_count; -//pub mod reason_string; +pub mod reason_string; // List all rules use crate::rules::best_practises::function_max_lines::FunctionMaxLines; use crate::rules::best_practises::line_maxlen::LineMaxLen; use crate::rules::best_practises::max_states_count::MaxStatesCount; -// use crate::rules::best_practises::reason_string::ReasonString; +use crate::rules::best_practises::reason_string::ReasonString; use crate::rules::RuleBuilder; pub fn create_default_rules() -> Vec { @@ -20,7 +20,7 @@ pub fn create_default_rules() -> Vec { LineMaxLen::create_default(), MaxStatesCount::create_default(), FunctionMaxLines::create_default(), -// ReasonString::create_default(), + ReasonString::create_default(), ] } @@ -29,13 +29,15 @@ pub fn create_rules() -> HashMap Box> { rules.insert(line_maxlen::RULE_ID.to_string(), LineMaxLen::create); - - rules.insert(max_states_count::RULE_ID.to_string(), MaxStatesCount::create); + rules.insert( + max_states_count::RULE_ID.to_string(), + MaxStatesCount::create, + ); rules.insert( FunctionMaxLines::RULE_ID.to_string(), FunctionMaxLines::create, ); -// rules.insert(reason_string::RULE_ID.to_string(), ReasonString::create); + rules.insert(reason_string::RULE_ID.to_string(), ReasonString::create); rules } diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/reason_string.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/reason_string.rs index 9921407b..b21b3b4e 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/reason_string.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/reason_string.rs @@ -1,8 +1,9 @@ +use ast_extractor::LineColumn; + use crate::linter::SolidFile; use crate::rules::types::{RuleEntry, RuleType}; use crate::types::{LintDiag, Position, Range, Severity}; -/* pub const RULE_ID: &str = "reason-string"; const DEFAULT_SEVERITY: Severity = Severity::WARNING; @@ -18,7 +19,7 @@ impl ReasonString { fn create_diag( &self, file: &SolidFile, - location: (CodeLocation, CodeLocation), + location: (LineColumn, LineColumn), message: String, ) -> LintDiag { LintDiag { @@ -47,54 +48,55 @@ impl RuleType for ReasonString { fn diagnose(&self, file: &SolidFile, _files: &Vec) -> Vec { let mut res = Vec::new(); - let nodes = get_all_nodes_by_type(file.data.clone(), NodeType::FunctionCall); - for i in &nodes { - match i { - utils::Nodes::FunctionCall(j) => match &j.expression { - Expression::Identifier(v) => { - if v.name == "require" { - if j.arguments.len() != 2 { - let location = decode_location(&j.src, &file.content); - res.push(self.create_diag(file, location, "reason-string: A require statement must have a reason string".to_string())); - } else { - for nj in &j.arguments { - match nj { - Expression::Literal(z) => { - if z.value.clone().unwrap().len() - > self.max_length as usize - { - let location = - decode_location(&z.src, &file.content); - res.push(self.create_diag(file, location, format!("reason-string: A revert statement must have a reason string of length less than {}", self.max_length))); - } - } - _ => {} - } - } - } - } else if v.name == "revert" { - if j.arguments.is_empty() { - let location = decode_location(&j.src, &file.content); - res.push(self.create_diag(file, location, "reason-string: A revert statement must have a reason string".to_string())); - } else { - match &j.arguments[0] { - Expression::Literal(z) => { - if z.value.clone().unwrap().len() > self.max_length as usize - { - let location = decode_location(&z.src, &file.content); - res.push(self.create_diag(file, location, format!("reason-string: A revert statement must have a reason string of length less than {}", self.max_length))); - } - } - _ => {} - } - } - } - } - _ => {} - }, - _ => {} - } - } + println!("debug"); + // let nodes = get_all_nodes_by_type(file.data.clone(), NodeType::FunctionCall); + // for i in &nodes { + // match i { + // utils::Nodes::FunctionCall(j) => match &j.expression { + // Expression::Identifier(v) => { + // if v.name == "require" { + // if j.arguments.len() != 2 { + // let location = decode_location(&j.src, &file.content); + // res.push(self.create_diag(file, location, "reason-string: A require statement must have a reason string".to_string())); + // } else { + // for nj in &j.arguments { + // match nj { + // Expression::Literal(z) => { + // if z.value.clone().unwrap().len() + // > self.max_length as usize + // { + // let location = + // decode_location(&z.src, &file.content); + // res.push(self.create_diag(file, location, format!("reason-string: A revert statement must have a reason string of length less than {}", self.max_length))); + // } + // } + // _ => {} + // } + // } + // } + // } else if v.name == "revert" { + // if j.arguments.is_empty() { + // let location = decode_location(&j.src, &file.content); + // res.push(self.create_diag(file, location, "reason-string: A revert statement must have a reason string".to_string())); + // } else { + // match &j.arguments[0] { + // Expression::Literal(z) => { + // if z.value.clone().unwrap().len() > self.max_length as usize + // { + // let location = decode_location(&z.src, &file.content); + // res.push(self.create_diag(file, location, format!("reason-string: A revert statement must have a reason string of length less than {}", self.max_length))); + // } + // } + // _ => {} + // } + // } + // } + // } + // _ => {} + // }, + // _ => {} + // } + // } res } } @@ -116,5 +118,3 @@ impl ReasonString { } } } - -*/ \ No newline at end of file diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/ReasonString/.solidhunter.json b/toolchains/solidity/linter/core/solidhunter-lib/testdata/ReasonString/.solidhunter.json new file mode 100644 index 00000000..20c03fed --- /dev/null +++ b/toolchains/solidity/linter/core/solidhunter-lib/testdata/ReasonString/.solidhunter.json @@ -0,0 +1,14 @@ +{ + "name": "solidhunter", + "includes": [], + "plugins": [], + "rules": [ + { + "id": "reason-string", + "severity": "WARNING", + "data": [ + "32" + ] + } + ] +} \ No newline at end of file diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/ReasonString/file.sol b/toolchains/solidity/linter/core/solidhunter-lib/testdata/ReasonString/file.sol new file mode 100644 index 00000000..44b09bf6 --- /dev/null +++ b/toolchains/solidity/linter/core/solidhunter-lib/testdata/ReasonString/file.sol @@ -0,0 +1,13 @@ +pragma solidity 0.8.0; + +contract Test { + function awesome() public { + require(!has(role, account), "This is perfect"); + } + function not_awesome() public { + require(!has(role, account), "This is not perfect at all because it's really too long but the code is 0xSwapFeeder compliant"); + } + function not_awesome_either() public { + require(!has(role, account)); + } +} \ No newline at end of file diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/ReasonString/findings.csv b/toolchains/solidity/linter/core/solidhunter-lib/testdata/ReasonString/findings.csv new file mode 100644 index 00000000..470a966f --- /dev/null +++ b/toolchains/solidity/linter/core/solidhunter-lib/testdata/ReasonString/findings.csv @@ -0,0 +1,2 @@ +reason-string:8:9:8:136 +reason-string:11:9:11:38 \ No newline at end of file diff --git a/toolchains/solidity/linter/core/solidhunter-lib/tests/linter.rs b/toolchains/solidity/linter/core/solidhunter-lib/tests/linter.rs index f44e4517..1c83886f 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/tests/linter.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/tests/linter.rs @@ -100,4 +100,5 @@ test_directories! { FunctionNameCamelCase, FunctionParamNameCamelCase, UseForbiddenName + ReasonString, } From e73f9ad456a2d70287e0663d132549fa12f8a165 Mon Sep 17 00:00:00 2001 From: EnergyCube Date: Sat, 16 Sep 2023 19:42:37 +0200 Subject: [PATCH 072/325] feat(solidhunter): fixed tests folder listing --- toolchains/solidity/linter/core/solidhunter-lib/tests/linter.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/toolchains/solidity/linter/core/solidhunter-lib/tests/linter.rs b/toolchains/solidity/linter/core/solidhunter-lib/tests/linter.rs index 1c83886f..8d6883f0 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/tests/linter.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/tests/linter.rs @@ -99,6 +99,6 @@ test_directories! { MaxStatesCount, FunctionNameCamelCase, FunctionParamNameCamelCase, - UseForbiddenName + UseForbiddenName, ReasonString, } From 9e4b69cdbfa25b28f4061330bb86690ad290fd0b Mon Sep 17 00:00:00 2001 From: EnergyCube Date: Sun, 17 Sep 2023 00:20:25 +0200 Subject: [PATCH 073/325] feat(solidity/linter/core): completed ReasonString rule with alloy --- .../src/rules/best_practises/reason_string.rs | 136 +++++++++++------- .../testdata/ReasonString/findings.csv | 4 +- 2 files changed, 88 insertions(+), 52 deletions(-) diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/reason_string.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/reason_string.rs index b21b3b4e..55e7858c 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/reason_string.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/reason_string.rs @@ -1,4 +1,4 @@ -use ast_extractor::LineColumn; +use ast_extractor::{ArgListImpl, Expr, FunctionBody, LineColumn, Stmt}; use crate::linter::SolidFile; use crate::rules::types::{RuleEntry, RuleType}; @@ -44,59 +44,95 @@ impl ReasonString { } } +fn get_all_functions_from_ast(ast_nodes: &ast_extractor::File) -> Vec { + let mut res = Vec::new(); + let contract = ast_nodes + .items + .iter() + .filter_map(|item| match item { + ast_extractor::Item::Contract(contract) => Some(contract), + _ => None, + }) + .next(); + + if let Some(contract) = contract { + res = ast_extractor::retriever::retrieve_functions_nodes(contract); + } + res +} + impl RuleType for ReasonString { fn diagnose(&self, file: &SolidFile, _files: &Vec) -> Vec { let mut res = Vec::new(); + let allfn = get_all_functions_from_ast(&file.data); + + for func in allfn { + if let FunctionBody::Block(fn_body) = func.body { + for stmt in fn_body.stmts { + if let Stmt::Expr(stmt_expr) = stmt { + if let Expr::Call(call_expr) = stmt_expr.expr { + let expr_require = match *call_expr.expr { + Expr::Ident(require_ident) => require_ident, + _ => continue, + }; + + if expr_require.as_string() != "require" + && expr_require.as_string() != "revert" + { + continue; + } + + let expr_args = match call_expr.args.list { + ArgListImpl::Named(_) => continue, + ArgListImpl::Unnamed(args) => args, + }; + + if let Some(expr_string) = expr_args.iter().find(|&x| { + if let Expr::Lit(lit) = x { + matches!(lit, ast_extractor::Lit::Str(_)) + } else { + false + } + }) { + if let Expr::Lit(lit_string) = expr_string { + if let ast_extractor::Lit::Str(lit_str) = lit_string { + let actual_string = lit_str.values[0].token().to_string(); + + if actual_string.len() > self.max_length as usize { + let location = ( + lit_str.values[0].span().start(), + lit_str.values[0].span().end(), + ); + res.push( + self.create_diag( + file, + location, + format!( + "reason-string: A revert statement must have a reason string of length less than {}", + self.max_length + ), + ), + ); + } + } + } + } else { + let location = + (expr_require.0.span().start(), expr_require.0.span().end()); + res.push( + self.create_diag( + file, + location, + "reason-string: A require statement must have a reason string".to_string(), + ), + ); + } + } + } + } + } + } - println!("debug"); - // let nodes = get_all_nodes_by_type(file.data.clone(), NodeType::FunctionCall); - // for i in &nodes { - // match i { - // utils::Nodes::FunctionCall(j) => match &j.expression { - // Expression::Identifier(v) => { - // if v.name == "require" { - // if j.arguments.len() != 2 { - // let location = decode_location(&j.src, &file.content); - // res.push(self.create_diag(file, location, "reason-string: A require statement must have a reason string".to_string())); - // } else { - // for nj in &j.arguments { - // match nj { - // Expression::Literal(z) => { - // if z.value.clone().unwrap().len() - // > self.max_length as usize - // { - // let location = - // decode_location(&z.src, &file.content); - // res.push(self.create_diag(file, location, format!("reason-string: A revert statement must have a reason string of length less than {}", self.max_length))); - // } - // } - // _ => {} - // } - // } - // } - // } else if v.name == "revert" { - // if j.arguments.is_empty() { - // let location = decode_location(&j.src, &file.content); - // res.push(self.create_diag(file, location, "reason-string: A revert statement must have a reason string".to_string())); - // } else { - // match &j.arguments[0] { - // Expression::Literal(z) => { - // if z.value.clone().unwrap().len() > self.max_length as usize - // { - // let location = decode_location(&z.src, &file.content); - // res.push(self.create_diag(file, location, format!("reason-string: A revert statement must have a reason string of length less than {}", self.max_length))); - // } - // } - // _ => {} - // } - // } - // } - // } - // _ => {} - // }, - // _ => {} - // } - // } res } } diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/ReasonString/findings.csv b/toolchains/solidity/linter/core/solidhunter-lib/testdata/ReasonString/findings.csv index 470a966f..abf94805 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/testdata/ReasonString/findings.csv +++ b/toolchains/solidity/linter/core/solidhunter-lib/testdata/ReasonString/findings.csv @@ -1,2 +1,2 @@ -reason-string:8:9:8:136 -reason-string:11:9:11:38 \ No newline at end of file +reason-string:8:37:8:133 +reason-string:11:8:11:15 \ No newline at end of file From f199786f22359eef3efad462c0ac6a19949c21a8 Mon Sep 17 00:00:00 2001 From: 0xSwapFeeder Date: Wed, 20 Sep 2023 14:34:08 -0400 Subject: [PATCH 074/325] chore(solidity/linter): created a get_call_expressions custom visitor --- .../src/rules/best_practises/reason_string.rs | 135 +++++++++--------- 1 file changed, 70 insertions(+), 65 deletions(-) diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/reason_string.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/reason_string.rs index 55e7858c..3eaeae96 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/reason_string.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/reason_string.rs @@ -1,4 +1,4 @@ -use ast_extractor::{ArgListImpl, Expr, FunctionBody, LineColumn, Stmt}; +use ast_extractor::*; use crate::linter::SolidFile; use crate::rules::types::{RuleEntry, RuleType}; @@ -44,8 +44,9 @@ impl ReasonString { } } -fn get_all_functions_from_ast(ast_nodes: &ast_extractor::File) -> Vec { +fn get_call_expressions(ast_nodes: &ast_extractor::File) -> Vec { let mut res = Vec::new(); + let mut calls: Vec = Vec::new(); let contract = ast_nodes .items .iter() @@ -58,78 +59,82 @@ fn get_all_functions_from_ast(ast_nodes: &ast_extractor::File) -> Vec) -> Vec { let mut res = Vec::new(); - let allfn = get_all_functions_from_ast(&file.data); - - for func in allfn { - if let FunctionBody::Block(fn_body) = func.body { - for stmt in fn_body.stmts { - if let Stmt::Expr(stmt_expr) = stmt { - if let Expr::Call(call_expr) = stmt_expr.expr { - let expr_require = match *call_expr.expr { - Expr::Ident(require_ident) => require_ident, - _ => continue, - }; - - if expr_require.as_string() != "require" - && expr_require.as_string() != "revert" - { - continue; - } - - let expr_args = match call_expr.args.list { - ArgListImpl::Named(_) => continue, - ArgListImpl::Unnamed(args) => args, - }; - - if let Some(expr_string) = expr_args.iter().find(|&x| { - if let Expr::Lit(lit) = x { - matches!(lit, ast_extractor::Lit::Str(_)) - } else { - false - } - }) { - if let Expr::Lit(lit_string) = expr_string { - if let ast_extractor::Lit::Str(lit_str) = lit_string { - let actual_string = lit_str.values[0].token().to_string(); - - if actual_string.len() > self.max_length as usize { - let location = ( - lit_str.values[0].span().start(), - lit_str.values[0].span().end(), - ); - res.push( - self.create_diag( - file, - location, - format!( - "reason-string: A revert statement must have a reason string of length less than {}", - self.max_length - ), - ), - ); - } - } - } - } else { - let location = - (expr_require.0.span().start(), expr_require.0.span().end()); - res.push( - self.create_diag( - file, - location, - "reason-string: A require statement must have a reason string".to_string(), - ), + let calls = get_call_expressions(&file.data); + + for call_expr in calls { + let expr_require = match *call_expr.expr { + Expr::Ident(require_ident) => require_ident, + _ => continue, + }; + + if expr_require.as_string() != "require" + && expr_require.as_string() != "revert" + { + continue; + } + + let expr_args = match call_expr.args.list { + ArgListImpl::Named(_) => continue, + ArgListImpl::Unnamed(args) => args, + }; + + if let Some(expr_string) = expr_args.iter().find(|&x| { + if let Expr::Lit(lit) = x { + matches!(lit, ast_extractor::Lit::Str(_)) + } else { + false + } + }) { + if let Expr::Lit(lit_string) = expr_string { + if let ast_extractor::Lit::Str(lit_str) = lit_string { + let actual_string = lit_str.values[0].token().to_string(); + + if actual_string.len() > self.max_length as usize { + let location = ( + lit_str.values[0].span().start(), + lit_str.values[0].span().end(), ); - } + res.push( + self.create_diag( + file, + location, + format!( + "reason-string: A revert statement must have a reason string of length less than {}", + self.max_length + ), + ), + ); } } } + } else { + let location = + (expr_require.0.span().start(), expr_require.0.span().end()); + res.push( + self.create_diag( + file, + location, + "reason-string: A require statement must have a reason string".to_string(), + ), + ); } } From 8a941da9d5aac9d574b67a85289aef2b483634d4 Mon Sep 17 00:00:00 2001 From: 0xtekgrinder <0xtekgrinder@protonmail.com> Date: Wed, 20 Sep 2023 14:40:37 -0400 Subject: [PATCH 075/325] refactor(solidity/linter/core): fix lcippy warnings and change u64 to usize --- .../linter/core/solidhunter-lib/src/lib.rs | 2 +- .../linter/core/solidhunter-lib/src/linter.rs | 12 +---- .../best_practises/function_max_lines.rs | 20 ++++---- .../src/rules/best_practises/line_maxlen.rs | 10 ++-- .../rules/best_practises/max_states_count.rs | 22 +++----- .../src/rules/best_practises/mod.rs | 6 +-- .../src/rules/best_practises/reason_string.rs | 50 ++++++++----------- .../core/solidhunter-lib/src/rules/factory.rs | 2 +- .../src/rules/miscellaneous/mod.rs | 4 +- .../src/rules/miscellaneous/quotes.rs | 16 +++--- .../core/solidhunter-lib/src/rules/mod.rs | 4 +- .../rules/naming/contract_name_pascalcase.rs | 10 ++-- .../src/rules/naming/func_name_camelcase.rs | 10 ++-- .../rules/naming/func_param_name_camelcase.rs | 10 ++-- .../solidhunter-lib/src/rules/naming/mod.rs | 4 +- .../src/rules/naming/use_forbidden_name.rs | 10 ++-- .../src/rules/order/import_on_top.rs | 29 +++++------ .../solidhunter-lib/src/rules/order/mod.rs | 4 +- .../core/solidhunter-lib/src/rules/types.rs | 5 +- .../core/solidhunter-lib/src/rules/utils.rs | 2 +- .../linter/core/solidhunter-lib/src/types.rs | 20 ++++---- .../core/solidhunter-lib/tests/linter.rs | 8 +-- 22 files changed, 121 insertions(+), 139 deletions(-) diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/lib.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/lib.rs index 460aae37..7a833d6f 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/lib.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/lib.rs @@ -1,4 +1,4 @@ pub mod error; pub mod linter; pub mod rules; -pub mod types; \ No newline at end of file +pub mod types; diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/linter.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/linter.rs index aa63991f..323f5f84 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/linter.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/linter.rs @@ -83,11 +83,7 @@ impl SolidLinter { let content = fs::read_to_string(filepath.clone())?; let res = ast_extractor::extract::extract_ast_from_content(&content)?; - self._add_file( - filepath.as_str(), - res, - &content.as_str(), - ); + self._add_file(filepath.as_str(), res, content.as_str()); let mut res: Vec = Vec::new(); for rule in &self.rules { @@ -100,11 +96,7 @@ impl SolidLinter { pub fn parse_content(&mut self, filepath: String, content: &String) -> LintResult { let res = ast_extractor::extract::extract_ast_from_content(content)?; - self._add_file( - filepath.as_str(), - res, - content.as_str(), - ); + self._add_file(filepath.as_str(), res, content.as_str()); let mut res: Vec = Vec::new(); for rule in &self.rules { diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/function_max_lines.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/function_max_lines.rs index bee00885..c40f1e17 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/function_max_lines.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/function_max_lines.rs @@ -6,6 +6,7 @@ use crate::types::*; // const DEFAULT_SEVERITY: &str = "warn"; const DEFAULT_MESSAGE: &str = "Function contains too much lines"; +pub const RULE_ID: &str = "function-max-lines"; // specific pub const DEFAULT_MAX_LINES: usize = 20; @@ -16,7 +17,7 @@ pub struct FunctionMaxLines { } impl RuleType for FunctionMaxLines { - fn diagnose(&self, _file: &SolidFile, _files: &Vec) -> Vec { + fn diagnose(&self, _file: &SolidFile, _files: &[SolidFile]) -> Vec { let mut res = Vec::new(); let functions = get_all_functions_from_ast(&_file.data); @@ -24,7 +25,7 @@ impl RuleType for FunctionMaxLines { let _report = check_function_lines(_file, &function, self.number_max_lines); if let Some(report) = _report { res.push(LintDiag { - id: Self::RULE_ID.to_string(), + id: RULE_ID.to_string(), range: report, severity: Some(Severity::WARNING), code: None, @@ -71,11 +72,11 @@ fn check_function_lines( if function_lines > nb_max_line { res = Some(Range { start: Position { - line: start_span.line as u64, - character: start_span.column as u64, + line: start_span.line, + character: start_span.column, }, end: Position { - line: last_bracket_line as u64, + line: last_bracket_line, character: 1, }, }); @@ -101,12 +102,10 @@ fn get_all_functions_from_ast(ast_nodes: &ast_extractor::File) -> Vec Box { let mut max_number_lines = DEFAULT_MAX_LINES; - - if data.data.len() > 0 { + + if !data.data.is_empty() { max_number_lines = match data.data[0].parse::() { Ok(v) => v, Err(_) => DEFAULT_MAX_LINES, @@ -121,10 +120,9 @@ impl FunctionMaxLines { pub fn create_default() -> RuleEntry { RuleEntry { - id: FunctionMaxLines::RULE_ID.to_string(), + id: RULE_ID.to_string(), severity: Severity::WARNING, data: vec![DEFAULT_MAX_LINES.to_string()], } } } - diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/line_maxlen.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/line_maxlen.rs index 3085df0a..4af03e1b 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/line_maxlen.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/line_maxlen.rs @@ -16,12 +16,12 @@ impl LineMaxLen { LintDiag { range: Range { start: Position { - line: line_idx as u64, - character: self.max_len as u64, + line: line_idx, + character: self.max_len, }, end: Position { - line: line_idx as u64, - character: line.len() as u64, + line: line_idx, + character: line.len(), }, }, id: RULE_ID.to_string(), @@ -36,7 +36,7 @@ impl LineMaxLen { } impl RuleType for LineMaxLen { - fn diagnose(&self, file: &SolidFile, _files: &Vec) -> Vec { + fn diagnose(&self, file: &SolidFile, _files: &[SolidFile]) -> Vec { let mut res = Vec::new(); let mut line_idx = 1; diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/max_states_count.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/max_states_count.rs index 71825232..17e5385a 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/max_states_count.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/max_states_count.rs @@ -3,8 +3,7 @@ use crate::rules::types::*; use crate::types::*; use ast_extractor::*; - -pub const RULE_ID: &'static str = "max-states-count"; +pub const RULE_ID: &str = "max-states-count"; const DEFAULT_MAX_STATES: usize = 15; pub struct MaxStatesCount { @@ -23,12 +22,12 @@ impl MaxStatesCount { id: RULE_ID.to_string(), range: Range { start: Position { - line: location.0.line as u64, - character: location.0.column as u64, + line: location.0.line, + character: location.0.column, }, end: Position { - line: location.1.line as u64, - character: location.1.column as u64, + line: location.1.line, + character: location.1.column, }, }, message: format!("Too many states: {}", count), @@ -42,7 +41,7 @@ impl MaxStatesCount { } impl RuleType for MaxStatesCount { - fn diagnose(&self, file: &SolidFile, _files: &Vec) -> Vec { + fn diagnose(&self, file: &SolidFile, _files: &[SolidFile]) -> Vec { let mut res = Vec::new(); let mut count = 0; @@ -68,19 +67,15 @@ impl RuleType for MaxStatesCount { } impl MaxStatesCount { - pub(crate) fn create(data: RuleEntry) -> Box { let mut max_states = DEFAULT_MAX_STATES; - if data.data.len() > 0 { + if !data.data.is_empty() { max_states = match data.data[0].parse::() { Ok(v) => v, Err(_) => DEFAULT_MAX_STATES, }; } - let rule = MaxStatesCount { - max_states, - data, - }; + let rule = MaxStatesCount { max_states, data }; Box::new(rule) } @@ -92,4 +87,3 @@ impl MaxStatesCount { } } } - diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/mod.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/mod.rs index dc12d3de..3991bee1 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/mod.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/mod.rs @@ -1,4 +1,4 @@ -use crate::rules::types::{RuleEntry, RuleType}; +use crate::rules::types::{RuleEntry, RulesMap}; use std::collections::HashMap; #[macro_use] @@ -24,7 +24,7 @@ pub fn create_default_rules() -> Vec { ] } -pub fn create_rules() -> HashMap Box> { +pub fn create_rules() -> RulesMap { let mut rules: HashMap = HashMap::new(); rules.insert(line_maxlen::RULE_ID.to_string(), LineMaxLen::create); @@ -34,7 +34,7 @@ pub fn create_rules() -> HashMap Box> { MaxStatesCount::create, ); rules.insert( - FunctionMaxLines::RULE_ID.to_string(), + function_max_lines::RULE_ID.to_string(), FunctionMaxLines::create, ); rules.insert(reason_string::RULE_ID.to_string(), ReasonString::create); diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/reason_string.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/reason_string.rs index 3eaeae96..0a0b832a 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/reason_string.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/reason_string.rs @@ -26,12 +26,12 @@ impl ReasonString { id: RULE_ID.to_string(), range: Range { start: Position { - line: location.0.line as u64, - character: location.0.column as u64, + line: location.0.line, + character: location.0.column, }, end: Position { - line: location.1.line as u64, - character: location.1.column as u64, + line: location.1.line, + character: location.1.column, }, }, message, @@ -67,7 +67,6 @@ fn get_call_expressions(ast_nodes: &ast_extractor::File) -> Vec { calls.push(call_expr); } } - } } } @@ -75,7 +74,7 @@ fn get_call_expressions(ast_nodes: &ast_extractor::File) -> Vec { } impl RuleType for ReasonString { - fn diagnose(&self, file: &SolidFile, _files: &Vec) -> Vec { + fn diagnose(&self, file: &SolidFile, _files: &[SolidFile]) -> Vec { let mut res = Vec::new(); let calls = get_call_expressions(&file.data); @@ -85,9 +84,7 @@ impl RuleType for ReasonString { _ => continue, }; - if expr_require.as_string() != "require" - && expr_require.as_string() != "revert" - { + if expr_require.as_string() != "require" && expr_require.as_string() != "revert" { continue; } @@ -103,16 +100,15 @@ impl RuleType for ReasonString { false } }) { - if let Expr::Lit(lit_string) = expr_string { - if let ast_extractor::Lit::Str(lit_str) = lit_string { - let actual_string = lit_str.values[0].token().to_string(); - - if actual_string.len() > self.max_length as usize { - let location = ( - lit_str.values[0].span().start(), - lit_str.values[0].span().end(), - ); - res.push( + if let Expr::Lit(ast_extractor::Lit::Str(lit_str)) = expr_string { + let actual_string = lit_str.values[0].token().to_string(); + + if actual_string.len() > self.max_length as usize { + let location = ( + lit_str.values[0].span().start(), + lit_str.values[0].span().end(), + ); + res.push( self.create_diag( file, location, @@ -122,19 +118,15 @@ impl RuleType for ReasonString { ), ), ); - } } } } else { - let location = - (expr_require.0.span().start(), expr_require.0.span().end()); - res.push( - self.create_diag( - file, - location, - "reason-string: A require statement must have a reason string".to_string(), - ), - ); + let location = (expr_require.0.span().start(), expr_require.0.span().end()); + res.push(self.create_diag( + file, + location, + "reason-string: A require statement must have a reason string".to_string(), + )); } } diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/factory.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/factory.rs index 0e94596a..d0ee4f32 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/factory.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/factory.rs @@ -3,7 +3,7 @@ use crate::rules::types::*; use std::collections::HashMap; pub struct RuleFactory { - _buildables: HashMap Box>, + _buildables: RulesMap, _rules: Vec>, } diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/miscellaneous/mod.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/miscellaneous/mod.rs index a2ff21c0..df11a6e4 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/miscellaneous/mod.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/miscellaneous/mod.rs @@ -1,4 +1,4 @@ -use crate::rules::types::{RuleEntry, RuleType}; +use crate::rules::types::{RuleEntry, RulesMap}; use std::collections::HashMap; #[macro_use] @@ -13,7 +13,7 @@ pub fn create_default_rules() -> Vec { vec![Quotes::create_default()] } -pub fn create_rules() -> HashMap Box> { +pub fn create_rules() -> RulesMap { let mut rules: HashMap = HashMap::new(); rules.insert("quotes".to_string(), Quotes::create); diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/miscellaneous/quotes.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/miscellaneous/quotes.rs index 270cbc29..ab04500f 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/miscellaneous/quotes.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/miscellaneous/quotes.rs @@ -2,25 +2,27 @@ use crate::linter::SolidFile; use crate::rules::types::*; use crate::types::*; +pub const RULE_ID: &str = "quotes"; + pub struct Quotes { data: RuleEntry, } impl Quotes { - fn create_diag(&self, file: &SolidFile, idx: usize, line_idx: u64) -> LintDiag { + fn create_diag(&self, file: &SolidFile, idx: usize, line_idx: usize) -> LintDiag { LintDiag { - id: "quotes".to_string(), + id: RULE_ID.to_string(), range: Range { start: Position { line: line_idx, - character: idx as u64, + character: idx, }, end: Position { line: line_idx, - character: idx as u64, + character: idx, }, }, - message: format!("Use double quotes instead of single quote"), + message: "Use double quotes instead of single quote".to_string(), severity: Some(self.data.severity), code: None, source: None, @@ -31,7 +33,7 @@ impl Quotes { } impl RuleType for Quotes { - fn diagnose(&self, file: &SolidFile, _files: &Vec) -> Vec { + fn diagnose(&self, file: &SolidFile, _files: &[SolidFile]) -> Vec { let mut res = Vec::new(); let mut line_idx = 1; @@ -55,7 +57,7 @@ impl Quotes { pub(crate) fn create_default() -> RuleEntry { RuleEntry { - id: "quotes".to_string(), + id: RULE_ID.to_string(), severity: Severity::ERROR, data: vec![], } diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/mod.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/mod.rs index a8f8bc3a..22f2c202 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/mod.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/mod.rs @@ -1,4 +1,4 @@ -use crate::rules::types::{RuleEntry, RuleType}; +use crate::rules::types::{RuleEntry, RuleType, RulesMap}; use std::collections::HashMap; pub mod factory; @@ -31,7 +31,7 @@ pub fn add_rules(rules: &mut HashMap, to_add: HashMap HashMap Box> { +pub fn create_rules() -> RulesMap { let mut rules = HashMap::new(); add_rules(&mut rules, best_practises::create_rules()); diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/contract_name_pascalcase.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/contract_name_pascalcase.rs index 4a6cc9af..1fdabe06 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/contract_name_pascalcase.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/contract_name_pascalcase.rs @@ -21,12 +21,12 @@ impl ContractNamePascalCase { id: RULE_ID.to_string(), range: Range { start: Position { - line: location.0.line as u64, - character: location.0.column as u64, + line: location.0.line, + character: location.0.column, }, end: Position { - line: location.1.line as u64, - character: location.1.column as u64, + line: location.1.line, + character: location.1.column, }, }, message: MESSAGE.to_string(), @@ -40,7 +40,7 @@ impl ContractNamePascalCase { } impl RuleType for ContractNamePascalCase { - fn diagnose(&self, file: &SolidFile, _files: &Vec) -> Vec { + fn diagnose(&self, file: &SolidFile, _files: &[SolidFile]) -> Vec { let mut res = Vec::new(); let contracts = ast_extractor::retriever::retrieve_contract_nodes(&file.data); diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/func_name_camelcase.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/func_name_camelcase.rs index 2017b9f2..8ae09d81 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/func_name_camelcase.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/func_name_camelcase.rs @@ -21,12 +21,12 @@ impl FuncNameCamelCase { id: RULE_ID.to_string(), range: Range { start: Position { - line: location.0.line as u64, - character: location.0.column as u64, + line: location.0.line, + character: location.0.column, }, end: Position { - line: location.1.line as u64, - character: location.1.column as u64, + line: location.1.line, + character: location.1.column, }, }, message: MESSAGE.to_string(), @@ -40,7 +40,7 @@ impl FuncNameCamelCase { } impl RuleType for FuncNameCamelCase { - fn diagnose(&self, file: &SolidFile, _files: &Vec) -> Vec { + fn diagnose(&self, file: &SolidFile, _files: &[SolidFile]) -> Vec { let mut res = Vec::new(); let contracts = ast_extractor::retriever::retrieve_contract_nodes(&file.data); diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/func_param_name_camelcase.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/func_param_name_camelcase.rs index 1f617ea5..abf5e77a 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/func_param_name_camelcase.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/func_param_name_camelcase.rs @@ -20,12 +20,12 @@ impl FuncParamNameCamelcase { id: RULE_ID.to_string(), range: Range { start: Position { - line: location.0.line as u64, - character: location.0.column as u64, + line: location.0.line, + character: location.0.column, }, end: Position { - line: location.1.line as u64, - character: location.1.column as u64, + line: location.1.line, + character: location.1.column, }, }, message: MESSAGE.to_string(), @@ -39,7 +39,7 @@ impl FuncParamNameCamelcase { } impl RuleType for FuncParamNameCamelcase { - fn diagnose(&self, file: &SolidFile, _files: &Vec) -> Vec { + fn diagnose(&self, file: &SolidFile, _files: &[SolidFile]) -> Vec { let mut res = Vec::new(); let contracts = ast_extractor::retriever::retrieve_contract_nodes(&file.data); diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/mod.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/mod.rs index 4248b2d7..94654601 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/mod.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/mod.rs @@ -3,7 +3,7 @@ use crate::rules::naming::func_name_camelcase::FuncNameCamelCase; use crate::rules::naming::func_param_name_camelcase::FuncParamNameCamelcase; use crate::rules::naming::use_forbidden_name::UseForbiddenName; -use crate::rules::types::{RuleEntry, RuleType}; +use crate::rules::types::{RuleEntry, RulesMap}; use crate::rules::RuleBuilder; use std::collections::HashMap; @@ -24,7 +24,7 @@ pub fn create_default_rules() -> Vec { ] } -pub fn create_rules() -> HashMap Box> { +pub fn create_rules() -> RulesMap { let mut rules: HashMap = HashMap::new(); rules.insert( diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/use_forbidden_name.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/use_forbidden_name.rs index 2924f955..80436ed5 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/use_forbidden_name.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/use_forbidden_name.rs @@ -21,12 +21,12 @@ impl UseForbiddenName { id: RULE_ID.to_string(), range: Range { start: Position { - line: location.0.line as u64, - character: location.0.column as u64, + line: location.0.line, + character: location.0.column, }, end: Position { - line: location.1.line as u64, - character: location.1.column as u64, + line: location.1.line, + character: location.1.column, }, }, message: format!("Forbidden variable name: {}", name), @@ -40,7 +40,7 @@ impl UseForbiddenName { } impl RuleType for UseForbiddenName { - fn diagnose(&self, file: &SolidFile, _files: &Vec) -> Vec { + fn diagnose(&self, file: &SolidFile, _files: &[SolidFile]) -> Vec { let mut res = Vec::new(); let blacklist = ['I', 'l', 'O']; diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/order/import_on_top.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/order/import_on_top.rs index d7757d40..0931330f 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/order/import_on_top.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/order/import_on_top.rs @@ -12,15 +12,19 @@ pub struct ImportOnTop { } impl ImportOnTop { - fn create_diag(&self, file: &SolidFile, location: (ast_extractor::LineColumn, ast_extractor::LineColumn)) -> LintDiag { - let mut range = Range { + fn create_diag( + &self, + file: &SolidFile, + location: (ast_extractor::LineColumn, ast_extractor::LineColumn), + ) -> LintDiag { + let range = Range { start: Position { - line: location.0.line as u64, - character: location.0.column as u64, + line: location.0.line, + character: location.0.column, }, end: Position { - line: location.1.line as u64, - character: location.1.column as u64, + line: location.1.line, + character: location.1.column, }, }; LintDiag { @@ -37,7 +41,7 @@ impl ImportOnTop { } impl RuleType for ImportOnTop { - fn diagnose(&self, file: &SolidFile, _files: &Vec) -> Vec { + fn diagnose(&self, file: &SolidFile, _files: &[SolidFile]) -> Vec { let mut res = Vec::new(); let mut last_import_location = 0; @@ -53,14 +57,11 @@ impl RuleType for ImportOnTop { } for i in 1..file.data.items.len() { - match &file.data.items[i] { - ast_extractor::Item::Import(import) => { - if i > last_import_location { - let location = (import.span().start(), import.span().end()); - res.push(self.create_diag(file, location)); - } + if let ast_extractor::Item::Import(import) = &file.data.items[i] { + if i > last_import_location { + let location = (import.span().start(), import.span().end()); + res.push(self.create_diag(file, location)); } - _ => {} } } diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/order/mod.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/order/mod.rs index e9b8017d..a22ad358 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/order/mod.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/order/mod.rs @@ -1,4 +1,4 @@ -use crate::rules::types::{RuleEntry, RuleType}; +use crate::rules::types::{RuleEntry, RulesMap}; use std::collections::HashMap; #[macro_use] @@ -12,7 +12,7 @@ pub fn create_default_rules() -> Vec { vec![ImportOnTop::create_default()] } -pub fn create_rules() -> HashMap Box> { +pub fn create_rules() -> RulesMap { let mut rules: HashMap = HashMap::new(); rules.insert(import_on_top::RULE_ID.to_string(), ImportOnTop::create); diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/types.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/types.rs index 722e547f..f18dedcf 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/types.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/types.rs @@ -1,6 +1,7 @@ use crate::linter::SolidFile; use crate::types::*; use serde::{Deserialize, Serialize}; +use std::collections::HashMap; #[derive(Serialize, Deserialize, Debug)] pub struct RuleEntry { @@ -18,5 +19,7 @@ pub struct Rules { } pub trait RuleType: Send + Sync + 'static { - fn diagnose(&self, file: &SolidFile, files: &Vec) -> Vec; + fn diagnose(&self, file: &SolidFile, files: &[SolidFile]) -> Vec; } + +pub type RulesMap = HashMap Box>; diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/utils.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/utils.rs index e637bcc7..5377471d 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/utils.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/utils.rs @@ -18,4 +18,4 @@ pub fn absolute_index_from_location(location: LineColumn, content: &str) -> usiz index += 1; } index -} \ No newline at end of file +} diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/types.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/types.rs index 8b8ea3fd..d69d1cd8 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/types.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/types.rs @@ -59,7 +59,7 @@ impl fmt::Display for LintDiag { let line = self .source_file_content .lines() - .nth((self.range.start.line - 1) as usize) + .nth(self.range.start.line - 1) .unwrap(); write!( @@ -73,8 +73,8 @@ impl fmt::Display for LintDiag { self.range.start.line, padding, line, - " ".repeat(self.range.start.character as usize), - "^".repeat(self.range.compute_length(line) as usize) + " ".repeat(self.range.start.character), + "^".repeat(self.range.compute_length(line)) ) } } @@ -91,8 +91,8 @@ impl PartialEq for Position { #[derive(Clone, Serialize, Deserialize, Debug)] pub struct Position { - pub line: u64, - pub character: u64, + pub line: usize, + pub character: usize, } #[derive(PartialEq, Eq, Clone, Copy, Serialize, Deserialize, Debug)] @@ -115,7 +115,7 @@ pub struct Range { impl Range { // Compue the number of characters between the start and end of the range - pub fn compute_length(&self, content: &str) -> u64 { + pub fn compute_length(&self, content: &str) -> usize { if self.start.line == self.end.line { self.end.character - self.start.character } else { @@ -123,13 +123,13 @@ impl Range { let mut line = self.start.line; let mut character = self.start.character; while line < self.end.line { - let line_content = content.lines().nth(line as usize - 1).unwrap(); - length += line_content.len() + 1 - character as usize; + let line_content = content.lines().nth(line - 1).unwrap(); + length += line_content.len() + 1 - character; line += 1; character = 0; } - length += self.end.character as usize - character as usize; - length as u64 + length += self.end.character - character; + length } } } diff --git a/toolchains/solidity/linter/core/solidhunter-lib/tests/linter.rs b/toolchains/solidity/linter/core/solidhunter-lib/tests/linter.rs index 8d6883f0..4bd2aaa3 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/tests/linter.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/tests/linter.rs @@ -32,12 +32,12 @@ fn test_directory(base_name: &str) { let splitted_line: Vec<&str> = line.split(':').collect(); expected_findings.push(Finding { start: Position { - line: splitted_line[1].parse::().unwrap(), - character: splitted_line[2].parse::().unwrap(), + line: splitted_line[1].parse::().unwrap(), + character: splitted_line[2].parse::().unwrap(), }, end: Position { - line: splitted_line[3].parse::().unwrap(), - character: splitted_line[4].parse::().unwrap(), + line: splitted_line[3].parse::().unwrap(), + character: splitted_line[4].parse::().unwrap(), }, id: splitted_line[0].to_string(), }); From 593a1755845a67dcb612dcfda6ca6bc8e0b87f07 Mon Sep 17 00:00:00 2001 From: 0xtekgrinder <0xtekgrinder@protonmail.com> Date: Wed, 20 Sep 2023 15:00:50 -0400 Subject: [PATCH 076/325] refactor(solidity/linter/core): rename error into errors --- .../linter/core/solidhunter-lib/src/{error.rs => errors.rs} | 0 toolchains/solidity/linter/core/solidhunter-lib/src/lib.rs | 2 +- .../solidity/linter/core/solidhunter-lib/src/rules/rule_impl.rs | 2 +- toolchains/solidity/linter/core/solidhunter-lib/src/types.rs | 2 +- 4 files changed, 3 insertions(+), 3 deletions(-) rename toolchains/solidity/linter/core/solidhunter-lib/src/{error.rs => errors.rs} (100%) diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/error.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/errors.rs similarity index 100% rename from toolchains/solidity/linter/core/solidhunter-lib/src/error.rs rename to toolchains/solidity/linter/core/solidhunter-lib/src/errors.rs diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/lib.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/lib.rs index 7a833d6f..5e557edc 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/lib.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/lib.rs @@ -1,4 +1,4 @@ -pub mod error; +pub mod errors; pub mod linter; pub mod rules; pub mod types; diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/rule_impl.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/rule_impl.rs index a8a36e3a..e049745b 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/rule_impl.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/rule_impl.rs @@ -1,4 +1,4 @@ -use crate::error::SolidHunterError; +use crate::errors::SolidHunterError; use crate::rules::create_default_rules; use crate::rules::types::*; diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/types.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/types.rs index d69d1cd8..df542d36 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/types.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/types.rs @@ -1,4 +1,4 @@ -use crate::error::SolidHunterError; +use crate::errors::SolidHunterError; use colored::Colorize; use serde::{Deserialize, Serialize}; use std::fmt; From 53d29fb680bf2c29118cd32d7c03313ed7add5c4 Mon Sep 17 00:00:00 2001 From: 0xtekgrinder <0xtekgrinder@protonmail.com> Date: Wed, 20 Sep 2023 15:03:53 -0400 Subject: [PATCH 077/325] feat(solidity/linter/core): add missing directory in tests --- toolchains/solidity/linter/core/solidhunter-lib/tests/linter.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/toolchains/solidity/linter/core/solidhunter-lib/tests/linter.rs b/toolchains/solidity/linter/core/solidhunter-lib/tests/linter.rs index 4bd2aaa3..618fc090 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/tests/linter.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/tests/linter.rs @@ -96,6 +96,7 @@ test_directories! { ContractNamePascalCase, FunctionMaxLines, ImportOnTop, + LineMaxLen, MaxStatesCount, FunctionNameCamelCase, FunctionParamNameCamelCase, From e7b691a36639b5128c4c41dc18bc7435e902d112 Mon Sep 17 00:00:00 2001 From: 0xtekgrinder <0xtekgrinder@protonmail.com> Date: Wed, 20 Sep 2023 17:50:15 -0400 Subject: [PATCH 078/325] fix(solidity.linter/core): can parse a folder --- .../linter/core/solidhunter-lib/src/linter.rs | 4 +- .../rules/best_practises/max_states_count.rs | 2 - .../src/rules/miscellaneous/mod.rs | 16 +---- .../src/rules/miscellaneous/quotes.rs | 65 ------------------- .../src/rules/naming/use_forbidden_name.rs | 1 - .../linter/core/solidhunter-lib/src/types.rs | 4 +- 6 files changed, 6 insertions(+), 86 deletions(-) delete mode 100644 toolchains/solidity/linter/core/solidhunter-lib/src/rules/miscellaneous/quotes.rs diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/linter.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/linter.rs index 323f5f84..3bfb0a07 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/linter.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/linter.rs @@ -87,7 +87,7 @@ impl SolidLinter { let mut res: Vec = Vec::new(); for rule in &self.rules { - let mut diags = rule.diagnose(&self.files[0], &self.files); + let mut diags = rule.diagnose(&self.files[self.files.len() - 1], &self.files); res.append(&mut diags); } Ok(res) @@ -100,7 +100,7 @@ impl SolidLinter { let mut res: Vec = Vec::new(); for rule in &self.rules { - let mut diags = rule.diagnose(&self.files[0], &self.files); + let mut diags = rule.diagnose(&self.files[self.files.len() - 1], &self.files); res.append(&mut diags); } Ok(res) diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/max_states_count.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/max_states_count.rs index 17e5385a..c8f615fe 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/max_states_count.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/max_states_count.rs @@ -47,7 +47,6 @@ impl RuleType for MaxStatesCount { let mut count = 0; let contracts = retriever::retrieve_contract_nodes(&file.data); - // var def => contract def for contract in contracts.iter() { for node_var in contract.body.iter() { let var = match node_var { @@ -61,7 +60,6 @@ impl RuleType for MaxStatesCount { } } } - println!("res: {:?}", res); res } } diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/miscellaneous/mod.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/miscellaneous/mod.rs index df11a6e4..b6a377f2 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/miscellaneous/mod.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/miscellaneous/mod.rs @@ -1,22 +1,10 @@ use crate::rules::types::{RuleEntry, RulesMap}; use std::collections::HashMap; -#[macro_use] -pub mod quotes; - -// List all rules - -use crate::rules::miscellaneous::quotes::Quotes; -use crate::rules::RuleBuilder; - pub fn create_default_rules() -> Vec { - vec![Quotes::create_default()] + vec![] } pub fn create_rules() -> RulesMap { - let mut rules: HashMap = HashMap::new(); - - rules.insert("quotes".to_string(), Quotes::create); - - rules + HashMap::new() } diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/miscellaneous/quotes.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/miscellaneous/quotes.rs deleted file mode 100644 index ab04500f..00000000 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/miscellaneous/quotes.rs +++ /dev/null @@ -1,65 +0,0 @@ -use crate::linter::SolidFile; -use crate::rules::types::*; -use crate::types::*; - -pub const RULE_ID: &str = "quotes"; - -pub struct Quotes { - data: RuleEntry, -} - -impl Quotes { - fn create_diag(&self, file: &SolidFile, idx: usize, line_idx: usize) -> LintDiag { - LintDiag { - id: RULE_ID.to_string(), - range: Range { - start: Position { - line: line_idx, - character: idx, - }, - end: Position { - line: line_idx, - character: idx, - }, - }, - message: "Use double quotes instead of single quote".to_string(), - severity: Some(self.data.severity), - code: None, - source: None, - uri: file.path.clone(), - source_file_content: file.content.clone(), - } - } -} - -impl RuleType for Quotes { - fn diagnose(&self, file: &SolidFile, _files: &[SolidFile]) -> Vec { - let mut res = Vec::new(); - let mut line_idx = 1; - - for line in file.content.lines() { - line.chars().enumerate().for_each(|(idx, c)| { - if c == '\'' && line.chars().nth(idx - 1).unwrap_or(' ') != '\\' { - res.push(self.create_diag(file, idx, line_idx)); - } - }); - line_idx += 1; - } - res - } -} - -impl Quotes { - pub(crate) fn create(data: RuleEntry) -> Box { - let rule = Quotes { data }; - Box::new(rule) - } - - pub(crate) fn create_default() -> RuleEntry { - RuleEntry { - id: RULE_ID.to_string(), - severity: Severity::ERROR, - data: vec![], - } - } -} diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/use_forbidden_name.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/use_forbidden_name.rs index 80436ed5..260aa857 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/use_forbidden_name.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/use_forbidden_name.rs @@ -1,7 +1,6 @@ use crate::linter::SolidFile; use crate::rules::types::*; use crate::types::*; -use ast_extractor::Spanned; use ast_extractor::*; pub const RULE_ID: &str = "use-forbidden-name"; diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/types.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/types.rs index df542d36..f5195b0e 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/types.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/types.rs @@ -74,7 +74,7 @@ impl fmt::Display for LintDiag { padding, line, " ".repeat(self.range.start.character), - "^".repeat(self.range.compute_length(line)) + "^".repeat(self.range.compute_length(self.source_file_content.as_str())) ) } } @@ -114,7 +114,7 @@ pub struct Range { } impl Range { - // Compue the number of characters between the start and end of the range + // Compute the number of characters between the start and end of the range pub fn compute_length(&self, content: &str) -> usize { if self.start.line == self.end.line { self.end.character - self.start.character From 4221e90c34ec4f64c2eee19ed873890e944cc73b Mon Sep 17 00:00:00 2001 From: 0xtekgrinder <0xtekgrinder@protonmail.com> Date: Wed, 20 Sep 2023 17:52:25 -0400 Subject: [PATCH 079/325] tests(solidity/linter/core): add all rules to be sure everything works good --- .../ContractNamePascalCase/.solidhunter.json | 48 +++++++++++++++++++ .../FunctionMaxLines/.solidhunter.json | 48 +++++++++++++++++++ .../FunctionNameCamelCase/.solidhunter.json | 48 +++++++++++++++++++ .../.solidhunter.json | 48 +++++++++++++++++++ .../testdata/ImportOnTop/.solidhunter.json | 48 +++++++++++++++++++ .../testdata/LineMaxLen/.solidhunter.json | 46 ++++++++++++++++++ .../testdata/MaxStatesCount/.solidhunter.json | 48 +++++++++++++++++++ .../testdata/MaxStatesCount/file.sol | 2 +- .../testdata/ReasonString/.solidhunter.json | 46 ++++++++++++++++++ .../testdata/ReasonString/file.sol | 6 +-- .../UseForbiddenName/.solidhunter.json | 48 +++++++++++++++++++ 11 files changed, 432 insertions(+), 4 deletions(-) diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/ContractNamePascalCase/.solidhunter.json b/toolchains/solidity/linter/core/solidhunter-lib/testdata/ContractNamePascalCase/.solidhunter.json index 9871b2e8..6cc3dcc2 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/testdata/ContractNamePascalCase/.solidhunter.json +++ b/toolchains/solidity/linter/core/solidhunter-lib/testdata/ContractNamePascalCase/.solidhunter.json @@ -3,10 +3,58 @@ "includes": [], "plugins": [], "rules": [ + { + "id": "line-max-len", + "severity": "WARNING", + "data": [ + "80" + ] + }, + { + "id": "max-states-count", + "severity": "WARNING", + "data": [ + "15" + ] + }, + { + "id": "function-max-lines", + "severity": "WARNING", + "data": [ + "20" + ] + }, + { + "id": "reason-string", + "severity": "WARNING", + "data": [ + "32" + ] + }, { "id": "contract-name-pascalcase", "severity": "WARNING", "data": [] + }, + { + "id": "func-name-camelcase", + "severity": "WARNING", + "data": [] + }, + { + "id": "func-param-name-camelcase", + "severity": "WARNING", + "data": [] + }, + { + "id": "use-forbidden-name", + "severity": "WARNING", + "data": [] + }, + { + "id": "import-on-top", + "severity": "WARNING", + "data": [] } ] } \ No newline at end of file diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/FunctionMaxLines/.solidhunter.json b/toolchains/solidity/linter/core/solidhunter-lib/testdata/FunctionMaxLines/.solidhunter.json index 9097ed1c..6cc3dcc2 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/testdata/FunctionMaxLines/.solidhunter.json +++ b/toolchains/solidity/linter/core/solidhunter-lib/testdata/FunctionMaxLines/.solidhunter.json @@ -3,9 +3,57 @@ "includes": [], "plugins": [], "rules": [ + { + "id": "line-max-len", + "severity": "WARNING", + "data": [ + "80" + ] + }, + { + "id": "max-states-count", + "severity": "WARNING", + "data": [ + "15" + ] + }, { "id": "function-max-lines", "severity": "WARNING", + "data": [ + "20" + ] + }, + { + "id": "reason-string", + "severity": "WARNING", + "data": [ + "32" + ] + }, + { + "id": "contract-name-pascalcase", + "severity": "WARNING", + "data": [] + }, + { + "id": "func-name-camelcase", + "severity": "WARNING", + "data": [] + }, + { + "id": "func-param-name-camelcase", + "severity": "WARNING", + "data": [] + }, + { + "id": "use-forbidden-name", + "severity": "WARNING", + "data": [] + }, + { + "id": "import-on-top", + "severity": "WARNING", "data": [] } ] diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/FunctionNameCamelCase/.solidhunter.json b/toolchains/solidity/linter/core/solidhunter-lib/testdata/FunctionNameCamelCase/.solidhunter.json index f623e561..6cc3dcc2 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/testdata/FunctionNameCamelCase/.solidhunter.json +++ b/toolchains/solidity/linter/core/solidhunter-lib/testdata/FunctionNameCamelCase/.solidhunter.json @@ -3,10 +3,58 @@ "includes": [], "plugins": [], "rules": [ + { + "id": "line-max-len", + "severity": "WARNING", + "data": [ + "80" + ] + }, + { + "id": "max-states-count", + "severity": "WARNING", + "data": [ + "15" + ] + }, + { + "id": "function-max-lines", + "severity": "WARNING", + "data": [ + "20" + ] + }, + { + "id": "reason-string", + "severity": "WARNING", + "data": [ + "32" + ] + }, + { + "id": "contract-name-pascalcase", + "severity": "WARNING", + "data": [] + }, { "id": "func-name-camelcase", "severity": "WARNING", "data": [] + }, + { + "id": "func-param-name-camelcase", + "severity": "WARNING", + "data": [] + }, + { + "id": "use-forbidden-name", + "severity": "WARNING", + "data": [] + }, + { + "id": "import-on-top", + "severity": "WARNING", + "data": [] } ] } \ No newline at end of file diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/FunctionParamNameCamelCase/.solidhunter.json b/toolchains/solidity/linter/core/solidhunter-lib/testdata/FunctionParamNameCamelCase/.solidhunter.json index cc4a2a76..6cc3dcc2 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/testdata/FunctionParamNameCamelCase/.solidhunter.json +++ b/toolchains/solidity/linter/core/solidhunter-lib/testdata/FunctionParamNameCamelCase/.solidhunter.json @@ -3,10 +3,58 @@ "includes": [], "plugins": [], "rules": [ + { + "id": "line-max-len", + "severity": "WARNING", + "data": [ + "80" + ] + }, + { + "id": "max-states-count", + "severity": "WARNING", + "data": [ + "15" + ] + }, + { + "id": "function-max-lines", + "severity": "WARNING", + "data": [ + "20" + ] + }, + { + "id": "reason-string", + "severity": "WARNING", + "data": [ + "32" + ] + }, + { + "id": "contract-name-pascalcase", + "severity": "WARNING", + "data": [] + }, + { + "id": "func-name-camelcase", + "severity": "WARNING", + "data": [] + }, { "id": "func-param-name-camelcase", "severity": "WARNING", "data": [] + }, + { + "id": "use-forbidden-name", + "severity": "WARNING", + "data": [] + }, + { + "id": "import-on-top", + "severity": "WARNING", + "data": [] } ] } \ No newline at end of file diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/ImportOnTop/.solidhunter.json b/toolchains/solidity/linter/core/solidhunter-lib/testdata/ImportOnTop/.solidhunter.json index 3f5b34e6..6cc3dcc2 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/testdata/ImportOnTop/.solidhunter.json +++ b/toolchains/solidity/linter/core/solidhunter-lib/testdata/ImportOnTop/.solidhunter.json @@ -3,6 +3,54 @@ "includes": [], "plugins": [], "rules": [ + { + "id": "line-max-len", + "severity": "WARNING", + "data": [ + "80" + ] + }, + { + "id": "max-states-count", + "severity": "WARNING", + "data": [ + "15" + ] + }, + { + "id": "function-max-lines", + "severity": "WARNING", + "data": [ + "20" + ] + }, + { + "id": "reason-string", + "severity": "WARNING", + "data": [ + "32" + ] + }, + { + "id": "contract-name-pascalcase", + "severity": "WARNING", + "data": [] + }, + { + "id": "func-name-camelcase", + "severity": "WARNING", + "data": [] + }, + { + "id": "func-param-name-camelcase", + "severity": "WARNING", + "data": [] + }, + { + "id": "use-forbidden-name", + "severity": "WARNING", + "data": [] + }, { "id": "import-on-top", "severity": "WARNING", diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/LineMaxLen/.solidhunter.json b/toolchains/solidity/linter/core/solidhunter-lib/testdata/LineMaxLen/.solidhunter.json index 4fd69780..6cc3dcc2 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/testdata/LineMaxLen/.solidhunter.json +++ b/toolchains/solidity/linter/core/solidhunter-lib/testdata/LineMaxLen/.solidhunter.json @@ -9,6 +9,52 @@ "data": [ "80" ] + }, + { + "id": "max-states-count", + "severity": "WARNING", + "data": [ + "15" + ] + }, + { + "id": "function-max-lines", + "severity": "WARNING", + "data": [ + "20" + ] + }, + { + "id": "reason-string", + "severity": "WARNING", + "data": [ + "32" + ] + }, + { + "id": "contract-name-pascalcase", + "severity": "WARNING", + "data": [] + }, + { + "id": "func-name-camelcase", + "severity": "WARNING", + "data": [] + }, + { + "id": "func-param-name-camelcase", + "severity": "WARNING", + "data": [] + }, + { + "id": "use-forbidden-name", + "severity": "WARNING", + "data": [] + }, + { + "id": "import-on-top", + "severity": "WARNING", + "data": [] } ] } \ No newline at end of file diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/MaxStatesCount/.solidhunter.json b/toolchains/solidity/linter/core/solidhunter-lib/testdata/MaxStatesCount/.solidhunter.json index 9a520219..6cc3dcc2 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/testdata/MaxStatesCount/.solidhunter.json +++ b/toolchains/solidity/linter/core/solidhunter-lib/testdata/MaxStatesCount/.solidhunter.json @@ -3,9 +3,57 @@ "includes": [], "plugins": [], "rules": [ + { + "id": "line-max-len", + "severity": "WARNING", + "data": [ + "80" + ] + }, { "id": "max-states-count", "severity": "WARNING", + "data": [ + "15" + ] + }, + { + "id": "function-max-lines", + "severity": "WARNING", + "data": [ + "20" + ] + }, + { + "id": "reason-string", + "severity": "WARNING", + "data": [ + "32" + ] + }, + { + "id": "contract-name-pascalcase", + "severity": "WARNING", + "data": [] + }, + { + "id": "func-name-camelcase", + "severity": "WARNING", + "data": [] + }, + { + "id": "func-param-name-camelcase", + "severity": "WARNING", + "data": [] + }, + { + "id": "use-forbidden-name", + "severity": "WARNING", + "data": [] + }, + { + "id": "import-on-top", + "severity": "WARNING", "data": [] } ] diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/MaxStatesCount/file.sol b/toolchains/solidity/linter/core/solidhunter-lib/testdata/MaxStatesCount/file.sol index d7a4124d..a82ad086 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/testdata/MaxStatesCount/file.sol +++ b/toolchains/solidity/linter/core/solidhunter-lib/testdata/MaxStatesCount/file.sol @@ -12,7 +12,7 @@ contract Test { uint i = 9; uint j = 10; uint k = 11; - uint l = 12; + uint z = 12; uint m = 13; uint n = 14; uint o = 15; diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/ReasonString/.solidhunter.json b/toolchains/solidity/linter/core/solidhunter-lib/testdata/ReasonString/.solidhunter.json index 20c03fed..6cc3dcc2 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/testdata/ReasonString/.solidhunter.json +++ b/toolchains/solidity/linter/core/solidhunter-lib/testdata/ReasonString/.solidhunter.json @@ -3,12 +3,58 @@ "includes": [], "plugins": [], "rules": [ + { + "id": "line-max-len", + "severity": "WARNING", + "data": [ + "80" + ] + }, + { + "id": "max-states-count", + "severity": "WARNING", + "data": [ + "15" + ] + }, + { + "id": "function-max-lines", + "severity": "WARNING", + "data": [ + "20" + ] + }, { "id": "reason-string", "severity": "WARNING", "data": [ "32" ] + }, + { + "id": "contract-name-pascalcase", + "severity": "WARNING", + "data": [] + }, + { + "id": "func-name-camelcase", + "severity": "WARNING", + "data": [] + }, + { + "id": "func-param-name-camelcase", + "severity": "WARNING", + "data": [] + }, + { + "id": "use-forbidden-name", + "severity": "WARNING", + "data": [] + }, + { + "id": "import-on-top", + "severity": "WARNING", + "data": [] } ] } \ No newline at end of file diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/ReasonString/file.sol b/toolchains/solidity/linter/core/solidhunter-lib/testdata/ReasonString/file.sol index 44b09bf6..bc29cc8e 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/testdata/ReasonString/file.sol +++ b/toolchains/solidity/linter/core/solidhunter-lib/testdata/ReasonString/file.sol @@ -4,10 +4,10 @@ contract Test { function awesome() public { require(!has(role, account), "This is perfect"); } - function not_awesome() public { - require(!has(role, account), "This is not perfect at all because it's really too long but the code is 0xSwapFeeder compliant"); + function notAwesome() public { + require(!has(role, account), "This is not perfect at all because i"); } - function not_awesome_either() public { + function notAwesomeEither() public { require(!has(role, account)); } } \ No newline at end of file diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/UseForbiddenName/.solidhunter.json b/toolchains/solidity/linter/core/solidhunter-lib/testdata/UseForbiddenName/.solidhunter.json index 0cbc855f..6cc3dcc2 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/testdata/UseForbiddenName/.solidhunter.json +++ b/toolchains/solidity/linter/core/solidhunter-lib/testdata/UseForbiddenName/.solidhunter.json @@ -3,10 +3,58 @@ "includes": [], "plugins": [], "rules": [ + { + "id": "line-max-len", + "severity": "WARNING", + "data": [ + "80" + ] + }, + { + "id": "max-states-count", + "severity": "WARNING", + "data": [ + "15" + ] + }, + { + "id": "function-max-lines", + "severity": "WARNING", + "data": [ + "20" + ] + }, + { + "id": "reason-string", + "severity": "WARNING", + "data": [ + "32" + ] + }, + { + "id": "contract-name-pascalcase", + "severity": "WARNING", + "data": [] + }, + { + "id": "func-name-camelcase", + "severity": "WARNING", + "data": [] + }, + { + "id": "func-param-name-camelcase", + "severity": "WARNING", + "data": [] + }, { "id": "use-forbidden-name", "severity": "WARNING", "data": [] + }, + { + "id": "import-on-top", + "severity": "WARNING", + "data": [] } ] } \ No newline at end of file From 912caac669825eb8c8e10955a4ed59cbcb6894d7 Mon Sep 17 00:00:00 2001 From: 0xMemoryGrinder <35138272+0xMemoryGrinder@users.noreply.github.com> Date: Wed, 20 Sep 2023 19:06:59 -0400 Subject: [PATCH 080/325] fix(solidity/linter/core): fixed LintDiag formatting --- .../linter/core/solidhunter-lib/src/types.rs | 101 +++++++++++++----- 1 file changed, 77 insertions(+), 24 deletions(-) diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/types.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/types.rs index f5195b0e..f2152550 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/types.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/types.rs @@ -1,3 +1,4 @@ +use std::cmp::min; use crate::errors::SolidHunterError; use colored::Colorize; use serde::{Deserialize, Serialize}; @@ -35,46 +36,87 @@ pub struct LintDiag { pub source_file_content: String, } -fn severity_to_string(severity: Option) -> String { - match severity { - Some(Severity::ERROR) => "error".to_string().red(), - Some(Severity::WARNING) => "warning".to_string().yellow(), - Some(Severity::INFO) => "info".to_string().blue(), - Some(Severity::HINT) => "hint".to_string().green(), - _ => "error".to_string().red(), + +fn compute_format_line_padding(line: usize) -> String { + let padding: String; + if line > 99 { + padding = " ".repeat(0); + } else if line > 9 { + padding = " ".to_string(); + } else { + padding = " ".repeat(2); } - .to_string() + padding } -impl fmt::Display for LintDiag { - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - let padding: String; - if self.range.start.line > 99 { - padding = " ".repeat(0); - } else if self.range.start.line > 9 { - padding = " ".to_string(); - } else { - padding = " ".repeat(2); +fn try_trim_max_offset(line: &str, max_offset: usize) -> (&str, usize) { + let mut offset: usize = 0; + + for (i, c) in line.chars().enumerate() { + if i >= max_offset { + break; + } + if c.is_whitespace() { + offset += 1; } - let line = self + } + (&line[offset..], offset) +} + +impl LintDiag { + + fn format_highlighted_lines(&self) -> String { + let mut formatted = format!(" |\n"); + let first_line = self .source_file_content .lines() .nth(self.range.start.line - 1) .unwrap(); + let trimmed_first_line = first_line.trim_start(); + let max_offset = first_line.len() - trimmed_first_line.len(); + + for line_nb in self.range.start.line..self.range.end.line + 1 { + let line = self + .source_file_content + .lines() + .nth(line_nb - 1) + .unwrap(); + let (trimmed_line, offset) = try_trim_max_offset(line, max_offset); + let mut higlight_length = trimmed_line.len(); + + if self.range.start.line == self.range.end.line { + higlight_length = self.range.end.character - self.range.start.character; + } else if line_nb == self.range.start.line { + higlight_length = trimmed_line.len() - (self.range.start.character - offset); + } else if line_nb == self.range.end.line { + higlight_length = trimmed_line.len() - (self.range.end.character - min(offset, trimmed_line.len())); + } + + formatted = format!( + "{}{}{}| {}\n | {}{}\n", + formatted, + self.range.start.line, + compute_format_line_padding(self.range.start.line), + trimmed_line, + " ".repeat(if line_nb == self.range.start.line { self.range.start.character - offset } else { 0 }), + "^".repeat(higlight_length) + ); + } + formatted + } +} +impl fmt::Display for LintDiag { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { write!( f, - "\n{}: {}\n --> {}:{}:{}\n |\n{}{}|{}\n |{}{}", + "\n{}: {}\n --> {}:{}:{}\n |\n{}", severity_to_string(self.severity), self.message, self.uri, self.range.start.line, self.range.start.character, - self.range.start.line, - padding, - line, - " ".repeat(self.range.start.character), - "^".repeat(self.range.compute_length(self.source_file_content.as_str())) + self.format_highlighted_lines() ) } } @@ -83,6 +125,17 @@ impl fmt::Display for LintDiag { /////////////////// RELATED TYPES: ///////////////////////// //////////////////////////////////////////////////////////// +fn severity_to_string(severity: Option) -> String { + match severity { + Some(Severity::ERROR) => "error".to_string().red(), + Some(Severity::WARNING) => "warning".to_string().yellow(), + Some(Severity::INFO) => "info".to_string().blue(), + Some(Severity::HINT) => "hint".to_string().green(), + _ => "error".to_string().red(), + } + .to_string() +} + impl PartialEq for Position { fn eq(&self, other: &Self) -> bool { self.line == other.line && self.character == other.character From 40445fec614ac360d516ec0a294e5f9b7a48d511 Mon Sep 17 00:00:00 2001 From: 0xtekgrinder <0xtekgrinder@protonmail.com> Date: Wed, 20 Sep 2023 22:22:59 -0400 Subject: [PATCH 081/325] fix(solidity/linter/core): line of linter formatting is now good --- .../solidity/linter/core/solidhunter-lib/src/types.rs | 6 +++--- .../core/solidhunter-lib/testdata/FunctionMaxLines/file.sol | 1 - 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/types.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/types.rs index f2152550..e198254a 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/types.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/types.rs @@ -74,7 +74,7 @@ impl LintDiag { .unwrap(); let trimmed_first_line = first_line.trim_start(); let max_offset = first_line.len() - trimmed_first_line.len(); - + for line_nb in self.range.start.line..self.range.end.line + 1 { let line = self .source_file_content @@ -95,8 +95,8 @@ impl LintDiag { formatted = format!( "{}{}{}| {}\n | {}{}\n", formatted, - self.range.start.line, - compute_format_line_padding(self.range.start.line), + line_nb, + compute_format_line_padding(line_nb), trimmed_line, " ".repeat(if line_nb == self.range.start.line { self.range.start.character - offset } else { 0 }), "^".repeat(higlight_length) diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/FunctionMaxLines/file.sol b/toolchains/solidity/linter/core/solidhunter-lib/testdata/FunctionMaxLines/file.sol index 54ae6076..55db8a98 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/testdata/FunctionMaxLines/file.sol +++ b/toolchains/solidity/linter/core/solidhunter-lib/testdata/FunctionMaxLines/file.sol @@ -24,6 +24,5 @@ contract Test { uint t = 20; uint u = 21; uint v = 22; - } } \ No newline at end of file From 59d3af3298a40fea7afb6907d84c30a35e8c19ff Mon Sep 17 00:00:00 2001 From: 0xtekgrinder <0xtekgrinder@protonmail.com> Date: Wed, 20 Sep 2023 22:40:36 -0400 Subject: [PATCH 082/325] chore: remove remove-me --- remove-me-1b9390d0431343b6a1aa.txt | 1 - 1 file changed, 1 deletion(-) delete mode 100644 remove-me-1b9390d0431343b6a1aa.txt diff --git a/remove-me-1b9390d0431343b6a1aa.txt b/remove-me-1b9390d0431343b6a1aa.txt deleted file mode 100644 index 3313bfdf..00000000 --- a/remove-me-1b9390d0431343b6a1aa.txt +++ /dev/null @@ -1 +0,0 @@ -1b9390d0431343b6a1aa From bf698e5f1a2fc6802a04c17d9dd590645b8ca59b Mon Sep 17 00:00:00 2001 From: Astrodevs CI Date: Tue, 26 Sep 2023 22:38:32 +0000 Subject: [PATCH 083/325] chore: create branch feature/49-solidity-linter/131-default-rules-are-loaded-and-not-created-when-linting-the-files-staging --- remove-me-8bf2020aa87d4372b9f9.txt | 1 + 1 file changed, 1 insertion(+) create mode 100644 remove-me-8bf2020aa87d4372b9f9.txt diff --git a/remove-me-8bf2020aa87d4372b9f9.txt b/remove-me-8bf2020aa87d4372b9f9.txt new file mode 100644 index 00000000..4d1009ef --- /dev/null +++ b/remove-me-8bf2020aa87d4372b9f9.txt @@ -0,0 +1 @@ +8bf2020aa87d4372b9f9 From 684f24bf8607cae47c24724437c7377e1595222e Mon Sep 17 00:00:00 2001 From: 0xMemoryGrinder <35138272+0xMemoryGrinder@users.noreply.github.com> Date: Thu, 28 Sep 2023 22:33:50 -0400 Subject: [PATCH 084/325] fix(solidity/linter/core): doesn't create a new file when running the linter --- .../linter/core/solidhunter-lib/src/linter.rs | 26 +++++++------------ .../solidhunter-lib/src/rules/rule_impl.rs | 4 +-- 2 files changed, 11 insertions(+), 19 deletions(-) diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/linter.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/linter.rs index 3bfb0a07..e940e233 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/linter.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/linter.rs @@ -1,5 +1,6 @@ +use crate::errors::SolidHunterError; use crate::rules::factory::RuleFactory; -use crate::rules::rule_impl::{create_rules_file, parse_rules}; +use crate::rules::rule_impl::parse_rules; use crate::rules::types::*; use crate::types::*; use std::fs; @@ -20,7 +21,7 @@ pub struct SolidLinter { impl Default for SolidLinter { fn default() -> Self { - SolidLinter::new(&String::new()) + SolidLinter::new(&".solidhunter.json".to_string()) } } @@ -31,26 +32,17 @@ impl SolidLinter { rule_factory: RuleFactory::default(), rules: Vec::new(), }; - linter._create_rules(rules_config, true); + linter._create_rules(rules_config).unwrap(); linter } - fn _create_rules(&mut self, rules_config: &String, first: bool) { - let res = parse_rules(rules_config.as_str()); - match res { - Ok(rules) => { - for rule in rules.rules { - self.rules.push(self.rule_factory.create_rule(rule)); - } - } - Err(_) => { - create_rules_file(rules_config.as_str()); - if first { - self._create_rules(rules_config, false); - } + fn _create_rules(&mut self, rules_config: &String) -> Result<(), SolidHunterError> { + let res = parse_rules(rules_config.as_str())?; + for rule in res.rules { + self.rules.push(self.rule_factory.create_rule(rule)); } + Ok(()) } - } fn _file_exists(&self, path: &str) -> bool { for file in &self.files { diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/rule_impl.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/rule_impl.rs index e049745b..5975da80 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/rule_impl.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/rule_impl.rs @@ -16,9 +16,9 @@ pub fn create_rules_file(path: &str) { pub fn parse_rules(path: &str) -> Result { if !std::path::Path::new(&path).is_file() { - return Err(SolidHunterError::IoError(std::io::Error::new( + return Err(SolidHunterError::IoError(std::io::Error::new( std::io::ErrorKind::NotFound, - "Rules file not found", + "Failed to load a solidhunter's config file", ))); } let file = std::fs::read_to_string(path)?; From ec6a83ae03faf9a16cf41a37a0c8760dd043f250 Mon Sep 17 00:00:00 2001 From: 0xtekgrinder <0xtekgrinder@protonmail.com> Date: Thu, 28 Sep 2023 14:10:30 -0400 Subject: [PATCH 085/325] fix(solidity/linter/core): doesn't create a file when none are specificied --- libs/ast-extractor/src/errors.rs | 4 ++-- libs/ast-extractor/src/extract.rs | 1 - libs/ast-extractor/src/lib.rs | 4 ++-- .../linter/core/solidhunter-lib/src/linter.rs | 14 +++++------ .../core/solidhunter-lib/src/rules/factory.rs | 3 --- .../solidhunter-lib/src/rules/rule_impl.rs | 2 +- .../linter/core/solidhunter-lib/src/types.rs | 23 +++++++++---------- 7 files changed, 23 insertions(+), 28 deletions(-) diff --git a/libs/ast-extractor/src/errors.rs b/libs/ast-extractor/src/errors.rs index c8192a38..ab5ce042 100644 --- a/libs/ast-extractor/src/errors.rs +++ b/libs/ast-extractor/src/errors.rs @@ -1,6 +1,6 @@ +use proc_macro2::LexError; use syn::Error; use thiserror::Error; -use proc_macro2::LexError; #[derive(Error, Debug)] pub enum ExtractError { @@ -8,4 +8,4 @@ pub enum ExtractError { Tokenize(#[from] LexError), #[error("Parsing error")] Parse(#[from] Error), -} \ No newline at end of file +} diff --git a/libs/ast-extractor/src/extract.rs b/libs/ast-extractor/src/extract.rs index 4e61bc5c..4130cb3b 100644 --- a/libs/ast-extractor/src/extract.rs +++ b/libs/ast-extractor/src/extract.rs @@ -3,7 +3,6 @@ * Extract AST from solidity source code * author: 0xMemoryGrinder */ - use crate::errors::ExtractError; use proc_macro2::TokenStream; use std::str::FromStr; diff --git a/libs/ast-extractor/src/lib.rs b/libs/ast-extractor/src/lib.rs index fb6764d5..00c15349 100644 --- a/libs/ast-extractor/src/lib.rs +++ b/libs/ast-extractor/src/lib.rs @@ -1,9 +1,9 @@ +pub mod errors; pub mod extract; pub mod retriever; -pub mod errors; // Expose syn_solidity crate pub use syn_solidity::*; // Publish span location type -pub use proc_macro2::LineColumn; \ No newline at end of file +pub use proc_macro2::LineColumn; diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/linter.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/linter.rs index e940e233..e5067a46 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/linter.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/linter.rs @@ -30,19 +30,19 @@ impl SolidLinter { let mut linter = SolidLinter { files: Vec::new(), rule_factory: RuleFactory::default(), - rules: Vec::new(), + rules: vec![], }; linter._create_rules(rules_config).unwrap(); linter } - fn _create_rules(&mut self, rules_config: &String) -> Result<(), SolidHunterError> { - let res = parse_rules(rules_config.as_str())?; - for rule in res.rules { - self.rules.push(self.rule_factory.create_rule(rule)); - } - Ok(()) + fn _create_rules(&mut self, rules_config: &str) -> Result<(), SolidHunterError> { + let res = parse_rules(rules_config)?; + for rule in res.rules { + self.rules.push(self.rule_factory.create_rule(rule)); } + Ok(()) + } fn _file_exists(&self, path: &str) -> bool { for file in &self.files { diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/factory.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/factory.rs index d0ee4f32..0d7585d5 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/factory.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/factory.rs @@ -4,14 +4,12 @@ use std::collections::HashMap; pub struct RuleFactory { _buildables: RulesMap, - _rules: Vec>, } impl Default for RuleFactory { fn default() -> Self { RuleFactory { _buildables: create_rules(), - _rules: Vec::new(), } } } @@ -20,7 +18,6 @@ impl RuleFactory { pub fn new() -> RuleFactory { RuleFactory { _buildables: HashMap::new(), - _rules: Vec::new(), } } diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/rule_impl.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/rule_impl.rs index 5975da80..bf489450 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/rule_impl.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/rule_impl.rs @@ -16,7 +16,7 @@ pub fn create_rules_file(path: &str) { pub fn parse_rules(path: &str) -> Result { if !std::path::Path::new(&path).is_file() { - return Err(SolidHunterError::IoError(std::io::Error::new( + return Err(SolidHunterError::IoError(std::io::Error::new( std::io::ErrorKind::NotFound, "Failed to load a solidhunter's config file", ))); diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/types.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/types.rs index e198254a..1652ba45 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/types.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/types.rs @@ -1,7 +1,7 @@ -use std::cmp::min; use crate::errors::SolidHunterError; use colored::Colorize; use serde::{Deserialize, Serialize}; +use std::cmp::min; use std::fmt; pub type LintResult = Result, SolidHunterError>; @@ -36,7 +36,6 @@ pub struct LintDiag { pub source_file_content: String, } - fn compute_format_line_padding(line: usize) -> String { let padding: String; if line > 99 { @@ -64,9 +63,8 @@ fn try_trim_max_offset(line: &str, max_offset: usize) -> (&str, usize) { } impl LintDiag { - fn format_highlighted_lines(&self) -> String { - let mut formatted = format!(" |\n"); + let mut formatted = " |\n".to_string(); let first_line = self .source_file_content .lines() @@ -76,11 +74,7 @@ impl LintDiag { let max_offset = first_line.len() - trimmed_first_line.len(); for line_nb in self.range.start.line..self.range.end.line + 1 { - let line = self - .source_file_content - .lines() - .nth(line_nb - 1) - .unwrap(); + let line = self.source_file_content.lines().nth(line_nb - 1).unwrap(); let (trimmed_line, offset) = try_trim_max_offset(line, max_offset); let mut higlight_length = trimmed_line.len(); @@ -89,7 +83,8 @@ impl LintDiag { } else if line_nb == self.range.start.line { higlight_length = trimmed_line.len() - (self.range.start.character - offset); } else if line_nb == self.range.end.line { - higlight_length = trimmed_line.len() - (self.range.end.character - min(offset, trimmed_line.len())); + higlight_length = trimmed_line.len() + - (self.range.end.character - min(offset, trimmed_line.len())); } formatted = format!( @@ -98,7 +93,11 @@ impl LintDiag { line_nb, compute_format_line_padding(line_nb), trimmed_line, - " ".repeat(if line_nb == self.range.start.line { self.range.start.character - offset } else { 0 }), + " ".repeat(if line_nb == self.range.start.line { + self.range.start.character - offset + } else { + 0 + }), "^".repeat(higlight_length) ); } @@ -133,7 +132,7 @@ fn severity_to_string(severity: Option) -> String { Some(Severity::HINT) => "hint".to_string().green(), _ => "error".to_string().red(), } - .to_string() + .to_string() } impl PartialEq for Position { From a4457f0c8eebb2aef2c2e413bd049fea04f84d45 Mon Sep 17 00:00:00 2001 From: 0xMemoryGrinder <35138272+0xMemoryGrinder@users.noreply.github.com> Date: Thu, 28 Sep 2023 22:35:51 -0400 Subject: [PATCH 086/325] chore: deleted remove-me.txt --- remove-me-8bf2020aa87d4372b9f9.txt | 1 - 1 file changed, 1 deletion(-) delete mode 100644 remove-me-8bf2020aa87d4372b9f9.txt diff --git a/remove-me-8bf2020aa87d4372b9f9.txt b/remove-me-8bf2020aa87d4372b9f9.txt deleted file mode 100644 index 4d1009ef..00000000 --- a/remove-me-8bf2020aa87d4372b9f9.txt +++ /dev/null @@ -1 +0,0 @@ -8bf2020aa87d4372b9f9 From 32889a73489c9960bd2c8e38744c2646f7c244ab Mon Sep 17 00:00:00 2001 From: 0xMemoryGrinder <35138272+0xMemoryGrinder@users.noreply.github.com> Date: Fri, 29 Sep 2023 12:23:57 -0400 Subject: [PATCH 087/325] fix(ci): now track extension subfolders as part of extension workspace --- .../workflows/detect-workspace-changes.yml | 46 +++++++++++++++++-- 1 file changed, 42 insertions(+), 4 deletions(-) diff --git a/.github/workflows/detect-workspace-changes.yml b/.github/workflows/detect-workspace-changes.yml index b055cb2b..4149f26a 100644 --- a/.github/workflows/detect-workspace-changes.yml +++ b/.github/workflows/detect-workspace-changes.yml @@ -75,24 +75,62 @@ jobs: console.log(workspaces) const affectedWorkspaces = workspaces.filter(workspace => { return workspace.location !== '.' + }).map(workspace => { + return { + name: workspace.name + } }) console.log(affectedWorkspaces) const toolchainsWorkspaces = affectedWorkspaces.filter(workspace => { return workspace.name.startsWith('@osmium-toolchains/') - }) + }).map(workspace => ({ + name: workspace.name + })) const librariesWorkspaces = affectedWorkspaces.filter(workspace => { return workspace.name.startsWith('@osmium-libs/') - }) + }).map(workspace => ({ + name: workspace.name + })) const packagesWorkspaces = affectedWorkspaces.filter(workspace => { return workspace.name.startsWith('@osmium-packages/') - }) + }).map(workspace => ({ + name: workspace.name + })) const extensionsWorkspaces = affectedWorkspaces.filter(workspace => { return workspace.name.match(/@osmium\/(?:manager|(?!\w+-\w+-\w+)(?:\w+-\w+))/) + }).map(workspace => ({ + name: workspace.name + })) + const extensionsFoldersWorkspaces = affectedWorkspaces.filter(workspace => { + return workspace.name.match(/@osmium\/\w+-\w+-\w+/) + }).map(workspace => ({ + name: workspace.name + })) + + const missingExtensionsWorkspaces = extensionsFoldersWorkspaces.map(workspaceFolder => { + const extensionName = workspaceFolder.name.split('-').slice(0, 2).join('-') + const extensionWorkspace = extensionsWorkspaces.find(workspace => { + return workspace.name === extensionName + }) + if (!extensionWorkspace) { + return { + name: extensionName + } + } + return extensionWorkspace }) + + const completeList = [...extensionsWorkspaces, ...missingExtensionsWorkspaces] + const completeExtensionsWorkspaces = completeList.filter((workspace, index, self) => { + return index === self.findIndex((t) => ( + t.name === workspace.name + )) + }) + return { affectedWorkspaces, toolchainsWorkspaces, - extensionsWorkspaces, + extensionsWorkspaces: completeExtensionsWorkspaces, librariesWorkspaces, packagesWorkspaces } From 47df9ef1e4254a10821723f9e7269c21b1fbf484 Mon Sep 17 00:00:00 2001 From: 0xMemoryGrinder <35138272+0xMemoryGrinder@users.noreply.github.com> Date: Fri, 29 Sep 2023 12:43:24 -0400 Subject: [PATCH 088/325] refactor(solidity/linter/core): fixed linting errors --- libs/ast-extractor/src/extract.rs | 4 ++-- libs/ast-extractor/src/retriever/contract.rs | 2 +- libs/ast-extractor/src/retriever/enum.rs | 4 ++-- libs/ast-extractor/src/retriever/error.rs | 2 +- libs/ast-extractor/src/retriever/event.rs | 4 ++-- libs/ast-extractor/src/retriever/function.rs | 2 +- libs/ast-extractor/src/retriever/struct.rs | 4 ++-- libs/ast-extractor/src/retriever/udt.rs | 2 +- libs/ast-extractor/src/retriever/using.rs | 2 +- 9 files changed, 13 insertions(+), 13 deletions(-) diff --git a/libs/ast-extractor/src/extract.rs b/libs/ast-extractor/src/extract.rs index 4130cb3b..0b88575d 100644 --- a/libs/ast-extractor/src/extract.rs +++ b/libs/ast-extractor/src/extract.rs @@ -7,8 +7,8 @@ use crate::errors::ExtractError; use proc_macro2::TokenStream; use std::str::FromStr; -pub fn extract_ast_from_content(content: &String) -> Result { - let tokens = TokenStream::from_str(content.as_str())?; +pub fn extract_ast_from_content(content: &str) -> Result { + let tokens = TokenStream::from_str(content)?; let ast = syn_solidity::parse2(tokens)?; Ok(ast) } diff --git a/libs/ast-extractor/src/retriever/contract.rs b/libs/ast-extractor/src/retriever/contract.rs index 5062ecbf..c24575fa 100644 --- a/libs/ast-extractor/src/retriever/contract.rs +++ b/libs/ast-extractor/src/retriever/contract.rs @@ -26,7 +26,7 @@ impl<'ast> Visit<'ast> for ContractVisitor { pub fn retrieve_contract_nodes(ast: &syn_solidity::File) -> Vec { let mut visitor = ContractVisitor::new(); - visitor.visit_file(&ast); + visitor.visit_file(ast); visitor.contracts } diff --git a/libs/ast-extractor/src/retriever/enum.rs b/libs/ast-extractor/src/retriever/enum.rs index 7f219f21..95b50fe9 100644 --- a/libs/ast-extractor/src/retriever/enum.rs +++ b/libs/ast-extractor/src/retriever/enum.rs @@ -40,13 +40,13 @@ impl<'ast> Visit<'ast> for EnumVisitor { pub fn retrieve_enums_contract_nodes(ast: &syn_solidity::ItemContract) -> Vec { let mut visitor = EnumVisitor::new(); - visitor.visit_item_contract(&ast); + visitor.visit_item_contract(ast); visitor.contract_enums } pub fn retrieve_enums_file_nodes(ast: &syn_solidity::File) -> Vec { let mut visitor = EnumVisitor::new(); - visitor.visit_file(&ast); + visitor.visit_file(ast); visitor.file_enums } diff --git a/libs/ast-extractor/src/retriever/error.rs b/libs/ast-extractor/src/retriever/error.rs index d8b4e514..c0099bc0 100644 --- a/libs/ast-extractor/src/retriever/error.rs +++ b/libs/ast-extractor/src/retriever/error.rs @@ -24,7 +24,7 @@ impl<'ast> Visit<'ast> for ErrorVisitor { pub fn retrieve_errors_nodes(ast: &syn_solidity::ItemContract) -> Vec { let mut visitor = ErrorVisitor::new(); - visitor.visit_item_contract(&ast); + visitor.visit_item_contract(ast); visitor.errors } diff --git a/libs/ast-extractor/src/retriever/event.rs b/libs/ast-extractor/src/retriever/event.rs index 96946da6..3bdea41a 100644 --- a/libs/ast-extractor/src/retriever/event.rs +++ b/libs/ast-extractor/src/retriever/event.rs @@ -40,13 +40,13 @@ impl<'ast> Visit<'ast> for EventVisitor { pub fn retrieve_events_contract_nodes(ast: &syn_solidity::ItemContract) -> Vec { let mut visitor = EventVisitor::new(); - visitor.visit_item_contract(&ast); + visitor.visit_item_contract(ast); visitor.contract_events } pub fn retrieve_events_file_nodes(ast: &syn_solidity::File) -> Vec { let mut visitor = EventVisitor::new(); - visitor.visit_file(&ast); + visitor.visit_file(ast); visitor.file_events } diff --git a/libs/ast-extractor/src/retriever/function.rs b/libs/ast-extractor/src/retriever/function.rs index 06079a28..29c4aeb6 100644 --- a/libs/ast-extractor/src/retriever/function.rs +++ b/libs/ast-extractor/src/retriever/function.rs @@ -26,7 +26,7 @@ impl<'ast> Visit<'ast> for FunctionVisitor { pub fn retrieve_functions_nodes(ast: &syn_solidity::ItemContract) -> Vec { let mut visitor = FunctionVisitor::new(); - visitor.visit_item_contract(&ast); + visitor.visit_item_contract(ast); visitor.functions } diff --git a/libs/ast-extractor/src/retriever/struct.rs b/libs/ast-extractor/src/retriever/struct.rs index dadbdf1c..2be3b0ca 100644 --- a/libs/ast-extractor/src/retriever/struct.rs +++ b/libs/ast-extractor/src/retriever/struct.rs @@ -39,13 +39,13 @@ impl<'ast> Visit<'ast> for StructVisitor { pub fn retrieve_structs_contract_nodes(ast: &syn_solidity::ItemContract) -> Vec { let mut visitor = StructVisitor::new(); - visitor.visit_item_contract(&ast); + visitor.visit_item_contract(ast); visitor.contract_structs } pub fn retrieve_structs_file_nodes(ast: &syn_solidity::File) -> Vec { let mut visitor = StructVisitor::new(); - visitor.visit_file(&ast); + visitor.visit_file(ast); visitor.file_structs } diff --git a/libs/ast-extractor/src/retriever/udt.rs b/libs/ast-extractor/src/retriever/udt.rs index 872d02ed..4e681ed8 100644 --- a/libs/ast-extractor/src/retriever/udt.rs +++ b/libs/ast-extractor/src/retriever/udt.rs @@ -24,7 +24,7 @@ impl<'ast> Visit<'ast> for UdtVisitor { pub fn retrieve_udts_nodes(ast: &syn_solidity::File) -> Vec { let mut visitor = UdtVisitor::new(); - visitor.visit_file(&ast); + visitor.visit_file(ast); visitor.udts } diff --git a/libs/ast-extractor/src/retriever/using.rs b/libs/ast-extractor/src/retriever/using.rs index 07b798b9..c9ac115b 100644 --- a/libs/ast-extractor/src/retriever/using.rs +++ b/libs/ast-extractor/src/retriever/using.rs @@ -24,7 +24,7 @@ impl<'ast> Visit<'ast> for UsingVisitor { pub fn retrieve_usings_nodes(ast: &syn_solidity::ItemContract) -> Vec { let mut visitor = UsingVisitor::new(); - visitor.visit_item_contract(&ast); + visitor.visit_item_contract(ast); visitor.usings } From fb9e89ca707dcb4115f2bd6b28d8f5260c324057 Mon Sep 17 00:00:00 2001 From: 0xMemoryGrinder <35138272+0xMemoryGrinder@users.noreply.github.com> Date: Fri, 29 Sep 2023 13:38:07 -0400 Subject: [PATCH 089/325] chore: deleted remove-me --- remove-me-34219c48b31d404ab611.txt | 1 - 1 file changed, 1 deletion(-) delete mode 100644 remove-me-34219c48b31d404ab611.txt diff --git a/remove-me-34219c48b31d404ab611.txt b/remove-me-34219c48b31d404ab611.txt deleted file mode 100644 index 78564588..00000000 --- a/remove-me-34219c48b31d404ab611.txt +++ /dev/null @@ -1 +0,0 @@ -34219c48b31d404ab611 From 4ae55be2ef85be943a32f0dc0bc6732d1056b939 Mon Sep 17 00:00:00 2001 From: Astrodevs CI Date: Thu, 17 Aug 2023 19:50:15 +0000 Subject: [PATCH 090/325] chore: create branch chore/48-embed-lsp-server-in-core-staging --- remove-me-f4e34cee726748d383d7.txt | 1 + 1 file changed, 1 insertion(+) create mode 100644 remove-me-f4e34cee726748d383d7.txt diff --git a/remove-me-f4e34cee726748d383d7.txt b/remove-me-f4e34cee726748d383d7.txt new file mode 100644 index 00000000..33c21276 --- /dev/null +++ b/remove-me-f4e34cee726748d383d7.txt @@ -0,0 +1 @@ +f4e34cee726748d383d7 From e1c9684d7ad94b43a29ca1231462fbde748fab7a Mon Sep 17 00:00:00 2001 From: Astrodevs CI Date: Wed, 30 Aug 2023 19:51:37 +0000 Subject: [PATCH 091/325] chore: create branch chore/48-embed-lsp-server-in-core/65-lsp-server-in-rust-staging --- remove-me-cd183d27aa5240d7aecb.txt | 1 + 1 file changed, 1 insertion(+) create mode 100644 remove-me-cd183d27aa5240d7aecb.txt diff --git a/remove-me-cd183d27aa5240d7aecb.txt b/remove-me-cd183d27aa5240d7aecb.txt new file mode 100644 index 00000000..371cb2b7 --- /dev/null +++ b/remove-me-cd183d27aa5240d7aecb.txt @@ -0,0 +1 @@ +cd183d27aa5240d7aecb From 2fa8a9135b145fcb6a60a8b126a43b02d34431e4 Mon Sep 17 00:00:00 2001 From: 0xMemoryGrinder <35138272+0xMemoryGrinder@users.noreply.github.com> Date: Sun, 10 Sep 2023 01:49:02 -0400 Subject: [PATCH 092/325] feat(solidity/linter/core): added boilerplate lsp server --- toolchains/solidity/linter/core/Cargo.lock | 1169 +++++++++++++++-- toolchains/solidity/linter/core/Cargo.toml | 2 + .../solidity/linter/core/src/lsp_server.rs | 40 + toolchains/solidity/linter/core/src/main.rs | 17 + 4 files changed, 1145 insertions(+), 83 deletions(-) create mode 100644 toolchains/solidity/linter/core/src/lsp_server.rs diff --git a/toolchains/solidity/linter/core/Cargo.lock b/toolchains/solidity/linter/core/Cargo.lock index 6d557624..6bcd0178 100644 --- a/toolchains/solidity/linter/core/Cargo.lock +++ b/toolchains/solidity/linter/core/Cargo.lock @@ -27,6 +27,30 @@ name = "anstyle-parse" version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "938874ff5980b03a87c5524b3ae5b59cf99b1d6bc836848df7bc5ada9643c333" +checksum = "216261ddc8289130e551ddcd5ce8a064710c0d064a4d2895c67151c92b5443f6" + +[[package]] +name = "arrayvec" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8da52d66c7071e2e3fa2a1e5c6d088fec47b593032b254f5e980de8ea54454d6" + +[[package]] +name = "async-trait" +version = "0.1.73" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bc00ceb34980c03614e35a3a4e218276a0a824e911d07651cd0d858a51e8c0f0" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.31", +] + +[[package]] +name = "atty" +version = "0.2.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" dependencies = [ "utf8parse", ] @@ -38,6 +62,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5ca11d4be1bab0c8bc8734a9aa7bf4ee8316d462a08c6ac5052f888fef5b494b" dependencies = [ "windows-sys", + "proc-macro-error", + "proc-macro2", + "quote", + "syn 1.0.105", ] [[package]] @@ -113,7 +141,20 @@ dependencies = [ "heck", "proc-macro2", "quote", - "syn", + "syn 1.0.105", +] + +[[package]] +name = "clap_derive" +version = "4.0.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0177313f9f02afc995627906bbd8967e2be069f5261954222dac78290c2b9014" +dependencies = [ + "heck", + "proc-macro-error", + "proc-macro2", + "quote", + "syn 1.0.105", ] [[package]] @@ -139,6 +180,143 @@ dependencies = [ "windows-sys", ] +[[package]] +name = "console" +version = "0.14.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3993e6445baa160675931ec041a5e03ca84b9c6e32a056150d3aa2bdda0a1f45" +dependencies = [ + "encode_unicode", + "lazy_static", + "libc", + "regex", + "terminal_size", + "unicode-width", + "winapi", +] + +[[package]] +name = "console" +version = "0.15.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c050367d967ced717c04b65d8c619d863ef9292ce0c5760028655a2fb298718c" +dependencies = [ + "encode_unicode", + "lazy_static", + "libc", + "terminal_size", + "winapi", +] + +[[package]] +name = "constant_time_eq" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "245097e9a4535ee1e3e3931fcfcd55a796a44c643e8596ff6566d68f09b87bbc" + +[[package]] +name = "cpufeatures" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28d997bd5e24a5928dd43e46dc529867e207907fe0b239c3477d924f7f2ca320" +dependencies = [ + "libc", +] + +[[package]] +name = "crc32fast" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b540bd8bc810d3885c6ea91e2018302f68baba2129ab3e88f32389ee9370880d" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "crossbeam-utils" +version = "0.8.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4fb766fa798726286dbbb842f174001dab8abc7b627a1dd86e0b7222a95d929f" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "crypto-common" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" +dependencies = [ + "generic-array", + "typenum", +] + +[[package]] +name = "dashmap" +version = "5.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "907076dfda823b0b36d2a1bb5f90c96660a5bbcd7729e10727f07858f22c4edc" +dependencies = [ + "cfg-if", + "hashbrown", + "lock_api", + "once_cell", + "parking_lot_core", +] + +[[package]] +name = "dialoguer" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c9dd058f8b65922819fabb4a41e7d1964e56344042c26efbccd465202c23fa0c" +dependencies = [ + "console 0.14.1", + "lazy_static", + "tempfile", + "zeroize", +] + +[[package]] +name = "digest" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3dd60d1080a57a05ab032377049e0591415d2b31afd7028356dbf3cc6dcb066" +dependencies = [ + "generic-array", +] + +[[package]] +name = "digest" +version = "0.10.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8168378f4e5023e7218c89c891c0fd8ecdb5e5e4f18cb78f38cf245dd021e76f" +dependencies = [ + "block-buffer 0.10.3", + "crypto-common", + "subtle", +] + +[[package]] +name = "either" +version = "1.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90e5c1c8368803113bf0c9584fc495a58b86dc8a29edbf8fe877d21d9507e797" + +[[package]] +name = "encode_unicode" +version = "0.3.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a357d28ed41a50f9c765dbfe56cbc04a64e53e5fc58ba79fbc34c10ef3df831f" + +[[package]] +name = "encoding_rs" +version = "0.8.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9852635589dc9f9ea1b6fe9f05b50ef208c85c834a562f0c6abb1c475736ec2b" +dependencies = [ + "cfg-if", +] + [[package]] name = "errno" version = "0.3.3" @@ -160,6 +338,137 @@ dependencies = [ "libc", ] +[[package]] +name = "fastrand" +version = "1.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a7a407cfaa3385c4ae6b23e84623d48c2798d06e3e6a1878f7f59f17b3f86499" +dependencies = [ + "instant", +] + +[[package]] +name = "flate2" +version = "1.0.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8a2db397cb1c8772f31494cb8917e48cd1e64f0fa7efac59fbd741a0a8ce841" +dependencies = [ + "crc32fast", + "miniz_oxide", +] + +[[package]] +name = "fnv" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" + +[[package]] +name = "form_urlencoded" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a9c384f161156f5260c24a097c56119f9be8c798586aecc13afbcbe7b7e26bf8" +dependencies = [ + "percent-encoding", +] + +[[package]] +name = "fs2" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9564fc758e15025b46aa6643b1b77d047d1a56a1aea6e01002ac0c7026876213" +dependencies = [ + "libc", + "winapi", +] + +[[package]] +name = "futures" +version = "0.3.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23342abe12aba583913b2e62f22225ff9c950774065e4bfb61a19cd9770fec40" +dependencies = [ + "futures-channel", + "futures-core", + "futures-io", + "futures-sink", + "futures-task", + "futures-util", +] + +[[package]] +name = "futures-channel" +version = "0.3.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "955518d47e09b25bbebc7a18df10b81f0c766eaf4c4f1cccef2fca5f2a4fb5f2" +dependencies = [ + "futures-core", + "futures-sink", +] + +[[package]] +name = "futures-core" +version = "0.3.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4bca583b7e26f571124fe5b7561d49cb2868d79116cfa0eefce955557c6fee8c" + +[[package]] +name = "futures-io" +version = "0.3.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4fff74096e71ed47f8e023204cfd0aa1289cd54ae5430a9523be060cdb849964" + +[[package]] +name = "futures-macro" +version = "0.3.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "89ca545a94061b6365f2c7355b4b32bd20df3ff95f02da9329b34ccc3bd6ee72" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.31", +] + +[[package]] +name = "futures-sink" +version = "0.3.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f43be4fe21a13b9781a69afa4985b0f6ee0e1afab2c6f454a8cf30e2b2237b6e" + +[[package]] +name = "futures-task" +version = "0.3.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "76d3d132be6c0e6aa1534069c705a74a5997a356c0dc2f86a47765e5617c5b65" + +[[package]] +name = "futures-util" +version = "0.3.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26b01e40b772d54cf6c6d721c1d1abd0647a0106a12ecaa1c186273392a69533" +dependencies = [ + "futures-channel", + "futures-core", + "futures-io", + "futures-macro", + "futures-sink", + "futures-task", + "memchr", + "pin-project-lite", + "pin-utils", + "slab", +] + +[[package]] +name = "generic-array" +version = "0.14.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bff49e947297f3312447abdca79f45f4738097cc82b06e72054d2223f601f1b9" +dependencies = [ + "typenum", + "version_check", +] + [[package]] name = "glob" version = "0.3.1" @@ -220,150 +529,698 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "de3145af08024dea9fa9914f381a17b8fc6034dfb00f3a84013f7ff43f29ed4c" [[package]] -name = "proc-macro2" -version = "1.0.67" +name = "log" +version = "0.4.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d433d9f1a3e8c1263d9456598b16fec66f4acc9a74dacffd35c7bb09b3a1328" +checksum = "abb12e687cfb44aa40f41fc3978ef76448f9b6038cad6aef4259d3c095a2382e" dependencies = [ - "unicode-ident", + "cfg-if", ] [[package]] -name = "quote" -version = "1.0.33" +name = "lsp-types" +version = "0.94.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" +checksum = "c66bfd44a06ae10647fe3f8214762e9369fd4248df1350924b4ef9e770a85ea1" dependencies = [ - "proc-macro2", + "bitflags", + "serde", + "serde_json", + "serde_repr", + "url", ] [[package]] -name = "rustix" -version = "0.38.13" +name = "memchr" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7db8590df6dfcd144d22afd1b83b36c21a18d7cbc1dc4bb5295a8712e9eb662" -dependencies = [ - "bitflags", - "errno", - "libc", - "linux-raw-sys", - "windows-sys", -] +checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" [[package]] -name = "ryu" -version = "1.0.15" +name = "mime" +version = "0.3.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ad4cc8da4ef723ed60bced201181d83791ad433213d8c24efffda1eec85d741" +checksum = "2a60c7ce501c71e03a9c9c0d35b861413ae925bd979cc7a4e30d060069aaac8d" [[package]] -name = "serde" -version = "1.0.188" +name = "miniz_oxide" +version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf9e0fcba69a370eed61bcf2b728575f726b50b55cba78064753d708ddc7549e" +checksum = "b275950c28b37e794e8c55d88aeb5e139d0ce23fdbbeda68f8d7174abdf9e8fa" dependencies = [ - "serde_derive", + "adler", ] [[package]] -name = "serde_derive" -version = "1.0.188" +name = "mio" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4eca7ac642d82aa35b60049a6eccb4be6be75e599bd2e9adb5f875a737654af2" +checksum = "e5d732bc30207a6423068df043e3d02e0735b155ad7ce1a6f76fe2baa5b158de" dependencies = [ - "proc-macro2", - "quote", - "syn", + "libc", + "log", + "wasi", + "windows-sys", ] [[package]] -name = "serde_json" -version = "1.0.107" +name = "num_cpus" +version = "1.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b420ce6e3d8bd882e9b243c6eed35dbc9a6110c9769e74b584e0d68d1f20c65" +checksum = "f6058e64324c71e02bc2b150e4f3bc8286db6c83092132ffa3f6b1eab0f9def5" dependencies = [ - "itoa", - "ryu", - "serde", + "hermit-abi 0.1.19", + "libc", ] [[package]] -name = "solidhunter" -version = "0.0.1" -dependencies = [ - "anyhow", - "clap", - "colored", - "glob", - "serde", - "serde_json", - "solidhunter-lib", - "thiserror", -] +name = "number_prefix" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "830b246a0e5f20af87141b25c173cd1b609bd7779a4617d6ec582abaf90870f3" [[package]] -name = "solidhunter-lib" -version = "0.0.1" +name = "once_cell" +version = "1.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "86f0b0d4bf799edbc74508c1e8bf170ff5f41238e5f8225603ca7caaae2b7860" + +[[package]] +name = "opaque-debug" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5" + +[[package]] +name = "open-fastrlp" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "786393f80485445794f6043fd3138854dd109cc6c4bd1a6383db304c9ce9b9ce" dependencies = [ - "anyhow", - "ast-extractor", - "clap", - "colored", - "glob", - "serde", - "serde_json", - "thiserror", + "arrayvec", + "auto_impl", + "bytes", ] [[package]] -name = "strsim" -version = "0.10.0" +name = "os_str_bytes" +version = "6.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" +checksum = "9b7820b9daea5457c9f21c69448905d723fbd21136ccf521748f23fd49e723ee" [[package]] -name = "syn" -version = "2.0.33" +name = "parking_lot" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9caece70c63bfba29ec2fed841a09851b14a235c60010fa4de58089b6c025668" +checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", + "lock_api", + "parking_lot_core", ] [[package]] -name = "syn-solidity" -version = "0.3.2" +name = "parking_lot_core" +version = "0.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "397f229dc34c7b8231b6ef85502f9ca4e3425b8625e6d403bb74779e6b1917b5" +checksum = "7ff9f3fef3968a3ec5945535ed654cb38ff72d7495a25619e2247fb15a2ed9ba" dependencies = [ - "paste", - "proc-macro2", - "quote", - "syn", + "cfg-if", + "libc", + "redox_syscall", + "smallvec", + "windows-sys", ] [[package]] -name = "thiserror" -version = "1.0.48" +name = "password-hash" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d6d7a740b8a666a7e828dd00da9c0dc290dff53154ea77ac109281de90589b7" +checksum = "7676374caaee8a325c9e7a2ae557f216c5563a171d6997b0ef8a65af35147700" dependencies = [ - "thiserror-impl", + "base64ct", + "rand_core", + "subtle", ] [[package]] -name = "thiserror-impl" -version = "1.0.48" +name = "pbkdf2" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49922ecae66cc8a249b77e68d1d0623c1b2c514f0060c27cdc68bd62a1219d35" +checksum = "83a0692ec44e4cf1ef28ca317f14f8f07da2d95ec3fa01f86e4467b725e60917" +dependencies = [ + "digest 0.10.6", + "hmac", + "password-hash", + "sha2 0.10.6", +] + +[[package]] +name = "percent-encoding" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "478c572c3d73181ff3c2539045f6eb99e5491218eae919370993b890cdbdd98e" + +[[package]] +name = "pin-project" +version = "1.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fda4ed1c6c173e3fc7a83629421152e01d7b1f9b7f65fb301e490e8cfc656422" +dependencies = [ + "pin-project-internal", +] + +[[package]] +name = "pin-project-internal" +version = "1.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4359fd9c9171ec6e8c62926d6faaf553a8dc3f64e1507e76da7911b4f6a04405" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.31", +] + +[[package]] +name = "pin-project-lite" +version = "0.2.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e0a7ae3ac2f1173085d398531c705756c94a4c56843785df85a60c1a0afac116" + +[[package]] +name = "pin-utils" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" + +[[package]] +name = "pkg-config" +version = "0.3.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ac9a59f73473f1b8d852421e59e64809f025994837ef743615c6d0c5b305160" + +[[package]] +name = "proc-macro-error" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" +dependencies = [ + "proc-macro-error-attr", + "proc-macro2", + "quote", + "syn 1.0.105", + "version_check", +] + +[[package]] +name = "proc-macro-error-attr" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" +dependencies = [ + "proc-macro2", + "quote", + "version_check", +] + +[[package]] +name = "proc-macro2" +version = "1.0.67" +version = "1.0.66" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d433d9f1a3e8c1263d9456598b16fec66f4acc9a74dacffd35c7bb09b3a1328" +checksum = "18fb31db3f9bddb2ea821cde30a9f70117e3f119938b5ee630b7403aa6e2ead9" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quote" +version = "1.0.33" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "rustix" +version = "0.38.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d7db8590df6dfcd144d22afd1b83b36c21a18d7cbc1dc4bb5295a8712e9eb662" +dependencies = [ + "bitflags", + "errno", + "libc", + "linux-raw-sys", + "windows-sys", +] + +[[package]] +name = "ryu" +version = "1.0.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ad4cc8da4ef723ed60bced201181d83791ad433213d8c24efffda1eec85d741" + +[[package]] +name = "serde" +version = "1.0.188" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf9e0fcba69a370eed61bcf2b728575f726b50b55cba78064753d708ddc7549e" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.188" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4eca7ac642d82aa35b60049a6eccb4be6be75e599bd2e9adb5f875a737654af2" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.105", +] + +[[package]] +name = "serde_json" +version = "1.0.107" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6b420ce6e3d8bd882e9b243c6eed35dbc9a6110c9769e74b584e0d68d1f20c65" +dependencies = [ + "itoa", + "ryu", + "serde", +] + +[[package]] +name = "serde_repr" +version = "0.1.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8725e1dfadb3a50f7e5ce0b1a540466f6ed3fe7a0fca2ac2b8b831d31316bd00" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.31", +] + +[[package]] +name = "serde_urlencoded" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd" +dependencies = [ + "form_urlencoded", + "itoa", + "ryu", + "serde", +] + +[[package]] +name = "sha1" +version = "0.10.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f04293dc80c3993519f2d7f6f511707ee7094fe0c6d3406feb330cdb3540eba3" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest 0.10.6", +] + +[[package]] +name = "sha2" +version = "0.9.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4d58a1e1bf39749807d89cf2d98ac2dfa0ff1cb3faa38fbb64dd88ac8013d800" +dependencies = [ + "block-buffer 0.9.0", + "cfg-if", + "cpufeatures", + "digest 0.9.0", + "opaque-debug", +] + +[[package]] +name = "sha2" +version = "0.10.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "82e6b795fe2e3b1e845bafcb27aa35405c4d47cdfc92af5fc8d3002f76cebdc0" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest 0.10.6", +] + +[[package]] +name = "signal-hook-registry" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e51e73328dc4ac0c7ccbda3a494dfa03df1de2f46018127f60c693f2648455b0" +dependencies = [ + "libc", +] + +[[package]] +name = "slab" +version = "0.4.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4614a76b2a8be0058caa9dbbaf66d988527d86d003c11a94fbd335d7661edcef" +dependencies = [ + "autocfg", +] + +[[package]] +name = "smallvec" +version = "1.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a507befe795404456341dfab10cef66ead4c041f62b8b11bbb92bffe5d0953e0" + +[[package]] +name = "socket2" +version = "0.4.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "02e2d2db9033d13a1567121ddd7a095ee144db4e1ca1b1bda3419bc0da294ebd" +dependencies = [ + "libc", + "winapi", +] + +[[package]] +name = "solc-wrapper" +version = "0.1.0" +dependencies = [ + "anyhow", + "hex", + "home", + "once_cell", + "open-fastrlp", + "regex", + "semver", + "serde", + "serde_json", + "svm-rs", + "thiserror", +] + +[[package]] +name = "solidhunter" +version = "0.0.1" +dependencies = [ + "anyhow", + "clap", + "colored", + "glob", + "serde", + "serde_json", + "solidhunter-lib", + "thiserror", + "tokio", + "tower-lsp", +] + +[[package]] +name = "solidhunter-lib" +version = "0.0.1" +dependencies = [ + "anyhow", + "ast-extractor", + "clap", + "colored", + "glob", + "serde", + "serde_json", + "thiserror", +] + +[[package]] +name = "strsim" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" + +[[package]] +name = "syn" +version = "2.0.33" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9caece70c63bfba29ec2fed841a09851b14a235c60010fa4de58089b6c025668" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "syn-solidity" +version = "0.3.2" +name = "syn" +version = "2.0.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "718fa2415bcb8d8bd775917a1bf12a7931b6dfa890753378538118181e0cb398" dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "tempfile" +version = "3.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "397f229dc34c7b8231b6ef85502f9ca4e3425b8625e6d403bb74779e6b1917b5" +dependencies = [ + "paste", "proc-macro2", "quote", "syn", ] +[[package]] +name = "thiserror" +version = "1.0.48" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d6d7a740b8a666a7e828dd00da9c0dc290dff53154ea77ac109281de90589b7" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.48" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49922ecae66cc8a249b77e68d1d0623c1b2c514f0060c27cdc68bd62a1219d35" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.105", +] + +[[package]] +name = "time" +version = "0.3.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a561bf4617eebd33bca6434b988f39ed798e527f51a1e797d0ee4f61c0a38376" +dependencies = [ + "itoa", + "serde", + "time-core", + "time-macros", +] + +[[package]] +name = "time-core" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e153e1f1acaef8acc537e68b44906d2db6436e2b35ac2c6b42640fff91f00fd" + +[[package]] +name = "time-macros" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d967f99f534ca7e495c575c62638eebc2898a8c84c119b89e250477bc4ba16b2" +dependencies = [ + "time-core", +] + +[[package]] +name = "tinyvec" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" +dependencies = [ + "tinyvec_macros", +] + +[[package]] +name = "tinyvec_macros" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c" + +[[package]] +name = "tokio" +version = "1.23.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eab6d665857cc6ca78d6e80303a02cea7a7851e85dfbd77cbdc09bd129f1ef46" +dependencies = [ + "autocfg", + "bytes", + "libc", + "memchr", + "mio", + "num_cpus", + "parking_lot", + "pin-project-lite", + "signal-hook-registry", + "socket2", + "tokio-macros", + "windows-sys", +] + +[[package]] +name = "tokio-macros" +version = "1.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d266c00fde287f55d3f1c3e96c500c362a2b8c695076ec180f27918820bc6df8" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.105", +] + +[[package]] +name = "tokio-rustls" +version = "0.23.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c43ee83903113e03984cb9e5cebe6c04a5116269e900e3ddba8f068a62adda59" +dependencies = [ + "rustls", + "tokio", + "webpki", +] + +[[package]] +name = "tokio-util" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0bb2e075f03b3d66d8d8785356224ba688d2906a371015e225beeb65ca92c740" +dependencies = [ + "bytes", + "futures-core", + "futures-sink", + "pin-project-lite", + "tokio", + "tracing", +] + +[[package]] +name = "tower" +version = "0.4.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8fa9be0de6cf49e536ce1851f987bd21a43b771b09473c3549a6c853db37c1c" +dependencies = [ + "futures-core", + "futures-util", + "pin-project", + "pin-project-lite", + "tower-layer", + "tower-service", +] + +[[package]] +name = "tower-layer" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c20c8dbed6283a09604c3e69b4b7eeb54e298b8a600d4d5ecb5ad39de609f1d0" + +[[package]] +name = "tower-lsp" +version = "0.20.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d4ba052b54a6627628d9b3c34c176e7eda8359b7da9acd497b9f20998d118508" +dependencies = [ + "async-trait", + "auto_impl", + "bytes", + "dashmap", + "futures", + "httparse", + "lsp-types", + "memchr", + "serde", + "serde_json", + "tokio", + "tokio-util", + "tower", + "tower-lsp-macros", + "tracing", +] + +[[package]] +name = "tower-lsp-macros" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "84fd902d4e0b9a4b27f2f440108dc034e1758628a9b702f8ec61ad66355422fa" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.31", +] + +[[package]] +name = "tower-service" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" + +[[package]] +name = "tracing" +version = "0.1.37" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ce8c33a8d48bd45d624a6e523445fd21ec13d3653cd51f681abf67418f54eb8" +dependencies = [ + "cfg-if", + "pin-project-lite", + "tracing-attributes", + "tracing-core", +] + +[[package]] +name = "tracing-attributes" +version = "0.1.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4017f8f45139870ca7e672686113917c71c7a6e02d4924eda67186083c03081a" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.105", +] + +[[package]] +name = "tracing-core" +version = "0.1.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24eb03ba0eab1fd845050058ce5e616558e8f8d8fca633e6b163fe25c797213a" +dependencies = [ + "once_cell", +] + +[[package]] +name = "try-lock" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59547bce71d9c38b83d9c0e92b6066c4253371f15005def0c30d9657f50c7642" + +[[package]] +name = "typenum" +version = "1.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "497961ef93d974e23eb6f433eb5fe1b7930b659f06d12dec6fc44a8f554c0bba" + +[[package]] +name = "unicode-bidi" +version = "0.3.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "099b7128301d285f79ddd55b9a83d5e6b9e97c92e0ea0daebee7263e932de992" + [[package]] name = "unicode-ident" version = "1.0.12" @@ -383,6 +1240,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" dependencies = [ "windows-targets", + "form_urlencoded", + "idna", + "percent-encoding", + "serde", ] [[package]] @@ -390,6 +1251,148 @@ name = "windows-targets" version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" +dependencies = [ + "log", + "try-lock", +] + +[[package]] +name = "wasi" +version = "0.11.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" + +[[package]] +name = "wasm-bindgen" +version = "0.2.83" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eaf9f5aceeec8be17c128b2e93e031fb8a4d469bb9c4ae2d7dc1888b26887268" +dependencies = [ + "cfg-if", + "wasm-bindgen-macro", +] + +[[package]] +name = "wasm-bindgen-backend" +version = "0.2.83" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c8ffb332579b0557b52d268b91feab8df3615f265d5270fec2a8c95b17c1142" +dependencies = [ + "bumpalo", + "log", + "once_cell", + "proc-macro2", + "quote", + "syn 1.0.105", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-futures" +version = "0.4.33" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23639446165ca5a5de86ae1d8896b737ae80319560fbaa4c2887b7da6e7ebd7d" +dependencies = [ + "cfg-if", + "js-sys", + "wasm-bindgen", + "web-sys", +] + +[[package]] +name = "wasm-bindgen-macro" +version = "0.2.83" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "052be0f94026e6cbc75cdefc9bae13fd6052cdcaf532fa6c45e7ae33a1e6c810" +dependencies = [ + "quote", + "wasm-bindgen-macro-support", +] + +[[package]] +name = "wasm-bindgen-macro-support" +version = "0.2.83" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07bc0c051dc5f23e307b13285f9d75df86bfdf816c5721e573dec1f9b8aa193c" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.105", + "wasm-bindgen-backend", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-shared" +version = "0.2.83" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1c38c045535d93ec4f0b4defec448e4291638ee608530863b1e2ba115d4fff7f" + +[[package]] +name = "web-sys" +version = "0.3.60" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bcda906d8be16e728fd5adc5b729afad4e444e106ab28cd1c7256e54fa61510f" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "webpki" +version = "0.22.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f095d78192e208183081cc07bc5515ef55216397af48b873e5edcd72637fa1bd" +dependencies = [ + "ring", + "untrusted", +] + +[[package]] +name = "webpki-roots" +version = "0.22.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6c71e40d7d2c34a5106301fb632274ca37242cd0c9d3e64dbece371a40a2d87" +dependencies = [ + "webpki", +] + +[[package]] +name = "winapi" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" +dependencies = [ + "winapi-i686-pc-windows-gnu", + "winapi-x86_64-pc-windows-gnu", +] + +[[package]] +name = "winapi-i686-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" + +[[package]] +name = "winapi-util" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" +dependencies = [ + "winapi", +] + +[[package]] +name = "winapi-x86_64-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" + +[[package]] +name = "windows-sys" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a3e1820f08b8513f676f7ab6c1f99ff312fb97b553d30ff4dd86f9f15728aa7" dependencies = [ "windows_aarch64_gnullvm", "windows_aarch64_msvc", diff --git a/toolchains/solidity/linter/core/Cargo.toml b/toolchains/solidity/linter/core/Cargo.toml index 468a65a1..e5a20d38 100644 --- a/toolchains/solidity/linter/core/Cargo.toml +++ b/toolchains/solidity/linter/core/Cargo.toml @@ -14,3 +14,5 @@ solidhunter-lib = { path = "./solidhunter-lib" } anyhow = "1.0" glob = "0.3.0" thiserror = "1.0" +tower-lsp = "0.20.0" +tokio = { version = "1.17.0", features = ["full"] } diff --git a/toolchains/solidity/linter/core/src/lsp_server.rs b/toolchains/solidity/linter/core/src/lsp_server.rs new file mode 100644 index 00000000..4186251f --- /dev/null +++ b/toolchains/solidity/linter/core/src/lsp_server.rs @@ -0,0 +1,40 @@ +use tower_lsp::jsonrpc::Result; +use tower_lsp::lsp_types::*; +use tower_lsp::{Client, LanguageServer, LspService, Server}; + +#[derive(Debug)] +struct Backend { + client: Client, +} + +#[tower_lsp::async_trait] +impl LanguageServer for Backend { + async fn initialize(&self, _: InitializeParams) -> Result { + Ok(InitializeResult::default()) + } + + async fn initialized(&self, _: InitializedParams) { + self.client + .log_message(MessageType::INFO, "server initialized!") + .await; + } + + async fn shutdown(&self) -> Result<()> { + Ok(()) + } + + async fn did_open(&self, _: DidOpenTextDocumentParams) { + self.client + .log_message(MessageType::INFO, "file opened!") + .await; + } +} + +#[tokio::main] +pub async fn run_server() { + let stdin = tokio::io::stdin(); + let stdout = tokio::io::stdout(); + + let (service, socket) = LspService::new(|client| Backend { client }); + Server::new(stdin, stdout, socket).serve(service).await; +} \ No newline at end of file diff --git a/toolchains/solidity/linter/core/src/main.rs b/toolchains/solidity/linter/core/src/main.rs index 439254e2..fa84aece 100644 --- a/toolchains/solidity/linter/core/src/main.rs +++ b/toolchains/solidity/linter/core/src/main.rs @@ -3,6 +3,9 @@ use solidhunter_lib::linter::SolidLinter; use solidhunter_lib::rules::rule_impl::create_rules_file; use solidhunter_lib::types::LintResult; +mod lsp_server; +use lsp_server::run_server; + #[derive(Parser, Debug)] #[command(author, version, about, long_about = None)] struct Args { @@ -60,6 +63,14 @@ struct Args { help = "Initialize rules file" )] init: bool, + + #[arg( + short = 'l', + long = "lsp", + default_value = "false", + help = "Starts the language server instead of linting" + )] + lsp: bool, } fn lint_folder(args: Args) { @@ -89,6 +100,12 @@ fn print_result(result: LintResult) { fn main() { let args = Args::parse(); + if args.lsp { + println!("Starting language server..."); + run_server(); + return; + } + if !args.to_json { println!(); println!("SolidHunter: Fast and efficient Solidity linter"); From b17c070569dfff6ac509a5338ba3b67ea8ccbce5 Mon Sep 17 00:00:00 2001 From: 0xMemoryGrinder <35138272+0xMemoryGrinder@users.noreply.github.com> Date: Wed, 13 Sep 2023 02:36:15 -0400 Subject: [PATCH 093/325] fix(solidity/linter/core): made the lsp server mode work --- .pnp.cjs | 4204 +++++++++++++++-- .../linter/core/solidhunter-lib/src/linter.rs | 19 +- .../solidity/linter/core/src/lsp_server.rs | 116 +- toolchains/solidity/linter/core/src/main.rs | 11 +- yarn.lock | 3683 +++++++++++++-- 5 files changed, 7071 insertions(+), 962 deletions(-) diff --git a/.pnp.cjs b/.pnp.cjs index bfacf3bc..85929c31 100644 --- a/.pnp.cjs +++ b/.pnp.cjs @@ -47,6 +47,10 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { "name": "@osmium/solidity-linter-core",\ "reference": "workspace:toolchains/solidity/linter/core"\ },\ + {\ + "name": "@osmium-toolchains/solidity-linter-extension",\ + "reference": "workspace:toolchains/solidity/linter/extension"\ + },\ {\ "name": "@osmium/solidity-lsp",\ "reference": "workspace:toolchains/solidity/lsp"\ @@ -60,6 +64,7 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { ["@osmium-packages/eslint-config", ["workspace:packages/eslint-config"]],\ ["@osmium-packages/prettier-config", ["workspace:packages/prettier-config"]],\ ["@osmium-toolchains/solidity", ["workspace:toolchains/solidity"]],\ + ["@osmium-toolchains/solidity-linter-extension", ["workspace:toolchains/solidity/linter/extension"]],\ ["@osmium/manager", ["workspace:manager"]],\ ["@osmium/solidity-linter", ["workspace:toolchains/solidity/linter"]],\ ["@osmium/solidity-linter-core", ["workspace:toolchains/solidity/linter/core"]],\ @@ -87,6 +92,15 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { "linkType": "HARD"\ }]\ ]],\ + ["@discoveryjs/json-ext", [\ + ["npm:0.5.7", {\ + "packageLocation": "./.yarn/cache/@discoveryjs-json-ext-npm-0.5.7-fe04af1f31-2176d301cc.zip/node_modules/@discoveryjs/json-ext/",\ + "packageDependencies": [\ + ["@discoveryjs/json-ext", "npm:0.5.7"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ ["@eslint-community/eslint-utils", [\ ["npm:4.4.0", {\ "packageLocation": "./.yarn/cache/@eslint-community-eslint-utils-npm-4.4.0-d1791bd5a3-cdfe3ae42b.zip/node_modules/@eslint-community/eslint-utils/",\ @@ -95,6 +109,20 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { ],\ "linkType": "SOFT"\ }],\ + ["virtual:1b802e43a1d6cfd4888588e031e9b9539c10922666207f02b37e1572beffa71b5952c5b88bdcc1e2ff0080ea3baa9b39a63225d9ea667488d5ab782bed5718c7#npm:4.4.0", {\ + "packageLocation": "./.yarn/__virtual__/@eslint-community-eslint-utils-virtual-3145c9a18a/0/cache/@eslint-community-eslint-utils-npm-4.4.0-d1791bd5a3-cdfe3ae42b.zip/node_modules/@eslint-community/eslint-utils/",\ + "packageDependencies": [\ + ["@eslint-community/eslint-utils", "virtual:1b802e43a1d6cfd4888588e031e9b9539c10922666207f02b37e1572beffa71b5952c5b88bdcc1e2ff0080ea3baa9b39a63225d9ea667488d5ab782bed5718c7#npm:4.4.0"],\ + ["@types/eslint", null],\ + ["eslint", "npm:8.49.0"],\ + ["eslint-visitor-keys", "npm:3.4.2"]\ + ],\ + "packagePeers": [\ + "@types/eslint",\ + "eslint"\ + ],\ + "linkType": "HARD"\ + }],\ ["virtual:dc7af99e618232ac0e2a751f560e2225037bf809144a4cc05369d5312b9d24061282984c0c0c6c5c199f3a0663f91f11c21afb60016655f472fa253e0b676e3b#npm:4.4.0", {\ "packageLocation": "./.yarn/__virtual__/@eslint-community-eslint-utils-virtual-19d05ef909/0/cache/@eslint-community-eslint-utils-npm-4.4.0-d1791bd5a3-cdfe3ae42b.zip/node_modules/@eslint-community/eslint-utils/",\ "packageDependencies": [\ @@ -117,6 +145,13 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { ["@eslint-community/regexpp", "npm:4.6.2"]\ ],\ "linkType": "HARD"\ + }],\ + ["npm:4.8.0", {\ + "packageLocation": "./.yarn/cache/@eslint-community-regexpp-npm-4.8.0-92ece47e3d-601e6d033d.zip/node_modules/@eslint-community/regexpp/",\ + "packageDependencies": [\ + ["@eslint-community/regexpp", "npm:4.8.0"]\ + ],\ + "linkType": "HARD"\ }]\ ]],\ ["@eslint/eslintrc", [\ @@ -135,6 +170,22 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { ["strip-json-comments", "npm:3.1.1"]\ ],\ "linkType": "HARD"\ + }],\ + ["npm:2.1.2", {\ + "packageLocation": "./.yarn/cache/@eslint-eslintrc-npm-2.1.2-feb0771c9f-bc742a1e3b.zip/node_modules/@eslint/eslintrc/",\ + "packageDependencies": [\ + ["@eslint/eslintrc", "npm:2.1.2"],\ + ["ajv", "npm:6.12.6"],\ + ["debug", "virtual:ced87d94ab05a28b44536eb0cd61a9458e757a0ae7bb35e5ab5d27e03d08b996abd275928b29aad2eb0973d5bb0800e75ba8ca3e26bf62cbe8ea0fae8cca70a8#npm:4.3.4"],\ + ["espree", "npm:9.6.1"],\ + ["globals", "npm:13.20.0"],\ + ["ignore", "npm:5.2.4"],\ + ["import-fresh", "npm:3.3.0"],\ + ["js-yaml", "npm:4.1.0"],\ + ["minimatch", "npm:3.1.2"],\ + ["strip-json-comments", "npm:3.1.1"]\ + ],\ + "linkType": "HARD"\ }]\ ]],\ ["@eslint/js", [\ @@ -144,6 +195,13 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { ["@eslint/js", "npm:8.46.0"]\ ],\ "linkType": "HARD"\ + }],\ + ["npm:8.49.0", {\ + "packageLocation": "./.yarn/cache/@eslint-js-npm-8.49.0-e8f6510b47-a6601807c8.zip/node_modules/@eslint/js/",\ + "packageDependencies": [\ + ["@eslint/js", "npm:8.49.0"]\ + ],\ + "linkType": "HARD"\ }]\ ]],\ ["@humanwhocodes/config-array", [\ @@ -156,6 +214,16 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { ["minimatch", "npm:3.1.2"]\ ],\ "linkType": "HARD"\ + }],\ + ["npm:0.11.11", {\ + "packageLocation": "./.yarn/cache/@humanwhocodes-config-array-npm-0.11.11-e3582554ee-db84507375.zip/node_modules/@humanwhocodes/config-array/",\ + "packageDependencies": [\ + ["@humanwhocodes/config-array", "npm:0.11.11"],\ + ["@humanwhocodes/object-schema", "npm:1.2.1"],\ + ["debug", "virtual:ced87d94ab05a28b44536eb0cd61a9458e757a0ae7bb35e5ab5d27e03d08b996abd275928b29aad2eb0973d5bb0800e75ba8ca3e26bf62cbe8ea0fae8cca70a8#npm:4.3.4"],\ + ["minimatch", "npm:3.1.2"]\ + ],\ + "linkType": "HARD"\ }]\ ]],\ ["@humanwhocodes/module-importer", [\ @@ -176,6 +244,91 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { "linkType": "HARD"\ }]\ ]],\ + ["@isaacs/cliui", [\ + ["npm:8.0.2", {\ + "packageLocation": "./.yarn/cache/@isaacs-cliui-npm-8.0.2-f4364666d5-4a473b9b32.zip/node_modules/@isaacs/cliui/",\ + "packageDependencies": [\ + ["@isaacs/cliui", "npm:8.0.2"],\ + ["string-width", "npm:5.1.2"],\ + ["string-width-cjs", [\ + "string-width",\ + "npm:4.2.3"\ + ]],\ + ["strip-ansi", "npm:7.1.0"],\ + ["strip-ansi-cjs", [\ + "strip-ansi",\ + "npm:6.0.1"\ + ]],\ + ["wrap-ansi", "npm:8.1.0"],\ + ["wrap-ansi-cjs", [\ + "wrap-ansi",\ + "npm:7.0.0"\ + ]]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["@jridgewell/gen-mapping", [\ + ["npm:0.3.3", {\ + "packageLocation": "./.yarn/cache/@jridgewell-gen-mapping-npm-0.3.3-1815eba94c-4a74944bd3.zip/node_modules/@jridgewell/gen-mapping/",\ + "packageDependencies": [\ + ["@jridgewell/gen-mapping", "npm:0.3.3"],\ + ["@jridgewell/set-array", "npm:1.1.2"],\ + ["@jridgewell/sourcemap-codec", "npm:1.4.15"],\ + ["@jridgewell/trace-mapping", "npm:0.3.19"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["@jridgewell/resolve-uri", [\ + ["npm:3.1.1", {\ + "packageLocation": "./.yarn/cache/@jridgewell-resolve-uri-npm-3.1.1-aa2de3f210-f5b441fe79.zip/node_modules/@jridgewell/resolve-uri/",\ + "packageDependencies": [\ + ["@jridgewell/resolve-uri", "npm:3.1.1"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["@jridgewell/set-array", [\ + ["npm:1.1.2", {\ + "packageLocation": "./.yarn/cache/@jridgewell-set-array-npm-1.1.2-45b82d7fb6-69a84d5980.zip/node_modules/@jridgewell/set-array/",\ + "packageDependencies": [\ + ["@jridgewell/set-array", "npm:1.1.2"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["@jridgewell/source-map", [\ + ["npm:0.3.5", {\ + "packageLocation": "./.yarn/cache/@jridgewell-source-map-npm-0.3.5-9f964eaf44-1ad4dec0bd.zip/node_modules/@jridgewell/source-map/",\ + "packageDependencies": [\ + ["@jridgewell/source-map", "npm:0.3.5"],\ + ["@jridgewell/gen-mapping", "npm:0.3.3"],\ + ["@jridgewell/trace-mapping", "npm:0.3.19"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["@jridgewell/sourcemap-codec", [\ + ["npm:1.4.15", {\ + "packageLocation": "./.yarn/cache/@jridgewell-sourcemap-codec-npm-1.4.15-a055fb62cf-b881c7e503.zip/node_modules/@jridgewell/sourcemap-codec/",\ + "packageDependencies": [\ + ["@jridgewell/sourcemap-codec", "npm:1.4.15"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["@jridgewell/trace-mapping", [\ + ["npm:0.3.19", {\ + "packageLocation": "./.yarn/cache/@jridgewell-trace-mapping-npm-0.3.19-9aa1a7e2fd-956a6f0f6f.zip/node_modules/@jridgewell/trace-mapping/",\ + "packageDependencies": [\ + ["@jridgewell/trace-mapping", "npm:0.3.19"],\ + ["@jridgewell/resolve-uri", "npm:3.1.1"],\ + ["@jridgewell/sourcemap-codec", "npm:1.4.15"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ ["@nodelib/fs.scandir", [\ ["npm:2.1.5", {\ "packageLocation": "./.yarn/cache/@nodelib-fs.scandir-npm-2.1.5-89c67370dd-a970d595bd.zip/node_modules/@nodelib/fs.scandir/",\ @@ -207,6 +360,16 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { "linkType": "HARD"\ }]\ ]],\ + ["@npmcli/fs", [\ + ["npm:3.1.0", {\ + "packageLocation": "./.yarn/cache/@npmcli-fs-npm-3.1.0-0844a57978-a50a6818de.zip/node_modules/@npmcli/fs/",\ + "packageDependencies": [\ + ["@npmcli/fs", "npm:3.1.0"],\ + ["semver", "npm:7.5.4"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ ["@osmium-libs/ast-extractor", [\ ["workspace:libs/ast-extractor", {\ "packageLocation": "./libs/ast-extractor/",\ @@ -254,6 +417,30 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { "linkType": "SOFT"\ }]\ ]],\ + ["@osmium-toolchains/solidity-linter-extension", [\ + ["workspace:toolchains/solidity/linter/extension", {\ + "packageLocation": "./toolchains/solidity/linter/extension/",\ + "packageDependencies": [\ + ["@osmium-toolchains/solidity-linter-extension", "workspace:toolchains/solidity/linter/extension"],\ + ["@types/glob", "npm:8.1.0"],\ + ["@types/mocha", "npm:10.0.1"],\ + ["@types/node", "npm:20.2.5"],\ + ["@types/vscode", "npm:1.82.0"],\ + ["@typescript-eslint/eslint-plugin", "virtual:114e6097baba06f1f7194aa147cc16af7c3daf193a49e5fc802ef9cf9d7ac56ceb0639593345639ab943707d850061c33067576340115e57cb282fb86146f6a5#npm:5.62.0"],\ + ["@typescript-eslint/parser", "virtual:114e6097baba06f1f7194aa147cc16af7c3daf193a49e5fc802ef9cf9d7ac56ceb0639593345639ab943707d850061c33067576340115e57cb282fb86146f6a5#npm:5.62.0"],\ + ["@vscode/test-electron", "npm:2.3.4"],\ + ["eslint", "npm:8.49.0"],\ + ["glob", "npm:8.1.0"],\ + ["mocha", "npm:10.2.0"],\ + ["ts-loader", "virtual:114e6097baba06f1f7194aa147cc16af7c3daf193a49e5fc802ef9cf9d7ac56ceb0639593345639ab943707d850061c33067576340115e57cb282fb86146f6a5#npm:9.4.4"],\ + ["typescript", "patch:typescript@npm%3A5.2.2#~builtin::version=5.2.2&hash=14eedb"],\ + ["vscode-languageclient", "npm:8.1.0"],\ + ["webpack", "virtual:114e6097baba06f1f7194aa147cc16af7c3daf193a49e5fc802ef9cf9d7ac56ceb0639593345639ab943707d850061c33067576340115e57cb282fb86146f6a5#npm:5.88.2"],\ + ["webpack-cli", "virtual:114e6097baba06f1f7194aa147cc16af7c3daf193a49e5fc802ef9cf9d7ac56ceb0639593345639ab943707d850061c33067576340115e57cb282fb86146f6a5#npm:5.1.4"]\ + ],\ + "linkType": "SOFT"\ + }]\ + ]],\ ["@osmium/manager", [\ ["workspace:manager", {\ "packageLocation": "./manager/",\ @@ -290,913 +477,3982 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { "linkType": "SOFT"\ }]\ ]],\ - ["acorn", [\ - ["npm:8.10.0", {\ - "packageLocation": "./.yarn/cache/acorn-npm-8.10.0-2230c9e83e-538ba38af0.zip/node_modules/acorn/",\ + ["@pkgjs/parseargs", [\ + ["npm:0.11.0", {\ + "packageLocation": "./.yarn/cache/@pkgjs-parseargs-npm-0.11.0-cd2a3fe948-6ad6a00fc4.zip/node_modules/@pkgjs/parseargs/",\ "packageDependencies": [\ - ["acorn", "npm:8.10.0"]\ + ["@pkgjs/parseargs", "npm:0.11.0"]\ ],\ "linkType": "HARD"\ }]\ ]],\ - ["acorn-jsx", [\ - ["npm:5.3.2", {\ - "packageLocation": "./.yarn/cache/acorn-jsx-npm-5.3.2-d7594599ea-c3d3b2a89c.zip/node_modules/acorn-jsx/",\ + ["@tootallnate/once", [\ + ["npm:1.1.2", {\ + "packageLocation": "./.yarn/cache/@tootallnate-once-npm-1.1.2-0517220057-e1fb1bbbc1.zip/node_modules/@tootallnate/once/",\ "packageDependencies": [\ - ["acorn-jsx", "npm:5.3.2"]\ + ["@tootallnate/once", "npm:1.1.2"]\ ],\ - "linkType": "SOFT"\ + "linkType": "HARD"\ }],\ - ["virtual:a50722a5a9326b6a5f12350c494c4db3aa0f4caeac45e3e9e5fe071da20014ecfe738fe2ebe2c9c98abae81a4ea86b42f56d776b3bd5ec37f9ad3670c242b242#npm:5.3.2", {\ - "packageLocation": "./.yarn/__virtual__/acorn-jsx-virtual-834321b202/0/cache/acorn-jsx-npm-5.3.2-d7594599ea-c3d3b2a89c.zip/node_modules/acorn-jsx/",\ + ["npm:2.0.0", {\ + "packageLocation": "./.yarn/cache/@tootallnate-once-npm-2.0.0-e36cf4f140-ad87447820.zip/node_modules/@tootallnate/once/",\ "packageDependencies": [\ - ["acorn-jsx", "virtual:a50722a5a9326b6a5f12350c494c4db3aa0f4caeac45e3e9e5fe071da20014ecfe738fe2ebe2c9c98abae81a4ea86b42f56d776b3bd5ec37f9ad3670c242b242#npm:5.3.2"],\ - ["@types/acorn", null],\ - ["acorn", "npm:8.10.0"]\ + ["@tootallnate/once", "npm:2.0.0"]\ ],\ - "packagePeers": [\ - "@types/acorn",\ - "acorn"\ + "linkType": "HARD"\ + }]\ + ]],\ + ["@types/eslint", [\ + ["npm:8.44.2", {\ + "packageLocation": "./.yarn/cache/@types-eslint-npm-8.44.2-6e9a6149b6-25b3ef61ba.zip/node_modules/@types/eslint/",\ + "packageDependencies": [\ + ["@types/eslint", "npm:8.44.2"],\ + ["@types/estree", "npm:1.0.1"],\ + ["@types/json-schema", "npm:7.0.12"]\ ],\ "linkType": "HARD"\ }]\ ]],\ - ["ajv", [\ - ["npm:6.12.6", {\ - "packageLocation": "./.yarn/cache/ajv-npm-6.12.6-4b5105e2b2-874972efe5.zip/node_modules/ajv/",\ + ["@types/eslint-scope", [\ + ["npm:3.7.4", {\ + "packageLocation": "./.yarn/cache/@types-eslint-scope-npm-3.7.4-c11d226d71-ea6a9363e9.zip/node_modules/@types/eslint-scope/",\ "packageDependencies": [\ - ["ajv", "npm:6.12.6"],\ - ["fast-deep-equal", "npm:3.1.3"],\ - ["fast-json-stable-stringify", "npm:2.1.0"],\ - ["json-schema-traverse", "npm:0.4.1"],\ - ["uri-js", "npm:4.4.1"]\ + ["@types/eslint-scope", "npm:3.7.4"],\ + ["@types/eslint", "npm:8.44.2"],\ + ["@types/estree", "npm:1.0.1"]\ ],\ "linkType": "HARD"\ }]\ ]],\ - ["ansi-regex", [\ - ["npm:5.0.1", {\ - "packageLocation": "./.yarn/cache/ansi-regex-npm-5.0.1-c963a48615-2aa4bb54ca.zip/node_modules/ansi-regex/",\ + ["@types/estree", [\ + ["npm:1.0.1", {\ + "packageLocation": "./.yarn/cache/@types-estree-npm-1.0.1-4c9469c165-e9aa175eac.zip/node_modules/@types/estree/",\ "packageDependencies": [\ - ["ansi-regex", "npm:5.0.1"]\ + ["@types/estree", "npm:1.0.1"]\ ],\ "linkType": "HARD"\ }]\ ]],\ - ["ansi-styles", [\ - ["npm:4.3.0", {\ - "packageLocation": "./.yarn/cache/ansi-styles-npm-4.3.0-245c7d42c7-513b44c3b2.zip/node_modules/ansi-styles/",\ + ["@types/glob", [\ + ["npm:8.1.0", {\ + "packageLocation": "./.yarn/cache/@types-glob-npm-8.1.0-bdb9d0520c-9101f3a906.zip/node_modules/@types/glob/",\ "packageDependencies": [\ - ["ansi-styles", "npm:4.3.0"],\ - ["color-convert", "npm:2.0.1"]\ + ["@types/glob", "npm:8.1.0"],\ + ["@types/minimatch", "npm:5.1.2"],\ + ["@types/node", "npm:20.6.0"]\ ],\ "linkType": "HARD"\ }]\ ]],\ - ["argparse", [\ - ["npm:2.0.1", {\ - "packageLocation": "./.yarn/cache/argparse-npm-2.0.1-faff7999e6-83644b5649.zip/node_modules/argparse/",\ + ["@types/json-schema", [\ + ["npm:7.0.12", {\ + "packageLocation": "./.yarn/cache/@types-json-schema-npm-7.0.12-f05cfc0e99-00239e9723.zip/node_modules/@types/json-schema/",\ "packageDependencies": [\ - ["argparse", "npm:2.0.1"]\ + ["@types/json-schema", "npm:7.0.12"]\ ],\ "linkType": "HARD"\ }]\ ]],\ - ["balanced-match", [\ - ["npm:1.0.2", {\ - "packageLocation": "./.yarn/cache/balanced-match-npm-1.0.2-a53c126459-9706c088a2.zip/node_modules/balanced-match/",\ + ["@types/minimatch", [\ + ["npm:5.1.2", {\ + "packageLocation": "./.yarn/cache/@types-minimatch-npm-5.1.2-aab9c394d3-0391a28286.zip/node_modules/@types/minimatch/",\ "packageDependencies": [\ - ["balanced-match", "npm:1.0.2"]\ + ["@types/minimatch", "npm:5.1.2"]\ ],\ "linkType": "HARD"\ }]\ ]],\ - ["brace-expansion", [\ - ["npm:1.1.11", {\ - "packageLocation": "./.yarn/cache/brace-expansion-npm-1.1.11-fb95eb05ad-faf34a7bb0.zip/node_modules/brace-expansion/",\ + ["@types/mocha", [\ + ["npm:10.0.1", {\ + "packageLocation": "./.yarn/cache/@types-mocha-npm-10.0.1-7c94e9e170-224ea9fce7.zip/node_modules/@types/mocha/",\ "packageDependencies": [\ - ["brace-expansion", "npm:1.1.11"],\ - ["balanced-match", "npm:1.0.2"],\ - ["concat-map", "npm:0.0.1"]\ + ["@types/mocha", "npm:10.0.1"]\ ],\ "linkType": "HARD"\ }]\ ]],\ - ["callsites", [\ - ["npm:3.1.0", {\ - "packageLocation": "./.yarn/cache/callsites-npm-3.1.0-268f989910-072d17b6ab.zip/node_modules/callsites/",\ + ["@types/node", [\ + ["npm:20.2.5", {\ + "packageLocation": "./.yarn/cache/@types-node-npm-20.2.5-0014d2d9ce-38ce7c7e9d.zip/node_modules/@types/node/",\ "packageDependencies": [\ - ["callsites", "npm:3.1.0"]\ + ["@types/node", "npm:20.2.5"]\ + ],\ + "linkType": "HARD"\ + }],\ + ["npm:20.6.0", {\ + "packageLocation": "./.yarn/cache/@types-node-npm-20.6.0-73d5022935-52611801af.zip/node_modules/@types/node/",\ + "packageDependencies": [\ + ["@types/node", "npm:20.6.0"]\ ],\ "linkType": "HARD"\ }]\ ]],\ - ["chalk", [\ - ["npm:4.1.2", {\ - "packageLocation": "./.yarn/cache/chalk-npm-4.1.2-ba8b67ab80-fe75c9d5c7.zip/node_modules/chalk/",\ + ["@types/semver", [\ + ["npm:7.5.1", {\ + "packageLocation": "./.yarn/cache/@types-semver-npm-7.5.1-cda240741c-2fffe938c7.zip/node_modules/@types/semver/",\ "packageDependencies": [\ - ["chalk", "npm:4.1.2"],\ - ["ansi-styles", "npm:4.3.0"],\ - ["supports-color", "npm:7.2.0"]\ + ["@types/semver", "npm:7.5.1"]\ ],\ "linkType": "HARD"\ }]\ ]],\ - ["color-convert", [\ - ["npm:2.0.1", {\ - "packageLocation": "./.yarn/cache/color-convert-npm-2.0.1-79730e935b-79e6bdb9fd.zip/node_modules/color-convert/",\ + ["@types/vscode", [\ + ["npm:1.82.0", {\ + "packageLocation": "./.yarn/cache/@types-vscode-npm-1.82.0-73aff2758d-2c546b61a0.zip/node_modules/@types/vscode/",\ "packageDependencies": [\ - ["color-convert", "npm:2.0.1"],\ - ["color-name", "npm:1.1.4"]\ + ["@types/vscode", "npm:1.82.0"]\ ],\ "linkType": "HARD"\ }]\ ]],\ - ["color-name", [\ - ["npm:1.1.4", {\ - "packageLocation": "./.yarn/cache/color-name-npm-1.1.4-025792b0ea-b044585952.zip/node_modules/color-name/",\ + ["@typescript-eslint/eslint-plugin", [\ + ["npm:5.62.0", {\ + "packageLocation": "./.yarn/cache/@typescript-eslint-eslint-plugin-npm-5.62.0-c48b9a5492-fc104b389c.zip/node_modules/@typescript-eslint/eslint-plugin/",\ "packageDependencies": [\ - ["color-name", "npm:1.1.4"]\ + ["@typescript-eslint/eslint-plugin", "npm:5.62.0"]\ + ],\ + "linkType": "SOFT"\ + }],\ + ["virtual:114e6097baba06f1f7194aa147cc16af7c3daf193a49e5fc802ef9cf9d7ac56ceb0639593345639ab943707d850061c33067576340115e57cb282fb86146f6a5#npm:5.62.0", {\ + "packageLocation": "./.yarn/__virtual__/@typescript-eslint-eslint-plugin-virtual-3aca1ca164/0/cache/@typescript-eslint-eslint-plugin-npm-5.62.0-c48b9a5492-fc104b389c.zip/node_modules/@typescript-eslint/eslint-plugin/",\ + "packageDependencies": [\ + ["@typescript-eslint/eslint-plugin", "virtual:114e6097baba06f1f7194aa147cc16af7c3daf193a49e5fc802ef9cf9d7ac56ceb0639593345639ab943707d850061c33067576340115e57cb282fb86146f6a5#npm:5.62.0"],\ + ["@eslint-community/regexpp", "npm:4.8.0"],\ + ["@types/eslint", null],\ + ["@types/typescript", null],\ + ["@types/typescript-eslint__parser", null],\ + ["@typescript-eslint/parser", "virtual:114e6097baba06f1f7194aa147cc16af7c3daf193a49e5fc802ef9cf9d7ac56ceb0639593345639ab943707d850061c33067576340115e57cb282fb86146f6a5#npm:5.62.0"],\ + ["@typescript-eslint/scope-manager", "npm:5.62.0"],\ + ["@typescript-eslint/type-utils", "virtual:3aca1ca16440e1ff7da0d6f5eed3f78efd0b8a2affea9a555b157df0fdba643060f7eef6665d606c0072b2d888384117b8c28f3e1839eba9cd360ad78efcb4d2#npm:5.62.0"],\ + ["@typescript-eslint/utils", "virtual:3aca1ca16440e1ff7da0d6f5eed3f78efd0b8a2affea9a555b157df0fdba643060f7eef6665d606c0072b2d888384117b8c28f3e1839eba9cd360ad78efcb4d2#npm:5.62.0"],\ + ["debug", "virtual:ced87d94ab05a28b44536eb0cd61a9458e757a0ae7bb35e5ab5d27e03d08b996abd275928b29aad2eb0973d5bb0800e75ba8ca3e26bf62cbe8ea0fae8cca70a8#npm:4.3.4"],\ + ["eslint", "npm:8.49.0"],\ + ["graphemer", "npm:1.4.0"],\ + ["ignore", "npm:5.2.4"],\ + ["natural-compare-lite", "npm:1.4.0"],\ + ["semver", "npm:7.5.4"],\ + ["tsutils", "virtual:3aca1ca16440e1ff7da0d6f5eed3f78efd0b8a2affea9a555b157df0fdba643060f7eef6665d606c0072b2d888384117b8c28f3e1839eba9cd360ad78efcb4d2#npm:3.21.0"],\ + ["typescript", "patch:typescript@npm%3A5.2.2#~builtin::version=5.2.2&hash=14eedb"]\ + ],\ + "packagePeers": [\ + "@types/eslint",\ + "@types/typescript-eslint__parser",\ + "@types/typescript",\ + "@typescript-eslint/parser",\ + "eslint",\ + "typescript"\ ],\ "linkType": "HARD"\ }]\ ]],\ - ["concat-map", [\ - ["npm:0.0.1", {\ - "packageLocation": "./.yarn/cache/concat-map-npm-0.0.1-85a921b7ee-902a9f5d89.zip/node_modules/concat-map/",\ + ["@typescript-eslint/parser", [\ + ["npm:5.62.0", {\ + "packageLocation": "./.yarn/cache/@typescript-eslint-parser-npm-5.62.0-c6b29fa302-d168f4c7f2.zip/node_modules/@typescript-eslint/parser/",\ "packageDependencies": [\ - ["concat-map", "npm:0.0.1"]\ + ["@typescript-eslint/parser", "npm:5.62.0"]\ + ],\ + "linkType": "SOFT"\ + }],\ + ["virtual:114e6097baba06f1f7194aa147cc16af7c3daf193a49e5fc802ef9cf9d7ac56ceb0639593345639ab943707d850061c33067576340115e57cb282fb86146f6a5#npm:5.62.0", {\ + "packageLocation": "./.yarn/__virtual__/@typescript-eslint-parser-virtual-34b9bf55e1/0/cache/@typescript-eslint-parser-npm-5.62.0-c6b29fa302-d168f4c7f2.zip/node_modules/@typescript-eslint/parser/",\ + "packageDependencies": [\ + ["@typescript-eslint/parser", "virtual:114e6097baba06f1f7194aa147cc16af7c3daf193a49e5fc802ef9cf9d7ac56ceb0639593345639ab943707d850061c33067576340115e57cb282fb86146f6a5#npm:5.62.0"],\ + ["@types/eslint", null],\ + ["@types/typescript", null],\ + ["@typescript-eslint/scope-manager", "npm:5.62.0"],\ + ["@typescript-eslint/types", "npm:5.62.0"],\ + ["@typescript-eslint/typescript-estree", "virtual:09a32c5d05445519672e7033850acc14806599ea4e35ceaa13d5f96f4ca63755fceba3d6f7c6e23aa5ec1c9d607a5bed84c29c92a52c0d9190e407626c2343da#npm:5.62.0"],\ + ["debug", "virtual:ced87d94ab05a28b44536eb0cd61a9458e757a0ae7bb35e5ab5d27e03d08b996abd275928b29aad2eb0973d5bb0800e75ba8ca3e26bf62cbe8ea0fae8cca70a8#npm:4.3.4"],\ + ["eslint", "npm:8.49.0"],\ + ["typescript", "patch:typescript@npm%3A5.2.2#~builtin::version=5.2.2&hash=14eedb"]\ + ],\ + "packagePeers": [\ + "@types/eslint",\ + "@types/typescript",\ + "eslint",\ + "typescript"\ ],\ "linkType": "HARD"\ }]\ ]],\ - ["cross-spawn", [\ - ["npm:7.0.3", {\ - "packageLocation": "./.yarn/cache/cross-spawn-npm-7.0.3-e4ff3e65b3-671cc7c728.zip/node_modules/cross-spawn/",\ + ["@typescript-eslint/scope-manager", [\ + ["npm:5.62.0", {\ + "packageLocation": "./.yarn/cache/@typescript-eslint-scope-manager-npm-5.62.0-c0013838b0-6062d6b797.zip/node_modules/@typescript-eslint/scope-manager/",\ "packageDependencies": [\ - ["cross-spawn", "npm:7.0.3"],\ - ["path-key", "npm:3.1.1"],\ - ["shebang-command", "npm:2.0.0"],\ - ["which", "npm:2.0.2"]\ + ["@typescript-eslint/scope-manager", "npm:5.62.0"],\ + ["@typescript-eslint/types", "npm:5.62.0"],\ + ["@typescript-eslint/visitor-keys", "npm:5.62.0"]\ ],\ "linkType": "HARD"\ }]\ ]],\ - ["debug", [\ - ["npm:4.3.4", {\ - "packageLocation": "./.yarn/cache/debug-npm-4.3.4-4513954577-3dbad3f94e.zip/node_modules/debug/",\ + ["@typescript-eslint/type-utils", [\ + ["npm:5.62.0", {\ + "packageLocation": "./.yarn/cache/@typescript-eslint-type-utils-npm-5.62.0-220216d668-fc41eece5f.zip/node_modules/@typescript-eslint/type-utils/",\ "packageDependencies": [\ - ["debug", "npm:4.3.4"]\ + ["@typescript-eslint/type-utils", "npm:5.62.0"]\ ],\ "linkType": "SOFT"\ }],\ - ["virtual:ced87d94ab05a28b44536eb0cd61a9458e757a0ae7bb35e5ab5d27e03d08b996abd275928b29aad2eb0973d5bb0800e75ba8ca3e26bf62cbe8ea0fae8cca70a8#npm:4.3.4", {\ - "packageLocation": "./.yarn/__virtual__/debug-virtual-023f479948/0/cache/debug-npm-4.3.4-4513954577-3dbad3f94e.zip/node_modules/debug/",\ + ["virtual:3aca1ca16440e1ff7da0d6f5eed3f78efd0b8a2affea9a555b157df0fdba643060f7eef6665d606c0072b2d888384117b8c28f3e1839eba9cd360ad78efcb4d2#npm:5.62.0", {\ + "packageLocation": "./.yarn/__virtual__/@typescript-eslint-type-utils-virtual-09a32c5d05/0/cache/@typescript-eslint-type-utils-npm-5.62.0-220216d668-fc41eece5f.zip/node_modules/@typescript-eslint/type-utils/",\ "packageDependencies": [\ + ["@typescript-eslint/type-utils", "virtual:3aca1ca16440e1ff7da0d6f5eed3f78efd0b8a2affea9a555b157df0fdba643060f7eef6665d606c0072b2d888384117b8c28f3e1839eba9cd360ad78efcb4d2#npm:5.62.0"],\ + ["@types/eslint", null],\ + ["@types/typescript", null],\ + ["@typescript-eslint/typescript-estree", "virtual:09a32c5d05445519672e7033850acc14806599ea4e35ceaa13d5f96f4ca63755fceba3d6f7c6e23aa5ec1c9d607a5bed84c29c92a52c0d9190e407626c2343da#npm:5.62.0"],\ + ["@typescript-eslint/utils", "virtual:3aca1ca16440e1ff7da0d6f5eed3f78efd0b8a2affea9a555b157df0fdba643060f7eef6665d606c0072b2d888384117b8c28f3e1839eba9cd360ad78efcb4d2#npm:5.62.0"],\ ["debug", "virtual:ced87d94ab05a28b44536eb0cd61a9458e757a0ae7bb35e5ab5d27e03d08b996abd275928b29aad2eb0973d5bb0800e75ba8ca3e26bf62cbe8ea0fae8cca70a8#npm:4.3.4"],\ - ["@types/supports-color", null],\ - ["ms", "npm:2.1.2"],\ - ["supports-color", null]\ + ["eslint", "npm:8.49.0"],\ + ["tsutils", "virtual:3aca1ca16440e1ff7da0d6f5eed3f78efd0b8a2affea9a555b157df0fdba643060f7eef6665d606c0072b2d888384117b8c28f3e1839eba9cd360ad78efcb4d2#npm:3.21.0"],\ + ["typescript", "patch:typescript@npm%3A5.2.2#~builtin::version=5.2.2&hash=14eedb"]\ ],\ "packagePeers": [\ - "@types/supports-color",\ - "supports-color"\ + "@types/eslint",\ + "@types/typescript",\ + "eslint",\ + "typescript"\ ],\ "linkType": "HARD"\ }]\ ]],\ - ["deep-is", [\ - ["npm:0.1.4", {\ - "packageLocation": "./.yarn/cache/deep-is-npm-0.1.4-88938b5a67-edb65dd0d7.zip/node_modules/deep-is/",\ + ["@typescript-eslint/types", [\ + ["npm:5.62.0", {\ + "packageLocation": "./.yarn/cache/@typescript-eslint-types-npm-5.62.0-5c2e0aab15-48c8711738.zip/node_modules/@typescript-eslint/types/",\ "packageDependencies": [\ - ["deep-is", "npm:0.1.4"]\ + ["@typescript-eslint/types", "npm:5.62.0"]\ ],\ "linkType": "HARD"\ }]\ ]],\ - ["doctrine", [\ - ["npm:3.0.0", {\ - "packageLocation": "./.yarn/cache/doctrine-npm-3.0.0-c6f1615f04-fd7673ca77.zip/node_modules/doctrine/",\ + ["@typescript-eslint/typescript-estree", [\ + ["npm:5.62.0", {\ + "packageLocation": "./.yarn/cache/@typescript-eslint-typescript-estree-npm-5.62.0-5d1ea132a9-3624520abb.zip/node_modules/@typescript-eslint/typescript-estree/",\ "packageDependencies": [\ - ["doctrine", "npm:3.0.0"],\ - ["esutils", "npm:2.0.3"]\ + ["@typescript-eslint/typescript-estree", "npm:5.62.0"]\ + ],\ + "linkType": "SOFT"\ + }],\ + ["virtual:09a32c5d05445519672e7033850acc14806599ea4e35ceaa13d5f96f4ca63755fceba3d6f7c6e23aa5ec1c9d607a5bed84c29c92a52c0d9190e407626c2343da#npm:5.62.0", {\ + "packageLocation": "./.yarn/__virtual__/@typescript-eslint-typescript-estree-virtual-7584c3ce67/0/cache/@typescript-eslint-typescript-estree-npm-5.62.0-5d1ea132a9-3624520abb.zip/node_modules/@typescript-eslint/typescript-estree/",\ + "packageDependencies": [\ + ["@typescript-eslint/typescript-estree", "virtual:09a32c5d05445519672e7033850acc14806599ea4e35ceaa13d5f96f4ca63755fceba3d6f7c6e23aa5ec1c9d607a5bed84c29c92a52c0d9190e407626c2343da#npm:5.62.0"],\ + ["@types/typescript", null],\ + ["@typescript-eslint/types", "npm:5.62.0"],\ + ["@typescript-eslint/visitor-keys", "npm:5.62.0"],\ + ["debug", "virtual:ced87d94ab05a28b44536eb0cd61a9458e757a0ae7bb35e5ab5d27e03d08b996abd275928b29aad2eb0973d5bb0800e75ba8ca3e26bf62cbe8ea0fae8cca70a8#npm:4.3.4"],\ + ["globby", "npm:11.1.0"],\ + ["is-glob", "npm:4.0.3"],\ + ["semver", "npm:7.5.4"],\ + ["tsutils", "virtual:3aca1ca16440e1ff7da0d6f5eed3f78efd0b8a2affea9a555b157df0fdba643060f7eef6665d606c0072b2d888384117b8c28f3e1839eba9cd360ad78efcb4d2#npm:3.21.0"],\ + ["typescript", "patch:typescript@npm%3A5.2.2#~builtin::version=5.2.2&hash=14eedb"]\ + ],\ + "packagePeers": [\ + "@types/typescript",\ + "typescript"\ + ],\ + "linkType": "HARD"\ + }],\ + ["virtual:2485497fabb6561c5ed091b21a93f92081faec16bdf12fb8700f0c5d6f41a9885e0707015e3dd31bfa247fced0568c0befc65eeed5e2802607799a38721425d3#npm:5.62.0", {\ + "packageLocation": "./.yarn/__virtual__/@typescript-eslint-typescript-estree-virtual-3c24b03900/0/cache/@typescript-eslint-typescript-estree-npm-5.62.0-5d1ea132a9-3624520abb.zip/node_modules/@typescript-eslint/typescript-estree/",\ + "packageDependencies": [\ + ["@typescript-eslint/typescript-estree", "virtual:2485497fabb6561c5ed091b21a93f92081faec16bdf12fb8700f0c5d6f41a9885e0707015e3dd31bfa247fced0568c0befc65eeed5e2802607799a38721425d3#npm:5.62.0"],\ + ["@types/typescript", null],\ + ["@typescript-eslint/types", "npm:5.62.0"],\ + ["@typescript-eslint/visitor-keys", "npm:5.62.0"],\ + ["debug", "virtual:ced87d94ab05a28b44536eb0cd61a9458e757a0ae7bb35e5ab5d27e03d08b996abd275928b29aad2eb0973d5bb0800e75ba8ca3e26bf62cbe8ea0fae8cca70a8#npm:4.3.4"],\ + ["globby", "npm:11.1.0"],\ + ["is-glob", "npm:4.0.3"],\ + ["semver", "npm:7.5.4"],\ + ["tsutils", "virtual:3c24b039002baf4da6de8f43a9856dedfe0870f0a250583774a5fe002029c55adf6dedcdc27b0c37b845157e72a671413cf99bdffefc9e78eecbe9051dc7da9a#npm:3.21.0"],\ + ["typescript", null]\ + ],\ + "packagePeers": [\ + "@types/typescript",\ + "typescript"\ ],\ "linkType": "HARD"\ }]\ ]],\ - ["escape-string-regexp", [\ - ["npm:4.0.0", {\ - "packageLocation": "./.yarn/cache/escape-string-regexp-npm-4.0.0-4b531d8d59-98b48897d9.zip/node_modules/escape-string-regexp/",\ + ["@typescript-eslint/utils", [\ + ["npm:5.62.0", {\ + "packageLocation": "./.yarn/cache/@typescript-eslint-utils-npm-5.62.0-907f2d579e-ee9398c8c5.zip/node_modules/@typescript-eslint/utils/",\ "packageDependencies": [\ - ["escape-string-regexp", "npm:4.0.0"]\ + ["@typescript-eslint/utils", "npm:5.62.0"]\ + ],\ + "linkType": "SOFT"\ + }],\ + ["virtual:3aca1ca16440e1ff7da0d6f5eed3f78efd0b8a2affea9a555b157df0fdba643060f7eef6665d606c0072b2d888384117b8c28f3e1839eba9cd360ad78efcb4d2#npm:5.62.0", {\ + "packageLocation": "./.yarn/__virtual__/@typescript-eslint-utils-virtual-2485497fab/0/cache/@typescript-eslint-utils-npm-5.62.0-907f2d579e-ee9398c8c5.zip/node_modules/@typescript-eslint/utils/",\ + "packageDependencies": [\ + ["@typescript-eslint/utils", "virtual:3aca1ca16440e1ff7da0d6f5eed3f78efd0b8a2affea9a555b157df0fdba643060f7eef6665d606c0072b2d888384117b8c28f3e1839eba9cd360ad78efcb4d2#npm:5.62.0"],\ + ["@eslint-community/eslint-utils", "virtual:1b802e43a1d6cfd4888588e031e9b9539c10922666207f02b37e1572beffa71b5952c5b88bdcc1e2ff0080ea3baa9b39a63225d9ea667488d5ab782bed5718c7#npm:4.4.0"],\ + ["@types/eslint", null],\ + ["@types/json-schema", "npm:7.0.12"],\ + ["@types/semver", "npm:7.5.1"],\ + ["@typescript-eslint/scope-manager", "npm:5.62.0"],\ + ["@typescript-eslint/types", "npm:5.62.0"],\ + ["@typescript-eslint/typescript-estree", "virtual:2485497fabb6561c5ed091b21a93f92081faec16bdf12fb8700f0c5d6f41a9885e0707015e3dd31bfa247fced0568c0befc65eeed5e2802607799a38721425d3#npm:5.62.0"],\ + ["eslint", "npm:8.49.0"],\ + ["eslint-scope", "npm:5.1.1"],\ + ["semver", "npm:7.5.4"]\ + ],\ + "packagePeers": [\ + "@types/eslint",\ + "eslint"\ ],\ "linkType": "HARD"\ }]\ ]],\ - ["eslint", [\ - ["npm:8.46.0", {\ - "packageLocation": "./.yarn/cache/eslint-npm-8.46.0-dc7af99e61-7a7d36b1a3.zip/node_modules/eslint/",\ + ["@typescript-eslint/visitor-keys", [\ + ["npm:5.62.0", {\ + "packageLocation": "./.yarn/cache/@typescript-eslint-visitor-keys-npm-5.62.0-da1af55f83-976b05d103.zip/node_modules/@typescript-eslint/visitor-keys/",\ + "packageDependencies": [\ + ["@typescript-eslint/visitor-keys", "npm:5.62.0"],\ + ["@typescript-eslint/types", "npm:5.62.0"],\ + ["eslint-visitor-keys", "npm:3.4.2"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["@vscode/test-electron", [\ + ["npm:2.3.4", {\ + "packageLocation": "./.yarn/cache/@vscode-test-electron-npm-2.3.4-cdb0185d02-78de21d66b.zip/node_modules/@vscode/test-electron/",\ + "packageDependencies": [\ + ["@vscode/test-electron", "npm:2.3.4"],\ + ["http-proxy-agent", "npm:4.0.1"],\ + ["https-proxy-agent", "npm:5.0.1"],\ + ["jszip", "npm:3.10.1"],\ + ["semver", "npm:7.5.4"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["@webassemblyjs/ast", [\ + ["npm:1.11.6", {\ + "packageLocation": "./.yarn/cache/@webassemblyjs-ast-npm-1.11.6-d3fd2bb49a-38ef1b526c.zip/node_modules/@webassemblyjs/ast/",\ + "packageDependencies": [\ + ["@webassemblyjs/ast", "npm:1.11.6"],\ + ["@webassemblyjs/helper-numbers", "npm:1.11.6"],\ + ["@webassemblyjs/helper-wasm-bytecode", "npm:1.11.6"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["@webassemblyjs/floating-point-hex-parser", [\ + ["npm:1.11.6", {\ + "packageLocation": "./.yarn/cache/@webassemblyjs-floating-point-hex-parser-npm-1.11.6-3a9928fc76-29b0875884.zip/node_modules/@webassemblyjs/floating-point-hex-parser/",\ + "packageDependencies": [\ + ["@webassemblyjs/floating-point-hex-parser", "npm:1.11.6"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["@webassemblyjs/helper-api-error", [\ + ["npm:1.11.6", {\ + "packageLocation": "./.yarn/cache/@webassemblyjs-helper-api-error-npm-1.11.6-75f6275ff4-e8563df851.zip/node_modules/@webassemblyjs/helper-api-error/",\ + "packageDependencies": [\ + ["@webassemblyjs/helper-api-error", "npm:1.11.6"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["@webassemblyjs/helper-buffer", [\ + ["npm:1.11.6", {\ + "packageLocation": "./.yarn/cache/@webassemblyjs-helper-buffer-npm-1.11.6-69996544b0-b14d0573bf.zip/node_modules/@webassemblyjs/helper-buffer/",\ + "packageDependencies": [\ + ["@webassemblyjs/helper-buffer", "npm:1.11.6"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["@webassemblyjs/helper-numbers", [\ + ["npm:1.11.6", {\ + "packageLocation": "./.yarn/cache/@webassemblyjs-helper-numbers-npm-1.11.6-819ddab1da-f4b562fa21.zip/node_modules/@webassemblyjs/helper-numbers/",\ + "packageDependencies": [\ + ["@webassemblyjs/helper-numbers", "npm:1.11.6"],\ + ["@webassemblyjs/floating-point-hex-parser", "npm:1.11.6"],\ + ["@webassemblyjs/helper-api-error", "npm:1.11.6"],\ + ["@xtuc/long", "npm:4.2.2"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["@webassemblyjs/helper-wasm-bytecode", [\ + ["npm:1.11.6", {\ + "packageLocation": "./.yarn/cache/@webassemblyjs-helper-wasm-bytecode-npm-1.11.6-3bc23747de-3535ef4f1f.zip/node_modules/@webassemblyjs/helper-wasm-bytecode/",\ + "packageDependencies": [\ + ["@webassemblyjs/helper-wasm-bytecode", "npm:1.11.6"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["@webassemblyjs/helper-wasm-section", [\ + ["npm:1.11.6", {\ + "packageLocation": "./.yarn/cache/@webassemblyjs-helper-wasm-section-npm-1.11.6-344f8ff2af-b2cf751bf4.zip/node_modules/@webassemblyjs/helper-wasm-section/",\ + "packageDependencies": [\ + ["@webassemblyjs/helper-wasm-section", "npm:1.11.6"],\ + ["@webassemblyjs/ast", "npm:1.11.6"],\ + ["@webassemblyjs/helper-buffer", "npm:1.11.6"],\ + ["@webassemblyjs/helper-wasm-bytecode", "npm:1.11.6"],\ + ["@webassemblyjs/wasm-gen", "npm:1.11.6"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["@webassemblyjs/ieee754", [\ + ["npm:1.11.6", {\ + "packageLocation": "./.yarn/cache/@webassemblyjs-ieee754-npm-1.11.6-95c92f446a-13574b8e41.zip/node_modules/@webassemblyjs/ieee754/",\ + "packageDependencies": [\ + ["@webassemblyjs/ieee754", "npm:1.11.6"],\ + ["@xtuc/ieee754", "npm:1.2.0"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["@webassemblyjs/leb128", [\ + ["npm:1.11.6", {\ + "packageLocation": "./.yarn/cache/@webassemblyjs-leb128-npm-1.11.6-697d62da2e-7ea942dc97.zip/node_modules/@webassemblyjs/leb128/",\ + "packageDependencies": [\ + ["@webassemblyjs/leb128", "npm:1.11.6"],\ + ["@xtuc/long", "npm:4.2.2"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["@webassemblyjs/utf8", [\ + ["npm:1.11.6", {\ + "packageLocation": "./.yarn/cache/@webassemblyjs-utf8-npm-1.11.6-102c4e5d68-807fe5b5ce.zip/node_modules/@webassemblyjs/utf8/",\ + "packageDependencies": [\ + ["@webassemblyjs/utf8", "npm:1.11.6"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["@webassemblyjs/wasm-edit", [\ + ["npm:1.11.6", {\ + "packageLocation": "./.yarn/cache/@webassemblyjs-wasm-edit-npm-1.11.6-8d2703f828-29ce758704.zip/node_modules/@webassemblyjs/wasm-edit/",\ + "packageDependencies": [\ + ["@webassemblyjs/wasm-edit", "npm:1.11.6"],\ + ["@webassemblyjs/ast", "npm:1.11.6"],\ + ["@webassemblyjs/helper-buffer", "npm:1.11.6"],\ + ["@webassemblyjs/helper-wasm-bytecode", "npm:1.11.6"],\ + ["@webassemblyjs/helper-wasm-section", "npm:1.11.6"],\ + ["@webassemblyjs/wasm-gen", "npm:1.11.6"],\ + ["@webassemblyjs/wasm-opt", "npm:1.11.6"],\ + ["@webassemblyjs/wasm-parser", "npm:1.11.6"],\ + ["@webassemblyjs/wast-printer", "npm:1.11.6"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["@webassemblyjs/wasm-gen", [\ + ["npm:1.11.6", {\ + "packageLocation": "./.yarn/cache/@webassemblyjs-wasm-gen-npm-1.11.6-0ca036cab0-a645a2eecb.zip/node_modules/@webassemblyjs/wasm-gen/",\ + "packageDependencies": [\ + ["@webassemblyjs/wasm-gen", "npm:1.11.6"],\ + ["@webassemblyjs/ast", "npm:1.11.6"],\ + ["@webassemblyjs/helper-wasm-bytecode", "npm:1.11.6"],\ + ["@webassemblyjs/ieee754", "npm:1.11.6"],\ + ["@webassemblyjs/leb128", "npm:1.11.6"],\ + ["@webassemblyjs/utf8", "npm:1.11.6"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["@webassemblyjs/wasm-opt", [\ + ["npm:1.11.6", {\ + "packageLocation": "./.yarn/cache/@webassemblyjs-wasm-opt-npm-1.11.6-8be3443975-b4557f1954.zip/node_modules/@webassemblyjs/wasm-opt/",\ + "packageDependencies": [\ + ["@webassemblyjs/wasm-opt", "npm:1.11.6"],\ + ["@webassemblyjs/ast", "npm:1.11.6"],\ + ["@webassemblyjs/helper-buffer", "npm:1.11.6"],\ + ["@webassemblyjs/wasm-gen", "npm:1.11.6"],\ + ["@webassemblyjs/wasm-parser", "npm:1.11.6"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["@webassemblyjs/wasm-parser", [\ + ["npm:1.11.6", {\ + "packageLocation": "./.yarn/cache/@webassemblyjs-wasm-parser-npm-1.11.6-88e2433c21-8200a8d77c.zip/node_modules/@webassemblyjs/wasm-parser/",\ + "packageDependencies": [\ + ["@webassemblyjs/wasm-parser", "npm:1.11.6"],\ + ["@webassemblyjs/ast", "npm:1.11.6"],\ + ["@webassemblyjs/helper-api-error", "npm:1.11.6"],\ + ["@webassemblyjs/helper-wasm-bytecode", "npm:1.11.6"],\ + ["@webassemblyjs/ieee754", "npm:1.11.6"],\ + ["@webassemblyjs/leb128", "npm:1.11.6"],\ + ["@webassemblyjs/utf8", "npm:1.11.6"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["@webassemblyjs/wast-printer", [\ + ["npm:1.11.6", {\ + "packageLocation": "./.yarn/cache/@webassemblyjs-wast-printer-npm-1.11.6-3191861e3f-d2fa6a4c42.zip/node_modules/@webassemblyjs/wast-printer/",\ + "packageDependencies": [\ + ["@webassemblyjs/wast-printer", "npm:1.11.6"],\ + ["@webassemblyjs/ast", "npm:1.11.6"],\ + ["@xtuc/long", "npm:4.2.2"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["@webpack-cli/configtest", [\ + ["npm:2.1.1", {\ + "packageLocation": "./.yarn/cache/@webpack-cli-configtest-npm-2.1.1-2aa637b6bc-9f9f9145c2.zip/node_modules/@webpack-cli/configtest/",\ + "packageDependencies": [\ + ["@webpack-cli/configtest", "npm:2.1.1"]\ + ],\ + "linkType": "SOFT"\ + }],\ + ["virtual:8ad348135e0848a579c70b3c72ac45cb01fbea9f7615ac07352453f68ac778fe8e57c5e7134a509f01e2186e4b4a924a1d476017d220e3e47d4d5c59aca52d8f#npm:2.1.1", {\ + "packageLocation": "./.yarn/__virtual__/@webpack-cli-configtest-virtual-953a62b3fa/0/cache/@webpack-cli-configtest-npm-2.1.1-2aa637b6bc-9f9f9145c2.zip/node_modules/@webpack-cli/configtest/",\ + "packageDependencies": [\ + ["@webpack-cli/configtest", "virtual:8ad348135e0848a579c70b3c72ac45cb01fbea9f7615ac07352453f68ac778fe8e57c5e7134a509f01e2186e4b4a924a1d476017d220e3e47d4d5c59aca52d8f#npm:2.1.1"],\ + ["@types/webpack", null],\ + ["@types/webpack-cli", null],\ + ["webpack", "virtual:114e6097baba06f1f7194aa147cc16af7c3daf193a49e5fc802ef9cf9d7ac56ceb0639593345639ab943707d850061c33067576340115e57cb282fb86146f6a5#npm:5.88.2"],\ + ["webpack-cli", "virtual:114e6097baba06f1f7194aa147cc16af7c3daf193a49e5fc802ef9cf9d7ac56ceb0639593345639ab943707d850061c33067576340115e57cb282fb86146f6a5#npm:5.1.4"]\ + ],\ + "packagePeers": [\ + "@types/webpack-cli",\ + "@types/webpack",\ + "webpack-cli",\ + "webpack"\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["@webpack-cli/info", [\ + ["npm:2.0.2", {\ + "packageLocation": "./.yarn/cache/@webpack-cli-info-npm-2.0.2-494be2e91a-8f9a178afc.zip/node_modules/@webpack-cli/info/",\ + "packageDependencies": [\ + ["@webpack-cli/info", "npm:2.0.2"]\ + ],\ + "linkType": "SOFT"\ + }],\ + ["virtual:8ad348135e0848a579c70b3c72ac45cb01fbea9f7615ac07352453f68ac778fe8e57c5e7134a509f01e2186e4b4a924a1d476017d220e3e47d4d5c59aca52d8f#npm:2.0.2", {\ + "packageLocation": "./.yarn/__virtual__/@webpack-cli-info-virtual-e8df45aa08/0/cache/@webpack-cli-info-npm-2.0.2-494be2e91a-8f9a178afc.zip/node_modules/@webpack-cli/info/",\ + "packageDependencies": [\ + ["@webpack-cli/info", "virtual:8ad348135e0848a579c70b3c72ac45cb01fbea9f7615ac07352453f68ac778fe8e57c5e7134a509f01e2186e4b4a924a1d476017d220e3e47d4d5c59aca52d8f#npm:2.0.2"],\ + ["@types/webpack", null],\ + ["@types/webpack-cli", null],\ + ["webpack", "virtual:114e6097baba06f1f7194aa147cc16af7c3daf193a49e5fc802ef9cf9d7ac56ceb0639593345639ab943707d850061c33067576340115e57cb282fb86146f6a5#npm:5.88.2"],\ + ["webpack-cli", "virtual:114e6097baba06f1f7194aa147cc16af7c3daf193a49e5fc802ef9cf9d7ac56ceb0639593345639ab943707d850061c33067576340115e57cb282fb86146f6a5#npm:5.1.4"]\ + ],\ + "packagePeers": [\ + "@types/webpack-cli",\ + "@types/webpack",\ + "webpack-cli",\ + "webpack"\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["@webpack-cli/serve", [\ + ["npm:2.0.5", {\ + "packageLocation": "./.yarn/cache/@webpack-cli-serve-npm-2.0.5-5a220c2601-75f0e54681.zip/node_modules/@webpack-cli/serve/",\ + "packageDependencies": [\ + ["@webpack-cli/serve", "npm:2.0.5"]\ + ],\ + "linkType": "SOFT"\ + }],\ + ["virtual:8ad348135e0848a579c70b3c72ac45cb01fbea9f7615ac07352453f68ac778fe8e57c5e7134a509f01e2186e4b4a924a1d476017d220e3e47d4d5c59aca52d8f#npm:2.0.5", {\ + "packageLocation": "./.yarn/__virtual__/@webpack-cli-serve-virtual-dd1f736c3f/0/cache/@webpack-cli-serve-npm-2.0.5-5a220c2601-75f0e54681.zip/node_modules/@webpack-cli/serve/",\ + "packageDependencies": [\ + ["@webpack-cli/serve", "virtual:8ad348135e0848a579c70b3c72ac45cb01fbea9f7615ac07352453f68ac778fe8e57c5e7134a509f01e2186e4b4a924a1d476017d220e3e47d4d5c59aca52d8f#npm:2.0.5"],\ + ["@types/webpack", null],\ + ["@types/webpack-cli", null],\ + ["@types/webpack-dev-server", null],\ + ["webpack", "virtual:114e6097baba06f1f7194aa147cc16af7c3daf193a49e5fc802ef9cf9d7ac56ceb0639593345639ab943707d850061c33067576340115e57cb282fb86146f6a5#npm:5.88.2"],\ + ["webpack-cli", "virtual:114e6097baba06f1f7194aa147cc16af7c3daf193a49e5fc802ef9cf9d7ac56ceb0639593345639ab943707d850061c33067576340115e57cb282fb86146f6a5#npm:5.1.4"],\ + ["webpack-dev-server", null]\ + ],\ + "packagePeers": [\ + "@types/webpack-cli",\ + "@types/webpack-dev-server",\ + "@types/webpack",\ + "webpack-cli",\ + "webpack-dev-server",\ + "webpack"\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["@xtuc/ieee754", [\ + ["npm:1.2.0", {\ + "packageLocation": "./.yarn/cache/@xtuc-ieee754-npm-1.2.0-ec0ce4e025-ac56d4ca6e.zip/node_modules/@xtuc/ieee754/",\ + "packageDependencies": [\ + ["@xtuc/ieee754", "npm:1.2.0"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["@xtuc/long", [\ + ["npm:4.2.2", {\ + "packageLocation": "./.yarn/cache/@xtuc-long-npm-4.2.2-37236e6d72-8ed0d477ce.zip/node_modules/@xtuc/long/",\ + "packageDependencies": [\ + ["@xtuc/long", "npm:4.2.2"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["abbrev", [\ + ["npm:1.1.1", {\ + "packageLocation": "./.yarn/cache/abbrev-npm-1.1.1-3659247eab-a4a97ec07d.zip/node_modules/abbrev/",\ + "packageDependencies": [\ + ["abbrev", "npm:1.1.1"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["acorn", [\ + ["npm:8.10.0", {\ + "packageLocation": "./.yarn/cache/acorn-npm-8.10.0-2230c9e83e-538ba38af0.zip/node_modules/acorn/",\ + "packageDependencies": [\ + ["acorn", "npm:8.10.0"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["acorn-import-assertions", [\ + ["npm:1.9.0", {\ + "packageLocation": "./.yarn/cache/acorn-import-assertions-npm-1.9.0-22f56507c7-944fb2659d.zip/node_modules/acorn-import-assertions/",\ + "packageDependencies": [\ + ["acorn-import-assertions", "npm:1.9.0"]\ + ],\ + "linkType": "SOFT"\ + }],\ + ["virtual:3ef4e983f64ff1a1e4c258f749269351ee3a43d8f85cba4f0b0f19708d052251a4e5cf013249fab72dce740ad98b16023faceb07b90994c348f059fa80742598#npm:1.9.0", {\ + "packageLocation": "./.yarn/__virtual__/acorn-import-assertions-virtual-3d8a833826/0/cache/acorn-import-assertions-npm-1.9.0-22f56507c7-944fb2659d.zip/node_modules/acorn-import-assertions/",\ + "packageDependencies": [\ + ["acorn-import-assertions", "virtual:3ef4e983f64ff1a1e4c258f749269351ee3a43d8f85cba4f0b0f19708d052251a4e5cf013249fab72dce740ad98b16023faceb07b90994c348f059fa80742598#npm:1.9.0"],\ + ["@types/acorn", null],\ + ["acorn", "npm:8.10.0"]\ + ],\ + "packagePeers": [\ + "@types/acorn",\ + "acorn"\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["acorn-jsx", [\ + ["npm:5.3.2", {\ + "packageLocation": "./.yarn/cache/acorn-jsx-npm-5.3.2-d7594599ea-c3d3b2a89c.zip/node_modules/acorn-jsx/",\ + "packageDependencies": [\ + ["acorn-jsx", "npm:5.3.2"]\ + ],\ + "linkType": "SOFT"\ + }],\ + ["virtual:a50722a5a9326b6a5f12350c494c4db3aa0f4caeac45e3e9e5fe071da20014ecfe738fe2ebe2c9c98abae81a4ea86b42f56d776b3bd5ec37f9ad3670c242b242#npm:5.3.2", {\ + "packageLocation": "./.yarn/__virtual__/acorn-jsx-virtual-834321b202/0/cache/acorn-jsx-npm-5.3.2-d7594599ea-c3d3b2a89c.zip/node_modules/acorn-jsx/",\ + "packageDependencies": [\ + ["acorn-jsx", "virtual:a50722a5a9326b6a5f12350c494c4db3aa0f4caeac45e3e9e5fe071da20014ecfe738fe2ebe2c9c98abae81a4ea86b42f56d776b3bd5ec37f9ad3670c242b242#npm:5.3.2"],\ + ["@types/acorn", null],\ + ["acorn", "npm:8.10.0"]\ + ],\ + "packagePeers": [\ + "@types/acorn",\ + "acorn"\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["agent-base", [\ + ["npm:6.0.2", {\ + "packageLocation": "./.yarn/cache/agent-base-npm-6.0.2-428f325a93-f52b6872cc.zip/node_modules/agent-base/",\ + "packageDependencies": [\ + ["agent-base", "npm:6.0.2"],\ + ["debug", "virtual:ced87d94ab05a28b44536eb0cd61a9458e757a0ae7bb35e5ab5d27e03d08b996abd275928b29aad2eb0973d5bb0800e75ba8ca3e26bf62cbe8ea0fae8cca70a8#npm:4.3.4"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["agentkeepalive", [\ + ["npm:4.5.0", {\ + "packageLocation": "./.yarn/cache/agentkeepalive-npm-4.5.0-f237b580b2-13278cd5b1.zip/node_modules/agentkeepalive/",\ + "packageDependencies": [\ + ["agentkeepalive", "npm:4.5.0"],\ + ["humanize-ms", "npm:1.2.1"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["aggregate-error", [\ + ["npm:3.1.0", {\ + "packageLocation": "./.yarn/cache/aggregate-error-npm-3.1.0-415a406f4e-1101a33f21.zip/node_modules/aggregate-error/",\ + "packageDependencies": [\ + ["aggregate-error", "npm:3.1.0"],\ + ["clean-stack", "npm:2.2.0"],\ + ["indent-string", "npm:4.0.0"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["ajv", [\ + ["npm:6.12.6", {\ + "packageLocation": "./.yarn/cache/ajv-npm-6.12.6-4b5105e2b2-874972efe5.zip/node_modules/ajv/",\ "packageDependencies": [\ - ["eslint", "npm:8.46.0"],\ - ["@eslint-community/eslint-utils", "virtual:dc7af99e618232ac0e2a751f560e2225037bf809144a4cc05369d5312b9d24061282984c0c0c6c5c199f3a0663f91f11c21afb60016655f472fa253e0b676e3b#npm:4.4.0"],\ - ["@eslint-community/regexpp", "npm:4.6.2"],\ - ["@eslint/eslintrc", "npm:2.1.1"],\ - ["@eslint/js", "npm:8.46.0"],\ - ["@humanwhocodes/config-array", "npm:0.11.10"],\ - ["@humanwhocodes/module-importer", "npm:1.0.1"],\ - ["@nodelib/fs.walk", "npm:1.2.8"],\ ["ajv", "npm:6.12.6"],\ - ["chalk", "npm:4.1.2"],\ - ["cross-spawn", "npm:7.0.3"],\ - ["debug", "virtual:ced87d94ab05a28b44536eb0cd61a9458e757a0ae7bb35e5ab5d27e03d08b996abd275928b29aad2eb0973d5bb0800e75ba8ca3e26bf62cbe8ea0fae8cca70a8#npm:4.3.4"],\ - ["doctrine", "npm:3.0.0"],\ - ["escape-string-regexp", "npm:4.0.0"],\ - ["eslint-scope", "npm:7.2.2"],\ - ["eslint-visitor-keys", "npm:3.4.2"],\ - ["espree", "npm:9.6.1"],\ - ["esquery", "npm:1.5.0"],\ - ["esutils", "npm:2.0.3"],\ ["fast-deep-equal", "npm:3.1.3"],\ - ["file-entry-cache", "npm:6.0.1"],\ - ["find-up", "npm:5.0.0"],\ - ["glob-parent", "npm:6.0.2"],\ - ["globals", "npm:13.20.0"],\ - ["graphemer", "npm:1.4.0"],\ - ["ignore", "npm:5.2.4"],\ - ["imurmurhash", "npm:0.1.4"],\ - ["is-glob", "npm:4.0.3"],\ - ["is-path-inside", "npm:3.0.3"],\ - ["js-yaml", "npm:4.1.0"],\ - ["json-stable-stringify-without-jsonify", "npm:1.0.1"],\ - ["levn", "npm:0.4.1"],\ - ["lodash.merge", "npm:4.6.2"],\ - ["minimatch", "npm:3.1.2"],\ - ["natural-compare", "npm:1.4.0"],\ - ["optionator", "npm:0.9.3"],\ - ["strip-ansi", "npm:6.0.1"],\ - ["text-table", "npm:0.2.0"]\ + ["fast-json-stable-stringify", "npm:2.1.0"],\ + ["json-schema-traverse", "npm:0.4.1"],\ + ["uri-js", "npm:4.4.1"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["ajv-keywords", [\ + ["npm:3.5.2", {\ + "packageLocation": "./.yarn/cache/ajv-keywords-npm-3.5.2-0e391b70e2-7dc5e59316.zip/node_modules/ajv-keywords/",\ + "packageDependencies": [\ + ["ajv-keywords", "npm:3.5.2"]\ + ],\ + "linkType": "SOFT"\ + }],\ + ["virtual:f2b36937f163b579815d3163513b3330d7a31aaf0599eea66346382b8838395c613f4204e9809cc2ff6bba09c17ab0c34b37deadcb147de7e2f5e535d6ccc245#npm:3.5.2", {\ + "packageLocation": "./.yarn/__virtual__/ajv-keywords-virtual-80fc73abbe/0/cache/ajv-keywords-npm-3.5.2-0e391b70e2-7dc5e59316.zip/node_modules/ajv-keywords/",\ + "packageDependencies": [\ + ["ajv-keywords", "virtual:f2b36937f163b579815d3163513b3330d7a31aaf0599eea66346382b8838395c613f4204e9809cc2ff6bba09c17ab0c34b37deadcb147de7e2f5e535d6ccc245#npm:3.5.2"],\ + ["@types/ajv", null],\ + ["ajv", "npm:6.12.6"]\ + ],\ + "packagePeers": [\ + "@types/ajv",\ + "ajv"\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["ansi-colors", [\ + ["npm:4.1.1", {\ + "packageLocation": "./.yarn/cache/ansi-colors-npm-4.1.1-97ad42f223-138d04a510.zip/node_modules/ansi-colors/",\ + "packageDependencies": [\ + ["ansi-colors", "npm:4.1.1"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["ansi-regex", [\ + ["npm:5.0.1", {\ + "packageLocation": "./.yarn/cache/ansi-regex-npm-5.0.1-c963a48615-2aa4bb54ca.zip/node_modules/ansi-regex/",\ + "packageDependencies": [\ + ["ansi-regex", "npm:5.0.1"]\ + ],\ + "linkType": "HARD"\ + }],\ + ["npm:6.0.1", {\ + "packageLocation": "./.yarn/cache/ansi-regex-npm-6.0.1-8d663a607d-1ff8b7667c.zip/node_modules/ansi-regex/",\ + "packageDependencies": [\ + ["ansi-regex", "npm:6.0.1"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["ansi-styles", [\ + ["npm:4.3.0", {\ + "packageLocation": "./.yarn/cache/ansi-styles-npm-4.3.0-245c7d42c7-513b44c3b2.zip/node_modules/ansi-styles/",\ + "packageDependencies": [\ + ["ansi-styles", "npm:4.3.0"],\ + ["color-convert", "npm:2.0.1"]\ + ],\ + "linkType": "HARD"\ + }],\ + ["npm:6.2.1", {\ + "packageLocation": "./.yarn/cache/ansi-styles-npm-6.2.1-d43647018c-ef940f2f0c.zip/node_modules/ansi-styles/",\ + "packageDependencies": [\ + ["ansi-styles", "npm:6.2.1"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["anymatch", [\ + ["npm:3.1.3", {\ + "packageLocation": "./.yarn/cache/anymatch-npm-3.1.3-bc81d103b1-3e044fd6d1.zip/node_modules/anymatch/",\ + "packageDependencies": [\ + ["anymatch", "npm:3.1.3"],\ + ["normalize-path", "npm:3.0.0"],\ + ["picomatch", "npm:2.3.1"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["aproba", [\ + ["npm:2.0.0", {\ + "packageLocation": "./.yarn/cache/aproba-npm-2.0.0-8716bcfde6-5615cadcfb.zip/node_modules/aproba/",\ + "packageDependencies": [\ + ["aproba", "npm:2.0.0"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["are-we-there-yet", [\ + ["npm:3.0.1", {\ + "packageLocation": "./.yarn/cache/are-we-there-yet-npm-3.0.1-3395b1512f-52590c2486.zip/node_modules/are-we-there-yet/",\ + "packageDependencies": [\ + ["are-we-there-yet", "npm:3.0.1"],\ + ["delegates", "npm:1.0.0"],\ + ["readable-stream", "npm:3.6.2"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["argparse", [\ + ["npm:2.0.1", {\ + "packageLocation": "./.yarn/cache/argparse-npm-2.0.1-faff7999e6-83644b5649.zip/node_modules/argparse/",\ + "packageDependencies": [\ + ["argparse", "npm:2.0.1"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["array-union", [\ + ["npm:2.1.0", {\ + "packageLocation": "./.yarn/cache/array-union-npm-2.1.0-4e4852b221-5bee12395c.zip/node_modules/array-union/",\ + "packageDependencies": [\ + ["array-union", "npm:2.1.0"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["balanced-match", [\ + ["npm:1.0.2", {\ + "packageLocation": "./.yarn/cache/balanced-match-npm-1.0.2-a53c126459-9706c088a2.zip/node_modules/balanced-match/",\ + "packageDependencies": [\ + ["balanced-match", "npm:1.0.2"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["binary-extensions", [\ + ["npm:2.2.0", {\ + "packageLocation": "./.yarn/cache/binary-extensions-npm-2.2.0-180c33fec7-ccd267956c.zip/node_modules/binary-extensions/",\ + "packageDependencies": [\ + ["binary-extensions", "npm:2.2.0"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["brace-expansion", [\ + ["npm:1.1.11", {\ + "packageLocation": "./.yarn/cache/brace-expansion-npm-1.1.11-fb95eb05ad-faf34a7bb0.zip/node_modules/brace-expansion/",\ + "packageDependencies": [\ + ["brace-expansion", "npm:1.1.11"],\ + ["balanced-match", "npm:1.0.2"],\ + ["concat-map", "npm:0.0.1"]\ + ],\ + "linkType": "HARD"\ + }],\ + ["npm:2.0.1", {\ + "packageLocation": "./.yarn/cache/brace-expansion-npm-2.0.1-17aa2616f9-a61e7cd2e8.zip/node_modules/brace-expansion/",\ + "packageDependencies": [\ + ["brace-expansion", "npm:2.0.1"],\ + ["balanced-match", "npm:1.0.2"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["braces", [\ + ["npm:3.0.2", {\ + "packageLocation": "./.yarn/cache/braces-npm-3.0.2-782240b28a-e2a8e769a8.zip/node_modules/braces/",\ + "packageDependencies": [\ + ["braces", "npm:3.0.2"],\ + ["fill-range", "npm:7.0.1"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["browser-stdout", [\ + ["npm:1.3.1", {\ + "packageLocation": "./.yarn/cache/browser-stdout-npm-1.3.1-6b2376bf3f-b717b19b25.zip/node_modules/browser-stdout/",\ + "packageDependencies": [\ + ["browser-stdout", "npm:1.3.1"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["browserslist", [\ + ["npm:4.21.10", {\ + "packageLocation": "./.yarn/cache/browserslist-npm-4.21.10-e2170a875b-1e27c0f111.zip/node_modules/browserslist/",\ + "packageDependencies": [\ + ["browserslist", "npm:4.21.10"],\ + ["caniuse-lite", "npm:1.0.30001532"],\ + ["electron-to-chromium", "npm:1.4.513"],\ + ["node-releases", "npm:2.0.13"],\ + ["update-browserslist-db", "virtual:e2170a875bba2f8fa9e93e47c65f2f250097e101a59d95ea6fd852f32965e8cd6cef3b5662aa7295279d5bc60c9a612ddb8515c7dd1b7e8fb9984dee1823e7d6#npm:1.0.11"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["buffer-from", [\ + ["npm:1.1.2", {\ + "packageLocation": "./.yarn/cache/buffer-from-npm-1.1.2-03d2f20d7e-0448524a56.zip/node_modules/buffer-from/",\ + "packageDependencies": [\ + ["buffer-from", "npm:1.1.2"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["cacache", [\ + ["npm:17.1.4", {\ + "packageLocation": "./.yarn/cache/cacache-npm-17.1.4-51ef53d0a8-b7751df756.zip/node_modules/cacache/",\ + "packageDependencies": [\ + ["cacache", "npm:17.1.4"],\ + ["@npmcli/fs", "npm:3.1.0"],\ + ["fs-minipass", "npm:3.0.3"],\ + ["glob", "npm:10.3.4"],\ + ["lru-cache", "npm:7.18.3"],\ + ["minipass", "npm:7.0.3"],\ + ["minipass-collect", "npm:1.0.2"],\ + ["minipass-flush", "npm:1.0.5"],\ + ["minipass-pipeline", "npm:1.2.4"],\ + ["p-map", "npm:4.0.0"],\ + ["ssri", "npm:10.0.5"],\ + ["tar", "npm:6.2.0"],\ + ["unique-filename", "npm:3.0.0"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["callsites", [\ + ["npm:3.1.0", {\ + "packageLocation": "./.yarn/cache/callsites-npm-3.1.0-268f989910-072d17b6ab.zip/node_modules/callsites/",\ + "packageDependencies": [\ + ["callsites", "npm:3.1.0"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["camelcase", [\ + ["npm:6.3.0", {\ + "packageLocation": "./.yarn/cache/camelcase-npm-6.3.0-e5e42a0d15-8c96818a90.zip/node_modules/camelcase/",\ + "packageDependencies": [\ + ["camelcase", "npm:6.3.0"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["caniuse-lite", [\ + ["npm:1.0.30001532", {\ + "packageLocation": "./.yarn/cache/caniuse-lite-npm-1.0.30001532-c9fe7ca084-613abeb15e.zip/node_modules/caniuse-lite/",\ + "packageDependencies": [\ + ["caniuse-lite", "npm:1.0.30001532"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["chalk", [\ + ["npm:4.1.2", {\ + "packageLocation": "./.yarn/cache/chalk-npm-4.1.2-ba8b67ab80-fe75c9d5c7.zip/node_modules/chalk/",\ + "packageDependencies": [\ + ["chalk", "npm:4.1.2"],\ + ["ansi-styles", "npm:4.3.0"],\ + ["supports-color", "npm:7.2.0"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["chokidar", [\ + ["npm:3.5.3", {\ + "packageLocation": "./.yarn/cache/chokidar-npm-3.5.3-c5f9b0a56a-b49fcde401.zip/node_modules/chokidar/",\ + "packageDependencies": [\ + ["chokidar", "npm:3.5.3"],\ + ["anymatch", "npm:3.1.3"],\ + ["braces", "npm:3.0.2"],\ + ["fsevents", "patch:fsevents@npm%3A2.3.3#~builtin::version=2.3.3&hash=df0bf1"],\ + ["glob-parent", "npm:5.1.2"],\ + ["is-binary-path", "npm:2.1.0"],\ + ["is-glob", "npm:4.0.3"],\ + ["normalize-path", "npm:3.0.0"],\ + ["readdirp", "npm:3.6.0"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["chownr", [\ + ["npm:2.0.0", {\ + "packageLocation": "./.yarn/cache/chownr-npm-2.0.0-638f1c9c61-c57cf9dd07.zip/node_modules/chownr/",\ + "packageDependencies": [\ + ["chownr", "npm:2.0.0"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["chrome-trace-event", [\ + ["npm:1.0.3", {\ + "packageLocation": "./.yarn/cache/chrome-trace-event-npm-1.0.3-e0ae3dcd60-cb8b1fc7e8.zip/node_modules/chrome-trace-event/",\ + "packageDependencies": [\ + ["chrome-trace-event", "npm:1.0.3"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["clean-stack", [\ + ["npm:2.2.0", {\ + "packageLocation": "./.yarn/cache/clean-stack-npm-2.2.0-a8ce435a5c-2ac8cd2b2f.zip/node_modules/clean-stack/",\ + "packageDependencies": [\ + ["clean-stack", "npm:2.2.0"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["cliui", [\ + ["npm:7.0.4", {\ + "packageLocation": "./.yarn/cache/cliui-npm-7.0.4-d6b8a9edb6-ce2e8f578a.zip/node_modules/cliui/",\ + "packageDependencies": [\ + ["cliui", "npm:7.0.4"],\ + ["string-width", "npm:4.2.3"],\ + ["strip-ansi", "npm:6.0.1"],\ + ["wrap-ansi", "npm:7.0.0"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["clone-deep", [\ + ["npm:4.0.1", {\ + "packageLocation": "./.yarn/cache/clone-deep-npm-4.0.1-70adab92c8-770f912fe4.zip/node_modules/clone-deep/",\ + "packageDependencies": [\ + ["clone-deep", "npm:4.0.1"],\ + ["is-plain-object", "npm:2.0.4"],\ + ["kind-of", "npm:6.0.3"],\ + ["shallow-clone", "npm:3.0.1"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["color-convert", [\ + ["npm:2.0.1", {\ + "packageLocation": "./.yarn/cache/color-convert-npm-2.0.1-79730e935b-79e6bdb9fd.zip/node_modules/color-convert/",\ + "packageDependencies": [\ + ["color-convert", "npm:2.0.1"],\ + ["color-name", "npm:1.1.4"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["color-name", [\ + ["npm:1.1.4", {\ + "packageLocation": "./.yarn/cache/color-name-npm-1.1.4-025792b0ea-b044585952.zip/node_modules/color-name/",\ + "packageDependencies": [\ + ["color-name", "npm:1.1.4"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["color-support", [\ + ["npm:1.1.3", {\ + "packageLocation": "./.yarn/cache/color-support-npm-1.1.3-3be5c53455-9b73568176.zip/node_modules/color-support/",\ + "packageDependencies": [\ + ["color-support", "npm:1.1.3"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["colorette", [\ + ["npm:2.0.20", {\ + "packageLocation": "./.yarn/cache/colorette-npm-2.0.20-692d428726-0c016fea2b.zip/node_modules/colorette/",\ + "packageDependencies": [\ + ["colorette", "npm:2.0.20"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["commander", [\ + ["npm:10.0.1", {\ + "packageLocation": "./.yarn/cache/commander-npm-10.0.1-f17613b72b-436901d64a.zip/node_modules/commander/",\ + "packageDependencies": [\ + ["commander", "npm:10.0.1"]\ + ],\ + "linkType": "HARD"\ + }],\ + ["npm:2.20.3", {\ + "packageLocation": "./.yarn/cache/commander-npm-2.20.3-d8dcbaa39b-ab8c07884e.zip/node_modules/commander/",\ + "packageDependencies": [\ + ["commander", "npm:2.20.3"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["concat-map", [\ + ["npm:0.0.1", {\ + "packageLocation": "./.yarn/cache/concat-map-npm-0.0.1-85a921b7ee-902a9f5d89.zip/node_modules/concat-map/",\ + "packageDependencies": [\ + ["concat-map", "npm:0.0.1"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["console-control-strings", [\ + ["npm:1.1.0", {\ + "packageLocation": "./.yarn/cache/console-control-strings-npm-1.1.0-e3160e5275-8755d76787.zip/node_modules/console-control-strings/",\ + "packageDependencies": [\ + ["console-control-strings", "npm:1.1.0"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["core-util-is", [\ + ["npm:1.0.3", {\ + "packageLocation": "./.yarn/cache/core-util-is-npm-1.0.3-ca74b76c90-9de8597363.zip/node_modules/core-util-is/",\ + "packageDependencies": [\ + ["core-util-is", "npm:1.0.3"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["cross-spawn", [\ + ["npm:7.0.3", {\ + "packageLocation": "./.yarn/cache/cross-spawn-npm-7.0.3-e4ff3e65b3-671cc7c728.zip/node_modules/cross-spawn/",\ + "packageDependencies": [\ + ["cross-spawn", "npm:7.0.3"],\ + ["path-key", "npm:3.1.1"],\ + ["shebang-command", "npm:2.0.0"],\ + ["which", "npm:2.0.2"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["debug", [\ + ["npm:4.3.4", {\ + "packageLocation": "./.yarn/cache/debug-npm-4.3.4-4513954577-3dbad3f94e.zip/node_modules/debug/",\ + "packageDependencies": [\ + ["debug", "npm:4.3.4"]\ + ],\ + "linkType": "SOFT"\ + }],\ + ["virtual:87db25c7c5e6b25bbc12571091cdabc648b79d427ab445d1714ccfdcdfb3265c9de6561ca760cc3de470037cbedf3af4be56ba3b684b3a1c01d4c9c2fd55a741#npm:4.3.4", {\ + "packageLocation": "./.yarn/__virtual__/debug-virtual-762d08cbe9/0/cache/debug-npm-4.3.4-4513954577-3dbad3f94e.zip/node_modules/debug/",\ + "packageDependencies": [\ + ["debug", "virtual:87db25c7c5e6b25bbc12571091cdabc648b79d427ab445d1714ccfdcdfb3265c9de6561ca760cc3de470037cbedf3af4be56ba3b684b3a1c01d4c9c2fd55a741#npm:4.3.4"],\ + ["@types/supports-color", null],\ + ["ms", "npm:2.1.2"],\ + ["supports-color", "npm:8.1.1"]\ + ],\ + "packagePeers": [\ + "@types/supports-color",\ + "supports-color"\ + ],\ + "linkType": "HARD"\ + }],\ + ["virtual:ced87d94ab05a28b44536eb0cd61a9458e757a0ae7bb35e5ab5d27e03d08b996abd275928b29aad2eb0973d5bb0800e75ba8ca3e26bf62cbe8ea0fae8cca70a8#npm:4.3.4", {\ + "packageLocation": "./.yarn/__virtual__/debug-virtual-023f479948/0/cache/debug-npm-4.3.4-4513954577-3dbad3f94e.zip/node_modules/debug/",\ + "packageDependencies": [\ + ["debug", "virtual:ced87d94ab05a28b44536eb0cd61a9458e757a0ae7bb35e5ab5d27e03d08b996abd275928b29aad2eb0973d5bb0800e75ba8ca3e26bf62cbe8ea0fae8cca70a8#npm:4.3.4"],\ + ["@types/supports-color", null],\ + ["ms", "npm:2.1.2"],\ + ["supports-color", null]\ + ],\ + "packagePeers": [\ + "@types/supports-color",\ + "supports-color"\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["decamelize", [\ + ["npm:4.0.0", {\ + "packageLocation": "./.yarn/cache/decamelize-npm-4.0.0-12410e3409-b7d09b8265.zip/node_modules/decamelize/",\ + "packageDependencies": [\ + ["decamelize", "npm:4.0.0"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["deep-is", [\ + ["npm:0.1.4", {\ + "packageLocation": "./.yarn/cache/deep-is-npm-0.1.4-88938b5a67-edb65dd0d7.zip/node_modules/deep-is/",\ + "packageDependencies": [\ + ["deep-is", "npm:0.1.4"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["delegates", [\ + ["npm:1.0.0", {\ + "packageLocation": "./.yarn/cache/delegates-npm-1.0.0-9b1942d75f-a51744d9b5.zip/node_modules/delegates/",\ + "packageDependencies": [\ + ["delegates", "npm:1.0.0"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["diff", [\ + ["npm:5.0.0", {\ + "packageLocation": "./.yarn/cache/diff-npm-5.0.0-ad6900db18-f19fe29284.zip/node_modules/diff/",\ + "packageDependencies": [\ + ["diff", "npm:5.0.0"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["dir-glob", [\ + ["npm:3.0.1", {\ + "packageLocation": "./.yarn/cache/dir-glob-npm-3.0.1-1aea628b1b-fa05e18324.zip/node_modules/dir-glob/",\ + "packageDependencies": [\ + ["dir-glob", "npm:3.0.1"],\ + ["path-type", "npm:4.0.0"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["doctrine", [\ + ["npm:3.0.0", {\ + "packageLocation": "./.yarn/cache/doctrine-npm-3.0.0-c6f1615f04-fd7673ca77.zip/node_modules/doctrine/",\ + "packageDependencies": [\ + ["doctrine", "npm:3.0.0"],\ + ["esutils", "npm:2.0.3"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["eastasianwidth", [\ + ["npm:0.2.0", {\ + "packageLocation": "./.yarn/cache/eastasianwidth-npm-0.2.0-c37eb16bd1-7d00d7cd8e.zip/node_modules/eastasianwidth/",\ + "packageDependencies": [\ + ["eastasianwidth", "npm:0.2.0"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["electron-to-chromium", [\ + ["npm:1.4.513", {\ + "packageLocation": "./.yarn/cache/electron-to-chromium-npm-1.4.513-bc6fee1f42-613b66da17.zip/node_modules/electron-to-chromium/",\ + "packageDependencies": [\ + ["electron-to-chromium", "npm:1.4.513"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["emoji-regex", [\ + ["npm:8.0.0", {\ + "packageLocation": "./.yarn/cache/emoji-regex-npm-8.0.0-213764015c-d4c5c39d5a.zip/node_modules/emoji-regex/",\ + "packageDependencies": [\ + ["emoji-regex", "npm:8.0.0"]\ + ],\ + "linkType": "HARD"\ + }],\ + ["npm:9.2.2", {\ + "packageLocation": "./.yarn/cache/emoji-regex-npm-9.2.2-e6fac8d058-8487182da7.zip/node_modules/emoji-regex/",\ + "packageDependencies": [\ + ["emoji-regex", "npm:9.2.2"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["encoding", [\ + ["npm:0.1.13", {\ + "packageLocation": "./.yarn/cache/encoding-npm-0.1.13-82a1837d30-bb98632f8f.zip/node_modules/encoding/",\ + "packageDependencies": [\ + ["encoding", "npm:0.1.13"],\ + ["iconv-lite", "npm:0.6.3"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["enhanced-resolve", [\ + ["npm:5.15.0", {\ + "packageLocation": "./.yarn/cache/enhanced-resolve-npm-5.15.0-16eb7ddef9-fbd8cdc926.zip/node_modules/enhanced-resolve/",\ + "packageDependencies": [\ + ["enhanced-resolve", "npm:5.15.0"],\ + ["graceful-fs", "npm:4.2.11"],\ + ["tapable", "npm:2.2.1"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["env-paths", [\ + ["npm:2.2.1", {\ + "packageLocation": "./.yarn/cache/env-paths-npm-2.2.1-7c7577428c-65b5df55a8.zip/node_modules/env-paths/",\ + "packageDependencies": [\ + ["env-paths", "npm:2.2.1"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["envinfo", [\ + ["npm:7.10.0", {\ + "packageLocation": "./.yarn/cache/envinfo-npm-7.10.0-cba8c054d4-05e81a5768.zip/node_modules/envinfo/",\ + "packageDependencies": [\ + ["envinfo", "npm:7.10.0"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["err-code", [\ + ["npm:2.0.3", {\ + "packageLocation": "./.yarn/cache/err-code-npm-2.0.3-082e0ff9a7-8b7b1be20d.zip/node_modules/err-code/",\ + "packageDependencies": [\ + ["err-code", "npm:2.0.3"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["es-module-lexer", [\ + ["npm:1.3.0", {\ + "packageLocation": "./.yarn/cache/es-module-lexer-npm-1.3.0-9be5e8b1c4-48fd9f504a.zip/node_modules/es-module-lexer/",\ + "packageDependencies": [\ + ["es-module-lexer", "npm:1.3.0"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["escalade", [\ + ["npm:3.1.1", {\ + "packageLocation": "./.yarn/cache/escalade-npm-3.1.1-e02da076aa-a3e2a99f07.zip/node_modules/escalade/",\ + "packageDependencies": [\ + ["escalade", "npm:3.1.1"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["escape-string-regexp", [\ + ["npm:4.0.0", {\ + "packageLocation": "./.yarn/cache/escape-string-regexp-npm-4.0.0-4b531d8d59-98b48897d9.zip/node_modules/escape-string-regexp/",\ + "packageDependencies": [\ + ["escape-string-regexp", "npm:4.0.0"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["eslint", [\ + ["npm:8.46.0", {\ + "packageLocation": "./.yarn/cache/eslint-npm-8.46.0-dc7af99e61-7a7d36b1a3.zip/node_modules/eslint/",\ + "packageDependencies": [\ + ["eslint", "npm:8.46.0"],\ + ["@eslint-community/eslint-utils", "virtual:dc7af99e618232ac0e2a751f560e2225037bf809144a4cc05369d5312b9d24061282984c0c0c6c5c199f3a0663f91f11c21afb60016655f472fa253e0b676e3b#npm:4.4.0"],\ + ["@eslint-community/regexpp", "npm:4.6.2"],\ + ["@eslint/eslintrc", "npm:2.1.1"],\ + ["@eslint/js", "npm:8.46.0"],\ + ["@humanwhocodes/config-array", "npm:0.11.10"],\ + ["@humanwhocodes/module-importer", "npm:1.0.1"],\ + ["@nodelib/fs.walk", "npm:1.2.8"],\ + ["ajv", "npm:6.12.6"],\ + ["chalk", "npm:4.1.2"],\ + ["cross-spawn", "npm:7.0.3"],\ + ["debug", "virtual:ced87d94ab05a28b44536eb0cd61a9458e757a0ae7bb35e5ab5d27e03d08b996abd275928b29aad2eb0973d5bb0800e75ba8ca3e26bf62cbe8ea0fae8cca70a8#npm:4.3.4"],\ + ["doctrine", "npm:3.0.0"],\ + ["escape-string-regexp", "npm:4.0.0"],\ + ["eslint-scope", "npm:7.2.2"],\ + ["eslint-visitor-keys", "npm:3.4.2"],\ + ["espree", "npm:9.6.1"],\ + ["esquery", "npm:1.5.0"],\ + ["esutils", "npm:2.0.3"],\ + ["fast-deep-equal", "npm:3.1.3"],\ + ["file-entry-cache", "npm:6.0.1"],\ + ["find-up", "npm:5.0.0"],\ + ["glob-parent", "npm:6.0.2"],\ + ["globals", "npm:13.20.0"],\ + ["graphemer", "npm:1.4.0"],\ + ["ignore", "npm:5.2.4"],\ + ["imurmurhash", "npm:0.1.4"],\ + ["is-glob", "npm:4.0.3"],\ + ["is-path-inside", "npm:3.0.3"],\ + ["js-yaml", "npm:4.1.0"],\ + ["json-stable-stringify-without-jsonify", "npm:1.0.1"],\ + ["levn", "npm:0.4.1"],\ + ["lodash.merge", "npm:4.6.2"],\ + ["minimatch", "npm:3.1.2"],\ + ["natural-compare", "npm:1.4.0"],\ + ["optionator", "npm:0.9.3"],\ + ["strip-ansi", "npm:6.0.1"],\ + ["text-table", "npm:0.2.0"]\ + ],\ + "linkType": "HARD"\ + }],\ + ["npm:8.49.0", {\ + "packageLocation": "./.yarn/cache/eslint-npm-8.49.0-1b802e43a1-4dfe257e1e.zip/node_modules/eslint/",\ + "packageDependencies": [\ + ["eslint", "npm:8.49.0"],\ + ["@eslint-community/eslint-utils", "virtual:1b802e43a1d6cfd4888588e031e9b9539c10922666207f02b37e1572beffa71b5952c5b88bdcc1e2ff0080ea3baa9b39a63225d9ea667488d5ab782bed5718c7#npm:4.4.0"],\ + ["@eslint-community/regexpp", "npm:4.6.2"],\ + ["@eslint/eslintrc", "npm:2.1.2"],\ + ["@eslint/js", "npm:8.49.0"],\ + ["@humanwhocodes/config-array", "npm:0.11.11"],\ + ["@humanwhocodes/module-importer", "npm:1.0.1"],\ + ["@nodelib/fs.walk", "npm:1.2.8"],\ + ["ajv", "npm:6.12.6"],\ + ["chalk", "npm:4.1.2"],\ + ["cross-spawn", "npm:7.0.3"],\ + ["debug", "virtual:ced87d94ab05a28b44536eb0cd61a9458e757a0ae7bb35e5ab5d27e03d08b996abd275928b29aad2eb0973d5bb0800e75ba8ca3e26bf62cbe8ea0fae8cca70a8#npm:4.3.4"],\ + ["doctrine", "npm:3.0.0"],\ + ["escape-string-regexp", "npm:4.0.0"],\ + ["eslint-scope", "npm:7.2.2"],\ + ["eslint-visitor-keys", "npm:3.4.3"],\ + ["espree", "npm:9.6.1"],\ + ["esquery", "npm:1.5.0"],\ + ["esutils", "npm:2.0.3"],\ + ["fast-deep-equal", "npm:3.1.3"],\ + ["file-entry-cache", "npm:6.0.1"],\ + ["find-up", "npm:5.0.0"],\ + ["glob-parent", "npm:6.0.2"],\ + ["globals", "npm:13.20.0"],\ + ["graphemer", "npm:1.4.0"],\ + ["ignore", "npm:5.2.4"],\ + ["imurmurhash", "npm:0.1.4"],\ + ["is-glob", "npm:4.0.3"],\ + ["is-path-inside", "npm:3.0.3"],\ + ["js-yaml", "npm:4.1.0"],\ + ["json-stable-stringify-without-jsonify", "npm:1.0.1"],\ + ["levn", "npm:0.4.1"],\ + ["lodash.merge", "npm:4.6.2"],\ + ["minimatch", "npm:3.1.2"],\ + ["natural-compare", "npm:1.4.0"],\ + ["optionator", "npm:0.9.3"],\ + ["strip-ansi", "npm:6.0.1"],\ + ["text-table", "npm:0.2.0"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["eslint-scope", [\ + ["npm:5.1.1", {\ + "packageLocation": "./.yarn/cache/eslint-scope-npm-5.1.1-71fe59b18a-47e4b6a3f0.zip/node_modules/eslint-scope/",\ + "packageDependencies": [\ + ["eslint-scope", "npm:5.1.1"],\ + ["esrecurse", "npm:4.3.0"],\ + ["estraverse", "npm:4.3.0"]\ + ],\ + "linkType": "HARD"\ + }],\ + ["npm:7.2.2", {\ + "packageLocation": "./.yarn/cache/eslint-scope-npm-7.2.2-53cb0df8e8-ec97dbf5fb.zip/node_modules/eslint-scope/",\ + "packageDependencies": [\ + ["eslint-scope", "npm:7.2.2"],\ + ["esrecurse", "npm:4.3.0"],\ + ["estraverse", "npm:5.3.0"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["eslint-visitor-keys", [\ + ["npm:3.4.2", {\ + "packageLocation": "./.yarn/cache/eslint-visitor-keys-npm-3.4.2-304459f972-9e0e7e4aae.zip/node_modules/eslint-visitor-keys/",\ + "packageDependencies": [\ + ["eslint-visitor-keys", "npm:3.4.2"]\ + ],\ + "linkType": "HARD"\ + }],\ + ["npm:3.4.3", {\ + "packageLocation": "./.yarn/cache/eslint-visitor-keys-npm-3.4.3-a356ac7e46-36e9ef87fc.zip/node_modules/eslint-visitor-keys/",\ + "packageDependencies": [\ + ["eslint-visitor-keys", "npm:3.4.3"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["espree", [\ + ["npm:9.6.1", {\ + "packageLocation": "./.yarn/cache/espree-npm-9.6.1-a50722a5a9-eb8c149c7a.zip/node_modules/espree/",\ + "packageDependencies": [\ + ["espree", "npm:9.6.1"],\ + ["acorn", "npm:8.10.0"],\ + ["acorn-jsx", "virtual:a50722a5a9326b6a5f12350c494c4db3aa0f4caeac45e3e9e5fe071da20014ecfe738fe2ebe2c9c98abae81a4ea86b42f56d776b3bd5ec37f9ad3670c242b242#npm:5.3.2"],\ + ["eslint-visitor-keys", "npm:3.4.2"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["esquery", [\ + ["npm:1.5.0", {\ + "packageLocation": "./.yarn/cache/esquery-npm-1.5.0-d8f8a06879-aefb0d2596.zip/node_modules/esquery/",\ + "packageDependencies": [\ + ["esquery", "npm:1.5.0"],\ + ["estraverse", "npm:5.3.0"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["esrecurse", [\ + ["npm:4.3.0", {\ + "packageLocation": "./.yarn/cache/esrecurse-npm-4.3.0-10b86a887a-ebc17b1a33.zip/node_modules/esrecurse/",\ + "packageDependencies": [\ + ["esrecurse", "npm:4.3.0"],\ + ["estraverse", "npm:5.3.0"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["estraverse", [\ + ["npm:4.3.0", {\ + "packageLocation": "./.yarn/cache/estraverse-npm-4.3.0-920a32f3c6-a6299491f9.zip/node_modules/estraverse/",\ + "packageDependencies": [\ + ["estraverse", "npm:4.3.0"]\ + ],\ + "linkType": "HARD"\ + }],\ + ["npm:5.3.0", {\ + "packageLocation": "./.yarn/cache/estraverse-npm-5.3.0-03284f8f63-072780882d.zip/node_modules/estraverse/",\ + "packageDependencies": [\ + ["estraverse", "npm:5.3.0"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["esutils", [\ + ["npm:2.0.3", {\ + "packageLocation": "./.yarn/cache/esutils-npm-2.0.3-f865beafd5-22b5b08f74.zip/node_modules/esutils/",\ + "packageDependencies": [\ + ["esutils", "npm:2.0.3"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["events", [\ + ["npm:3.3.0", {\ + "packageLocation": "./.yarn/cache/events-npm-3.3.0-c280bc7e48-f6f487ad21.zip/node_modules/events/",\ + "packageDependencies": [\ + ["events", "npm:3.3.0"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["exponential-backoff", [\ + ["npm:3.1.1", {\ + "packageLocation": "./.yarn/cache/exponential-backoff-npm-3.1.1-04df458b30-3d21519a4f.zip/node_modules/exponential-backoff/",\ + "packageDependencies": [\ + ["exponential-backoff", "npm:3.1.1"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["fast-deep-equal", [\ + ["npm:3.1.3", {\ + "packageLocation": "./.yarn/cache/fast-deep-equal-npm-3.1.3-790edcfcf5-e21a9d8d84.zip/node_modules/fast-deep-equal/",\ + "packageDependencies": [\ + ["fast-deep-equal", "npm:3.1.3"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["fast-glob", [\ + ["npm:3.3.1", {\ + "packageLocation": "./.yarn/cache/fast-glob-npm-3.3.1-8045ff8f4d-b6f3add640.zip/node_modules/fast-glob/",\ + "packageDependencies": [\ + ["fast-glob", "npm:3.3.1"],\ + ["@nodelib/fs.stat", "npm:2.0.5"],\ + ["@nodelib/fs.walk", "npm:1.2.8"],\ + ["glob-parent", "npm:5.1.2"],\ + ["merge2", "npm:1.4.1"],\ + ["micromatch", "npm:4.0.5"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["fast-json-stable-stringify", [\ + ["npm:2.1.0", {\ + "packageLocation": "./.yarn/cache/fast-json-stable-stringify-npm-2.1.0-02e8905fda-b191531e36.zip/node_modules/fast-json-stable-stringify/",\ + "packageDependencies": [\ + ["fast-json-stable-stringify", "npm:2.1.0"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["fast-levenshtein", [\ + ["npm:2.0.6", {\ + "packageLocation": "./.yarn/cache/fast-levenshtein-npm-2.0.6-fcd74b8df5-92cfec0a8d.zip/node_modules/fast-levenshtein/",\ + "packageDependencies": [\ + ["fast-levenshtein", "npm:2.0.6"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["fastest-levenshtein", [\ + ["npm:1.0.16", {\ + "packageLocation": "./.yarn/cache/fastest-levenshtein-npm-1.0.16-192d328856-a78d44285c.zip/node_modules/fastest-levenshtein/",\ + "packageDependencies": [\ + ["fastest-levenshtein", "npm:1.0.16"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["fastq", [\ + ["npm:1.15.0", {\ + "packageLocation": "./.yarn/cache/fastq-npm-1.15.0-1013f6514e-0170e6bfcd.zip/node_modules/fastq/",\ + "packageDependencies": [\ + ["fastq", "npm:1.15.0"],\ + ["reusify", "npm:1.0.4"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["file-entry-cache", [\ + ["npm:6.0.1", {\ + "packageLocation": "./.yarn/cache/file-entry-cache-npm-6.0.1-31965cf0af-f49701feaa.zip/node_modules/file-entry-cache/",\ + "packageDependencies": [\ + ["file-entry-cache", "npm:6.0.1"],\ + ["flat-cache", "npm:3.0.4"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["fill-range", [\ + ["npm:7.0.1", {\ + "packageLocation": "./.yarn/cache/fill-range-npm-7.0.1-b8b1817caa-cc283f4e65.zip/node_modules/fill-range/",\ + "packageDependencies": [\ + ["fill-range", "npm:7.0.1"],\ + ["to-regex-range", "npm:5.0.1"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["find-up", [\ + ["npm:4.1.0", {\ + "packageLocation": "./.yarn/cache/find-up-npm-4.1.0-c3ccf8d855-4c172680e8.zip/node_modules/find-up/",\ + "packageDependencies": [\ + ["find-up", "npm:4.1.0"],\ + ["locate-path", "npm:5.0.0"],\ + ["path-exists", "npm:4.0.0"]\ + ],\ + "linkType": "HARD"\ + }],\ + ["npm:5.0.0", {\ + "packageLocation": "./.yarn/cache/find-up-npm-5.0.0-e03e9b796d-07955e3573.zip/node_modules/find-up/",\ + "packageDependencies": [\ + ["find-up", "npm:5.0.0"],\ + ["locate-path", "npm:6.0.0"],\ + ["path-exists", "npm:4.0.0"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["flat", [\ + ["npm:5.0.2", {\ + "packageLocation": "./.yarn/cache/flat-npm-5.0.2-12748102a5-12a1536ac7.zip/node_modules/flat/",\ + "packageDependencies": [\ + ["flat", "npm:5.0.2"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["flat-cache", [\ + ["npm:3.0.4", {\ + "packageLocation": "./.yarn/cache/flat-cache-npm-3.0.4-ee77e5911e-4fdd10ecbc.zip/node_modules/flat-cache/",\ + "packageDependencies": [\ + ["flat-cache", "npm:3.0.4"],\ + ["flatted", "npm:3.2.7"],\ + ["rimraf", "npm:3.0.2"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["flatted", [\ + ["npm:3.2.7", {\ + "packageLocation": "./.yarn/cache/flatted-npm-3.2.7-0da10b7c56-427633049d.zip/node_modules/flatted/",\ + "packageDependencies": [\ + ["flatted", "npm:3.2.7"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["foreground-child", [\ + ["npm:3.1.1", {\ + "packageLocation": "./.yarn/cache/foreground-child-npm-3.1.1-77e78ed774-139d270bc8.zip/node_modules/foreground-child/",\ + "packageDependencies": [\ + ["foreground-child", "npm:3.1.1"],\ + ["cross-spawn", "npm:7.0.3"],\ + ["signal-exit", "npm:4.1.0"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["fs-minipass", [\ + ["npm:2.1.0", {\ + "packageLocation": "./.yarn/cache/fs-minipass-npm-2.1.0-501ef87306-1b8d128dae.zip/node_modules/fs-minipass/",\ + "packageDependencies": [\ + ["fs-minipass", "npm:2.1.0"],\ + ["minipass", "npm:3.3.6"]\ + ],\ + "linkType": "HARD"\ + }],\ + ["npm:3.0.3", {\ + "packageLocation": "./.yarn/cache/fs-minipass-npm-3.0.3-d148d6ac19-8722a41109.zip/node_modules/fs-minipass/",\ + "packageDependencies": [\ + ["fs-minipass", "npm:3.0.3"],\ + ["minipass", "npm:7.0.3"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["fs.realpath", [\ + ["npm:1.0.0", {\ + "packageLocation": "./.yarn/cache/fs.realpath-npm-1.0.0-c8f05d8126-99ddea01a7.zip/node_modules/fs.realpath/",\ + "packageDependencies": [\ + ["fs.realpath", "npm:1.0.0"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["fsevents", [\ + ["patch:fsevents@npm%3A2.3.3#~builtin::version=2.3.3&hash=df0bf1", {\ + "packageLocation": "./.yarn/unplugged/fsevents-patch-21ad2b1333/node_modules/fsevents/",\ + "packageDependencies": [\ + ["fsevents", "patch:fsevents@npm%3A2.3.3#~builtin::version=2.3.3&hash=df0bf1"],\ + ["node-gyp", "npm:9.4.0"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["function-bind", [\ + ["npm:1.1.1", {\ + "packageLocation": "./.yarn/cache/function-bind-npm-1.1.1-b56b322ae9-b32fbaebb3.zip/node_modules/function-bind/",\ + "packageDependencies": [\ + ["function-bind", "npm:1.1.1"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["gauge", [\ + ["npm:4.0.4", {\ + "packageLocation": "./.yarn/cache/gauge-npm-4.0.4-8f878385e9-788b6bfe52.zip/node_modules/gauge/",\ + "packageDependencies": [\ + ["gauge", "npm:4.0.4"],\ + ["aproba", "npm:2.0.0"],\ + ["color-support", "npm:1.1.3"],\ + ["console-control-strings", "npm:1.1.0"],\ + ["has-unicode", "npm:2.0.1"],\ + ["signal-exit", "npm:3.0.7"],\ + ["string-width", "npm:4.2.3"],\ + ["strip-ansi", "npm:6.0.1"],\ + ["wide-align", "npm:1.1.5"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["get-caller-file", [\ + ["npm:2.0.5", {\ + "packageLocation": "./.yarn/cache/get-caller-file-npm-2.0.5-80e8a86305-b9769a836d.zip/node_modules/get-caller-file/",\ + "packageDependencies": [\ + ["get-caller-file", "npm:2.0.5"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["glob", [\ + ["npm:10.3.4", {\ + "packageLocation": "./.yarn/cache/glob-npm-10.3.4-f58cd31f55-176b97c124.zip/node_modules/glob/",\ + "packageDependencies": [\ + ["glob", "npm:10.3.4"],\ + ["foreground-child", "npm:3.1.1"],\ + ["jackspeak", "npm:2.3.3"],\ + ["minimatch", "npm:9.0.3"],\ + ["minipass", "npm:7.0.3"],\ + ["path-scurry", "npm:1.10.1"]\ + ],\ + "linkType": "HARD"\ + }],\ + ["npm:7.2.0", {\ + "packageLocation": "./.yarn/cache/glob-npm-7.2.0-bb4644d239-78a8ea9423.zip/node_modules/glob/",\ + "packageDependencies": [\ + ["glob", "npm:7.2.0"],\ + ["fs.realpath", "npm:1.0.0"],\ + ["inflight", "npm:1.0.6"],\ + ["inherits", "npm:2.0.4"],\ + ["minimatch", "npm:3.1.2"],\ + ["once", "npm:1.4.0"],\ + ["path-is-absolute", "npm:1.0.1"]\ + ],\ + "linkType": "HARD"\ + }],\ + ["npm:7.2.3", {\ + "packageLocation": "./.yarn/cache/glob-npm-7.2.3-2d866d17a5-29452e97b3.zip/node_modules/glob/",\ + "packageDependencies": [\ + ["glob", "npm:7.2.3"],\ + ["fs.realpath", "npm:1.0.0"],\ + ["inflight", "npm:1.0.6"],\ + ["inherits", "npm:2.0.4"],\ + ["minimatch", "npm:3.1.2"],\ + ["once", "npm:1.4.0"],\ + ["path-is-absolute", "npm:1.0.1"]\ + ],\ + "linkType": "HARD"\ + }],\ + ["npm:8.1.0", {\ + "packageLocation": "./.yarn/cache/glob-npm-8.1.0-65f64af8b1-92fbea3221.zip/node_modules/glob/",\ + "packageDependencies": [\ + ["glob", "npm:8.1.0"],\ + ["fs.realpath", "npm:1.0.0"],\ + ["inflight", "npm:1.0.6"],\ + ["inherits", "npm:2.0.4"],\ + ["minimatch", "npm:5.1.6"],\ + ["once", "npm:1.4.0"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["glob-parent", [\ + ["npm:5.1.2", {\ + "packageLocation": "./.yarn/cache/glob-parent-npm-5.1.2-021ab32634-f4f2bfe242.zip/node_modules/glob-parent/",\ + "packageDependencies": [\ + ["glob-parent", "npm:5.1.2"],\ + ["is-glob", "npm:4.0.3"]\ + ],\ + "linkType": "HARD"\ + }],\ + ["npm:6.0.2", {\ + "packageLocation": "./.yarn/cache/glob-parent-npm-6.0.2-2cbef12738-c13ee97978.zip/node_modules/glob-parent/",\ + "packageDependencies": [\ + ["glob-parent", "npm:6.0.2"],\ + ["is-glob", "npm:4.0.3"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["glob-to-regexp", [\ + ["npm:0.4.1", {\ + "packageLocation": "./.yarn/cache/glob-to-regexp-npm-0.4.1-cd697e0fc7-e795f4e8f0.zip/node_modules/glob-to-regexp/",\ + "packageDependencies": [\ + ["glob-to-regexp", "npm:0.4.1"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["globals", [\ + ["npm:13.20.0", {\ + "packageLocation": "./.yarn/cache/globals-npm-13.20.0-4565a722e7-ad1ecf914b.zip/node_modules/globals/",\ + "packageDependencies": [\ + ["globals", "npm:13.20.0"],\ + ["type-fest", "npm:0.20.2"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["globby", [\ + ["npm:11.1.0", {\ + "packageLocation": "./.yarn/cache/globby-npm-11.1.0-bdcdf20c71-b4be8885e0.zip/node_modules/globby/",\ + "packageDependencies": [\ + ["globby", "npm:11.1.0"],\ + ["array-union", "npm:2.1.0"],\ + ["dir-glob", "npm:3.0.1"],\ + ["fast-glob", "npm:3.3.1"],\ + ["ignore", "npm:5.2.4"],\ + ["merge2", "npm:1.4.1"],\ + ["slash", "npm:3.0.0"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["graceful-fs", [\ + ["npm:4.2.11", {\ + "packageLocation": "./.yarn/cache/graceful-fs-npm-4.2.11-24bb648a68-ac85f94da9.zip/node_modules/graceful-fs/",\ + "packageDependencies": [\ + ["graceful-fs", "npm:4.2.11"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["graphemer", [\ + ["npm:1.4.0", {\ + "packageLocation": "./.yarn/cache/graphemer-npm-1.4.0-0627732d35-bab8f0be9b.zip/node_modules/graphemer/",\ + "packageDependencies": [\ + ["graphemer", "npm:1.4.0"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["has", [\ + ["npm:1.0.3", {\ + "packageLocation": "./.yarn/cache/has-npm-1.0.3-b7f00631c1-b9ad53d53b.zip/node_modules/has/",\ + "packageDependencies": [\ + ["has", "npm:1.0.3"],\ + ["function-bind", "npm:1.1.1"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["has-flag", [\ + ["npm:4.0.0", {\ + "packageLocation": "./.yarn/cache/has-flag-npm-4.0.0-32af9f0536-261a135703.zip/node_modules/has-flag/",\ + "packageDependencies": [\ + ["has-flag", "npm:4.0.0"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["has-unicode", [\ + ["npm:2.0.1", {\ + "packageLocation": "./.yarn/cache/has-unicode-npm-2.0.1-893adb4747-1eab07a743.zip/node_modules/has-unicode/",\ + "packageDependencies": [\ + ["has-unicode", "npm:2.0.1"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["he", [\ + ["npm:1.2.0", {\ + "packageLocation": "./.yarn/cache/he-npm-1.2.0-3b73a2ff07-3d4d6babcc.zip/node_modules/he/",\ + "packageDependencies": [\ + ["he", "npm:1.2.0"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["http-cache-semantics", [\ + ["npm:4.1.1", {\ + "packageLocation": "./.yarn/cache/http-cache-semantics-npm-4.1.1-1120131375-83ac0bc60b.zip/node_modules/http-cache-semantics/",\ + "packageDependencies": [\ + ["http-cache-semantics", "npm:4.1.1"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["http-proxy-agent", [\ + ["npm:4.0.1", {\ + "packageLocation": "./.yarn/cache/http-proxy-agent-npm-4.0.1-ce9ef61788-c6a5da5a19.zip/node_modules/http-proxy-agent/",\ + "packageDependencies": [\ + ["http-proxy-agent", "npm:4.0.1"],\ + ["@tootallnate/once", "npm:1.1.2"],\ + ["agent-base", "npm:6.0.2"],\ + ["debug", "virtual:ced87d94ab05a28b44536eb0cd61a9458e757a0ae7bb35e5ab5d27e03d08b996abd275928b29aad2eb0973d5bb0800e75ba8ca3e26bf62cbe8ea0fae8cca70a8#npm:4.3.4"]\ + ],\ + "linkType": "HARD"\ + }],\ + ["npm:5.0.0", {\ + "packageLocation": "./.yarn/cache/http-proxy-agent-npm-5.0.0-7f1f121b83-e2ee1ff165.zip/node_modules/http-proxy-agent/",\ + "packageDependencies": [\ + ["http-proxy-agent", "npm:5.0.0"],\ + ["@tootallnate/once", "npm:2.0.0"],\ + ["agent-base", "npm:6.0.2"],\ + ["debug", "virtual:ced87d94ab05a28b44536eb0cd61a9458e757a0ae7bb35e5ab5d27e03d08b996abd275928b29aad2eb0973d5bb0800e75ba8ca3e26bf62cbe8ea0fae8cca70a8#npm:4.3.4"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["https-proxy-agent", [\ + ["npm:5.0.1", {\ + "packageLocation": "./.yarn/cache/https-proxy-agent-npm-5.0.1-42d65f358e-571fccdf38.zip/node_modules/https-proxy-agent/",\ + "packageDependencies": [\ + ["https-proxy-agent", "npm:5.0.1"],\ + ["agent-base", "npm:6.0.2"],\ + ["debug", "virtual:ced87d94ab05a28b44536eb0cd61a9458e757a0ae7bb35e5ab5d27e03d08b996abd275928b29aad2eb0973d5bb0800e75ba8ca3e26bf62cbe8ea0fae8cca70a8#npm:4.3.4"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["humanize-ms", [\ + ["npm:1.2.1", {\ + "packageLocation": "./.yarn/cache/humanize-ms-npm-1.2.1-e942bd7329-9c7a74a282.zip/node_modules/humanize-ms/",\ + "packageDependencies": [\ + ["humanize-ms", "npm:1.2.1"],\ + ["ms", "npm:2.1.3"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["husky", [\ + ["npm:8.0.3", {\ + "packageLocation": "./.yarn/cache/husky-npm-8.0.3-b0b59c5127-837bc7e441.zip/node_modules/husky/",\ + "packageDependencies": [\ + ["husky", "npm:8.0.3"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["iconv-lite", [\ + ["npm:0.6.3", {\ + "packageLocation": "./.yarn/cache/iconv-lite-npm-0.6.3-24b8aae27e-3f60d47a5c.zip/node_modules/iconv-lite/",\ + "packageDependencies": [\ + ["iconv-lite", "npm:0.6.3"],\ + ["safer-buffer", "npm:2.1.2"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["ignore", [\ + ["npm:5.2.4", {\ + "packageLocation": "./.yarn/cache/ignore-npm-5.2.4-fbe6e989e5-3d4c309c60.zip/node_modules/ignore/",\ + "packageDependencies": [\ + ["ignore", "npm:5.2.4"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["immediate", [\ + ["npm:3.0.6", {\ + "packageLocation": "./.yarn/cache/immediate-npm-3.0.6-c27588a2d3-f9b3486477.zip/node_modules/immediate/",\ + "packageDependencies": [\ + ["immediate", "npm:3.0.6"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["import-fresh", [\ + ["npm:3.3.0", {\ + "packageLocation": "./.yarn/cache/import-fresh-npm-3.3.0-3e34265ca9-2cacfad06e.zip/node_modules/import-fresh/",\ + "packageDependencies": [\ + ["import-fresh", "npm:3.3.0"],\ + ["parent-module", "npm:1.0.1"],\ + ["resolve-from", "npm:4.0.0"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["import-local", [\ + ["npm:3.1.0", {\ + "packageLocation": "./.yarn/cache/import-local-npm-3.1.0-8960af5e51-bfcdb63b5e.zip/node_modules/import-local/",\ + "packageDependencies": [\ + ["import-local", "npm:3.1.0"],\ + ["pkg-dir", "npm:4.2.0"],\ + ["resolve-cwd", "npm:3.0.0"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["imurmurhash", [\ + ["npm:0.1.4", {\ + "packageLocation": "./.yarn/cache/imurmurhash-npm-0.1.4-610c5068a0-7cae75c8cd.zip/node_modules/imurmurhash/",\ + "packageDependencies": [\ + ["imurmurhash", "npm:0.1.4"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["indent-string", [\ + ["npm:4.0.0", {\ + "packageLocation": "./.yarn/cache/indent-string-npm-4.0.0-7b717435b2-824cfb9929.zip/node_modules/indent-string/",\ + "packageDependencies": [\ + ["indent-string", "npm:4.0.0"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["inflight", [\ + ["npm:1.0.6", {\ + "packageLocation": "./.yarn/cache/inflight-npm-1.0.6-ccedb4b908-f4f76aa072.zip/node_modules/inflight/",\ + "packageDependencies": [\ + ["inflight", "npm:1.0.6"],\ + ["once", "npm:1.4.0"],\ + ["wrappy", "npm:1.0.2"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["inherits", [\ + ["npm:2.0.4", {\ + "packageLocation": "./.yarn/cache/inherits-npm-2.0.4-c66b3957a0-4a48a73384.zip/node_modules/inherits/",\ + "packageDependencies": [\ + ["inherits", "npm:2.0.4"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["interpret", [\ + ["npm:3.1.1", {\ + "packageLocation": "./.yarn/cache/interpret-npm-3.1.1-715bac2bd7-35cebcf48c.zip/node_modules/interpret/",\ + "packageDependencies": [\ + ["interpret", "npm:3.1.1"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["ip", [\ + ["npm:2.0.0", {\ + "packageLocation": "./.yarn/cache/ip-npm-2.0.0-204facb3cc-cfcfac6b87.zip/node_modules/ip/",\ + "packageDependencies": [\ + ["ip", "npm:2.0.0"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["is-binary-path", [\ + ["npm:2.1.0", {\ + "packageLocation": "./.yarn/cache/is-binary-path-npm-2.1.0-e61d46f557-84192eb88c.zip/node_modules/is-binary-path/",\ + "packageDependencies": [\ + ["is-binary-path", "npm:2.1.0"],\ + ["binary-extensions", "npm:2.2.0"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["is-core-module", [\ + ["npm:2.13.0", {\ + "packageLocation": "./.yarn/cache/is-core-module-npm-2.13.0-e444c50225-053ab101fb.zip/node_modules/is-core-module/",\ + "packageDependencies": [\ + ["is-core-module", "npm:2.13.0"],\ + ["has", "npm:1.0.3"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["is-extglob", [\ + ["npm:2.1.1", {\ + "packageLocation": "./.yarn/cache/is-extglob-npm-2.1.1-0870ea68b5-df033653d0.zip/node_modules/is-extglob/",\ + "packageDependencies": [\ + ["is-extglob", "npm:2.1.1"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["is-fullwidth-code-point", [\ + ["npm:3.0.0", {\ + "packageLocation": "./.yarn/cache/is-fullwidth-code-point-npm-3.0.0-1ecf4ebee5-44a30c2945.zip/node_modules/is-fullwidth-code-point/",\ + "packageDependencies": [\ + ["is-fullwidth-code-point", "npm:3.0.0"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["is-glob", [\ + ["npm:4.0.3", {\ + "packageLocation": "./.yarn/cache/is-glob-npm-4.0.3-cb87bf1bdb-d381c1319f.zip/node_modules/is-glob/",\ + "packageDependencies": [\ + ["is-glob", "npm:4.0.3"],\ + ["is-extglob", "npm:2.1.1"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["is-lambda", [\ + ["npm:1.0.1", {\ + "packageLocation": "./.yarn/cache/is-lambda-npm-1.0.1-7ab55bc8a8-93a32f0194.zip/node_modules/is-lambda/",\ + "packageDependencies": [\ + ["is-lambda", "npm:1.0.1"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["is-number", [\ + ["npm:7.0.0", {\ + "packageLocation": "./.yarn/cache/is-number-npm-7.0.0-060086935c-456ac6f8e0.zip/node_modules/is-number/",\ + "packageDependencies": [\ + ["is-number", "npm:7.0.0"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["is-path-inside", [\ + ["npm:3.0.3", {\ + "packageLocation": "./.yarn/cache/is-path-inside-npm-3.0.3-2ea0ef44fd-abd50f0618.zip/node_modules/is-path-inside/",\ + "packageDependencies": [\ + ["is-path-inside", "npm:3.0.3"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["is-plain-obj", [\ + ["npm:2.1.0", {\ + "packageLocation": "./.yarn/cache/is-plain-obj-npm-2.1.0-8dffd7ae9c-cec9100678.zip/node_modules/is-plain-obj/",\ + "packageDependencies": [\ + ["is-plain-obj", "npm:2.1.0"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["is-plain-object", [\ + ["npm:2.0.4", {\ + "packageLocation": "./.yarn/cache/is-plain-object-npm-2.0.4-da3265d804-2a401140cf.zip/node_modules/is-plain-object/",\ + "packageDependencies": [\ + ["is-plain-object", "npm:2.0.4"],\ + ["isobject", "npm:3.0.1"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["is-unicode-supported", [\ + ["npm:0.1.0", {\ + "packageLocation": "./.yarn/cache/is-unicode-supported-npm-0.1.0-0833e1bbfb-a2aab86ee7.zip/node_modules/is-unicode-supported/",\ + "packageDependencies": [\ + ["is-unicode-supported", "npm:0.1.0"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["isarray", [\ + ["npm:1.0.0", {\ + "packageLocation": "./.yarn/cache/isarray-npm-1.0.0-db4f547720-f032df8e02.zip/node_modules/isarray/",\ + "packageDependencies": [\ + ["isarray", "npm:1.0.0"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["isexe", [\ + ["npm:2.0.0", {\ + "packageLocation": "./.yarn/cache/isexe-npm-2.0.0-b58870bd2e-26bf6c5480.zip/node_modules/isexe/",\ + "packageDependencies": [\ + ["isexe", "npm:2.0.0"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["isobject", [\ + ["npm:3.0.1", {\ + "packageLocation": "./.yarn/cache/isobject-npm-3.0.1-8145901fd2-db85c4c970.zip/node_modules/isobject/",\ + "packageDependencies": [\ + ["isobject", "npm:3.0.1"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["jackspeak", [\ + ["npm:2.3.3", {\ + "packageLocation": "./.yarn/cache/jackspeak-npm-2.3.3-755684cc60-4313a7c0cc.zip/node_modules/jackspeak/",\ + "packageDependencies": [\ + ["jackspeak", "npm:2.3.3"],\ + ["@isaacs/cliui", "npm:8.0.2"],\ + ["@pkgjs/parseargs", "npm:0.11.0"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["jest-worker", [\ + ["npm:27.5.1", {\ + "packageLocation": "./.yarn/cache/jest-worker-npm-27.5.1-1c110b5894-98cd68b696.zip/node_modules/jest-worker/",\ + "packageDependencies": [\ + ["jest-worker", "npm:27.5.1"],\ + ["@types/node", "npm:20.6.0"],\ + ["merge-stream", "npm:2.0.0"],\ + ["supports-color", "npm:8.1.1"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["js-yaml", [\ + ["npm:4.1.0", {\ + "packageLocation": "./.yarn/cache/js-yaml-npm-4.1.0-3606f32312-c7830dfd45.zip/node_modules/js-yaml/",\ + "packageDependencies": [\ + ["js-yaml", "npm:4.1.0"],\ + ["argparse", "npm:2.0.1"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["json-parse-even-better-errors", [\ + ["npm:2.3.1", {\ + "packageLocation": "./.yarn/cache/json-parse-even-better-errors-npm-2.3.1-144d62256e-798ed4cf33.zip/node_modules/json-parse-even-better-errors/",\ + "packageDependencies": [\ + ["json-parse-even-better-errors", "npm:2.3.1"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["json-schema-traverse", [\ + ["npm:0.4.1", {\ + "packageLocation": "./.yarn/cache/json-schema-traverse-npm-0.4.1-4759091693-7486074d3b.zip/node_modules/json-schema-traverse/",\ + "packageDependencies": [\ + ["json-schema-traverse", "npm:0.4.1"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["json-stable-stringify-without-jsonify", [\ + ["npm:1.0.1", {\ + "packageLocation": "./.yarn/cache/json-stable-stringify-without-jsonify-npm-1.0.1-b65772b28b-cff44156dd.zip/node_modules/json-stable-stringify-without-jsonify/",\ + "packageDependencies": [\ + ["json-stable-stringify-without-jsonify", "npm:1.0.1"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["jszip", [\ + ["npm:3.10.1", {\ + "packageLocation": "./.yarn/cache/jszip-npm-3.10.1-2862546cfb-abc77bfbe3.zip/node_modules/jszip/",\ + "packageDependencies": [\ + ["jszip", "npm:3.10.1"],\ + ["lie", "npm:3.3.0"],\ + ["pako", "npm:1.0.11"],\ + ["readable-stream", "npm:2.3.8"],\ + ["setimmediate", "npm:1.0.5"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["kind-of", [\ + ["npm:6.0.3", {\ + "packageLocation": "./.yarn/cache/kind-of-npm-6.0.3-ab15f36220-3ab01e7b1d.zip/node_modules/kind-of/",\ + "packageDependencies": [\ + ["kind-of", "npm:6.0.3"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["levn", [\ + ["npm:0.4.1", {\ + "packageLocation": "./.yarn/cache/levn-npm-0.4.1-d183b2d7bb-12c5021c85.zip/node_modules/levn/",\ + "packageDependencies": [\ + ["levn", "npm:0.4.1"],\ + ["prelude-ls", "npm:1.2.1"],\ + ["type-check", "npm:0.4.0"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["lie", [\ + ["npm:3.3.0", {\ + "packageLocation": "./.yarn/cache/lie-npm-3.3.0-35ddd11a4d-33102302cf.zip/node_modules/lie/",\ + "packageDependencies": [\ + ["lie", "npm:3.3.0"],\ + ["immediate", "npm:3.0.6"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["loader-runner", [\ + ["npm:4.3.0", {\ + "packageLocation": "./.yarn/cache/loader-runner-npm-4.3.0-9ca67df372-a90e00dee9.zip/node_modules/loader-runner/",\ + "packageDependencies": [\ + ["loader-runner", "npm:4.3.0"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["locate-path", [\ + ["npm:5.0.0", {\ + "packageLocation": "./.yarn/cache/locate-path-npm-5.0.0-46580c43e4-83e51725e6.zip/node_modules/locate-path/",\ + "packageDependencies": [\ + ["locate-path", "npm:5.0.0"],\ + ["p-locate", "npm:4.1.0"]\ + ],\ + "linkType": "HARD"\ + }],\ + ["npm:6.0.0", {\ + "packageLocation": "./.yarn/cache/locate-path-npm-6.0.0-06a1e4c528-72eb661788.zip/node_modules/locate-path/",\ + "packageDependencies": [\ + ["locate-path", "npm:6.0.0"],\ + ["p-locate", "npm:5.0.0"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["lodash.merge", [\ + ["npm:4.6.2", {\ + "packageLocation": "./.yarn/cache/lodash.merge-npm-4.6.2-77cb4416bf-ad580b4bdb.zip/node_modules/lodash.merge/",\ + "packageDependencies": [\ + ["lodash.merge", "npm:4.6.2"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["log-symbols", [\ + ["npm:4.1.0", {\ + "packageLocation": "./.yarn/cache/log-symbols-npm-4.1.0-0a13492d8b-fce1497b31.zip/node_modules/log-symbols/",\ + "packageDependencies": [\ + ["log-symbols", "npm:4.1.0"],\ + ["chalk", "npm:4.1.2"],\ + ["is-unicode-supported", "npm:0.1.0"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["lru-cache", [\ + ["npm:10.0.1", {\ + "packageLocation": "./.yarn/cache/lru-cache-npm-10.0.1-0e1abf4c13-06f8d0e1ce.zip/node_modules/lru-cache/",\ + "packageDependencies": [\ + ["lru-cache", "npm:10.0.1"]\ + ],\ + "linkType": "HARD"\ + }],\ + ["npm:6.0.0", {\ + "packageLocation": "./.yarn/cache/lru-cache-npm-6.0.0-b4c8668fe1-f97f499f89.zip/node_modules/lru-cache/",\ + "packageDependencies": [\ + ["lru-cache", "npm:6.0.0"],\ + ["yallist", "npm:4.0.0"]\ + ],\ + "linkType": "HARD"\ + }],\ + ["npm:7.18.3", {\ + "packageLocation": "./.yarn/cache/lru-cache-npm-7.18.3-e68be5b11c-e550d77238.zip/node_modules/lru-cache/",\ + "packageDependencies": [\ + ["lru-cache", "npm:7.18.3"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["make-fetch-happen", [\ + ["npm:11.1.1", {\ + "packageLocation": "./.yarn/cache/make-fetch-happen-npm-11.1.1-f32b79aaaa-7268bf274a.zip/node_modules/make-fetch-happen/",\ + "packageDependencies": [\ + ["make-fetch-happen", "npm:11.1.1"],\ + ["agentkeepalive", "npm:4.5.0"],\ + ["cacache", "npm:17.1.4"],\ + ["http-cache-semantics", "npm:4.1.1"],\ + ["http-proxy-agent", "npm:5.0.0"],\ + ["https-proxy-agent", "npm:5.0.1"],\ + ["is-lambda", "npm:1.0.1"],\ + ["lru-cache", "npm:7.18.3"],\ + ["minipass", "npm:5.0.0"],\ + ["minipass-fetch", "npm:3.0.4"],\ + ["minipass-flush", "npm:1.0.5"],\ + ["minipass-pipeline", "npm:1.2.4"],\ + ["negotiator", "npm:0.6.3"],\ + ["promise-retry", "npm:2.0.1"],\ + ["socks-proxy-agent", "npm:7.0.0"],\ + ["ssri", "npm:10.0.5"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["merge-stream", [\ + ["npm:2.0.0", {\ + "packageLocation": "./.yarn/cache/merge-stream-npm-2.0.0-2ac83efea5-6fa4dcc8d8.zip/node_modules/merge-stream/",\ + "packageDependencies": [\ + ["merge-stream", "npm:2.0.0"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["merge2", [\ + ["npm:1.4.1", {\ + "packageLocation": "./.yarn/cache/merge2-npm-1.4.1-a2507bd06c-7268db63ed.zip/node_modules/merge2/",\ + "packageDependencies": [\ + ["merge2", "npm:1.4.1"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["micromatch", [\ + ["npm:4.0.5", {\ + "packageLocation": "./.yarn/cache/micromatch-npm-4.0.5-cfab5d7669-02a17b671c.zip/node_modules/micromatch/",\ + "packageDependencies": [\ + ["micromatch", "npm:4.0.5"],\ + ["braces", "npm:3.0.2"],\ + ["picomatch", "npm:2.3.1"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["mime-db", [\ + ["npm:1.52.0", {\ + "packageLocation": "./.yarn/cache/mime-db-npm-1.52.0-b5371d6fd2-0d99a03585.zip/node_modules/mime-db/",\ + "packageDependencies": [\ + ["mime-db", "npm:1.52.0"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["mime-types", [\ + ["npm:2.1.35", {\ + "packageLocation": "./.yarn/cache/mime-types-npm-2.1.35-dd9ea9f3e2-89a5b7f1de.zip/node_modules/mime-types/",\ + "packageDependencies": [\ + ["mime-types", "npm:2.1.35"],\ + ["mime-db", "npm:1.52.0"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["minimatch", [\ + ["npm:3.1.2", {\ + "packageLocation": "./.yarn/cache/minimatch-npm-3.1.2-9405269906-c154e56640.zip/node_modules/minimatch/",\ + "packageDependencies": [\ + ["minimatch", "npm:3.1.2"],\ + ["brace-expansion", "npm:1.1.11"]\ + ],\ + "linkType": "HARD"\ + }],\ + ["npm:5.0.1", {\ + "packageLocation": "./.yarn/cache/minimatch-npm-5.0.1-612724f6f0-b34b98463d.zip/node_modules/minimatch/",\ + "packageDependencies": [\ + ["minimatch", "npm:5.0.1"],\ + ["brace-expansion", "npm:2.0.1"]\ + ],\ + "linkType": "HARD"\ + }],\ + ["npm:5.1.6", {\ + "packageLocation": "./.yarn/cache/minimatch-npm-5.1.6-1e71429f4c-7564208ef8.zip/node_modules/minimatch/",\ + "packageDependencies": [\ + ["minimatch", "npm:5.1.6"],\ + ["brace-expansion", "npm:2.0.1"]\ + ],\ + "linkType": "HARD"\ + }],\ + ["npm:9.0.3", {\ + "packageLocation": "./.yarn/cache/minimatch-npm-9.0.3-69d7d6fad5-253487976b.zip/node_modules/minimatch/",\ + "packageDependencies": [\ + ["minimatch", "npm:9.0.3"],\ + ["brace-expansion", "npm:2.0.1"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["minipass", [\ + ["npm:3.3.6", {\ + "packageLocation": "./.yarn/cache/minipass-npm-3.3.6-b8d93a945b-a30d083c80.zip/node_modules/minipass/",\ + "packageDependencies": [\ + ["minipass", "npm:3.3.6"],\ + ["yallist", "npm:4.0.0"]\ + ],\ + "linkType": "HARD"\ + }],\ + ["npm:5.0.0", {\ + "packageLocation": "./.yarn/cache/minipass-npm-5.0.0-c64fb63c92-425dab2887.zip/node_modules/minipass/",\ + "packageDependencies": [\ + ["minipass", "npm:5.0.0"]\ + ],\ + "linkType": "HARD"\ + }],\ + ["npm:7.0.3", {\ + "packageLocation": "./.yarn/cache/minipass-npm-7.0.3-3b57909ee9-6f1614f5b5.zip/node_modules/minipass/",\ + "packageDependencies": [\ + ["minipass", "npm:7.0.3"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["minipass-collect", [\ + ["npm:1.0.2", {\ + "packageLocation": "./.yarn/cache/minipass-collect-npm-1.0.2-3b4676eab5-14df761028.zip/node_modules/minipass-collect/",\ + "packageDependencies": [\ + ["minipass-collect", "npm:1.0.2"],\ + ["minipass", "npm:3.3.6"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["minipass-fetch", [\ + ["npm:3.0.4", {\ + "packageLocation": "./.yarn/cache/minipass-fetch-npm-3.0.4-200ac7c66d-af7aad15d5.zip/node_modules/minipass-fetch/",\ + "packageDependencies": [\ + ["minipass-fetch", "npm:3.0.4"],\ + ["encoding", "npm:0.1.13"],\ + ["minipass", "npm:7.0.3"],\ + ["minipass-sized", "npm:1.0.3"],\ + ["minizlib", "npm:2.1.2"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["minipass-flush", [\ + ["npm:1.0.5", {\ + "packageLocation": "./.yarn/cache/minipass-flush-npm-1.0.5-efe79d9826-56269a0b22.zip/node_modules/minipass-flush/",\ + "packageDependencies": [\ + ["minipass-flush", "npm:1.0.5"],\ + ["minipass", "npm:3.3.6"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["minipass-pipeline", [\ + ["npm:1.2.4", {\ + "packageLocation": "./.yarn/cache/minipass-pipeline-npm-1.2.4-5924cb077f-b14240dac0.zip/node_modules/minipass-pipeline/",\ + "packageDependencies": [\ + ["minipass-pipeline", "npm:1.2.4"],\ + ["minipass", "npm:3.3.6"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["minipass-sized", [\ + ["npm:1.0.3", {\ + "packageLocation": "./.yarn/cache/minipass-sized-npm-1.0.3-306d86f432-79076749fc.zip/node_modules/minipass-sized/",\ + "packageDependencies": [\ + ["minipass-sized", "npm:1.0.3"],\ + ["minipass", "npm:3.3.6"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["minizlib", [\ + ["npm:2.1.2", {\ + "packageLocation": "./.yarn/cache/minizlib-npm-2.1.2-ea89cd0cfb-f1fdeac0b0.zip/node_modules/minizlib/",\ + "packageDependencies": [\ + ["minizlib", "npm:2.1.2"],\ + ["minipass", "npm:3.3.6"],\ + ["yallist", "npm:4.0.0"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["mkdirp", [\ + ["npm:1.0.4", {\ + "packageLocation": "./.yarn/cache/mkdirp-npm-1.0.4-37f6ef56b9-a96865108c.zip/node_modules/mkdirp/",\ + "packageDependencies": [\ + ["mkdirp", "npm:1.0.4"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["mocha", [\ + ["npm:10.2.0", {\ + "packageLocation": "./.yarn/cache/mocha-npm-10.2.0-87db25c7c5-406c45eab1.zip/node_modules/mocha/",\ + "packageDependencies": [\ + ["mocha", "npm:10.2.0"],\ + ["ansi-colors", "npm:4.1.1"],\ + ["browser-stdout", "npm:1.3.1"],\ + ["chokidar", "npm:3.5.3"],\ + ["debug", "virtual:87db25c7c5e6b25bbc12571091cdabc648b79d427ab445d1714ccfdcdfb3265c9de6561ca760cc3de470037cbedf3af4be56ba3b684b3a1c01d4c9c2fd55a741#npm:4.3.4"],\ + ["diff", "npm:5.0.0"],\ + ["escape-string-regexp", "npm:4.0.0"],\ + ["find-up", "npm:5.0.0"],\ + ["glob", "npm:7.2.0"],\ + ["he", "npm:1.2.0"],\ + ["js-yaml", "npm:4.1.0"],\ + ["log-symbols", "npm:4.1.0"],\ + ["minimatch", "npm:5.0.1"],\ + ["ms", "npm:2.1.3"],\ + ["nanoid", "npm:3.3.3"],\ + ["serialize-javascript", "npm:6.0.0"],\ + ["strip-json-comments", "npm:3.1.1"],\ + ["supports-color", "npm:8.1.1"],\ + ["workerpool", "npm:6.2.1"],\ + ["yargs", "npm:16.2.0"],\ + ["yargs-parser", "npm:20.2.4"],\ + ["yargs-unparser", "npm:2.0.0"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["ms", [\ + ["npm:2.1.2", {\ + "packageLocation": "./.yarn/cache/ms-npm-2.1.2-ec0c1512ff-673cdb2c31.zip/node_modules/ms/",\ + "packageDependencies": [\ + ["ms", "npm:2.1.2"]\ + ],\ + "linkType": "HARD"\ + }],\ + ["npm:2.1.3", {\ + "packageLocation": "./.yarn/cache/ms-npm-2.1.3-81ff3cfac1-aa92de6080.zip/node_modules/ms/",\ + "packageDependencies": [\ + ["ms", "npm:2.1.3"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["nanoid", [\ + ["npm:3.3.3", {\ + "packageLocation": "./.yarn/cache/nanoid-npm-3.3.3-25d865be84-ada019402a.zip/node_modules/nanoid/",\ + "packageDependencies": [\ + ["nanoid", "npm:3.3.3"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["natural-compare", [\ + ["npm:1.4.0", {\ + "packageLocation": "./.yarn/cache/natural-compare-npm-1.4.0-97b75b362d-23ad088b08.zip/node_modules/natural-compare/",\ + "packageDependencies": [\ + ["natural-compare", "npm:1.4.0"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["natural-compare-lite", [\ + ["npm:1.4.0", {\ + "packageLocation": "./.yarn/cache/natural-compare-lite-npm-1.4.0-12b6b308ed-5222ac3986.zip/node_modules/natural-compare-lite/",\ + "packageDependencies": [\ + ["natural-compare-lite", "npm:1.4.0"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["negotiator", [\ + ["npm:0.6.3", {\ + "packageLocation": "./.yarn/cache/negotiator-npm-0.6.3-9d50e36171-b8ffeb1e26.zip/node_modules/negotiator/",\ + "packageDependencies": [\ + ["negotiator", "npm:0.6.3"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["neo-async", [\ + ["npm:2.6.2", {\ + "packageLocation": "./.yarn/cache/neo-async-npm-2.6.2-75d6902586-deac9f8d00.zip/node_modules/neo-async/",\ + "packageDependencies": [\ + ["neo-async", "npm:2.6.2"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["node-gyp", [\ + ["npm:9.4.0", {\ + "packageLocation": "./.yarn/unplugged/node-gyp-npm-9.4.0-ebf5f5573e/node_modules/node-gyp/",\ + "packageDependencies": [\ + ["node-gyp", "npm:9.4.0"],\ + ["env-paths", "npm:2.2.1"],\ + ["exponential-backoff", "npm:3.1.1"],\ + ["glob", "npm:7.2.3"],\ + ["graceful-fs", "npm:4.2.11"],\ + ["make-fetch-happen", "npm:11.1.1"],\ + ["nopt", "npm:6.0.0"],\ + ["npmlog", "npm:6.0.2"],\ + ["rimraf", "npm:3.0.2"],\ + ["semver", "npm:7.5.4"],\ + ["tar", "npm:6.2.0"],\ + ["which", "npm:2.0.2"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["node-releases", [\ + ["npm:2.0.13", {\ + "packageLocation": "./.yarn/cache/node-releases-npm-2.0.13-1f2e177887-17ec8f315d.zip/node_modules/node-releases/",\ + "packageDependencies": [\ + ["node-releases", "npm:2.0.13"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["nopt", [\ + ["npm:6.0.0", {\ + "packageLocation": "./.yarn/cache/nopt-npm-6.0.0-5ea8050815-82149371f8.zip/node_modules/nopt/",\ + "packageDependencies": [\ + ["nopt", "npm:6.0.0"],\ + ["abbrev", "npm:1.1.1"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["normalize-path", [\ + ["npm:3.0.0", {\ + "packageLocation": "./.yarn/cache/normalize-path-npm-3.0.0-658ba7d77f-88eeb4da89.zip/node_modules/normalize-path/",\ + "packageDependencies": [\ + ["normalize-path", "npm:3.0.0"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["npmlog", [\ + ["npm:6.0.2", {\ + "packageLocation": "./.yarn/cache/npmlog-npm-6.0.2-e0e69455c7-ae238cd264.zip/node_modules/npmlog/",\ + "packageDependencies": [\ + ["npmlog", "npm:6.0.2"],\ + ["are-we-there-yet", "npm:3.0.1"],\ + ["console-control-strings", "npm:1.1.0"],\ + ["gauge", "npm:4.0.4"],\ + ["set-blocking", "npm:2.0.0"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["once", [\ + ["npm:1.4.0", {\ + "packageLocation": "./.yarn/cache/once-npm-1.4.0-ccf03ef07a-cd0a885013.zip/node_modules/once/",\ + "packageDependencies": [\ + ["once", "npm:1.4.0"],\ + ["wrappy", "npm:1.0.2"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["optionator", [\ + ["npm:0.9.3", {\ + "packageLocation": "./.yarn/cache/optionator-npm-0.9.3-56c3a4bf80-0928199944.zip/node_modules/optionator/",\ + "packageDependencies": [\ + ["optionator", "npm:0.9.3"],\ + ["@aashutoshrathi/word-wrap", "npm:1.2.6"],\ + ["deep-is", "npm:0.1.4"],\ + ["fast-levenshtein", "npm:2.0.6"],\ + ["levn", "npm:0.4.1"],\ + ["prelude-ls", "npm:1.2.1"],\ + ["type-check", "npm:0.4.0"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["osmium", [\ + ["workspace:.", {\ + "packageLocation": "./",\ + "packageDependencies": [\ + ["osmium", "workspace:."],\ + ["husky", "npm:8.0.3"]\ + ],\ + "linkType": "SOFT"\ + }]\ + ]],\ + ["p-limit", [\ + ["npm:2.3.0", {\ + "packageLocation": "./.yarn/cache/p-limit-npm-2.3.0-94a0310039-84ff17f1a3.zip/node_modules/p-limit/",\ + "packageDependencies": [\ + ["p-limit", "npm:2.3.0"],\ + ["p-try", "npm:2.2.0"]\ + ],\ + "linkType": "HARD"\ + }],\ + ["npm:3.1.0", {\ + "packageLocation": "./.yarn/cache/p-limit-npm-3.1.0-05d2ede37f-7c3690c4db.zip/node_modules/p-limit/",\ + "packageDependencies": [\ + ["p-limit", "npm:3.1.0"],\ + ["yocto-queue", "npm:0.1.0"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["p-locate", [\ + ["npm:4.1.0", {\ + "packageLocation": "./.yarn/cache/p-locate-npm-4.1.0-eec6872537-513bd14a45.zip/node_modules/p-locate/",\ + "packageDependencies": [\ + ["p-locate", "npm:4.1.0"],\ + ["p-limit", "npm:2.3.0"]\ + ],\ + "linkType": "HARD"\ + }],\ + ["npm:5.0.0", {\ + "packageLocation": "./.yarn/cache/p-locate-npm-5.0.0-92cc7c7a3e-1623088f36.zip/node_modules/p-locate/",\ + "packageDependencies": [\ + ["p-locate", "npm:5.0.0"],\ + ["p-limit", "npm:3.1.0"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["p-map", [\ + ["npm:4.0.0", {\ + "packageLocation": "./.yarn/cache/p-map-npm-4.0.0-4677ae07c7-cb0ab21ec0.zip/node_modules/p-map/",\ + "packageDependencies": [\ + ["p-map", "npm:4.0.0"],\ + ["aggregate-error", "npm:3.1.0"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["p-try", [\ + ["npm:2.2.0", {\ + "packageLocation": "./.yarn/cache/p-try-npm-2.2.0-e0390dbaf8-f8a8e9a769.zip/node_modules/p-try/",\ + "packageDependencies": [\ + ["p-try", "npm:2.2.0"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["pako", [\ + ["npm:1.0.11", {\ + "packageLocation": "./.yarn/cache/pako-npm-1.0.11-b8f1b69d3e-1be2bfa1f8.zip/node_modules/pako/",\ + "packageDependencies": [\ + ["pako", "npm:1.0.11"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["parent-module", [\ + ["npm:1.0.1", {\ + "packageLocation": "./.yarn/cache/parent-module-npm-1.0.1-1fae11b095-6ba8b25514.zip/node_modules/parent-module/",\ + "packageDependencies": [\ + ["parent-module", "npm:1.0.1"],\ + ["callsites", "npm:3.1.0"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["path-exists", [\ + ["npm:4.0.0", {\ + "packageLocation": "./.yarn/cache/path-exists-npm-4.0.0-e9e4f63eb0-505807199d.zip/node_modules/path-exists/",\ + "packageDependencies": [\ + ["path-exists", "npm:4.0.0"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["path-is-absolute", [\ + ["npm:1.0.1", {\ + "packageLocation": "./.yarn/cache/path-is-absolute-npm-1.0.1-31bc695ffd-060840f92c.zip/node_modules/path-is-absolute/",\ + "packageDependencies": [\ + ["path-is-absolute", "npm:1.0.1"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["path-key", [\ + ["npm:3.1.1", {\ + "packageLocation": "./.yarn/cache/path-key-npm-3.1.1-0e66ea8321-55cd7a9dd4.zip/node_modules/path-key/",\ + "packageDependencies": [\ + ["path-key", "npm:3.1.1"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["path-parse", [\ + ["npm:1.0.7", {\ + "packageLocation": "./.yarn/cache/path-parse-npm-1.0.7-09564527b7-49abf3d811.zip/node_modules/path-parse/",\ + "packageDependencies": [\ + ["path-parse", "npm:1.0.7"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["path-scurry", [\ + ["npm:1.10.1", {\ + "packageLocation": "./.yarn/cache/path-scurry-npm-1.10.1-52bd946f2e-e2557cff3a.zip/node_modules/path-scurry/",\ + "packageDependencies": [\ + ["path-scurry", "npm:1.10.1"],\ + ["lru-cache", "npm:10.0.1"],\ + ["minipass", "npm:7.0.3"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["path-type", [\ + ["npm:4.0.0", {\ + "packageLocation": "./.yarn/cache/path-type-npm-4.0.0-10d47fc86a-5b1e2daa24.zip/node_modules/path-type/",\ + "packageDependencies": [\ + ["path-type", "npm:4.0.0"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["picocolors", [\ + ["npm:1.0.0", {\ + "packageLocation": "./.yarn/cache/picocolors-npm-1.0.0-d81e0b1927-a2e8092dd8.zip/node_modules/picocolors/",\ + "packageDependencies": [\ + ["picocolors", "npm:1.0.0"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["picomatch", [\ + ["npm:2.3.1", {\ + "packageLocation": "./.yarn/cache/picomatch-npm-2.3.1-c782cfd986-050c865ce8.zip/node_modules/picomatch/",\ + "packageDependencies": [\ + ["picomatch", "npm:2.3.1"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["pkg-dir", [\ + ["npm:4.2.0", {\ + "packageLocation": "./.yarn/cache/pkg-dir-npm-4.2.0-2b5d0a8d32-9863e3f351.zip/node_modules/pkg-dir/",\ + "packageDependencies": [\ + ["pkg-dir", "npm:4.2.0"],\ + ["find-up", "npm:4.1.0"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["prelude-ls", [\ + ["npm:1.2.1", {\ + "packageLocation": "./.yarn/cache/prelude-ls-npm-1.2.1-3e4d272a55-cd192ec0d0.zip/node_modules/prelude-ls/",\ + "packageDependencies": [\ + ["prelude-ls", "npm:1.2.1"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["prettier", [\ + ["npm:3.0.0", {\ + "packageLocation": "./.yarn/cache/prettier-npm-3.0.0-7ffbcce680-6a832876a1.zip/node_modules/prettier/",\ + "packageDependencies": [\ + ["prettier", "npm:3.0.0"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["process-nextick-args", [\ + ["npm:2.0.1", {\ + "packageLocation": "./.yarn/cache/process-nextick-args-npm-2.0.1-b8d7971609-1d38588e52.zip/node_modules/process-nextick-args/",\ + "packageDependencies": [\ + ["process-nextick-args", "npm:2.0.1"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["promise-retry", [\ + ["npm:2.0.1", {\ + "packageLocation": "./.yarn/cache/promise-retry-npm-2.0.1-871f0b01b7-f96a3f6d90.zip/node_modules/promise-retry/",\ + "packageDependencies": [\ + ["promise-retry", "npm:2.0.1"],\ + ["err-code", "npm:2.0.3"],\ + ["retry", "npm:0.12.0"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["punycode", [\ + ["npm:2.3.0", {\ + "packageLocation": "./.yarn/cache/punycode-npm-2.3.0-df4bdce06b-39f760e09a.zip/node_modules/punycode/",\ + "packageDependencies": [\ + ["punycode", "npm:2.3.0"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["queue-microtask", [\ + ["npm:1.2.3", {\ + "packageLocation": "./.yarn/cache/queue-microtask-npm-1.2.3-fcc98e4e2d-b676f8c040.zip/node_modules/queue-microtask/",\ + "packageDependencies": [\ + ["queue-microtask", "npm:1.2.3"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["randombytes", [\ + ["npm:2.1.0", {\ + "packageLocation": "./.yarn/cache/randombytes-npm-2.1.0-e3da76bccf-d779499376.zip/node_modules/randombytes/",\ + "packageDependencies": [\ + ["randombytes", "npm:2.1.0"],\ + ["safe-buffer", "npm:5.2.1"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["readable-stream", [\ + ["npm:2.3.8", {\ + "packageLocation": "./.yarn/cache/readable-stream-npm-2.3.8-67a94c2cb1-6564546703.zip/node_modules/readable-stream/",\ + "packageDependencies": [\ + ["readable-stream", "npm:2.3.8"],\ + ["core-util-is", "npm:1.0.3"],\ + ["inherits", "npm:2.0.4"],\ + ["isarray", "npm:1.0.0"],\ + ["process-nextick-args", "npm:2.0.1"],\ + ["safe-buffer", "npm:5.1.2"],\ + ["string_decoder", "npm:1.1.1"],\ + ["util-deprecate", "npm:1.0.2"]\ + ],\ + "linkType": "HARD"\ + }],\ + ["npm:3.6.2", {\ + "packageLocation": "./.yarn/cache/readable-stream-npm-3.6.2-d2a6069158-bdcbe6c22e.zip/node_modules/readable-stream/",\ + "packageDependencies": [\ + ["readable-stream", "npm:3.6.2"],\ + ["inherits", "npm:2.0.4"],\ + ["string_decoder", "npm:1.3.0"],\ + ["util-deprecate", "npm:1.0.2"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["readdirp", [\ + ["npm:3.6.0", {\ + "packageLocation": "./.yarn/cache/readdirp-npm-3.6.0-f950cc74ab-1ced032e6e.zip/node_modules/readdirp/",\ + "packageDependencies": [\ + ["readdirp", "npm:3.6.0"],\ + ["picomatch", "npm:2.3.1"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["rechoir", [\ + ["npm:0.8.0", {\ + "packageLocation": "./.yarn/cache/rechoir-npm-0.8.0-fb660b3bc8-ad3caed8af.zip/node_modules/rechoir/",\ + "packageDependencies": [\ + ["rechoir", "npm:0.8.0"],\ + ["resolve", "patch:resolve@npm%3A1.22.4#~builtin::version=1.22.4&hash=c3c19d"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["require-directory", [\ + ["npm:2.1.1", {\ + "packageLocation": "./.yarn/cache/require-directory-npm-2.1.1-8608aee50b-fb47e70bf0.zip/node_modules/require-directory/",\ + "packageDependencies": [\ + ["require-directory", "npm:2.1.1"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["resolve", [\ + ["patch:resolve@npm%3A1.22.4#~builtin::version=1.22.4&hash=c3c19d", {\ + "packageLocation": "./.yarn/cache/resolve-patch-efbbaf0edd-c45f2545fd.zip/node_modules/resolve/",\ + "packageDependencies": [\ + ["resolve", "patch:resolve@npm%3A1.22.4#~builtin::version=1.22.4&hash=c3c19d"],\ + ["is-core-module", "npm:2.13.0"],\ + ["path-parse", "npm:1.0.7"],\ + ["supports-preserve-symlinks-flag", "npm:1.0.0"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["resolve-cwd", [\ + ["npm:3.0.0", {\ + "packageLocation": "./.yarn/cache/resolve-cwd-npm-3.0.0-e6f4e296bf-546e081601.zip/node_modules/resolve-cwd/",\ + "packageDependencies": [\ + ["resolve-cwd", "npm:3.0.0"],\ + ["resolve-from", "npm:5.0.0"]\ ],\ "linkType": "HARD"\ }]\ ]],\ - ["eslint-scope", [\ - ["npm:7.2.2", {\ - "packageLocation": "./.yarn/cache/eslint-scope-npm-7.2.2-53cb0df8e8-ec97dbf5fb.zip/node_modules/eslint-scope/",\ + ["resolve-from", [\ + ["npm:4.0.0", {\ + "packageLocation": "./.yarn/cache/resolve-from-npm-4.0.0-f758ec21bf-f4ba0b8494.zip/node_modules/resolve-from/",\ "packageDependencies": [\ - ["eslint-scope", "npm:7.2.2"],\ - ["esrecurse", "npm:4.3.0"],\ - ["estraverse", "npm:5.3.0"]\ + ["resolve-from", "npm:4.0.0"]\ + ],\ + "linkType": "HARD"\ + }],\ + ["npm:5.0.0", {\ + "packageLocation": "./.yarn/cache/resolve-from-npm-5.0.0-15c9db4d33-4ceeb9113e.zip/node_modules/resolve-from/",\ + "packageDependencies": [\ + ["resolve-from", "npm:5.0.0"]\ ],\ "linkType": "HARD"\ }]\ ]],\ - ["eslint-visitor-keys", [\ - ["npm:3.4.2", {\ - "packageLocation": "./.yarn/cache/eslint-visitor-keys-npm-3.4.2-304459f972-9e0e7e4aae.zip/node_modules/eslint-visitor-keys/",\ + ["retry", [\ + ["npm:0.12.0", {\ + "packageLocation": "./.yarn/cache/retry-npm-0.12.0-72ac7fb4cc-623bd7d2e5.zip/node_modules/retry/",\ "packageDependencies": [\ - ["eslint-visitor-keys", "npm:3.4.2"]\ + ["retry", "npm:0.12.0"]\ ],\ "linkType": "HARD"\ }]\ ]],\ - ["espree", [\ - ["npm:9.6.1", {\ - "packageLocation": "./.yarn/cache/espree-npm-9.6.1-a50722a5a9-eb8c149c7a.zip/node_modules/espree/",\ + ["reusify", [\ + ["npm:1.0.4", {\ + "packageLocation": "./.yarn/cache/reusify-npm-1.0.4-95ac4aec11-c3076ebcc2.zip/node_modules/reusify/",\ "packageDependencies": [\ - ["espree", "npm:9.6.1"],\ - ["acorn", "npm:8.10.0"],\ - ["acorn-jsx", "virtual:a50722a5a9326b6a5f12350c494c4db3aa0f4caeac45e3e9e5fe071da20014ecfe738fe2ebe2c9c98abae81a4ea86b42f56d776b3bd5ec37f9ad3670c242b242#npm:5.3.2"],\ - ["eslint-visitor-keys", "npm:3.4.2"]\ + ["reusify", "npm:1.0.4"]\ ],\ "linkType": "HARD"\ }]\ ]],\ - ["esquery", [\ - ["npm:1.5.0", {\ - "packageLocation": "./.yarn/cache/esquery-npm-1.5.0-d8f8a06879-aefb0d2596.zip/node_modules/esquery/",\ + ["rimraf", [\ + ["npm:3.0.2", {\ + "packageLocation": "./.yarn/cache/rimraf-npm-3.0.2-2cb7dac69a-87f4164e39.zip/node_modules/rimraf/",\ "packageDependencies": [\ - ["esquery", "npm:1.5.0"],\ - ["estraverse", "npm:5.3.0"]\ + ["rimraf", "npm:3.0.2"],\ + ["glob", "npm:7.2.3"]\ ],\ "linkType": "HARD"\ }]\ ]],\ - ["esrecurse", [\ - ["npm:4.3.0", {\ - "packageLocation": "./.yarn/cache/esrecurse-npm-4.3.0-10b86a887a-ebc17b1a33.zip/node_modules/esrecurse/",\ + ["run-parallel", [\ + ["npm:1.2.0", {\ + "packageLocation": "./.yarn/cache/run-parallel-npm-1.2.0-3f47ff2034-cb4f97ad25.zip/node_modules/run-parallel/",\ "packageDependencies": [\ - ["esrecurse", "npm:4.3.0"],\ - ["estraverse", "npm:5.3.0"]\ + ["run-parallel", "npm:1.2.0"],\ + ["queue-microtask", "npm:1.2.3"]\ ],\ "linkType": "HARD"\ }]\ ]],\ - ["estraverse", [\ - ["npm:5.3.0", {\ - "packageLocation": "./.yarn/cache/estraverse-npm-5.3.0-03284f8f63-072780882d.zip/node_modules/estraverse/",\ + ["safe-buffer", [\ + ["npm:5.1.2", {\ + "packageLocation": "./.yarn/cache/safe-buffer-npm-5.1.2-c27fedf6c4-f2f1f7943c.zip/node_modules/safe-buffer/",\ "packageDependencies": [\ - ["estraverse", "npm:5.3.0"]\ + ["safe-buffer", "npm:5.1.2"]\ + ],\ + "linkType": "HARD"\ + }],\ + ["npm:5.2.1", {\ + "packageLocation": "./.yarn/cache/safe-buffer-npm-5.2.1-3481c8aa9b-b99c4b41fd.zip/node_modules/safe-buffer/",\ + "packageDependencies": [\ + ["safe-buffer", "npm:5.2.1"]\ ],\ "linkType": "HARD"\ }]\ ]],\ - ["esutils", [\ - ["npm:2.0.3", {\ - "packageLocation": "./.yarn/cache/esutils-npm-2.0.3-f865beafd5-22b5b08f74.zip/node_modules/esutils/",\ + ["safer-buffer", [\ + ["npm:2.1.2", {\ + "packageLocation": "./.yarn/cache/safer-buffer-npm-2.1.2-8d5c0b705e-cab8f25ae6.zip/node_modules/safer-buffer/",\ "packageDependencies": [\ - ["esutils", "npm:2.0.3"]\ + ["safer-buffer", "npm:2.1.2"]\ ],\ "linkType": "HARD"\ }]\ ]],\ - ["fast-deep-equal", [\ - ["npm:3.1.3", {\ - "packageLocation": "./.yarn/cache/fast-deep-equal-npm-3.1.3-790edcfcf5-e21a9d8d84.zip/node_modules/fast-deep-equal/",\ + ["schema-utils", [\ + ["npm:3.3.0", {\ + "packageLocation": "./.yarn/cache/schema-utils-npm-3.3.0-f2b36937f1-ea56971926.zip/node_modules/schema-utils/",\ "packageDependencies": [\ - ["fast-deep-equal", "npm:3.1.3"]\ + ["schema-utils", "npm:3.3.0"],\ + ["@types/json-schema", "npm:7.0.12"],\ + ["ajv", "npm:6.12.6"],\ + ["ajv-keywords", "virtual:f2b36937f163b579815d3163513b3330d7a31aaf0599eea66346382b8838395c613f4204e9809cc2ff6bba09c17ab0c34b37deadcb147de7e2f5e535d6ccc245#npm:3.5.2"]\ ],\ "linkType": "HARD"\ }]\ ]],\ - ["fast-json-stable-stringify", [\ - ["npm:2.1.0", {\ - "packageLocation": "./.yarn/cache/fast-json-stable-stringify-npm-2.1.0-02e8905fda-b191531e36.zip/node_modules/fast-json-stable-stringify/",\ + ["semver", [\ + ["npm:7.5.4", {\ + "packageLocation": "./.yarn/cache/semver-npm-7.5.4-c4ad957fcd-12d8ad952f.zip/node_modules/semver/",\ "packageDependencies": [\ - ["fast-json-stable-stringify", "npm:2.1.0"]\ + ["semver", "npm:7.5.4"],\ + ["lru-cache", "npm:6.0.0"]\ ],\ "linkType": "HARD"\ }]\ ]],\ - ["fast-levenshtein", [\ - ["npm:2.0.6", {\ - "packageLocation": "./.yarn/cache/fast-levenshtein-npm-2.0.6-fcd74b8df5-92cfec0a8d.zip/node_modules/fast-levenshtein/",\ + ["serialize-javascript", [\ + ["npm:6.0.0", {\ + "packageLocation": "./.yarn/cache/serialize-javascript-npm-6.0.0-0bb8a3c88d-56f90b562a.zip/node_modules/serialize-javascript/",\ "packageDependencies": [\ - ["fast-levenshtein", "npm:2.0.6"]\ + ["serialize-javascript", "npm:6.0.0"],\ + ["randombytes", "npm:2.1.0"]\ + ],\ + "linkType": "HARD"\ + }],\ + ["npm:6.0.1", {\ + "packageLocation": "./.yarn/cache/serialize-javascript-npm-6.0.1-fac87289ed-3c4f4cb61d.zip/node_modules/serialize-javascript/",\ + "packageDependencies": [\ + ["serialize-javascript", "npm:6.0.1"],\ + ["randombytes", "npm:2.1.0"]\ ],\ "linkType": "HARD"\ }]\ ]],\ - ["fastq", [\ - ["npm:1.15.0", {\ - "packageLocation": "./.yarn/cache/fastq-npm-1.15.0-1013f6514e-0170e6bfcd.zip/node_modules/fastq/",\ + ["set-blocking", [\ + ["npm:2.0.0", {\ + "packageLocation": "./.yarn/cache/set-blocking-npm-2.0.0-49e2cffa24-6e65a05f7c.zip/node_modules/set-blocking/",\ "packageDependencies": [\ - ["fastq", "npm:1.15.0"],\ - ["reusify", "npm:1.0.4"]\ + ["set-blocking", "npm:2.0.0"]\ ],\ "linkType": "HARD"\ }]\ ]],\ - ["file-entry-cache", [\ - ["npm:6.0.1", {\ - "packageLocation": "./.yarn/cache/file-entry-cache-npm-6.0.1-31965cf0af-f49701feaa.zip/node_modules/file-entry-cache/",\ + ["setimmediate", [\ + ["npm:1.0.5", {\ + "packageLocation": "./.yarn/cache/setimmediate-npm-1.0.5-54587459b6-c9a6f2c5b5.zip/node_modules/setimmediate/",\ "packageDependencies": [\ - ["file-entry-cache", "npm:6.0.1"],\ - ["flat-cache", "npm:3.0.4"]\ + ["setimmediate", "npm:1.0.5"]\ ],\ "linkType": "HARD"\ }]\ ]],\ - ["find-up", [\ - ["npm:5.0.0", {\ - "packageLocation": "./.yarn/cache/find-up-npm-5.0.0-e03e9b796d-07955e3573.zip/node_modules/find-up/",\ + ["shallow-clone", [\ + ["npm:3.0.1", {\ + "packageLocation": "./.yarn/cache/shallow-clone-npm-3.0.1-dab5873d0d-39b3dd9630.zip/node_modules/shallow-clone/",\ "packageDependencies": [\ - ["find-up", "npm:5.0.0"],\ - ["locate-path", "npm:6.0.0"],\ - ["path-exists", "npm:4.0.0"]\ + ["shallow-clone", "npm:3.0.1"],\ + ["kind-of", "npm:6.0.3"]\ ],\ "linkType": "HARD"\ }]\ ]],\ - ["flat-cache", [\ - ["npm:3.0.4", {\ - "packageLocation": "./.yarn/cache/flat-cache-npm-3.0.4-ee77e5911e-4fdd10ecbc.zip/node_modules/flat-cache/",\ + ["shebang-command", [\ + ["npm:2.0.0", {\ + "packageLocation": "./.yarn/cache/shebang-command-npm-2.0.0-eb2b01921d-6b52fe8727.zip/node_modules/shebang-command/",\ "packageDependencies": [\ - ["flat-cache", "npm:3.0.4"],\ - ["flatted", "npm:3.2.7"],\ - ["rimraf", "npm:3.0.2"]\ + ["shebang-command", "npm:2.0.0"],\ + ["shebang-regex", "npm:3.0.0"]\ ],\ "linkType": "HARD"\ }]\ ]],\ - ["flatted", [\ - ["npm:3.2.7", {\ - "packageLocation": "./.yarn/cache/flatted-npm-3.2.7-0da10b7c56-427633049d.zip/node_modules/flatted/",\ + ["shebang-regex", [\ + ["npm:3.0.0", {\ + "packageLocation": "./.yarn/cache/shebang-regex-npm-3.0.0-899a0cd65e-1a2bcae50d.zip/node_modules/shebang-regex/",\ "packageDependencies": [\ - ["flatted", "npm:3.2.7"]\ + ["shebang-regex", "npm:3.0.0"]\ ],\ "linkType": "HARD"\ }]\ ]],\ - ["fs.realpath", [\ - ["npm:1.0.0", {\ - "packageLocation": "./.yarn/cache/fs.realpath-npm-1.0.0-c8f05d8126-99ddea01a7.zip/node_modules/fs.realpath/",\ + ["signal-exit", [\ + ["npm:3.0.7", {\ + "packageLocation": "./.yarn/cache/signal-exit-npm-3.0.7-bd270458a3-a2f098f247.zip/node_modules/signal-exit/",\ "packageDependencies": [\ - ["fs.realpath", "npm:1.0.0"]\ + ["signal-exit", "npm:3.0.7"]\ + ],\ + "linkType": "HARD"\ + }],\ + ["npm:4.1.0", {\ + "packageLocation": "./.yarn/cache/signal-exit-npm-4.1.0-61fb957687-64c757b498.zip/node_modules/signal-exit/",\ + "packageDependencies": [\ + ["signal-exit", "npm:4.1.0"]\ ],\ "linkType": "HARD"\ }]\ ]],\ - ["glob", [\ - ["npm:7.2.3", {\ - "packageLocation": "./.yarn/cache/glob-npm-7.2.3-2d866d17a5-29452e97b3.zip/node_modules/glob/",\ + ["slash", [\ + ["npm:3.0.0", {\ + "packageLocation": "./.yarn/cache/slash-npm-3.0.0-b87de2279a-94a93fff61.zip/node_modules/slash/",\ "packageDependencies": [\ - ["glob", "npm:7.2.3"],\ - ["fs.realpath", "npm:1.0.0"],\ - ["inflight", "npm:1.0.6"],\ - ["inherits", "npm:2.0.4"],\ - ["minimatch", "npm:3.1.2"],\ - ["once", "npm:1.4.0"],\ - ["path-is-absolute", "npm:1.0.1"]\ + ["slash", "npm:3.0.0"]\ ],\ "linkType": "HARD"\ }]\ ]],\ - ["glob-parent", [\ - ["npm:6.0.2", {\ - "packageLocation": "./.yarn/cache/glob-parent-npm-6.0.2-2cbef12738-c13ee97978.zip/node_modules/glob-parent/",\ + ["smart-buffer", [\ + ["npm:4.2.0", {\ + "packageLocation": "./.yarn/cache/smart-buffer-npm-4.2.0-5ac3f668bb-b5167a7142.zip/node_modules/smart-buffer/",\ "packageDependencies": [\ - ["glob-parent", "npm:6.0.2"],\ - ["is-glob", "npm:4.0.3"]\ + ["smart-buffer", "npm:4.2.0"]\ ],\ "linkType": "HARD"\ }]\ ]],\ - ["globals", [\ - ["npm:13.20.0", {\ - "packageLocation": "./.yarn/cache/globals-npm-13.20.0-4565a722e7-ad1ecf914b.zip/node_modules/globals/",\ + ["socks", [\ + ["npm:2.7.1", {\ + "packageLocation": "./.yarn/cache/socks-npm-2.7.1-17f2b53052-259d9e3e8e.zip/node_modules/socks/",\ "packageDependencies": [\ - ["globals", "npm:13.20.0"],\ - ["type-fest", "npm:0.20.2"]\ + ["socks", "npm:2.7.1"],\ + ["ip", "npm:2.0.0"],\ + ["smart-buffer", "npm:4.2.0"]\ ],\ "linkType": "HARD"\ }]\ ]],\ - ["graphemer", [\ - ["npm:1.4.0", {\ - "packageLocation": "./.yarn/cache/graphemer-npm-1.4.0-0627732d35-bab8f0be9b.zip/node_modules/graphemer/",\ + ["socks-proxy-agent", [\ + ["npm:7.0.0", {\ + "packageLocation": "./.yarn/cache/socks-proxy-agent-npm-7.0.0-7aacf32ea0-7205543701.zip/node_modules/socks-proxy-agent/",\ "packageDependencies": [\ - ["graphemer", "npm:1.4.0"]\ + ["socks-proxy-agent", "npm:7.0.0"],\ + ["agent-base", "npm:6.0.2"],\ + ["debug", "virtual:ced87d94ab05a28b44536eb0cd61a9458e757a0ae7bb35e5ab5d27e03d08b996abd275928b29aad2eb0973d5bb0800e75ba8ca3e26bf62cbe8ea0fae8cca70a8#npm:4.3.4"],\ + ["socks", "npm:2.7.1"]\ ],\ "linkType": "HARD"\ }]\ ]],\ - ["has-flag", [\ - ["npm:4.0.0", {\ - "packageLocation": "./.yarn/cache/has-flag-npm-4.0.0-32af9f0536-261a135703.zip/node_modules/has-flag/",\ + ["source-map", [\ + ["npm:0.6.1", {\ + "packageLocation": "./.yarn/cache/source-map-npm-0.6.1-1a3621db16-59ce8640cf.zip/node_modules/source-map/",\ "packageDependencies": [\ - ["has-flag", "npm:4.0.0"]\ + ["source-map", "npm:0.6.1"]\ ],\ "linkType": "HARD"\ }]\ ]],\ - ["husky", [\ - ["npm:8.0.3", {\ - "packageLocation": "./.yarn/cache/husky-npm-8.0.3-b0b59c5127-837bc7e441.zip/node_modules/husky/",\ + ["source-map-support", [\ + ["npm:0.5.21", {\ + "packageLocation": "./.yarn/cache/source-map-support-npm-0.5.21-09ca99e250-43e98d700d.zip/node_modules/source-map-support/",\ "packageDependencies": [\ - ["husky", "npm:8.0.3"]\ + ["source-map-support", "npm:0.5.21"],\ + ["buffer-from", "npm:1.1.2"],\ + ["source-map", "npm:0.6.1"]\ ],\ "linkType": "HARD"\ }]\ ]],\ - ["ignore", [\ - ["npm:5.2.4", {\ - "packageLocation": "./.yarn/cache/ignore-npm-5.2.4-fbe6e989e5-3d4c309c60.zip/node_modules/ignore/",\ + ["ssri", [\ + ["npm:10.0.5", {\ + "packageLocation": "./.yarn/cache/ssri-npm-10.0.5-1a7557d04d-0a31b65f21.zip/node_modules/ssri/",\ "packageDependencies": [\ - ["ignore", "npm:5.2.4"]\ + ["ssri", "npm:10.0.5"],\ + ["minipass", "npm:7.0.3"]\ ],\ "linkType": "HARD"\ }]\ ]],\ - ["import-fresh", [\ - ["npm:3.3.0", {\ - "packageLocation": "./.yarn/cache/import-fresh-npm-3.3.0-3e34265ca9-2cacfad06e.zip/node_modules/import-fresh/",\ + ["string-width", [\ + ["npm:4.2.3", {\ + "packageLocation": "./.yarn/cache/string-width-npm-4.2.3-2c27177bae-e52c10dc3f.zip/node_modules/string-width/",\ "packageDependencies": [\ - ["import-fresh", "npm:3.3.0"],\ - ["parent-module", "npm:1.0.1"],\ - ["resolve-from", "npm:4.0.0"]\ + ["string-width", "npm:4.2.3"],\ + ["emoji-regex", "npm:8.0.0"],\ + ["is-fullwidth-code-point", "npm:3.0.0"],\ + ["strip-ansi", "npm:6.0.1"]\ + ],\ + "linkType": "HARD"\ + }],\ + ["npm:5.1.2", {\ + "packageLocation": "./.yarn/cache/string-width-npm-5.1.2-bf60531341-7369deaa29.zip/node_modules/string-width/",\ + "packageDependencies": [\ + ["string-width", "npm:5.1.2"],\ + ["eastasianwidth", "npm:0.2.0"],\ + ["emoji-regex", "npm:9.2.2"],\ + ["strip-ansi", "npm:7.1.0"]\ ],\ "linkType": "HARD"\ }]\ ]],\ - ["imurmurhash", [\ - ["npm:0.1.4", {\ - "packageLocation": "./.yarn/cache/imurmurhash-npm-0.1.4-610c5068a0-7cae75c8cd.zip/node_modules/imurmurhash/",\ + ["string_decoder", [\ + ["npm:1.1.1", {\ + "packageLocation": "./.yarn/cache/string_decoder-npm-1.1.1-e46a6c1353-9ab7e56f9d.zip/node_modules/string_decoder/",\ "packageDependencies": [\ - ["imurmurhash", "npm:0.1.4"]\ + ["string_decoder", "npm:1.1.1"],\ + ["safe-buffer", "npm:5.1.2"]\ + ],\ + "linkType": "HARD"\ + }],\ + ["npm:1.3.0", {\ + "packageLocation": "./.yarn/cache/string_decoder-npm-1.3.0-2422117fd0-8417646695.zip/node_modules/string_decoder/",\ + "packageDependencies": [\ + ["string_decoder", "npm:1.3.0"],\ + ["safe-buffer", "npm:5.2.1"]\ ],\ "linkType": "HARD"\ }]\ ]],\ - ["inflight", [\ - ["npm:1.0.6", {\ - "packageLocation": "./.yarn/cache/inflight-npm-1.0.6-ccedb4b908-f4f76aa072.zip/node_modules/inflight/",\ + ["strip-ansi", [\ + ["npm:6.0.1", {\ + "packageLocation": "./.yarn/cache/strip-ansi-npm-6.0.1-caddc7cb40-f3cd25890a.zip/node_modules/strip-ansi/",\ "packageDependencies": [\ - ["inflight", "npm:1.0.6"],\ - ["once", "npm:1.4.0"],\ - ["wrappy", "npm:1.0.2"]\ + ["strip-ansi", "npm:6.0.1"],\ + ["ansi-regex", "npm:5.0.1"]\ + ],\ + "linkType": "HARD"\ + }],\ + ["npm:7.1.0", {\ + "packageLocation": "./.yarn/cache/strip-ansi-npm-7.1.0-7453b80b79-859c73fcf2.zip/node_modules/strip-ansi/",\ + "packageDependencies": [\ + ["strip-ansi", "npm:7.1.0"],\ + ["ansi-regex", "npm:6.0.1"]\ ],\ "linkType": "HARD"\ }]\ ]],\ - ["inherits", [\ - ["npm:2.0.4", {\ - "packageLocation": "./.yarn/cache/inherits-npm-2.0.4-c66b3957a0-4a48a73384.zip/node_modules/inherits/",\ + ["strip-json-comments", [\ + ["npm:3.1.1", {\ + "packageLocation": "./.yarn/cache/strip-json-comments-npm-3.1.1-dcb2324823-492f73e272.zip/node_modules/strip-json-comments/",\ "packageDependencies": [\ - ["inherits", "npm:2.0.4"]\ + ["strip-json-comments", "npm:3.1.1"]\ ],\ "linkType": "HARD"\ }]\ ]],\ - ["is-extglob", [\ - ["npm:2.1.1", {\ - "packageLocation": "./.yarn/cache/is-extglob-npm-2.1.1-0870ea68b5-df033653d0.zip/node_modules/is-extglob/",\ + ["supports-color", [\ + ["npm:7.2.0", {\ + "packageLocation": "./.yarn/cache/supports-color-npm-7.2.0-606bfcf7da-3dda818de0.zip/node_modules/supports-color/",\ "packageDependencies": [\ - ["is-extglob", "npm:2.1.1"]\ + ["supports-color", "npm:7.2.0"],\ + ["has-flag", "npm:4.0.0"]\ + ],\ + "linkType": "HARD"\ + }],\ + ["npm:8.1.1", {\ + "packageLocation": "./.yarn/cache/supports-color-npm-8.1.1-289e937149-c052193a7e.zip/node_modules/supports-color/",\ + "packageDependencies": [\ + ["supports-color", "npm:8.1.1"],\ + ["has-flag", "npm:4.0.0"]\ ],\ "linkType": "HARD"\ }]\ ]],\ - ["is-glob", [\ - ["npm:4.0.3", {\ - "packageLocation": "./.yarn/cache/is-glob-npm-4.0.3-cb87bf1bdb-d381c1319f.zip/node_modules/is-glob/",\ + ["supports-preserve-symlinks-flag", [\ + ["npm:1.0.0", {\ + "packageLocation": "./.yarn/cache/supports-preserve-symlinks-flag-npm-1.0.0-f17c4d0028-53b1e247e6.zip/node_modules/supports-preserve-symlinks-flag/",\ "packageDependencies": [\ - ["is-glob", "npm:4.0.3"],\ - ["is-extglob", "npm:2.1.1"]\ + ["supports-preserve-symlinks-flag", "npm:1.0.0"]\ ],\ "linkType": "HARD"\ }]\ ]],\ - ["is-path-inside", [\ - ["npm:3.0.3", {\ - "packageLocation": "./.yarn/cache/is-path-inside-npm-3.0.3-2ea0ef44fd-abd50f0618.zip/node_modules/is-path-inside/",\ + ["tapable", [\ + ["npm:2.2.1", {\ + "packageLocation": "./.yarn/cache/tapable-npm-2.2.1-8cf5ff3039-3b7a1b4d86.zip/node_modules/tapable/",\ "packageDependencies": [\ - ["is-path-inside", "npm:3.0.3"]\ + ["tapable", "npm:2.2.1"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["tar", [\ + ["npm:6.2.0", {\ + "packageLocation": "./.yarn/cache/tar-npm-6.2.0-3eb25205a7-db4d9fe74a.zip/node_modules/tar/",\ + "packageDependencies": [\ + ["tar", "npm:6.2.0"],\ + ["chownr", "npm:2.0.0"],\ + ["fs-minipass", "npm:2.1.0"],\ + ["minipass", "npm:5.0.0"],\ + ["minizlib", "npm:2.1.2"],\ + ["mkdirp", "npm:1.0.4"],\ + ["yallist", "npm:4.0.0"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["terser", [\ + ["npm:5.19.4", {\ + "packageLocation": "./.yarn/cache/terser-npm-5.19.4-0504dfe160-09273ce7d3.zip/node_modules/terser/",\ + "packageDependencies": [\ + ["terser", "npm:5.19.4"],\ + ["@jridgewell/source-map", "npm:0.3.5"],\ + ["acorn", "npm:8.10.0"],\ + ["commander", "npm:2.20.3"],\ + ["source-map-support", "npm:0.5.21"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["terser-webpack-plugin", [\ + ["npm:5.3.9", {\ + "packageLocation": "./.yarn/cache/terser-webpack-plugin-npm-5.3.9-7ba1eb45f4-41705713d6.zip/node_modules/terser-webpack-plugin/",\ + "packageDependencies": [\ + ["terser-webpack-plugin", "npm:5.3.9"]\ + ],\ + "linkType": "SOFT"\ + }],\ + ["virtual:3ef4e983f64ff1a1e4c258f749269351ee3a43d8f85cba4f0b0f19708d052251a4e5cf013249fab72dce740ad98b16023faceb07b90994c348f059fa80742598#npm:5.3.9", {\ + "packageLocation": "./.yarn/__virtual__/terser-webpack-plugin-virtual-1f540bc554/0/cache/terser-webpack-plugin-npm-5.3.9-7ba1eb45f4-41705713d6.zip/node_modules/terser-webpack-plugin/",\ + "packageDependencies": [\ + ["terser-webpack-plugin", "virtual:3ef4e983f64ff1a1e4c258f749269351ee3a43d8f85cba4f0b0f19708d052251a4e5cf013249fab72dce740ad98b16023faceb07b90994c348f059fa80742598#npm:5.3.9"],\ + ["@jridgewell/trace-mapping", "npm:0.3.19"],\ + ["@swc/core", null],\ + ["@types/esbuild", null],\ + ["@types/swc__core", null],\ + ["@types/uglify-js", null],\ + ["@types/webpack", null],\ + ["esbuild", null],\ + ["jest-worker", "npm:27.5.1"],\ + ["schema-utils", "npm:3.3.0"],\ + ["serialize-javascript", "npm:6.0.1"],\ + ["terser", "npm:5.19.4"],\ + ["uglify-js", null],\ + ["webpack", "virtual:114e6097baba06f1f7194aa147cc16af7c3daf193a49e5fc802ef9cf9d7ac56ceb0639593345639ab943707d850061c33067576340115e57cb282fb86146f6a5#npm:5.88.2"]\ + ],\ + "packagePeers": [\ + "@swc/core",\ + "@types/esbuild",\ + "@types/swc__core",\ + "@types/uglify-js",\ + "@types/webpack",\ + "esbuild",\ + "uglify-js",\ + "webpack"\ ],\ "linkType": "HARD"\ }]\ ]],\ - ["isexe", [\ - ["npm:2.0.0", {\ - "packageLocation": "./.yarn/cache/isexe-npm-2.0.0-b58870bd2e-26bf6c5480.zip/node_modules/isexe/",\ + ["text-table", [\ + ["npm:0.2.0", {\ + "packageLocation": "./.yarn/cache/text-table-npm-0.2.0-d92a778b59-b6937a38c8.zip/node_modules/text-table/",\ "packageDependencies": [\ - ["isexe", "npm:2.0.0"]\ + ["text-table", "npm:0.2.0"]\ ],\ "linkType": "HARD"\ }]\ ]],\ - ["js-yaml", [\ - ["npm:4.1.0", {\ - "packageLocation": "./.yarn/cache/js-yaml-npm-4.1.0-3606f32312-c7830dfd45.zip/node_modules/js-yaml/",\ + ["to-regex-range", [\ + ["npm:5.0.1", {\ + "packageLocation": "./.yarn/cache/to-regex-range-npm-5.0.1-f1e8263b00-f76fa01b3d.zip/node_modules/to-regex-range/",\ "packageDependencies": [\ - ["js-yaml", "npm:4.1.0"],\ - ["argparse", "npm:2.0.1"]\ + ["to-regex-range", "npm:5.0.1"],\ + ["is-number", "npm:7.0.0"]\ ],\ "linkType": "HARD"\ }]\ ]],\ - ["json-schema-traverse", [\ - ["npm:0.4.1", {\ - "packageLocation": "./.yarn/cache/json-schema-traverse-npm-0.4.1-4759091693-7486074d3b.zip/node_modules/json-schema-traverse/",\ + ["ts-loader", [\ + ["npm:9.4.4", {\ + "packageLocation": "./.yarn/cache/ts-loader-npm-9.4.4-f7a7993559-8e5e6b839b.zip/node_modules/ts-loader/",\ "packageDependencies": [\ - ["json-schema-traverse", "npm:0.4.1"]\ + ["ts-loader", "npm:9.4.4"]\ ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["json-stable-stringify-without-jsonify", [\ - ["npm:1.0.1", {\ - "packageLocation": "./.yarn/cache/json-stable-stringify-without-jsonify-npm-1.0.1-b65772b28b-cff44156dd.zip/node_modules/json-stable-stringify-without-jsonify/",\ + "linkType": "SOFT"\ + }],\ + ["virtual:114e6097baba06f1f7194aa147cc16af7c3daf193a49e5fc802ef9cf9d7ac56ceb0639593345639ab943707d850061c33067576340115e57cb282fb86146f6a5#npm:9.4.4", {\ + "packageLocation": "./.yarn/__virtual__/ts-loader-virtual-7c7f7426be/0/cache/ts-loader-npm-9.4.4-f7a7993559-8e5e6b839b.zip/node_modules/ts-loader/",\ "packageDependencies": [\ - ["json-stable-stringify-without-jsonify", "npm:1.0.1"]\ + ["ts-loader", "virtual:114e6097baba06f1f7194aa147cc16af7c3daf193a49e5fc802ef9cf9d7ac56ceb0639593345639ab943707d850061c33067576340115e57cb282fb86146f6a5#npm:9.4.4"],\ + ["@types/typescript", null],\ + ["@types/webpack", null],\ + ["chalk", "npm:4.1.2"],\ + ["enhanced-resolve", "npm:5.15.0"],\ + ["micromatch", "npm:4.0.5"],\ + ["semver", "npm:7.5.4"],\ + ["typescript", "patch:typescript@npm%3A5.2.2#~builtin::version=5.2.2&hash=14eedb"],\ + ["webpack", "virtual:114e6097baba06f1f7194aa147cc16af7c3daf193a49e5fc802ef9cf9d7ac56ceb0639593345639ab943707d850061c33067576340115e57cb282fb86146f6a5#npm:5.88.2"]\ + ],\ + "packagePeers": [\ + "@types/typescript",\ + "@types/webpack",\ + "typescript",\ + "webpack"\ ],\ "linkType": "HARD"\ }]\ ]],\ - ["levn", [\ - ["npm:0.4.1", {\ - "packageLocation": "./.yarn/cache/levn-npm-0.4.1-d183b2d7bb-12c5021c85.zip/node_modules/levn/",\ + ["tslib", [\ + ["npm:1.14.1", {\ + "packageLocation": "./.yarn/cache/tslib-npm-1.14.1-102499115e-dbe628ef87.zip/node_modules/tslib/",\ "packageDependencies": [\ - ["levn", "npm:0.4.1"],\ - ["prelude-ls", "npm:1.2.1"],\ - ["type-check", "npm:0.4.0"]\ + ["tslib", "npm:1.14.1"]\ ],\ "linkType": "HARD"\ }]\ ]],\ - ["locate-path", [\ - ["npm:6.0.0", {\ - "packageLocation": "./.yarn/cache/locate-path-npm-6.0.0-06a1e4c528-72eb661788.zip/node_modules/locate-path/",\ + ["tsutils", [\ + ["npm:3.21.0", {\ + "packageLocation": "./.yarn/cache/tsutils-npm-3.21.0-347e6636c5-1843f4c1b2.zip/node_modules/tsutils/",\ "packageDependencies": [\ - ["locate-path", "npm:6.0.0"],\ - ["p-locate", "npm:5.0.0"]\ + ["tsutils", "npm:3.21.0"]\ + ],\ + "linkType": "SOFT"\ + }],\ + ["virtual:3aca1ca16440e1ff7da0d6f5eed3f78efd0b8a2affea9a555b157df0fdba643060f7eef6665d606c0072b2d888384117b8c28f3e1839eba9cd360ad78efcb4d2#npm:3.21.0", {\ + "packageLocation": "./.yarn/__virtual__/tsutils-virtual-6eb87d37df/0/cache/tsutils-npm-3.21.0-347e6636c5-1843f4c1b2.zip/node_modules/tsutils/",\ + "packageDependencies": [\ + ["tsutils", "virtual:3aca1ca16440e1ff7da0d6f5eed3f78efd0b8a2affea9a555b157df0fdba643060f7eef6665d606c0072b2d888384117b8c28f3e1839eba9cd360ad78efcb4d2#npm:3.21.0"],\ + ["@types/typescript", null],\ + ["tslib", "npm:1.14.1"],\ + ["typescript", "patch:typescript@npm%3A5.2.2#~builtin::version=5.2.2&hash=14eedb"]\ + ],\ + "packagePeers": [\ + "@types/typescript",\ + "typescript"\ ],\ "linkType": "HARD"\ - }]\ - ]],\ - ["lodash.merge", [\ - ["npm:4.6.2", {\ - "packageLocation": "./.yarn/cache/lodash.merge-npm-4.6.2-77cb4416bf-ad580b4bdb.zip/node_modules/lodash.merge/",\ + }],\ + ["virtual:3c24b039002baf4da6de8f43a9856dedfe0870f0a250583774a5fe002029c55adf6dedcdc27b0c37b845157e72a671413cf99bdffefc9e78eecbe9051dc7da9a#npm:3.21.0", {\ + "packageLocation": "./.yarn/__virtual__/tsutils-virtual-188f559577/0/cache/tsutils-npm-3.21.0-347e6636c5-1843f4c1b2.zip/node_modules/tsutils/",\ "packageDependencies": [\ - ["lodash.merge", "npm:4.6.2"]\ + ["tsutils", "virtual:3c24b039002baf4da6de8f43a9856dedfe0870f0a250583774a5fe002029c55adf6dedcdc27b0c37b845157e72a671413cf99bdffefc9e78eecbe9051dc7da9a#npm:3.21.0"],\ + ["@types/typescript", null],\ + ["tslib", "npm:1.14.1"],\ + ["typescript", null]\ + ],\ + "packagePeers": [\ + "@types/typescript",\ + "typescript"\ ],\ "linkType": "HARD"\ }]\ ]],\ - ["minimatch", [\ - ["npm:3.1.2", {\ - "packageLocation": "./.yarn/cache/minimatch-npm-3.1.2-9405269906-c154e56640.zip/node_modules/minimatch/",\ + ["type-check", [\ + ["npm:0.4.0", {\ + "packageLocation": "./.yarn/cache/type-check-npm-0.4.0-60565800ce-ec688ebfc9.zip/node_modules/type-check/",\ "packageDependencies": [\ - ["minimatch", "npm:3.1.2"],\ - ["brace-expansion", "npm:1.1.11"]\ + ["type-check", "npm:0.4.0"],\ + ["prelude-ls", "npm:1.2.1"]\ ],\ "linkType": "HARD"\ }]\ ]],\ - ["ms", [\ - ["npm:2.1.2", {\ - "packageLocation": "./.yarn/cache/ms-npm-2.1.2-ec0c1512ff-673cdb2c31.zip/node_modules/ms/",\ + ["type-fest", [\ + ["npm:0.20.2", {\ + "packageLocation": "./.yarn/cache/type-fest-npm-0.20.2-b36432617f-4fb3272df2.zip/node_modules/type-fest/",\ "packageDependencies": [\ - ["ms", "npm:2.1.2"]\ + ["type-fest", "npm:0.20.2"]\ ],\ "linkType": "HARD"\ }]\ ]],\ - ["natural-compare", [\ - ["npm:1.4.0", {\ - "packageLocation": "./.yarn/cache/natural-compare-npm-1.4.0-97b75b362d-23ad088b08.zip/node_modules/natural-compare/",\ + ["typescript", [\ + ["patch:typescript@npm%3A5.2.2#~builtin::version=5.2.2&hash=14eedb", {\ + "packageLocation": "./.yarn/cache/typescript-patch-79198159d7-07106822b4.zip/node_modules/typescript/",\ "packageDependencies": [\ - ["natural-compare", "npm:1.4.0"]\ + ["typescript", "patch:typescript@npm%3A5.2.2#~builtin::version=5.2.2&hash=14eedb"]\ ],\ "linkType": "HARD"\ }]\ ]],\ - ["once", [\ - ["npm:1.4.0", {\ - "packageLocation": "./.yarn/cache/once-npm-1.4.0-ccf03ef07a-cd0a885013.zip/node_modules/once/",\ + ["unique-filename", [\ + ["npm:3.0.0", {\ + "packageLocation": "./.yarn/cache/unique-filename-npm-3.0.0-77d68e0a45-8e2f59b356.zip/node_modules/unique-filename/",\ "packageDependencies": [\ - ["once", "npm:1.4.0"],\ - ["wrappy", "npm:1.0.2"]\ + ["unique-filename", "npm:3.0.0"],\ + ["unique-slug", "npm:4.0.0"]\ ],\ "linkType": "HARD"\ }]\ ]],\ - ["optionator", [\ - ["npm:0.9.3", {\ - "packageLocation": "./.yarn/cache/optionator-npm-0.9.3-56c3a4bf80-0928199944.zip/node_modules/optionator/",\ + ["unique-slug", [\ + ["npm:4.0.0", {\ + "packageLocation": "./.yarn/cache/unique-slug-npm-4.0.0-e6b08f28aa-0884b58365.zip/node_modules/unique-slug/",\ "packageDependencies": [\ - ["optionator", "npm:0.9.3"],\ - ["@aashutoshrathi/word-wrap", "npm:1.2.6"],\ - ["deep-is", "npm:0.1.4"],\ - ["fast-levenshtein", "npm:2.0.6"],\ - ["levn", "npm:0.4.1"],\ - ["prelude-ls", "npm:1.2.1"],\ - ["type-check", "npm:0.4.0"]\ + ["unique-slug", "npm:4.0.0"],\ + ["imurmurhash", "npm:0.1.4"]\ ],\ "linkType": "HARD"\ }]\ ]],\ - ["osmium", [\ - ["workspace:.", {\ - "packageLocation": "./",\ + ["update-browserslist-db", [\ + ["npm:1.0.11", {\ + "packageLocation": "./.yarn/cache/update-browserslist-db-npm-1.0.11-2c8e64258f-b98327518f.zip/node_modules/update-browserslist-db/",\ "packageDependencies": [\ - ["osmium", "workspace:."],\ - ["husky", "npm:8.0.3"]\ + ["update-browserslist-db", "npm:1.0.11"]\ ],\ "linkType": "SOFT"\ - }]\ - ]],\ - ["p-limit", [\ - ["npm:3.1.0", {\ - "packageLocation": "./.yarn/cache/p-limit-npm-3.1.0-05d2ede37f-7c3690c4db.zip/node_modules/p-limit/",\ + }],\ + ["virtual:e2170a875bba2f8fa9e93e47c65f2f250097e101a59d95ea6fd852f32965e8cd6cef3b5662aa7295279d5bc60c9a612ddb8515c7dd1b7e8fb9984dee1823e7d6#npm:1.0.11", {\ + "packageLocation": "./.yarn/__virtual__/update-browserslist-db-virtual-e6fb63e03d/0/cache/update-browserslist-db-npm-1.0.11-2c8e64258f-b98327518f.zip/node_modules/update-browserslist-db/",\ "packageDependencies": [\ - ["p-limit", "npm:3.1.0"],\ - ["yocto-queue", "npm:0.1.0"]\ + ["update-browserslist-db", "virtual:e2170a875bba2f8fa9e93e47c65f2f250097e101a59d95ea6fd852f32965e8cd6cef3b5662aa7295279d5bc60c9a612ddb8515c7dd1b7e8fb9984dee1823e7d6#npm:1.0.11"],\ + ["@types/browserslist", null],\ + ["browserslist", "npm:4.21.10"],\ + ["escalade", "npm:3.1.1"],\ + ["picocolors", "npm:1.0.0"]\ + ],\ + "packagePeers": [\ + "@types/browserslist",\ + "browserslist"\ ],\ "linkType": "HARD"\ }]\ ]],\ - ["p-locate", [\ - ["npm:5.0.0", {\ - "packageLocation": "./.yarn/cache/p-locate-npm-5.0.0-92cc7c7a3e-1623088f36.zip/node_modules/p-locate/",\ + ["uri-js", [\ + ["npm:4.4.1", {\ + "packageLocation": "./.yarn/cache/uri-js-npm-4.4.1-66d11cbcaf-7167432de6.zip/node_modules/uri-js/",\ "packageDependencies": [\ - ["p-locate", "npm:5.0.0"],\ - ["p-limit", "npm:3.1.0"]\ + ["uri-js", "npm:4.4.1"],\ + ["punycode", "npm:2.3.0"]\ ],\ "linkType": "HARD"\ }]\ ]],\ - ["parent-module", [\ - ["npm:1.0.1", {\ - "packageLocation": "./.yarn/cache/parent-module-npm-1.0.1-1fae11b095-6ba8b25514.zip/node_modules/parent-module/",\ + ["util-deprecate", [\ + ["npm:1.0.2", {\ + "packageLocation": "./.yarn/cache/util-deprecate-npm-1.0.2-e3fe1a219c-474acf1146.zip/node_modules/util-deprecate/",\ "packageDependencies": [\ - ["parent-module", "npm:1.0.1"],\ - ["callsites", "npm:3.1.0"]\ + ["util-deprecate", "npm:1.0.2"]\ ],\ "linkType": "HARD"\ }]\ ]],\ - ["path-exists", [\ - ["npm:4.0.0", {\ - "packageLocation": "./.yarn/cache/path-exists-npm-4.0.0-e9e4f63eb0-505807199d.zip/node_modules/path-exists/",\ + ["vscode-jsonrpc", [\ + ["npm:8.1.0", {\ + "packageLocation": "./.yarn/cache/vscode-jsonrpc-npm-8.1.0-557f20ee72-8980037cc0.zip/node_modules/vscode-jsonrpc/",\ "packageDependencies": [\ - ["path-exists", "npm:4.0.0"]\ + ["vscode-jsonrpc", "npm:8.1.0"]\ ],\ "linkType": "HARD"\ }]\ ]],\ - ["path-is-absolute", [\ - ["npm:1.0.1", {\ - "packageLocation": "./.yarn/cache/path-is-absolute-npm-1.0.1-31bc695ffd-060840f92c.zip/node_modules/path-is-absolute/",\ + ["vscode-languageclient", [\ + ["npm:8.1.0", {\ + "packageLocation": "./.yarn/cache/vscode-languageclient-npm-8.1.0-3befe78fee-b9d46aa256.zip/node_modules/vscode-languageclient/",\ "packageDependencies": [\ - ["path-is-absolute", "npm:1.0.1"]\ + ["vscode-languageclient", "npm:8.1.0"],\ + ["minimatch", "npm:5.1.6"],\ + ["semver", "npm:7.5.4"],\ + ["vscode-languageserver-protocol", "npm:3.17.3"]\ ],\ "linkType": "HARD"\ }]\ ]],\ - ["path-key", [\ - ["npm:3.1.1", {\ - "packageLocation": "./.yarn/cache/path-key-npm-3.1.1-0e66ea8321-55cd7a9dd4.zip/node_modules/path-key/",\ + ["vscode-languageserver-protocol", [\ + ["npm:3.17.3", {\ + "packageLocation": "./.yarn/cache/vscode-languageserver-protocol-npm-3.17.3-3c0373c95b-ffea508b2e.zip/node_modules/vscode-languageserver-protocol/",\ "packageDependencies": [\ - ["path-key", "npm:3.1.1"]\ + ["vscode-languageserver-protocol", "npm:3.17.3"],\ + ["vscode-jsonrpc", "npm:8.1.0"],\ + ["vscode-languageserver-types", "npm:3.17.3"]\ ],\ "linkType": "HARD"\ }]\ ]],\ - ["prelude-ls", [\ - ["npm:1.2.1", {\ - "packageLocation": "./.yarn/cache/prelude-ls-npm-1.2.1-3e4d272a55-cd192ec0d0.zip/node_modules/prelude-ls/",\ + ["vscode-languageserver-types", [\ + ["npm:3.17.3", {\ + "packageLocation": "./.yarn/cache/vscode-languageserver-types-npm-3.17.3-2fde4bb32b-fbc8221297.zip/node_modules/vscode-languageserver-types/",\ "packageDependencies": [\ - ["prelude-ls", "npm:1.2.1"]\ + ["vscode-languageserver-types", "npm:3.17.3"]\ ],\ "linkType": "HARD"\ }]\ ]],\ - ["prettier", [\ - ["npm:3.0.0", {\ - "packageLocation": "./.yarn/cache/prettier-npm-3.0.0-7ffbcce680-6a832876a1.zip/node_modules/prettier/",\ + ["watchpack", [\ + ["npm:2.4.0", {\ + "packageLocation": "./.yarn/cache/watchpack-npm-2.4.0-7ec4b9cc65-23d4bc5863.zip/node_modules/watchpack/",\ "packageDependencies": [\ - ["prettier", "npm:3.0.0"]\ + ["watchpack", "npm:2.4.0"],\ + ["glob-to-regexp", "npm:0.4.1"],\ + ["graceful-fs", "npm:4.2.11"]\ ],\ "linkType": "HARD"\ }]\ ]],\ - ["punycode", [\ - ["npm:2.3.0", {\ - "packageLocation": "./.yarn/cache/punycode-npm-2.3.0-df4bdce06b-39f760e09a.zip/node_modules/punycode/",\ + ["webpack", [\ + ["npm:5.88.2", {\ + "packageLocation": "./.yarn/cache/webpack-npm-5.88.2-38717ace6f-79476a782d.zip/node_modules/webpack/",\ "packageDependencies": [\ - ["punycode", "npm:2.3.0"]\ + ["webpack", "npm:5.88.2"]\ + ],\ + "linkType": "SOFT"\ + }],\ + ["virtual:114e6097baba06f1f7194aa147cc16af7c3daf193a49e5fc802ef9cf9d7ac56ceb0639593345639ab943707d850061c33067576340115e57cb282fb86146f6a5#npm:5.88.2", {\ + "packageLocation": "./.yarn/__virtual__/webpack-virtual-3ef4e983f6/0/cache/webpack-npm-5.88.2-38717ace6f-79476a782d.zip/node_modules/webpack/",\ + "packageDependencies": [\ + ["webpack", "virtual:114e6097baba06f1f7194aa147cc16af7c3daf193a49e5fc802ef9cf9d7ac56ceb0639593345639ab943707d850061c33067576340115e57cb282fb86146f6a5#npm:5.88.2"],\ + ["@types/eslint-scope", "npm:3.7.4"],\ + ["@types/estree", "npm:1.0.1"],\ + ["@types/webpack-cli", null],\ + ["@webassemblyjs/ast", "npm:1.11.6"],\ + ["@webassemblyjs/wasm-edit", "npm:1.11.6"],\ + ["@webassemblyjs/wasm-parser", "npm:1.11.6"],\ + ["acorn", "npm:8.10.0"],\ + ["acorn-import-assertions", "virtual:3ef4e983f64ff1a1e4c258f749269351ee3a43d8f85cba4f0b0f19708d052251a4e5cf013249fab72dce740ad98b16023faceb07b90994c348f059fa80742598#npm:1.9.0"],\ + ["browserslist", "npm:4.21.10"],\ + ["chrome-trace-event", "npm:1.0.3"],\ + ["enhanced-resolve", "npm:5.15.0"],\ + ["es-module-lexer", "npm:1.3.0"],\ + ["eslint-scope", "npm:5.1.1"],\ + ["events", "npm:3.3.0"],\ + ["glob-to-regexp", "npm:0.4.1"],\ + ["graceful-fs", "npm:4.2.11"],\ + ["json-parse-even-better-errors", "npm:2.3.1"],\ + ["loader-runner", "npm:4.3.0"],\ + ["mime-types", "npm:2.1.35"],\ + ["neo-async", "npm:2.6.2"],\ + ["schema-utils", "npm:3.3.0"],\ + ["tapable", "npm:2.2.1"],\ + ["terser-webpack-plugin", "virtual:3ef4e983f64ff1a1e4c258f749269351ee3a43d8f85cba4f0b0f19708d052251a4e5cf013249fab72dce740ad98b16023faceb07b90994c348f059fa80742598#npm:5.3.9"],\ + ["watchpack", "npm:2.4.0"],\ + ["webpack-cli", "virtual:114e6097baba06f1f7194aa147cc16af7c3daf193a49e5fc802ef9cf9d7ac56ceb0639593345639ab943707d850061c33067576340115e57cb282fb86146f6a5#npm:5.1.4"],\ + ["webpack-sources", "npm:3.2.3"]\ + ],\ + "packagePeers": [\ + "@types/webpack-cli",\ + "webpack-cli"\ ],\ "linkType": "HARD"\ }]\ ]],\ - ["queue-microtask", [\ - ["npm:1.2.3", {\ - "packageLocation": "./.yarn/cache/queue-microtask-npm-1.2.3-fcc98e4e2d-b676f8c040.zip/node_modules/queue-microtask/",\ + ["webpack-cli", [\ + ["npm:5.1.4", {\ + "packageLocation": "./.yarn/cache/webpack-cli-npm-5.1.4-7be5b53b38-3a4ad0d034.zip/node_modules/webpack-cli/",\ "packageDependencies": [\ - ["queue-microtask", "npm:1.2.3"]\ + ["webpack-cli", "npm:5.1.4"]\ + ],\ + "linkType": "SOFT"\ + }],\ + ["virtual:114e6097baba06f1f7194aa147cc16af7c3daf193a49e5fc802ef9cf9d7ac56ceb0639593345639ab943707d850061c33067576340115e57cb282fb86146f6a5#npm:5.1.4", {\ + "packageLocation": "./.yarn/__virtual__/webpack-cli-virtual-8ad348135e/0/cache/webpack-cli-npm-5.1.4-7be5b53b38-3a4ad0d034.zip/node_modules/webpack-cli/",\ + "packageDependencies": [\ + ["webpack-cli", "virtual:114e6097baba06f1f7194aa147cc16af7c3daf193a49e5fc802ef9cf9d7ac56ceb0639593345639ab943707d850061c33067576340115e57cb282fb86146f6a5#npm:5.1.4"],\ + ["@discoveryjs/json-ext", "npm:0.5.7"],\ + ["@types/webpack", null],\ + ["@types/webpack-bundle-analyzer", null],\ + ["@types/webpack-cli__generators", null],\ + ["@types/webpack-dev-server", null],\ + ["@webpack-cli/configtest", "virtual:8ad348135e0848a579c70b3c72ac45cb01fbea9f7615ac07352453f68ac778fe8e57c5e7134a509f01e2186e4b4a924a1d476017d220e3e47d4d5c59aca52d8f#npm:2.1.1"],\ + ["@webpack-cli/generators", null],\ + ["@webpack-cli/info", "virtual:8ad348135e0848a579c70b3c72ac45cb01fbea9f7615ac07352453f68ac778fe8e57c5e7134a509f01e2186e4b4a924a1d476017d220e3e47d4d5c59aca52d8f#npm:2.0.2"],\ + ["@webpack-cli/serve", "virtual:8ad348135e0848a579c70b3c72ac45cb01fbea9f7615ac07352453f68ac778fe8e57c5e7134a509f01e2186e4b4a924a1d476017d220e3e47d4d5c59aca52d8f#npm:2.0.5"],\ + ["colorette", "npm:2.0.20"],\ + ["commander", "npm:10.0.1"],\ + ["cross-spawn", "npm:7.0.3"],\ + ["envinfo", "npm:7.10.0"],\ + ["fastest-levenshtein", "npm:1.0.16"],\ + ["import-local", "npm:3.1.0"],\ + ["interpret", "npm:3.1.1"],\ + ["rechoir", "npm:0.8.0"],\ + ["webpack", "virtual:114e6097baba06f1f7194aa147cc16af7c3daf193a49e5fc802ef9cf9d7ac56ceb0639593345639ab943707d850061c33067576340115e57cb282fb86146f6a5#npm:5.88.2"],\ + ["webpack-bundle-analyzer", null],\ + ["webpack-dev-server", null],\ + ["webpack-merge", "npm:5.9.0"]\ + ],\ + "packagePeers": [\ + "@types/webpack-bundle-analyzer",\ + "@types/webpack-cli__generators",\ + "@types/webpack-dev-server",\ + "@types/webpack",\ + "@webpack-cli/generators",\ + "webpack-bundle-analyzer",\ + "webpack-dev-server",\ + "webpack"\ ],\ "linkType": "HARD"\ }]\ ]],\ - ["resolve-from", [\ - ["npm:4.0.0", {\ - "packageLocation": "./.yarn/cache/resolve-from-npm-4.0.0-f758ec21bf-f4ba0b8494.zip/node_modules/resolve-from/",\ + ["webpack-merge", [\ + ["npm:5.9.0", {\ + "packageLocation": "./.yarn/cache/webpack-merge-npm-5.9.0-9110e650de-64fe2c23aa.zip/node_modules/webpack-merge/",\ "packageDependencies": [\ - ["resolve-from", "npm:4.0.0"]\ + ["webpack-merge", "npm:5.9.0"],\ + ["clone-deep", "npm:4.0.1"],\ + ["wildcard", "npm:2.0.1"]\ ],\ "linkType": "HARD"\ }]\ ]],\ - ["reusify", [\ - ["npm:1.0.4", {\ - "packageLocation": "./.yarn/cache/reusify-npm-1.0.4-95ac4aec11-c3076ebcc2.zip/node_modules/reusify/",\ + ["webpack-sources", [\ + ["npm:3.2.3", {\ + "packageLocation": "./.yarn/cache/webpack-sources-npm-3.2.3-6bfb5d9563-989e401b9f.zip/node_modules/webpack-sources/",\ "packageDependencies": [\ - ["reusify", "npm:1.0.4"]\ + ["webpack-sources", "npm:3.2.3"]\ ],\ "linkType": "HARD"\ }]\ ]],\ - ["rimraf", [\ - ["npm:3.0.2", {\ - "packageLocation": "./.yarn/cache/rimraf-npm-3.0.2-2cb7dac69a-87f4164e39.zip/node_modules/rimraf/",\ + ["which", [\ + ["npm:2.0.2", {\ + "packageLocation": "./.yarn/cache/which-npm-2.0.2-320ddf72f7-1a5c563d3c.zip/node_modules/which/",\ "packageDependencies": [\ - ["rimraf", "npm:3.0.2"],\ - ["glob", "npm:7.2.3"]\ + ["which", "npm:2.0.2"],\ + ["isexe", "npm:2.0.0"]\ ],\ "linkType": "HARD"\ }]\ ]],\ - ["run-parallel", [\ - ["npm:1.2.0", {\ - "packageLocation": "./.yarn/cache/run-parallel-npm-1.2.0-3f47ff2034-cb4f97ad25.zip/node_modules/run-parallel/",\ + ["wide-align", [\ + ["npm:1.1.5", {\ + "packageLocation": "./.yarn/cache/wide-align-npm-1.1.5-889d77e592-d5fc37cd56.zip/node_modules/wide-align/",\ "packageDependencies": [\ - ["run-parallel", "npm:1.2.0"],\ - ["queue-microtask", "npm:1.2.3"]\ + ["wide-align", "npm:1.1.5"],\ + ["string-width", "npm:4.2.3"]\ ],\ "linkType": "HARD"\ }]\ ]],\ - ["shebang-command", [\ - ["npm:2.0.0", {\ - "packageLocation": "./.yarn/cache/shebang-command-npm-2.0.0-eb2b01921d-6b52fe8727.zip/node_modules/shebang-command/",\ + ["wildcard", [\ + ["npm:2.0.1", {\ + "packageLocation": "./.yarn/cache/wildcard-npm-2.0.1-7c6a3a3365-e0c60a12a2.zip/node_modules/wildcard/",\ "packageDependencies": [\ - ["shebang-command", "npm:2.0.0"],\ - ["shebang-regex", "npm:3.0.0"]\ + ["wildcard", "npm:2.0.1"]\ ],\ "linkType": "HARD"\ }]\ ]],\ - ["shebang-regex", [\ - ["npm:3.0.0", {\ - "packageLocation": "./.yarn/cache/shebang-regex-npm-3.0.0-899a0cd65e-1a2bcae50d.zip/node_modules/shebang-regex/",\ + ["workerpool", [\ + ["npm:6.2.1", {\ + "packageLocation": "./.yarn/cache/workerpool-npm-6.2.1-1486cb2056-c2c6eebbc5.zip/node_modules/workerpool/",\ "packageDependencies": [\ - ["shebang-regex", "npm:3.0.0"]\ + ["workerpool", "npm:6.2.1"]\ ],\ "linkType": "HARD"\ }]\ ]],\ - ["strip-ansi", [\ - ["npm:6.0.1", {\ - "packageLocation": "./.yarn/cache/strip-ansi-npm-6.0.1-caddc7cb40-f3cd25890a.zip/node_modules/strip-ansi/",\ + ["wrap-ansi", [\ + ["npm:7.0.0", {\ + "packageLocation": "./.yarn/cache/wrap-ansi-npm-7.0.0-ad6e1a0554-a790b846fd.zip/node_modules/wrap-ansi/",\ "packageDependencies": [\ - ["strip-ansi", "npm:6.0.1"],\ - ["ansi-regex", "npm:5.0.1"]\ + ["wrap-ansi", "npm:7.0.0"],\ + ["ansi-styles", "npm:4.3.0"],\ + ["string-width", "npm:4.2.3"],\ + ["strip-ansi", "npm:6.0.1"]\ ],\ "linkType": "HARD"\ - }]\ - ]],\ - ["strip-json-comments", [\ - ["npm:3.1.1", {\ - "packageLocation": "./.yarn/cache/strip-json-comments-npm-3.1.1-dcb2324823-492f73e272.zip/node_modules/strip-json-comments/",\ + }],\ + ["npm:8.1.0", {\ + "packageLocation": "./.yarn/cache/wrap-ansi-npm-8.1.0-26a4e6ae28-371733296d.zip/node_modules/wrap-ansi/",\ "packageDependencies": [\ - ["strip-json-comments", "npm:3.1.1"]\ + ["wrap-ansi", "npm:8.1.0"],\ + ["ansi-styles", "npm:6.2.1"],\ + ["string-width", "npm:5.1.2"],\ + ["strip-ansi", "npm:7.1.0"]\ ],\ "linkType": "HARD"\ }]\ ]],\ - ["supports-color", [\ - ["npm:7.2.0", {\ - "packageLocation": "./.yarn/cache/supports-color-npm-7.2.0-606bfcf7da-3dda818de0.zip/node_modules/supports-color/",\ + ["wrappy", [\ + ["npm:1.0.2", {\ + "packageLocation": "./.yarn/cache/wrappy-npm-1.0.2-916de4d4b3-159da4805f.zip/node_modules/wrappy/",\ "packageDependencies": [\ - ["supports-color", "npm:7.2.0"],\ - ["has-flag", "npm:4.0.0"]\ + ["wrappy", "npm:1.0.2"]\ ],\ "linkType": "HARD"\ }]\ ]],\ - ["text-table", [\ - ["npm:0.2.0", {\ - "packageLocation": "./.yarn/cache/text-table-npm-0.2.0-d92a778b59-b6937a38c8.zip/node_modules/text-table/",\ + ["y18n", [\ + ["npm:5.0.8", {\ + "packageLocation": "./.yarn/cache/y18n-npm-5.0.8-5f3a0a7e62-54f0fb9562.zip/node_modules/y18n/",\ "packageDependencies": [\ - ["text-table", "npm:0.2.0"]\ + ["y18n", "npm:5.0.8"]\ ],\ "linkType": "HARD"\ }]\ ]],\ - ["type-check", [\ - ["npm:0.4.0", {\ - "packageLocation": "./.yarn/cache/type-check-npm-0.4.0-60565800ce-ec688ebfc9.zip/node_modules/type-check/",\ + ["yallist", [\ + ["npm:4.0.0", {\ + "packageLocation": "./.yarn/cache/yallist-npm-4.0.0-b493d9e907-343617202a.zip/node_modules/yallist/",\ "packageDependencies": [\ - ["type-check", "npm:0.4.0"],\ - ["prelude-ls", "npm:1.2.1"]\ + ["yallist", "npm:4.0.0"]\ ],\ "linkType": "HARD"\ }]\ ]],\ - ["type-fest", [\ - ["npm:0.20.2", {\ - "packageLocation": "./.yarn/cache/type-fest-npm-0.20.2-b36432617f-4fb3272df2.zip/node_modules/type-fest/",\ + ["yargs", [\ + ["npm:16.2.0", {\ + "packageLocation": "./.yarn/cache/yargs-npm-16.2.0-547873d425-b14afbb51e.zip/node_modules/yargs/",\ "packageDependencies": [\ - ["type-fest", "npm:0.20.2"]\ + ["yargs", "npm:16.2.0"],\ + ["cliui", "npm:7.0.4"],\ + ["escalade", "npm:3.1.1"],\ + ["get-caller-file", "npm:2.0.5"],\ + ["require-directory", "npm:2.1.1"],\ + ["string-width", "npm:4.2.3"],\ + ["y18n", "npm:5.0.8"],\ + ["yargs-parser", "npm:20.2.9"]\ ],\ "linkType": "HARD"\ }]\ ]],\ - ["uri-js", [\ - ["npm:4.4.1", {\ - "packageLocation": "./.yarn/cache/uri-js-npm-4.4.1-66d11cbcaf-7167432de6.zip/node_modules/uri-js/",\ + ["yargs-parser", [\ + ["npm:20.2.4", {\ + "packageLocation": "./.yarn/cache/yargs-parser-npm-20.2.4-1de20916a6-d251998a37.zip/node_modules/yargs-parser/",\ "packageDependencies": [\ - ["uri-js", "npm:4.4.1"],\ - ["punycode", "npm:2.3.0"]\ + ["yargs-parser", "npm:20.2.4"]\ ],\ "linkType": "HARD"\ - }]\ - ]],\ - ["which", [\ - ["npm:2.0.2", {\ - "packageLocation": "./.yarn/cache/which-npm-2.0.2-320ddf72f7-1a5c563d3c.zip/node_modules/which/",\ + }],\ + ["npm:20.2.9", {\ + "packageLocation": "./.yarn/cache/yargs-parser-npm-20.2.9-a1d19e598d-8bb69015f2.zip/node_modules/yargs-parser/",\ "packageDependencies": [\ - ["which", "npm:2.0.2"],\ - ["isexe", "npm:2.0.0"]\ + ["yargs-parser", "npm:20.2.9"]\ ],\ "linkType": "HARD"\ }]\ ]],\ - ["wrappy", [\ - ["npm:1.0.2", {\ - "packageLocation": "./.yarn/cache/wrappy-npm-1.0.2-916de4d4b3-159da4805f.zip/node_modules/wrappy/",\ + ["yargs-unparser", [\ + ["npm:2.0.0", {\ + "packageLocation": "./.yarn/cache/yargs-unparser-npm-2.0.0-930f3ff3f6-68f9a542c6.zip/node_modules/yargs-unparser/",\ "packageDependencies": [\ - ["wrappy", "npm:1.0.2"]\ + ["yargs-unparser", "npm:2.0.0"],\ + ["camelcase", "npm:6.3.0"],\ + ["decamelize", "npm:4.0.0"],\ + ["flat", "npm:5.0.2"],\ + ["is-plain-obj", "npm:2.1.0"]\ ],\ "linkType": "HARD"\ }]\ diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/linter.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/linter.rs index e5067a46..ac2ce6a5 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/linter.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/linter.rs @@ -1,12 +1,14 @@ use crate::errors::SolidHunterError; use crate::rules::factory::RuleFactory; -use crate::rules::rule_impl::parse_rules; +use crate::rules::create_default_rules; +use crate::rules::rule_impl::{create_rules_file, parse_rules}; use crate::rules::types::*; use crate::types::*; use std::fs; use glob::glob; +#[derive(Debug)] pub struct SolidFile { pub data: ast_extractor::File, pub path: String, @@ -36,6 +38,21 @@ impl SolidLinter { linter } + pub fn new_fileless() -> Self { + let default_rules = create_default_rules(); + let mut linter = SolidLinter { + files: Vec::new(), + rule_factory: RuleFactory::default(), + rules: Vec::new(), + }; + + for rule in default_rules { + linter.rules.push(linter.rule_factory.create_rule(rule)); + } + + linter + } + fn _create_rules(&mut self, rules_config: &str) -> Result<(), SolidHunterError> { let res = parse_rules(rules_config)?; for rule in res.rules { diff --git a/toolchains/solidity/linter/core/src/lsp_server.rs b/toolchains/solidity/linter/core/src/lsp_server.rs index 4186251f..dd3d8f2a 100644 --- a/toolchains/solidity/linter/core/src/lsp_server.rs +++ b/toolchains/solidity/linter/core/src/lsp_server.rs @@ -1,40 +1,144 @@ +use std::sync::{Arc}; +use tokio::sync::Mutex; + +use solidhunter_lib::linter::SolidLinter; +use solidhunter_lib::types::LintDiag; use tower_lsp::jsonrpc::Result; use tower_lsp::lsp_types::*; use tower_lsp::{Client, LanguageServer, LspService, Server}; -#[derive(Debug)] +use crate::Args; + struct Backend { client: Client, + config_file_path: String, + working_dir: String, + linter: Arc>> } #[tower_lsp::async_trait] impl LanguageServer for Backend { async fn initialize(&self, _: InitializeParams) -> Result { - Ok(InitializeResult::default()) + Ok(InitializeResult { + server_info: None, + capabilities: ServerCapabilities { + text_document_sync: Some(TextDocumentSyncCapability::Kind( + TextDocumentSyncKind::FULL, + )), + ..ServerCapabilities::default() + }, + }) } async fn initialized(&self, _: InitializedParams) { self.client - .log_message(MessageType::INFO, "server initialized!") + .log_message(MessageType::INFO, "Server initialized!") .await; + + let file_res = std::fs::read_to_string(&self.config_file_path); + + if let Ok(file) = file_res { + let mut linter = self.linter.lock().await; + linter.replace(SolidLinter::new(&file)); + } else { + let mut linter = self.linter.lock().await; + linter.replace(SolidLinter::new_fileless()); + } + + self.client + .log_message(MessageType::INFO, "Linter initialized!") + .await; + } async fn shutdown(&self) -> Result<()> { + self.client + .log_message(MessageType::INFO, "Server shutdown!") + .await; Ok(()) } - async fn did_open(&self, _: DidOpenTextDocumentParams) { + async fn did_open(&self, params: DidOpenTextDocumentParams) { self.client .log_message(MessageType::INFO, "file opened!") .await; + + let mut linter = self.linter.lock().await; + let filepath = filepath_from_uri(¶ms.text_document.uri); + let linter = linter.as_mut().unwrap(); + let diags_res = linter.parse_content(filepath, ¶ms.text_document.text); + + if let Ok(diags) = diags_res { + let diags = diags.iter().map(|d| diagnostic_from_lintdiag(d.clone())).collect(); + self.client.log_message(MessageType::INFO, "diags: ").await; + self.client.publish_diagnostics(params.text_document.uri.clone(), diags, None).await; + //self.client.publish_diagnostics(params.text_document.uri, diags, None).await; + } else if let Err(e) = diags_res { + self.client.log_message(MessageType::ERROR, e.to_string()).await; + } + + } + + async fn did_change(&self, params: DidChangeTextDocumentParams) { + self.client + .log_message(MessageType::INFO, "file changed!") + .await; + + let mut linter = self.linter.lock().await; + let filepath = filepath_from_uri(¶ms.text_document.uri); + let linter = linter.as_mut().unwrap(); + let diags_res = linter.parse_content(filepath, ¶ms.content_changes[0].text); + + if let Ok(diags) = diags_res { + let diags = diags.iter().map(|d| diagnostic_from_lintdiag(d.clone())).collect(); + self.client.log_message(MessageType::INFO, "diags: ").await; + self.client.publish_diagnostics(params.text_document.uri.clone(), diags, None).await; + //self.client.publish_diagnostics(params.text_document.uri, diags, None).await; + } else if let Err(e) = diags_res { + self.client.log_message(MessageType::ERROR, e.to_string()).await; + } + } +} + +pub fn filepath_from_uri(uri: &Url) -> String { + let path = uri.path(); +// let path = path.strip_prefix("/").unwrap_or(path); + path.to_string() +} + +fn diagnostic_from_lintdiag(diag: LintDiag) -> Diagnostic { + Diagnostic { + range: Range { + start: Position { + line: diag.range.start.line as u32, + character: diag.range.start.character as u32, + }, + end: Position { + line: diag.range.end.line as u32, + character: diag.range.end.character as u32, + }, + }, + severity: Some(DiagnosticSeverity::WARNING), + code: None, + code_description: None, + source: Some("solidity-linter".to_string()), + message: diag.message, + related_information: None, + tags: None, + data: None, } } #[tokio::main] -pub async fn run_server() { +pub async fn run_server(args: Args) { let stdin = tokio::io::stdin(); let stdout = tokio::io::stdout(); - let (service, socket) = LspService::new(|client| Backend { client }); + let (service, socket) = LspService::new(|client| Backend { + client, + config_file_path: args.rules_file, + working_dir: args.project_path[0].clone(), + linter: Arc::new(Mutex::new(None)) + }); Server::new(stdin, stdout, socket).serve(service).await; } \ No newline at end of file diff --git a/toolchains/solidity/linter/core/src/main.rs b/toolchains/solidity/linter/core/src/main.rs index fa84aece..885ad52f 100644 --- a/toolchains/solidity/linter/core/src/main.rs +++ b/toolchains/solidity/linter/core/src/main.rs @@ -8,7 +8,7 @@ use lsp_server::run_server; #[derive(Parser, Debug)] #[command(author, version, about, long_about = None)] -struct Args { +pub struct Args { #[arg( short = 'p', long = "path", @@ -65,8 +65,8 @@ struct Args { init: bool, #[arg( - short = 'l', - long = "lsp", + short = 's', + long = "stdio", default_value = "false", help = "Starts the language server instead of linting" )] @@ -101,8 +101,9 @@ fn main() { let args = Args::parse(); if args.lsp { - println!("Starting language server..."); - run_server(); + //println!("Starting language server..."); + run_server(args); + //println!("Done!"); return; } diff --git a/yarn.lock b/yarn.lock index 86f581f8..4e067ff7 100644 --- a/yarn.lock +++ b/yarn.lock @@ -12,6 +12,13 @@ __metadata: languageName: node linkType: hard +"@discoveryjs/json-ext@npm:^0.5.0": + version: 0.5.7 + resolution: "@discoveryjs/json-ext@npm:0.5.7" + checksum: 2176d301cc258ea5c2324402997cf8134ebb212469c0d397591636cea8d3c02f2b3cf9fd58dcb748c7a0dade77ebdc1b10284fa63e608c033a1db52fddc69918 + languageName: node + linkType: hard + "@eslint-community/eslint-utils@npm:^4.2.0": version: 4.4.0 resolution: "@eslint-community/eslint-utils@npm:4.4.0" @@ -23,6 +30,13 @@ __metadata: languageName: node linkType: hard +"@eslint-community/regexpp@npm:^4.4.0": + version: 4.8.0 + resolution: "@eslint-community/regexpp@npm:4.8.0" + checksum: 601e6d033d556e98e8c929905bef335f20d7389762812df4d0f709d9b4d2631610dda975fb272e23b5b68e24a163b3851b114c8080a0a19fb4c141a1eff6305b + languageName: node + linkType: hard + "@eslint-community/regexpp@npm:^4.6.1": version: 4.6.2 resolution: "@eslint-community/regexpp@npm:4.6.2" @@ -47,6 +61,30 @@ __metadata: languageName: node linkType: hard +"@eslint/eslintrc@npm:^2.1.2": + version: 2.1.2 + resolution: "@eslint/eslintrc@npm:2.1.2" + dependencies: + ajv: ^6.12.4 + debug: ^4.3.2 + espree: ^9.6.0 + globals: ^13.19.0 + ignore: ^5.2.0 + import-fresh: ^3.2.1 + js-yaml: ^4.1.0 + minimatch: ^3.1.2 + strip-json-comments: ^3.1.1 + checksum: bc742a1e3b361f06fedb4afb6bf32cbd27171292ef7924f61c62f2aed73048367bcc7ac68f98c06d4245cd3fabc43270f844e3c1699936d4734b3ac5398814a7 + languageName: node + linkType: hard + +"@eslint/js@npm:8.49.0": + version: 8.49.0 + resolution: "@eslint/js@npm:8.49.0" + checksum: a6601807c8aeeefe866926ad92ed98007c034a735af20ff709009e39ad1337474243d47908500a3bde04e37bfba16bcf1d3452417f962e1345bc8756edd6b830 + languageName: node + linkType: hard + "@eslint/js@npm:^8.46.0": version: 8.46.0 resolution: "@eslint/js@npm:8.46.0" @@ -65,6 +103,17 @@ __metadata: languageName: node linkType: hard +"@humanwhocodes/config-array@npm:^0.11.11": + version: 0.11.11 + resolution: "@humanwhocodes/config-array@npm:0.11.11" + dependencies: + "@humanwhocodes/object-schema": ^1.2.1 + debug: ^4.1.1 + minimatch: ^3.0.5 + checksum: db84507375ab77b8ffdd24f498a5b49ad6b64391d30dd2ac56885501d03964d29637e05b1ed5aefa09d57ac667e28028bc22d2da872bfcd619652fbdb5f4ca19 + languageName: node + linkType: hard + "@humanwhocodes/module-importer@npm:^1.0.1": version: 1.0.1 resolution: "@humanwhocodes/module-importer@npm:1.0.1" @@ -79,6 +128,72 @@ __metadata: languageName: node linkType: hard +"@isaacs/cliui@npm:^8.0.2": + version: 8.0.2 + resolution: "@isaacs/cliui@npm:8.0.2" + dependencies: + string-width: ^5.1.2 + string-width-cjs: "npm:string-width@^4.2.0" + strip-ansi: ^7.0.1 + strip-ansi-cjs: "npm:strip-ansi@^6.0.1" + wrap-ansi: ^8.1.0 + wrap-ansi-cjs: "npm:wrap-ansi@^7.0.0" + checksum: 4a473b9b32a7d4d3cfb7a614226e555091ff0c5a29a1734c28c72a182c2f6699b26fc6b5c2131dfd841e86b185aea714c72201d7c98c2fba5f17709333a67aeb + languageName: node + linkType: hard + +"@jridgewell/gen-mapping@npm:^0.3.0": + version: 0.3.3 + resolution: "@jridgewell/gen-mapping@npm:0.3.3" + dependencies: + "@jridgewell/set-array": ^1.0.1 + "@jridgewell/sourcemap-codec": ^1.4.10 + "@jridgewell/trace-mapping": ^0.3.9 + checksum: 4a74944bd31f22354fc01c3da32e83c19e519e3bbadafa114f6da4522ea77dd0c2842607e923a591d60a76699d819a2fbb6f3552e277efdb9b58b081390b60ab + languageName: node + linkType: hard + +"@jridgewell/resolve-uri@npm:^3.1.0": + version: 3.1.1 + resolution: "@jridgewell/resolve-uri@npm:3.1.1" + checksum: f5b441fe7900eab4f9155b3b93f9800a916257f4e8563afbcd3b5a5337b55e52bd8ae6735453b1b745457d9f6cdb16d74cd6220bbdd98cf153239e13f6cbb653 + languageName: node + linkType: hard + +"@jridgewell/set-array@npm:^1.0.1": + version: 1.1.2 + resolution: "@jridgewell/set-array@npm:1.1.2" + checksum: 69a84d5980385f396ff60a175f7177af0b8da4ddb81824cb7016a9ef914eee9806c72b6b65942003c63f7983d4f39a5c6c27185bbca88eb4690b62075602e28e + languageName: node + linkType: hard + +"@jridgewell/source-map@npm:^0.3.3": + version: 0.3.5 + resolution: "@jridgewell/source-map@npm:0.3.5" + dependencies: + "@jridgewell/gen-mapping": ^0.3.0 + "@jridgewell/trace-mapping": ^0.3.9 + checksum: 1ad4dec0bdafbade57920a50acec6634f88a0eb735851e0dda906fa9894e7f0549c492678aad1a10f8e144bfe87f238307bf2a914a1bc85b7781d345417e9f6f + languageName: node + linkType: hard + +"@jridgewell/sourcemap-codec@npm:^1.4.10, @jridgewell/sourcemap-codec@npm:^1.4.14": + version: 1.4.15 + resolution: "@jridgewell/sourcemap-codec@npm:1.4.15" + checksum: b881c7e503db3fc7f3c1f35a1dd2655a188cc51a3612d76efc8a6eb74728bef5606e6758ee77423e564092b4a518aba569bbb21c9bac5ab7a35b0c6ae7e344c8 + languageName: node + linkType: hard + +"@jridgewell/trace-mapping@npm:^0.3.17, @jridgewell/trace-mapping@npm:^0.3.9": + version: 0.3.19 + resolution: "@jridgewell/trace-mapping@npm:0.3.19" + dependencies: + "@jridgewell/resolve-uri": ^3.1.0 + "@jridgewell/sourcemap-codec": ^1.4.14 + checksum: 956a6f0f6fec060fb48c6bf1f5ec2064e13cd38c8be3873877d4b92b4a27ba58289a34071752671262a3e3c202abcc3fa2aac64d8447b4b0fa1ba3c9047f1c20 + languageName: node + linkType: hard + "@nodelib/fs.scandir@npm:2.1.5": version: 2.1.5 resolution: "@nodelib/fs.scandir@npm:2.1.5" @@ -89,14 +204,14 @@ __metadata: languageName: node linkType: hard -"@nodelib/fs.stat@npm:2.0.5": +"@nodelib/fs.stat@npm:2.0.5, @nodelib/fs.stat@npm:^2.0.2": version: 2.0.5 resolution: "@nodelib/fs.stat@npm:2.0.5" checksum: 012480b5ca9d97bff9261571dbbec7bbc6033f69cc92908bc1ecfad0792361a5a1994bc48674b9ef76419d056a03efadfce5a6cf6dbc0a36559571a7a483f6f0 languageName: node linkType: hard -"@nodelib/fs.walk@npm:^1.2.8": +"@nodelib/fs.walk@npm:^1.2.3, @nodelib/fs.walk@npm:^1.2.8": version: 1.2.8 resolution: "@nodelib/fs.walk@npm:1.2.8" dependencies: @@ -106,6 +221,15 @@ __metadata: languageName: node linkType: hard +"@npmcli/fs@npm:^3.1.0": + version: 3.1.0 + resolution: "@npmcli/fs@npm:3.1.0" + dependencies: + semver: ^7.3.5 + checksum: a50a6818de5fc557d0b0e6f50ec780a7a02ab8ad07e5ac8b16bf519e0ad60a144ac64f97d05c443c3367235d337182e1d012bbac0eb8dbae8dc7b40b193efd0e + languageName: node + linkType: hard + "@osmium-libs/ast-extractor@workspace:libs/ast-extractor": version: 0.0.0-use.local resolution: "@osmium-libs/ast-extractor@workspace:libs/ast-extractor" @@ -134,6 +258,28 @@ __metadata: languageName: unknown linkType: soft +"@osmium-toolchains/solidity-linter-extension@workspace:toolchains/solidity/linter/extension": + version: 0.0.0-use.local + resolution: "@osmium-toolchains/solidity-linter-extension@workspace:toolchains/solidity/linter/extension" + dependencies: + "@types/glob": ^8.1.0 + "@types/mocha": ^10.0.1 + "@types/node": 20.2.5 + "@types/vscode": ^1.82.0 + "@typescript-eslint/eslint-plugin": ^5.59.8 + "@typescript-eslint/parser": ^5.59.8 + "@vscode/test-electron": ^2.3.2 + eslint: ^8.41.0 + glob: ^8.1.0 + mocha: ^10.2.0 + ts-loader: ^9.4.3 + typescript: ^5.1.3 + vscode-languageclient: ^8.1.0 + webpack: ^5.85.0 + webpack-cli: ^5.1.1 + languageName: unknown + linkType: soft + "@osmium-toolchains/solidity@workspace:toolchains/solidity": version: 0.0.0-use.local resolution: "@osmium-toolchains/solidity@workspace:toolchains/solidity" @@ -164,773 +310,3358 @@ __metadata: languageName: unknown linkType: soft -"acorn-jsx@npm:^5.3.2": - version: 5.3.2 - resolution: "acorn-jsx@npm:5.3.2" - peerDependencies: - acorn: ^6.0.0 || ^7.0.0 || ^8.0.0 - checksum: c3d3b2a89c9a056b205b69530a37b972b404ee46ec8e5b341666f9513d3163e2a4f214a71f4dfc7370f5a9c07472d2fd1c11c91c3f03d093e37637d95da98950 +"@pkgjs/parseargs@npm:^0.11.0": + version: 0.11.0 + resolution: "@pkgjs/parseargs@npm:0.11.0" + checksum: 6ad6a00fc4f2f2cfc6bff76fb1d88b8ee20bc0601e18ebb01b6d4be583733a860239a521a7fbca73b612e66705078809483549d2b18f370eb346c5155c8e4a0f languageName: node linkType: hard -"acorn@npm:^8.9.0": - version: 8.10.0 - resolution: "acorn@npm:8.10.0" - bin: - acorn: bin/acorn - checksum: 538ba38af0cc9e5ef983aee196c4b8b4d87c0c94532334fa7e065b2c8a1f85863467bb774231aae91613fcda5e68740c15d97b1967ae3394d20faddddd8af61d +"@tootallnate/once@npm:1": + version: 1.1.2 + resolution: "@tootallnate/once@npm:1.1.2" + checksum: e1fb1bbbc12089a0cb9433dc290f97bddd062deadb6178ce9bcb93bb7c1aecde5e60184bc7065aec42fe1663622a213493c48bbd4972d931aae48315f18e1be9 languageName: node linkType: hard -"ajv@npm:^6.12.4": - version: 6.12.6 - resolution: "ajv@npm:6.12.6" - dependencies: - fast-deep-equal: ^3.1.1 - fast-json-stable-stringify: ^2.0.0 - json-schema-traverse: ^0.4.1 - uri-js: ^4.2.2 - checksum: 874972efe5c4202ab0a68379481fbd3d1b5d0a7bd6d3cc21d40d3536ebff3352a2a1fabb632d4fd2cc7fe4cbdcd5ed6782084c9bbf7f32a1536d18f9da5007d4 +"@tootallnate/once@npm:2": + version: 2.0.0 + resolution: "@tootallnate/once@npm:2.0.0" + checksum: ad87447820dd3f24825d2d947ebc03072b20a42bfc96cbafec16bff8bbda6c1a81fcb0be56d5b21968560c5359a0af4038a68ba150c3e1694fe4c109a063bed8 languageName: node linkType: hard -"ansi-regex@npm:^5.0.1": - version: 5.0.1 - resolution: "ansi-regex@npm:5.0.1" - checksum: 2aa4bb54caf2d622f1afdad09441695af2a83aa3fe8b8afa581d205e57ed4261c183c4d3877cee25794443fde5876417d859c108078ab788d6af7e4fe52eb66b +"@types/eslint-scope@npm:^3.7.3": + version: 3.7.4 + resolution: "@types/eslint-scope@npm:3.7.4" + dependencies: + "@types/eslint": "*" + "@types/estree": "*" + checksum: ea6a9363e92f301cd3888194469f9ec9d0021fe0a397a97a6dd689e7545c75de0bd2153dfb13d3ab532853a278b6572c6f678ce846980669e41029d205653460 languageName: node linkType: hard -"ansi-styles@npm:^4.1.0": - version: 4.3.0 - resolution: "ansi-styles@npm:4.3.0" +"@types/eslint@npm:*": + version: 8.44.2 + resolution: "@types/eslint@npm:8.44.2" dependencies: - color-convert: ^2.0.1 - checksum: 513b44c3b2105dd14cc42a19271e80f386466c4be574bccf60b627432f9198571ebf4ab1e4c3ba17347658f4ee1711c163d574248c0c1cdc2d5917a0ad582ec4 + "@types/estree": "*" + "@types/json-schema": "*" + checksum: 25b3ef61bae96350026593c9914c8a61ee02fde48ab8d568a73ee45032f13c0028c62e47a5ff78715af488dfe8e8bba913f7d30f859f60c7f9e639d328e80482 languageName: node linkType: hard -"argparse@npm:^2.0.1": - version: 2.0.1 - resolution: "argparse@npm:2.0.1" - checksum: 83644b56493e89a254bae05702abf3a1101b4fa4d0ca31df1c9985275a5a5bd47b3c27b7fa0b71098d41114d8ca000e6ed90cad764b306f8a503665e4d517ced +"@types/estree@npm:*, @types/estree@npm:^1.0.0": + version: 1.0.1 + resolution: "@types/estree@npm:1.0.1" + checksum: e9aa175eacb797216fafce4d41e8202c7a75555bc55232dee0f9903d7171f8f19f0ae7d5191bb1a88cb90e65468be508c0df850a9fb81b4433b293a5a749899d languageName: node linkType: hard -"balanced-match@npm:^1.0.0": - version: 1.0.2 - resolution: "balanced-match@npm:1.0.2" - checksum: 9706c088a283058a8a99e0bf91b0a2f75497f185980d9ffa8b304de1d9e58ebda7c72c07ebf01dadedaac5b2907b2c6f566f660d62bd336c3468e960403b9d65 +"@types/glob@npm:^8.1.0": + version: 8.1.0 + resolution: "@types/glob@npm:8.1.0" + dependencies: + "@types/minimatch": ^5.1.2 + "@types/node": "*" + checksum: 9101f3a9061e40137190f70626aa0e202369b5ec4012c3fabe6f5d229cce04772db9a94fa5a0eb39655e2e4ad105c38afbb4af56a56c0996a8c7d4fc72350e3d languageName: node linkType: hard -"brace-expansion@npm:^1.1.7": - version: 1.1.11 - resolution: "brace-expansion@npm:1.1.11" - dependencies: - balanced-match: ^1.0.0 - concat-map: 0.0.1 - checksum: faf34a7bb0c3fcf4b59c7808bc5d2a96a40988addf2e7e09dfbb67a2251800e0d14cd2bfc1aa79174f2f5095c54ff27f46fb1289fe2d77dac755b5eb3434cc07 +"@types/json-schema@npm:*, @types/json-schema@npm:^7.0.8, @types/json-schema@npm:^7.0.9": + version: 7.0.12 + resolution: "@types/json-schema@npm:7.0.12" + checksum: 00239e97234eeb5ceefb0c1875d98ade6e922bfec39dd365ec6bd360b5c2f825e612ac4f6e5f1d13601b8b30f378f15e6faa805a3a732f4a1bbe61915163d293 languageName: node linkType: hard -"callsites@npm:^3.0.0": - version: 3.1.0 - resolution: "callsites@npm:3.1.0" - checksum: 072d17b6abb459c2ba96598918b55868af677154bec7e73d222ef95a8fdb9bbf7dae96a8421085cdad8cd190d86653b5b6dc55a4484f2e5b2e27d5e0c3fc15b3 +"@types/minimatch@npm:^5.1.2": + version: 5.1.2 + resolution: "@types/minimatch@npm:5.1.2" + checksum: 0391a282860c7cb6fe262c12b99564732401bdaa5e395bee9ca323c312c1a0f45efbf34dce974682036e857db59a5c9b1da522f3d6055aeead7097264c8705a8 languageName: node linkType: hard -"chalk@npm:^4.0.0": - version: 4.1.2 - resolution: "chalk@npm:4.1.2" - dependencies: - ansi-styles: ^4.1.0 - supports-color: ^7.1.0 - checksum: fe75c9d5c76a7a98d45495b91b2172fa3b7a09e0cc9370e5c8feb1c567b85c4288e2b3fded7cfdd7359ac28d6b3844feb8b82b8686842e93d23c827c417e83fc +"@types/mocha@npm:^10.0.1": + version: 10.0.1 + resolution: "@types/mocha@npm:10.0.1" + checksum: 224ea9fce7b1734ccdb9aa99a622d902a538ce1847bca7fd22c5fb38adcf3ed536f50f48f587085db988a4bb3c2eb68f4b98e1cd6a38bc5547bd3bbbedc54495 languageName: node linkType: hard -"color-convert@npm:^2.0.1": - version: 2.0.1 - resolution: "color-convert@npm:2.0.1" - dependencies: - color-name: ~1.1.4 - checksum: 79e6bdb9fd479a205c71d89574fccfb22bd9053bd98c6c4d870d65c132e5e904e6034978e55b43d69fcaa7433af2016ee203ce76eeba9cfa554b373e7f7db336 +"@types/node@npm:*": + version: 20.6.0 + resolution: "@types/node@npm:20.6.0" + checksum: 52611801af5cf151c6fac1963aa4a8a8ca2e388a9e9ed82b01b70bca762088ded5b32cc789c5564220d5d7dccba2b8dd34446a3d4fc74736805e1f2cf262e29d languageName: node linkType: hard -"color-name@npm:~1.1.4": - version: 1.1.4 - resolution: "color-name@npm:1.1.4" - checksum: b0445859521eb4021cd0fb0cc1a75cecf67fceecae89b63f62b201cca8d345baf8b952c966862a9d9a2632987d4f6581f0ec8d957dfacece86f0a7919316f610 +"@types/node@npm:20.2.5": + version: 20.2.5 + resolution: "@types/node@npm:20.2.5" + checksum: 38ce7c7e9d76880dc632f71d71e0d5914fcda9d5e9a7095d6c339abda55ca4affb0f2a882aeb29398f8e09d2c5151f0b6586c81c8ccdfe529c34b1ea3337425e languageName: node linkType: hard -"concat-map@npm:0.0.1": - version: 0.0.1 - resolution: "concat-map@npm:0.0.1" - checksum: 902a9f5d8967a3e2faf138d5cb784b9979bad2e6db5357c5b21c568df4ebe62bcb15108af1b2253744844eb964fc023fbd9afbbbb6ddd0bcc204c6fb5b7bf3af +"@types/semver@npm:^7.3.12": + version: 7.5.1 + resolution: "@types/semver@npm:7.5.1" + checksum: 2fffe938c7ac168711f245a16e1856a3578d77161ca17e29a05c3e02c7be3e9c5beefa29a3350f6c1bd982fb70aa28cc52e4845eb7d36246bcdc0377170d584d languageName: node linkType: hard -"cross-spawn@npm:^7.0.2": - version: 7.0.3 - resolution: "cross-spawn@npm:7.0.3" - dependencies: - path-key: ^3.1.0 - shebang-command: ^2.0.0 - which: ^2.0.1 - checksum: 671cc7c7288c3a8406f3c69a3ae2fc85555c04169e9d611def9a675635472614f1c0ed0ef80955d5b6d4e724f6ced67f0ad1bb006c2ea643488fcfef994d7f52 +"@types/vscode@npm:^1.82.0": + version: 1.82.0 + resolution: "@types/vscode@npm:1.82.0" + checksum: 2c546b61a0f52c8153bf52645e230e192609a77cd482c96a8eaa5f7008763b25bab684c688a77713dcb087464f99ff979a232bf145038f9cb91a395feb6a09d9 languageName: node linkType: hard -"debug@npm:^4.1.1, debug@npm:^4.3.2": - version: 4.3.4 - resolution: "debug@npm:4.3.4" +"@typescript-eslint/eslint-plugin@npm:^5.59.8": + version: 5.62.0 + resolution: "@typescript-eslint/eslint-plugin@npm:5.62.0" dependencies: - ms: 2.1.2 + "@eslint-community/regexpp": ^4.4.0 + "@typescript-eslint/scope-manager": 5.62.0 + "@typescript-eslint/type-utils": 5.62.0 + "@typescript-eslint/utils": 5.62.0 + debug: ^4.3.4 + graphemer: ^1.4.0 + ignore: ^5.2.0 + natural-compare-lite: ^1.4.0 + semver: ^7.3.7 + tsutils: ^3.21.0 + peerDependencies: + "@typescript-eslint/parser": ^5.0.0 + eslint: ^6.0.0 || ^7.0.0 || ^8.0.0 peerDependenciesMeta: - supports-color: + typescript: optional: true - checksum: 3dbad3f94ea64f34431a9cbf0bafb61853eda57bff2880036153438f50fb5a84f27683ba0d8e5426bf41a8c6ff03879488120cf5b3a761e77953169c0600a708 + checksum: fc104b389c768f9fa7d45a48c86d5c1ad522c1d0512943e782a56b1e3096b2cbcc1eea3fcc590647bf0658eef61aac35120a9c6daf979bf629ad2956deb516a1 languageName: node linkType: hard -"deep-is@npm:^0.1.3": - version: 0.1.4 - resolution: "deep-is@npm:0.1.4" - checksum: edb65dd0d7d1b9c40b2f50219aef30e116cedd6fc79290e740972c132c09106d2e80aa0bc8826673dd5a00222d4179c84b36a790eef63a4c4bca75a37ef90804 +"@typescript-eslint/parser@npm:^5.59.8": + version: 5.62.0 + resolution: "@typescript-eslint/parser@npm:5.62.0" + dependencies: + "@typescript-eslint/scope-manager": 5.62.0 + "@typescript-eslint/types": 5.62.0 + "@typescript-eslint/typescript-estree": 5.62.0 + debug: ^4.3.4 + peerDependencies: + eslint: ^6.0.0 || ^7.0.0 || ^8.0.0 + peerDependenciesMeta: + typescript: + optional: true + checksum: d168f4c7f21a7a63f47002e2d319bcbb6173597af5c60c1cf2de046b46c76b4930a093619e69faf2d30214c29ab27b54dcf1efc7046a6a6bd6f37f59a990e752 languageName: node linkType: hard -"doctrine@npm:^3.0.0": - version: 3.0.0 - resolution: "doctrine@npm:3.0.0" +"@typescript-eslint/scope-manager@npm:5.62.0": + version: 5.62.0 + resolution: "@typescript-eslint/scope-manager@npm:5.62.0" dependencies: - esutils: ^2.0.2 - checksum: fd7673ca77fe26cd5cba38d816bc72d641f500f1f9b25b83e8ce28827fe2da7ad583a8da26ab6af85f834138cf8dae9f69b0cd6ab925f52ddab1754db44d99ce + "@typescript-eslint/types": 5.62.0 + "@typescript-eslint/visitor-keys": 5.62.0 + checksum: 6062d6b797fe1ce4d275bb0d17204c827494af59b5eaf09d8a78cdd39dadddb31074dded4297aaf5d0f839016d601032857698b0e4516c86a41207de606e9573 languageName: node linkType: hard -"escape-string-regexp@npm:^4.0.0": - version: 4.0.0 - resolution: "escape-string-regexp@npm:4.0.0" - checksum: 98b48897d93060f2322108bf29db0feba7dd774be96cd069458d1453347b25ce8682ecc39859d4bca2203cc0ab19c237bcc71755eff49a0f8d90beadeeba5cc5 +"@typescript-eslint/type-utils@npm:5.62.0": + version: 5.62.0 + resolution: "@typescript-eslint/type-utils@npm:5.62.0" + dependencies: + "@typescript-eslint/typescript-estree": 5.62.0 + "@typescript-eslint/utils": 5.62.0 + debug: ^4.3.4 + tsutils: ^3.21.0 + peerDependencies: + eslint: "*" + peerDependenciesMeta: + typescript: + optional: true + checksum: fc41eece5f315dfda14320be0da78d3a971d650ea41300be7196934b9715f3fe1120a80207551eb71d39568275dbbcf359bde540d1ca1439d8be15e9885d2739 languageName: node linkType: hard -"eslint-scope@npm:^7.2.2": - version: 7.2.2 - resolution: "eslint-scope@npm:7.2.2" - dependencies: - esrecurse: ^4.3.0 - estraverse: ^5.2.0 - checksum: ec97dbf5fb04b94e8f4c5a91a7f0a6dd3c55e46bfc7bbcd0e3138c3a76977570e02ed89a1810c778dcd72072ff0e9621ba1379b4babe53921d71e2e4486fda3e +"@typescript-eslint/types@npm:5.62.0": + version: 5.62.0 + resolution: "@typescript-eslint/types@npm:5.62.0" + checksum: 48c87117383d1864766486f24de34086155532b070f6264e09d0e6139449270f8a9559cfef3c56d16e3bcfb52d83d42105d61b36743626399c7c2b5e0ac3b670 languageName: node linkType: hard -"eslint-visitor-keys@npm:^3.3.0, eslint-visitor-keys@npm:^3.4.1, eslint-visitor-keys@npm:^3.4.2": - version: 3.4.2 - resolution: "eslint-visitor-keys@npm:3.4.2" - checksum: 9e0e7e4aaea705c097ae37c97410e5f167d4d2193be2edcb1f0760762ede3df01545e4820ae314f42dcec687745f2c6dcaf6d83575c4a2a241eb0c8517d724f2 +"@typescript-eslint/typescript-estree@npm:5.62.0": + version: 5.62.0 + resolution: "@typescript-eslint/typescript-estree@npm:5.62.0" + dependencies: + "@typescript-eslint/types": 5.62.0 + "@typescript-eslint/visitor-keys": 5.62.0 + debug: ^4.3.4 + globby: ^11.1.0 + is-glob: ^4.0.3 + semver: ^7.3.7 + tsutils: ^3.21.0 + peerDependenciesMeta: + typescript: + optional: true + checksum: 3624520abb5807ed8f57b1197e61c7b1ed770c56dfcaca66372d584ff50175225798bccb701f7ef129d62c5989070e1ee3a0aa2d84e56d9524dcf011a2bb1a52 languageName: node linkType: hard -"eslint@npm:^8.46.0": - version: 8.46.0 - resolution: "eslint@npm:8.46.0" +"@typescript-eslint/utils@npm:5.62.0": + version: 5.62.0 + resolution: "@typescript-eslint/utils@npm:5.62.0" dependencies: "@eslint-community/eslint-utils": ^4.2.0 - "@eslint-community/regexpp": ^4.6.1 - "@eslint/eslintrc": ^2.1.1 - "@eslint/js": ^8.46.0 - "@humanwhocodes/config-array": ^0.11.10 - "@humanwhocodes/module-importer": ^1.0.1 - "@nodelib/fs.walk": ^1.2.8 - ajv: ^6.12.4 - chalk: ^4.0.0 - cross-spawn: ^7.0.2 - debug: ^4.3.2 - doctrine: ^3.0.0 - escape-string-regexp: ^4.0.0 - eslint-scope: ^7.2.2 - eslint-visitor-keys: ^3.4.2 - espree: ^9.6.1 - esquery: ^1.4.2 - esutils: ^2.0.2 - fast-deep-equal: ^3.1.3 - file-entry-cache: ^6.0.1 - find-up: ^5.0.0 - glob-parent: ^6.0.2 - globals: ^13.19.0 - graphemer: ^1.4.0 - ignore: ^5.2.0 - imurmurhash: ^0.1.4 - is-glob: ^4.0.0 - is-path-inside: ^3.0.3 - js-yaml: ^4.1.0 - json-stable-stringify-without-jsonify: ^1.0.1 - levn: ^0.4.1 - lodash.merge: ^4.6.2 - minimatch: ^3.1.2 - natural-compare: ^1.4.0 - optionator: ^0.9.3 - strip-ansi: ^6.0.1 - text-table: ^0.2.0 - bin: - eslint: bin/eslint.js - checksum: 7a7d36b1a3bbc12e08fbb5bc36fd482a7a5a1797e62e762499dd45601b9e45aaa53a129f31ce0b4444551a9639b8b681ad535f379893dd1e3ae37b31dccd82aa + "@types/json-schema": ^7.0.9 + "@types/semver": ^7.3.12 + "@typescript-eslint/scope-manager": 5.62.0 + "@typescript-eslint/types": 5.62.0 + "@typescript-eslint/typescript-estree": 5.62.0 + eslint-scope: ^5.1.1 + semver: ^7.3.7 + peerDependencies: + eslint: ^6.0.0 || ^7.0.0 || ^8.0.0 + checksum: ee9398c8c5db6d1da09463ca7bf36ed134361e20131ea354b2da16a5fdb6df9ba70c62a388d19f6eebb421af1786dbbd79ba95ddd6ab287324fc171c3e28d931 languageName: node linkType: hard -"espree@npm:^9.6.0, espree@npm:^9.6.1": - version: 9.6.1 - resolution: "espree@npm:9.6.1" +"@typescript-eslint/visitor-keys@npm:5.62.0": + version: 5.62.0 + resolution: "@typescript-eslint/visitor-keys@npm:5.62.0" dependencies: - acorn: ^8.9.0 - acorn-jsx: ^5.3.2 - eslint-visitor-keys: ^3.4.1 - checksum: eb8c149c7a2a77b3f33a5af80c10875c3abd65450f60b8af6db1bfcfa8f101e21c1e56a561c6dc13b848e18148d43469e7cd208506238554fb5395a9ea5a1ab9 + "@typescript-eslint/types": 5.62.0 + eslint-visitor-keys: ^3.3.0 + checksum: 976b05d103fe8335bef5c93ad3f76d781e3ce50329c0243ee0f00c0fcfb186c81df50e64bfdd34970148113f8ade90887f53e3c4938183afba830b4ba8e30a35 languageName: node linkType: hard -"esquery@npm:^1.4.2": - version: 1.5.0 - resolution: "esquery@npm:1.5.0" +"@vscode/test-electron@npm:^2.3.2": + version: 2.3.4 + resolution: "@vscode/test-electron@npm:2.3.4" dependencies: - estraverse: ^5.1.0 - checksum: aefb0d2596c230118656cd4ec7532d447333a410a48834d80ea648b1e7b5c9bc9ed8b5e33a89cb04e487b60d622f44cf5713bf4abed7c97343edefdc84a35900 + http-proxy-agent: ^4.0.1 + https-proxy-agent: ^5.0.0 + jszip: ^3.10.1 + semver: ^7.5.2 + checksum: 78de21d66be5affa26789e41a3f645bd07978a993ef026219136e55e4b7025e5e13f03bd9a1a1696690f802fed3e2e363828d1933e5bd581cadee94655272f00 languageName: node linkType: hard -"esrecurse@npm:^4.3.0": - version: 4.3.0 - resolution: "esrecurse@npm:4.3.0" +"@webassemblyjs/ast@npm:1.11.6, @webassemblyjs/ast@npm:^1.11.5": + version: 1.11.6 + resolution: "@webassemblyjs/ast@npm:1.11.6" dependencies: - estraverse: ^5.2.0 - checksum: ebc17b1a33c51cef46fdc28b958994b1dc43cd2e86237515cbc3b4e5d2be6a811b2315d0a1a4d9d340b6d2308b15322f5c8291059521cc5f4802f65e7ec32837 + "@webassemblyjs/helper-numbers": 1.11.6 + "@webassemblyjs/helper-wasm-bytecode": 1.11.6 + checksum: 38ef1b526ca47c210f30975b06df2faf1a8170b1636ce239fc5738fc231ce28389dd61ecedd1bacfc03cbe95b16d1af848c805652080cb60982836eb4ed2c6cf languageName: node linkType: hard -"estraverse@npm:^5.1.0, estraverse@npm:^5.2.0": - version: 5.3.0 - resolution: "estraverse@npm:5.3.0" - checksum: 072780882dc8416ad144f8fe199628d2b3e7bbc9989d9ed43795d2c90309a2047e6bc5979d7e2322a341163d22cfad9e21f4110597fe487519697389497e4e2b +"@webassemblyjs/floating-point-hex-parser@npm:1.11.6": + version: 1.11.6 + resolution: "@webassemblyjs/floating-point-hex-parser@npm:1.11.6" + checksum: 29b08758841fd8b299c7152eda36b9eb4921e9c584eb4594437b5cd90ed6b920523606eae7316175f89c20628da14326801090167cc7fbffc77af448ac84b7e2 languageName: node linkType: hard -"esutils@npm:^2.0.2": - version: 2.0.3 - resolution: "esutils@npm:2.0.3" - checksum: 22b5b08f74737379a840b8ed2036a5fb35826c709ab000683b092d9054e5c2a82c27818f12604bfc2a9a76b90b6834ef081edbc1c7ae30d1627012e067c6ec87 +"@webassemblyjs/helper-api-error@npm:1.11.6": + version: 1.11.6 + resolution: "@webassemblyjs/helper-api-error@npm:1.11.6" + checksum: e8563df85161096343008f9161adb138a6e8f3c2cc338d6a36011aa55eabb32f2fd138ffe63bc278d009ada001cc41d263dadd1c0be01be6c2ed99076103689f languageName: node linkType: hard -"fast-deep-equal@npm:^3.1.1, fast-deep-equal@npm:^3.1.3": +"@webassemblyjs/helper-buffer@npm:1.11.6": + version: 1.11.6 + resolution: "@webassemblyjs/helper-buffer@npm:1.11.6" + checksum: b14d0573bf680d22b2522e8a341ec451fddd645d1f9c6bd9012ccb7e587a2973b86ab7b89fe91e1c79939ba96095f503af04369a3b356c8023c13a5893221644 + languageName: node + linkType: hard + +"@webassemblyjs/helper-numbers@npm:1.11.6": + version: 1.11.6 + resolution: "@webassemblyjs/helper-numbers@npm:1.11.6" + dependencies: + "@webassemblyjs/floating-point-hex-parser": 1.11.6 + "@webassemblyjs/helper-api-error": 1.11.6 + "@xtuc/long": 4.2.2 + checksum: f4b562fa219f84368528339e0f8d273ad44e047a07641ffcaaec6f93e5b76fd86490a009aa91a294584e1436d74b0a01fa9fde45e333a4c657b58168b04da424 + languageName: node + linkType: hard + +"@webassemblyjs/helper-wasm-bytecode@npm:1.11.6": + version: 1.11.6 + resolution: "@webassemblyjs/helper-wasm-bytecode@npm:1.11.6" + checksum: 3535ef4f1fba38de3475e383b3980f4bbf3de72bbb631c2b6584c7df45be4eccd62c6ff48b5edd3f1bcff275cfd605a37679ec199fc91fd0a7705d7f1e3972dc + languageName: node + linkType: hard + +"@webassemblyjs/helper-wasm-section@npm:1.11.6": + version: 1.11.6 + resolution: "@webassemblyjs/helper-wasm-section@npm:1.11.6" + dependencies: + "@webassemblyjs/ast": 1.11.6 + "@webassemblyjs/helper-buffer": 1.11.6 + "@webassemblyjs/helper-wasm-bytecode": 1.11.6 + "@webassemblyjs/wasm-gen": 1.11.6 + checksum: b2cf751bf4552b5b9999d27bbb7692d0aca75260140195cb58ea6374d7b9c2dc69b61e10b211a0e773f66209c3ddd612137ed66097e3684d7816f854997682e9 + languageName: node + linkType: hard + +"@webassemblyjs/ieee754@npm:1.11.6": + version: 1.11.6 + resolution: "@webassemblyjs/ieee754@npm:1.11.6" + dependencies: + "@xtuc/ieee754": ^1.2.0 + checksum: 13574b8e41f6ca39b700e292d7edf102577db5650fe8add7066a320aa4b7a7c09a5056feccac7a74eb68c10dea9546d4461412af351f13f6b24b5f32379b49de + languageName: node + linkType: hard + +"@webassemblyjs/leb128@npm:1.11.6": + version: 1.11.6 + resolution: "@webassemblyjs/leb128@npm:1.11.6" + dependencies: + "@xtuc/long": 4.2.2 + checksum: 7ea942dc9777d4b18a5ebfa3a937b30ae9e1d2ce1fee637583ed7f376334dd1d4274f813d2e250056cca803e0952def4b954913f1a3c9068bcd4ab4ee5143bf0 + languageName: node + linkType: hard + +"@webassemblyjs/utf8@npm:1.11.6": + version: 1.11.6 + resolution: "@webassemblyjs/utf8@npm:1.11.6" + checksum: 807fe5b5ce10c390cfdd93e0fb92abda8aebabb5199980681e7c3743ee3306a75729bcd1e56a3903980e96c885ee53ef901fcbaac8efdfa480f9c0dae1d08713 + languageName: node + linkType: hard + +"@webassemblyjs/wasm-edit@npm:^1.11.5": + version: 1.11.6 + resolution: "@webassemblyjs/wasm-edit@npm:1.11.6" + dependencies: + "@webassemblyjs/ast": 1.11.6 + "@webassemblyjs/helper-buffer": 1.11.6 + "@webassemblyjs/helper-wasm-bytecode": 1.11.6 + "@webassemblyjs/helper-wasm-section": 1.11.6 + "@webassemblyjs/wasm-gen": 1.11.6 + "@webassemblyjs/wasm-opt": 1.11.6 + "@webassemblyjs/wasm-parser": 1.11.6 + "@webassemblyjs/wast-printer": 1.11.6 + checksum: 29ce75870496d6fad864d815ebb072395a8a3a04dc9c3f4e1ffdc63fc5fa58b1f34304a1117296d8240054cfdbc38aca88e71fb51483cf29ffab0a61ef27b481 + languageName: node + linkType: hard + +"@webassemblyjs/wasm-gen@npm:1.11.6": + version: 1.11.6 + resolution: "@webassemblyjs/wasm-gen@npm:1.11.6" + dependencies: + "@webassemblyjs/ast": 1.11.6 + "@webassemblyjs/helper-wasm-bytecode": 1.11.6 + "@webassemblyjs/ieee754": 1.11.6 + "@webassemblyjs/leb128": 1.11.6 + "@webassemblyjs/utf8": 1.11.6 + checksum: a645a2eecbea24833c3260a249704a7f554ef4a94c6000984728e94bb2bc9140a68dfd6fd21d5e0bbb09f6dfc98e083a45760a83ae0417b41a0196ff6d45a23a + languageName: node + linkType: hard + +"@webassemblyjs/wasm-opt@npm:1.11.6": + version: 1.11.6 + resolution: "@webassemblyjs/wasm-opt@npm:1.11.6" + dependencies: + "@webassemblyjs/ast": 1.11.6 + "@webassemblyjs/helper-buffer": 1.11.6 + "@webassemblyjs/wasm-gen": 1.11.6 + "@webassemblyjs/wasm-parser": 1.11.6 + checksum: b4557f195487f8e97336ddf79f7bef40d788239169aac707f6eaa2fa5fe243557c2d74e550a8e57f2788e70c7ae4e7d32f7be16101afe183d597b747a3bdd528 + languageName: node + linkType: hard + +"@webassemblyjs/wasm-parser@npm:1.11.6, @webassemblyjs/wasm-parser@npm:^1.11.5": + version: 1.11.6 + resolution: "@webassemblyjs/wasm-parser@npm:1.11.6" + dependencies: + "@webassemblyjs/ast": 1.11.6 + "@webassemblyjs/helper-api-error": 1.11.6 + "@webassemblyjs/helper-wasm-bytecode": 1.11.6 + "@webassemblyjs/ieee754": 1.11.6 + "@webassemblyjs/leb128": 1.11.6 + "@webassemblyjs/utf8": 1.11.6 + checksum: 8200a8d77c15621724a23fdabe58d5571415cda98a7058f542e670ea965dd75499f5e34a48675184947c66f3df23adf55df060312e6d72d57908e3f049620d8a + languageName: node + linkType: hard + +"@webassemblyjs/wast-printer@npm:1.11.6": + version: 1.11.6 + resolution: "@webassemblyjs/wast-printer@npm:1.11.6" + dependencies: + "@webassemblyjs/ast": 1.11.6 + "@xtuc/long": 4.2.2 + checksum: d2fa6a4c427325ec81463e9c809aa6572af6d47f619f3091bf4c4a6fc34f1da3df7caddaac50b8e7a457f8784c62cd58c6311b6cb69b0162ccd8d4c072f79cf8 + languageName: node + linkType: hard + +"@webpack-cli/configtest@npm:^2.1.1": + version: 2.1.1 + resolution: "@webpack-cli/configtest@npm:2.1.1" + peerDependencies: + webpack: 5.x.x + webpack-cli: 5.x.x + checksum: 9f9f9145c2d05471fc83d426db1df85cf49f329836b0c4b9f46b6948bed4b013464c00622b136d2a0a26993ce2306976682592245b08ee717500b1db45009a72 + languageName: node + linkType: hard + +"@webpack-cli/info@npm:^2.0.2": + version: 2.0.2 + resolution: "@webpack-cli/info@npm:2.0.2" + peerDependencies: + webpack: 5.x.x + webpack-cli: 5.x.x + checksum: 8f9a178afca5c82e113aed1efa552d64ee5ae4fdff63fe747c096a981ec74f18a5d07bd6e89bbe6715c3e57d96eea024a410e58977169489fe1df044c10dd94e + languageName: node + linkType: hard + +"@webpack-cli/serve@npm:^2.0.5": + version: 2.0.5 + resolution: "@webpack-cli/serve@npm:2.0.5" + peerDependencies: + webpack: 5.x.x + webpack-cli: 5.x.x + peerDependenciesMeta: + webpack-dev-server: + optional: true + checksum: 75f0e54681796d567a71ac3e2781d2901a8d8cf1cdfc82f261034dddac59a8343e8c3bc5e32b4bb9d6766759ba49fb29a5cd86ef1701d79c506fe886bb63ac75 + languageName: node + linkType: hard + +"@xtuc/ieee754@npm:^1.2.0": + version: 1.2.0 + resolution: "@xtuc/ieee754@npm:1.2.0" + checksum: ac56d4ca6e17790f1b1677f978c0c6808b1900a5b138885d3da21732f62e30e8f0d9120fcf8f6edfff5100ca902b46f8dd7c1e3f903728634523981e80e2885a + languageName: node + linkType: hard + +"@xtuc/long@npm:4.2.2": + version: 4.2.2 + resolution: "@xtuc/long@npm:4.2.2" + checksum: 8ed0d477ce3bc9c6fe2bf6a6a2cc316bb9c4127c5a7827bae947fa8ec34c7092395c5a283cc300c05b5fa01cbbfa1f938f410a7bf75db7c7846fea41949989ec + languageName: node + linkType: hard + +"abbrev@npm:^1.0.0": + version: 1.1.1 + resolution: "abbrev@npm:1.1.1" + checksum: a4a97ec07d7ea112c517036882b2ac22f3109b7b19077dc656316d07d308438aac28e4d9746dc4d84bf6b1e75b4a7b0a5f3cb30592419f128ca9a8cee3bcfa17 + languageName: node + linkType: hard + +"acorn-import-assertions@npm:^1.9.0": + version: 1.9.0 + resolution: "acorn-import-assertions@npm:1.9.0" + peerDependencies: + acorn: ^8 + checksum: 944fb2659d0845c467066bdcda2e20c05abe3aaf11972116df457ce2627628a81764d800dd55031ba19de513ee0d43bb771bc679cc0eda66dc8b4fade143bc0c + languageName: node + linkType: hard + +"acorn-jsx@npm:^5.3.2": + version: 5.3.2 + resolution: "acorn-jsx@npm:5.3.2" + peerDependencies: + acorn: ^6.0.0 || ^7.0.0 || ^8.0.0 + checksum: c3d3b2a89c9a056b205b69530a37b972b404ee46ec8e5b341666f9513d3163e2a4f214a71f4dfc7370f5a9c07472d2fd1c11c91c3f03d093e37637d95da98950 + languageName: node + linkType: hard + +"acorn@npm:^8.7.1, acorn@npm:^8.8.2, acorn@npm:^8.9.0": + version: 8.10.0 + resolution: "acorn@npm:8.10.0" + bin: + acorn: bin/acorn + checksum: 538ba38af0cc9e5ef983aee196c4b8b4d87c0c94532334fa7e065b2c8a1f85863467bb774231aae91613fcda5e68740c15d97b1967ae3394d20faddddd8af61d + languageName: node + linkType: hard + +"agent-base@npm:6, agent-base@npm:^6.0.2": + version: 6.0.2 + resolution: "agent-base@npm:6.0.2" + dependencies: + debug: 4 + checksum: f52b6872cc96fd5f622071b71ef200e01c7c4c454ee68bc9accca90c98cfb39f2810e3e9aa330435835eedc8c23f4f8a15267f67c6e245d2b33757575bdac49d + languageName: node + linkType: hard + +"agentkeepalive@npm:^4.2.1": + version: 4.5.0 + resolution: "agentkeepalive@npm:4.5.0" + dependencies: + humanize-ms: ^1.2.1 + checksum: 13278cd5b125e51eddd5079f04d6fe0914ac1b8b91c1f3db2c1822f99ac1a7457869068997784342fe455d59daaff22e14fb7b8c3da4e741896e7e31faf92481 + languageName: node + linkType: hard + +"aggregate-error@npm:^3.0.0": + version: 3.1.0 + resolution: "aggregate-error@npm:3.1.0" + dependencies: + clean-stack: ^2.0.0 + indent-string: ^4.0.0 + checksum: 1101a33f21baa27a2fa8e04b698271e64616b886795fd43c31068c07533c7b3facfcaf4e9e0cab3624bd88f729a592f1c901a1a229c9e490eafce411a8644b79 + languageName: node + linkType: hard + +"ajv-keywords@npm:^3.5.2": + version: 3.5.2 + resolution: "ajv-keywords@npm:3.5.2" + peerDependencies: + ajv: ^6.9.1 + checksum: 7dc5e5931677a680589050f79dcbe1fefbb8fea38a955af03724229139175b433c63c68f7ae5f86cf8f65d55eb7c25f75a046723e2e58296707617ca690feae9 + languageName: node + linkType: hard + +"ajv@npm:^6.12.4, ajv@npm:^6.12.5": + version: 6.12.6 + resolution: "ajv@npm:6.12.6" + dependencies: + fast-deep-equal: ^3.1.1 + fast-json-stable-stringify: ^2.0.0 + json-schema-traverse: ^0.4.1 + uri-js: ^4.2.2 + checksum: 874972efe5c4202ab0a68379481fbd3d1b5d0a7bd6d3cc21d40d3536ebff3352a2a1fabb632d4fd2cc7fe4cbdcd5ed6782084c9bbf7f32a1536d18f9da5007d4 + languageName: node + linkType: hard + +"ansi-colors@npm:4.1.1": + version: 4.1.1 + resolution: "ansi-colors@npm:4.1.1" + checksum: 138d04a51076cb085da0a7e2d000c5c0bb09f6e772ed5c65c53cb118d37f6c5f1637506d7155fb5f330f0abcf6f12fa2e489ac3f8cdab9da393bf1bb4f9a32b0 + languageName: node + linkType: hard + +"ansi-regex@npm:^5.0.1": + version: 5.0.1 + resolution: "ansi-regex@npm:5.0.1" + checksum: 2aa4bb54caf2d622f1afdad09441695af2a83aa3fe8b8afa581d205e57ed4261c183c4d3877cee25794443fde5876417d859c108078ab788d6af7e4fe52eb66b + languageName: node + linkType: hard + +"ansi-regex@npm:^6.0.1": + version: 6.0.1 + resolution: "ansi-regex@npm:6.0.1" + checksum: 1ff8b7667cded1de4fa2c9ae283e979fc87036864317da86a2e546725f96406746411d0d85e87a2d12fa5abd715d90006de7fa4fa0477c92321ad3b4c7d4e169 + languageName: node + linkType: hard + +"ansi-styles@npm:^4.0.0, ansi-styles@npm:^4.1.0": + version: 4.3.0 + resolution: "ansi-styles@npm:4.3.0" + dependencies: + color-convert: ^2.0.1 + checksum: 513b44c3b2105dd14cc42a19271e80f386466c4be574bccf60b627432f9198571ebf4ab1e4c3ba17347658f4ee1711c163d574248c0c1cdc2d5917a0ad582ec4 + languageName: node + linkType: hard + +"ansi-styles@npm:^6.1.0": + version: 6.2.1 + resolution: "ansi-styles@npm:6.2.1" + checksum: ef940f2f0ced1a6347398da88a91da7930c33ecac3c77b72c5905f8b8fe402c52e6fde304ff5347f616e27a742da3f1dc76de98f6866c69251ad0b07a66776d9 + languageName: node + linkType: hard + +"anymatch@npm:~3.1.2": version: 3.1.3 - resolution: "fast-deep-equal@npm:3.1.3" - checksum: e21a9d8d84f53493b6aa15efc9cfd53dd5b714a1f23f67fb5dc8f574af80df889b3bce25dc081887c6d25457cce704e636395333abad896ccdec03abaf1f3f9d + resolution: "anymatch@npm:3.1.3" + dependencies: + normalize-path: ^3.0.0 + picomatch: ^2.0.4 + checksum: 3e044fd6d1d26545f235a9fe4d7a534e2029d8e59fa7fd9f2a6eb21230f6b5380ea1eaf55136e60cbf8e613544b3b766e7a6fa2102e2a3a117505466e3025dc2 + languageName: node + linkType: hard + +"aproba@npm:^1.0.3 || ^2.0.0": + version: 2.0.0 + resolution: "aproba@npm:2.0.0" + checksum: 5615cadcfb45289eea63f8afd064ab656006361020e1735112e346593856f87435e02d8dcc7ff0d11928bc7d425f27bc7c2a84f6c0b35ab0ff659c814c138a24 + languageName: node + linkType: hard + +"are-we-there-yet@npm:^3.0.0": + version: 3.0.1 + resolution: "are-we-there-yet@npm:3.0.1" + dependencies: + delegates: ^1.0.0 + readable-stream: ^3.6.0 + checksum: 52590c24860fa7173bedeb69a4c05fb573473e860197f618b9a28432ee4379049336727ae3a1f9c4cb083114601c1140cee578376164d0e651217a9843f9fe83 + languageName: node + linkType: hard + +"argparse@npm:^2.0.1": + version: 2.0.1 + resolution: "argparse@npm:2.0.1" + checksum: 83644b56493e89a254bae05702abf3a1101b4fa4d0ca31df1c9985275a5a5bd47b3c27b7fa0b71098d41114d8ca000e6ed90cad764b306f8a503665e4d517ced + languageName: node + linkType: hard + +"array-union@npm:^2.1.0": + version: 2.1.0 + resolution: "array-union@npm:2.1.0" + checksum: 5bee12395cba82da674931df6d0fea23c4aa4660cb3b338ced9f828782a65caa232573e6bf3968f23e0c5eb301764a382cef2f128b170a9dc59de0e36c39f98d + languageName: node + linkType: hard + +"balanced-match@npm:^1.0.0": + version: 1.0.2 + resolution: "balanced-match@npm:1.0.2" + checksum: 9706c088a283058a8a99e0bf91b0a2f75497f185980d9ffa8b304de1d9e58ebda7c72c07ebf01dadedaac5b2907b2c6f566f660d62bd336c3468e960403b9d65 + languageName: node + linkType: hard + +"binary-extensions@npm:^2.0.0": + version: 2.2.0 + resolution: "binary-extensions@npm:2.2.0" + checksum: ccd267956c58d2315f5d3ea6757cf09863c5fc703e50fbeb13a7dc849b812ef76e3cf9ca8f35a0c48498776a7478d7b4a0418e1e2b8cb9cb9731f2922aaad7f8 + languageName: node + linkType: hard + +"brace-expansion@npm:^1.1.7": + version: 1.1.11 + resolution: "brace-expansion@npm:1.1.11" + dependencies: + balanced-match: ^1.0.0 + concat-map: 0.0.1 + checksum: faf34a7bb0c3fcf4b59c7808bc5d2a96a40988addf2e7e09dfbb67a2251800e0d14cd2bfc1aa79174f2f5095c54ff27f46fb1289fe2d77dac755b5eb3434cc07 + languageName: node + linkType: hard + +"brace-expansion@npm:^2.0.1": + version: 2.0.1 + resolution: "brace-expansion@npm:2.0.1" + dependencies: + balanced-match: ^1.0.0 + checksum: a61e7cd2e8a8505e9f0036b3b6108ba5e926b4b55089eeb5550cd04a471fe216c96d4fe7e4c7f995c728c554ae20ddfc4244cad10aef255e72b62930afd233d1 + languageName: node + linkType: hard + +"braces@npm:^3.0.2, braces@npm:~3.0.2": + version: 3.0.2 + resolution: "braces@npm:3.0.2" + dependencies: + fill-range: ^7.0.1 + checksum: e2a8e769a863f3d4ee887b5fe21f63193a891c68b612ddb4b68d82d1b5f3ff9073af066c343e9867a393fe4c2555dcb33e89b937195feb9c1613d259edfcd459 + languageName: node + linkType: hard + +"browser-stdout@npm:1.3.1": + version: 1.3.1 + resolution: "browser-stdout@npm:1.3.1" + checksum: b717b19b25952dd6af483e368f9bcd6b14b87740c3d226c2977a65e84666ffd67000bddea7d911f111a9b6ddc822b234de42d52ab6507bce4119a4cc003ef7b3 + languageName: node + linkType: hard + +"browserslist@npm:^4.14.5": + version: 4.21.10 + resolution: "browserslist@npm:4.21.10" + dependencies: + caniuse-lite: ^1.0.30001517 + electron-to-chromium: ^1.4.477 + node-releases: ^2.0.13 + update-browserslist-db: ^1.0.11 + bin: + browserslist: cli.js + checksum: 1e27c0f111a35d1dd0e8fc2c61781b0daefabc2c9471b0b10537ce54843014bceb2a1ce4571af1a82b2bf1e6e6e05d38865916689a158f03bc2c7a4ec2577db8 + languageName: node + linkType: hard + +"buffer-from@npm:^1.0.0": + version: 1.1.2 + resolution: "buffer-from@npm:1.1.2" + checksum: 0448524a562b37d4d7ed9efd91685a5b77a50672c556ea254ac9a6d30e3403a517d8981f10e565db24e8339413b43c97ca2951f10e399c6125a0d8911f5679bb + languageName: node + linkType: hard + +"cacache@npm:^17.0.0": + version: 17.1.4 + resolution: "cacache@npm:17.1.4" + dependencies: + "@npmcli/fs": ^3.1.0 + fs-minipass: ^3.0.0 + glob: ^10.2.2 + lru-cache: ^7.7.1 + minipass: ^7.0.3 + minipass-collect: ^1.0.2 + minipass-flush: ^1.0.5 + minipass-pipeline: ^1.2.4 + p-map: ^4.0.0 + ssri: ^10.0.0 + tar: ^6.1.11 + unique-filename: ^3.0.0 + checksum: b7751df756656954a51201335addced8f63fc53266fa56392c9f5ae83c8d27debffb4458ac2d168a744a4517ec3f2163af05c20097f93d17bdc2dc8a385e14a6 + languageName: node + linkType: hard + +"callsites@npm:^3.0.0": + version: 3.1.0 + resolution: "callsites@npm:3.1.0" + checksum: 072d17b6abb459c2ba96598918b55868af677154bec7e73d222ef95a8fdb9bbf7dae96a8421085cdad8cd190d86653b5b6dc55a4484f2e5b2e27d5e0c3fc15b3 + languageName: node + linkType: hard + +"camelcase@npm:^6.0.0": + version: 6.3.0 + resolution: "camelcase@npm:6.3.0" + checksum: 8c96818a9076434998511251dcb2761a94817ea17dbdc37f47ac080bd088fc62c7369429a19e2178b993497132c8cbcf5cc1f44ba963e76782ba469c0474938d + languageName: node + linkType: hard + +"caniuse-lite@npm:^1.0.30001517": + version: 1.0.30001532 + resolution: "caniuse-lite@npm:1.0.30001532" + checksum: 613abeb15e03dde307d543195a7860f7ba7450c9c9262d45642b2c8fbe097914fa060d68c8647f9d443947b1f62b09d891858bde7d2cac94fae8133a0b518b28 + languageName: node + linkType: hard + +"chalk@npm:^4.0.0, chalk@npm:^4.1.0": + version: 4.1.2 + resolution: "chalk@npm:4.1.2" + dependencies: + ansi-styles: ^4.1.0 + supports-color: ^7.1.0 + checksum: fe75c9d5c76a7a98d45495b91b2172fa3b7a09e0cc9370e5c8feb1c567b85c4288e2b3fded7cfdd7359ac28d6b3844feb8b82b8686842e93d23c827c417e83fc + languageName: node + linkType: hard + +"chokidar@npm:3.5.3": + version: 3.5.3 + resolution: "chokidar@npm:3.5.3" + dependencies: + anymatch: ~3.1.2 + braces: ~3.0.2 + fsevents: ~2.3.2 + glob-parent: ~5.1.2 + is-binary-path: ~2.1.0 + is-glob: ~4.0.1 + normalize-path: ~3.0.0 + readdirp: ~3.6.0 + dependenciesMeta: + fsevents: + optional: true + checksum: b49fcde40176ba007ff361b198a2d35df60d9bb2a5aab228279eb810feae9294a6b4649ab15981304447afe1e6ffbf4788ad5db77235dc770ab777c6e771980c + languageName: node + linkType: hard + +"chownr@npm:^2.0.0": + version: 2.0.0 + resolution: "chownr@npm:2.0.0" + checksum: c57cf9dd0791e2f18a5ee9c1a299ae6e801ff58fee96dc8bfd0dcb4738a6ce58dd252a3605b1c93c6418fe4f9d5093b28ffbf4d66648cb2a9c67eaef9679be2f + languageName: node + linkType: hard + +"chrome-trace-event@npm:^1.0.2": + version: 1.0.3 + resolution: "chrome-trace-event@npm:1.0.3" + checksum: cb8b1fc7e881aaef973bd0c4a43cd353c2ad8323fb471a041e64f7c2dd849cde4aad15f8b753331a32dda45c973f032c8a03b8177fc85d60eaa75e91e08bfb97 + languageName: node + linkType: hard + +"clean-stack@npm:^2.0.0": + version: 2.2.0 + resolution: "clean-stack@npm:2.2.0" + checksum: 2ac8cd2b2f5ec986a3c743935ec85b07bc174d5421a5efc8017e1f146a1cf5f781ae962618f416352103b32c9cd7e203276e8c28241bbe946160cab16149fb68 + languageName: node + linkType: hard + +"cliui@npm:^7.0.2": + version: 7.0.4 + resolution: "cliui@npm:7.0.4" + dependencies: + string-width: ^4.2.0 + strip-ansi: ^6.0.0 + wrap-ansi: ^7.0.0 + checksum: ce2e8f578a4813806788ac399b9e866297740eecd4ad1823c27fd344d78b22c5f8597d548adbcc46f0573e43e21e751f39446c5a5e804a12aace402b7a315d7f + languageName: node + linkType: hard + +"clone-deep@npm:^4.0.1": + version: 4.0.1 + resolution: "clone-deep@npm:4.0.1" + dependencies: + is-plain-object: ^2.0.4 + kind-of: ^6.0.2 + shallow-clone: ^3.0.0 + checksum: 770f912fe4e6f21873c8e8fbb1e99134db3b93da32df271d00589ea4a29dbe83a9808a322c93f3bcaf8584b8b4fa6fc269fc8032efbaa6728e0c9886c74467d2 + languageName: node + linkType: hard + +"color-convert@npm:^2.0.1": + version: 2.0.1 + resolution: "color-convert@npm:2.0.1" + dependencies: + color-name: ~1.1.4 + checksum: 79e6bdb9fd479a205c71d89574fccfb22bd9053bd98c6c4d870d65c132e5e904e6034978e55b43d69fcaa7433af2016ee203ce76eeba9cfa554b373e7f7db336 + languageName: node + linkType: hard + +"color-name@npm:~1.1.4": + version: 1.1.4 + resolution: "color-name@npm:1.1.4" + checksum: b0445859521eb4021cd0fb0cc1a75cecf67fceecae89b63f62b201cca8d345baf8b952c966862a9d9a2632987d4f6581f0ec8d957dfacece86f0a7919316f610 + languageName: node + linkType: hard + +"color-support@npm:^1.1.3": + version: 1.1.3 + resolution: "color-support@npm:1.1.3" + bin: + color-support: bin.js + checksum: 9b7356817670b9a13a26ca5af1c21615463b500783b739b7634a0c2047c16cef4b2865d7576875c31c3cddf9dd621fa19285e628f20198b233a5cfdda6d0793b + languageName: node + linkType: hard + +"colorette@npm:^2.0.14": + version: 2.0.20 + resolution: "colorette@npm:2.0.20" + checksum: 0c016fea2b91b733eb9f4bcdb580018f52c0bc0979443dad930e5037a968237ac53d9beb98e218d2e9235834f8eebce7f8e080422d6194e957454255bde71d3d + languageName: node + linkType: hard + +"commander@npm:^10.0.1": + version: 10.0.1 + resolution: "commander@npm:10.0.1" + checksum: 436901d64a818295803c1996cd856621a74f30b9f9e28a588e726b2b1670665bccd7c1a77007ebf328729f0139838a88a19265858a0fa7a8728c4656796db948 + languageName: node + linkType: hard + +"commander@npm:^2.20.0": + version: 2.20.3 + resolution: "commander@npm:2.20.3" + checksum: ab8c07884e42c3a8dbc5dd9592c606176c7eb5c1ca5ff274bcf907039b2c41de3626f684ea75ccf4d361ba004bbaff1f577d5384c155f3871e456bdf27becf9e + languageName: node + linkType: hard + +"concat-map@npm:0.0.1": + version: 0.0.1 + resolution: "concat-map@npm:0.0.1" + checksum: 902a9f5d8967a3e2faf138d5cb784b9979bad2e6db5357c5b21c568df4ebe62bcb15108af1b2253744844eb964fc023fbd9afbbbb6ddd0bcc204c6fb5b7bf3af + languageName: node + linkType: hard + +"console-control-strings@npm:^1.1.0": + version: 1.1.0 + resolution: "console-control-strings@npm:1.1.0" + checksum: 8755d76787f94e6cf79ce4666f0c5519906d7f5b02d4b884cf41e11dcd759ed69c57da0670afd9236d229a46e0f9cf519db0cd829c6dca820bb5a5c3def584ed + languageName: node + linkType: hard + +"core-util-is@npm:~1.0.0": + version: 1.0.3 + resolution: "core-util-is@npm:1.0.3" + checksum: 9de8597363a8e9b9952491ebe18167e3b36e7707569eed0ebf14f8bba773611376466ae34575bca8cfe3c767890c859c74056084738f09d4e4a6f902b2ad7d99 + languageName: node + linkType: hard + +"cross-spawn@npm:^7.0.0, cross-spawn@npm:^7.0.2, cross-spawn@npm:^7.0.3": + version: 7.0.3 + resolution: "cross-spawn@npm:7.0.3" + dependencies: + path-key: ^3.1.0 + shebang-command: ^2.0.0 + which: ^2.0.1 + checksum: 671cc7c7288c3a8406f3c69a3ae2fc85555c04169e9d611def9a675635472614f1c0ed0ef80955d5b6d4e724f6ced67f0ad1bb006c2ea643488fcfef994d7f52 + languageName: node + linkType: hard + +"debug@npm:4, debug@npm:4.3.4, debug@npm:^4.1.1, debug@npm:^4.3.2, debug@npm:^4.3.3, debug@npm:^4.3.4": + version: 4.3.4 + resolution: "debug@npm:4.3.4" + dependencies: + ms: 2.1.2 + peerDependenciesMeta: + supports-color: + optional: true + checksum: 3dbad3f94ea64f34431a9cbf0bafb61853eda57bff2880036153438f50fb5a84f27683ba0d8e5426bf41a8c6ff03879488120cf5b3a761e77953169c0600a708 + languageName: node + linkType: hard + +"decamelize@npm:^4.0.0": + version: 4.0.0 + resolution: "decamelize@npm:4.0.0" + checksum: b7d09b82652c39eead4d6678bb578e3bebd848add894b76d0f6b395bc45b2d692fb88d977e7cfb93c4ed6c119b05a1347cef261174916c2e75c0a8ca57da1809 + languageName: node + linkType: hard + +"deep-is@npm:^0.1.3": + version: 0.1.4 + resolution: "deep-is@npm:0.1.4" + checksum: edb65dd0d7d1b9c40b2f50219aef30e116cedd6fc79290e740972c132c09106d2e80aa0bc8826673dd5a00222d4179c84b36a790eef63a4c4bca75a37ef90804 + languageName: node + linkType: hard + +"delegates@npm:^1.0.0": + version: 1.0.0 + resolution: "delegates@npm:1.0.0" + checksum: a51744d9b53c164ba9c0492471a1a2ffa0b6727451bdc89e31627fdf4adda9d51277cfcbfb20f0a6f08ccb3c436f341df3e92631a3440226d93a8971724771fd + languageName: node + linkType: hard + +"diff@npm:5.0.0": + version: 5.0.0 + resolution: "diff@npm:5.0.0" + checksum: f19fe29284b633afdb2725c2a8bb7d25761ea54d321d8e67987ac851c5294be4afeab532bd84531e02583a3fe7f4014aa314a3eda84f5590e7a9e6b371ef3b46 + languageName: node + linkType: hard + +"dir-glob@npm:^3.0.1": + version: 3.0.1 + resolution: "dir-glob@npm:3.0.1" + dependencies: + path-type: ^4.0.0 + checksum: fa05e18324510d7283f55862f3161c6759a3f2f8dbce491a2fc14c8324c498286c54282c1f0e933cb930da8419b30679389499b919122952a4f8592362ef4615 + languageName: node + linkType: hard + +"doctrine@npm:^3.0.0": + version: 3.0.0 + resolution: "doctrine@npm:3.0.0" + dependencies: + esutils: ^2.0.2 + checksum: fd7673ca77fe26cd5cba38d816bc72d641f500f1f9b25b83e8ce28827fe2da7ad583a8da26ab6af85f834138cf8dae9f69b0cd6ab925f52ddab1754db44d99ce + languageName: node + linkType: hard + +"eastasianwidth@npm:^0.2.0": + version: 0.2.0 + resolution: "eastasianwidth@npm:0.2.0" + checksum: 7d00d7cd8e49b9afa762a813faac332dee781932d6f2c848dc348939c4253f1d4564341b7af1d041853bc3f32c2ef141b58e0a4d9862c17a7f08f68df1e0f1ed + languageName: node + linkType: hard + +"electron-to-chromium@npm:^1.4.477": + version: 1.4.513 + resolution: "electron-to-chromium@npm:1.4.513" + checksum: 613b66da177dcf5abca2441c502cde4b4fb247665dc049c54d1fe3b79fc3a5a3ecae92faf97d3147af0fec9c50bf90db09e8ca3f0953a5ec2fdb472d6d6253c2 + languageName: node + linkType: hard + +"emoji-regex@npm:^8.0.0": + version: 8.0.0 + resolution: "emoji-regex@npm:8.0.0" + checksum: d4c5c39d5a9868b5fa152f00cada8a936868fd3367f33f71be515ecee4c803132d11b31a6222b2571b1e5f7e13890156a94880345594d0ce7e3c9895f560f192 + languageName: node + linkType: hard + +"emoji-regex@npm:^9.2.2": + version: 9.2.2 + resolution: "emoji-regex@npm:9.2.2" + checksum: 8487182da74aabd810ac6d6f1994111dfc0e331b01271ae01ec1eb0ad7b5ecc2bbbbd2f053c05cb55a1ac30449527d819bbfbf0e3de1023db308cbcb47f86601 + languageName: node + linkType: hard + +"encoding@npm:^0.1.13": + version: 0.1.13 + resolution: "encoding@npm:0.1.13" + dependencies: + iconv-lite: ^0.6.2 + checksum: bb98632f8ffa823996e508ce6a58ffcf5856330fde839ae42c9e1f436cc3b5cc651d4aeae72222916545428e54fd0f6aa8862fd8d25bdbcc4589f1e3f3715e7f + languageName: node + linkType: hard + +"enhanced-resolve@npm:^5.0.0, enhanced-resolve@npm:^5.15.0": + version: 5.15.0 + resolution: "enhanced-resolve@npm:5.15.0" + dependencies: + graceful-fs: ^4.2.4 + tapable: ^2.2.0 + checksum: fbd8cdc9263be71cc737aa8a7d6c57b43d6aa38f6cc75dde6fcd3598a130cc465f979d2f4d01bb3bf475acb43817749c79f8eef9be048683602ca91ab52e4f11 + languageName: node + linkType: hard + +"env-paths@npm:^2.2.0": + version: 2.2.1 + resolution: "env-paths@npm:2.2.1" + checksum: 65b5df55a8bab92229ab2b40dad3b387fad24613263d103a97f91c9fe43ceb21965cd3392b1ccb5d77088021e525c4e0481adb309625d0cb94ade1d1fb8dc17e + languageName: node + linkType: hard + +"envinfo@npm:^7.7.3": + version: 7.10.0 + resolution: "envinfo@npm:7.10.0" + bin: + envinfo: dist/cli.js + checksum: 05e81a5768c42cbd5c580dc3f274db3401facadd53e9bd52e2aa49dfbb5d8b26f6181c25a6652d79618a6994185bd2b1c137673101690b147f758e4e71d42f7d + languageName: node + linkType: hard + +"err-code@npm:^2.0.2": + version: 2.0.3 + resolution: "err-code@npm:2.0.3" + checksum: 8b7b1be20d2de12d2255c0bc2ca638b7af5171142693299416e6a9339bd7d88fc8d7707d913d78e0993176005405a236b066b45666b27b797252c771156ace54 + languageName: node + linkType: hard + +"es-module-lexer@npm:^1.2.1": + version: 1.3.0 + resolution: "es-module-lexer@npm:1.3.0" + checksum: 48fd9f504a9d2a894126f75c8b7ccc6273a289983e9b67255f165bfd9ae765d50100218251e94e702ca567826905ea2f7b3b4a0c4d74d3ce99cce3a2a606a238 + languageName: node + linkType: hard + +"escalade@npm:^3.1.1": + version: 3.1.1 + resolution: "escalade@npm:3.1.1" + checksum: a3e2a99f07acb74b3ad4989c48ca0c3140f69f923e56d0cba0526240ee470b91010f9d39001f2a4a313841d237ede70a729e92125191ba5d21e74b106800b133 + languageName: node + linkType: hard + +"escape-string-regexp@npm:4.0.0, escape-string-regexp@npm:^4.0.0": + version: 4.0.0 + resolution: "escape-string-regexp@npm:4.0.0" + checksum: 98b48897d93060f2322108bf29db0feba7dd774be96cd069458d1453347b25ce8682ecc39859d4bca2203cc0ab19c237bcc71755eff49a0f8d90beadeeba5cc5 + languageName: node + linkType: hard + +"eslint-scope@npm:5.1.1, eslint-scope@npm:^5.1.1": + version: 5.1.1 + resolution: "eslint-scope@npm:5.1.1" + dependencies: + esrecurse: ^4.3.0 + estraverse: ^4.1.1 + checksum: 47e4b6a3f0cc29c7feedee6c67b225a2da7e155802c6ea13bbef4ac6b9e10c66cd2dcb987867ef176292bf4e64eccc680a49e35e9e9c669f4a02bac17e86abdb + languageName: node + linkType: hard + +"eslint-scope@npm:^7.2.2": + version: 7.2.2 + resolution: "eslint-scope@npm:7.2.2" + dependencies: + esrecurse: ^4.3.0 + estraverse: ^5.2.0 + checksum: ec97dbf5fb04b94e8f4c5a91a7f0a6dd3c55e46bfc7bbcd0e3138c3a76977570e02ed89a1810c778dcd72072ff0e9621ba1379b4babe53921d71e2e4486fda3e + languageName: node + linkType: hard + +"eslint-visitor-keys@npm:^3.3.0, eslint-visitor-keys@npm:^3.4.1, eslint-visitor-keys@npm:^3.4.2": + version: 3.4.2 + resolution: "eslint-visitor-keys@npm:3.4.2" + checksum: 9e0e7e4aaea705c097ae37c97410e5f167d4d2193be2edcb1f0760762ede3df01545e4820ae314f42dcec687745f2c6dcaf6d83575c4a2a241eb0c8517d724f2 + languageName: node + linkType: hard + +"eslint-visitor-keys@npm:^3.4.3": + version: 3.4.3 + resolution: "eslint-visitor-keys@npm:3.4.3" + checksum: 36e9ef87fca698b6fd7ca5ca35d7b2b6eeaaf106572e2f7fd31c12d3bfdaccdb587bba6d3621067e5aece31c8c3a348b93922ab8f7b2cbc6aaab5e1d89040c60 + languageName: node + linkType: hard + +"eslint@npm:^8.41.0": + version: 8.49.0 + resolution: "eslint@npm:8.49.0" + dependencies: + "@eslint-community/eslint-utils": ^4.2.0 + "@eslint-community/regexpp": ^4.6.1 + "@eslint/eslintrc": ^2.1.2 + "@eslint/js": 8.49.0 + "@humanwhocodes/config-array": ^0.11.11 + "@humanwhocodes/module-importer": ^1.0.1 + "@nodelib/fs.walk": ^1.2.8 + ajv: ^6.12.4 + chalk: ^4.0.0 + cross-spawn: ^7.0.2 + debug: ^4.3.2 + doctrine: ^3.0.0 + escape-string-regexp: ^4.0.0 + eslint-scope: ^7.2.2 + eslint-visitor-keys: ^3.4.3 + espree: ^9.6.1 + esquery: ^1.4.2 + esutils: ^2.0.2 + fast-deep-equal: ^3.1.3 + file-entry-cache: ^6.0.1 + find-up: ^5.0.0 + glob-parent: ^6.0.2 + globals: ^13.19.0 + graphemer: ^1.4.0 + ignore: ^5.2.0 + imurmurhash: ^0.1.4 + is-glob: ^4.0.0 + is-path-inside: ^3.0.3 + js-yaml: ^4.1.0 + json-stable-stringify-without-jsonify: ^1.0.1 + levn: ^0.4.1 + lodash.merge: ^4.6.2 + minimatch: ^3.1.2 + natural-compare: ^1.4.0 + optionator: ^0.9.3 + strip-ansi: ^6.0.1 + text-table: ^0.2.0 + bin: + eslint: bin/eslint.js + checksum: 4dfe257e1e42da2f9da872b05aaaf99b0f5aa022c1a91eee8f2af1ab72651b596366320c575ccd4e0469f7b4c97aff5bb85ae3323ebd6a293c3faef4028b0d81 + languageName: node + linkType: hard + +"eslint@npm:^8.46.0": + version: 8.46.0 + resolution: "eslint@npm:8.46.0" + dependencies: + "@eslint-community/eslint-utils": ^4.2.0 + "@eslint-community/regexpp": ^4.6.1 + "@eslint/eslintrc": ^2.1.1 + "@eslint/js": ^8.46.0 + "@humanwhocodes/config-array": ^0.11.10 + "@humanwhocodes/module-importer": ^1.0.1 + "@nodelib/fs.walk": ^1.2.8 + ajv: ^6.12.4 + chalk: ^4.0.0 + cross-spawn: ^7.0.2 + debug: ^4.3.2 + doctrine: ^3.0.0 + escape-string-regexp: ^4.0.0 + eslint-scope: ^7.2.2 + eslint-visitor-keys: ^3.4.2 + espree: ^9.6.1 + esquery: ^1.4.2 + esutils: ^2.0.2 + fast-deep-equal: ^3.1.3 + file-entry-cache: ^6.0.1 + find-up: ^5.0.0 + glob-parent: ^6.0.2 + globals: ^13.19.0 + graphemer: ^1.4.0 + ignore: ^5.2.0 + imurmurhash: ^0.1.4 + is-glob: ^4.0.0 + is-path-inside: ^3.0.3 + js-yaml: ^4.1.0 + json-stable-stringify-without-jsonify: ^1.0.1 + levn: ^0.4.1 + lodash.merge: ^4.6.2 + minimatch: ^3.1.2 + natural-compare: ^1.4.0 + optionator: ^0.9.3 + strip-ansi: ^6.0.1 + text-table: ^0.2.0 + bin: + eslint: bin/eslint.js + checksum: 7a7d36b1a3bbc12e08fbb5bc36fd482a7a5a1797e62e762499dd45601b9e45aaa53a129f31ce0b4444551a9639b8b681ad535f379893dd1e3ae37b31dccd82aa + languageName: node + linkType: hard + +"espree@npm:^9.6.0, espree@npm:^9.6.1": + version: 9.6.1 + resolution: "espree@npm:9.6.1" + dependencies: + acorn: ^8.9.0 + acorn-jsx: ^5.3.2 + eslint-visitor-keys: ^3.4.1 + checksum: eb8c149c7a2a77b3f33a5af80c10875c3abd65450f60b8af6db1bfcfa8f101e21c1e56a561c6dc13b848e18148d43469e7cd208506238554fb5395a9ea5a1ab9 + languageName: node + linkType: hard + +"esquery@npm:^1.4.2": + version: 1.5.0 + resolution: "esquery@npm:1.5.0" + dependencies: + estraverse: ^5.1.0 + checksum: aefb0d2596c230118656cd4ec7532d447333a410a48834d80ea648b1e7b5c9bc9ed8b5e33a89cb04e487b60d622f44cf5713bf4abed7c97343edefdc84a35900 + languageName: node + linkType: hard + +"esrecurse@npm:^4.3.0": + version: 4.3.0 + resolution: "esrecurse@npm:4.3.0" + dependencies: + estraverse: ^5.2.0 + checksum: ebc17b1a33c51cef46fdc28b958994b1dc43cd2e86237515cbc3b4e5d2be6a811b2315d0a1a4d9d340b6d2308b15322f5c8291059521cc5f4802f65e7ec32837 + languageName: node + linkType: hard + +"estraverse@npm:^4.1.1": + version: 4.3.0 + resolution: "estraverse@npm:4.3.0" + checksum: a6299491f9940bb246124a8d44b7b7a413a8336f5436f9837aaa9330209bd9ee8af7e91a654a3545aee9c54b3308e78ee360cef1d777d37cfef77d2fa33b5827 + languageName: node + linkType: hard + +"estraverse@npm:^5.1.0, estraverse@npm:^5.2.0": + version: 5.3.0 + resolution: "estraverse@npm:5.3.0" + checksum: 072780882dc8416ad144f8fe199628d2b3e7bbc9989d9ed43795d2c90309a2047e6bc5979d7e2322a341163d22cfad9e21f4110597fe487519697389497e4e2b + languageName: node + linkType: hard + +"esutils@npm:^2.0.2": + version: 2.0.3 + resolution: "esutils@npm:2.0.3" + checksum: 22b5b08f74737379a840b8ed2036a5fb35826c709ab000683b092d9054e5c2a82c27818f12604bfc2a9a76b90b6834ef081edbc1c7ae30d1627012e067c6ec87 + languageName: node + linkType: hard + +"events@npm:^3.2.0": + version: 3.3.0 + resolution: "events@npm:3.3.0" + checksum: f6f487ad2198aa41d878fa31452f1a3c00958f46e9019286ff4787c84aac329332ab45c9cdc8c445928fc6d7ded294b9e005a7fce9426488518017831b272780 + languageName: node + linkType: hard + +"exponential-backoff@npm:^3.1.1": + version: 3.1.1 + resolution: "exponential-backoff@npm:3.1.1" + checksum: 3d21519a4f8207c99f7457287291316306255a328770d320b401114ec8481986e4e467e854cb9914dd965e0a1ca810a23ccb559c642c88f4c7f55c55778a9b48 + languageName: node + linkType: hard + +"fast-deep-equal@npm:^3.1.1, fast-deep-equal@npm:^3.1.3": + version: 3.1.3 + resolution: "fast-deep-equal@npm:3.1.3" + checksum: e21a9d8d84f53493b6aa15efc9cfd53dd5b714a1f23f67fb5dc8f574af80df889b3bce25dc081887c6d25457cce704e636395333abad896ccdec03abaf1f3f9d + languageName: node + linkType: hard + +"fast-glob@npm:^3.2.9": + version: 3.3.1 + resolution: "fast-glob@npm:3.3.1" + dependencies: + "@nodelib/fs.stat": ^2.0.2 + "@nodelib/fs.walk": ^1.2.3 + glob-parent: ^5.1.2 + merge2: ^1.3.0 + micromatch: ^4.0.4 + checksum: b6f3add6403e02cf3a798bfbb1183d0f6da2afd368f27456010c0bc1f9640aea308243d4cb2c0ab142f618276e65ecb8be1661d7c62a7b4e5ba774b9ce5432e5 + languageName: node + linkType: hard + +"fast-json-stable-stringify@npm:^2.0.0": + version: 2.1.0 + resolution: "fast-json-stable-stringify@npm:2.1.0" + checksum: b191531e36c607977e5b1c47811158733c34ccb3bfde92c44798929e9b4154884378536d26ad90dfecd32e1ffc09c545d23535ad91b3161a27ddbb8ebe0cbecb + languageName: node + linkType: hard + +"fast-levenshtein@npm:^2.0.6": + version: 2.0.6 + resolution: "fast-levenshtein@npm:2.0.6" + checksum: 92cfec0a8dfafd9c7a15fba8f2cc29cd0b62b85f056d99ce448bbcd9f708e18ab2764bda4dd5158364f4145a7c72788538994f0d1787b956ef0d1062b0f7c24c + languageName: node + linkType: hard + +"fastest-levenshtein@npm:^1.0.12": + version: 1.0.16 + resolution: "fastest-levenshtein@npm:1.0.16" + checksum: a78d44285c9e2ae2c25f3ef0f8a73f332c1247b7ea7fb4a191e6bb51aa6ee1ef0dfb3ed113616dcdc7023e18e35a8db41f61c8d88988e877cf510df8edafbc71 + languageName: node + linkType: hard + +"fastq@npm:^1.6.0": + version: 1.15.0 + resolution: "fastq@npm:1.15.0" + dependencies: + reusify: ^1.0.4 + checksum: 0170e6bfcd5d57a70412440b8ef600da6de3b2a6c5966aeaf0a852d542daff506a0ee92d6de7679d1de82e644bce69d7a574a6c93f0b03964b5337eed75ada1a + languageName: node + linkType: hard + +"file-entry-cache@npm:^6.0.1": + version: 6.0.1 + resolution: "file-entry-cache@npm:6.0.1" + dependencies: + flat-cache: ^3.0.4 + checksum: f49701feaa6314c8127c3c2f6173cfefff17612f5ed2daaafc6da13b5c91fd43e3b2a58fd0d63f9f94478a501b167615931e7200e31485e320f74a33885a9c74 + languageName: node + linkType: hard + +"fill-range@npm:^7.0.1": + version: 7.0.1 + resolution: "fill-range@npm:7.0.1" + dependencies: + to-regex-range: ^5.0.1 + checksum: cc283f4e65b504259e64fd969bcf4def4eb08d85565e906b7d36516e87819db52029a76b6363d0f02d0d532f0033c9603b9e2d943d56ee3b0d4f7ad3328ff917 + languageName: node + linkType: hard + +"find-up@npm:5.0.0, find-up@npm:^5.0.0": + version: 5.0.0 + resolution: "find-up@npm:5.0.0" + dependencies: + locate-path: ^6.0.0 + path-exists: ^4.0.0 + checksum: 07955e357348f34660bde7920783204ff5a26ac2cafcaa28bace494027158a97b9f56faaf2d89a6106211a8174db650dd9f503f9c0d526b1202d5554a00b9095 + languageName: node + linkType: hard + +"find-up@npm:^4.0.0": + version: 4.1.0 + resolution: "find-up@npm:4.1.0" + dependencies: + locate-path: ^5.0.0 + path-exists: ^4.0.0 + checksum: 4c172680e8f8c1f78839486e14a43ef82e9decd0e74145f40707cc42e7420506d5ec92d9a11c22bd2c48fb0c384ea05dd30e10dd152fefeec6f2f75282a8b844 + languageName: node + linkType: hard + +"flat-cache@npm:^3.0.4": + version: 3.0.4 + resolution: "flat-cache@npm:3.0.4" + dependencies: + flatted: ^3.1.0 + rimraf: ^3.0.2 + checksum: 4fdd10ecbcbf7d520f9040dd1340eb5dfe951e6f0ecf2252edeec03ee68d989ec8b9a20f4434270e71bcfd57800dc09b3344fca3966b2eb8f613072c7d9a2365 + languageName: node + linkType: hard + +"flat@npm:^5.0.2": + version: 5.0.2 + resolution: "flat@npm:5.0.2" + bin: + flat: cli.js + checksum: 12a1536ac746db74881316a181499a78ef953632ddd28050b7a3a43c62ef5462e3357c8c29d76072bb635f147f7a9a1f0c02efef6b4be28f8db62ceb3d5c7f5d + languageName: node + linkType: hard + +"flatted@npm:^3.1.0": + version: 3.2.7 + resolution: "flatted@npm:3.2.7" + checksum: 427633049d55bdb80201c68f7eb1cbd533e03eac541f97d3aecab8c5526f12a20ccecaeede08b57503e772c769e7f8680b37e8d482d1e5f8d7e2194687f9ea35 + languageName: node + linkType: hard + +"foreground-child@npm:^3.1.0": + version: 3.1.1 + resolution: "foreground-child@npm:3.1.1" + dependencies: + cross-spawn: ^7.0.0 + signal-exit: ^4.0.1 + checksum: 139d270bc82dc9e6f8bc045fe2aae4001dc2472157044fdfad376d0a3457f77857fa883c1c8b21b491c6caade9a926a4bed3d3d2e8d3c9202b151a4cbbd0bcd5 + languageName: node + linkType: hard + +"fs-minipass@npm:^2.0.0": + version: 2.1.0 + resolution: "fs-minipass@npm:2.1.0" + dependencies: + minipass: ^3.0.0 + checksum: 1b8d128dae2ac6cc94230cc5ead341ba3e0efaef82dab46a33d171c044caaa6ca001364178d42069b2809c35a1c3c35079a32107c770e9ffab3901b59af8c8b1 + languageName: node + linkType: hard + +"fs-minipass@npm:^3.0.0": + version: 3.0.3 + resolution: "fs-minipass@npm:3.0.3" + dependencies: + minipass: ^7.0.3 + checksum: 8722a41109130851d979222d3ec88aabaceeaaf8f57b2a8f744ef8bd2d1ce95453b04a61daa0078822bc5cd21e008814f06fe6586f56fef511e71b8d2394d802 + languageName: node + linkType: hard + +"fs.realpath@npm:^1.0.0": + version: 1.0.0 + resolution: "fs.realpath@npm:1.0.0" + checksum: 99ddea01a7e75aa276c250a04eedeffe5662bce66c65c07164ad6264f9de18fb21be9433ead460e54cff20e31721c811f4fb5d70591799df5f85dce6d6746fd0 + languageName: node + linkType: hard + +"fsevents@npm:~2.3.2": + version: 2.3.3 + resolution: "fsevents@npm:2.3.3" + dependencies: + node-gyp: latest + checksum: 11e6ea6fea15e42461fc55b4b0e4a0a3c654faa567f1877dbd353f39156f69def97a69936d1746619d656c4b93de2238bf731f6085a03a50cabf287c9d024317 + conditions: os=darwin + languageName: node + linkType: hard + +"fsevents@patch:fsevents@~2.3.2#~builtin": + version: 2.3.3 + resolution: "fsevents@patch:fsevents@npm%3A2.3.3#~builtin::version=2.3.3&hash=df0bf1" + dependencies: + node-gyp: latest + conditions: os=darwin + languageName: node + linkType: hard + +"function-bind@npm:^1.1.1": + version: 1.1.1 + resolution: "function-bind@npm:1.1.1" + checksum: b32fbaebb3f8ec4969f033073b43f5c8befbb58f1a79e12f1d7490358150359ebd92f49e72ff0144f65f2c48ea2a605bff2d07965f548f6474fd8efd95bf361a + languageName: node + linkType: hard + +"gauge@npm:^4.0.3": + version: 4.0.4 + resolution: "gauge@npm:4.0.4" + dependencies: + aproba: ^1.0.3 || ^2.0.0 + color-support: ^1.1.3 + console-control-strings: ^1.1.0 + has-unicode: ^2.0.1 + signal-exit: ^3.0.7 + string-width: ^4.2.3 + strip-ansi: ^6.0.1 + wide-align: ^1.1.5 + checksum: 788b6bfe52f1dd8e263cda800c26ac0ca2ff6de0b6eee2fe0d9e3abf15e149b651bd27bf5226be10e6e3edb5c4e5d5985a5a1a98137e7a892f75eff76467ad2d + languageName: node + linkType: hard + +"get-caller-file@npm:^2.0.5": + version: 2.0.5 + resolution: "get-caller-file@npm:2.0.5" + checksum: b9769a836d2a98c3ee734a88ba712e62703f1df31b94b784762c433c27a386dd6029ff55c2a920c392e33657d80191edbf18c61487e198844844516f843496b9 + languageName: node + linkType: hard + +"glob-parent@npm:^5.1.2, glob-parent@npm:~5.1.2": + version: 5.1.2 + resolution: "glob-parent@npm:5.1.2" + dependencies: + is-glob: ^4.0.1 + checksum: f4f2bfe2425296e8a47e36864e4f42be38a996db40420fe434565e4480e3322f18eb37589617a98640c5dc8fdec1a387007ee18dbb1f3f5553409c34d17f425e + languageName: node + linkType: hard + +"glob-parent@npm:^6.0.2": + version: 6.0.2 + resolution: "glob-parent@npm:6.0.2" + dependencies: + is-glob: ^4.0.3 + checksum: c13ee97978bef4f55106b71e66428eb1512e71a7466ba49025fc2aec59a5bfb0954d5abd58fc5ee6c9b076eef4e1f6d3375c2e964b88466ca390da4419a786a8 + languageName: node + linkType: hard + +"glob-to-regexp@npm:^0.4.1": + version: 0.4.1 + resolution: "glob-to-regexp@npm:0.4.1" + checksum: e795f4e8f06d2a15e86f76e4d92751cf8bbfcf0157cea5c2f0f35678a8195a750b34096b1256e436f0cebc1883b5ff0888c47348443e69546a5a87f9e1eb1167 + languageName: node + linkType: hard + +"glob@npm:7.2.0": + version: 7.2.0 + resolution: "glob@npm:7.2.0" + dependencies: + fs.realpath: ^1.0.0 + inflight: ^1.0.4 + inherits: 2 + minimatch: ^3.0.4 + once: ^1.3.0 + path-is-absolute: ^1.0.0 + checksum: 78a8ea942331f08ed2e055cb5b9e40fe6f46f579d7fd3d694f3412fe5db23223d29b7fee1575440202e9a7ff9a72ab106a39fee39934c7bedafe5e5f8ae20134 + languageName: node + linkType: hard + +"glob@npm:^10.2.2": + version: 10.3.4 + resolution: "glob@npm:10.3.4" + dependencies: + foreground-child: ^3.1.0 + jackspeak: ^2.0.3 + minimatch: ^9.0.1 + minipass: ^5.0.0 || ^6.0.2 || ^7.0.0 + path-scurry: ^1.10.1 + bin: + glob: dist/cjs/src/bin.js + checksum: 176b97c124414401cb51329a93d2ba112cef8814adbed10348481916b9521b677773eee2691cb6b24d66632d8c8bb8913533f5ac4bfb2d0ef5454a1856082361 + languageName: node + linkType: hard + +"glob@npm:^7.1.3, glob@npm:^7.1.4": + version: 7.2.3 + resolution: "glob@npm:7.2.3" + dependencies: + fs.realpath: ^1.0.0 + inflight: ^1.0.4 + inherits: 2 + minimatch: ^3.1.1 + once: ^1.3.0 + path-is-absolute: ^1.0.0 + checksum: 29452e97b38fa704dabb1d1045350fb2467cf0277e155aa9ff7077e90ad81d1ea9d53d3ee63bd37c05b09a065e90f16aec4a65f5b8de401d1dac40bc5605d133 + languageName: node + linkType: hard + +"glob@npm:^8.1.0": + version: 8.1.0 + resolution: "glob@npm:8.1.0" + dependencies: + fs.realpath: ^1.0.0 + inflight: ^1.0.4 + inherits: 2 + minimatch: ^5.0.1 + once: ^1.3.0 + checksum: 92fbea3221a7d12075f26f0227abac435de868dd0736a17170663783296d0dd8d3d532a5672b4488a439bf5d7fb85cdd07c11185d6cd39184f0385cbdfb86a47 + languageName: node + linkType: hard + +"globals@npm:^13.19.0": + version: 13.20.0 + resolution: "globals@npm:13.20.0" + dependencies: + type-fest: ^0.20.2 + checksum: ad1ecf914bd051325faad281d02ea2c0b1df5d01bd94d368dcc5513340eac41d14b3c61af325768e3c7f8d44576e72780ec0b6f2d366121f8eec6e03c3a3b97a + languageName: node + linkType: hard + +"globby@npm:^11.1.0": + version: 11.1.0 + resolution: "globby@npm:11.1.0" + dependencies: + array-union: ^2.1.0 + dir-glob: ^3.0.1 + fast-glob: ^3.2.9 + ignore: ^5.2.0 + merge2: ^1.4.1 + slash: ^3.0.0 + checksum: b4be8885e0cfa018fc783792942d53926c35c50b3aefd3fdcfb9d22c627639dc26bd2327a40a0b74b074100ce95bb7187bfeae2f236856aa3de183af7a02aea6 + languageName: node + linkType: hard + +"graceful-fs@npm:^4.1.2, graceful-fs@npm:^4.2.4, graceful-fs@npm:^4.2.6, graceful-fs@npm:^4.2.9": + version: 4.2.11 + resolution: "graceful-fs@npm:4.2.11" + checksum: ac85f94da92d8eb6b7f5a8b20ce65e43d66761c55ce85ac96df6865308390da45a8d3f0296dd3a663de65d30ba497bd46c696cc1e248c72b13d6d567138a4fc7 + languageName: node + linkType: hard + +"graphemer@npm:^1.4.0": + version: 1.4.0 + resolution: "graphemer@npm:1.4.0" + checksum: bab8f0be9b568857c7bec9fda95a89f87b783546d02951c40c33f84d05bb7da3fd10f863a9beb901463669b6583173a8c8cc6d6b306ea2b9b9d5d3d943c3a673 + languageName: node + linkType: hard + +"has-flag@npm:^4.0.0": + version: 4.0.0 + resolution: "has-flag@npm:4.0.0" + checksum: 261a1357037ead75e338156b1f9452c016a37dcd3283a972a30d9e4a87441ba372c8b81f818cd0fbcd9c0354b4ae7e18b9e1afa1971164aef6d18c2b6095a8ad + languageName: node + linkType: hard + +"has-unicode@npm:^2.0.1": + version: 2.0.1 + resolution: "has-unicode@npm:2.0.1" + checksum: 1eab07a7436512db0be40a710b29b5dc21fa04880b7f63c9980b706683127e3c1b57cb80ea96d47991bdae2dfe479604f6a1ba410106ee1046a41d1bd0814400 + languageName: node + linkType: hard + +"has@npm:^1.0.3": + version: 1.0.3 + resolution: "has@npm:1.0.3" + dependencies: + function-bind: ^1.1.1 + checksum: b9ad53d53be4af90ce5d1c38331e712522417d017d5ef1ebd0507e07c2fbad8686fffb8e12ddecd4c39ca9b9b47431afbb975b8abf7f3c3b82c98e9aad052792 + languageName: node + linkType: hard + +"he@npm:1.2.0": + version: 1.2.0 + resolution: "he@npm:1.2.0" + bin: + he: bin/he + checksum: 3d4d6babccccd79c5c5a3f929a68af33360d6445587d628087f39a965079d84f18ce9c3d3f917ee1e3978916fc833bb8b29377c3b403f919426f91bc6965e7a7 + languageName: node + linkType: hard + +"http-cache-semantics@npm:^4.1.1": + version: 4.1.1 + resolution: "http-cache-semantics@npm:4.1.1" + checksum: 83ac0bc60b17a3a36f9953e7be55e5c8f41acc61b22583060e8dedc9dd5e3607c823a88d0926f9150e571f90946835c7fe150732801010845c72cd8bbff1a236 + languageName: node + linkType: hard + +"http-proxy-agent@npm:^4.0.1": + version: 4.0.1 + resolution: "http-proxy-agent@npm:4.0.1" + dependencies: + "@tootallnate/once": 1 + agent-base: 6 + debug: 4 + checksum: c6a5da5a1929416b6bbdf77b1aca13888013fe7eb9d59fc292e25d18e041bb154a8dfada58e223fc7b76b9b2d155a87e92e608235201f77d34aa258707963a82 + languageName: node + linkType: hard + +"http-proxy-agent@npm:^5.0.0": + version: 5.0.0 + resolution: "http-proxy-agent@npm:5.0.0" + dependencies: + "@tootallnate/once": 2 + agent-base: 6 + debug: 4 + checksum: e2ee1ff1656a131953839b2a19cd1f3a52d97c25ba87bd2559af6ae87114abf60971e498021f9b73f9fd78aea8876d1fb0d4656aac8a03c6caa9fc175f22b786 + languageName: node + linkType: hard + +"https-proxy-agent@npm:^5.0.0": + version: 5.0.1 + resolution: "https-proxy-agent@npm:5.0.1" + dependencies: + agent-base: 6 + debug: 4 + checksum: 571fccdf38184f05943e12d37d6ce38197becdd69e58d03f43637f7fa1269cf303a7d228aa27e5b27bbd3af8f09fd938e1c91dcfefff2df7ba77c20ed8dfc765 + languageName: node + linkType: hard + +"humanize-ms@npm:^1.2.1": + version: 1.2.1 + resolution: "humanize-ms@npm:1.2.1" + dependencies: + ms: ^2.0.0 + checksum: 9c7a74a2827f9294c009266c82031030eae811ca87b0da3dceb8d6071b9bde22c9f3daef0469c3c533cc67a97d8a167cd9fc0389350e5f415f61a79b171ded16 + languageName: node + linkType: hard + +"husky@npm:^8.0.0": + version: 8.0.3 + resolution: "husky@npm:8.0.3" + bin: + husky: lib/bin.js + checksum: 837bc7e4413e58c1f2946d38fb050f5d7324c6f16b0fd66411ffce5703b294bd21429e8ba58711cd331951ee86ed529c5be4f76805959ff668a337dbfa82a1b0 + languageName: node + linkType: hard + +"iconv-lite@npm:^0.6.2": + version: 0.6.3 + resolution: "iconv-lite@npm:0.6.3" + dependencies: + safer-buffer: ">= 2.1.2 < 3.0.0" + checksum: 3f60d47a5c8fc3313317edfd29a00a692cc87a19cac0159e2ce711d0ebc9019064108323b5e493625e25594f11c6236647d8e256fbe7a58f4a3b33b89e6d30bf + languageName: node + linkType: hard + +"ignore@npm:^5.2.0": + version: 5.2.4 + resolution: "ignore@npm:5.2.4" + checksum: 3d4c309c6006e2621659311783eaea7ebcd41fe4ca1d78c91c473157ad6666a57a2df790fe0d07a12300d9aac2888204d7be8d59f9aaf665b1c7fcdb432517ef + languageName: node + linkType: hard + +"immediate@npm:~3.0.5": + version: 3.0.6 + resolution: "immediate@npm:3.0.6" + checksum: f9b3486477555997657f70318cc8d3416159f208bec4cca3ff3442fd266bc23f50f0c9bd8547e1371a6b5e82b821ec9a7044a4f7b944798b25aa3cc6d5e63e62 + languageName: node + linkType: hard + +"import-fresh@npm:^3.2.1": + version: 3.3.0 + resolution: "import-fresh@npm:3.3.0" + dependencies: + parent-module: ^1.0.0 + resolve-from: ^4.0.0 + checksum: 2cacfad06e652b1edc50be650f7ec3be08c5e5a6f6d12d035c440a42a8cc028e60a5b99ca08a77ab4d6b1346da7d971915828f33cdab730d3d42f08242d09baa + languageName: node + linkType: hard + +"import-local@npm:^3.0.2": + version: 3.1.0 + resolution: "import-local@npm:3.1.0" + dependencies: + pkg-dir: ^4.2.0 + resolve-cwd: ^3.0.0 + bin: + import-local-fixture: fixtures/cli.js + checksum: bfcdb63b5e3c0e245e347f3107564035b128a414c4da1172a20dc67db2504e05ede4ac2eee1252359f78b0bfd7b19ef180aec427c2fce6493ae782d73a04cddd + languageName: node + linkType: hard + +"imurmurhash@npm:^0.1.4": + version: 0.1.4 + resolution: "imurmurhash@npm:0.1.4" + checksum: 7cae75c8cd9a50f57dadd77482359f659eaebac0319dd9368bcd1714f55e65badd6929ca58569da2b6494ef13fdd5598cd700b1eba23f8b79c5f19d195a3ecf7 + languageName: node + linkType: hard + +"indent-string@npm:^4.0.0": + version: 4.0.0 + resolution: "indent-string@npm:4.0.0" + checksum: 824cfb9929d031dabf059bebfe08cf3137365e112019086ed3dcff6a0a7b698cb80cf67ccccde0e25b9e2d7527aa6cc1fed1ac490c752162496caba3e6699612 + languageName: node + linkType: hard + +"inflight@npm:^1.0.4": + version: 1.0.6 + resolution: "inflight@npm:1.0.6" + dependencies: + once: ^1.3.0 + wrappy: 1 + checksum: f4f76aa072ce19fae87ce1ef7d221e709afb59d445e05d47fba710e85470923a75de35bfae47da6de1b18afc3ce83d70facf44cfb0aff89f0a3f45c0a0244dfd + languageName: node + linkType: hard + +"inherits@npm:2, inherits@npm:^2.0.3, inherits@npm:~2.0.3": + version: 2.0.4 + resolution: "inherits@npm:2.0.4" + checksum: 4a48a733847879d6cf6691860a6b1e3f0f4754176e4d71494c41f3475553768b10f84b5ce1d40fbd0e34e6bfbb864ee35858ad4dd2cf31e02fc4a154b724d7f1 + languageName: node + linkType: hard + +"interpret@npm:^3.1.1": + version: 3.1.1 + resolution: "interpret@npm:3.1.1" + checksum: 35cebcf48c7351130437596d9ab8c8fe131ce4038da4561e6d665f25640e0034702a031cf7e3a5cea60ac7ac548bf17465e0571ede126f3d3a6933152171ac82 + languageName: node + linkType: hard + +"ip@npm:^2.0.0": + version: 2.0.0 + resolution: "ip@npm:2.0.0" + checksum: cfcfac6b873b701996d71ec82a7dd27ba92450afdb421e356f44044ed688df04567344c36cbacea7d01b1c39a4c732dc012570ebe9bebfb06f27314bca625349 + languageName: node + linkType: hard + +"is-binary-path@npm:~2.1.0": + version: 2.1.0 + resolution: "is-binary-path@npm:2.1.0" + dependencies: + binary-extensions: ^2.0.0 + checksum: 84192eb88cff70d320426f35ecd63c3d6d495da9d805b19bc65b518984b7c0760280e57dbf119b7e9be6b161784a5a673ab2c6abe83abb5198a432232ad5b35c + languageName: node + linkType: hard + +"is-core-module@npm:^2.13.0": + version: 2.13.0 + resolution: "is-core-module@npm:2.13.0" + dependencies: + has: ^1.0.3 + checksum: 053ab101fb390bfeb2333360fd131387bed54e476b26860dc7f5a700bbf34a0ec4454f7c8c4d43e8a0030957e4b3db6e16d35e1890ea6fb654c833095e040355 + languageName: node + linkType: hard + +"is-extglob@npm:^2.1.1": + version: 2.1.1 + resolution: "is-extglob@npm:2.1.1" + checksum: df033653d06d0eb567461e58a7a8c9f940bd8c22274b94bf7671ab36df5719791aae15eef6d83bbb5e23283967f2f984b8914559d4449efda578c775c4be6f85 + languageName: node + linkType: hard + +"is-fullwidth-code-point@npm:^3.0.0": + version: 3.0.0 + resolution: "is-fullwidth-code-point@npm:3.0.0" + checksum: 44a30c29457c7fb8f00297bce733f0a64cd22eca270f83e58c105e0d015e45c019491a4ab2faef91ab51d4738c670daff901c799f6a700e27f7314029e99e348 + languageName: node + linkType: hard + +"is-glob@npm:^4.0.0, is-glob@npm:^4.0.1, is-glob@npm:^4.0.3, is-glob@npm:~4.0.1": + version: 4.0.3 + resolution: "is-glob@npm:4.0.3" + dependencies: + is-extglob: ^2.1.1 + checksum: d381c1319fcb69d341cc6e6c7cd588e17cd94722d9a32dbd60660b993c4fb7d0f19438674e68dfec686d09b7c73139c9166b47597f846af387450224a8101ab4 + languageName: node + linkType: hard + +"is-lambda@npm:^1.0.1": + version: 1.0.1 + resolution: "is-lambda@npm:1.0.1" + checksum: 93a32f01940220532e5948538699ad610d5924ac86093fcee83022252b363eb0cc99ba53ab084a04e4fb62bf7b5731f55496257a4c38adf87af9c4d352c71c35 + languageName: node + linkType: hard + +"is-number@npm:^7.0.0": + version: 7.0.0 + resolution: "is-number@npm:7.0.0" + checksum: 456ac6f8e0f3111ed34668a624e45315201dff921e5ac181f8ec24923b99e9f32ca1a194912dc79d539c97d33dba17dc635202ff0b2cf98326f608323276d27a + languageName: node + linkType: hard + +"is-path-inside@npm:^3.0.3": + version: 3.0.3 + resolution: "is-path-inside@npm:3.0.3" + checksum: abd50f06186a052b349c15e55b182326f1936c89a78bf6c8f2b707412517c097ce04bc49a0ca221787bc44e1049f51f09a2ffb63d22899051988d3a618ba13e9 + languageName: node + linkType: hard + +"is-plain-obj@npm:^2.1.0": + version: 2.1.0 + resolution: "is-plain-obj@npm:2.1.0" + checksum: cec9100678b0a9fe0248a81743041ed990c2d4c99f893d935545cfbc42876cbe86d207f3b895700c690ad2fa520e568c44afc1605044b535a7820c1d40e38daa + languageName: node + linkType: hard + +"is-plain-object@npm:^2.0.4": + version: 2.0.4 + resolution: "is-plain-object@npm:2.0.4" + dependencies: + isobject: ^3.0.1 + checksum: 2a401140cfd86cabe25214956ae2cfee6fbd8186809555cd0e84574f88de7b17abacb2e477a6a658fa54c6083ecbda1e6ae404c7720244cd198903848fca70ca + languageName: node + linkType: hard + +"is-unicode-supported@npm:^0.1.0": + version: 0.1.0 + resolution: "is-unicode-supported@npm:0.1.0" + checksum: a2aab86ee7712f5c2f999180daaba5f361bdad1efadc9610ff5b8ab5495b86e4f627839d085c6530363c6d6d4ecbde340fb8e54bdb83da4ba8e0865ed5513c52 + languageName: node + linkType: hard + +"isarray@npm:~1.0.0": + version: 1.0.0 + resolution: "isarray@npm:1.0.0" + checksum: f032df8e02dce8ec565cf2eb605ea939bdccea528dbcf565cdf92bfa2da9110461159d86a537388ef1acef8815a330642d7885b29010e8f7eac967c9993b65ab + languageName: node + linkType: hard + +"isexe@npm:^2.0.0": + version: 2.0.0 + resolution: "isexe@npm:2.0.0" + checksum: 26bf6c5480dda5161c820c5b5c751ae1e766c587b1f951ea3fcfc973bafb7831ae5b54a31a69bd670220e42e99ec154475025a468eae58ea262f813fdc8d1c62 + languageName: node + linkType: hard + +"isobject@npm:^3.0.1": + version: 3.0.1 + resolution: "isobject@npm:3.0.1" + checksum: db85c4c970ce30693676487cca0e61da2ca34e8d4967c2e1309143ff910c207133a969f9e4ddb2dc6aba670aabce4e0e307146c310350b298e74a31f7d464703 + languageName: node + linkType: hard + +"jackspeak@npm:^2.0.3": + version: 2.3.3 + resolution: "jackspeak@npm:2.3.3" + dependencies: + "@isaacs/cliui": ^8.0.2 + "@pkgjs/parseargs": ^0.11.0 + dependenciesMeta: + "@pkgjs/parseargs": + optional: true + checksum: 4313a7c0cc44c7753c4cb9869935f0b06f4cf96827515f63f58ff46b3d2f6e29aba6b3b5151778397c3f5ae67ef8bfc48871967bd10343c27e90cff198ec7808 + languageName: node + linkType: hard + +"jest-worker@npm:^27.4.5": + version: 27.5.1 + resolution: "jest-worker@npm:27.5.1" + dependencies: + "@types/node": "*" + merge-stream: ^2.0.0 + supports-color: ^8.0.0 + checksum: 98cd68b696781caed61c983a3ee30bf880b5bd021c01d98f47b143d4362b85d0737f8523761e2713d45e18b4f9a2b98af1eaee77afade4111bb65c77d6f7c980 + languageName: node + linkType: hard + +"js-yaml@npm:4.1.0, js-yaml@npm:^4.1.0": + version: 4.1.0 + resolution: "js-yaml@npm:4.1.0" + dependencies: + argparse: ^2.0.1 + bin: + js-yaml: bin/js-yaml.js + checksum: c7830dfd456c3ef2c6e355cc5a92e6700ceafa1d14bba54497b34a99f0376cecbb3e9ac14d3e5849b426d5a5140709a66237a8c991c675431271c4ce5504151a + languageName: node + linkType: hard + +"json-parse-even-better-errors@npm:^2.3.1": + version: 2.3.1 + resolution: "json-parse-even-better-errors@npm:2.3.1" + checksum: 798ed4cf3354a2d9ccd78e86d2169515a0097a5c133337807cdf7f1fc32e1391d207ccfc276518cc1d7d8d4db93288b8a50ba4293d212ad1336e52a8ec0a941f + languageName: node + linkType: hard + +"json-schema-traverse@npm:^0.4.1": + version: 0.4.1 + resolution: "json-schema-traverse@npm:0.4.1" + checksum: 7486074d3ba247769fda17d5181b345c9fb7d12e0da98b22d1d71a5db9698d8b4bd900a3ec1a4ffdd60846fc2556274a5c894d0c48795f14cb03aeae7b55260b + languageName: node + linkType: hard + +"json-stable-stringify-without-jsonify@npm:^1.0.1": + version: 1.0.1 + resolution: "json-stable-stringify-without-jsonify@npm:1.0.1" + checksum: cff44156ddce9c67c44386ad5cddf91925fe06b1d217f2da9c4910d01f358c6e3989c4d5a02683c7a5667f9727ff05831f7aa8ae66c8ff691c556f0884d49215 + languageName: node + linkType: hard + +"jszip@npm:^3.10.1": + version: 3.10.1 + resolution: "jszip@npm:3.10.1" + dependencies: + lie: ~3.3.0 + pako: ~1.0.2 + readable-stream: ~2.3.6 + setimmediate: ^1.0.5 + checksum: abc77bfbe33e691d4d1ac9c74c8851b5761fba6a6986630864f98d876f3fcc2d36817dfc183779f32c00157b5d53a016796677298272a714ae096dfe6b1c8b60 + languageName: node + linkType: hard + +"kind-of@npm:^6.0.2": + version: 6.0.3 + resolution: "kind-of@npm:6.0.3" + checksum: 3ab01e7b1d440b22fe4c31f23d8d38b4d9b91d9f291df683476576493d5dfd2e03848a8b05813dd0c3f0e835bc63f433007ddeceb71f05cb25c45ae1b19c6d3b + languageName: node + linkType: hard + +"levn@npm:^0.4.1": + version: 0.4.1 + resolution: "levn@npm:0.4.1" + dependencies: + prelude-ls: ^1.2.1 + type-check: ~0.4.0 + checksum: 12c5021c859bd0f5248561bf139121f0358285ec545ebf48bb3d346820d5c61a4309535c7f387ed7d84361cf821e124ce346c6b7cef8ee09a67c1473b46d0fc4 + languageName: node + linkType: hard + +"lie@npm:~3.3.0": + version: 3.3.0 + resolution: "lie@npm:3.3.0" + dependencies: + immediate: ~3.0.5 + checksum: 33102302cf19766f97919a6a98d481e01393288b17a6aa1f030a3542031df42736edde8dab29ffdbf90bebeffc48c761eb1d064dc77592ca3ba3556f9fe6d2a8 + languageName: node + linkType: hard + +"loader-runner@npm:^4.2.0": + version: 4.3.0 + resolution: "loader-runner@npm:4.3.0" + checksum: a90e00dee9a16be118ea43fec3192d0b491fe03a32ed48a4132eb61d498f5536a03a1315531c19d284392a8726a4ecad71d82044c28d7f22ef62e029bf761569 + languageName: node + linkType: hard + +"locate-path@npm:^5.0.0": + version: 5.0.0 + resolution: "locate-path@npm:5.0.0" + dependencies: + p-locate: ^4.1.0 + checksum: 83e51725e67517287d73e1ded92b28602e3ae5580b301fe54bfb76c0c723e3f285b19252e375712316774cf52006cb236aed5704692c32db0d5d089b69696e30 + languageName: node + linkType: hard + +"locate-path@npm:^6.0.0": + version: 6.0.0 + resolution: "locate-path@npm:6.0.0" + dependencies: + p-locate: ^5.0.0 + checksum: 72eb661788a0368c099a184c59d2fee760b3831c9c1c33955e8a19ae4a21b4116e53fa736dc086cdeb9fce9f7cc508f2f92d2d3aae516f133e16a2bb59a39f5a + languageName: node + linkType: hard + +"lodash.merge@npm:^4.6.2": + version: 4.6.2 + resolution: "lodash.merge@npm:4.6.2" + checksum: ad580b4bdbb7ca1f7abf7e1bce63a9a0b98e370cf40194b03380a46b4ed799c9573029599caebc1b14e3f24b111aef72b96674a56cfa105e0f5ac70546cdc005 + languageName: node + linkType: hard + +"log-symbols@npm:4.1.0": + version: 4.1.0 + resolution: "log-symbols@npm:4.1.0" + dependencies: + chalk: ^4.1.0 + is-unicode-supported: ^0.1.0 + checksum: fce1497b3135a0198803f9f07464165e9eb83ed02ceb2273930a6f8a508951178d8cf4f0378e9d28300a2ed2bc49050995d2bd5f53ab716bb15ac84d58c6ef74 + languageName: node + linkType: hard + +"lru-cache@npm:^6.0.0": + version: 6.0.0 + resolution: "lru-cache@npm:6.0.0" + dependencies: + yallist: ^4.0.0 + checksum: f97f499f898f23e4585742138a22f22526254fdba6d75d41a1c2526b3b6cc5747ef59c5612ba7375f42aca4f8461950e925ba08c991ead0651b4918b7c978297 + languageName: node + linkType: hard + +"lru-cache@npm:^7.7.1": + version: 7.18.3 + resolution: "lru-cache@npm:7.18.3" + checksum: e550d772384709deea3f141af34b6d4fa392e2e418c1498c078de0ee63670f1f46f5eee746e8ef7e69e1c895af0d4224e62ee33e66a543a14763b0f2e74c1356 + languageName: node + linkType: hard + +"lru-cache@npm:^9.1.1 || ^10.0.0": + version: 10.0.1 + resolution: "lru-cache@npm:10.0.1" + checksum: 06f8d0e1ceabd76bb6f644a26dbb0b4c471b79c7b514c13c6856113879b3bf369eb7b497dad4ff2b7e2636db202412394865b33c332100876d838ad1372f0181 + languageName: node + linkType: hard + +"make-fetch-happen@npm:^11.0.3": + version: 11.1.1 + resolution: "make-fetch-happen@npm:11.1.1" + dependencies: + agentkeepalive: ^4.2.1 + cacache: ^17.0.0 + http-cache-semantics: ^4.1.1 + http-proxy-agent: ^5.0.0 + https-proxy-agent: ^5.0.0 + is-lambda: ^1.0.1 + lru-cache: ^7.7.1 + minipass: ^5.0.0 + minipass-fetch: ^3.0.0 + minipass-flush: ^1.0.5 + minipass-pipeline: ^1.2.4 + negotiator: ^0.6.3 + promise-retry: ^2.0.1 + socks-proxy-agent: ^7.0.0 + ssri: ^10.0.0 + checksum: 7268bf274a0f6dcf0343829489a4506603ff34bd0649c12058753900b0eb29191dce5dba12680719a5d0a983d3e57810f594a12f3c18494e93a1fbc6348a4540 + languageName: node + linkType: hard + +"merge-stream@npm:^2.0.0": + version: 2.0.0 + resolution: "merge-stream@npm:2.0.0" + checksum: 6fa4dcc8d86629705cea944a4b88ef4cb0e07656ebf223fa287443256414283dd25d91c1cd84c77987f2aec5927af1a9db6085757cb43d90eb170ebf4b47f4f4 + languageName: node + linkType: hard + +"merge2@npm:^1.3.0, merge2@npm:^1.4.1": + version: 1.4.1 + resolution: "merge2@npm:1.4.1" + checksum: 7268db63ed5169466540b6fb947aec313200bcf6d40c5ab722c22e242f651994619bcd85601602972d3c85bd2cc45a358a4c61937e9f11a061919a1da569b0c2 + languageName: node + linkType: hard + +"micromatch@npm:^4.0.0, micromatch@npm:^4.0.4": + version: 4.0.5 + resolution: "micromatch@npm:4.0.5" + dependencies: + braces: ^3.0.2 + picomatch: ^2.3.1 + checksum: 02a17b671c06e8fefeeb6ef996119c1e597c942e632a21ef589154f23898c9c6a9858526246abb14f8bca6e77734aa9dcf65476fca47cedfb80d9577d52843fc + languageName: node + linkType: hard + +"mime-db@npm:1.52.0": + version: 1.52.0 + resolution: "mime-db@npm:1.52.0" + checksum: 0d99a03585f8b39d68182803b12ac601d9c01abfa28ec56204fa330bc9f3d1c5e14beb049bafadb3dbdf646dfb94b87e24d4ec7b31b7279ef906a8ea9b6a513f + languageName: node + linkType: hard + +"mime-types@npm:^2.1.27": + version: 2.1.35 + resolution: "mime-types@npm:2.1.35" + dependencies: + mime-db: 1.52.0 + checksum: 89a5b7f1def9f3af5dad6496c5ed50191ae4331cc5389d7c521c8ad28d5fdad2d06fd81baf38fed813dc4e46bb55c8145bb0ff406330818c9cf712fb2e9b3836 + languageName: node + linkType: hard + +"minimatch@npm:5.0.1": + version: 5.0.1 + resolution: "minimatch@npm:5.0.1" + dependencies: + brace-expansion: ^2.0.1 + checksum: b34b98463da4754bc526b244d680c69d4d6089451ebe512edaf6dd9eeed0279399cfa3edb19233513b8f830bf4bfcad911dddcdf125e75074100d52f724774f0 + languageName: node + linkType: hard + +"minimatch@npm:^3.0.4, minimatch@npm:^3.0.5, minimatch@npm:^3.1.1, minimatch@npm:^3.1.2": + version: 3.1.2 + resolution: "minimatch@npm:3.1.2" + dependencies: + brace-expansion: ^1.1.7 + checksum: c154e566406683e7bcb746e000b84d74465b3a832c45d59912b9b55cd50dee66e5c4b1e5566dba26154040e51672f9aa450a9aef0c97cfc7336b78b7afb9540a + languageName: node + linkType: hard + +"minimatch@npm:^5.0.1, minimatch@npm:^5.1.0": + version: 5.1.6 + resolution: "minimatch@npm:5.1.6" + dependencies: + brace-expansion: ^2.0.1 + checksum: 7564208ef81d7065a370f788d337cd80a689e981042cb9a1d0e6580b6c6a8c9279eba80010516e258835a988363f99f54a6f711a315089b8b42694f5da9d0d77 + languageName: node + linkType: hard + +"minimatch@npm:^9.0.1": + version: 9.0.3 + resolution: "minimatch@npm:9.0.3" + dependencies: + brace-expansion: ^2.0.1 + checksum: 253487976bf485b612f16bf57463520a14f512662e592e95c571afdab1442a6a6864b6c88f248ce6fc4ff0b6de04ac7aa6c8bb51e868e99d1d65eb0658a708b5 + languageName: node + linkType: hard + +"minipass-collect@npm:^1.0.2": + version: 1.0.2 + resolution: "minipass-collect@npm:1.0.2" + dependencies: + minipass: ^3.0.0 + checksum: 14df761028f3e47293aee72888f2657695ec66bd7d09cae7ad558da30415fdc4752bbfee66287dcc6fd5e6a2fa3466d6c484dc1cbd986525d9393b9523d97f10 + languageName: node + linkType: hard + +"minipass-fetch@npm:^3.0.0": + version: 3.0.4 + resolution: "minipass-fetch@npm:3.0.4" + dependencies: + encoding: ^0.1.13 + minipass: ^7.0.3 + minipass-sized: ^1.0.3 + minizlib: ^2.1.2 + dependenciesMeta: + encoding: + optional: true + checksum: af7aad15d5c128ab1ebe52e043bdf7d62c3c6f0cecb9285b40d7b395e1375b45dcdfd40e63e93d26a0e8249c9efd5c325c65575aceee192883970ff8cb11364a + languageName: node + linkType: hard + +"minipass-flush@npm:^1.0.5": + version: 1.0.5 + resolution: "minipass-flush@npm:1.0.5" + dependencies: + minipass: ^3.0.0 + checksum: 56269a0b22bad756a08a94b1ffc36b7c9c5de0735a4dd1ab2b06c066d795cfd1f0ac44a0fcae13eece5589b908ecddc867f04c745c7009be0b566421ea0944cf + languageName: node + linkType: hard + +"minipass-pipeline@npm:^1.2.4": + version: 1.2.4 + resolution: "minipass-pipeline@npm:1.2.4" + dependencies: + minipass: ^3.0.0 + checksum: b14240dac0d29823c3d5911c286069e36d0b81173d7bdf07a7e4a91ecdef92cdff4baaf31ea3746f1c61e0957f652e641223970870e2353593f382112257971b + languageName: node + linkType: hard + +"minipass-sized@npm:^1.0.3": + version: 1.0.3 + resolution: "minipass-sized@npm:1.0.3" + dependencies: + minipass: ^3.0.0 + checksum: 79076749fcacf21b5d16dd596d32c3b6bf4d6e62abb43868fac21674078505c8b15eaca4e47ed844985a4514854f917d78f588fcd029693709417d8f98b2bd60 + languageName: node + linkType: hard + +"minipass@npm:^3.0.0": + version: 3.3.6 + resolution: "minipass@npm:3.3.6" + dependencies: + yallist: ^4.0.0 + checksum: a30d083c8054cee83cdcdc97f97e4641a3f58ae743970457b1489ce38ee1167b3aaf7d815cd39ec7a99b9c40397fd4f686e83750e73e652b21cb516f6d845e48 + languageName: node + linkType: hard + +"minipass@npm:^5.0.0": + version: 5.0.0 + resolution: "minipass@npm:5.0.0" + checksum: 425dab288738853fded43da3314a0b5c035844d6f3097a8e3b5b29b328da8f3c1af6fc70618b32c29ff906284cf6406b6841376f21caaadd0793c1d5a6a620ea + languageName: node + linkType: hard + +"minipass@npm:^5.0.0 || ^6.0.2 || ^7.0.0, minipass@npm:^7.0.3": + version: 7.0.3 + resolution: "minipass@npm:7.0.3" + checksum: 6f1614f5b5b55568a46bca5fec0e7c46dac027691db27d0e1923a8192866903144cd962ac772c0e9f89b608ea818b702709c042bce98e190d258847d85461531 + languageName: node + linkType: hard + +"minizlib@npm:^2.1.1, minizlib@npm:^2.1.2": + version: 2.1.2 + resolution: "minizlib@npm:2.1.2" + dependencies: + minipass: ^3.0.0 + yallist: ^4.0.0 + checksum: f1fdeac0b07cf8f30fcf12f4b586795b97be856edea22b5e9072707be51fc95d41487faec3f265b42973a304fe3a64acd91a44a3826a963e37b37bafde0212c3 + languageName: node + linkType: hard + +"mkdirp@npm:^1.0.3": + version: 1.0.4 + resolution: "mkdirp@npm:1.0.4" + bin: + mkdirp: bin/cmd.js + checksum: a96865108c6c3b1b8e1d5e9f11843de1e077e57737602de1b82030815f311be11f96f09cce59bd5b903d0b29834733e5313f9301e3ed6d6f6fba2eae0df4298f + languageName: node + linkType: hard + +"mocha@npm:^10.2.0": + version: 10.2.0 + resolution: "mocha@npm:10.2.0" + dependencies: + ansi-colors: 4.1.1 + browser-stdout: 1.3.1 + chokidar: 3.5.3 + debug: 4.3.4 + diff: 5.0.0 + escape-string-regexp: 4.0.0 + find-up: 5.0.0 + glob: 7.2.0 + he: 1.2.0 + js-yaml: 4.1.0 + log-symbols: 4.1.0 + minimatch: 5.0.1 + ms: 2.1.3 + nanoid: 3.3.3 + serialize-javascript: 6.0.0 + strip-json-comments: 3.1.1 + supports-color: 8.1.1 + workerpool: 6.2.1 + yargs: 16.2.0 + yargs-parser: 20.2.4 + yargs-unparser: 2.0.0 + bin: + _mocha: bin/_mocha + mocha: bin/mocha.js + checksum: 406c45eab122ffd6ea2003c2f108b2bc35ba036225eee78e0c784b6fa2c7f34e2b13f1dbacef55a4fdf523255d76e4f22d1b5aacda2394bd11666febec17c719 + languageName: node + linkType: hard + +"ms@npm:2.1.2": + version: 2.1.2 + resolution: "ms@npm:2.1.2" + checksum: 673cdb2c3133eb050c745908d8ce632ed2c02d85640e2edb3ace856a2266a813b30c613569bf3354fdf4ea7d1a1494add3bfa95e2713baa27d0c2c71fc44f58f + languageName: node + linkType: hard + +"ms@npm:2.1.3, ms@npm:^2.0.0": + version: 2.1.3 + resolution: "ms@npm:2.1.3" + checksum: aa92de608021b242401676e35cfa5aa42dd70cbdc082b916da7fb925c542173e36bce97ea3e804923fe92c0ad991434e4a38327e15a1b5b5f945d66df615ae6d + languageName: node + linkType: hard + +"nanoid@npm:3.3.3": + version: 3.3.3 + resolution: "nanoid@npm:3.3.3" + bin: + nanoid: bin/nanoid.cjs + checksum: ada019402a07464a694553c61d2dca8a4353645a7d92f2830f0d487fedff403678a0bee5323a46522752b2eab95a0bc3da98b6cccaa7c0c55cd9975130e6d6f0 + languageName: node + linkType: hard + +"natural-compare-lite@npm:^1.4.0": + version: 1.4.0 + resolution: "natural-compare-lite@npm:1.4.0" + checksum: 5222ac3986a2b78dd6069ac62cbb52a7bf8ffc90d972ab76dfe7b01892485d229530ed20d0c62e79a6b363a663b273db3bde195a1358ce9e5f779d4453887225 + languageName: node + linkType: hard + +"natural-compare@npm:^1.4.0": + version: 1.4.0 + resolution: "natural-compare@npm:1.4.0" + checksum: 23ad088b08f898fc9b53011d7bb78ec48e79de7627e01ab5518e806033861bef68d5b0cd0e2205c2f36690ac9571ff6bcb05eb777ced2eeda8d4ac5b44592c3d + languageName: node + linkType: hard + +"negotiator@npm:^0.6.3": + version: 0.6.3 + resolution: "negotiator@npm:0.6.3" + checksum: b8ffeb1e262eff7968fc90a2b6767b04cfd9842582a9d0ece0af7049537266e7b2506dfb1d107a32f06dd849ab2aea834d5830f7f4d0e5cb7d36e1ae55d021d9 + languageName: node + linkType: hard + +"neo-async@npm:^2.6.2": + version: 2.6.2 + resolution: "neo-async@npm:2.6.2" + checksum: deac9f8d00eda7b2e5cd1b2549e26e10a0faa70adaa6fdadca701cc55f49ee9018e427f424bac0c790b7c7e2d3068db97f3093f1093975f2acb8f8818b936ed9 + languageName: node + linkType: hard + +"node-gyp@npm:latest": + version: 9.4.0 + resolution: "node-gyp@npm:9.4.0" + dependencies: + env-paths: ^2.2.0 + exponential-backoff: ^3.1.1 + glob: ^7.1.4 + graceful-fs: ^4.2.6 + make-fetch-happen: ^11.0.3 + nopt: ^6.0.0 + npmlog: ^6.0.0 + rimraf: ^3.0.2 + semver: ^7.3.5 + tar: ^6.1.2 + which: ^2.0.2 + bin: + node-gyp: bin/node-gyp.js + checksum: 78b404e2e0639d64e145845f7f5a3cb20c0520cdaf6dda2f6e025e9b644077202ea7de1232396ba5bde3fee84cdc79604feebe6ba3ec84d464c85d407bb5da99 + languageName: node + linkType: hard + +"node-releases@npm:^2.0.13": + version: 2.0.13 + resolution: "node-releases@npm:2.0.13" + checksum: 17ec8f315dba62710cae71a8dad3cd0288ba943d2ece43504b3b1aa8625bf138637798ab470b1d9035b0545996f63000a8a926e0f6d35d0996424f8b6d36dda3 + languageName: node + linkType: hard + +"nopt@npm:^6.0.0": + version: 6.0.0 + resolution: "nopt@npm:6.0.0" + dependencies: + abbrev: ^1.0.0 + bin: + nopt: bin/nopt.js + checksum: 82149371f8be0c4b9ec2f863cc6509a7fd0fa729929c009f3a58e4eb0c9e4cae9920e8f1f8eb46e7d032fec8fb01bede7f0f41a67eb3553b7b8e14fa53de1dac + languageName: node + linkType: hard + +"normalize-path@npm:^3.0.0, normalize-path@npm:~3.0.0": + version: 3.0.0 + resolution: "normalize-path@npm:3.0.0" + checksum: 88eeb4da891e10b1318c4b2476b6e2ecbeb5ff97d946815ffea7794c31a89017c70d7f34b3c2ebf23ef4e9fc9fb99f7dffe36da22011b5b5c6ffa34f4873ec20 + languageName: node + linkType: hard + +"npmlog@npm:^6.0.0": + version: 6.0.2 + resolution: "npmlog@npm:6.0.2" + dependencies: + are-we-there-yet: ^3.0.0 + console-control-strings: ^1.1.0 + gauge: ^4.0.3 + set-blocking: ^2.0.0 + checksum: ae238cd264a1c3f22091cdd9e2b106f684297d3c184f1146984ecbe18aaa86343953f26b9520dedd1b1372bc0316905b736c1932d778dbeb1fcf5a1001390e2a + languageName: node + linkType: hard + +"once@npm:^1.3.0": + version: 1.4.0 + resolution: "once@npm:1.4.0" + dependencies: + wrappy: 1 + checksum: cd0a88501333edd640d95f0d2700fbde6bff20b3d4d9bdc521bdd31af0656b5706570d6c6afe532045a20bb8dc0849f8332d6f2a416e0ba6d3d3b98806c7db68 + languageName: node + linkType: hard + +"optionator@npm:^0.9.3": + version: 0.9.3 + resolution: "optionator@npm:0.9.3" + dependencies: + "@aashutoshrathi/word-wrap": ^1.2.3 + deep-is: ^0.1.3 + fast-levenshtein: ^2.0.6 + levn: ^0.4.1 + prelude-ls: ^1.2.1 + type-check: ^0.4.0 + checksum: 09281999441f2fe9c33a5eeab76700795365a061563d66b098923eb719251a42bdbe432790d35064d0816ead9296dbeb1ad51a733edf4167c96bd5d0882e428a + languageName: node + linkType: hard + +"osmium@workspace:.": + version: 0.0.0-use.local + resolution: "osmium@workspace:." + dependencies: + husky: ^8.0.0 + languageName: unknown + linkType: soft + +"p-limit@npm:^2.2.0": + version: 2.3.0 + resolution: "p-limit@npm:2.3.0" + dependencies: + p-try: ^2.0.0 + checksum: 84ff17f1a38126c3314e91ecfe56aecbf36430940e2873dadaa773ffe072dc23b7af8e46d4b6485d302a11673fe94c6b67ca2cfbb60c989848b02100d0594ac1 + languageName: node + linkType: hard + +"p-limit@npm:^3.0.2": + version: 3.1.0 + resolution: "p-limit@npm:3.1.0" + dependencies: + yocto-queue: ^0.1.0 + checksum: 7c3690c4dbf62ef625671e20b7bdf1cbc9534e83352a2780f165b0d3ceba21907e77ad63401708145ca4e25bfc51636588d89a8c0aeb715e6c37d1c066430360 + languageName: node + linkType: hard + +"p-locate@npm:^4.1.0": + version: 4.1.0 + resolution: "p-locate@npm:4.1.0" + dependencies: + p-limit: ^2.2.0 + checksum: 513bd14a455f5da4ebfcb819ef706c54adb09097703de6aeaa5d26fe5ea16df92b48d1ac45e01e3944ce1e6aa2a66f7f8894742b8c9d6e276e16cd2049a2b870 + languageName: node + linkType: hard + +"p-locate@npm:^5.0.0": + version: 5.0.0 + resolution: "p-locate@npm:5.0.0" + dependencies: + p-limit: ^3.0.2 + checksum: 1623088f36cf1cbca58e9b61c4e62bf0c60a07af5ae1ca99a720837356b5b6c5ba3eb1b2127e47a06865fee59dd0453cad7cc844cda9d5a62ac1a5a51b7c86d3 + languageName: node + linkType: hard + +"p-map@npm:^4.0.0": + version: 4.0.0 + resolution: "p-map@npm:4.0.0" + dependencies: + aggregate-error: ^3.0.0 + checksum: cb0ab21ec0f32ddffd31dfc250e3afa61e103ef43d957cc45497afe37513634589316de4eb88abdfd969fe6410c22c0b93ab24328833b8eb1ccc087fc0442a1c + languageName: node + linkType: hard + +"p-try@npm:^2.0.0": + version: 2.2.0 + resolution: "p-try@npm:2.2.0" + checksum: f8a8e9a7693659383f06aec604ad5ead237c7a261c18048a6e1b5b85a5f8a067e469aa24f5bc009b991ea3b058a87f5065ef4176793a200d4917349881216cae + languageName: node + linkType: hard + +"pako@npm:~1.0.2": + version: 1.0.11 + resolution: "pako@npm:1.0.11" + checksum: 1be2bfa1f807608c7538afa15d6f25baa523c30ec870a3228a89579e474a4d992f4293859524e46d5d87fd30fa17c5edf34dbef0671251d9749820b488660b16 + languageName: node + linkType: hard + +"parent-module@npm:^1.0.0": + version: 1.0.1 + resolution: "parent-module@npm:1.0.1" + dependencies: + callsites: ^3.0.0 + checksum: 6ba8b255145cae9470cf5551eb74be2d22281587af787a2626683a6c20fbb464978784661478dd2a3f1dad74d1e802d403e1b03c1a31fab310259eec8ac560ff + languageName: node + linkType: hard + +"path-exists@npm:^4.0.0": + version: 4.0.0 + resolution: "path-exists@npm:4.0.0" + checksum: 505807199dfb7c50737b057dd8d351b82c033029ab94cb10a657609e00c1bc53b951cfdbccab8de04c5584d5eff31128ce6afd3db79281874a5ef2adbba55ed1 + languageName: node + linkType: hard + +"path-is-absolute@npm:^1.0.0": + version: 1.0.1 + resolution: "path-is-absolute@npm:1.0.1" + checksum: 060840f92cf8effa293bcc1bea81281bd7d363731d214cbe5c227df207c34cd727430f70c6037b5159c8a870b9157cba65e775446b0ab06fd5ecc7e54615a3b8 + languageName: node + linkType: hard + +"path-key@npm:^3.1.0": + version: 3.1.1 + resolution: "path-key@npm:3.1.1" + checksum: 55cd7a9dd4b343412a8386a743f9c746ef196e57c823d90ca3ab917f90ab9f13dd0ded27252ba49dbdfcab2b091d998bc446f6220cd3cea65db407502a740020 + languageName: node + linkType: hard + +"path-parse@npm:^1.0.7": + version: 1.0.7 + resolution: "path-parse@npm:1.0.7" + checksum: 49abf3d81115642938a8700ec580da6e830dde670be21893c62f4e10bd7dd4c3742ddc603fe24f898cba7eb0c6bc1777f8d9ac14185d34540c6d4d80cd9cae8a + languageName: node + linkType: hard + +"path-scurry@npm:^1.10.1": + version: 1.10.1 + resolution: "path-scurry@npm:1.10.1" + dependencies: + lru-cache: ^9.1.1 || ^10.0.0 + minipass: ^5.0.0 || ^6.0.2 || ^7.0.0 + checksum: e2557cff3a8fb8bc07afdd6ab163a92587884f9969b05bbbaf6fe7379348bfb09af9ed292af12ed32398b15fb443e81692047b786d1eeb6d898a51eb17ed7d90 + languageName: node + linkType: hard + +"path-type@npm:^4.0.0": + version: 4.0.0 + resolution: "path-type@npm:4.0.0" + checksum: 5b1e2daa247062061325b8fdbfd1fb56dde0a448fb1455453276ea18c60685bdad23a445dc148cf87bc216be1573357509b7d4060494a6fd768c7efad833ee45 + languageName: node + linkType: hard + +"picocolors@npm:^1.0.0": + version: 1.0.0 + resolution: "picocolors@npm:1.0.0" + checksum: a2e8092dd86c8396bdba9f2b5481032848525b3dc295ce9b57896f931e63fc16f79805144321f72976383fc249584672a75cc18d6777c6b757603f372f745981 + languageName: node + linkType: hard + +"picomatch@npm:^2.0.4, picomatch@npm:^2.2.1, picomatch@npm:^2.3.1": + version: 2.3.1 + resolution: "picomatch@npm:2.3.1" + checksum: 050c865ce81119c4822c45d3c84f1ced46f93a0126febae20737bd05ca20589c564d6e9226977df859ed5e03dc73f02584a2b0faad36e896936238238b0446cf + languageName: node + linkType: hard + +"pkg-dir@npm:^4.2.0": + version: 4.2.0 + resolution: "pkg-dir@npm:4.2.0" + dependencies: + find-up: ^4.0.0 + checksum: 9863e3f35132bf99ae1636d31ff1e1e3501251d480336edb1c211133c8d58906bed80f154a1d723652df1fda91e01c7442c2eeaf9dc83157c7ae89087e43c8d6 + languageName: node + linkType: hard + +"prelude-ls@npm:^1.2.1": + version: 1.2.1 + resolution: "prelude-ls@npm:1.2.1" + checksum: cd192ec0d0a8e4c6da3bb80e4f62afe336df3f76271ac6deb0e6a36187133b6073a19e9727a1ff108cd8b9982e4768850d413baa71214dd80c7979617dca827a + languageName: node + linkType: hard + +"prettier@npm:^3.0.0": + version: 3.0.0 + resolution: "prettier@npm:3.0.0" + bin: + prettier: bin/prettier.cjs + checksum: 6a832876a1552dc58330d2467874e5a0b46b9ccbfc5d3531eb69d15684743e7f83dc9fbd202db6270446deba9c82b79d24383d09924c462b457136a759425e33 + languageName: node + linkType: hard + +"process-nextick-args@npm:~2.0.0": + version: 2.0.1 + resolution: "process-nextick-args@npm:2.0.1" + checksum: 1d38588e520dab7cea67cbbe2efdd86a10cc7a074c09657635e34f035277b59fbb57d09d8638346bf7090f8e8ebc070c96fa5fd183b777fff4f5edff5e9466cf + languageName: node + linkType: hard + +"promise-retry@npm:^2.0.1": + version: 2.0.1 + resolution: "promise-retry@npm:2.0.1" + dependencies: + err-code: ^2.0.2 + retry: ^0.12.0 + checksum: f96a3f6d90b92b568a26f71e966cbbc0f63ab85ea6ff6c81284dc869b41510e6cdef99b6b65f9030f0db422bf7c96652a3fff9f2e8fb4a0f069d8f4430359429 + languageName: node + linkType: hard + +"punycode@npm:^2.1.0": + version: 2.3.0 + resolution: "punycode@npm:2.3.0" + checksum: 39f760e09a2a3bbfe8f5287cf733ecdad69d6af2fe6f97ca95f24b8921858b91e9ea3c9eeec6e08cede96181b3bb33f95c6ffd8c77e63986508aa2e8159fa200 + languageName: node + linkType: hard + +"queue-microtask@npm:^1.2.2": + version: 1.2.3 + resolution: "queue-microtask@npm:1.2.3" + checksum: b676f8c040cdc5b12723ad2f91414d267605b26419d5c821ff03befa817ddd10e238d22b25d604920340fd73efd8ba795465a0377c4adf45a4a41e4234e42dc4 languageName: node linkType: hard -"fast-json-stable-stringify@npm:^2.0.0": +"randombytes@npm:^2.1.0": version: 2.1.0 - resolution: "fast-json-stable-stringify@npm:2.1.0" - checksum: b191531e36c607977e5b1c47811158733c34ccb3bfde92c44798929e9b4154884378536d26ad90dfecd32e1ffc09c545d23535ad91b3161a27ddbb8ebe0cbecb + resolution: "randombytes@npm:2.1.0" + dependencies: + safe-buffer: ^5.1.0 + checksum: d779499376bd4cbb435ef3ab9a957006c8682f343f14089ed5f27764e4645114196e75b7f6abf1cbd84fd247c0cb0651698444df8c9bf30e62120fbbc52269d6 languageName: node linkType: hard -"fast-levenshtein@npm:^2.0.6": - version: 2.0.6 - resolution: "fast-levenshtein@npm:2.0.6" - checksum: 92cfec0a8dfafd9c7a15fba8f2cc29cd0b62b85f056d99ce448bbcd9f708e18ab2764bda4dd5158364f4145a7c72788538994f0d1787b956ef0d1062b0f7c24c +"readable-stream@npm:^3.6.0": + version: 3.6.2 + resolution: "readable-stream@npm:3.6.2" + dependencies: + inherits: ^2.0.3 + string_decoder: ^1.1.1 + util-deprecate: ^1.0.1 + checksum: bdcbe6c22e846b6af075e32cf8f4751c2576238c5043169a1c221c92ee2878458a816a4ea33f4c67623c0b6827c8a400409bfb3cf0bf3381392d0b1dfb52ac8d languageName: node linkType: hard -"fastq@npm:^1.6.0": - version: 1.15.0 - resolution: "fastq@npm:1.15.0" +"readable-stream@npm:~2.3.6": + version: 2.3.8 + resolution: "readable-stream@npm:2.3.8" dependencies: - reusify: ^1.0.4 - checksum: 0170e6bfcd5d57a70412440b8ef600da6de3b2a6c5966aeaf0a852d542daff506a0ee92d6de7679d1de82e644bce69d7a574a6c93f0b03964b5337eed75ada1a + core-util-is: ~1.0.0 + inherits: ~2.0.3 + isarray: ~1.0.0 + process-nextick-args: ~2.0.0 + safe-buffer: ~5.1.1 + string_decoder: ~1.1.1 + util-deprecate: ~1.0.1 + checksum: 65645467038704f0c8aaf026a72fbb588a9e2ef7a75cd57a01702ee9db1c4a1e4b03aaad36861a6a0926546a74d174149c8c207527963e0c2d3eee2f37678a42 languageName: node linkType: hard -"file-entry-cache@npm:^6.0.1": - version: 6.0.1 - resolution: "file-entry-cache@npm:6.0.1" +"readdirp@npm:~3.6.0": + version: 3.6.0 + resolution: "readdirp@npm:3.6.0" dependencies: - flat-cache: ^3.0.4 - checksum: f49701feaa6314c8127c3c2f6173cfefff17612f5ed2daaafc6da13b5c91fd43e3b2a58fd0d63f9f94478a501b167615931e7200e31485e320f74a33885a9c74 + picomatch: ^2.2.1 + checksum: 1ced032e6e45670b6d7352d71d21ce7edf7b9b928494dcaba6f11fba63180d9da6cd7061ebc34175ffda6ff529f481818c962952004d273178acd70f7059b320 languageName: node linkType: hard -"find-up@npm:^5.0.0": - version: 5.0.0 - resolution: "find-up@npm:5.0.0" +"rechoir@npm:^0.8.0": + version: 0.8.0 + resolution: "rechoir@npm:0.8.0" dependencies: - locate-path: ^6.0.0 - path-exists: ^4.0.0 - checksum: 07955e357348f34660bde7920783204ff5a26ac2cafcaa28bace494027158a97b9f56faaf2d89a6106211a8174db650dd9f503f9c0d526b1202d5554a00b9095 + resolve: ^1.20.0 + checksum: ad3caed8afdefbc33fbc30e6d22b86c35b3d51c2005546f4e79bcc03c074df804b3640ad18945e6bef9ed12caedc035655ec1082f64a5e94c849ff939dc0a788 languageName: node linkType: hard -"flat-cache@npm:^3.0.4": - version: 3.0.4 - resolution: "flat-cache@npm:3.0.4" +"require-directory@npm:^2.1.1": + version: 2.1.1 + resolution: "require-directory@npm:2.1.1" + checksum: fb47e70bf0001fdeabdc0429d431863e9475e7e43ea5f94ad86503d918423c1543361cc5166d713eaa7029dd7a3d34775af04764bebff99ef413111a5af18c80 + languageName: node + linkType: hard + +"resolve-cwd@npm:^3.0.0": + version: 3.0.0 + resolution: "resolve-cwd@npm:3.0.0" dependencies: - flatted: ^3.1.0 - rimraf: ^3.0.2 - checksum: 4fdd10ecbcbf7d520f9040dd1340eb5dfe951e6f0ecf2252edeec03ee68d989ec8b9a20f4434270e71bcfd57800dc09b3344fca3966b2eb8f613072c7d9a2365 + resolve-from: ^5.0.0 + checksum: 546e0816012d65778e580ad62b29e975a642989108d9a3c5beabfb2304192fa3c9f9146fbdfe213563c6ff51975ae41bac1d3c6e047dd9572c94863a057b4d81 languageName: node linkType: hard -"flatted@npm:^3.1.0": - version: 3.2.7 - resolution: "flatted@npm:3.2.7" - checksum: 427633049d55bdb80201c68f7eb1cbd533e03eac541f97d3aecab8c5526f12a20ccecaeede08b57503e772c769e7f8680b37e8d482d1e5f8d7e2194687f9ea35 +"resolve-from@npm:^4.0.0": + version: 4.0.0 + resolution: "resolve-from@npm:4.0.0" + checksum: f4ba0b8494846a5066328ad33ef8ac173801a51739eb4d63408c847da9a2e1c1de1e6cbbf72699211f3d13f8fc1325648b169bd15eb7da35688e30a5fb0e4a7f languageName: node linkType: hard -"fs.realpath@npm:^1.0.0": - version: 1.0.0 - resolution: "fs.realpath@npm:1.0.0" - checksum: 99ddea01a7e75aa276c250a04eedeffe5662bce66c65c07164ad6264f9de18fb21be9433ead460e54cff20e31721c811f4fb5d70591799df5f85dce6d6746fd0 +"resolve-from@npm:^5.0.0": + version: 5.0.0 + resolution: "resolve-from@npm:5.0.0" + checksum: 4ceeb9113e1b1372d0cd969f3468fa042daa1dd9527b1b6bb88acb6ab55d8b9cd65dbf18819f9f9ddf0db804990901dcdaade80a215e7b2c23daae38e64f5bdf languageName: node linkType: hard -"glob-parent@npm:^6.0.2": - version: 6.0.2 - resolution: "glob-parent@npm:6.0.2" +"resolve@npm:^1.20.0": + version: 1.22.4 + resolution: "resolve@npm:1.22.4" dependencies: - is-glob: ^4.0.3 - checksum: c13ee97978bef4f55106b71e66428eb1512e71a7466ba49025fc2aec59a5bfb0954d5abd58fc5ee6c9b076eef4e1f6d3375c2e964b88466ca390da4419a786a8 + is-core-module: ^2.13.0 + path-parse: ^1.0.7 + supports-preserve-symlinks-flag: ^1.0.0 + bin: + resolve: bin/resolve + checksum: 23f25174c2736ce24c6d918910e0d1f89b6b38fefa07a995dff864acd7863d59a7f049e691f93b4b2ee29696303390d921552b6d1b841ed4a8101f517e1d0124 languageName: node linkType: hard -"glob@npm:^7.1.3": - version: 7.2.3 - resolution: "glob@npm:7.2.3" +"resolve@patch:resolve@^1.20.0#~builtin": + version: 1.22.4 + resolution: "resolve@patch:resolve@npm%3A1.22.4#~builtin::version=1.22.4&hash=c3c19d" dependencies: - fs.realpath: ^1.0.0 - inflight: ^1.0.4 - inherits: 2 - minimatch: ^3.1.1 - once: ^1.3.0 - path-is-absolute: ^1.0.0 - checksum: 29452e97b38fa704dabb1d1045350fb2467cf0277e155aa9ff7077e90ad81d1ea9d53d3ee63bd37c05b09a065e90f16aec4a65f5b8de401d1dac40bc5605d133 + is-core-module: ^2.13.0 + path-parse: ^1.0.7 + supports-preserve-symlinks-flag: ^1.0.0 + bin: + resolve: bin/resolve + checksum: c45f2545fdc4d21883861b032789e20aa67a2f2692f68da320cc84d5724cd02f2923766c5354b3210897e88f1a7b3d6d2c7c22faeead8eed7078e4c783a444bc languageName: node linkType: hard -"globals@npm:^13.19.0": - version: 13.20.0 - resolution: "globals@npm:13.20.0" +"retry@npm:^0.12.0": + version: 0.12.0 + resolution: "retry@npm:0.12.0" + checksum: 623bd7d2e5119467ba66202d733ec3c2e2e26568074923bc0585b6b99db14f357e79bdedb63cab56cec47491c4a0da7e6021a7465ca6dc4f481d3898fdd3158c + languageName: node + linkType: hard + +"reusify@npm:^1.0.4": + version: 1.0.4 + resolution: "reusify@npm:1.0.4" + checksum: c3076ebcc22a6bc252cb0b9c77561795256c22b757f40c0d8110b1300723f15ec0fc8685e8d4ea6d7666f36c79ccc793b1939c748bf36f18f542744a4e379fcc + languageName: node + linkType: hard + +"rimraf@npm:^3.0.2": + version: 3.0.2 + resolution: "rimraf@npm:3.0.2" dependencies: - type-fest: ^0.20.2 - checksum: ad1ecf914bd051325faad281d02ea2c0b1df5d01bd94d368dcc5513340eac41d14b3c61af325768e3c7f8d44576e72780ec0b6f2d366121f8eec6e03c3a3b97a + glob: ^7.1.3 + bin: + rimraf: bin.js + checksum: 87f4164e396f0171b0a3386cc1877a817f572148ee13a7e113b238e48e8a9f2f31d009a92ec38a591ff1567d9662c6b67fd8818a2dbbaed74bc26a87a2a4a9a0 languageName: node linkType: hard -"graphemer@npm:^1.4.0": - version: 1.4.0 - resolution: "graphemer@npm:1.4.0" - checksum: bab8f0be9b568857c7bec9fda95a89f87b783546d02951c40c33f84d05bb7da3fd10f863a9beb901463669b6583173a8c8cc6d6b306ea2b9b9d5d3d943c3a673 +"run-parallel@npm:^1.1.9": + version: 1.2.0 + resolution: "run-parallel@npm:1.2.0" + dependencies: + queue-microtask: ^1.2.2 + checksum: cb4f97ad25a75ebc11a8ef4e33bb962f8af8516bb2001082ceabd8902e15b98f4b84b4f8a9b222e5d57fc3bd1379c483886ed4619367a7680dad65316993021d languageName: node linkType: hard -"has-flag@npm:^4.0.0": - version: 4.0.0 - resolution: "has-flag@npm:4.0.0" - checksum: 261a1357037ead75e338156b1f9452c016a37dcd3283a972a30d9e4a87441ba372c8b81f818cd0fbcd9c0354b4ae7e18b9e1afa1971164aef6d18c2b6095a8ad +"safe-buffer@npm:^5.1.0, safe-buffer@npm:~5.2.0": + version: 5.2.1 + resolution: "safe-buffer@npm:5.2.1" + checksum: b99c4b41fdd67a6aaf280fcd05e9ffb0813654894223afb78a31f14a19ad220bba8aba1cb14eddce1fcfb037155fe6de4e861784eb434f7d11ed58d1e70dd491 languageName: node linkType: hard -"husky@npm:^8.0.0": - version: 8.0.3 - resolution: "husky@npm:8.0.3" - bin: - husky: lib/bin.js - checksum: 837bc7e4413e58c1f2946d38fb050f5d7324c6f16b0fd66411ffce5703b294bd21429e8ba58711cd331951ee86ed529c5be4f76805959ff668a337dbfa82a1b0 +"safe-buffer@npm:~5.1.0, safe-buffer@npm:~5.1.1": + version: 5.1.2 + resolution: "safe-buffer@npm:5.1.2" + checksum: f2f1f7943ca44a594893a852894055cf619c1fbcb611237fc39e461ae751187e7baf4dc391a72125e0ac4fb2d8c5c0b3c71529622e6a58f46b960211e704903c languageName: node linkType: hard -"ignore@npm:^5.2.0": - version: 5.2.4 - resolution: "ignore@npm:5.2.4" - checksum: 3d4c309c6006e2621659311783eaea7ebcd41fe4ca1d78c91c473157ad6666a57a2df790fe0d07a12300d9aac2888204d7be8d59f9aaf665b1c7fcdb432517ef +"safer-buffer@npm:>= 2.1.2 < 3.0.0": + version: 2.1.2 + resolution: "safer-buffer@npm:2.1.2" + checksum: cab8f25ae6f1434abee8d80023d7e72b598cf1327164ddab31003c51215526801e40b66c5e65d658a0af1e9d6478cadcb4c745f4bd6751f97d8644786c0978b0 languageName: node linkType: hard -"import-fresh@npm:^3.2.1": +"schema-utils@npm:^3.1.1, schema-utils@npm:^3.2.0": version: 3.3.0 - resolution: "import-fresh@npm:3.3.0" + resolution: "schema-utils@npm:3.3.0" dependencies: - parent-module: ^1.0.0 - resolve-from: ^4.0.0 - checksum: 2cacfad06e652b1edc50be650f7ec3be08c5e5a6f6d12d035c440a42a8cc028e60a5b99ca08a77ab4d6b1346da7d971915828f33cdab730d3d42f08242d09baa + "@types/json-schema": ^7.0.8 + ajv: ^6.12.5 + ajv-keywords: ^3.5.2 + checksum: ea56971926fac2487f0757da939a871388891bc87c6a82220d125d587b388f1704788f3706e7f63a7b70e49fc2db974c41343528caea60444afd5ce0fe4b85c0 languageName: node linkType: hard -"imurmurhash@npm:^0.1.4": - version: 0.1.4 - resolution: "imurmurhash@npm:0.1.4" - checksum: 7cae75c8cd9a50f57dadd77482359f659eaebac0319dd9368bcd1714f55e65badd6929ca58569da2b6494ef13fdd5598cd700b1eba23f8b79c5f19d195a3ecf7 +"semver@npm:^7.3.4, semver@npm:^7.3.5, semver@npm:^7.3.7, semver@npm:^7.5.2": + version: 7.5.4 + resolution: "semver@npm:7.5.4" + dependencies: + lru-cache: ^6.0.0 + bin: + semver: bin/semver.js + checksum: 12d8ad952fa353b0995bf180cdac205a4068b759a140e5d3c608317098b3575ac2f1e09182206bf2eb26120e1c0ed8fb92c48c592f6099680de56bb071423ca3 languageName: node linkType: hard -"inflight@npm:^1.0.4": - version: 1.0.6 - resolution: "inflight@npm:1.0.6" +"serialize-javascript@npm:6.0.0": + version: 6.0.0 + resolution: "serialize-javascript@npm:6.0.0" dependencies: - once: ^1.3.0 - wrappy: 1 - checksum: f4f76aa072ce19fae87ce1ef7d221e709afb59d445e05d47fba710e85470923a75de35bfae47da6de1b18afc3ce83d70facf44cfb0aff89f0a3f45c0a0244dfd + randombytes: ^2.1.0 + checksum: 56f90b562a1bdc92e55afb3e657c6397c01a902c588c0fe3d4c490efdcc97dcd2a3074ba12df9e94630f33a5ce5b76a74784a7041294628a6f4306e0ec84bf93 languageName: node linkType: hard -"inherits@npm:2": - version: 2.0.4 - resolution: "inherits@npm:2.0.4" - checksum: 4a48a733847879d6cf6691860a6b1e3f0f4754176e4d71494c41f3475553768b10f84b5ce1d40fbd0e34e6bfbb864ee35858ad4dd2cf31e02fc4a154b724d7f1 +"serialize-javascript@npm:^6.0.1": + version: 6.0.1 + resolution: "serialize-javascript@npm:6.0.1" + dependencies: + randombytes: ^2.1.0 + checksum: 3c4f4cb61d0893b988415bdb67243637333f3f574e9e9cc9a006a2ced0b390b0b3b44aef8d51c951272a9002ec50885eefdc0298891bc27eb2fe7510ea87dc4f languageName: node linkType: hard -"is-extglob@npm:^2.1.1": - version: 2.1.1 - resolution: "is-extglob@npm:2.1.1" - checksum: df033653d06d0eb567461e58a7a8c9f940bd8c22274b94bf7671ab36df5719791aae15eef6d83bbb5e23283967f2f984b8914559d4449efda578c775c4be6f85 +"set-blocking@npm:^2.0.0": + version: 2.0.0 + resolution: "set-blocking@npm:2.0.0" + checksum: 6e65a05f7cf7ebdf8b7c75b101e18c0b7e3dff4940d480efed8aad3a36a4005140b660fa1d804cb8bce911cac290441dc728084a30504d3516ac2ff7ad607b02 languageName: node linkType: hard -"is-glob@npm:^4.0.0, is-glob@npm:^4.0.3": - version: 4.0.3 - resolution: "is-glob@npm:4.0.3" +"setimmediate@npm:^1.0.5": + version: 1.0.5 + resolution: "setimmediate@npm:1.0.5" + checksum: c9a6f2c5b51a2dabdc0247db9c46460152ffc62ee139f3157440bd48e7c59425093f42719ac1d7931f054f153e2d26cf37dfeb8da17a794a58198a2705e527fd + languageName: node + linkType: hard + +"shallow-clone@npm:^3.0.0": + version: 3.0.1 + resolution: "shallow-clone@npm:3.0.1" dependencies: - is-extglob: ^2.1.1 - checksum: d381c1319fcb69d341cc6e6c7cd588e17cd94722d9a32dbd60660b993c4fb7d0f19438674e68dfec686d09b7c73139c9166b47597f846af387450224a8101ab4 + kind-of: ^6.0.2 + checksum: 39b3dd9630a774aba288a680e7d2901f5c0eae7b8387fc5c8ea559918b29b3da144b7bdb990d7ccd9e11be05508ac9e459ce51d01fd65e583282f6ffafcba2e7 languageName: node linkType: hard -"is-path-inside@npm:^3.0.3": - version: 3.0.3 - resolution: "is-path-inside@npm:3.0.3" - checksum: abd50f06186a052b349c15e55b182326f1936c89a78bf6c8f2b707412517c097ce04bc49a0ca221787bc44e1049f51f09a2ffb63d22899051988d3a618ba13e9 +"shebang-command@npm:^2.0.0": + version: 2.0.0 + resolution: "shebang-command@npm:2.0.0" + dependencies: + shebang-regex: ^3.0.0 + checksum: 6b52fe87271c12968f6a054e60f6bde5f0f3d2db483a1e5c3e12d657c488a15474121a1d55cd958f6df026a54374ec38a4a963988c213b7570e1d51575cea7fa + languageName: node + linkType: hard + +"shebang-regex@npm:^3.0.0": + version: 3.0.0 + resolution: "shebang-regex@npm:3.0.0" + checksum: 1a2bcae50de99034fcd92ad4212d8e01eedf52c7ec7830eedcf886622804fe36884278f2be8be0ea5fde3fd1c23911643a4e0f726c8685b61871c8908af01222 + languageName: node + linkType: hard + +"signal-exit@npm:^3.0.7": + version: 3.0.7 + resolution: "signal-exit@npm:3.0.7" + checksum: a2f098f247adc367dffc27845853e9959b9e88b01cb301658cfe4194352d8d2bb32e18467c786a7fe15f1d44b233ea35633d076d5e737870b7139949d1ab6318 + languageName: node + linkType: hard + +"signal-exit@npm:^4.0.1": + version: 4.1.0 + resolution: "signal-exit@npm:4.1.0" + checksum: 64c757b498cb8629ffa5f75485340594d2f8189e9b08700e69199069c8e3070fb3e255f7ab873c05dc0b3cec412aea7402e10a5990cb6a050bd33ba062a6c549 + languageName: node + linkType: hard + +"slash@npm:^3.0.0": + version: 3.0.0 + resolution: "slash@npm:3.0.0" + checksum: 94a93fff615f25a999ad4b83c9d5e257a7280c90a32a7cb8b4a87996e4babf322e469c42b7f649fd5796edd8687652f3fb452a86dc97a816f01113183393f11c + languageName: node + linkType: hard + +"smart-buffer@npm:^4.2.0": + version: 4.2.0 + resolution: "smart-buffer@npm:4.2.0" + checksum: b5167a7142c1da704c0e3af85c402002b597081dd9575031a90b4f229ca5678e9a36e8a374f1814c8156a725d17008ae3bde63b92f9cfd132526379e580bec8b + languageName: node + linkType: hard + +"socks-proxy-agent@npm:^7.0.0": + version: 7.0.0 + resolution: "socks-proxy-agent@npm:7.0.0" + dependencies: + agent-base: ^6.0.2 + debug: ^4.3.3 + socks: ^2.6.2 + checksum: 720554370154cbc979e2e9ce6a6ec6ced205d02757d8f5d93fe95adae454fc187a5cbfc6b022afab850a5ce9b4c7d73e0f98e381879cf45f66317a4895953846 + languageName: node + linkType: hard + +"socks@npm:^2.6.2": + version: 2.7.1 + resolution: "socks@npm:2.7.1" + dependencies: + ip: ^2.0.0 + smart-buffer: ^4.2.0 + checksum: 259d9e3e8e1c9809a7f5c32238c3d4d2a36b39b83851d0f573bfde5f21c4b1288417ce1af06af1452569cd1eb0841169afd4998f0e04ba04656f6b7f0e46d748 + languageName: node + linkType: hard + +"source-map-support@npm:~0.5.20": + version: 0.5.21 + resolution: "source-map-support@npm:0.5.21" + dependencies: + buffer-from: ^1.0.0 + source-map: ^0.6.0 + checksum: 43e98d700d79af1d36f859bdb7318e601dfc918c7ba2e98456118ebc4c4872b327773e5a1df09b0524e9e5063bb18f0934538eace60cca2710d1fa687645d137 + languageName: node + linkType: hard + +"source-map@npm:^0.6.0": + version: 0.6.1 + resolution: "source-map@npm:0.6.1" + checksum: 59ce8640cf3f3124f64ac289012c2b8bd377c238e316fb323ea22fbfe83da07d81e000071d7242cad7a23cd91c7de98e4df8830ec3f133cb6133a5f6e9f67bc2 + languageName: node + linkType: hard + +"ssri@npm:^10.0.0": + version: 10.0.5 + resolution: "ssri@npm:10.0.5" + dependencies: + minipass: ^7.0.3 + checksum: 0a31b65f21872dea1ed3f7c200d7bc1c1b91c15e419deca14f282508ba917cbb342c08a6814c7f68ca4ca4116dd1a85da2bbf39227480e50125a1ceffeecb750 + languageName: node + linkType: hard + +"string-width-cjs@npm:string-width@^4.2.0, string-width@npm:^1.0.2 || 2 || 3 || 4, string-width@npm:^4.1.0, string-width@npm:^4.2.0, string-width@npm:^4.2.3": + version: 4.2.3 + resolution: "string-width@npm:4.2.3" + dependencies: + emoji-regex: ^8.0.0 + is-fullwidth-code-point: ^3.0.0 + strip-ansi: ^6.0.1 + checksum: e52c10dc3fbfcd6c3a15f159f54a90024241d0f149cf8aed2982a2d801d2e64df0bf1dc351cf8e95c3319323f9f220c16e740b06faecd53e2462df1d2b5443fb + languageName: node + linkType: hard + +"string-width@npm:^5.0.1, string-width@npm:^5.1.2": + version: 5.1.2 + resolution: "string-width@npm:5.1.2" + dependencies: + eastasianwidth: ^0.2.0 + emoji-regex: ^9.2.2 + strip-ansi: ^7.0.1 + checksum: 7369deaa29f21dda9a438686154b62c2c5f661f8dda60449088f9f980196f7908fc39fdd1803e3e01541970287cf5deae336798337e9319a7055af89dafa7193 + languageName: node + linkType: hard + +"string_decoder@npm:^1.1.1": + version: 1.3.0 + resolution: "string_decoder@npm:1.3.0" + dependencies: + safe-buffer: ~5.2.0 + checksum: 8417646695a66e73aefc4420eb3b84cc9ffd89572861fe004e6aeb13c7bc00e2f616247505d2dbbef24247c372f70268f594af7126f43548565c68c117bdeb56 + languageName: node + linkType: hard + +"string_decoder@npm:~1.1.1": + version: 1.1.1 + resolution: "string_decoder@npm:1.1.1" + dependencies: + safe-buffer: ~5.1.0 + checksum: 9ab7e56f9d60a28f2be697419917c50cac19f3e8e6c28ef26ed5f4852289fe0de5d6997d29becf59028556f2c62983790c1d9ba1e2a3cc401768ca12d5183a5b + languageName: node + linkType: hard + +"strip-ansi-cjs@npm:strip-ansi@^6.0.1, strip-ansi@npm:^6.0.0, strip-ansi@npm:^6.0.1": + version: 6.0.1 + resolution: "strip-ansi@npm:6.0.1" + dependencies: + ansi-regex: ^5.0.1 + checksum: f3cd25890aef3ba6e1a74e20896c21a46f482e93df4a06567cebf2b57edabb15133f1f94e57434e0a958d61186087b1008e89c94875d019910a213181a14fc8c + languageName: node + linkType: hard + +"strip-ansi@npm:^7.0.1": + version: 7.1.0 + resolution: "strip-ansi@npm:7.1.0" + dependencies: + ansi-regex: ^6.0.1 + checksum: 859c73fcf27869c22a4e4d8c6acfe690064659e84bef9458aa6d13719d09ca88dcfd40cbf31fd0be63518ea1a643fe070b4827d353e09533a5b0b9fd4553d64d + languageName: node + linkType: hard + +"strip-json-comments@npm:3.1.1, strip-json-comments@npm:^3.1.1": + version: 3.1.1 + resolution: "strip-json-comments@npm:3.1.1" + checksum: 492f73e27268f9b1c122733f28ecb0e7e8d8a531a6662efbd08e22cccb3f9475e90a1b82cab06a392f6afae6d2de636f977e231296400d0ec5304ba70f166443 + languageName: node + linkType: hard + +"supports-color@npm:8.1.1, supports-color@npm:^8.0.0": + version: 8.1.1 + resolution: "supports-color@npm:8.1.1" + dependencies: + has-flag: ^4.0.0 + checksum: c052193a7e43c6cdc741eb7f378df605636e01ad434badf7324f17fb60c69a880d8d8fcdcb562cf94c2350e57b937d7425ab5b8326c67c2adc48f7c87c1db406 + languageName: node + linkType: hard + +"supports-color@npm:^7.1.0": + version: 7.2.0 + resolution: "supports-color@npm:7.2.0" + dependencies: + has-flag: ^4.0.0 + checksum: 3dda818de06ebbe5b9653e07842d9479f3555ebc77e9a0280caf5a14fb877ffee9ed57007c3b78f5a6324b8dbeec648d9e97a24e2ed9fdb81ddc69ea07100f4a + languageName: node + linkType: hard + +"supports-preserve-symlinks-flag@npm:^1.0.0": + version: 1.0.0 + resolution: "supports-preserve-symlinks-flag@npm:1.0.0" + checksum: 53b1e247e68e05db7b3808b99b892bd36fb096e6fba213a06da7fab22045e97597db425c724f2bbd6c99a3c295e1e73f3e4de78592289f38431049e1277ca0ae + languageName: node + linkType: hard + +"tapable@npm:^2.1.1, tapable@npm:^2.2.0": + version: 2.2.1 + resolution: "tapable@npm:2.2.1" + checksum: 3b7a1b4d86fa940aad46d9e73d1e8739335efd4c48322cb37d073eb6f80f5281889bf0320c6d8ffcfa1a0dd5bfdbd0f9d037e252ef972aca595330538aac4d51 languageName: node linkType: hard -"isexe@npm:^2.0.0": - version: 2.0.0 - resolution: "isexe@npm:2.0.0" - checksum: 26bf6c5480dda5161c820c5b5c751ae1e766c587b1f951ea3fcfc973bafb7831ae5b54a31a69bd670220e42e99ec154475025a468eae58ea262f813fdc8d1c62 +"tar@npm:^6.1.11, tar@npm:^6.1.2": + version: 6.2.0 + resolution: "tar@npm:6.2.0" + dependencies: + chownr: ^2.0.0 + fs-minipass: ^2.0.0 + minipass: ^5.0.0 + minizlib: ^2.1.1 + mkdirp: ^1.0.3 + yallist: ^4.0.0 + checksum: db4d9fe74a2082c3a5016630092c54c8375ff3b280186938cfd104f2e089c4fd9bad58688ef6be9cf186a889671bf355c7cda38f09bbf60604b281715ca57f5c languageName: node linkType: hard -"js-yaml@npm:^4.1.0": - version: 4.1.0 - resolution: "js-yaml@npm:4.1.0" +"terser-webpack-plugin@npm:^5.3.7": + version: 5.3.9 + resolution: "terser-webpack-plugin@npm:5.3.9" dependencies: - argparse: ^2.0.1 - bin: - js-yaml: bin/js-yaml.js - checksum: c7830dfd456c3ef2c6e355cc5a92e6700ceafa1d14bba54497b34a99f0376cecbb3e9ac14d3e5849b426d5a5140709a66237a8c991c675431271c4ce5504151a + "@jridgewell/trace-mapping": ^0.3.17 + jest-worker: ^27.4.5 + schema-utils: ^3.1.1 + serialize-javascript: ^6.0.1 + terser: ^5.16.8 + peerDependencies: + webpack: ^5.1.0 + peerDependenciesMeta: + "@swc/core": + optional: true + esbuild: + optional: true + uglify-js: + optional: true + checksum: 41705713d6f9cb83287936b21e27c658891c78c4392159f5148b5623f0e8c48559869779619b058382a4c9758e7820ea034695e57dc7c474b4962b79f553bc5f languageName: node linkType: hard -"json-schema-traverse@npm:^0.4.1": - version: 0.4.1 - resolution: "json-schema-traverse@npm:0.4.1" - checksum: 7486074d3ba247769fda17d5181b345c9fb7d12e0da98b22d1d71a5db9698d8b4bd900a3ec1a4ffdd60846fc2556274a5c894d0c48795f14cb03aeae7b55260b +"terser@npm:^5.16.8": + version: 5.19.4 + resolution: "terser@npm:5.19.4" + dependencies: + "@jridgewell/source-map": ^0.3.3 + acorn: ^8.8.2 + commander: ^2.20.0 + source-map-support: ~0.5.20 + bin: + terser: bin/terser + checksum: 09273ce7d3fbe8fea0ec2603ad1c06cc304838bdac42bbfe77835b0b0b6c4a894054575ca518fe16c95d5c401574a8c703f4fde97da45f1c972ea568e6ecafda languageName: node linkType: hard -"json-stable-stringify-without-jsonify@npm:^1.0.1": - version: 1.0.1 - resolution: "json-stable-stringify-without-jsonify@npm:1.0.1" - checksum: cff44156ddce9c67c44386ad5cddf91925fe06b1d217f2da9c4910d01f358c6e3989c4d5a02683c7a5667f9727ff05831f7aa8ae66c8ff691c556f0884d49215 +"text-table@npm:^0.2.0": + version: 0.2.0 + resolution: "text-table@npm:0.2.0" + checksum: b6937a38c80c7f84d9c11dd75e49d5c44f71d95e810a3250bd1f1797fc7117c57698204adf676b71497acc205d769d65c16ae8fa10afad832ae1322630aef10a languageName: node linkType: hard -"levn@npm:^0.4.1": - version: 0.4.1 - resolution: "levn@npm:0.4.1" +"to-regex-range@npm:^5.0.1": + version: 5.0.1 + resolution: "to-regex-range@npm:5.0.1" dependencies: - prelude-ls: ^1.2.1 - type-check: ~0.4.0 - checksum: 12c5021c859bd0f5248561bf139121f0358285ec545ebf48bb3d346820d5c61a4309535c7f387ed7d84361cf821e124ce346c6b7cef8ee09a67c1473b46d0fc4 + is-number: ^7.0.0 + checksum: f76fa01b3d5be85db6a2a143e24df9f60dd047d151062d0ba3df62953f2f697b16fe5dad9b0ac6191c7efc7b1d9dcaa4b768174b7b29da89d4428e64bc0a20ed languageName: node linkType: hard -"locate-path@npm:^6.0.0": - version: 6.0.0 - resolution: "locate-path@npm:6.0.0" +"ts-loader@npm:^9.4.3": + version: 9.4.4 + resolution: "ts-loader@npm:9.4.4" dependencies: - p-locate: ^5.0.0 - checksum: 72eb661788a0368c099a184c59d2fee760b3831c9c1c33955e8a19ae4a21b4116e53fa736dc086cdeb9fce9f7cc508f2f92d2d3aae516f133e16a2bb59a39f5a + chalk: ^4.1.0 + enhanced-resolve: ^5.0.0 + micromatch: ^4.0.0 + semver: ^7.3.4 + peerDependencies: + typescript: "*" + webpack: ^5.0.0 + checksum: 8e5e6b839b0edfa40d2156c880d88ccab58226894ea5978221bc48c7db3215e2e856bfd0093f148e925a2befc42d6c94cafa9a994a7da274541efaa916012b63 languageName: node linkType: hard -"lodash.merge@npm:^4.6.2": - version: 4.6.2 - resolution: "lodash.merge@npm:4.6.2" - checksum: ad580b4bdbb7ca1f7abf7e1bce63a9a0b98e370cf40194b03380a46b4ed799c9573029599caebc1b14e3f24b111aef72b96674a56cfa105e0f5ac70546cdc005 +"tslib@npm:^1.8.1": + version: 1.14.1 + resolution: "tslib@npm:1.14.1" + checksum: dbe628ef87f66691d5d2959b3e41b9ca0045c3ee3c7c7b906cc1e328b39f199bb1ad9e671c39025bd56122ac57dfbf7385a94843b1cc07c60a4db74795829acd languageName: node linkType: hard -"minimatch@npm:^3.0.5, minimatch@npm:^3.1.1, minimatch@npm:^3.1.2": - version: 3.1.2 - resolution: "minimatch@npm:3.1.2" +"tsutils@npm:^3.21.0": + version: 3.21.0 + resolution: "tsutils@npm:3.21.0" dependencies: - brace-expansion: ^1.1.7 - checksum: c154e566406683e7bcb746e000b84d74465b3a832c45d59912b9b55cd50dee66e5c4b1e5566dba26154040e51672f9aa450a9aef0c97cfc7336b78b7afb9540a + tslib: ^1.8.1 + peerDependencies: + typescript: ">=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta" + checksum: 1843f4c1b2e0f975e08c4c21caa4af4f7f65a12ac1b81b3b8489366826259323feb3fc7a243123453d2d1a02314205a7634e048d4a8009921da19f99755cdc48 languageName: node linkType: hard -"ms@npm:2.1.2": - version: 2.1.2 - resolution: "ms@npm:2.1.2" - checksum: 673cdb2c3133eb050c745908d8ce632ed2c02d85640e2edb3ace856a2266a813b30c613569bf3354fdf4ea7d1a1494add3bfa95e2713baa27d0c2c71fc44f58f +"type-check@npm:^0.4.0, type-check@npm:~0.4.0": + version: 0.4.0 + resolution: "type-check@npm:0.4.0" + dependencies: + prelude-ls: ^1.2.1 + checksum: ec688ebfc9c45d0c30412e41ca9c0cdbd704580eb3a9ccf07b9b576094d7b86a012baebc95681999dd38f4f444afd28504cb3a89f2ef16b31d4ab61a0739025a languageName: node linkType: hard -"natural-compare@npm:^1.4.0": - version: 1.4.0 - resolution: "natural-compare@npm:1.4.0" - checksum: 23ad088b08f898fc9b53011d7bb78ec48e79de7627e01ab5518e806033861bef68d5b0cd0e2205c2f36690ac9571ff6bcb05eb777ced2eeda8d4ac5b44592c3d +"type-fest@npm:^0.20.2": + version: 0.20.2 + resolution: "type-fest@npm:0.20.2" + checksum: 4fb3272df21ad1c552486f8a2f8e115c09a521ad7a8db3d56d53718d0c907b62c6e9141ba5f584af3f6830d0872c521357e512381f24f7c44acae583ad517d73 languageName: node linkType: hard -"once@npm:^1.3.0": - version: 1.4.0 - resolution: "once@npm:1.4.0" - dependencies: - wrappy: 1 - checksum: cd0a88501333edd640d95f0d2700fbde6bff20b3d4d9bdc521bdd31af0656b5706570d6c6afe532045a20bb8dc0849f8332d6f2a416e0ba6d3d3b98806c7db68 +"typescript@npm:^5.1.3": + version: 5.2.2 + resolution: "typescript@npm:5.2.2" + bin: + tsc: bin/tsc + tsserver: bin/tsserver + checksum: 7912821dac4d962d315c36800fe387cdc0a6298dba7ec171b350b4a6e988b51d7b8f051317786db1094bd7431d526b648aba7da8236607febb26cf5b871d2d3c languageName: node linkType: hard -"optionator@npm:^0.9.3": - version: 0.9.3 - resolution: "optionator@npm:0.9.3" - dependencies: - "@aashutoshrathi/word-wrap": ^1.2.3 - deep-is: ^0.1.3 - fast-levenshtein: ^2.0.6 - levn: ^0.4.1 - prelude-ls: ^1.2.1 - type-check: ^0.4.0 - checksum: 09281999441f2fe9c33a5eeab76700795365a061563d66b098923eb719251a42bdbe432790d35064d0816ead9296dbeb1ad51a733edf4167c96bd5d0882e428a +"typescript@patch:typescript@^5.1.3#~builtin": + version: 5.2.2 + resolution: "typescript@patch:typescript@npm%3A5.2.2#~builtin::version=5.2.2&hash=14eedb" + bin: + tsc: bin/tsc + tsserver: bin/tsserver + checksum: 07106822b4305de3f22835cbba949a2b35451cad50888759b6818421290ff95d522b38ef7919e70fb381c5fe9c1c643d7dea22c8b31652a717ddbd57b7f4d554 languageName: node linkType: hard -"osmium@workspace:.": - version: 0.0.0-use.local - resolution: "osmium@workspace:." +"unique-filename@npm:^3.0.0": + version: 3.0.0 + resolution: "unique-filename@npm:3.0.0" dependencies: - husky: ^8.0.0 - languageName: unknown - linkType: soft + unique-slug: ^4.0.0 + checksum: 8e2f59b356cb2e54aab14ff98a51ac6c45781d15ceaab6d4f1c2228b780193dc70fae4463ce9e1df4479cb9d3304d7c2043a3fb905bdeca71cc7e8ce27e063df + languageName: node + linkType: hard -"p-limit@npm:^3.0.2": - version: 3.1.0 - resolution: "p-limit@npm:3.1.0" +"unique-slug@npm:^4.0.0": + version: 4.0.0 + resolution: "unique-slug@npm:4.0.0" dependencies: - yocto-queue: ^0.1.0 - checksum: 7c3690c4dbf62ef625671e20b7bdf1cbc9534e83352a2780f165b0d3ceba21907e77ad63401708145ca4e25bfc51636588d89a8c0aeb715e6c37d1c066430360 + imurmurhash: ^0.1.4 + checksum: 0884b58365af59f89739e6f71e3feacb5b1b41f2df2d842d0757933620e6de08eff347d27e9d499b43c40476cbaf7988638d3acb2ffbcb9d35fd035591adfd15 languageName: node linkType: hard -"p-locate@npm:^5.0.0": - version: 5.0.0 - resolution: "p-locate@npm:5.0.0" +"update-browserslist-db@npm:^1.0.11": + version: 1.0.11 + resolution: "update-browserslist-db@npm:1.0.11" dependencies: - p-limit: ^3.0.2 - checksum: 1623088f36cf1cbca58e9b61c4e62bf0c60a07af5ae1ca99a720837356b5b6c5ba3eb1b2127e47a06865fee59dd0453cad7cc844cda9d5a62ac1a5a51b7c86d3 + escalade: ^3.1.1 + picocolors: ^1.0.0 + peerDependencies: + browserslist: ">= 4.21.0" + bin: + update-browserslist-db: cli.js + checksum: b98327518f9a345c7cad5437afae4d2ae7d865f9779554baf2a200fdf4bac4969076b679b1115434bd6557376bdd37ca7583d0f9b8f8e302d7d4cc1e91b5f231 languageName: node linkType: hard -"parent-module@npm:^1.0.0": - version: 1.0.1 - resolution: "parent-module@npm:1.0.1" +"uri-js@npm:^4.2.2": + version: 4.4.1 + resolution: "uri-js@npm:4.4.1" dependencies: - callsites: ^3.0.0 - checksum: 6ba8b255145cae9470cf5551eb74be2d22281587af787a2626683a6c20fbb464978784661478dd2a3f1dad74d1e802d403e1b03c1a31fab310259eec8ac560ff + punycode: ^2.1.0 + checksum: 7167432de6817fe8e9e0c9684f1d2de2bb688c94388f7569f7dbdb1587c9f4ca2a77962f134ec90be0cc4d004c939ff0d05acc9f34a0db39a3c797dada262633 languageName: node linkType: hard -"path-exists@npm:^4.0.0": - version: 4.0.0 - resolution: "path-exists@npm:4.0.0" - checksum: 505807199dfb7c50737b057dd8d351b82c033029ab94cb10a657609e00c1bc53b951cfdbccab8de04c5584d5eff31128ce6afd3db79281874a5ef2adbba55ed1 +"util-deprecate@npm:^1.0.1, util-deprecate@npm:~1.0.1": + version: 1.0.2 + resolution: "util-deprecate@npm:1.0.2" + checksum: 474acf1146cb2701fe3b074892217553dfcf9a031280919ba1b8d651a068c9b15d863b7303cb15bd00a862b498e6cf4ad7b4a08fb134edd5a6f7641681cb54a2 languageName: node linkType: hard -"path-is-absolute@npm:^1.0.0": - version: 1.0.1 - resolution: "path-is-absolute@npm:1.0.1" - checksum: 060840f92cf8effa293bcc1bea81281bd7d363731d214cbe5c227df207c34cd727430f70c6037b5159c8a870b9157cba65e775446b0ab06fd5ecc7e54615a3b8 +"vscode-jsonrpc@npm:8.1.0": + version: 8.1.0 + resolution: "vscode-jsonrpc@npm:8.1.0" + checksum: 8980037cc0014802e6ac1e5dfcff9a65e8292727096dfd23c92d2039c0c45de74a00d6ee06938cf1a671286dd8258a5f418cf048c26ad0fcb0c44f96c9e0f278 languageName: node linkType: hard -"path-key@npm:^3.1.0": - version: 3.1.1 - resolution: "path-key@npm:3.1.1" - checksum: 55cd7a9dd4b343412a8386a743f9c746ef196e57c823d90ca3ab917f90ab9f13dd0ded27252ba49dbdfcab2b091d998bc446f6220cd3cea65db407502a740020 +"vscode-languageclient@npm:^8.1.0": + version: 8.1.0 + resolution: "vscode-languageclient@npm:8.1.0" + dependencies: + minimatch: ^5.1.0 + semver: ^7.3.7 + vscode-languageserver-protocol: 3.17.3 + checksum: b9d46aa256188dae19dcc5adb502be7193564b3313cbf20f99f83730ffbbf88cec40a08c4cafdc005b65c6385544c9f316de9b152067ab263221383326f00f95 languageName: node linkType: hard -"prelude-ls@npm:^1.2.1": - version: 1.2.1 - resolution: "prelude-ls@npm:1.2.1" - checksum: cd192ec0d0a8e4c6da3bb80e4f62afe336df3f76271ac6deb0e6a36187133b6073a19e9727a1ff108cd8b9982e4768850d413baa71214dd80c7979617dca827a +"vscode-languageserver-protocol@npm:3.17.3": + version: 3.17.3 + resolution: "vscode-languageserver-protocol@npm:3.17.3" + dependencies: + vscode-jsonrpc: 8.1.0 + vscode-languageserver-types: 3.17.3 + checksum: ffea508b2efd7f4853f1cef5e5eac58672f0ae71a9ec275ad37a4a2a24cdc3ff023f941e759951aee01c79da3f3279f10e034f19d875f081eb387181241bd836 languageName: node linkType: hard -"prettier@npm:^3.0.0": - version: 3.0.0 - resolution: "prettier@npm:3.0.0" - bin: - prettier: bin/prettier.cjs - checksum: 6a832876a1552dc58330d2467874e5a0b46b9ccbfc5d3531eb69d15684743e7f83dc9fbd202db6270446deba9c82b79d24383d09924c462b457136a759425e33 +"vscode-languageserver-types@npm:3.17.3": + version: 3.17.3 + resolution: "vscode-languageserver-types@npm:3.17.3" + checksum: fbc8221297261f659a6482875ff2a419dc9d55965dc53745797da569ff9f819cd832e6f2699017baadd946548bbfe212e3f6971f3d960f12dc0ee9c629dacc07 languageName: node linkType: hard -"punycode@npm:^2.1.0": - version: 2.3.0 - resolution: "punycode@npm:2.3.0" - checksum: 39f760e09a2a3bbfe8f5287cf733ecdad69d6af2fe6f97ca95f24b8921858b91e9ea3c9eeec6e08cede96181b3bb33f95c6ffd8c77e63986508aa2e8159fa200 +"watchpack@npm:^2.4.0": + version: 2.4.0 + resolution: "watchpack@npm:2.4.0" + dependencies: + glob-to-regexp: ^0.4.1 + graceful-fs: ^4.1.2 + checksum: 23d4bc58634dbe13b86093e01c6a68d8096028b664ab7139d58f0c37d962d549a940e98f2f201cecdabd6f9c340338dc73ef8bf094a2249ef582f35183d1a131 languageName: node linkType: hard -"queue-microtask@npm:^1.2.2": - version: 1.2.3 - resolution: "queue-microtask@npm:1.2.3" - checksum: b676f8c040cdc5b12723ad2f91414d267605b26419d5c821ff03befa817ddd10e238d22b25d604920340fd73efd8ba795465a0377c4adf45a4a41e4234e42dc4 +"webpack-cli@npm:^5.1.1": + version: 5.1.4 + resolution: "webpack-cli@npm:5.1.4" + dependencies: + "@discoveryjs/json-ext": ^0.5.0 + "@webpack-cli/configtest": ^2.1.1 + "@webpack-cli/info": ^2.0.2 + "@webpack-cli/serve": ^2.0.5 + colorette: ^2.0.14 + commander: ^10.0.1 + cross-spawn: ^7.0.3 + envinfo: ^7.7.3 + fastest-levenshtein: ^1.0.12 + import-local: ^3.0.2 + interpret: ^3.1.1 + rechoir: ^0.8.0 + webpack-merge: ^5.7.3 + peerDependencies: + webpack: 5.x.x + peerDependenciesMeta: + "@webpack-cli/generators": + optional: true + webpack-bundle-analyzer: + optional: true + webpack-dev-server: + optional: true + bin: + webpack-cli: bin/cli.js + checksum: 3a4ad0d0342a6815c850ee4633cc2a8a5dae04f918e7847f180bf24ab400803cf8a8943707ffbed03eb20fe6ce647f996f60a2aade87b0b4a9954da3da172ce0 languageName: node linkType: hard -"resolve-from@npm:^4.0.0": - version: 4.0.0 - resolution: "resolve-from@npm:4.0.0" - checksum: f4ba0b8494846a5066328ad33ef8ac173801a51739eb4d63408c847da9a2e1c1de1e6cbbf72699211f3d13f8fc1325648b169bd15eb7da35688e30a5fb0e4a7f +"webpack-merge@npm:^5.7.3": + version: 5.9.0 + resolution: "webpack-merge@npm:5.9.0" + dependencies: + clone-deep: ^4.0.1 + wildcard: ^2.0.0 + checksum: 64fe2c23aacc5f19684452a0e84ec02c46b990423aee6fcc5c18d7d471155bd14e9a6adb02bd3656eb3e0ac2532c8e97d69412ad14c97eeafe32fa6d10050872 languageName: node linkType: hard -"reusify@npm:^1.0.4": - version: 1.0.4 - resolution: "reusify@npm:1.0.4" - checksum: c3076ebcc22a6bc252cb0b9c77561795256c22b757f40c0d8110b1300723f15ec0fc8685e8d4ea6d7666f36c79ccc793b1939c748bf36f18f542744a4e379fcc +"webpack-sources@npm:^3.2.3": + version: 3.2.3 + resolution: "webpack-sources@npm:3.2.3" + checksum: 989e401b9fe3536529e2a99dac8c1bdc50e3a0a2c8669cbafad31271eadd994bc9405f88a3039cd2e29db5e6d9d0926ceb7a1a4e7409ece021fe79c37d9c4607 languageName: node linkType: hard -"rimraf@npm:^3.0.2": - version: 3.0.2 - resolution: "rimraf@npm:3.0.2" +"webpack@npm:^5.85.0": + version: 5.88.2 + resolution: "webpack@npm:5.88.2" dependencies: - glob: ^7.1.3 + "@types/eslint-scope": ^3.7.3 + "@types/estree": ^1.0.0 + "@webassemblyjs/ast": ^1.11.5 + "@webassemblyjs/wasm-edit": ^1.11.5 + "@webassemblyjs/wasm-parser": ^1.11.5 + acorn: ^8.7.1 + acorn-import-assertions: ^1.9.0 + browserslist: ^4.14.5 + chrome-trace-event: ^1.0.2 + enhanced-resolve: ^5.15.0 + es-module-lexer: ^1.2.1 + eslint-scope: 5.1.1 + events: ^3.2.0 + glob-to-regexp: ^0.4.1 + graceful-fs: ^4.2.9 + json-parse-even-better-errors: ^2.3.1 + loader-runner: ^4.2.0 + mime-types: ^2.1.27 + neo-async: ^2.6.2 + schema-utils: ^3.2.0 + tapable: ^2.1.1 + terser-webpack-plugin: ^5.3.7 + watchpack: ^2.4.0 + webpack-sources: ^3.2.3 + peerDependenciesMeta: + webpack-cli: + optional: true bin: - rimraf: bin.js - checksum: 87f4164e396f0171b0a3386cc1877a817f572148ee13a7e113b238e48e8a9f2f31d009a92ec38a591ff1567d9662c6b67fd8818a2dbbaed74bc26a87a2a4a9a0 + webpack: bin/webpack.js + checksum: 79476a782da31a21f6dd38fbbd06b68da93baf6a62f0d08ca99222367f3b8668f5a1f2086b7bb78e23172e31fa6df6fa7ab09b25e827866c4fc4dc2b30443ce2 languageName: node linkType: hard -"run-parallel@npm:^1.1.9": - version: 1.2.0 - resolution: "run-parallel@npm:1.2.0" +"which@npm:^2.0.1, which@npm:^2.0.2": + version: 2.0.2 + resolution: "which@npm:2.0.2" dependencies: - queue-microtask: ^1.2.2 - checksum: cb4f97ad25a75ebc11a8ef4e33bb962f8af8516bb2001082ceabd8902e15b98f4b84b4f8a9b222e5d57fc3bd1379c483886ed4619367a7680dad65316993021d + isexe: ^2.0.0 + bin: + node-which: ./bin/node-which + checksum: 1a5c563d3c1b52d5f893c8b61afe11abc3bab4afac492e8da5bde69d550de701cf9806235f20a47b5c8fa8a1d6a9135841de2596535e998027a54589000e66d1 languageName: node linkType: hard -"shebang-command@npm:^2.0.0": - version: 2.0.0 - resolution: "shebang-command@npm:2.0.0" +"wide-align@npm:^1.1.5": + version: 1.1.5 + resolution: "wide-align@npm:1.1.5" dependencies: - shebang-regex: ^3.0.0 - checksum: 6b52fe87271c12968f6a054e60f6bde5f0f3d2db483a1e5c3e12d657c488a15474121a1d55cd958f6df026a54374ec38a4a963988c213b7570e1d51575cea7fa + string-width: ^1.0.2 || 2 || 3 || 4 + checksum: d5fc37cd561f9daee3c80e03b92ed3e84d80dde3365a8767263d03dacfc8fa06b065ffe1df00d8c2a09f731482fcacae745abfbb478d4af36d0a891fad4834d3 languageName: node linkType: hard -"shebang-regex@npm:^3.0.0": - version: 3.0.0 - resolution: "shebang-regex@npm:3.0.0" - checksum: 1a2bcae50de99034fcd92ad4212d8e01eedf52c7ec7830eedcf886622804fe36884278f2be8be0ea5fde3fd1c23911643a4e0f726c8685b61871c8908af01222 +"wildcard@npm:^2.0.0": + version: 2.0.1 + resolution: "wildcard@npm:2.0.1" + checksum: e0c60a12a219e4b12065d1199802d81c27b841ed6ad6d9d28240980c73ceec6f856771d575af367cbec2982d9ae7838759168b551776577f155044f5a5ba843c languageName: node linkType: hard -"strip-ansi@npm:^6.0.1": - version: 6.0.1 - resolution: "strip-ansi@npm:6.0.1" - dependencies: - ansi-regex: ^5.0.1 - checksum: f3cd25890aef3ba6e1a74e20896c21a46f482e93df4a06567cebf2b57edabb15133f1f94e57434e0a958d61186087b1008e89c94875d019910a213181a14fc8c +"workerpool@npm:6.2.1": + version: 6.2.1 + resolution: "workerpool@npm:6.2.1" + checksum: c2c6eebbc5225f10f758d599a5c016fa04798bcc44e4c1dffb34050cd361d7be2e97891aa44419e7afe647b1f767b1dc0b85a5e046c409d890163f655028b09d languageName: node linkType: hard -"strip-json-comments@npm:^3.1.1": - version: 3.1.1 - resolution: "strip-json-comments@npm:3.1.1" - checksum: 492f73e27268f9b1c122733f28ecb0e7e8d8a531a6662efbd08e22cccb3f9475e90a1b82cab06a392f6afae6d2de636f977e231296400d0ec5304ba70f166443 +"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0, wrap-ansi@npm:^7.0.0": + version: 7.0.0 + resolution: "wrap-ansi@npm:7.0.0" + dependencies: + ansi-styles: ^4.0.0 + string-width: ^4.1.0 + strip-ansi: ^6.0.0 + checksum: a790b846fd4505de962ba728a21aaeda189b8ee1c7568ca5e817d85930e06ef8d1689d49dbf0e881e8ef84436af3a88bc49115c2e2788d841ff1b8b5b51a608b languageName: node linkType: hard -"supports-color@npm:^7.1.0": - version: 7.2.0 - resolution: "supports-color@npm:7.2.0" +"wrap-ansi@npm:^8.1.0": + version: 8.1.0 + resolution: "wrap-ansi@npm:8.1.0" dependencies: - has-flag: ^4.0.0 - checksum: 3dda818de06ebbe5b9653e07842d9479f3555ebc77e9a0280caf5a14fb877ffee9ed57007c3b78f5a6324b8dbeec648d9e97a24e2ed9fdb81ddc69ea07100f4a + ansi-styles: ^6.1.0 + string-width: ^5.0.1 + strip-ansi: ^7.0.1 + checksum: 371733296dc2d616900ce15a0049dca0ef67597d6394c57347ba334393599e800bab03c41d4d45221b6bc967b8c453ec3ae4749eff3894202d16800fdfe0e238 languageName: node linkType: hard -"text-table@npm:^0.2.0": - version: 0.2.0 - resolution: "text-table@npm:0.2.0" - checksum: b6937a38c80c7f84d9c11dd75e49d5c44f71d95e810a3250bd1f1797fc7117c57698204adf676b71497acc205d769d65c16ae8fa10afad832ae1322630aef10a +"wrappy@npm:1": + version: 1.0.2 + resolution: "wrappy@npm:1.0.2" + checksum: 159da4805f7e84a3d003d8841557196034155008f817172d4e986bd591f74aa82aa7db55929a54222309e01079a65a92a9e6414da5a6aa4b01ee44a511ac3ee5 languageName: node linkType: hard -"type-check@npm:^0.4.0, type-check@npm:~0.4.0": - version: 0.4.0 - resolution: "type-check@npm:0.4.0" - dependencies: - prelude-ls: ^1.2.1 - checksum: ec688ebfc9c45d0c30412e41ca9c0cdbd704580eb3a9ccf07b9b576094d7b86a012baebc95681999dd38f4f444afd28504cb3a89f2ef16b31d4ab61a0739025a +"y18n@npm:^5.0.5": + version: 5.0.8 + resolution: "y18n@npm:5.0.8" + checksum: 54f0fb95621ee60898a38c572c515659e51cc9d9f787fb109cef6fde4befbe1c4602dc999d30110feee37456ad0f1660fa2edcfde6a9a740f86a290999550d30 languageName: node linkType: hard -"type-fest@npm:^0.20.2": - version: 0.20.2 - resolution: "type-fest@npm:0.20.2" - checksum: 4fb3272df21ad1c552486f8a2f8e115c09a521ad7a8db3d56d53718d0c907b62c6e9141ba5f584af3f6830d0872c521357e512381f24f7c44acae583ad517d73 +"yallist@npm:^4.0.0": + version: 4.0.0 + resolution: "yallist@npm:4.0.0" + checksum: 343617202af32df2a15a3be36a5a8c0c8545208f3d3dfbc6bb7c3e3b7e8c6f8e7485432e4f3b88da3031a6e20afa7c711eded32ddfb122896ac5d914e75848d5 languageName: node linkType: hard -"uri-js@npm:^4.2.2": - version: 4.4.1 - resolution: "uri-js@npm:4.4.1" - dependencies: - punycode: ^2.1.0 - checksum: 7167432de6817fe8e9e0c9684f1d2de2bb688c94388f7569f7dbdb1587c9f4ca2a77962f134ec90be0cc4d004c939ff0d05acc9f34a0db39a3c797dada262633 +"yargs-parser@npm:20.2.4": + version: 20.2.4 + resolution: "yargs-parser@npm:20.2.4" + checksum: d251998a374b2743a20271c2fd752b9fbef24eb881d53a3b99a7caa5e8227fcafd9abf1f345ac5de46435821be25ec12189a11030c12ee6481fef6863ed8b924 languageName: node linkType: hard -"which@npm:^2.0.1": - version: 2.0.2 - resolution: "which@npm:2.0.2" +"yargs-parser@npm:^20.2.2": + version: 20.2.9 + resolution: "yargs-parser@npm:20.2.9" + checksum: 8bb69015f2b0ff9e17b2c8e6bfe224ab463dd00ca211eece72a4cd8a906224d2703fb8a326d36fdd0e68701e201b2a60ed7cf81ce0fd9b3799f9fe7745977ae3 + languageName: node + linkType: hard + +"yargs-unparser@npm:2.0.0": + version: 2.0.0 + resolution: "yargs-unparser@npm:2.0.0" dependencies: - isexe: ^2.0.0 - bin: - node-which: ./bin/node-which - checksum: 1a5c563d3c1b52d5f893c8b61afe11abc3bab4afac492e8da5bde69d550de701cf9806235f20a47b5c8fa8a1d6a9135841de2596535e998027a54589000e66d1 + camelcase: ^6.0.0 + decamelize: ^4.0.0 + flat: ^5.0.2 + is-plain-obj: ^2.1.0 + checksum: 68f9a542c6927c3768c2f16c28f71b19008710abd6b8f8efbac6dcce26bbb68ab6503bed1d5994bdbc2df9a5c87c161110c1dfe04c6a3fe5c6ad1b0e15d9a8a3 languageName: node linkType: hard -"wrappy@npm:1": - version: 1.0.2 - resolution: "wrappy@npm:1.0.2" - checksum: 159da4805f7e84a3d003d8841557196034155008f817172d4e986bd591f74aa82aa7db55929a54222309e01079a65a92a9e6414da5a6aa4b01ee44a511ac3ee5 +"yargs@npm:16.2.0": + version: 16.2.0 + resolution: "yargs@npm:16.2.0" + dependencies: + cliui: ^7.0.2 + escalade: ^3.1.1 + get-caller-file: ^2.0.5 + require-directory: ^2.1.1 + string-width: ^4.2.0 + y18n: ^5.0.5 + yargs-parser: ^20.2.2 + checksum: b14afbb51e3251a204d81937c86a7e9d4bdbf9a2bcee38226c900d00f522969ab675703bee2a6f99f8e20103f608382936034e64d921b74df82b63c07c5e8f59 languageName: node linkType: hard From 18cbb1ee4b3bb0b575a04b5878b14bc7e3113285 Mon Sep 17 00:00:00 2001 From: 0xMemoryGrinder <35138272+0xMemoryGrinder@users.noreply.github.com> Date: Thu, 21 Sep 2023 22:54:51 -0400 Subject: [PATCH 094/325] refactor(solidity/linter/core): made a separate library to switch to lsp-server as tower lsp isn't compatible with alloy --- libs/lsp-server-wrapper/.gitignore | 2 + libs/lsp-server-wrapper/Cargo.lock | 276 ++++ libs/lsp-server-wrapper/Cargo.toml | 13 + libs/lsp-server-wrapper/src/client.rs | 516 +++++++ libs/lsp-server-wrapper/src/jsonrpc.rs | 4 + libs/lsp-server-wrapper/src/jsonrpc/error.rs | 217 +++ libs/lsp-server-wrapper/src/lib.rs | 1218 +++++++++++++++++ libs/lsp-server-wrapper/src/server.rs | 121 ++ libs/lsp-server-wrapper/src/service.rs | 317 +++++ libs/lsp-server-wrapper/src/service/state.rs | 50 + toolchains/solidity/linter/core/Cargo.lock | 1024 +++----------- toolchains/solidity/linter/core/Cargo.toml | 5 +- .../linter/core/solidhunter-lib/Cargo.toml | 1 + .../linter/core/solidhunter-lib/src/linter.rs | 2 +- .../solidity/linter/core/src/lsp_server.rs | 144 -- toolchains/solidity/linter/core/src/main.rs | 4 +- toolchains/solidity/linter/core/src/server.rs | 135 ++ 17 files changed, 3090 insertions(+), 959 deletions(-) create mode 100644 libs/lsp-server-wrapper/.gitignore create mode 100644 libs/lsp-server-wrapper/Cargo.lock create mode 100644 libs/lsp-server-wrapper/Cargo.toml create mode 100644 libs/lsp-server-wrapper/src/client.rs create mode 100644 libs/lsp-server-wrapper/src/jsonrpc.rs create mode 100644 libs/lsp-server-wrapper/src/jsonrpc/error.rs create mode 100644 libs/lsp-server-wrapper/src/lib.rs create mode 100644 libs/lsp-server-wrapper/src/server.rs create mode 100644 libs/lsp-server-wrapper/src/service.rs create mode 100644 libs/lsp-server-wrapper/src/service/state.rs delete mode 100644 toolchains/solidity/linter/core/src/lsp_server.rs create mode 100644 toolchains/solidity/linter/core/src/server.rs diff --git a/libs/lsp-server-wrapper/.gitignore b/libs/lsp-server-wrapper/.gitignore new file mode 100644 index 00000000..ec376bb8 --- /dev/null +++ b/libs/lsp-server-wrapper/.gitignore @@ -0,0 +1,2 @@ +.idea +target \ No newline at end of file diff --git a/libs/lsp-server-wrapper/Cargo.lock b/libs/lsp-server-wrapper/Cargo.lock new file mode 100644 index 00000000..66c43c57 --- /dev/null +++ b/libs/lsp-server-wrapper/Cargo.lock @@ -0,0 +1,276 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "bitflags" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "crossbeam-channel" +version = "0.5.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a33c2bf77f2df06183c3aa30d1e96c0695a313d4f9c453cc3762a6db39f99200" +dependencies = [ + "cfg-if", + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-utils" +version = "0.8.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a22b2d63d4d1dc0b7f1b6b2747dd0088008a9be28b6ddf0b1e7d335e3037294" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "form_urlencoded" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a62bc1cf6f830c2ec14a513a9fb124d0a213a629668a4186f329db21fe045652" +dependencies = [ + "percent-encoding", +] + +[[package]] +name = "idna" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7d20d6b07bfbc108882d88ed8e37d39636dcc260e15e30c45e6ba089610b917c" +dependencies = [ + "unicode-bidi", + "unicode-normalization", +] + +[[package]] +name = "itoa" +version = "1.0.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "af150ab688ff2122fcef229be89cb50dd66af9e01a4ff320cc137eecc9bacc38" + +[[package]] +name = "log" +version = "0.4.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" + +[[package]] +name = "lsp-server" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b52dccdf3302eefab8c8a1273047f0a3c3dca4b527c8458d00c09484c8371928" +dependencies = [ + "crossbeam-channel", + "log", + "serde", + "serde_json", +] + +[[package]] +name = "lsp-server-wrapper" +version = "0.1.0" +dependencies = [ + "lsp-server", + "lsp-types", + "serde", + "serde_json", + "tracing", +] + +[[package]] +name = "lsp-types" +version = "0.94.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c66bfd44a06ae10647fe3f8214762e9369fd4248df1350924b4ef9e770a85ea1" +dependencies = [ + "bitflags", + "serde", + "serde_json", + "serde_repr", + "url", +] + +[[package]] +name = "once_cell" +version = "1.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d" + +[[package]] +name = "percent-encoding" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b2a4787296e9989611394c33f193f676704af1686e70b8f8033ab5ba9a35a94" + +[[package]] +name = "pin-project-lite" +version = "0.2.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8afb450f006bf6385ca15ef45d71d2288452bc3683ce2e2cacc0d18e4be60b58" + +[[package]] +name = "proc-macro2" +version = "1.0.67" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d433d9f1a3e8c1263d9456598b16fec66f4acc9a74dacffd35c7bb09b3a1328" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quote" +version = "1.0.33" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "ryu" +version = "1.0.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ad4cc8da4ef723ed60bced201181d83791ad433213d8c24efffda1eec85d741" + +[[package]] +name = "serde" +version = "1.0.188" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf9e0fcba69a370eed61bcf2b728575f726b50b55cba78064753d708ddc7549e" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.188" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4eca7ac642d82aa35b60049a6eccb4be6be75e599bd2e9adb5f875a737654af2" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "serde_json" +version = "1.0.107" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6b420ce6e3d8bd882e9b243c6eed35dbc9a6110c9769e74b584e0d68d1f20c65" +dependencies = [ + "itoa", + "ryu", + "serde", +] + +[[package]] +name = "serde_repr" +version = "0.1.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8725e1dfadb3a50f7e5ce0b1a540466f6ed3fe7a0fca2ac2b8b831d31316bd00" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "syn" +version = "2.0.37" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7303ef2c05cd654186cb250d29049a24840ca25d2747c25c0381c8d9e2f582e8" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "tinyvec" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" +dependencies = [ + "tinyvec_macros", +] + +[[package]] +name = "tinyvec_macros" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" + +[[package]] +name = "tracing" +version = "0.1.37" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ce8c33a8d48bd45d624a6e523445fd21ec13d3653cd51f681abf67418f54eb8" +dependencies = [ + "cfg-if", + "pin-project-lite", + "tracing-attributes", + "tracing-core", +] + +[[package]] +name = "tracing-attributes" +version = "0.1.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f4f31f56159e98206da9efd823404b79b6ef3143b4a7ab76e67b1751b25a4ab" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "tracing-core" +version = "0.1.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0955b8137a1df6f1a2e9a37d8a6656291ff0297c1a97c24e0d8425fe2312f79a" +dependencies = [ + "once_cell", +] + +[[package]] +name = "unicode-bidi" +version = "0.3.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92888ba5573ff080736b3648696b70cafad7d250551175acbaa4e0385b3e1460" + +[[package]] +name = "unicode-ident" +version = "1.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" + +[[package]] +name = "unicode-normalization" +version = "0.1.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c5713f0fc4b5db668a2ac63cdb7bb4469d8c9fed047b1d0292cc7b0ce2ba921" +dependencies = [ + "tinyvec", +] + +[[package]] +name = "url" +version = "2.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "143b538f18257fac9cad154828a57c6bf5157e1aa604d4816b5995bf6de87ae5" +dependencies = [ + "form_urlencoded", + "idna", + "percent-encoding", + "serde", +] diff --git a/libs/lsp-server-wrapper/Cargo.toml b/libs/lsp-server-wrapper/Cargo.toml new file mode 100644 index 00000000..85da3bb8 --- /dev/null +++ b/libs/lsp-server-wrapper/Cargo.toml @@ -0,0 +1,13 @@ +[package] +name = "lsp-server-wrapper" +version = "0.1.0" +edition = "2021" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] +lsp-server = "0.7.4" +lsp-types = "0.94.1" +serde = "1.0.188" +serde_json = "1.0.107" +tracing = "0.1.37" diff --git a/libs/lsp-server-wrapper/src/client.rs b/libs/lsp-server-wrapper/src/client.rs new file mode 100644 index 00000000..20fe4aa9 --- /dev/null +++ b/libs/lsp-server-wrapper/src/client.rs @@ -0,0 +1,516 @@ +use std::cell::RefCell; +use lsp_types::notification::*; +use lsp_types::request::*; +use lsp_types::*; +use crate::jsonrpc::{self,}; +use std::fmt::Display; +use std::rc::Weak; +use lsp_server::{Message, RequestId}; +use serde::Serialize; +use serde_json::Value; +use tracing::error; + +use crate::server::LspServer; + +#[derive(Clone)] + pub(crate) struct ClientInner { + server: Option>, + id: RefCell, +} + +/// Handle for communicating with the language client. +/// +/// This type provides a very cheap implementation of [`Clone`] so API consumers can cheaply clone +/// and pass it around as needed. +/// +/// It also implements [`tower::Service`] in order to remain independent from the underlying +/// transport and to facilitate further abstraction with middleware. +#[derive(Clone)] +pub struct Client { + inner: ClientInner, +} + +impl Client { + pub(super) fn new() -> Self { + Client { + inner: ClientInner { + server: None, + id: RefCell::new(0), + }, + } + } + + pub(super) fn set_server(&mut self, server: Weak) { + self.inner.server = Some(server); + } +} + +impl Client { + // Lifecycle Messages + + /// Registers a new capability with the client. + /// + /// This corresponds to the [`client/registerCapability`] request. + /// + /// [`client/registerCapability`]: https://microsoft.github.io/language-server-protocol/specification#client_registerCapability + /// + /// # Initialization + /// + /// If the request is sent to the client before the server has been initialized, this will + /// immediately return `Err` with JSON-RPC error code `-32002` ([read more]). + /// + /// [read more]: https://microsoft.github.io/language-server-protocol/specification#initialize + pub fn register_capability( + &self, + registrations: Vec, + ) -> jsonrpc::Result<()> { + self.send_request::(RegistrationParams { registrations }) + } + + /// Unregisters a capability with the client. + /// + /// This corresponds to the [`client/unregisterCapability`] request. + /// + /// [`client/unregisterCapability`]: https://microsoft.github.io/language-server-protocol/specification#client_unregisterCapability + /// + /// # Initialization + /// + /// If the request is sent to the client before the server has been initialized, this will + /// immediately return `Err` with JSON-RPC error code `-32002` ([read more]). + /// + /// [read more]: https://microsoft.github.io/language-server-protocol/specification#initialize + pub fn unregister_capability( + &self, + unregisterations: Vec, + ) -> jsonrpc::Result<()> { + self.send_request::(UnregistrationParams { unregisterations }) + } + + // Window Features + + /// Notifies the client to display a particular message in the user interface. + /// + /// This corresponds to the [`window/showMessage`] notification. + /// + /// [`window/showMessage`]: https://microsoft.github.io/language-server-protocol/specification#window_showMessage + pub fn show_message(&self, typ: MessageType, message: M) { + self.send_notification_unchecked::(ShowMessageParams { + typ, + message: message.to_string(), + }); + } + + /// Requests the client to display a particular message in the user interface. + /// + /// Unlike the `show_message` notification, this request can also pass a list of actions and + /// wait for an answer from the client. + /// + /// This corresponds to the [`window/showMessageRequest`] request. + /// + /// [`window/showMessageRequest`]: https://microsoft.github.io/language-server-protocol/specification#window_showMessageRequest + pub fn show_message_request( + &self, + typ: MessageType, + message: M, + actions: Option>, + ) -> jsonrpc::Result> { + self.send_request_unchecked::(ShowMessageRequestParams { + typ, + message: message.to_string(), + actions, + }) + } + + /// Notifies the client to log a particular message. + /// + /// This corresponds to the [`window/logMessage`] notification. + /// + /// [`window/logMessage`]: https://microsoft.github.io/language-server-protocol/specification#window_logMessage + pub fn log_message(&self, typ: MessageType, message: M) { + self.send_notification_unchecked::(LogMessageParams { + typ, + message: message.to_string(), + }); + } + + /// Asks the client to display a particular resource referenced by a URI in the user interface. + /// + /// Returns `Ok(true)` if the document was successfully shown, or `Ok(false)` otherwise. + /// + /// This corresponds to the [`window/showDocument`] request. + /// + /// [`window/showDocument`]: https://microsoft.github.io/language-server-protocol/specification#window_showDocument + /// + /// # Initialization + /// + /// If the request is sent to the client before the server has been initialized, this will + /// immediately return `Err` with JSON-RPC error code `-32002` ([read more]). + /// + /// [read more]: https://microsoft.github.io/language-server-protocol/specification#initialize + /// + /// # Compatibility + /// + /// This request was introduced in specification version 3.16.0. + pub fn show_document(&self, params: ShowDocumentParams) -> jsonrpc::Result { + let response = self.send_request::(params)?; + Ok(response.success) + } + + // TODO: Add `work_done_progress_create()` here (since 3.15.0) when supported by `tower-lsp`. + // https://github.com/ebkalderon/tower-lsp/issues/176 + + /// Notifies the client to log a telemetry event. + /// + /// This corresponds to the [`telemetry/event`] notification. + /// + /// [`telemetry/event`]: https://microsoft.github.io/language-server-protocol/specification#telemetry_event + pub fn telemetry_event(&self, data: U) { + match serde_json::to_value(data) { + Err(e) => error!("invalid JSON in `telemetry/event` notification: {}", e), + Ok(mut value) => { + if !value.is_null() && !value.is_array() && !value.is_object() { + value = Value::Array(vec![value]); + } + self.send_notification_unchecked::(value); + } + } + } + + /// Asks the client to refresh the code lenses currently shown in editors. As a result, the + /// client should ask the server to recompute the code lenses for these editors. + /// + /// This is useful if a server detects a configuration change which requires a re-calculation + /// of all code lenses. + /// + /// Note that the client still has the freedom to delay the re-calculation of the code lenses + /// if for example an editor is currently not visible. + /// + /// This corresponds to the [`workspace/codeLens/refresh`] request. + /// + /// [`workspace/codeLens/refresh`]: https://microsoft.github.io/language-server-protocol/specification#codeLens_refresh + /// + /// # Initialization + /// + /// If the request is sent to the client before the server has been initialized, this will + /// immediately return `Err` with JSON-RPC error code `-32002` ([read more]). + /// + /// [read more]: https://microsoft.github.io/language-server-protocol/specification#initialize + /// + /// # Compatibility + /// + /// This request was introduced in specification version 3.16.0. + pub fn code_lens_refresh(&self) -> jsonrpc::Result<()> { + self.send_request::(()) + } + + /// Asks the client to refresh the editors for which this server provides semantic tokens. As a + /// result, the client should ask the server to recompute the semantic tokens for these + /// editors. + /// + /// This is useful if a server detects a project-wide configuration change which requires a + /// re-calculation of all semantic tokens. Note that the client still has the freedom to delay + /// the re-calculation of the semantic tokens if for example an editor is currently not visible. + /// + /// This corresponds to the [`workspace/semanticTokens/refresh`] request. + /// + /// [`workspace/semanticTokens/refresh`]: https://microsoft.github.io/language-server-protocol/specification#textDocument_semanticTokens + /// + /// # Initialization + /// + /// If the request is sent to the client before the server has been initialized, this will + /// immediately return `Err` with JSON-RPC error code `-32002` ([read more]). + /// + /// [read more]: https://microsoft.github.io/language-server-protocol/specification#initialize + /// + /// # Compatibility + /// + /// This request was introduced in specification version 3.16.0. + pub fn semantic_tokens_refresh(&self) -> jsonrpc::Result<()> { + self.send_request::(()) + } + + /// Asks the client to refresh the inline values currently shown in editors. As a result, the + /// client should ask the server to recompute the inline values for these editors. + /// + /// This is useful if a server detects a configuration change which requires a re-calculation + /// of all inline values. Note that the client still has the freedom to delay the + /// re-calculation of the inline values if for example an editor is currently not visible. + /// + /// This corresponds to the [`workspace/inlineValue/refresh`] request. + /// + /// [`workspace/inlineValue/refresh`]: https://microsoft.github.io/language-server-protocol/specification#workspace_inlineValue_refresh + /// + /// # Initialization + /// + /// If the request is sent to the client before the server has been initialized, this will + /// immediately return `Err` with JSON-RPC error code `-32002` ([read more]). + /// + /// [read more]: https://microsoft.github.io/language-server-protocol/specification#initialize + /// + /// # Compatibility + /// + /// This request was introduced in specification version 3.17.0. + pub fn inline_value_refresh(&self) -> jsonrpc::Result<()> { + self.send_request::(()) + } + + /// Asks the client to refresh the inlay hints currently shown in editors. As a result, the + /// client should ask the server to recompute the inlay hints for these editors. + /// + /// This is useful if a server detects a configuration change which requires a re-calculation + /// of all inlay hints. Note that the client still has the freedom to delay the re-calculation + /// of the inlay hints if for example an editor is currently not visible. + /// + /// This corresponds to the [`workspace/inlayHint/refresh`] request. + /// + /// [`workspace/inlayHint/refresh`]: https://microsoft.github.io/language-server-protocol/specification#workspace_inlayHint_refresh + /// + /// # Initialization + /// + /// If the request is sent to the client before the server has been initialized, this will + /// immediately return `Err` with JSON-RPC error code `-32002` ([read more]). + /// + /// [read more]: https://microsoft.github.io/language-server-protocol/specification#initialize + /// + /// # Compatibility + /// + /// This request was introduced in specification version 3.17.0. + pub fn inlay_hint_refresh(&self) -> jsonrpc::Result<()> { + self.send_request::(()) + } + + /// Asks the client to refresh all needed document and workspace diagnostics. + /// + /// This is useful if a server detects a project wide configuration change which requires a + /// re-calculation of all diagnostics. + /// + /// This corresponds to the [`workspace/diagnostic/refresh`] request. + /// + /// [`workspace/diagnostic/refresh`]: https://microsoft.github.io/language-server-protocol/specification#diagnostic_refresh + /// + /// # Initialization + /// + /// If the request is sent to the client before the server has been initialized, this will + /// immediately return `Err` with JSON-RPC error code `-32002` ([read more]). + /// + /// [read more]: https://microsoft.github.io/language-server-protocol/specification#initialize + /// + /// # Compatibility + /// + /// This request was introduced in specification version 3.17.0. + pub fn workspace_diagnostic_refresh(&self) -> jsonrpc::Result<()> { + self.send_request::(()) + } + + /// Submits validation diagnostics for an open file with the given URI. + /// + /// This corresponds to the [`textDocument/publishDiagnostics`] notification. + /// + /// [`textDocument/publishDiagnostics`]: https://microsoft.github.io/language-server-protocol/specification#textDocument_publishDiagnostics + /// + /// # Initialization + /// + /// This notification will only be sent if the server is initialized. + pub fn publish_diagnostics( + &self, + uri: Url, + diags: Vec, + version: Option, + ) { + self.send_notification::(PublishDiagnosticsParams::new( + uri, diags, version, + )); + } + + // Workspace Features + + /// Fetches configuration settings from the client. + /// + /// The request can fetch several configuration settings in one roundtrip. The order of the + /// returned configuration settings correspond to the order of the passed + /// [`ConfigurationItem`]s (e.g. the first item in the response is the result for the first + /// configuration item in the params). + /// + /// This corresponds to the [`workspace/configuration`] request. + /// + /// [`workspace/configuration`]: https://microsoft.github.io/language-server-protocol/specification#workspace_configuration + /// + /// # Initialization + /// + /// If the request is sent to the client before the server has been initialized, this will + /// immediately return `Err` with JSON-RPC error code `-32002` ([read more]). + /// + /// [read more]: https://microsoft.github.io/language-server-protocol/specification#initialize + /// + /// # Compatibility + /// + /// This request was introduced in specification version 3.6.0. + pub fn configuration( + &self, + items: Vec, + ) -> jsonrpc::Result> { + self.send_request::(ConfigurationParams { items }) + } + + /// Fetches the current open list of workspace folders. + /// + /// Returns `None` if only a single file is open in the tool. Returns an empty `Vec` if a + /// workspace is open but no folders are configured. + /// + /// This corresponds to the [`workspace/workspaceFolders`] request. + /// + /// [`workspace/workspaceFolders`]: https://microsoft.github.io/language-server-protocol/specification#workspace_workspaceFolders + /// + /// # Initialization + /// + /// If the request is sent to the client before the server has been initialized, this will + /// immediately return `Err` with JSON-RPC error code `-32002` ([read more]). + /// + /// [read more]: https://microsoft.github.io/language-server-protocol/specification#initialize + /// + /// # Compatibility + /// + /// This request was introduced in specification version 3.6.0. + pub fn workspace_folders(&self) -> jsonrpc::Result>> { + self.send_request::(()) + } + + /// Requests a workspace resource be edited on the client side and returns whether the edit was + /// applied. + /// + /// This corresponds to the [`workspace/applyEdit`] request. + /// + /// [`workspace/applyEdit`]: https://microsoft.github.io/language-server-protocol/specification#workspace_applyEdit + /// + /// # Initialization + /// + /// If the request is sent to the client before the server has been initialized, this will + /// immediately return `Err` with JSON-RPC error code `-32002` ([read more]). + /// + /// [read more]: https://microsoft.github.io/language-server-protocol/specification#initialize + pub fn apply_edit( + &self, + edit: WorkspaceEdit, + ) -> jsonrpc::Result { + self.send_request::(ApplyWorkspaceEditParams { edit, label: None }) + } + + /// Sends a custom notification to the client. + /// + /// # Initialization + /// + /// This notification will only be sent if the server is initialized. + pub fn send_notification(&self, params: N::Params) + where + N: lsp_types::notification::Notification, + { + let server_opt = self.inner.server.clone().unwrap().upgrade(); + if server_opt.is_none() { + eprintln!("Cannot send request, server is not initialized"); + return; + } + server_opt.unwrap().send(Message::Notification( + lsp_server::Notification::new(N::METHOD.to_string(), params), + )); + /*if let State::Initialized | State::ShutDown = self.inner.state.get() { + self.send_notification_unchecked::(params).await; + } else { + let msg = Request::from_notification::(params); + trace!("server not initialized, supressing message: {}", msg); + }*/ + } + + fn send_notification_unchecked(&self, params: N::Params) + where + N: lsp_types::notification::Notification, + { + let server_opt = self.inner.server.clone().unwrap().upgrade(); + if server_opt.is_none() { + eprintln!("Cannot send request, server is not initialized"); + return; + } + server_opt.unwrap().send(Message::Notification( + lsp_server::Notification::new(N::METHOD.to_string(), params), + )); + //let request = request::Request::from_notification::(params); + /*if self.clone().call(request).await.is_err() { + error!("failed to send notification"); + }*/ + } + + /// Sends a custom request to the client. + /// + /// # Initialization + /// + /// If the request is sent to the client before the server has been initialized, this will + /// immediately return `Err` with JSON-RPC error code `-32002` ([read more]). + /// + /// [read more]: https://microsoft.github.io/language-server-protocol/specification#initialize + pub fn send_request(&self, params: R::Params) -> jsonrpc::Result + where + R: lsp_types::request::Request, + { + let server_opt = self.inner.server.clone().unwrap().upgrade(); + if server_opt.is_none() { + eprintln!("Cannot send request, server is not initialized"); + return Err(jsonrpc::not_initialized_error()); + } + server_opt.as_ref().unwrap().send(Message::Request( + lsp_server::Request::new(RequestId::from(self.next_request_id().to_string()), R::METHOD.to_string(), params), + )); + + /*if let State::Initialized | State::ShutDown = self.inner.state.get() { + self.send_request_unchecked::(params).await + } else { + let id = self.inner.request_id.load(Ordering::SeqCst) as i64 + 1; + let msg = Request::from_request::(id.into(), params); + trace!("server not initialized, supressing message: {}", msg); + Err(jsonrpc::not_initialized_error()) + }*/ + Err(jsonrpc::not_initialized_error()) + } + + fn send_request_unchecked(&self, params: R::Params) -> jsonrpc::Result + where + R: lsp_types::request::Request, + { + let server_opt = self.inner.server.clone().unwrap().upgrade(); + if server_opt.is_none() { + eprintln!("Cannot send request, server is not initialized"); + return Err(jsonrpc::not_initialized_error()); + } + server_opt.unwrap().send(Message::Request( + lsp_server::Request::new(RequestId::from(self.next_request_id().to_string()), R::METHOD.to_string(), params), + )); + /*let id = self.next_request_id(); + let request = Request::from_request::(id, params); + + let response = match self.clone().call(request).await { + Ok(Some(response)) => response, + Ok(None) | Err(_) => return Err(Error::internal_error()), + }; + + let (_, result) = response.into_parts(); + result.and_then(|v| { + serde_json::from_value(v).map_err(|e| Error { + code: ErrorCode::ParseError, + message: e.to_string().into(), + data: None, + }) + })*/ + Err(jsonrpc::not_initialized_error()) + } +} + +impl Client { + fn next_request_id(&self) -> u32 { + let id = *self.inner.id.borrow_mut(); + if id == u32::MAX { + *self.inner.id.borrow_mut() = 0; + } else { + *self.inner.id.borrow_mut() += 1; + } + id + } + +} \ No newline at end of file diff --git a/libs/lsp-server-wrapper/src/jsonrpc.rs b/libs/lsp-server-wrapper/src/jsonrpc.rs new file mode 100644 index 00000000..a00465f3 --- /dev/null +++ b/libs/lsp-server-wrapper/src/jsonrpc.rs @@ -0,0 +1,4 @@ +mod error; + +pub(crate) use self::error::not_initialized_error; +pub use self::error::{Error, ErrorCode, Result}; \ No newline at end of file diff --git a/libs/lsp-server-wrapper/src/jsonrpc/error.rs b/libs/lsp-server-wrapper/src/jsonrpc/error.rs new file mode 100644 index 00000000..80e6eb25 --- /dev/null +++ b/libs/lsp-server-wrapper/src/jsonrpc/error.rs @@ -0,0 +1,217 @@ +//! Error types defined by the JSON-RPC specification. + +use std::borrow::Cow; +use std::fmt::{self, Display, Formatter}; + +use serde::{Deserialize, Serialize}; +use serde_json::Value; + +/// A specialized [`Result`] error type for JSON-RPC handlers. +/// +/// [`Result`]: enum@std::result::Result +pub type Result = std::result::Result; + +/// A list of numeric error codes used in JSON-RPC responses. +#[derive(Clone, Copy, Debug, Eq, PartialEq, Serialize, Deserialize)] +#[serde(into = "i64", from = "i64")] +pub enum ErrorCode { + /// Invalid JSON was received by the server. + ParseError, + /// The JSON sent is not a valid Request object. + InvalidRequest, + /// The method does not exist / is not available. + MethodNotFound, + /// Invalid method parameter(s). + InvalidParams, + /// Internal JSON-RPC error. + InternalError, + /// Reserved for implementation-defined server errors. + ServerError(i64), + + /// The request was cancelled by the client. + /// + /// # Compatibility + /// + /// This error code is defined by the Language Server Protocol. + RequestCancelled, + /// The request was invalidated by another incoming request. + /// + /// # Compatibility + /// + /// This error code is specific to the Language Server Protocol. + ContentModified, +} + +impl ErrorCode { + /// Returns the integer error code value. + pub const fn code(&self) -> i64 { + match *self { + ErrorCode::ParseError => -32700, + ErrorCode::InvalidRequest => -32600, + ErrorCode::MethodNotFound => -32601, + ErrorCode::InvalidParams => -32602, + ErrorCode::InternalError => -32603, + ErrorCode::RequestCancelled => -32800, + ErrorCode::ContentModified => -32801, + ErrorCode::ServerError(code) => code, + } + } + + /// Returns a human-readable description of the error. + pub const fn description(&self) -> &'static str { + match *self { + ErrorCode::ParseError => "Parse error", + ErrorCode::InvalidRequest => "Invalid request", + ErrorCode::MethodNotFound => "Method not found", + ErrorCode::InvalidParams => "Invalid params", + ErrorCode::InternalError => "Internal error", + ErrorCode::RequestCancelled => "Canceled", + ErrorCode::ContentModified => "Content modified", + ErrorCode::ServerError(_) => "Server error", + } + } +} + +impl From for ErrorCode { + fn from(code: i64) -> Self { + match code { + -32700 => ErrorCode::ParseError, + -32600 => ErrorCode::InvalidRequest, + -32601 => ErrorCode::MethodNotFound, + -32602 => ErrorCode::InvalidParams, + -32603 => ErrorCode::InternalError, + -32800 => ErrorCode::RequestCancelled, + -32801 => ErrorCode::ContentModified, + code => ErrorCode::ServerError(code), + } + } +} + +impl From for i64 { + fn from(code: ErrorCode) -> Self { + code.code() + } +} + +impl Display for ErrorCode { + fn fmt(&self, f: &mut Formatter) -> fmt::Result { + Display::fmt(&self.code(), f) + } +} + +/// A JSON-RPC error object. +#[derive(Clone, Debug, Eq, PartialEq, Deserialize, Serialize)] +#[serde(deny_unknown_fields)] +pub struct Error { + /// A number indicating the error type that occurred. + pub code: ErrorCode, + /// A short description of the error. + pub message: Cow<'static, str>, + /// Additional information about the error, if any. + #[serde(skip_serializing_if = "Option::is_none")] + pub data: Option, +} + +impl Error { + /// Creates a new error from the given `ErrorCode`. + pub const fn new(code: ErrorCode) -> Self { + Error { + code, + message: Cow::Borrowed(code.description()), + data: None, + } + } + + /// Creates a new parse error (`-32700`). + pub const fn parse_error() -> Self { + Error::new(ErrorCode::ParseError) + } + + /// Creates a new "invalid request" error (`-32600`). + pub const fn invalid_request() -> Self { + Error::new(ErrorCode::InvalidRequest) + } + + /// Creates a new "method not found" error (`-32601`). + pub const fn method_not_found() -> Self { + Error::new(ErrorCode::MethodNotFound) + } + + /// Creates a new "invalid params" error (`-32602`). + pub fn invalid_params(message: M) -> Self + where + M: Into>, + { + Error { + code: ErrorCode::InvalidParams, + message: message.into(), + data: None, + } + } + + /// Creates a new internal error (`-32603`). + pub const fn internal_error() -> Self { + Error::new(ErrorCode::InternalError) + } + + /// Creates a new "request cancelled" error (`-32800`). + /// + /// # Compatibility + /// + /// This error code is defined by the Language Server Protocol. + pub const fn request_cancelled() -> Self { + Error::new(ErrorCode::RequestCancelled) + } + + /// Creates a new "content modified" error (`-32801`). + /// + /// # Compatibility + /// + /// This error code is defined by the Language Server Protocol. + pub const fn content_modified() -> Self { + Error::new(ErrorCode::ContentModified) + } +} + +impl Display for Error { + fn fmt(&self, f: &mut Formatter) -> fmt::Result { + write!(f, "{}: {}", self.code.description(), self.message) + } +} + +impl std::error::Error for Error {} + +/// Error response returned for every request received before the server is initialized. +/// +/// See [here](https://microsoft.github.io/language-server-protocol/specification#initialize) +/// for reference. +pub(crate) const fn not_initialized_error() -> Error { + Error { + code: ErrorCode::ServerError(-32002), + message: Cow::Borrowed("Server not initialized"), + data: None, + } +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn error_code_serializes_as_i64() { + let serialized = serde_json::to_string(&ErrorCode::ParseError).unwrap(); + assert_eq!(serialized, "-32700"); + + let serialized = serde_json::to_string(&ErrorCode::ServerError(-12345)).unwrap(); + assert_eq!(serialized, "-12345"); + } + + #[test] + fn error_code_deserializes_from_i64() { + let deserialized: ErrorCode = serde_json::from_str("-32700").unwrap(); + assert_eq!(deserialized, ErrorCode::ParseError); + + let deserialized: ErrorCode = serde_json::from_str("-12345").unwrap(); + assert_eq!(deserialized, ErrorCode::ServerError(-12345)); + } +} \ No newline at end of file diff --git a/libs/lsp-server-wrapper/src/lib.rs b/libs/lsp-server-wrapper/src/lib.rs new file mode 100644 index 00000000..635f153a --- /dev/null +++ b/libs/lsp-server-wrapper/src/lib.rs @@ -0,0 +1,1218 @@ +mod server; +mod client; +mod jsonrpc; +mod service; + +pub use lsp_types; +use lsp_types::*; +use tracing::{error, warn}; +use lsp_types::request::{ + GotoDeclarationParams, GotoDeclarationResponse, GotoImplementationParams, + GotoImplementationResponse, GotoTypeDefinitionParams, GotoTypeDefinitionResponse, +}; +pub use crate::jsonrpc::{Error, Result}; +use serde_json::Value; +pub use client::Client; +pub use server::LspStdioServer; +pub use service::LspService; + +/// Trait implemented by language server backends. +/// +/// This interface allows servers adhering to the [Language Server Protocol] to be implemented in a +/// safe and easily testable way without exposing the low-level implementation details. +/// +/// [Language Server Protocol]: https://microsoft.github.io/language-server-protocol/ +pub trait LanguageServer { + /// The [`initialize`] request is the first request sent from the client to the server. + /// + /// [`initialize`]: https://microsoft.github.io/language-server-protocol/specification#initialize + /// + /// This method is guaranteed to only execute once. If the client sends this request to the + /// server again, the server will respond with JSON-RPC error code `-32600` (invalid request). + fn initialize(&self, params: InitializeParams) -> Result; + + /// The [`initialized`] notification is sent from the client to the server after the client + /// received the result of the initialize request but before the client sends anything else. + /// + /// [`initialized`]: https://microsoft.github.io/language-server-protocol/specification#initialized + /// + /// The server can use the `initialized` notification, for example, to dynamically register + /// capabilities with the client. + fn initialized(&self, params: InitializedParams) { + let _ = params; + } + + /// The [`shutdown`] request asks the server to gracefully shut down, but to not exit. + /// + /// [`shutdown`]: https://microsoft.github.io/language-server-protocol/specification#shutdown + /// + /// This request is often later followed by an [`exit`] notification, which will cause the + /// server to exit immediately. + /// + /// [`exit`]: https://microsoft.github.io/language-server-protocol/specification#exit + /// + /// This method is guaranteed to only execute once. If the client sends this request to the + /// server again, the server will respond with JSON-RPC error code `-32600` (invalid request). + fn shutdown(&self) -> Result<()>; + + // Document Synchronization + + /// The [`textDocument/didOpen`] notification is sent from the client to the server to signal + /// that a new text document has been opened by the client. + /// + /// [`textDocument/didOpen`]: https://microsoft.github.io/language-server-protocol/specification#textDocument_didOpen + /// + /// The document's truth is now managed by the client and the server must not try to read the + /// document’s truth using the document's URI. "Open" in this sense means it is managed by the + /// client. It doesn't necessarily mean that its content is presented in an editor. + fn did_open(&self, params: DidOpenTextDocumentParams) { + let _ = params; + warn!("Got a textDocument/didOpen notification, but it is not implemented"); + } + + /// The [`textDocument/didChange`] notification is sent from the client to the server to signal + /// changes to a text document. + /// + /// [`textDocument/didChange`]: https://microsoft.github.io/language-server-protocol/specification#textDocument_didChange + /// + /// This notification will contain a distinct version tag and a list of edits made to the + /// document for the server to interpret. + fn did_change(&self, params: DidChangeTextDocumentParams) { + let _ = params; + warn!("Got a textDocument/didChange notification, but it is not implemented"); + } + + /// The [`textDocument/willSave`] notification is sent from the client to the server before the + /// document is actually saved. + /// + /// [`textDocument/willSave`]: https://microsoft.github.io/language-server-protocol/specification#textDocument_willSave + fn will_save(&self, params: WillSaveTextDocumentParams) { + let _ = params; + warn!("Got a textDocument/willSave notification, but it is not implemented"); + } + + /// The [`textDocument/willSaveWaitUntil`] request is sent from the client to the server before + /// the document is actually saved. + /// + /// [`textDocument/willSaveWaitUntil`]: https://microsoft.github.io/language-server-protocol/specification#textDocument_willSaveWaitUntil + /// + /// The request can return an array of `TextEdit`s which will be applied to the text document + /// before it is saved. + /// + /// Please note that clients might drop results if computing the text edits took too long or if + /// a server constantly fails on this request. This is done to keep the save fast and reliable. + fn will_save_wait_until( + &self, + params: WillSaveTextDocumentParams, + ) -> Result>> { + let _ = params; + error!("Got a textDocument/willSaveWaitUntil request, but it is not implemented"); + Err(Error::method_not_found()) + } + + /// The [`textDocument/didSave`] notification is sent from the client to the server when the + /// document was saved in the client. + /// + /// [`textDocument/didSave`]: https://microsoft.github.io/language-server-protocol/specification#textDocument_didSave + fn did_save(&self, params: DidSaveTextDocumentParams) { + let _ = params; + warn!("Got a textDocument/didSave notification, but it is not implemented"); + } + + /// The [`textDocument/didClose`] notification is sent from the client to the server when the + /// document got closed in the client. + /// + /// [`textDocument/didClose`]: https://microsoft.github.io/language-server-protocol/specification#textDocument_didClose + /// + /// The document's truth now exists where the document's URI points to (e.g. if the document's + /// URI is a file URI, the truth now exists on disk). + fn did_close(&self, params: DidCloseTextDocumentParams) { + let _ = params; + warn!("Got a textDocument/didClose notification, but it is not implemented"); + } + + // Language Features + + /// The [`textDocument/declaration`] request asks the server for the declaration location of a + /// symbol at a given text document position. + /// + /// [`textDocument/declaration`]: https://microsoft.github.io/language-server-protocol/specification#textDocument_declaration + /// + /// # Compatibility + /// + /// This request was introduced in specification version 3.14.0. + /// + /// The [`GotoDeclarationResponse::Link`](lsp_types::GotoDefinitionResponse::Link) return value + /// was introduced in specification version 3.14.0 and requires client-side support in order to + /// be used. It can be returned if the client set the following field to `true` in the + /// [`initialize`](Self::initialize) method: + /// + /// ```text + /// InitializeParams::capabilities::text_document::declaration::link_support + /// ``` + fn goto_declaration( + &self, + params: GotoDeclarationParams, + ) -> Result> { + let _ = params; + error!("Got a textDocument/declaration request, but it is not implemented"); + Err(Error::method_not_found()) + } + + /// The [`textDocument/definition`] request asks the server for the definition location of a + /// symbol at a given text document position. + /// + /// [`textDocument/definition`]: https://microsoft.github.io/language-server-protocol/specification#textDocument_definition + /// + /// # Compatibility + /// + /// The [`GotoDefinitionResponse::Link`](lsp_types::GotoDefinitionResponse::Link) return value + /// was introduced in specification version 3.14.0 and requires client-side support in order to + /// be used. It can be returned if the client set the following field to `true` in the + /// [`initialize`](Self::initialize) method: + /// + /// ```text + /// InitializeParams::capabilities::text_document::definition::link_support + /// ``` + fn goto_definition( + &self, + params: GotoDefinitionParams, + ) -> Result> { + let _ = params; + error!("Got a textDocument/definition request, but it is not implemented"); + Err(Error::method_not_found()) + } + + /// The [`textDocument/typeDefinition`] request asks the server for the type definition location of + /// a symbol at a given text document position. + /// + /// [`textDocument/typeDefinition`]: https://microsoft.github.io/language-server-protocol/specification#textDocument_typeDefinition + /// + /// # Compatibility + /// + /// This request was introduced in specification version 3.6.0. + /// + /// The [`GotoTypeDefinitionResponse::Link`](lsp_types::GotoDefinitionResponse::Link) return + /// value was introduced in specification version 3.14.0 and requires client-side support in + /// order to be used. It can be returned if the client set the following field to `true` in the + /// [`initialize`](Self::initialize) method: + /// + /// ```text + /// InitializeParams::capabilities::text_document::type_definition::link_support + /// ``` + fn goto_type_definition( + &self, + params: GotoTypeDefinitionParams, + ) -> Result> { + let _ = params; + error!("Got a textDocument/typeDefinition request, but it is not implemented"); + Err(Error::method_not_found()) + } + + /// The [`textDocument/implementation`] request is sent from the client to the server to resolve + /// the implementation location of a symbol at a given text document position. + /// + /// [`textDocument/implementation`]: https://microsoft.github.io/language-server-protocol/specification#textDocument_implementation + /// + /// # Compatibility + /// + /// This request was introduced in specification version 3.6.0. + /// + /// The [`GotoImplementationResponse::Link`](lsp_types::GotoDefinitionResponse::Link) + /// return value was introduced in specification version 3.14.0 and requires client-side + /// support in order to be used. It can be returned if the client set the following field to + /// `true` in the [`initialize`](Self::initialize) method: + /// + /// ```text + /// InitializeParams::capabilities::text_document::implementation::link_support + /// ``` + fn goto_implementation( + &self, + params: GotoImplementationParams, + ) -> Result> { + let _ = params; + error!("Got a textDocument/implementation request, but it is not implemented"); + Err(Error::method_not_found()) + } + + /// The [`textDocument/references`] request is sent from the client to the server to resolve + /// project-wide references for the symbol denoted by the given text document position. + /// + /// [`textDocument/references`]: https://microsoft.github.io/language-server-protocol/specification#textDocument_references + + fn references(&self, params: ReferenceParams) -> Result>> { + let _ = params; + error!("Got a textDocument/references request, but it is not implemented"); + Err(Error::method_not_found()) + } + + /// The [`textDocument/prepareCallHierarchy`] request is sent from the client to the server to + /// return a call hierarchy for the language element of given text document positions. + /// + /// [`textDocument/prepareCallHierarchy`]: https://microsoft.github.io/language-server-protocol/specification#textDocument_prepareCallHierarchy + /// + /// The call hierarchy requests are executed in two steps: + /// + /// 1. First, a call hierarchy item is resolved for the given text document position (this + /// method). + /// 2. For a call hierarchy item, the incoming or outgoing call hierarchy items are resolved + /// inside [`incoming_calls`] and [`outgoing_calls`], respectively. + /// + /// [`incoming_calls`]: Self::incoming_calls + /// [`outgoing_calls`]: Self::outgoing_calls + /// + /// # Compatibility + /// + /// This request was introduced in specification version 3.16.0. + fn prepare_call_hierarchy( + &self, + params: CallHierarchyPrepareParams, + ) -> Result>> { + let _ = params; + error!("Got a textDocument/prepareCallHierarchy request, but it is not implemented"); + Err(Error::method_not_found()) + } + + /// The [`callHierarchy/incomingCalls`] request is sent from the client to the server to + /// resolve **incoming** calls for a given call hierarchy item. + /// + /// The request doesn't define its own client and server capabilities. It is only issued if a + /// server registers for the [`textDocument/prepareCallHierarchy`] request. + /// + /// [`callHierarchy/incomingCalls`]: https://microsoft.github.io/language-server-protocol/specification#callHierarchy_incomingCalls + /// [`textDocument/prepareCallHierarchy`]: Self::prepare_call_hierarchy + /// + /// # Compatibility + /// + /// This request was introduced in specification version 3.16.0. + fn incoming_calls( + &self, + params: CallHierarchyIncomingCallsParams, + ) -> Result>> { + let _ = params; + error!("Got a callHierarchy/incomingCalls request, but it is not implemented"); + Err(Error::method_not_found()) + } + + /// The [`callHierarchy/outgoingCalls`] request is sent from the client to the server to + /// resolve **outgoing** calls for a given call hierarchy item. + /// + /// The request doesn't define its own client and server capabilities. It is only issued if a + /// server registers for the [`textDocument/prepareCallHierarchy`] request. + /// + /// [`callHierarchy/outgoingCalls`]: https://microsoft.github.io/language-server-protocol/specification#callHierarchy_outgoingCalls + /// [`textDocument/prepareCallHierarchy`]: Self::prepare_call_hierarchy + /// + /// # Compatibility + /// + /// This request was introduced in specification version 3.16.0. + fn outgoing_calls( + &self, + params: CallHierarchyOutgoingCallsParams, + ) -> Result>> { + let _ = params; + error!("Got a callHierarchy/outgoingCalls request, but it is not implemented"); + Err(Error::method_not_found()) + } + + /// The [`textDocument/prepareTypeHierarchy`] request is sent from the client to the server to + /// return a type hierarchy for the language element of given text document positions. + /// + /// [`textDocument/prepareTypeHierarchy`]: https://microsoft.github.io/language-server-protocol/specification#textDocument_prepareTypeHierarchy + /// + /// Returns `Ok(None)` if the server couldn’t infer a valid type from the position. + /// + /// The type hierarchy requests are executed in two steps: + /// + /// 1. First, a type hierarchy item is prepared for the given text document position. + /// 2. For a type hierarchy item, the supertype or subtype type hierarchy items are resolved in + /// [`supertypes`](Self::supertypes) and [`subtypes`](Self::subtypes), respectively. + /// + /// # Compatibility + /// + /// This request was introduced in specification version 3.17.0. + fn prepare_type_hierarchy( + &self, + params: TypeHierarchyPrepareParams, + ) -> Result>> { + let _ = params; + error!("Got a textDocument/prepareTypeHierarchy request, but it is not implemented"); + Err(Error::method_not_found()) + } + + /// The [`typeHierarchy/supertypes`] request is sent from the client to the server to resolve + /// the **supertypes** for a given type hierarchy item. + /// + /// Returns `Ok(None)` if the server couldn’t infer a valid type from item in `params`. + /// + /// The request doesn’t define its own client and server capabilities. It is only issued if a + /// server registers for the `textDocument/prepareTypeHierarchy` request. + /// + /// # Compatibility + /// + /// This request was introduced in specification version 3.17.0. + fn supertypes( + &self, + params: TypeHierarchySupertypesParams, + ) -> Result>> { + let _ = params; + error!("Got a typeHierarchy/supertypes request, but it is not implemented"); + Err(Error::method_not_found()) + } + + /// The [`typeHierarchy/subtypes`] request is sent from the client to the server to resolve + /// the **subtypes** for a given type hierarchy item. + /// + /// Returns `Ok(None)` if the server couldn’t infer a valid type from item in `params`. + /// + /// The request doesn’t define its own client and server capabilities. It is only issued if a + /// server registers for the `textDocument/prepareTypeHierarchy` request. + /// + /// # Compatibility + /// + /// This request was introduced in specification version 3.17.0. + fn subtypes( + &self, + params: TypeHierarchySubtypesParams, + ) -> Result>> { + let _ = params; + error!("Got a typeHierarchy/subtypes request, but it is not implemented"); + Err(Error::method_not_found()) + } + + /// The [`textDocument/documentHighlight`] request is sent from the client to the server to + /// resolve appropriate highlights for a given text document position. + /// + /// [`textDocument/documentHighlight`]: https://microsoft.github.io/language-server-protocol/specification#textDocument_documentHighlight + /// + /// For programming languages, this usually highlights all textual references to the symbol + /// scoped to this file. + /// + /// This request differs slightly from `textDocument/references` in that this one is allowed to + /// be more fuzzy. + fn document_highlight( + &self, + params: DocumentHighlightParams, + ) -> Result>> { + let _ = params; + error!("Got a textDocument/documentHighlight request, but it is not implemented"); + Err(Error::method_not_found()) + } + + /// The [`textDocument/documentLink`] request is sent from the client to the server to request + /// the location of links in a document. + /// + /// A document link is a range in a text document that links to an internal or external + /// resource, like another text document or a web site. + /// + /// [`textDocument/documentLink`]: https://microsoft.github.io/language-server-protocol/specification#textDocument_documentLink + /// + /// # Compatibility + /// + /// The [`DocumentLink::tooltip`] field was introduced in specification version 3.15.0 and + /// requires client-side support in order to be used. It can be returned if the client set the + /// following field to `true` in the [`initialize`](Self::initialize) method: + /// + /// ```text + /// InitializeParams::capabilities::text_document::document_link::tooltip_support + /// ``` + fn document_link(&self, params: DocumentLinkParams) -> Result>> { + let _ = params; + error!("Got a textDocument/documentLink request, but it is not implemented"); + Err(Error::method_not_found()) + } + + /// The [`documentLink/resolve`] request is sent from the client to the server to resolve the + /// target of a given document link. + /// + /// [`documentLink/resolve`]: https://microsoft.github.io/language-server-protocol/specification#documentLink_resolve + /// + /// A document link is a range in a text document that links to an internal or external + /// resource, like another text document or a web site. + fn document_link_resolve(&self, params: DocumentLink) -> Result { + let _ = params; + error!("Got a documentLink/resolve request, but it is not implemented"); + Err(Error::method_not_found()) + } + + /// The [`textDocument/hover`] request asks the server for hover information at a given text + /// document position. + /// + /// [`textDocument/hover`]: https://microsoft.github.io/language-server-protocol/specification#textDocument_hover + /// + /// Such hover information typically includes type signature information and inline + /// documentation for the symbol at the given text document position. + fn hover(&self, params: HoverParams) -> Result> { + let _ = params; + error!("Got a textDocument/hover request, but it is not implemented"); + Err(Error::method_not_found()) + } + + /// The [`textDocument/codeLens`] request is sent from the client to the server to compute code + /// lenses for a given text document. + /// + /// [`textDocument/codeLens`]: https://microsoft.github.io/language-server-protocol/specification#textDocument_codeLens + + fn code_lens(&self, params: CodeLensParams) -> Result>> { + let _ = params; + error!("Got a textDocument/codeLens request, but it is not implemented"); + Err(Error::method_not_found()) + } + + /// The [`codeLens/resolve`] request is sent from the client to the server to resolve the + /// command for a given code lens item. + /// + /// [`codeLens/resolve`]: https://microsoft.github.io/language-server-protocol/specification#codeLens_resolve + + fn code_lens_resolve(&self, params: CodeLens) -> Result { + let _ = params; + error!("Got a codeLens/resolve request, but it is not implemented"); + Err(Error::method_not_found()) + } + + /// The [`textDocument/foldingRange`] request is sent from the client to the server to return + /// all folding ranges found in a given text document. + /// + /// [`textDocument/foldingRange`]: https://microsoft.github.io/language-server-protocol/specification#textDocument_foldingRange + /// + /// # Compatibility + /// + /// This request was introduced in specification version 3.10.0. + + fn folding_range(&self, params: FoldingRangeParams) -> Result>> { + let _ = params; + error!("Got a textDocument/foldingRange request, but it is not implemented"); + Err(Error::method_not_found()) + } + + /// The [`textDocument/selectionRange`] request is sent from the client to the server to return + /// suggested selection ranges at an array of given positions. A selection range is a range + /// around the cursor position which the user might be interested in selecting. + /// + /// [`textDocument/selectionRange`]: https://microsoft.github.io/language-server-protocol/specification#textDocument_selectionRange + /// + /// A selection range in the return array is for the position in the provided parameters at the + /// same index. Therefore `params.positions[i]` must be contained in `result[i].range`. + /// + /// # Compatibility + /// + /// This request was introduced in specification version 3.15.0. + + fn selection_range( + &self, + params: SelectionRangeParams, + ) -> Result>> { + let _ = params; + error!("Got a textDocument/selectionRange request, but it is not implemented"); + Err(Error::method_not_found()) + } + + /// The [`textDocument/documentSymbol`] request is sent from the client to the server to + /// retrieve all symbols found in a given text document. + /// + /// [`textDocument/documentSymbol`]: https://microsoft.github.io/language-server-protocol/specification#textDocument_documentSymbol + /// + /// The returned result is either: + /// + /// * [`DocumentSymbolResponse::Flat`] which is a flat list of all symbols found in a given + /// text document. Then neither the symbol’s location range nor the symbol’s container name + /// should be used to infer a hierarchy. + /// * [`DocumentSymbolResponse::Nested`] which is a hierarchy of symbols found in a given text + /// document. + + fn document_symbol( + &self, + params: DocumentSymbolParams, + ) -> Result> { + let _ = params; + error!("Got a textDocument/documentSymbol request, but it is not implemented"); + Err(Error::method_not_found()) + } + + /// The [`textDocument/semanticTokens/full`] request is sent from the client to the server to + /// resolve the semantic tokens of a given file. + /// + /// [`textDocument/semanticTokens/full`]: https://microsoft.github.io/language-server-protocol/specification#textDocument_semanticTokens + /// + /// Semantic tokens are used to add additional color information to a file that depends on + /// language specific symbol information. A semantic token request usually produces a large + /// result. The protocol therefore supports encoding tokens with numbers. In addition, optional + /// support for deltas is available, i.e. [`semantic_tokens_full_delta`]. + /// + /// [`semantic_tokens_full_delta`]: Self::semantic_tokens_full_delta + /// + /// # Compatibility + /// + /// This request was introduced in specification version 3.16.0. + + fn semantic_tokens_full( + &self, + params: SemanticTokensParams, + ) -> Result> { + let _ = params; + error!("Got a textDocument/semanticTokens/full request, but it is not implemented"); + Err(Error::method_not_found()) + } + + /// The [`textDocument/semanticTokens/full/delta`] request is sent from the client to the server to + /// resolve the semantic tokens of a given file, **returning only the delta**. + /// + /// [`textDocument/semanticTokens/full/delta`]: https://microsoft.github.io/language-server-protocol/specification#textDocument_semanticTokens + /// + /// Similar to [`semantic_tokens_full`](Self::semantic_tokens_full), except it returns a + /// sequence of [`SemanticTokensEdit`] to transform a previous result into a new result. + /// + /// # Compatibility + /// + /// This request was introduced in specification version 3.16.0. + + fn semantic_tokens_full_delta( + &self, + params: SemanticTokensDeltaParams, + ) -> Result> { + let _ = params; + error!("Got a textDocument/semanticTokens/full/delta request, but it is not implemented"); + Err(Error::method_not_found()) + } + + /// The [`textDocument/semanticTokens/range`] request is sent from the client to the server to + /// resolve the semantic tokens **for the visible range** of a given file. + /// + /// [`textDocument/semanticTokens/range`]: https://microsoft.github.io/language-server-protocol/specification#textDocument_semanticTokens + /// + /// When a user opens a file, it can be beneficial to only compute the semantic tokens for the + /// visible range (faster rendering of the tokens in the user interface). If a server can + /// compute these tokens faster than for the whole file, it can implement this method to handle + /// this special case. + /// + /// See the [`semantic_tokens_full`](Self::semantic_tokens_full) documentation for more + /// details. + /// + /// # Compatibility + /// + /// This request was introduced in specification version 3.16.0. + + fn semantic_tokens_range( + &self, + params: SemanticTokensRangeParams, + ) -> Result> { + let _ = params; + error!("Got a textDocument/semanticTokens/range request, but it is not implemented"); + Err(Error::method_not_found()) + } + + /// The [`textDocument/inlineValue`] request is sent from the client to the server to compute + /// inline values for a given text document that may be rendered in the editor at the end of + /// lines. + /// + /// [`textDocument/inlineValue`]: https://microsoft.github.io/language-server-protocol/specification#textDocument_inlineValue + /// + /// # Compatibility + /// + /// This request was introduced in specification version 3.17.0. + + fn inline_value(&self, params: InlineValueParams) -> Result>> { + let _ = params; + error!("Got a textDocument/inlineValue request, but it is not implemented"); + Err(Error::method_not_found()) + } + + /// The [`textDocument/inlayHint`] request is sent from the client to the server to compute + /// inlay hints for a given `(text document, range)` tuple that may be rendered in the editor + /// in place with other text. + /// + /// [`textDocument/inlayHint`]: https://microsoft.github.io/language-server-protocol/specification#textDocument_inlayHint + /// + /// # Compatibility + /// + /// This request was introduced in specification version 3.17.0 + + fn inlay_hint(&self, params: InlayHintParams) -> Result>> { + let _ = params; + error!("Got a textDocument/inlayHint request, but it is not implemented"); + Err(Error::method_not_found()) + } + + /// The [`inlayHint/resolve`] request is sent from the client to the server to resolve + /// additional information for a given inlay hint. + /// + /// [`inlayHint/resolve`]: https://microsoft.github.io/language-server-protocol/specification#inlayHint_resolve + /// + /// This is usually used to compute the tooltip, location or command properties of an inlay + /// hint’s label part to avoid its unnecessary computation during the `textDocument/inlayHint` + /// request. + /// + /// Consider a client announces the `label.location` property as a property that can be + /// resolved lazily using the client capability: + /// + /// ```js + /// textDocument.inlayHint.resolveSupport = { properties: ['label.location'] }; + /// ``` + /// + /// then an inlay hint with a label part, but without a location, must be resolved using the + /// `inlayHint/resolve` request before it can be used. + /// + /// # Compatibility + /// + /// This request was introduced in specification version 3.17.0 + + fn inlay_hint_resolve(&self, params: InlayHint) -> Result { + let _ = params; + error!("Got a inlayHint/resolve request, but it is not implemented"); + Err(Error::method_not_found()) + } + + /// The [`textDocument/moniker`] request is sent from the client to the server to get the + /// symbol monikers for a given text document position. + /// + /// [`textDocument/moniker`]: https://microsoft.github.io/language-server-protocol/specification#textDocument_moniker + /// + /// An array of `Moniker` types is returned as response to indicate possible monikers at the + /// given location. If no monikers can be calculated, `Some(vec![])` or `None` should be + /// returned. + /// + /// # Concept + /// + /// The Language Server Index Format (LSIF) introduced the concept of _symbol monikers_ to help + /// associate symbols across different indexes. This request adds capability for LSP server + /// implementations to provide the same symbol moniker information given a text document + /// position. + /// + /// Clients can utilize this method to get the moniker at the current location in a file the + /// user is editing and do further code navigation queries in other services that rely on LSIF + /// indexes and link symbols together. + /// + /// # Compatibility + /// + /// This request was introduced in specification version 3.16.0. + + fn moniker(&self, params: MonikerParams) -> Result>> { + let _ = params; + error!("Got a textDocument/moniker request, but it is not implemented"); + Err(Error::method_not_found()) + } + + /// The [`textDocument/completion`] request is sent from the client to the server to compute + /// completion items at a given cursor position. + /// + /// If computing full completion items is expensive, servers can additionally provide a handler + /// for the completion item resolve request (`completionItem/resolve`). This request is sent + /// when a completion item is selected in the user interface. + /// + /// [`textDocument/completion`]: https://microsoft.github.io/language-server-protocol/specification#textDocument_completion + /// + /// # Compatibility + /// + /// Since 3.16.0, the client can signal that it can resolve more properties lazily. This is + /// done using the `completion_item.resolve_support` client capability which lists all + /// properties that can be filled in during a `completionItem/resolve` request. + /// + /// All other properties (usually `sort_text`, `filter_text`, `insert_text`, and `text_edit`) + /// must be provided in the `textDocument/completion` response and must not be changed during + /// resolve. + + fn completion(&self, params: CompletionParams) -> Result> { + let _ = params; + error!("Got a textDocument/completion request, but it is not implemented"); + Err(Error::method_not_found()) + } + + /// The [`completionItem/resolve`] request is sent from the client to the server to resolve + /// additional information for a given completion item. + /// + /// [`completionItem/resolve`]: https://microsoft.github.io/language-server-protocol/specification#completionItem_resolve + + fn completion_resolve(&self, params: CompletionItem) -> Result { + let _ = params; + error!("Got a completionItem/resolve request, but it is not implemented"); + Err(Error::method_not_found()) + } + + /// The [`textDocument/diagnostic`] request is sent from the client to the server to ask the + /// server to compute the diagnostics for a given document. + /// + /// As with other pull requests, the server is asked to compute the diagnostics for the + /// currently synced version of the document. + /// + /// The request doesn't define its own client and server capabilities. It is only issued if a + /// server registers for the [`textDocument/diagnostic`] request. + /// + /// [`textDocument/diagnostic`]: https://microsoft.github.io/language-server-protocol/specification#textDocument_diagnostic + /// + /// # Compatibility + /// + /// This request was introduced in specification version 3.17.0. + + fn diagnostic( + &self, + params: DocumentDiagnosticParams, + ) -> Result { + let _ = params; + error!("Got a textDocument/diagnostic request, but it is not implemented"); + Err(Error::method_not_found()) + } + + /// The [`workspace/diagnostic`] request is sent from the client to the server to ask the + /// server to compute workspace wide diagnostics which previously where pushed from the server + /// to the client. + /// + /// In contrast to the [`textDocument/diagnostic`] request, the workspace request can be + /// long-running and is not bound to a specific workspace or document state. If the client + /// supports streaming for the workspace diagnostic pull, it is legal to provide a + /// `textDocument/diagnostic` report multiple times for the same document URI. The last one + /// reported will win over previous reports. + /// + /// [`textDocument/diagnostic`]: https://microsoft.github.io/language-server-protocol/specification#textDocument_diagnostic + /// + /// If a client receives a diagnostic report for a document in a workspace diagnostic request + /// for which the client also issues individual document diagnostic pull requests, the client + /// needs to decide which diagnostics win and should be presented. In general: + /// + /// * Diagnostics for a higher document version should win over those from a lower document + /// version (e.g. note that document versions are steadily increasing). + /// * Diagnostics from a document pull should win over diagnostics from a workspace pull. + /// + /// The request doesn't define its own client and server capabilities. It is only issued if a + /// server registers for the [`workspace/diagnostic`] request. + /// + /// [`workspace/diagnostic`]: https://microsoft.github.io/language-server-protocol/specification#workspace_diagnostic + /// + /// # Compatibility + /// + /// This request was introduced in specification version 3.17.0. + + fn workspace_diagnostic( + &self, + params: WorkspaceDiagnosticParams, + ) -> Result { + let _ = params; + error!("Got a workspace/diagnostic request, but it is not implemented"); + Err(Error::method_not_found()) + } + + /// The [`textDocument/signatureHelp`] request is sent from the client to the server to request + /// signature information at a given cursor position. + /// + /// [`textDocument/signatureHelp`]: https://microsoft.github.io/language-server-protocol/specification#textDocument_signatureHelp + + fn signature_help(&self, params: SignatureHelpParams) -> Result> { + let _ = params; + error!("Got a textDocument/signatureHelp request, but it is not implemented"); + Err(Error::method_not_found()) + } + + /// The [`textDocument/codeAction`] request is sent from the client to the server to compute + /// commands for a given text document and range. These commands are typically code fixes to + /// either fix problems or to beautify/refactor code. + /// + /// The result of a [`textDocument/codeAction`] request is an array of `Command` literals which + /// are typically presented in the user interface. + /// + /// [`textDocument/codeAction`]: https://microsoft.github.io/language-server-protocol/specification#textDocument_codeAction + /// + /// To ensure that a server is useful in many clients, the commands specified in a code actions + /// should be handled by the server and not by the client (see [`workspace/executeCommand`] and + /// `ServerCapabilities::execute_command_provider`). If the client supports providing edits + /// with a code action, then the mode should be used. + /// + /// When the command is selected the server should be contacted again (via the + /// [`workspace/executeCommand`] request) to execute the command. + /// + /// [`workspace/executeCommand`]: https://microsoft.github.io/language-server-protocol/specification#workspace_executeCommand + /// + /// # Compatibility + /// + /// ## Since version 3.16.0 + /// + /// A client can offer a server to delay the computation of code action properties during a + /// `textDocument/codeAction` request. This is useful for cases where it is expensive to + /// compute the value of a property (for example, the `edit` property). + /// + /// Clients signal this through the `code_action.resolve_support` client capability which lists + /// all properties a client can resolve lazily. The server capability + /// `code_action_provider.resolve_provider` signals that a server will offer a + /// `codeAction/resolve` route. + /// + /// To help servers uniquely identify a code action in the resolve request, a code action + /// literal may optionally carry a `data` property. This is also guarded by an additional + /// client capability `code_action.data_support`. In general, a client should offer data + /// support if it offers resolve support. + /// + /// It should also be noted that servers shouldn’t alter existing attributes of a code action + /// in a `codeAction/resolve` request. + /// + /// ## Since version 3.8.0 + /// + /// Support for [`CodeAction`] literals to enable the following scenarios: + /// + /// * The ability to directly return a workspace edit from the code action request. + /// This avoids having another server roundtrip to execute an actual code action. + /// However server providers should be aware that if the code action is expensive to compute + /// or the edits are huge it might still be beneficial if the result is simply a command and + /// the actual edit is only computed when needed. + /// + /// * The ability to group code actions using a kind. Clients are allowed to ignore that + /// information. However it allows them to better group code action, for example, into + /// corresponding menus (e.g. all refactor code actions into a refactor menu). + + fn code_action(&self, params: CodeActionParams) -> Result> { + let _ = params; + error!("Got a textDocument/codeAction request, but it is not implemented"); + Err(Error::method_not_found()) + } + + /// The [`codeAction/resolve`] request is sent from the client to the server to resolve + /// additional information for a given code action. + /// + /// [`codeAction/resolve`]: https://microsoft.github.io/language-server-protocol/specification#codeAction_resolve + /// + /// This is usually used to compute the edit property of a [`CodeAction`] to avoid its + /// unnecessary computation during the [`textDocument/codeAction`](Self::code_action) request. + /// + /// # Compatibility + /// + /// This request was introduced in specification version 3.16.0. + + fn code_action_resolve(&self, params: CodeAction) -> Result { + let _ = params; + error!("Got a codeAction/resolve request, but it is not implemented"); + Err(Error::method_not_found()) + } + + /// The [`textDocument/documentColor`] request is sent from the client to the server to list + /// all color references found in a given text document. Along with the range, a color value in + /// RGB is returned. + /// + /// [`textDocument/documentColor`]: https://microsoft.github.io/language-server-protocol/specification#textDocument_documentColor + /// + /// Clients can use the result to decorate color references in an editor. For example: + /// + /// * Color boxes showing the actual color next to the reference + /// * Show a color picker when a color reference is edited + /// + /// # Compatibility + /// + /// This request was introduced in specification version 3.6.0. + + fn document_color(&self, params: DocumentColorParams) -> Result> { + let _ = params; + error!("Got a textDocument/documentColor request, but it is not implemented"); + Err(Error::method_not_found()) + } + + /// The [`textDocument/colorPresentation`] request is sent from the client to the server to + /// obtain a list of presentations for a color value at a given location. + /// + /// [`textDocument/colorPresentation`]: https://microsoft.github.io/language-server-protocol/specification#textDocument_colorPresentation + /// + /// Clients can use the result to: + /// + /// * Modify a color reference + /// * Show in a color picker and let users pick one of the presentations + /// + /// # Compatibility + /// + /// This request was introduced in specification version 3.6.0. + /// + /// This request has no special capabilities and registration options since it is sent as a + /// resolve request for the [`textDocument/documentColor`](Self::document_color) request. + + fn color_presentation( + &self, + params: ColorPresentationParams, + ) -> Result> { + let _ = params; + error!("Got a textDocument/colorPresentation request, but it is not implemented"); + Err(Error::method_not_found()) + } + + /// The [`textDocument/formatting`] request is sent from the client to the server to format a + /// whole document. + /// + /// [`textDocument/formatting`]: https://microsoft.github.io/language-server-protocol/specification#textDocument_formatting + + fn formatting(&self, params: DocumentFormattingParams) -> Result>> { + let _ = params; + error!("Got a textDocument/formatting request, but it is not implemented"); + Err(Error::method_not_found()) + } + + /// The [`textDocument/rangeFormatting`] request is sent from the client to the server to + /// format a given range in a document. + /// + /// [`textDocument/rangeFormatting`]: https://microsoft.github.io/language-server-protocol/specification#textDocument_rangeFormatting + + fn range_formatting( + &self, + params: DocumentRangeFormattingParams, + ) -> Result>> { + let _ = params; + error!("Got a textDocument/rangeFormatting request, but it is not implemented"); + Err(Error::method_not_found()) + } + + /// The [`textDocument/onTypeFormatting`] request is sent from the client to the server to + /// format parts of the document during typing. + /// + /// [`textDocument/onTypeFormatting`]: https://microsoft.github.io/language-server-protocol/specification#textDocument_onTypeFormatting + + fn on_type_formatting( + &self, + params: DocumentOnTypeFormattingParams, + ) -> Result>> { + let _ = params; + error!("Got a textDocument/onTypeFormatting request, but it is not implemented"); + Err(Error::method_not_found()) + } + + /// The [`textDocument/rename`] request is sent from the client to the server to ask the server + /// to compute a workspace change so that the client can perform a workspace-wide rename of a + /// symbol. + /// + /// [`textDocument/rename`]: https://microsoft.github.io/language-server-protocol/specification#textDocument_rename + + fn rename(&self, params: RenameParams) -> Result> { + let _ = params; + error!("Got a textDocument/rename request, but it is not implemented"); + Err(Error::method_not_found()) + } + + /// The [`textDocument/prepareRename`] request is sent from the client to the server to setup + /// and test the validity of a rename operation at a given location. + /// + /// [`textDocument/prepareRename`]: https://microsoft.github.io/language-server-protocol/specification#textDocument_prepareRename + /// + /// # Compatibility + /// + /// This request was introduced in specification version 3.12.0. + + fn prepare_rename( + &self, + params: TextDocumentPositionParams, + ) -> Result> { + let _ = params; + error!("Got a textDocument/prepareRename request, but it is not implemented"); + Err(Error::method_not_found()) + } + + /// The [`textDocument/linkedEditingRange`] request is sent from the client to the server to + /// return for a given position in a document the range of the symbol at the position and all + /// ranges that have the same content. + /// + /// [`textDocument/linkedEditingRange`]: https://microsoft.github.io/language-server-protocol/specification#textDocument_linkedEditingRange + /// + /// Optionally a word pattern can be returned to describe valid contents. + /// + /// A rename to one of the ranges can be applied to all other ranges if the new content is + /// valid. If no result-specific word pattern is provided, the word pattern from the client's + /// language configuration is used. + /// + /// # Compatibility + /// + /// This request was introduced in specification version 3.16.0. + + fn linked_editing_range( + &self, + params: LinkedEditingRangeParams, + ) -> Result> { + let _ = params; + error!("Got a textDocument/linkedEditingRange request, but it is not implemented"); + Err(Error::method_not_found()) + } + + // Workspace Features + + /// The [`workspace/symbol`] request is sent from the client to the server to list project-wide + /// symbols matching the given query string. + /// + /// [`workspace/symbol`]: https://microsoft.github.io/language-server-protocol/specification#workspace_symbol + /// + /// # Compatibility + /// + /// Since 3.17.0, servers can also provider a handler for [`workspaceSymbol/resolve`] requests. + /// This allows servers to return workspace symbols without a range for a `workspace/symbol` + /// request. Clients then need to resolve the range when necessary using the + /// `workspaceSymbol/resolve` request. + /// + /// [`workspaceSymbol/resolve`]: Self::symbol_resolve + /// + /// Servers can only use this new model if clients advertise support for it via the + /// `workspace.symbol.resolve_support` capability. + + fn symbol( + &self, + params: WorkspaceSymbolParams, + ) -> Result>> { + let _ = params; + error!("Got a workspace/symbol request, but it is not implemented"); + Err(Error::method_not_found()) + } + + /// The [`workspaceSymbol/resolve`] request is sent from the client to the server to resolve + /// additional information for a given workspace symbol. + /// + /// [`workspaceSymbol/resolve`]: https://microsoft.github.io/language-server-protocol/specification#workspace_symbolResolve + /// + /// See the [`symbol`](Self::symbol) documentation for more details. + /// + /// # Compatibility + /// + /// This request was introduced in specification version 3.17.0. + + fn symbol_resolve(&self, params: WorkspaceSymbol) -> Result { + let _ = params; + error!("Got a workspaceSymbol/resolve request, but it is not implemented"); + Err(Error::method_not_found()) + } + + /// The [`workspace/didChangeConfiguration`] notification is sent from the client to the server + /// to signal the change of configuration settings. + /// + /// [`workspace/didChangeConfiguration`]: https://microsoft.github.io/language-server-protocol/specification#workspace_didChangeConfiguration + + fn did_change_configuration(&self, params: DidChangeConfigurationParams) { + let _ = params; + warn!("Got a workspace/didChangeConfiguration notification, but it is not implemented"); + } + + /// The [`workspace/didChangeWorkspaceFolders`] notification is sent from the client to the + /// server to inform about workspace folder configuration changes. + /// + /// [`workspace/didChangeWorkspaceFolders`]: https://microsoft.github.io/language-server-protocol/specification#workspace_didChangeWorkspaceFolders + /// + /// The notification is sent by default if both of these boolean fields were set to `true` in + /// the [`initialize`](Self::initialize) method: + /// + /// * `InitializeParams::capabilities::workspace::workspace_folders` + /// * `InitializeResult::capabilities::workspace::workspace_folders::supported` + /// + /// This notification is also sent if the server has registered itself to receive this + /// notification. + + fn did_change_workspace_folders(&self, params: DidChangeWorkspaceFoldersParams) { + let _ = params; + warn!("Got a workspace/didChangeWorkspaceFolders notification, but it is not implemented"); + } + + /// The [`workspace/willCreateFiles`] request is sent from the client to the server before + /// files are actually created as long as the creation is triggered from within the client. + /// + /// [`workspace/willCreateFiles`]: https://microsoft.github.io/language-server-protocol/specification#workspace_willCreateFiles + /// + /// The request can return a [`WorkspaceEdit`] which will be applied to workspace before the + /// files are created. Please note that clients might drop results if computing the edit took + /// too long or if a server constantly fails on this request. This is done to keep creates fast + /// and reliable. + /// + /// # Compatibility + /// + /// This request was introduced in specification version 3.16.0. + + fn will_create_files(&self, params: CreateFilesParams) -> Result> { + let _ = params; + error!("Got a workspace/willCreateFiles request, but it is not implemented"); + Err(Error::method_not_found()) + } + + /// The [`workspace/didCreateFiles`] request is sent from the client to the server when files + /// were created from within the client. + /// + /// [`workspace/didCreateFiles`]: https://microsoft.github.io/language-server-protocol/specification#workspace_didCreateFiles + + fn did_create_files(&self, params: CreateFilesParams) { + let _ = params; + warn!("Got a workspace/didCreateFiles notification, but it is not implemented"); + } + + /// The [`workspace/willRenameFiles`] request is sent from the client to the server before + /// files are actually renamed as long as the rename is triggered from within the client. + /// + /// [`workspace/willRenameFiles`]: https://microsoft.github.io/language-server-protocol/specification#workspace_willRenameFiles + /// + /// The request can return a [`WorkspaceEdit`] which will be applied to workspace before the + /// files are renamed. Please note that clients might drop results if computing the edit took + /// too long or if a server constantly fails on this request. This is done to keep creates fast + /// and reliable. + /// + /// # Compatibility + /// + /// This request was introduced in specification version 3.16.0. + + fn will_rename_files(&self, params: RenameFilesParams) -> Result> { + let _ = params; + error!("Got a workspace/willRenameFiles request, but it is not implemented"); + Err(Error::method_not_found()) + } + + /// The [`workspace/didRenameFiles`] notification is sent from the client to the server when + /// files were renamed from within the client. + /// + /// [`workspace/didRenameFiles`]: https://microsoft.github.io/language-server-protocol/specification#workspace_didRenameFiles + + fn did_rename_files(&self, params: RenameFilesParams) { + let _ = params; + warn!("Got a workspace/didRenameFiles notification, but it is not implemented"); + } + + /// The [`workspace/willDeleteFiles`] request is sent from the client to the server before + /// files are actually deleted as long as the deletion is triggered from within the client + /// either by a user action or by applying a workspace edit. + /// + /// [`workspace/willDeleteFiles`]: https://microsoft.github.io/language-server-protocol/specification#workspace_willDeleteFiles + /// + /// The request can return a [`WorkspaceEdit`] which will be applied to workspace before the + /// files are deleted. Please note that clients might drop results if computing the edit took + /// too long or if a server constantly fails on this request. This is done to keep deletions + /// fast and reliable. + /// + /// # Compatibility + /// + /// This request was introduced in specification version 3.16.0. + + fn will_delete_files(&self, params: DeleteFilesParams) -> Result> { + let _ = params; + error!("Got a workspace/willDeleteFiles request, but it is not implemented"); + Err(Error::method_not_found()) + } + + /// The [`workspace/didDeleteFiles`] notification is sent from the client to the server when + /// files were deleted from within the client. + /// + /// [`workspace/didDeleteFiles`]: https://microsoft.github.io/language-server-protocol/specification#workspace_didDeleteFiles + + fn did_delete_files(&self, params: DeleteFilesParams) { + let _ = params; + warn!("Got a workspace/didDeleteFiles notification, but it is not implemented"); + } + + /// The [`workspace/didChangeWatchedFiles`] notification is sent from the client to the server + /// when the client detects changes to files watched by the language client. + /// + /// [`workspace/didChangeWatchedFiles`]: https://microsoft.github.io/language-server-protocol/specification#workspace_didChangeWatchedFiles + /// + /// It is recommended that servers register for these file events using the registration + /// mechanism. This can be done here or in the [`initialized`](Self::initialized) method using + /// [`Client::register_capability`](crate::Client::register_capability). + + fn did_change_watched_files(&self, params: DidChangeWatchedFilesParams) { + let _ = params; + warn!("Got a workspace/didChangeWatchedFiles notification, but it is not implemented"); + } + + /// The [`workspace/executeCommand`] request is sent from the client to the server to trigger + /// command execution on the server. + /// + /// [`workspace/executeCommand`]: https://microsoft.github.io/language-server-protocol/specification#workspace_executeCommand + /// + /// In most cases, the server creates a [`WorkspaceEdit`] structure and applies the changes to + /// the workspace using `Client::apply_edit()` before returning from this function. + + fn execute_command(&self, params: ExecuteCommandParams) -> Result> { + let _ = params; + error!("Got a workspace/executeCommand request, but it is not implemented"); + Err(Error::method_not_found()) + } + + // TODO: Add `work_done_progress_cancel()` here (since 3.15.0) when supported by `tower-lsp`. + // https://github.com/ebkalderon/tower-lsp/issues/176 +} \ No newline at end of file diff --git a/libs/lsp-server-wrapper/src/server.rs b/libs/lsp-server-wrapper/src/server.rs new file mode 100644 index 00000000..a94c4e1d --- /dev/null +++ b/libs/lsp-server-wrapper/src/server.rs @@ -0,0 +1,121 @@ +use std::cell::RefCell; +use std::error::Error; + +use std::rc::{Rc, Weak}; + +use lsp_server::{Connection, IoThreads, Message, Response}; +use crate::{Client, LanguageServer}; +use crate::service::LspService; + +pub(crate) trait LspServer { + fn send(&self, msg: Message); +} + +struct InnerLspStdioServer { + connection: Connection, + io_threads: IoThreads, + client: Rc>, + self_ref: Weak +} + +pub struct LspStdioServer { + inner: InnerLspStdioServer, +} + +impl<'a> LspStdioServer { + pub fn new() -> Rc { + let (connection, io_threads) = Connection::stdio(); + let client = Rc::new(RefCell::new(Client::new())); + Rc::new_cyclic(|me| LspStdioServer { + inner: InnerLspStdioServer { + connection, + io_threads, + client, + self_ref: me.clone() + } + }) + } + + + + fn run_initialization(&self, service: &LspService) -> Result<(), Box> { + let (initialize_id, initialize_params) = self.inner.connection.initialize_start()?; + let res = service.call_request("initialize", initialize_params)?; + let res = match res { + Some(res) => res, + None => return Ok(()), + }; + + let resp = Response::new_ok(initialize_id, res); + self.inner.connection.sender.send(resp.into()).unwrap(); + match &self.inner.connection.receiver.recv() { + Ok(Message::Notification(n)) => { + service.call_notification(&n.method, n.params.clone()).map_err(|e| { + eprintln!("Error: {}", e); + e + }) + } + Ok(msg) => { + return Err(format!(r#"expected initialized notification, got: {msg:?}"#).to_owned().into()); + } + Err(e) => { + return Err(format!("expected initialized notification, got error: {e}",).to_owned().into()) + } + }?; + + Ok(()) + + } + + pub fn serve(this: Rc, init: F) -> Result<(), Box> + where + F: FnOnce(Rc>) -> S + 'a, + { + this.inner.client.borrow_mut().set_server(this.inner.self_ref.clone()); + let client = this.inner.client.clone(); + let service = LspService::new(client, init); + this.run_initialization(&service)?; + this.serve_loop(service)?; + Rc::into_inner(this).unwrap().inner.io_threads.join()?; + Ok(()) + } + + fn serve_loop(&self, service: LspService) -> Result<(), Box> { + for msg in &self.inner.connection.receiver { + match msg { + Message::Request(req) => { + let id = req.id.clone(); + let is_shutdown = self.inner.connection.handle_shutdown(&req)?; + let result = service.call_request(&req.method, req.params)?; + let resp = Response { id, result, error: None }; + if is_shutdown { + return Ok(()); + } + self.inner.connection.sender.send(Message::Response(resp))?; + continue; + } + Message::Response(resp) => { + eprintln!("got response: {resp:?}"); + } + Message::Notification(not) => { + service.call_notification(¬.method, not.params)?; + continue; + } + } + } + Ok(()) + } +} + +impl LspServer for LspStdioServer { + fn send(&self, msg: Message) { + let _ = self.inner.connection.sender.send(msg).map_err(|e| { + eprintln!("Error: {}", e); + }); + + } +} + + + + diff --git a/libs/lsp-server-wrapper/src/service.rs b/libs/lsp-server-wrapper/src/service.rs new file mode 100644 index 00000000..4e300403 --- /dev/null +++ b/libs/lsp-server-wrapper/src/service.rs @@ -0,0 +1,317 @@ +mod state; + +use std::cell::RefCell; +use std::error::Error; +use std::rc::Rc; +use std::sync::Arc; +use lsp_types::*; +use lsp_types::request::*; +pub use crate::client::Client; +use crate::{jsonrpc, LanguageServer}; +pub(crate) use self::state::{ServerState, State}; + + pub(super) struct InnerService { + backend: Arc, + //pub(super) client: Arc>, +} + +pub struct LspService { + state: Arc, + inner: InnerService, +} + +impl LspService { + pub fn new(client: Rc>, init: F) -> Self + where + F: FnOnce(Rc>) -> S, + { + let backend = init(client); + LspService { + state: Arc::new(ServerState::new()), + inner: InnerService { + backend: Arc::new(backend), + }, + } + } + + pub fn call_request(&self, method: &str, params: serde_json::Value) -> Result, Box> { + let ret = match method { + "initialize" => { + self.state.set(State::Initializing); + let params: InitializeParams = serde_json::from_value(params).unwrap(); + serde_json::to_value(self.inner.backend.initialize(params)?) + }, + "shutdown" => { + self.state.set(State::ShutDown); + serde_json::to_value(self.inner.backend.shutdown()?) + }, + "textDocument/willSaveWaitUntil" => { + let params: WillSaveTextDocumentParams = serde_json::from_value(params).unwrap(); + serde_json::to_value(self.inner.backend.will_save_wait_until(params)?) + }, + "textDocument/declaration" => { + let params: GotoDeclarationParams = serde_json::from_value(params).unwrap(); + serde_json::to_value(self.inner.backend.goto_declaration(params)?) + }, + "textDocument/definition" => { + let params: GotoDefinitionParams = serde_json::from_value(params).unwrap(); + serde_json::to_value(self.inner.backend.goto_definition(params)?) + }, + "textDocument/typeDefinition" => { + let params: GotoTypeDefinitionParams = serde_json::from_value(params).unwrap(); + serde_json::to_value(self.inner.backend.goto_type_definition(params)?) + }, + "textDocument/implementation" => { + let params: GotoImplementationParams = serde_json::from_value(params).unwrap(); + serde_json::to_value(self.inner.backend.goto_implementation(params)?) + }, + "textDocument/references" => { + let params: ReferenceParams = serde_json::from_value(params).unwrap(); + serde_json::to_value(self.inner.backend.references(params)?) + }, + "textDocument/prepareCallHierarchy" => { + let params: CallHierarchyPrepareParams = serde_json::from_value(params).unwrap(); + serde_json::to_value(self.inner.backend.prepare_call_hierarchy(params)?) + }, + "textDocument/incomingCalls" => { + let params: CallHierarchyIncomingCallsParams = serde_json::from_value(params).unwrap(); + serde_json::to_value(self.inner.backend.incoming_calls(params)?) + }, + "textDocument/outgoingCalls" => { + let params: CallHierarchyOutgoingCallsParams = serde_json::from_value(params).unwrap(); + serde_json::to_value(self.inner.backend.outgoing_calls(params)?) + }, + "textDocument/prepareTypeHierarchy" => { + let params: TypeHierarchyPrepareParams = serde_json::from_value(params).unwrap(); + serde_json::to_value(self.inner.backend.prepare_type_hierarchy(params)?) + }, + "textDocument/supertypes" => { + let params: TypeHierarchySupertypesParams = serde_json::from_value(params).unwrap(); + serde_json::to_value(self.inner.backend.supertypes(params)?) + }, + "textDocument/subtypes" => { + let params: TypeHierarchySubtypesParams = serde_json::from_value(params).unwrap(); + serde_json::to_value(self.inner.backend.subtypes(params)?) + }, + "textDocument/documentHighlight" => { + let params: DocumentHighlightParams = serde_json::from_value(params).unwrap(); + serde_json::to_value(self.inner.backend.document_highlight(params)?) + }, + "textDocument/documentLink" => { + let params: DocumentLinkParams = serde_json::from_value(params).unwrap(); + serde_json::to_value(self.inner.backend.document_link(params)?) + }, + "documentLink/resolve" => { + let params: DocumentLink = serde_json::from_value(params).unwrap(); + serde_json::to_value(self.inner.backend.document_link_resolve(params)?) + }, + "textDocument/hover" => { + let params: HoverParams = serde_json::from_value(params).unwrap(); + serde_json::to_value(self.inner.backend.hover(params)?) + }, + "textDocument/codeLens" => { + let params: CodeLensParams = serde_json::from_value(params).unwrap(); + serde_json::to_value(self.inner.backend.code_lens(params)?) + }, + "codeLens/resolve" => { + let params: CodeLens = serde_json::from_value(params).unwrap(); + serde_json::to_value(self.inner.backend.code_lens_resolve(params)?) + }, + "textDocument/foldingRange" => { + let params: FoldingRangeParams = serde_json::from_value(params).unwrap(); + serde_json::to_value(self.inner.backend.folding_range(params)?) + }, + "textDocument/selectionRange" => { + let params: SelectionRangeParams = serde_json::from_value(params).unwrap(); + serde_json::to_value(self.inner.backend.selection_range(params)?) + }, + "textDocument/documentSymbol" => { + let params: DocumentSymbolParams = serde_json::from_value(params).unwrap(); + serde_json::to_value(self.inner.backend.document_symbol(params)?) + }, + "textDocument/sementicTokens/full" => { + let params: SemanticTokensParams = serde_json::from_value(params).unwrap(); + serde_json::to_value(self.inner.backend.semantic_tokens_full(params)?) + }, + "textDocument/sementicTokens/full/delta" => { + let params: SemanticTokensDeltaParams = serde_json::from_value(params).unwrap(); + serde_json::to_value(self.inner.backend.semantic_tokens_full_delta(params)?) + }, + "textDocument/sementicTokens/range" => { + let params: SemanticTokensRangeParams = serde_json::from_value(params).unwrap(); + serde_json::to_value(self.inner.backend.semantic_tokens_range(params)?) + }, + "textDocument/inlineValue" => { + let params: InlineValueParams = serde_json::from_value(params).unwrap(); + serde_json::to_value(self.inner.backend.inline_value(params)?) + }, + "textDocument/inlayHint" => { + let params: InlayHintParams = serde_json::from_value(params).unwrap(); + serde_json::to_value(self.inner.backend.inlay_hint(params)?) + }, + "inlayHint/resolve" => { + let params: InlayHint = serde_json::from_value(params).unwrap(); + serde_json::to_value(self.inner.backend.inlay_hint_resolve(params)?) + }, + "textDocument/moniker" => { + let params: MonikerParams = serde_json::from_value(params).unwrap(); + serde_json::to_value(self.inner.backend.moniker(params)?) + }, + "textDocument/completion" => { + let params: CompletionParams = serde_json::from_value(params).unwrap(); + serde_json::to_value(self.inner.backend.completion(params)?) + }, + "completionItem/resolve" => { + let params: CompletionItem = serde_json::from_value(params).unwrap(); + serde_json::to_value(self.inner.backend.completion_resolve(params)?) + }, + "textDocument/diagnostic" => { + let params: DocumentDiagnosticParams = serde_json::from_value(params).unwrap(); + serde_json::to_value(self.inner.backend.diagnostic(params)?) + }, + "workspace/diagnostic" => { + let params: WorkspaceDiagnosticParams = serde_json::from_value(params).unwrap(); + serde_json::to_value(self.inner.backend.workspace_diagnostic(params)?) + }, + "textDocument/signatureHelp" => { + let params: SignatureHelpParams = serde_json::from_value(params).unwrap(); + serde_json::to_value(self.inner.backend.signature_help(params)?) + }, + "textDocument/codeAction" => { + let params: CodeActionParams = serde_json::from_value(params).unwrap(); + serde_json::to_value(self.inner.backend.code_action(params)?) + }, + "codeAction/resolve" => { + let params: CodeAction = serde_json::from_value(params).unwrap(); + serde_json::to_value(self.inner.backend.code_action_resolve(params)?) + }, + "textDocument/documentColor" => { + let params: DocumentColorParams = serde_json::from_value(params).unwrap(); + serde_json::to_value(self.inner.backend.document_color(params)?) + }, + "textDocument/colorPresentation" => { + let params: ColorPresentationParams = serde_json::from_value(params).unwrap(); + serde_json::to_value(self.inner.backend.color_presentation(params)?) + }, + "textDocument/formatting" => { + let params: DocumentFormattingParams = serde_json::from_value(params).unwrap(); + serde_json::to_value(self.inner.backend.formatting(params)?) + }, + "textDocument/rangeFormatting" => { + let params: DocumentRangeFormattingParams = serde_json::from_value(params).unwrap(); + serde_json::to_value(self.inner.backend.range_formatting(params)?) + }, + "textDocument/onTypeFormatting" => { + let params: DocumentOnTypeFormattingParams = serde_json::from_value(params).unwrap(); + serde_json::to_value(self.inner.backend.on_type_formatting(params)?) + }, + "textDocument/rename" => { + let params: RenameParams = serde_json::from_value(params).unwrap(); + serde_json::to_value(self.inner.backend.rename(params)?) + }, + "textDocument/prepareRename" => { + let params: TextDocumentPositionParams = serde_json::from_value(params).unwrap(); + serde_json::to_value(self.inner.backend.prepare_rename(params)?) + }, + "textDocument/linkedEditingRange" => { + let params: LinkedEditingRangeParams = serde_json::from_value(params).unwrap(); + serde_json::to_value(self.inner.backend.linked_editing_range(params)?) + }, + "workspace/symbol" => { + let params: WorkspaceSymbolParams = serde_json::from_value(params).unwrap(); + serde_json::to_value(self.inner.backend.symbol(params)?) + }, + "workspaceSymbol/resolve" => { + let params: WorkspaceSymbol = serde_json::from_value(params).unwrap(); + serde_json::to_value(self.inner.backend.symbol_resolve(params)?) + }, + "workspace/willCreateFiles" => { + let params: CreateFilesParams = serde_json::from_value(params).unwrap(); + serde_json::to_value(self.inner.backend.will_create_files(params)?) + }, + "workspace/willRenameFiles" => { + let params: RenameFilesParams = serde_json::from_value(params).unwrap(); + serde_json::to_value(self.inner.backend.will_rename_files(params)?) + }, + "workspace/willDeleteFiles" => { + let params: DeleteFilesParams = serde_json::from_value(params).unwrap(); + serde_json::to_value(self.inner.backend.will_delete_files(params)?) + }, + "workspace/executeCommand" => { + let params: ExecuteCommandParams = serde_json::from_value(params).unwrap(); + serde_json::to_value(self.inner.backend.execute_command(params)?) + }, + "exit" => { + self.state.set(State::Exited); + return Ok(None); + }, + _ => { + return Err(Box::new(jsonrpc::Error::method_not_found()).into()); + } + }.map_err( + |e| { + eprintln!("Error: {}", e); + Box::new(e) + } + )?; + Ok(Some(ret)) + } + + pub fn call_notification(&self, method: &str, params: serde_json::Value) -> Result<(), Box> { + match method { + "initialized" => { + self.state.set(State::Initialized); + let params: InitializedParams = serde_json::from_value(params).unwrap(); + self.inner.backend.initialized(params); + }, + "textDocument/didOpen" => { + let params: DidOpenTextDocumentParams = serde_json::from_value(params).unwrap(); + self.inner.backend.did_open(params); + }, + "textDocument/didChange" => { + let params: DidChangeTextDocumentParams = serde_json::from_value(params).unwrap(); + self.inner.backend.did_change(params); + }, + "textDocument/willSave" => { + let params: WillSaveTextDocumentParams = serde_json::from_value(params).unwrap(); + self.inner.backend.will_save(params); + }, + "textDocument/didSave" => { + let params: DidSaveTextDocumentParams = serde_json::from_value(params).unwrap(); + self.inner.backend.did_save(params); + }, + "textDocument/didClose" => { + let params: DidCloseTextDocumentParams = serde_json::from_value(params).unwrap(); + self.inner.backend.did_close(params); + }, + "workspace/didChangeConfiguration" => { + let params: DidChangeConfigurationParams = serde_json::from_value(params).unwrap(); + self.inner.backend.did_change_configuration(params); + }, + "workspace/didChangeWorkspaceFolders" => { + let params: DidChangeWorkspaceFoldersParams = serde_json::from_value(params).unwrap(); + self.inner.backend.did_change_workspace_folders(params); + }, + "workspace/didCreateFiles" => { + let params: CreateFilesParams = serde_json::from_value(params).unwrap(); + self.inner.backend.did_create_files(params) + }, + "workspace/didRenameFiles" => { + let params: RenameFilesParams = serde_json::from_value(params).unwrap(); + self.inner.backend.did_rename_files(params) + }, + "workspace/didDeleteFiles" => { + let params: DeleteFilesParams = serde_json::from_value(params).unwrap(); + self.inner.backend.did_delete_files(params) + }, + "workspace/didChangeWatchedFiles" => { + let params: DidChangeWatchedFilesParams = serde_json::from_value(params).unwrap(); + self.inner.backend.did_change_watched_files(params) + }, + _ => { + return Err("Method not found".to_owned().into()); + } + } + Ok(()) + } +} \ No newline at end of file diff --git a/libs/lsp-server-wrapper/src/service/state.rs b/libs/lsp-server-wrapper/src/service/state.rs new file mode 100644 index 00000000..c4ede1f7 --- /dev/null +++ b/libs/lsp-server-wrapper/src/service/state.rs @@ -0,0 +1,50 @@ +//! Types representing the current state of the language server. + +use std::fmt::{self, Debug, Formatter}; +use std::sync::atomic::{AtomicU8, Ordering}; + +/// A list of possible states the language server can be in. +#[derive(Clone, Copy, Debug, Eq, PartialEq)] +#[repr(u8)] +pub enum State { + /// Server has not received an `initialize` request. + Uninitialized = 0, + /// Server received an `initialize` request, but has not yet responded. + Initializing = 1, + /// Server received and responded success to an `initialize` request. + Initialized = 2, + /// Server received a `shutdown` request. + ShutDown = 3, + /// Server received an `exit` notification. + Exited = 4, +} + +/// Atomic value which represents the current state of the server. +pub struct ServerState(AtomicU8); + +impl ServerState { + pub const fn new() -> Self { + ServerState(AtomicU8::new(State::Uninitialized as u8)) + } + + pub fn set(&self, state: State) { + self.0.store(state as u8, Ordering::SeqCst); + } + + pub fn get(&self) -> State { + match self.0.load(Ordering::SeqCst) { + 0 => State::Uninitialized, + 1 => State::Initializing, + 2 => State::Initialized, + 3 => State::ShutDown, + 4 => State::Exited, + _ => unreachable!(), + } + } +} + +impl Debug for ServerState { + fn fmt(&self, f: &mut Formatter) -> fmt::Result { + self.get().fmt(f) + } +} \ No newline at end of file diff --git a/toolchains/solidity/linter/core/Cargo.lock b/toolchains/solidity/linter/core/Cargo.lock index 6bcd0178..715f9323 100644 --- a/toolchains/solidity/linter/core/Cargo.lock +++ b/toolchains/solidity/linter/core/Cargo.lock @@ -2,6 +2,21 @@ # It is not intended for manual editing. version = 3 +[[package]] +name = "addr2line" +version = "0.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a30b2e23b9e17a9f90641c7ab1549cd9b44f296d3ccbf309d2863cfe398a0cb" +dependencies = [ + "gimli", +] + +[[package]] +name = "adler" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" + [[package]] name = "anstream" version = "0.5.0" @@ -27,30 +42,6 @@ name = "anstyle-parse" version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "938874ff5980b03a87c5524b3ae5b59cf99b1d6bc836848df7bc5ada9643c333" -checksum = "216261ddc8289130e551ddcd5ce8a064710c0d064a4d2895c67151c92b5443f6" - -[[package]] -name = "arrayvec" -version = "0.7.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8da52d66c7071e2e3fa2a1e5c6d088fec47b593032b254f5e980de8ea54454d6" - -[[package]] -name = "async-trait" -version = "0.1.73" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc00ceb34980c03614e35a3a4e218276a0a824e911d07651cd0d858a51e8c0f0" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.31", -] - -[[package]] -name = "atty" -version = "0.2.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" dependencies = [ "utf8parse", ] @@ -62,10 +53,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5ca11d4be1bab0c8bc8734a9aa7bf4ee8316d462a08c6ac5052f888fef5b494b" dependencies = [ "windows-sys", - "proc-macro-error", - "proc-macro2", - "quote", - "syn 1.0.105", ] [[package]] @@ -95,12 +82,45 @@ dependencies = [ "thiserror", ] +[[package]] +name = "autocfg" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" + +[[package]] +name = "backtrace" +version = "0.3.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2089b7e3f35b9dd2d0ed921ead4f6d318c27680d4a5bd167b3ee120edb105837" +dependencies = [ + "addr2line", + "cc", + "cfg-if", + "libc", + "miniz_oxide", + "object", + "rustc-demangle", +] + +[[package]] +name = "bitflags" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" + [[package]] name = "bitflags" version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b4682ae6287fcf752ecaabbfcc7b6f9b72aa33933dc23a554d853aea8eea8635" +[[package]] +name = "bytes" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2bd12c1caf447e69cd4528f47f94d203fd2582878ecb9e9465484c4148a8223" + [[package]] name = "cc" version = "1.0.83" @@ -110,11 +130,17 @@ dependencies = [ "libc", ] +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + [[package]] name = "clap" -version = "4.4.3" +version = "4.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "84ed82781cea27b43c9b106a979fe450a13a31aab0500595fb3fc06616de08e6" +checksum = "b1d7b8d5ec32af0fadc644bf1fd509a688c2103b185644bb1e29d164e0703136" dependencies = [ "clap_builder", "clap_derive", @@ -122,9 +148,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.4.2" +version = "4.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2bb9faaa7c2ef94b2743a21f5a29e6f0010dff4caa69ac8e9d6cf8b6fa74da08" +checksum = "5179bb514e4d7c2051749d8fcefa2ed6d06a9f4e6d69faf3805f5d80b8cf8d56" dependencies = [ "anstream", "anstyle", @@ -141,20 +167,7 @@ dependencies = [ "heck", "proc-macro2", "quote", - "syn 1.0.105", -] - -[[package]] -name = "clap_derive" -version = "4.0.21" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0177313f9f02afc995627906bbd8967e2be069f5261954222dac78290c2b9014" -dependencies = [ - "heck", - "proc-macro-error", - "proc-macro2", - "quote", - "syn 1.0.105", + "syn", ] [[package]] @@ -181,138 +194,20 @@ dependencies = [ ] [[package]] -name = "console" -version = "0.14.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3993e6445baa160675931ec041a5e03ca84b9c6e32a056150d3aa2bdda0a1f45" -dependencies = [ - "encode_unicode", - "lazy_static", - "libc", - "regex", - "terminal_size", - "unicode-width", - "winapi", -] - -[[package]] -name = "console" -version = "0.15.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c050367d967ced717c04b65d8c619d863ef9292ce0c5760028655a2fb298718c" -dependencies = [ - "encode_unicode", - "lazy_static", - "libc", - "terminal_size", - "winapi", -] - -[[package]] -name = "constant_time_eq" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "245097e9a4535ee1e3e3931fcfcd55a796a44c643e8596ff6566d68f09b87bbc" - -[[package]] -name = "cpufeatures" -version = "0.2.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28d997bd5e24a5928dd43e46dc529867e207907fe0b239c3477d924f7f2ca320" -dependencies = [ - "libc", -] - -[[package]] -name = "crc32fast" -version = "1.3.2" +name = "crossbeam-channel" +version = "0.5.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b540bd8bc810d3885c6ea91e2018302f68baba2129ab3e88f32389ee9370880d" +checksum = "a33c2bf77f2df06183c3aa30d1e96c0695a313d4f9c453cc3762a6db39f99200" dependencies = [ "cfg-if", + "crossbeam-utils", ] [[package]] name = "crossbeam-utils" -version = "0.8.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fb766fa798726286dbbb842f174001dab8abc7b627a1dd86e0b7222a95d929f" -dependencies = [ - "cfg-if", -] - -[[package]] -name = "crypto-common" -version = "0.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" -dependencies = [ - "generic-array", - "typenum", -] - -[[package]] -name = "dashmap" -version = "5.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "907076dfda823b0b36d2a1bb5f90c96660a5bbcd7729e10727f07858f22c4edc" -dependencies = [ - "cfg-if", - "hashbrown", - "lock_api", - "once_cell", - "parking_lot_core", -] - -[[package]] -name = "dialoguer" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c9dd058f8b65922819fabb4a41e7d1964e56344042c26efbccd465202c23fa0c" -dependencies = [ - "console 0.14.1", - "lazy_static", - "tempfile", - "zeroize", -] - -[[package]] -name = "digest" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3dd60d1080a57a05ab032377049e0591415d2b31afd7028356dbf3cc6dcb066" -dependencies = [ - "generic-array", -] - -[[package]] -name = "digest" -version = "0.10.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8168378f4e5023e7218c89c891c0fd8ecdb5e5e4f18cb78f38cf245dd021e76f" -dependencies = [ - "block-buffer 0.10.3", - "crypto-common", - "subtle", -] - -[[package]] -name = "either" -version = "1.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90e5c1c8368803113bf0c9584fc495a58b86dc8a29edbf8fe877d21d9507e797" - -[[package]] -name = "encode_unicode" -version = "0.3.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a357d28ed41a50f9c765dbfe56cbc04a64e53e5fc58ba79fbc34c10ef3df831f" - -[[package]] -name = "encoding_rs" -version = "0.8.31" +version = "0.8.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9852635589dc9f9ea1b6fe9f05b50ef208c85c834a562f0c6abb1c475736ec2b" +checksum = "5a22b2d63d4d1dc0b7f1b6b2747dd0088008a9be28b6ddf0b1e7d335e3037294" dependencies = [ "cfg-if", ] @@ -338,136 +233,20 @@ dependencies = [ "libc", ] -[[package]] -name = "fastrand" -version = "1.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7a407cfaa3385c4ae6b23e84623d48c2798d06e3e6a1878f7f59f17b3f86499" -dependencies = [ - "instant", -] - -[[package]] -name = "flate2" -version = "1.0.25" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8a2db397cb1c8772f31494cb8917e48cd1e64f0fa7efac59fbd741a0a8ce841" -dependencies = [ - "crc32fast", - "miniz_oxide", -] - -[[package]] -name = "fnv" -version = "1.0.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" - [[package]] name = "form_urlencoded" -version = "1.1.0" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9c384f161156f5260c24a097c56119f9be8c798586aecc13afbcbe7b7e26bf8" +checksum = "a62bc1cf6f830c2ec14a513a9fb124d0a213a629668a4186f329db21fe045652" dependencies = [ "percent-encoding", ] [[package]] -name = "fs2" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9564fc758e15025b46aa6643b1b77d047d1a56a1aea6e01002ac0c7026876213" -dependencies = [ - "libc", - "winapi", -] - -[[package]] -name = "futures" -version = "0.3.28" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23342abe12aba583913b2e62f22225ff9c950774065e4bfb61a19cd9770fec40" -dependencies = [ - "futures-channel", - "futures-core", - "futures-io", - "futures-sink", - "futures-task", - "futures-util", -] - -[[package]] -name = "futures-channel" -version = "0.3.28" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "955518d47e09b25bbebc7a18df10b81f0c766eaf4c4f1cccef2fca5f2a4fb5f2" -dependencies = [ - "futures-core", - "futures-sink", -] - -[[package]] -name = "futures-core" -version = "0.3.28" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4bca583b7e26f571124fe5b7561d49cb2868d79116cfa0eefce955557c6fee8c" - -[[package]] -name = "futures-io" -version = "0.3.28" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fff74096e71ed47f8e023204cfd0aa1289cd54ae5430a9523be060cdb849964" - -[[package]] -name = "futures-macro" -version = "0.3.28" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89ca545a94061b6365f2c7355b4b32bd20df3ff95f02da9329b34ccc3bd6ee72" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.31", -] - -[[package]] -name = "futures-sink" -version = "0.3.28" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f43be4fe21a13b9781a69afa4985b0f6ee0e1afab2c6f454a8cf30e2b2237b6e" - -[[package]] -name = "futures-task" -version = "0.3.28" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76d3d132be6c0e6aa1534069c705a74a5997a356c0dc2f86a47765e5617c5b65" - -[[package]] -name = "futures-util" -version = "0.3.28" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26b01e40b772d54cf6c6d721c1d1abd0647a0106a12ecaa1c186273392a69533" -dependencies = [ - "futures-channel", - "futures-core", - "futures-io", - "futures-macro", - "futures-sink", - "futures-task", - "memchr", - "pin-project-lite", - "pin-utils", - "slab", -] - -[[package]] -name = "generic-array" -version = "0.14.6" +name = "gimli" +version = "0.28.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bff49e947297f3312447abdca79f45f4738097cc82b06e72054d2223f601f1b9" -dependencies = [ - "typenum", - "version_check", -] +checksum = "6fb8d784f27acf97159b40fc4db5ecd8aa23b9ad5ef69cdd136d3bc80665f0c0" [[package]] name = "glob" @@ -483,9 +262,19 @@ checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" [[package]] name = "hermit-abi" -version = "0.3.2" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d77f7ec81a6d05a3abb01ab6eb7590f6083d08449fe5a1c8b1e620283546ccb7" + +[[package]] +name = "idna" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "443144c8cdadd93ebf52ddb4056d257f5b52c04d3c804e657d19eb73fc33668b" +checksum = "7d20d6b07bfbc108882d88ed8e37d39636dcc260e15e30c45e6ba089610b917c" +dependencies = [ + "unicode-bidi", + "unicode-normalization", +] [[package]] name = "is-terminal" @@ -523,18 +312,42 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1a9bad9f94746442c783ca431b22403b519cd7fbeed0533fdd6328b2f2212128" [[package]] -name = "paste" -version = "1.0.14" +name = "lock_api" +version = "0.4.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de3145af08024dea9fa9914f381a17b8fc6034dfb00f3a84013f7ff43f29ed4c" +checksum = "c1cc9717a20b1bb222f333e6a92fd32f7d8a18ddc5a3191a11af45dcbf4dcd16" +dependencies = [ + "autocfg", + "scopeguard", +] [[package]] name = "log" -version = "0.4.17" +version = "0.4.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" + +[[package]] +name = "lsp-server" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "abb12e687cfb44aa40f41fc3978ef76448f9b6038cad6aef4259d3c095a2382e" +checksum = "b52dccdf3302eefab8c8a1273047f0a3c3dca4b527c8458d00c09484c8371928" dependencies = [ - "cfg-if", + "crossbeam-channel", + "log", + "serde", + "serde_json", +] + +[[package]] +name = "lsp-server-wrapper" +version = "0.1.0" +dependencies = [ + "lsp-server", + "lsp-types", + "serde", + "serde_json", + "tracing", ] [[package]] @@ -543,7 +356,7 @@ version = "0.94.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c66bfd44a06ae10647fe3f8214762e9369fd4248df1350924b4ef9e770a85ea1" dependencies = [ - "bitflags", + "bitflags 1.3.2", "serde", "serde_json", "serde_repr", @@ -552,81 +365,54 @@ dependencies = [ [[package]] name = "memchr" -version = "2.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" - -[[package]] -name = "mime" -version = "0.3.16" +version = "2.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a60c7ce501c71e03a9c9c0d35b861413ae925bd979cc7a4e30d060069aaac8d" +checksum = "8f232d6ef707e1956a43342693d2a31e72989554d58299d7a88738cc95b0d35c" [[package]] name = "miniz_oxide" -version = "0.6.2" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b275950c28b37e794e8c55d88aeb5e139d0ce23fdbbeda68f8d7174abdf9e8fa" +checksum = "e7810e0be55b428ada41041c41f32c9f1a42817901b4ccf45fa3d4b6561e74c7" dependencies = [ "adler", ] [[package]] name = "mio" -version = "0.8.5" +version = "0.8.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5d732bc30207a6423068df043e3d02e0735b155ad7ce1a6f76fe2baa5b158de" +checksum = "927a765cd3fc26206e66b296465fa9d3e5ab003e651c1b3c060e7956d96b19d2" dependencies = [ "libc", - "log", "wasi", "windows-sys", ] [[package]] name = "num_cpus" -version = "1.14.0" +version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6058e64324c71e02bc2b150e4f3bc8286db6c83092132ffa3f6b1eab0f9def5" +checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" dependencies = [ - "hermit-abi 0.1.19", + "hermit-abi", "libc", ] [[package]] -name = "number_prefix" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "830b246a0e5f20af87141b25c173cd1b609bd7779a4617d6ec582abaf90870f3" - -[[package]] -name = "once_cell" -version = "1.16.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86f0b0d4bf799edbc74508c1e8bf170ff5f41238e5f8225603ca7caaae2b7860" - -[[package]] -name = "opaque-debug" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5" - -[[package]] -name = "open-fastrlp" -version = "0.1.4" +name = "object" +version = "0.32.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "786393f80485445794f6043fd3138854dd109cc6c4bd1a6383db304c9ce9b9ce" +checksum = "9cf5f9dd3933bd50a9e1f149ec995f39ae2c496d31fd772c1fd45ebc27e902b0" dependencies = [ - "arrayvec", - "auto_impl", - "bytes", + "memchr", ] [[package]] -name = "os_str_bytes" -version = "6.4.1" +name = "once_cell" +version = "1.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b7820b9daea5457c9f21c69448905d723fbd21136ccf521748f23fd49e723ee" +checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d" [[package]] name = "parking_lot" @@ -640,135 +426,75 @@ dependencies = [ [[package]] name = "parking_lot_core" -version = "0.9.5" +version = "0.9.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ff9f3fef3968a3ec5945535ed654cb38ff72d7495a25619e2247fb15a2ed9ba" +checksum = "93f00c865fe7cabf650081affecd3871070f26767e7b2070a3ffae14c654b447" dependencies = [ "cfg-if", "libc", "redox_syscall", "smallvec", - "windows-sys", + "windows-targets", ] [[package]] -name = "password-hash" -version = "0.4.2" +name = "paste" +version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7676374caaee8a325c9e7a2ae557f216c5563a171d6997b0ef8a65af35147700" -dependencies = [ - "base64ct", - "rand_core", - "subtle", -] +checksum = "de3145af08024dea9fa9914f381a17b8fc6034dfb00f3a84013f7ff43f29ed4c" [[package]] -name = "pbkdf2" -version = "0.11.0" +name = "percent-encoding" +version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83a0692ec44e4cf1ef28ca317f14f8f07da2d95ec3fa01f86e4467b725e60917" -dependencies = [ - "digest 0.10.6", - "hmac", - "password-hash", - "sha2 0.10.6", -] +checksum = "9b2a4787296e9989611394c33f193f676704af1686e70b8f8033ab5ba9a35a94" [[package]] -name = "percent-encoding" -version = "2.2.0" +name = "pin-project-lite" +version = "0.2.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "478c572c3d73181ff3c2539045f6eb99e5491218eae919370993b890cdbdd98e" +checksum = "8afb450f006bf6385ca15ef45d71d2288452bc3683ce2e2cacc0d18e4be60b58" [[package]] -name = "pin-project" -version = "1.1.3" +name = "proc-macro2" +version = "1.0.67" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fda4ed1c6c173e3fc7a83629421152e01d7b1f9b7f65fb301e490e8cfc656422" +checksum = "3d433d9f1a3e8c1263d9456598b16fec66f4acc9a74dacffd35c7bb09b3a1328" dependencies = [ - "pin-project-internal", + "unicode-ident", ] [[package]] -name = "pin-project-internal" -version = "1.1.3" +name = "quote" +version = "1.0.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4359fd9c9171ec6e8c62926d6faaf553a8dc3f64e1507e76da7911b4f6a04405" +checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" dependencies = [ "proc-macro2", - "quote", - "syn 2.0.31", ] [[package]] -name = "pin-project-lite" -version = "0.2.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0a7ae3ac2f1173085d398531c705756c94a4c56843785df85a60c1a0afac116" - -[[package]] -name = "pin-utils" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" - -[[package]] -name = "pkg-config" -version = "0.3.26" +name = "redox_syscall" +version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ac9a59f73473f1b8d852421e59e64809f025994837ef743615c6d0c5b305160" - -[[package]] -name = "proc-macro-error" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" +checksum = "567664f262709473930a4bf9e51bf2ebf3348f2e748ccc50dea20646858f8f29" dependencies = [ - "proc-macro-error-attr", - "proc-macro2", - "quote", - "syn 1.0.105", - "version_check", + "bitflags 1.3.2", ] [[package]] -name = "proc-macro-error-attr" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" -dependencies = [ - "proc-macro2", - "quote", - "version_check", -] - -[[package]] -name = "proc-macro2" -version = "1.0.67" -version = "1.0.66" +name = "rustc-demangle" +version = "0.1.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d433d9f1a3e8c1263d9456598b16fec66f4acc9a74dacffd35c7bb09b3a1328" -checksum = "18fb31db3f9bddb2ea821cde30a9f70117e3f119938b5ee630b7403aa6e2ead9" -dependencies = [ - "unicode-ident", -] - -[[package]] -name = "quote" -version = "1.0.33" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" -dependencies = [ - "proc-macro2", -] +checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" [[package]] name = "rustix" -version = "0.38.13" +version = "0.38.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7db8590df6dfcd144d22afd1b83b36c21a18d7cbc1dc4bb5295a8712e9eb662" +checksum = "747c788e9ce8e92b12cd485c49ddf90723550b654b32508f979b71a7b1ecda4f" dependencies = [ - "bitflags", + "bitflags 2.4.0", "errno", "libc", "linux-raw-sys", @@ -781,6 +507,12 @@ version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1ad4cc8da4ef723ed60bced201181d83791ad433213d8c24efffda1eec85d741" +[[package]] +name = "scopeguard" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" + [[package]] name = "serde" version = "1.0.188" @@ -798,7 +530,7 @@ checksum = "4eca7ac642d82aa35b60049a6eccb4be6be75e599bd2e9adb5f875a737654af2" dependencies = [ "proc-macro2", "quote", - "syn 1.0.105", + "syn", ] [[package]] @@ -820,105 +552,32 @@ checksum = "8725e1dfadb3a50f7e5ce0b1a540466f6ed3fe7a0fca2ac2b8b831d31316bd00" dependencies = [ "proc-macro2", "quote", - "syn 2.0.31", -] - -[[package]] -name = "serde_urlencoded" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd" -dependencies = [ - "form_urlencoded", - "itoa", - "ryu", - "serde", -] - -[[package]] -name = "sha1" -version = "0.10.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f04293dc80c3993519f2d7f6f511707ee7094fe0c6d3406feb330cdb3540eba3" -dependencies = [ - "cfg-if", - "cpufeatures", - "digest 0.10.6", -] - -[[package]] -name = "sha2" -version = "0.9.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d58a1e1bf39749807d89cf2d98ac2dfa0ff1cb3faa38fbb64dd88ac8013d800" -dependencies = [ - "block-buffer 0.9.0", - "cfg-if", - "cpufeatures", - "digest 0.9.0", - "opaque-debug", -] - -[[package]] -name = "sha2" -version = "0.10.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "82e6b795fe2e3b1e845bafcb27aa35405c4d47cdfc92af5fc8d3002f76cebdc0" -dependencies = [ - "cfg-if", - "cpufeatures", - "digest 0.10.6", + "syn", ] [[package]] name = "signal-hook-registry" -version = "1.4.0" +version = "1.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e51e73328dc4ac0c7ccbda3a494dfa03df1de2f46018127f60c693f2648455b0" +checksum = "d8229b473baa5980ac72ef434c4415e70c4b5e71b423043adb4ba059f89c99a1" dependencies = [ "libc", ] -[[package]] -name = "slab" -version = "0.4.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4614a76b2a8be0058caa9dbbaf66d988527d86d003c11a94fbd335d7661edcef" -dependencies = [ - "autocfg", -] - [[package]] name = "smallvec" -version = "1.10.0" +version = "1.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a507befe795404456341dfab10cef66ead4c041f62b8b11bbb92bffe5d0953e0" +checksum = "942b4a808e05215192e39f4ab80813e599068285906cc91aa64f923db842bd5a" [[package]] name = "socket2" -version = "0.4.7" +version = "0.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02e2d2db9033d13a1567121ddd7a095ee144db4e1ca1b1bda3419bc0da294ebd" +checksum = "4031e820eb552adee9295814c0ced9e5cf38ddf1e8b7d566d6de8e2538ea989e" dependencies = [ "libc", - "winapi", -] - -[[package]] -name = "solc-wrapper" -version = "0.1.0" -dependencies = [ - "anyhow", - "hex", - "home", - "once_cell", - "open-fastrlp", - "regex", - "semver", - "serde", - "serde_json", - "svm-rs", - "thiserror", + "windows-sys", ] [[package]] @@ -929,12 +588,13 @@ dependencies = [ "clap", "colored", "glob", + "lsp-server", + "lsp-server-wrapper", + "lsp-types", "serde", "serde_json", "solidhunter-lib", "thiserror", - "tokio", - "tower-lsp", ] [[package]] @@ -949,6 +609,7 @@ dependencies = [ "serde", "serde_json", "thiserror", + "tokio", ] [[package]] @@ -959,9 +620,9 @@ checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" [[package]] name = "syn" -version = "2.0.33" +version = "2.0.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9caece70c63bfba29ec2fed841a09851b14a235c60010fa4de58089b6c025668" +checksum = "7303ef2c05cd654186cb250d29049a24840ca25d2747c25c0381c8d9e2f582e8" dependencies = [ "proc-macro2", "quote", @@ -971,19 +632,6 @@ dependencies = [ [[package]] name = "syn-solidity" version = "0.3.2" -name = "syn" -version = "2.0.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "718fa2415bcb8d8bd775917a1bf12a7931b6dfa890753378538118181e0cb398" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "tempfile" -version = "3.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "397f229dc34c7b8231b6ef85502f9ca4e3425b8625e6d403bb74779e6b1917b5" dependencies = [ @@ -1010,34 +658,7 @@ checksum = "49922ecae66cc8a249b77e68d1d0623c1b2c514f0060c27cdc68bd62a1219d35" dependencies = [ "proc-macro2", "quote", - "syn 1.0.105", -] - -[[package]] -name = "time" -version = "0.3.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a561bf4617eebd33bca6434b988f39ed798e527f51a1e797d0ee4f61c0a38376" -dependencies = [ - "itoa", - "serde", - "time-core", - "time-macros", -] - -[[package]] -name = "time-core" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e153e1f1acaef8acc537e68b44906d2db6436e2b35ac2c6b42640fff91f00fd" - -[[package]] -name = "time-macros" -version = "0.2.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d967f99f534ca7e495c575c62638eebc2898a8c84c119b89e250477bc4ba16b2" -dependencies = [ - "time-core", + "syn", ] [[package]] @@ -1051,20 +672,19 @@ dependencies = [ [[package]] name = "tinyvec_macros" -version = "0.1.0" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c" +checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.23.0" +version = "1.32.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eab6d665857cc6ca78d6e80303a02cea7a7851e85dfbd77cbdc09bd129f1ef46" +checksum = "17ed6077ed6cd6c74735e21f37eb16dc3935f96878b1fe961074089cc80893f9" dependencies = [ - "autocfg", + "backtrace", "bytes", "libc", - "memchr", "mio", "num_cpus", "parking_lot", @@ -1077,100 +697,15 @@ dependencies = [ [[package]] name = "tokio-macros" -version = "1.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d266c00fde287f55d3f1c3e96c500c362a2b8c695076ec180f27918820bc6df8" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.105", -] - -[[package]] -name = "tokio-rustls" -version = "0.23.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c43ee83903113e03984cb9e5cebe6c04a5116269e900e3ddba8f068a62adda59" -dependencies = [ - "rustls", - "tokio", - "webpki", -] - -[[package]] -name = "tokio-util" -version = "0.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0bb2e075f03b3d66d8d8785356224ba688d2906a371015e225beeb65ca92c740" -dependencies = [ - "bytes", - "futures-core", - "futures-sink", - "pin-project-lite", - "tokio", - "tracing", -] - -[[package]] -name = "tower" -version = "0.4.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8fa9be0de6cf49e536ce1851f987bd21a43b771b09473c3549a6c853db37c1c" -dependencies = [ - "futures-core", - "futures-util", - "pin-project", - "pin-project-lite", - "tower-layer", - "tower-service", -] - -[[package]] -name = "tower-layer" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c20c8dbed6283a09604c3e69b4b7eeb54e298b8a600d4d5ecb5ad39de609f1d0" - -[[package]] -name = "tower-lsp" -version = "0.20.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4ba052b54a6627628d9b3c34c176e7eda8359b7da9acd497b9f20998d118508" -dependencies = [ - "async-trait", - "auto_impl", - "bytes", - "dashmap", - "futures", - "httparse", - "lsp-types", - "memchr", - "serde", - "serde_json", - "tokio", - "tokio-util", - "tower", - "tower-lsp-macros", - "tracing", -] - -[[package]] -name = "tower-lsp-macros" -version = "0.9.0" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "84fd902d4e0b9a4b27f2f440108dc034e1758628a9b702f8ec61ad66355422fa" +checksum = "630bdcf245f78637c13ec01ffae6187cca34625e8c63150d424b59e55af2675e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.31", + "syn", ] -[[package]] -name = "tower-service" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" - [[package]] name = "tracing" version = "0.1.37" @@ -1185,41 +720,29 @@ dependencies = [ [[package]] name = "tracing-attributes" -version = "0.1.23" +version = "0.1.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4017f8f45139870ca7e672686113917c71c7a6e02d4924eda67186083c03081a" +checksum = "5f4f31f56159e98206da9efd823404b79b6ef3143b4a7ab76e67b1751b25a4ab" dependencies = [ "proc-macro2", "quote", - "syn 1.0.105", + "syn", ] [[package]] name = "tracing-core" -version = "0.1.30" +version = "0.1.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24eb03ba0eab1fd845050058ce5e616558e8f8d8fca633e6b163fe25c797213a" +checksum = "0955b8137a1df6f1a2e9a37d8a6656291ff0297c1a97c24e0d8425fe2312f79a" dependencies = [ "once_cell", ] -[[package]] -name = "try-lock" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59547bce71d9c38b83d9c0e92b6066c4253371f15005def0c30d9657f50c7642" - -[[package]] -name = "typenum" -version = "1.16.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "497961ef93d974e23eb6f433eb5fe1b7930b659f06d12dec6fc44a8f554c0bba" - [[package]] name = "unicode-bidi" -version = "0.3.8" +version = "0.3.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "099b7128301d285f79ddd55b9a83d5e6b9e97c92e0ea0daebee7263e932de992" +checksum = "92888ba5573ff080736b3648696b70cafad7d250551175acbaa4e0385b3e1460" [[package]] name = "unicode-ident" @@ -1228,18 +751,20 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" [[package]] -name = "utf8parse" -version = "0.2.1" +name = "unicode-normalization" +version = "0.1.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a" +checksum = "5c5713f0fc4b5db668a2ac63cdb7bb4469d8c9fed047b1d0292cc7b0ce2ba921" +dependencies = [ + "tinyvec", +] [[package]] -name = "windows-sys" -version = "0.48.0" +name = "url" +version = "2.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" +checksum = "143b538f18257fac9cad154828a57c6bf5157e1aa604d4816b5995bf6de87ae5" dependencies = [ - "windows-targets", "form_urlencoded", "idna", "percent-encoding", @@ -1247,14 +772,10 @@ dependencies = [ ] [[package]] -name = "windows-targets" -version = "0.48.5" +name = "utf8parse" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" -dependencies = [ - "log", - "try-lock", -] +checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a" [[package]] name = "wasi" @@ -1263,136 +784,19 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] -name = "wasm-bindgen" -version = "0.2.83" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eaf9f5aceeec8be17c128b2e93e031fb8a4d469bb9c4ae2d7dc1888b26887268" -dependencies = [ - "cfg-if", - "wasm-bindgen-macro", -] - -[[package]] -name = "wasm-bindgen-backend" -version = "0.2.83" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c8ffb332579b0557b52d268b91feab8df3615f265d5270fec2a8c95b17c1142" -dependencies = [ - "bumpalo", - "log", - "once_cell", - "proc-macro2", - "quote", - "syn 1.0.105", - "wasm-bindgen-shared", -] - -[[package]] -name = "wasm-bindgen-futures" -version = "0.4.33" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23639446165ca5a5de86ae1d8896b737ae80319560fbaa4c2887b7da6e7ebd7d" -dependencies = [ - "cfg-if", - "js-sys", - "wasm-bindgen", - "web-sys", -] - -[[package]] -name = "wasm-bindgen-macro" -version = "0.2.83" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "052be0f94026e6cbc75cdefc9bae13fd6052cdcaf532fa6c45e7ae33a1e6c810" -dependencies = [ - "quote", - "wasm-bindgen-macro-support", -] - -[[package]] -name = "wasm-bindgen-macro-support" -version = "0.2.83" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07bc0c051dc5f23e307b13285f9d75df86bfdf816c5721e573dec1f9b8aa193c" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.105", - "wasm-bindgen-backend", - "wasm-bindgen-shared", -] - -[[package]] -name = "wasm-bindgen-shared" -version = "0.2.83" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c38c045535d93ec4f0b4defec448e4291638ee608530863b1e2ba115d4fff7f" - -[[package]] -name = "web-sys" -version = "0.3.60" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bcda906d8be16e728fd5adc5b729afad4e444e106ab28cd1c7256e54fa61510f" -dependencies = [ - "js-sys", - "wasm-bindgen", -] - -[[package]] -name = "webpki" -version = "0.22.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f095d78192e208183081cc07bc5515ef55216397af48b873e5edcd72637fa1bd" -dependencies = [ - "ring", - "untrusted", -] - -[[package]] -name = "webpki-roots" -version = "0.22.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6c71e40d7d2c34a5106301fb632274ca37242cd0c9d3e64dbece371a40a2d87" -dependencies = [ - "webpki", -] - -[[package]] -name = "winapi" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" -dependencies = [ - "winapi-i686-pc-windows-gnu", - "winapi-x86_64-pc-windows-gnu", -] - -[[package]] -name = "winapi-i686-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" - -[[package]] -name = "winapi-util" -version = "0.1.5" +name = "windows-sys" +version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" +checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" dependencies = [ - "winapi", + "windows-targets", ] [[package]] -name = "winapi-x86_64-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" - -[[package]] -name = "windows-sys" -version = "0.42.0" +name = "windows-targets" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a3e1820f08b8513f676f7ab6c1f99ff312fb97b553d30ff4dd86f9f15728aa7" +checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" dependencies = [ "windows_aarch64_gnullvm", "windows_aarch64_msvc", diff --git a/toolchains/solidity/linter/core/Cargo.toml b/toolchains/solidity/linter/core/Cargo.toml index e5a20d38..a240ad10 100644 --- a/toolchains/solidity/linter/core/Cargo.toml +++ b/toolchains/solidity/linter/core/Cargo.toml @@ -14,5 +14,6 @@ solidhunter-lib = { path = "./solidhunter-lib" } anyhow = "1.0" glob = "0.3.0" thiserror = "1.0" -tower-lsp = "0.20.0" -tokio = { version = "1.17.0", features = ["full"] } +lsp-types = "0.94.1" +lsp-server = "0.7.4" +lsp-server-wrapper = { path = "../../../../libs/lsp-server-wrapper" } \ No newline at end of file diff --git a/toolchains/solidity/linter/core/solidhunter-lib/Cargo.toml b/toolchains/solidity/linter/core/solidhunter-lib/Cargo.toml index ea598b75..c41e9990 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/Cargo.toml +++ b/toolchains/solidity/linter/core/solidhunter-lib/Cargo.toml @@ -14,3 +14,4 @@ anyhow = "1.0" glob = "0.3.0" thiserror = "1.0" ast-extractor = { path = "../../../../../libs/ast-extractor" } +tokio = { version = "1.17.0", features = ["full"] } diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/linter.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/linter.rs index ac2ce6a5..c61bc1e4 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/linter.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/linter.rs @@ -1,7 +1,7 @@ use crate::errors::SolidHunterError; use crate::rules::factory::RuleFactory; use crate::rules::create_default_rules; -use crate::rules::rule_impl::{create_rules_file, parse_rules}; +use crate::rules::rule_impl::parse_rules; use crate::rules::types::*; use crate::types::*; use std::fs; diff --git a/toolchains/solidity/linter/core/src/lsp_server.rs b/toolchains/solidity/linter/core/src/lsp_server.rs deleted file mode 100644 index dd3d8f2a..00000000 --- a/toolchains/solidity/linter/core/src/lsp_server.rs +++ /dev/null @@ -1,144 +0,0 @@ -use std::sync::{Arc}; -use tokio::sync::Mutex; - -use solidhunter_lib::linter::SolidLinter; -use solidhunter_lib::types::LintDiag; -use tower_lsp::jsonrpc::Result; -use tower_lsp::lsp_types::*; -use tower_lsp::{Client, LanguageServer, LspService, Server}; - -use crate::Args; - -struct Backend { - client: Client, - config_file_path: String, - working_dir: String, - linter: Arc>> -} - -#[tower_lsp::async_trait] -impl LanguageServer for Backend { - async fn initialize(&self, _: InitializeParams) -> Result { - Ok(InitializeResult { - server_info: None, - capabilities: ServerCapabilities { - text_document_sync: Some(TextDocumentSyncCapability::Kind( - TextDocumentSyncKind::FULL, - )), - ..ServerCapabilities::default() - }, - }) - } - - async fn initialized(&self, _: InitializedParams) { - self.client - .log_message(MessageType::INFO, "Server initialized!") - .await; - - let file_res = std::fs::read_to_string(&self.config_file_path); - - if let Ok(file) = file_res { - let mut linter = self.linter.lock().await; - linter.replace(SolidLinter::new(&file)); - } else { - let mut linter = self.linter.lock().await; - linter.replace(SolidLinter::new_fileless()); - } - - self.client - .log_message(MessageType::INFO, "Linter initialized!") - .await; - - } - - async fn shutdown(&self) -> Result<()> { - self.client - .log_message(MessageType::INFO, "Server shutdown!") - .await; - Ok(()) - } - - async fn did_open(&self, params: DidOpenTextDocumentParams) { - self.client - .log_message(MessageType::INFO, "file opened!") - .await; - - let mut linter = self.linter.lock().await; - let filepath = filepath_from_uri(¶ms.text_document.uri); - let linter = linter.as_mut().unwrap(); - let diags_res = linter.parse_content(filepath, ¶ms.text_document.text); - - if let Ok(diags) = diags_res { - let diags = diags.iter().map(|d| diagnostic_from_lintdiag(d.clone())).collect(); - self.client.log_message(MessageType::INFO, "diags: ").await; - self.client.publish_diagnostics(params.text_document.uri.clone(), diags, None).await; - //self.client.publish_diagnostics(params.text_document.uri, diags, None).await; - } else if let Err(e) = diags_res { - self.client.log_message(MessageType::ERROR, e.to_string()).await; - } - - } - - async fn did_change(&self, params: DidChangeTextDocumentParams) { - self.client - .log_message(MessageType::INFO, "file changed!") - .await; - - let mut linter = self.linter.lock().await; - let filepath = filepath_from_uri(¶ms.text_document.uri); - let linter = linter.as_mut().unwrap(); - let diags_res = linter.parse_content(filepath, ¶ms.content_changes[0].text); - - if let Ok(diags) = diags_res { - let diags = diags.iter().map(|d| diagnostic_from_lintdiag(d.clone())).collect(); - self.client.log_message(MessageType::INFO, "diags: ").await; - self.client.publish_diagnostics(params.text_document.uri.clone(), diags, None).await; - //self.client.publish_diagnostics(params.text_document.uri, diags, None).await; - } else if let Err(e) = diags_res { - self.client.log_message(MessageType::ERROR, e.to_string()).await; - } - } -} - -pub fn filepath_from_uri(uri: &Url) -> String { - let path = uri.path(); -// let path = path.strip_prefix("/").unwrap_or(path); - path.to_string() -} - -fn diagnostic_from_lintdiag(diag: LintDiag) -> Diagnostic { - Diagnostic { - range: Range { - start: Position { - line: diag.range.start.line as u32, - character: diag.range.start.character as u32, - }, - end: Position { - line: diag.range.end.line as u32, - character: diag.range.end.character as u32, - }, - }, - severity: Some(DiagnosticSeverity::WARNING), - code: None, - code_description: None, - source: Some("solidity-linter".to_string()), - message: diag.message, - related_information: None, - tags: None, - data: None, - } -} - -#[tokio::main] -pub async fn run_server(args: Args) { - let stdin = tokio::io::stdin(); - let stdout = tokio::io::stdout(); - - let (service, socket) = LspService::new(|client| Backend { - client, - config_file_path: args.rules_file, - working_dir: args.project_path[0].clone(), - linter: Arc::new(Mutex::new(None)) - }); - Server::new(stdin, stdout, socket).serve(service).await; -} \ No newline at end of file diff --git a/toolchains/solidity/linter/core/src/main.rs b/toolchains/solidity/linter/core/src/main.rs index 885ad52f..160802a2 100644 --- a/toolchains/solidity/linter/core/src/main.rs +++ b/toolchains/solidity/linter/core/src/main.rs @@ -3,8 +3,8 @@ use solidhunter_lib::linter::SolidLinter; use solidhunter_lib::rules::rule_impl::create_rules_file; use solidhunter_lib::types::LintResult; -mod lsp_server; -use lsp_server::run_server; +mod server; +use server::run_server; #[derive(Parser, Debug)] #[command(author, version, about, long_about = None)] diff --git a/toolchains/solidity/linter/core/src/server.rs b/toolchains/solidity/linter/core/src/server.rs new file mode 100644 index 00000000..d682b5b0 --- /dev/null +++ b/toolchains/solidity/linter/core/src/server.rs @@ -0,0 +1,135 @@ +use std::{cell::RefCell, rc::Rc}; + +use lsp_server_wrapper::{ LanguageServer, Client, lsp_types::{InitializeParams, InitializeResult, InitializedParams, MessageType, ServerCapabilities, TextDocumentSyncCapability, TextDocumentSyncKind, DidOpenTextDocumentParams, DidChangeTextDocumentParams, Diagnostic, DiagnosticSeverity, Range, Position, Url}, Result, LspStdioServer }; +use solidhunter_lib::{linter::SolidLinter, types::LintDiag}; + +use crate::Args; + +struct Backend { + client: Rc>, + config_file_path: String, + _working_dir: String, + linter: RefCell> +} + +impl LanguageServer for Backend { + fn initialize(&self, _: InitializeParams) -> Result { + eprintln!("starting example main loop"); + Ok(InitializeResult { + server_info: None, + capabilities: ServerCapabilities { + text_document_sync: Some(TextDocumentSyncCapability::Kind( + TextDocumentSyncKind::FULL, + )), + ..ServerCapabilities::default() + }, + }) + } + + fn initialized(&self, _: InitializedParams) { + eprintln!("Initializing server with config file: {:?}", self.config_file_path); + self.client.as_ref().borrow() + .log_message(MessageType::INFO, "Server initialized!"); + + let file_res = std::fs::read_to_string(&self.config_file_path); + + if let Ok(file) = file_res { + self.linter.borrow_mut().replace(SolidLinter::new(&file)); + } else { + self.linter.borrow_mut().replace(SolidLinter::new_fileless()); + } + + self.client.as_ref().borrow() + .log_message(MessageType::INFO, "Linter initialized!"); + + } + + fn shutdown(&self) -> Result<()> { + self.client.as_ref().borrow() + .log_message(MessageType::INFO, "Server shutdown!"); + Ok(()) + } + + fn did_open(&self, params: DidOpenTextDocumentParams) { + eprintln!("file opened!"); + self.client.as_ref().borrow() + .log_message(MessageType::INFO, "file opened!"); + + let filepath = filepath_from_uri(¶ms.text_document.uri); + let mut linter = self.linter.borrow_mut(); + let linter = linter.as_mut().unwrap(); + let diags_res = linter.parse_content(filepath, ¶ms.text_document.text); + + if let Ok(diags) = diags_res { + let diags = diags.iter().map(|d| diagnostic_from_lintdiag(d.clone())).collect(); + eprintln!("diags: {:?}", diags); + self.client.as_ref().borrow().log_message(MessageType::INFO, "diags: "); + self.client.as_ref().borrow().publish_diagnostics(params.text_document.uri.clone(), diags, None); + //self.client.publish_diagnostics(params.text_document.uri, diags, None).await; + } else if let Err(e) = diags_res { + self.client.as_ref().borrow().log_message(MessageType::ERROR, e.to_string()); + } + + } + + fn did_change(&self, params: DidChangeTextDocumentParams) { + eprintln!("file changed!"); + self.client.as_ref().borrow() + .log_message(MessageType::INFO, "file changed!"); + + let filepath = filepath_from_uri(¶ms.text_document.uri); + let mut linter = self.linter.borrow_mut(); + let linter = linter.as_mut().unwrap(); + let diags_res = linter.parse_content(filepath, ¶ms.content_changes[0].text); + + if let Ok(diags) = diags_res { + let diags = diags.iter().map(|d| diagnostic_from_lintdiag(d.clone())).collect(); + eprintln!("diags: {:?}", diags); + self.client.as_ref().borrow().publish_diagnostics(params.text_document.uri.clone(), diags, None); + //self.client.publish_diagnostics(params.text_document.uri, diags, None).await; + } else if let Err(e) = diags_res { + self.client.as_ref().borrow().log_message(MessageType::ERROR, e.to_string()); + } + } +} + +pub fn filepath_from_uri(uri: &Url) -> String { + let path = uri.path(); +// let path = path.strip_prefix("/").unwrap_or(path); + path.to_string() +} + +fn diagnostic_from_lintdiag(diag: LintDiag) -> Diagnostic { + eprintln!("diag: {:?}", diag); + Diagnostic { + range: Range { + start: Position { + line: diag.range.start.line as u32 - 1, + character: diag.range.start.character as u32, + }, + end: Position { + line: diag.range.end.line as u32 - 1, + character: diag.range.end.character as u32, + }, + }, + severity: Some(DiagnosticSeverity::WARNING), + code: None, + code_description: None, + source: Some("solidity-linter".to_string()), + message: diag.message, + related_information: None, + tags: None, + data: None, + } +} + +pub fn run_server(args: Args) { + eprintln!("starting LSP server"); + let server = LspStdioServer::new(); + let _ = LspStdioServer::serve(server, |client| Backend { + client, + config_file_path: args.rules_file, + _working_dir: args.project_path[0].clone(), + linter: RefCell::new(None) + }); +} \ No newline at end of file From c1a0ead307a5d6c391abf7bd5a7179393d8af692 Mon Sep 17 00:00:00 2001 From: 0xMemoryGrinder <35138272+0xMemoryGrinder@users.noreply.github.com> Date: Fri, 29 Sep 2023 14:10:59 -0400 Subject: [PATCH 095/325] chore: deleted remove-me --- remove-me-cd183d27aa5240d7aecb.txt | 1 - 1 file changed, 1 deletion(-) delete mode 100644 remove-me-cd183d27aa5240d7aecb.txt diff --git a/remove-me-cd183d27aa5240d7aecb.txt b/remove-me-cd183d27aa5240d7aecb.txt deleted file mode 100644 index 371cb2b7..00000000 --- a/remove-me-cd183d27aa5240d7aecb.txt +++ /dev/null @@ -1 +0,0 @@ -cd183d27aa5240d7aecb From 1ba985617f0b03af0db5774d2fd0206ce7cce06d Mon Sep 17 00:00:00 2001 From: 0xMemoryGrinder <35138272+0xMemoryGrinder@users.noreply.github.com> Date: Fri, 29 Sep 2023 14:32:59 -0400 Subject: [PATCH 096/325] refactor(libs/lsp-server-wrapper): deleted dead comments --- libs/lsp-server-wrapper/src/client.rs | 35 --------------------------- 1 file changed, 35 deletions(-) diff --git a/libs/lsp-server-wrapper/src/client.rs b/libs/lsp-server-wrapper/src/client.rs index 20fe4aa9..4450f384 100644 --- a/libs/lsp-server-wrapper/src/client.rs +++ b/libs/lsp-server-wrapper/src/client.rs @@ -412,12 +412,6 @@ impl Client { server_opt.unwrap().send(Message::Notification( lsp_server::Notification::new(N::METHOD.to_string(), params), )); - /*if let State::Initialized | State::ShutDown = self.inner.state.get() { - self.send_notification_unchecked::(params).await; - } else { - let msg = Request::from_notification::(params); - trace!("server not initialized, supressing message: {}", msg); - }*/ } fn send_notification_unchecked(&self, params: N::Params) @@ -432,10 +426,6 @@ impl Client { server_opt.unwrap().send(Message::Notification( lsp_server::Notification::new(N::METHOD.to_string(), params), )); - //let request = request::Request::from_notification::(params); - /*if self.clone().call(request).await.is_err() { - error!("failed to send notification"); - }*/ } /// Sends a custom request to the client. @@ -458,15 +448,6 @@ impl Client { server_opt.as_ref().unwrap().send(Message::Request( lsp_server::Request::new(RequestId::from(self.next_request_id().to_string()), R::METHOD.to_string(), params), )); - - /*if let State::Initialized | State::ShutDown = self.inner.state.get() { - self.send_request_unchecked::(params).await - } else { - let id = self.inner.request_id.load(Ordering::SeqCst) as i64 + 1; - let msg = Request::from_request::(id.into(), params); - trace!("server not initialized, supressing message: {}", msg); - Err(jsonrpc::not_initialized_error()) - }*/ Err(jsonrpc::not_initialized_error()) } @@ -482,22 +463,6 @@ impl Client { server_opt.unwrap().send(Message::Request( lsp_server::Request::new(RequestId::from(self.next_request_id().to_string()), R::METHOD.to_string(), params), )); - /*let id = self.next_request_id(); - let request = Request::from_request::(id, params); - - let response = match self.clone().call(request).await { - Ok(Some(response)) => response, - Ok(None) | Err(_) => return Err(Error::internal_error()), - }; - - let (_, result) = response.into_parts(); - result.and_then(|v| { - serde_json::from_value(v).map_err(|e| Error { - code: ErrorCode::ParseError, - message: e.to_string().into(), - data: None, - }) - })*/ Err(jsonrpc::not_initialized_error()) } } From fd1807cebd9fe862c5dd69d5828a65854432b355 Mon Sep 17 00:00:00 2001 From: 0xMemoryGrinder <35138272+0xMemoryGrinder@users.noreply.github.com> Date: Fri, 29 Sep 2023 14:36:08 -0400 Subject: [PATCH 097/325] refactor(solidity/linter/core): now takes proper parameters in run_server --- toolchains/solidity/linter/core/src/main.rs | 8 ++++---- toolchains/solidity/linter/core/src/server.rs | 8 ++------ 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/toolchains/solidity/linter/core/src/main.rs b/toolchains/solidity/linter/core/src/main.rs index 160802a2..c9290c00 100644 --- a/toolchains/solidity/linter/core/src/main.rs +++ b/toolchains/solidity/linter/core/src/main.rs @@ -8,7 +8,7 @@ use server::run_server; #[derive(Parser, Debug)] #[command(author, version, about, long_about = None)] -pub struct Args { +struct Args { #[arg( short = 'p', long = "path", @@ -101,9 +101,9 @@ fn main() { let args = Args::parse(); if args.lsp { - //println!("Starting language server..."); - run_server(args); - //println!("Done!"); + eprintln!("Starting language server..."); + run_server(args.rules_file.clone()); + eprintln!("Done!"); return; } diff --git a/toolchains/solidity/linter/core/src/server.rs b/toolchains/solidity/linter/core/src/server.rs index d682b5b0..3ca535af 100644 --- a/toolchains/solidity/linter/core/src/server.rs +++ b/toolchains/solidity/linter/core/src/server.rs @@ -3,12 +3,9 @@ use std::{cell::RefCell, rc::Rc}; use lsp_server_wrapper::{ LanguageServer, Client, lsp_types::{InitializeParams, InitializeResult, InitializedParams, MessageType, ServerCapabilities, TextDocumentSyncCapability, TextDocumentSyncKind, DidOpenTextDocumentParams, DidChangeTextDocumentParams, Diagnostic, DiagnosticSeverity, Range, Position, Url}, Result, LspStdioServer }; use solidhunter_lib::{linter::SolidLinter, types::LintDiag}; -use crate::Args; - struct Backend { client: Rc>, config_file_path: String, - _working_dir: String, linter: RefCell> } @@ -123,13 +120,12 @@ fn diagnostic_from_lintdiag(diag: LintDiag) -> Diagnostic { } } -pub fn run_server(args: Args) { +pub fn run_server(config_file_path: String) { eprintln!("starting LSP server"); let server = LspStdioServer::new(); let _ = LspStdioServer::serve(server, |client| Backend { client, - config_file_path: args.rules_file, - _working_dir: args.project_path[0].clone(), + config_file_path, linter: RefCell::new(None) }); } \ No newline at end of file From 783dba8b57ae9a9e8f358a41f2a861e917480be2 Mon Sep 17 00:00:00 2001 From: 0xMemoryGrinder <35138272+0xMemoryGrinder@users.noreply.github.com> Date: Fri, 29 Sep 2023 14:37:34 -0400 Subject: [PATCH 098/325] feat(libs/lsp-server-wrapper): added proper logging in lsp server handlers --- libs/lsp-server-wrapper/src/lib.rs | 121 +++++++++++++------------- libs/lsp-server-wrapper/src/server.rs | 30 ++++++- 2 files changed, 86 insertions(+), 65 deletions(-) diff --git a/libs/lsp-server-wrapper/src/lib.rs b/libs/lsp-server-wrapper/src/lib.rs index 635f153a..6d7f3682 100644 --- a/libs/lsp-server-wrapper/src/lib.rs +++ b/libs/lsp-server-wrapper/src/lib.rs @@ -5,7 +5,6 @@ mod service; pub use lsp_types; use lsp_types::*; -use tracing::{error, warn}; use lsp_types::request::{ GotoDeclarationParams, GotoDeclarationResponse, GotoImplementationParams, GotoImplementationResponse, GotoTypeDefinitionParams, GotoTypeDefinitionResponse, @@ -67,7 +66,7 @@ pub trait LanguageServer { /// client. It doesn't necessarily mean that its content is presented in an editor. fn did_open(&self, params: DidOpenTextDocumentParams) { let _ = params; - warn!("Got a textDocument/didOpen notification, but it is not implemented"); + eprintln!("Got a textDocument/didOpen notification, but it is not implemented"); } /// The [`textDocument/didChange`] notification is sent from the client to the server to signal @@ -79,7 +78,7 @@ pub trait LanguageServer { /// document for the server to interpret. fn did_change(&self, params: DidChangeTextDocumentParams) { let _ = params; - warn!("Got a textDocument/didChange notification, but it is not implemented"); + eprintln!("Got a textDocument/didChange notification, but it is not implemented"); } /// The [`textDocument/willSave`] notification is sent from the client to the server before the @@ -88,7 +87,7 @@ pub trait LanguageServer { /// [`textDocument/willSave`]: https://microsoft.github.io/language-server-protocol/specification#textDocument_willSave fn will_save(&self, params: WillSaveTextDocumentParams) { let _ = params; - warn!("Got a textDocument/willSave notification, but it is not implemented"); + eprintln!("Got a textDocument/willSave notification, but it is not implemented"); } /// The [`textDocument/willSaveWaitUntil`] request is sent from the client to the server before @@ -106,7 +105,7 @@ pub trait LanguageServer { params: WillSaveTextDocumentParams, ) -> Result>> { let _ = params; - error!("Got a textDocument/willSaveWaitUntil request, but it is not implemented"); + eprintln!("Got a textDocument/willSaveWaitUntil request, but it is not implemented"); Err(Error::method_not_found()) } @@ -116,7 +115,7 @@ pub trait LanguageServer { /// [`textDocument/didSave`]: https://microsoft.github.io/language-server-protocol/specification#textDocument_didSave fn did_save(&self, params: DidSaveTextDocumentParams) { let _ = params; - warn!("Got a textDocument/didSave notification, but it is not implemented"); + eprintln!("Got a textDocument/didSave notification, but it is not implemented"); } /// The [`textDocument/didClose`] notification is sent from the client to the server when the @@ -128,7 +127,7 @@ pub trait LanguageServer { /// URI is a file URI, the truth now exists on disk). fn did_close(&self, params: DidCloseTextDocumentParams) { let _ = params; - warn!("Got a textDocument/didClose notification, but it is not implemented"); + eprintln!("Got a textDocument/didClose notification, but it is not implemented"); } // Language Features @@ -155,7 +154,7 @@ pub trait LanguageServer { params: GotoDeclarationParams, ) -> Result> { let _ = params; - error!("Got a textDocument/declaration request, but it is not implemented"); + eprintln!("Got a textDocument/declaration request, but it is not implemented"); Err(Error::method_not_found()) } @@ -179,7 +178,7 @@ pub trait LanguageServer { params: GotoDefinitionParams, ) -> Result> { let _ = params; - error!("Got a textDocument/definition request, but it is not implemented"); + eprintln!("Got a textDocument/definition request, but it is not implemented"); Err(Error::method_not_found()) } @@ -205,7 +204,7 @@ pub trait LanguageServer { params: GotoTypeDefinitionParams, ) -> Result> { let _ = params; - error!("Got a textDocument/typeDefinition request, but it is not implemented"); + eprintln!("Got a textDocument/typeDefinition request, but it is not implemented"); Err(Error::method_not_found()) } @@ -231,7 +230,7 @@ pub trait LanguageServer { params: GotoImplementationParams, ) -> Result> { let _ = params; - error!("Got a textDocument/implementation request, but it is not implemented"); + eprintln!("Got a textDocument/implementation request, but it is not implemented"); Err(Error::method_not_found()) } @@ -242,7 +241,7 @@ pub trait LanguageServer { fn references(&self, params: ReferenceParams) -> Result>> { let _ = params; - error!("Got a textDocument/references request, but it is not implemented"); + eprintln!("Got a textDocument/references request, but it is not implemented"); Err(Error::method_not_found()) } @@ -269,7 +268,7 @@ pub trait LanguageServer { params: CallHierarchyPrepareParams, ) -> Result>> { let _ = params; - error!("Got a textDocument/prepareCallHierarchy request, but it is not implemented"); + eprintln!("Got a textDocument/prepareCallHierarchy request, but it is not implemented"); Err(Error::method_not_found()) } @@ -290,7 +289,7 @@ pub trait LanguageServer { params: CallHierarchyIncomingCallsParams, ) -> Result>> { let _ = params; - error!("Got a callHierarchy/incomingCalls request, but it is not implemented"); + eprintln!("Got a callHierarchy/incomingCalls request, but it is not implemented"); Err(Error::method_not_found()) } @@ -311,7 +310,7 @@ pub trait LanguageServer { params: CallHierarchyOutgoingCallsParams, ) -> Result>> { let _ = params; - error!("Got a callHierarchy/outgoingCalls request, but it is not implemented"); + eprintln!("Got a callHierarchy/outgoingCalls request, but it is not implemented"); Err(Error::method_not_found()) } @@ -336,7 +335,7 @@ pub trait LanguageServer { params: TypeHierarchyPrepareParams, ) -> Result>> { let _ = params; - error!("Got a textDocument/prepareTypeHierarchy request, but it is not implemented"); + eprintln!("Got a textDocument/prepareTypeHierarchy request, but it is not implemented"); Err(Error::method_not_found()) } @@ -356,7 +355,7 @@ pub trait LanguageServer { params: TypeHierarchySupertypesParams, ) -> Result>> { let _ = params; - error!("Got a typeHierarchy/supertypes request, but it is not implemented"); + eprintln!("Got a typeHierarchy/supertypes request, but it is not implemented"); Err(Error::method_not_found()) } @@ -376,7 +375,7 @@ pub trait LanguageServer { params: TypeHierarchySubtypesParams, ) -> Result>> { let _ = params; - error!("Got a typeHierarchy/subtypes request, but it is not implemented"); + eprintln!("Got a typeHierarchy/subtypes request, but it is not implemented"); Err(Error::method_not_found()) } @@ -395,7 +394,7 @@ pub trait LanguageServer { params: DocumentHighlightParams, ) -> Result>> { let _ = params; - error!("Got a textDocument/documentHighlight request, but it is not implemented"); + eprintln!("Got a textDocument/documentHighlight request, but it is not implemented"); Err(Error::method_not_found()) } @@ -418,7 +417,7 @@ pub trait LanguageServer { /// ``` fn document_link(&self, params: DocumentLinkParams) -> Result>> { let _ = params; - error!("Got a textDocument/documentLink request, but it is not implemented"); + eprintln!("Got a textDocument/documentLink request, but it is not implemented"); Err(Error::method_not_found()) } @@ -431,7 +430,7 @@ pub trait LanguageServer { /// resource, like another text document or a web site. fn document_link_resolve(&self, params: DocumentLink) -> Result { let _ = params; - error!("Got a documentLink/resolve request, but it is not implemented"); + eprintln!("Got a documentLink/resolve request, but it is not implemented"); Err(Error::method_not_found()) } @@ -444,7 +443,7 @@ pub trait LanguageServer { /// documentation for the symbol at the given text document position. fn hover(&self, params: HoverParams) -> Result> { let _ = params; - error!("Got a textDocument/hover request, but it is not implemented"); + eprintln!("Got a textDocument/hover request, but it is not implemented"); Err(Error::method_not_found()) } @@ -455,7 +454,7 @@ pub trait LanguageServer { fn code_lens(&self, params: CodeLensParams) -> Result>> { let _ = params; - error!("Got a textDocument/codeLens request, but it is not implemented"); + eprintln!("Got a textDocument/codeLens request, but it is not implemented"); Err(Error::method_not_found()) } @@ -466,7 +465,7 @@ pub trait LanguageServer { fn code_lens_resolve(&self, params: CodeLens) -> Result { let _ = params; - error!("Got a codeLens/resolve request, but it is not implemented"); + eprintln!("Got a codeLens/resolve request, but it is not implemented"); Err(Error::method_not_found()) } @@ -481,7 +480,7 @@ pub trait LanguageServer { fn folding_range(&self, params: FoldingRangeParams) -> Result>> { let _ = params; - error!("Got a textDocument/foldingRange request, but it is not implemented"); + eprintln!("Got a textDocument/foldingRange request, but it is not implemented"); Err(Error::method_not_found()) } @@ -503,7 +502,7 @@ pub trait LanguageServer { params: SelectionRangeParams, ) -> Result>> { let _ = params; - error!("Got a textDocument/selectionRange request, but it is not implemented"); + eprintln!("Got a textDocument/selectionRange request, but it is not implemented"); Err(Error::method_not_found()) } @@ -525,7 +524,7 @@ pub trait LanguageServer { params: DocumentSymbolParams, ) -> Result> { let _ = params; - error!("Got a textDocument/documentSymbol request, but it is not implemented"); + eprintln!("Got a textDocument/documentSymbol request, but it is not implemented"); Err(Error::method_not_found()) } @@ -550,7 +549,7 @@ pub trait LanguageServer { params: SemanticTokensParams, ) -> Result> { let _ = params; - error!("Got a textDocument/semanticTokens/full request, but it is not implemented"); + eprintln!("Got a textDocument/semanticTokens/full request, but it is not implemented"); Err(Error::method_not_found()) } @@ -571,7 +570,7 @@ pub trait LanguageServer { params: SemanticTokensDeltaParams, ) -> Result> { let _ = params; - error!("Got a textDocument/semanticTokens/full/delta request, but it is not implemented"); + eprintln!("Got a textDocument/semanticTokens/full/delta request, but it is not implemented"); Err(Error::method_not_found()) } @@ -597,7 +596,7 @@ pub trait LanguageServer { params: SemanticTokensRangeParams, ) -> Result> { let _ = params; - error!("Got a textDocument/semanticTokens/range request, but it is not implemented"); + eprintln!("Got a textDocument/semanticTokens/range request, but it is not implemented"); Err(Error::method_not_found()) } @@ -613,7 +612,7 @@ pub trait LanguageServer { fn inline_value(&self, params: InlineValueParams) -> Result>> { let _ = params; - error!("Got a textDocument/inlineValue request, but it is not implemented"); + eprintln!("Got a textDocument/inlineValue request, but it is not implemented"); Err(Error::method_not_found()) } @@ -629,7 +628,7 @@ pub trait LanguageServer { fn inlay_hint(&self, params: InlayHintParams) -> Result>> { let _ = params; - error!("Got a textDocument/inlayHint request, but it is not implemented"); + eprintln!("Got a textDocument/inlayHint request, but it is not implemented"); Err(Error::method_not_found()) } @@ -658,7 +657,7 @@ pub trait LanguageServer { fn inlay_hint_resolve(&self, params: InlayHint) -> Result { let _ = params; - error!("Got a inlayHint/resolve request, but it is not implemented"); + eprintln!("Got a inlayHint/resolve request, but it is not implemented"); Err(Error::method_not_found()) } @@ -688,7 +687,7 @@ pub trait LanguageServer { fn moniker(&self, params: MonikerParams) -> Result>> { let _ = params; - error!("Got a textDocument/moniker request, but it is not implemented"); + eprintln!("Got a textDocument/moniker request, but it is not implemented"); Err(Error::method_not_found()) } @@ -713,7 +712,7 @@ pub trait LanguageServer { fn completion(&self, params: CompletionParams) -> Result> { let _ = params; - error!("Got a textDocument/completion request, but it is not implemented"); + eprintln!("Got a textDocument/completion request, but it is not implemented"); Err(Error::method_not_found()) } @@ -724,7 +723,7 @@ pub trait LanguageServer { fn completion_resolve(&self, params: CompletionItem) -> Result { let _ = params; - error!("Got a completionItem/resolve request, but it is not implemented"); + eprintln!("Got a completionItem/resolve request, but it is not implemented"); Err(Error::method_not_found()) } @@ -748,7 +747,7 @@ pub trait LanguageServer { params: DocumentDiagnosticParams, ) -> Result { let _ = params; - error!("Got a textDocument/diagnostic request, but it is not implemented"); + eprintln!("Got a textDocument/diagnostic request, but it is not implemented"); Err(Error::method_not_found()) } @@ -786,7 +785,7 @@ pub trait LanguageServer { params: WorkspaceDiagnosticParams, ) -> Result { let _ = params; - error!("Got a workspace/diagnostic request, but it is not implemented"); + eprintln!("Got a workspace/diagnostic request, but it is not implemented"); Err(Error::method_not_found()) } @@ -797,7 +796,7 @@ pub trait LanguageServer { fn signature_help(&self, params: SignatureHelpParams) -> Result> { let _ = params; - error!("Got a textDocument/signatureHelp request, but it is not implemented"); + eprintln!("Got a textDocument/signatureHelp request, but it is not implemented"); Err(Error::method_not_found()) } @@ -857,7 +856,7 @@ pub trait LanguageServer { fn code_action(&self, params: CodeActionParams) -> Result> { let _ = params; - error!("Got a textDocument/codeAction request, but it is not implemented"); + eprintln!("Got a textDocument/codeAction request, but it is not implemented"); Err(Error::method_not_found()) } @@ -875,7 +874,7 @@ pub trait LanguageServer { fn code_action_resolve(&self, params: CodeAction) -> Result { let _ = params; - error!("Got a codeAction/resolve request, but it is not implemented"); + eprintln!("Got a codeAction/resolve request, but it is not implemented"); Err(Error::method_not_found()) } @@ -896,7 +895,7 @@ pub trait LanguageServer { fn document_color(&self, params: DocumentColorParams) -> Result> { let _ = params; - error!("Got a textDocument/documentColor request, but it is not implemented"); + eprintln!("Got a textDocument/documentColor request, but it is not implemented"); Err(Error::method_not_found()) } @@ -922,7 +921,7 @@ pub trait LanguageServer { params: ColorPresentationParams, ) -> Result> { let _ = params; - error!("Got a textDocument/colorPresentation request, but it is not implemented"); + eprintln!("Got a textDocument/colorPresentation request, but it is not implemented"); Err(Error::method_not_found()) } @@ -933,7 +932,7 @@ pub trait LanguageServer { fn formatting(&self, params: DocumentFormattingParams) -> Result>> { let _ = params; - error!("Got a textDocument/formatting request, but it is not implemented"); + eprintln!("Got a textDocument/formatting request, but it is not implemented"); Err(Error::method_not_found()) } @@ -947,7 +946,7 @@ pub trait LanguageServer { params: DocumentRangeFormattingParams, ) -> Result>> { let _ = params; - error!("Got a textDocument/rangeFormatting request, but it is not implemented"); + eprintln!("Got a textDocument/rangeFormatting request, but it is not implemented"); Err(Error::method_not_found()) } @@ -961,7 +960,7 @@ pub trait LanguageServer { params: DocumentOnTypeFormattingParams, ) -> Result>> { let _ = params; - error!("Got a textDocument/onTypeFormatting request, but it is not implemented"); + eprintln!("Got a textDocument/onTypeFormatting request, but it is not implemented"); Err(Error::method_not_found()) } @@ -973,7 +972,7 @@ pub trait LanguageServer { fn rename(&self, params: RenameParams) -> Result> { let _ = params; - error!("Got a textDocument/rename request, but it is not implemented"); + eprintln!("Got a textDocument/rename request, but it is not implemented"); Err(Error::method_not_found()) } @@ -991,7 +990,7 @@ pub trait LanguageServer { params: TextDocumentPositionParams, ) -> Result> { let _ = params; - error!("Got a textDocument/prepareRename request, but it is not implemented"); + eprintln!("Got a textDocument/prepareRename request, but it is not implemented"); Err(Error::method_not_found()) } @@ -1016,7 +1015,7 @@ pub trait LanguageServer { params: LinkedEditingRangeParams, ) -> Result> { let _ = params; - error!("Got a textDocument/linkedEditingRange request, but it is not implemented"); + eprintln!("Got a textDocument/linkedEditingRange request, but it is not implemented"); Err(Error::method_not_found()) } @@ -1044,7 +1043,7 @@ pub trait LanguageServer { params: WorkspaceSymbolParams, ) -> Result>> { let _ = params; - error!("Got a workspace/symbol request, but it is not implemented"); + eprintln!("Got a workspace/symbol request, but it is not implemented"); Err(Error::method_not_found()) } @@ -1061,7 +1060,7 @@ pub trait LanguageServer { fn symbol_resolve(&self, params: WorkspaceSymbol) -> Result { let _ = params; - error!("Got a workspaceSymbol/resolve request, but it is not implemented"); + eprintln!("Got a workspaceSymbol/resolve request, but it is not implemented"); Err(Error::method_not_found()) } @@ -1072,7 +1071,7 @@ pub trait LanguageServer { fn did_change_configuration(&self, params: DidChangeConfigurationParams) { let _ = params; - warn!("Got a workspace/didChangeConfiguration notification, but it is not implemented"); + eprintln!("Got a workspace/didChangeConfiguration notification, but it is not implemented"); } /// The [`workspace/didChangeWorkspaceFolders`] notification is sent from the client to the @@ -1091,7 +1090,7 @@ pub trait LanguageServer { fn did_change_workspace_folders(&self, params: DidChangeWorkspaceFoldersParams) { let _ = params; - warn!("Got a workspace/didChangeWorkspaceFolders notification, but it is not implemented"); + eprintln!("Got a workspace/didChangeWorkspaceFolders notification, but it is not implemented"); } /// The [`workspace/willCreateFiles`] request is sent from the client to the server before @@ -1110,7 +1109,7 @@ pub trait LanguageServer { fn will_create_files(&self, params: CreateFilesParams) -> Result> { let _ = params; - error!("Got a workspace/willCreateFiles request, but it is not implemented"); + eprintln!("Got a workspace/willCreateFiles request, but it is not implemented"); Err(Error::method_not_found()) } @@ -1121,7 +1120,7 @@ pub trait LanguageServer { fn did_create_files(&self, params: CreateFilesParams) { let _ = params; - warn!("Got a workspace/didCreateFiles notification, but it is not implemented"); + eprintln!("Got a workspace/didCreateFiles notification, but it is not implemented"); } /// The [`workspace/willRenameFiles`] request is sent from the client to the server before @@ -1140,7 +1139,7 @@ pub trait LanguageServer { fn will_rename_files(&self, params: RenameFilesParams) -> Result> { let _ = params; - error!("Got a workspace/willRenameFiles request, but it is not implemented"); + eprintln!("Got a workspace/willRenameFiles request, but it is not implemented"); Err(Error::method_not_found()) } @@ -1151,7 +1150,7 @@ pub trait LanguageServer { fn did_rename_files(&self, params: RenameFilesParams) { let _ = params; - warn!("Got a workspace/didRenameFiles notification, but it is not implemented"); + eprintln!("Got a workspace/didRenameFiles notification, but it is not implemented"); } /// The [`workspace/willDeleteFiles`] request is sent from the client to the server before @@ -1171,7 +1170,7 @@ pub trait LanguageServer { fn will_delete_files(&self, params: DeleteFilesParams) -> Result> { let _ = params; - error!("Got a workspace/willDeleteFiles request, but it is not implemented"); + eprintln!("Got a workspace/willDeleteFiles request, but it is not implemented"); Err(Error::method_not_found()) } @@ -1182,7 +1181,7 @@ pub trait LanguageServer { fn did_delete_files(&self, params: DeleteFilesParams) { let _ = params; - warn!("Got a workspace/didDeleteFiles notification, but it is not implemented"); + eprintln!("Got a workspace/didDeleteFiles notification, but it is not implemented"); } /// The [`workspace/didChangeWatchedFiles`] notification is sent from the client to the server @@ -1196,7 +1195,7 @@ pub trait LanguageServer { fn did_change_watched_files(&self, params: DidChangeWatchedFilesParams) { let _ = params; - warn!("Got a workspace/didChangeWatchedFiles notification, but it is not implemented"); + eprintln!("Got a workspace/didChangeWatchedFiles notification, but it is not implemented"); } /// The [`workspace/executeCommand`] request is sent from the client to the server to trigger @@ -1209,7 +1208,7 @@ pub trait LanguageServer { fn execute_command(&self, params: ExecuteCommandParams) -> Result> { let _ = params; - error!("Got a workspace/executeCommand request, but it is not implemented"); + eprintln!("Got a workspace/executeCommand request, but it is not implemented"); Err(Error::method_not_found()) } diff --git a/libs/lsp-server-wrapper/src/server.rs b/libs/lsp-server-wrapper/src/server.rs index a94c4e1d..3e7dcdc4 100644 --- a/libs/lsp-server-wrapper/src/server.rs +++ b/libs/lsp-server-wrapper/src/server.rs @@ -85,24 +85,46 @@ impl<'a> LspStdioServer { match msg { Message::Request(req) => { let id = req.id.clone(); - let is_shutdown = self.inner.connection.handle_shutdown(&req)?; - let result = service.call_request(&req.method, req.params)?; + let is_shutdown = self.inner.connection.handle_shutdown(&req); + let is_shutdown = match is_shutdown { + Ok(is_shutdown) => is_shutdown, + Err(e) => { + eprintln!("Handle shutdown Error: {}", e); + continue + } + }; + let result = service.call_request(&req.method, req.params); + let result = match result { + Ok(result) => result, + Err(e) => { + eprintln!("Call request Error: {}", e); + continue + } + }; let resp = Response { id, result, error: None }; if is_shutdown { + eprintln!("Shutting down"); return Ok(()); } - self.inner.connection.sender.send(Message::Response(resp))?; + let status = self.inner.connection.sender.send(Message::Response(resp)); + if status.is_err() { + eprintln!("Error sending request's response: {status:?}"); + } continue; } Message::Response(resp) => { eprintln!("got response: {resp:?}"); } Message::Notification(not) => { - service.call_notification(¬.method, not.params)?; + let status = service.call_notification(¬.method, not.params); + if status.is_err() { + eprintln!("Error calling notification ({}): {status:?}", not.method); + } continue; } } } + eprintln!("Out of loop"); Ok(()) } } From 2558e107dc641d007d0f3ca5d06fac29442de7b6 Mon Sep 17 00:00:00 2001 From: 0xMemoryGrinder <35138272+0xMemoryGrinder@users.noreply.github.com> Date: Fri, 29 Sep 2023 18:01:52 -0400 Subject: [PATCH 099/325] chore: removed useless comments --- toolchains/solidity/linter/core/src/server.rs | 3 --- 1 file changed, 3 deletions(-) diff --git a/toolchains/solidity/linter/core/src/server.rs b/toolchains/solidity/linter/core/src/server.rs index 3ca535af..7b185cb3 100644 --- a/toolchains/solidity/linter/core/src/server.rs +++ b/toolchains/solidity/linter/core/src/server.rs @@ -62,7 +62,6 @@ impl LanguageServer for Backend { eprintln!("diags: {:?}", diags); self.client.as_ref().borrow().log_message(MessageType::INFO, "diags: "); self.client.as_ref().borrow().publish_diagnostics(params.text_document.uri.clone(), diags, None); - //self.client.publish_diagnostics(params.text_document.uri, diags, None).await; } else if let Err(e) = diags_res { self.client.as_ref().borrow().log_message(MessageType::ERROR, e.to_string()); } @@ -83,7 +82,6 @@ impl LanguageServer for Backend { let diags = diags.iter().map(|d| diagnostic_from_lintdiag(d.clone())).collect(); eprintln!("diags: {:?}", diags); self.client.as_ref().borrow().publish_diagnostics(params.text_document.uri.clone(), diags, None); - //self.client.publish_diagnostics(params.text_document.uri, diags, None).await; } else if let Err(e) = diags_res { self.client.as_ref().borrow().log_message(MessageType::ERROR, e.to_string()); } @@ -92,7 +90,6 @@ impl LanguageServer for Backend { pub fn filepath_from_uri(uri: &Url) -> String { let path = uri.path(); -// let path = path.strip_prefix("/").unwrap_or(path); path.to_string() } From e80ffe4c05f4d1b2b857c68cbb868ccbd37408e3 Mon Sep 17 00:00:00 2001 From: Astrodevs CI Date: Thu, 17 Aug 2023 19:50:30 +0000 Subject: [PATCH 100/325] chore: create branch chore/48-embed-lsp-server-in-core/66-solidhunter-client-launches-rust-server-staging --- remove-me-87b2f04faae04ab39afd.txt | 1 + 1 file changed, 1 insertion(+) create mode 100644 remove-me-87b2f04faae04ab39afd.txt diff --git a/remove-me-87b2f04faae04ab39afd.txt b/remove-me-87b2f04faae04ab39afd.txt new file mode 100644 index 00000000..e47371fb --- /dev/null +++ b/remove-me-87b2f04faae04ab39afd.txt @@ -0,0 +1 @@ +87b2f04faae04ab39afd From 39007e3a84375affface3d9de5f634debf2f955f Mon Sep 17 00:00:00 2001 From: 0xMemoryGrinder <35138272+0xMemoryGrinder@users.noreply.github.com> Date: Wed, 13 Sep 2023 02:45:05 -0400 Subject: [PATCH 101/325] feat(solidity/linter/extension): added base extension scaffold to launch rust language server --- .../solidity/linter/extension/.eslintrc.json | 24 +++++ .../solidity/linter/extension/.gitignore | 4 + .../linter/extension/.vscode/extensions.json | 5 ++ .../linter/extension/.vscode/launch.json | 35 ++++++++ .../linter/extension/.vscode/settings.json | 13 +++ .../linter/extension/.vscode/tasks.json | 40 +++++++++ .../solidity/linter/extension/.vscodeignore | 13 +++ toolchains/solidity/linter/extension/.yarnrc | 1 + .../solidity/linter/extension/CHANGELOG.md | 9 ++ .../solidity/linter/extension/README.md | 71 +++++++++++++++ .../solidity/linter/extension/package.json | 90 +++++++++++++++++++ .../linter/extension/src/extension.ts | 59 ++++++++++++ .../solidity/linter/extension/tsconfig.json | 16 ++++ .../extension/vsc-extension-quickstart.md | 47 ++++++++++ .../linter/extension/webpack.config.js | 61 +++++++++++++ toolchains/solidity/linter/package.json | 3 +- 16 files changed, 490 insertions(+), 1 deletion(-) create mode 100644 toolchains/solidity/linter/extension/.eslintrc.json create mode 100644 toolchains/solidity/linter/extension/.gitignore create mode 100644 toolchains/solidity/linter/extension/.vscode/extensions.json create mode 100644 toolchains/solidity/linter/extension/.vscode/launch.json create mode 100644 toolchains/solidity/linter/extension/.vscode/settings.json create mode 100644 toolchains/solidity/linter/extension/.vscode/tasks.json create mode 100644 toolchains/solidity/linter/extension/.vscodeignore create mode 100644 toolchains/solidity/linter/extension/.yarnrc create mode 100644 toolchains/solidity/linter/extension/CHANGELOG.md create mode 100644 toolchains/solidity/linter/extension/README.md create mode 100644 toolchains/solidity/linter/extension/package.json create mode 100644 toolchains/solidity/linter/extension/src/extension.ts create mode 100644 toolchains/solidity/linter/extension/tsconfig.json create mode 100644 toolchains/solidity/linter/extension/vsc-extension-quickstart.md create mode 100644 toolchains/solidity/linter/extension/webpack.config.js diff --git a/toolchains/solidity/linter/extension/.eslintrc.json b/toolchains/solidity/linter/extension/.eslintrc.json new file mode 100644 index 00000000..f9b22b79 --- /dev/null +++ b/toolchains/solidity/linter/extension/.eslintrc.json @@ -0,0 +1,24 @@ +{ + "root": true, + "parser": "@typescript-eslint/parser", + "parserOptions": { + "ecmaVersion": 6, + "sourceType": "module" + }, + "plugins": [ + "@typescript-eslint" + ], + "rules": { + "@typescript-eslint/naming-convention": "warn", + "@typescript-eslint/semi": "warn", + "curly": "warn", + "eqeqeq": "warn", + "no-throw-literal": "warn", + "semi": "off" + }, + "ignorePatterns": [ + "out", + "dist", + "**/*.d.ts" + ] +} diff --git a/toolchains/solidity/linter/extension/.gitignore b/toolchains/solidity/linter/extension/.gitignore new file mode 100644 index 00000000..ca4172ac --- /dev/null +++ b/toolchains/solidity/linter/extension/.gitignore @@ -0,0 +1,4 @@ +dist +node_modules +out +core \ No newline at end of file diff --git a/toolchains/solidity/linter/extension/.vscode/extensions.json b/toolchains/solidity/linter/extension/.vscode/extensions.json new file mode 100644 index 00000000..57dbdae4 --- /dev/null +++ b/toolchains/solidity/linter/extension/.vscode/extensions.json @@ -0,0 +1,5 @@ +{ + // See http://go.microsoft.com/fwlink/?LinkId=827846 + // for the documentation about the extensions.json format + "recommendations": ["dbaeumer.vscode-eslint", "amodio.tsl-problem-matcher"] +} diff --git a/toolchains/solidity/linter/extension/.vscode/launch.json b/toolchains/solidity/linter/extension/.vscode/launch.json new file mode 100644 index 00000000..d4df9e96 --- /dev/null +++ b/toolchains/solidity/linter/extension/.vscode/launch.json @@ -0,0 +1,35 @@ +// A launch configuration that compiles the extension and then opens it inside a new window +// Use IntelliSense to learn about possible attributes. +// Hover to view descriptions of existing attributes. +// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 +{ + "version": "0.2.0", + "configurations": [ + { + "name": "Run Extension", + "type": "extensionHost", + "request": "launch", + "args": [ + "--extensionDevelopmentPath=${workspaceFolder}" + ], + "outFiles": [ + "${workspaceFolder}/dist/**/*.js" + ], + "preLaunchTask": "${defaultBuildTask}" + }, + { + "name": "Extension Tests", + "type": "extensionHost", + "request": "launch", + "args": [ + "--extensionDevelopmentPath=${workspaceFolder}", + "--extensionTestsPath=${workspaceFolder}/out/test/suite/index" + ], + "outFiles": [ + "${workspaceFolder}/out/**/*.js", + "${workspaceFolder}/dist/**/*.js" + ], + "preLaunchTask": "tasks: watch-tests" + } + ] +} diff --git a/toolchains/solidity/linter/extension/.vscode/settings.json b/toolchains/solidity/linter/extension/.vscode/settings.json new file mode 100644 index 00000000..5c5ac48c --- /dev/null +++ b/toolchains/solidity/linter/extension/.vscode/settings.json @@ -0,0 +1,13 @@ +// Place your settings in this file to overwrite default and user settings. +{ + "files.exclude": { + "out": false, // set this to true to hide the "out" folder with the compiled JS files + "dist": false // set this to true to hide the "dist" folder with the compiled JS files + }, + "search.exclude": { + "out": true, // set this to false to include "out" folder in search results + "dist": true // set this to false to include "dist" folder in search results + }, + // Turn off tsc task auto detection since we have the necessary tasks as npm scripts + "typescript.tsc.autoDetect": "off" +} \ No newline at end of file diff --git a/toolchains/solidity/linter/extension/.vscode/tasks.json b/toolchains/solidity/linter/extension/.vscode/tasks.json new file mode 100644 index 00000000..c2ab68ae --- /dev/null +++ b/toolchains/solidity/linter/extension/.vscode/tasks.json @@ -0,0 +1,40 @@ +// See https://go.microsoft.com/fwlink/?LinkId=733558 +// for the documentation about the tasks.json format +{ + "version": "2.0.0", + "tasks": [ + { + "type": "npm", + "script": "watch", + "problemMatcher": "$ts-webpack-watch", + "isBackground": true, + "presentation": { + "reveal": "never", + "group": "watchers" + }, + "group": { + "kind": "build", + "isDefault": true + } + }, + { + "type": "npm", + "script": "watch-tests", + "problemMatcher": "$tsc-watch", + "isBackground": true, + "presentation": { + "reveal": "never", + "group": "watchers" + }, + "group": "build" + }, + { + "label": "tasks: watch-tests", + "dependsOn": [ + "npm: watch", + "npm: watch-tests" + ], + "problemMatcher": [] + } + ] +} diff --git a/toolchains/solidity/linter/extension/.vscodeignore b/toolchains/solidity/linter/extension/.vscodeignore new file mode 100644 index 00000000..c6136798 --- /dev/null +++ b/toolchains/solidity/linter/extension/.vscodeignore @@ -0,0 +1,13 @@ +.vscode/** +.vscode-test/** +out/** +node_modules/** +src/** +.gitignore +.yarnrc +webpack.config.js +vsc-extension-quickstart.md +**/tsconfig.json +**/.eslintrc.json +**/*.map +**/*.ts diff --git a/toolchains/solidity/linter/extension/.yarnrc b/toolchains/solidity/linter/extension/.yarnrc new file mode 100644 index 00000000..f757a6ac --- /dev/null +++ b/toolchains/solidity/linter/extension/.yarnrc @@ -0,0 +1 @@ +--ignore-engines true \ No newline at end of file diff --git a/toolchains/solidity/linter/extension/CHANGELOG.md b/toolchains/solidity/linter/extension/CHANGELOG.md new file mode 100644 index 00000000..a4ddaf4a --- /dev/null +++ b/toolchains/solidity/linter/extension/CHANGELOG.md @@ -0,0 +1,9 @@ +# Change Log + +All notable changes to the "solidhunter" extension will be documented in this file. + +Check [Keep a Changelog](http://keepachangelog.com/) for recommendations on how to structure this file. + +## [Unreleased] + +- Initial release \ No newline at end of file diff --git a/toolchains/solidity/linter/extension/README.md b/toolchains/solidity/linter/extension/README.md new file mode 100644 index 00000000..f5ef46a3 --- /dev/null +++ b/toolchains/solidity/linter/extension/README.md @@ -0,0 +1,71 @@ +# solidhunter README + +This is the README for your extension "solidhunter". After writing up a brief description, we recommend including the following sections. + +## Features + +Describe specific features of your extension including screenshots of your extension in action. Image paths are relative to this README file. + +For example if there is an image subfolder under your extension project workspace: + +\!\[feature X\]\(images/feature-x.png\) + +> Tip: Many popular extensions utilize animations. This is an excellent way to show off your extension! We recommend short, focused animations that are easy to follow. + +## Requirements + +If you have any requirements or dependencies, add a section describing those and how to install and configure them. + +## Extension Settings + +Include if your extension adds any VS Code settings through the `contributes.configuration` extension point. + +For example: + +This extension contributes the following settings: + +* `myExtension.enable`: Enable/disable this extension. +* `myExtension.thing`: Set to `blah` to do something. + +## Known Issues + +Calling out known issues can help limit users opening duplicate issues against your extension. + +## Release Notes + +Users appreciate release notes as you update your extension. + +### 1.0.0 + +Initial release of ... + +### 1.0.1 + +Fixed issue #. + +### 1.1.0 + +Added features X, Y, and Z. + +--- + +## Following extension guidelines + +Ensure that you've read through the extensions guidelines and follow the best practices for creating your extension. + +* [Extension Guidelines](https://code.visualstudio.com/api/references/extension-guidelines) + +## Working with Markdown + +You can author your README using Visual Studio Code. Here are some useful editor keyboard shortcuts: + +* Split the editor (`Cmd+\` on macOS or `Ctrl+\` on Windows and Linux). +* Toggle preview (`Shift+Cmd+V` on macOS or `Shift+Ctrl+V` on Windows and Linux). +* Press `Ctrl+Space` (Windows, Linux, macOS) to see a list of Markdown snippets. + +## For more information + +* [Visual Studio Code's Markdown Support](http://code.visualstudio.com/docs/languages/markdown) +* [Markdown Syntax Reference](https://help.github.com/articles/markdown-basics/) + +**Enjoy!** diff --git a/toolchains/solidity/linter/extension/package.json b/toolchains/solidity/linter/extension/package.json new file mode 100644 index 00000000..6a649683 --- /dev/null +++ b/toolchains/solidity/linter/extension/package.json @@ -0,0 +1,90 @@ +{ + "name": "@osmium-toolchains/solidity-linter-extension", + "displayName": "solidhunter", + "description": "", + "version": "0.0.1", + "engines": { + "vscode": "^1.82.0" + }, + "categories": [ + "Other" + ], + "activationEvents": [ + "onLanguage:sol", + "onLanguage:solidity", + "workspaceContains:**/.solidhunter.json", + "workspaceContains:**/*.sol" + ], + "main": "./dist/extension.js", + "contributes": { + "commands": [ + { + "command": "solidhunter.helloWorld", + "title": "Hello World" + } + ], + "languages": [ + { + "id": "sol", + "aliases": [ + "Solidity" + ], + "extensions": [ + ".sol" + ] + } + ] + }, + "configuration": { + "type": "object", + "title": "solidity-language-server", + "properties": { + "solidhunter.trace.server": { + "type": "string", + "scope": "window", + "enum": [ + "off", + "messages", + "verbose" + ], + "enumDescriptions": [ + "No traces", + "Error only", + "Full log" + ], + "default": "verbose", + "description": "Traces the communication between VS Code and the language server." + } + } + }, + "scripts": { + "vscode:prepublish": "yarn run package", + "compile": "webpack", + "watch": "webpack --watch", + "package": "webpack --mode production --devtool hidden-source-map", + "compile-tests": "tsc -p . --outDir out", + "watch-tests": "tsc -p . -w --outDir out", + "pretest": "yarn run compile-tests && yarn run compile && yarn run lint", + "lint": "eslint src --ext ts", + "test": "node ./out/test/runTest.js" + }, + "devDependencies": { + "@types/glob": "^8.1.0", + "@types/mocha": "^10.0.1", + "@types/node": "20.2.5", + "@types/vscode": "^1.82.0", + "@typescript-eslint/eslint-plugin": "^5.59.8", + "@typescript-eslint/parser": "^5.59.8", + "@vscode/test-electron": "^2.3.2", + "eslint": "^8.41.0", + "glob": "^8.1.0", + "mocha": "^10.2.0", + "ts-loader": "^9.4.3", + "typescript": "^5.1.3", + "webpack": "^5.85.0", + "webpack-cli": "^5.1.1" + }, + "dependencies": { + "vscode-languageclient": "^8.1.0" + } +} diff --git a/toolchains/solidity/linter/extension/src/extension.ts b/toolchains/solidity/linter/extension/src/extension.ts new file mode 100644 index 00000000..f96c8307 --- /dev/null +++ b/toolchains/solidity/linter/extension/src/extension.ts @@ -0,0 +1,59 @@ +// The module 'vscode' contains the VS Code extensibility API +// Import the module and reference it with the alias vscode in your code below +import { workspace, ExtensionContext, window, commands } from 'vscode'; +import { LanguageClient, LanguageClientOptions, ServerOptions, TransportKind } from 'vscode-languageclient/node'; +import * as path from 'path'; + +let client: LanguageClient; + +// This method is called when your extension is activated +// Your extension is activated the very first time the command is executed +export async function activate(context: ExtensionContext) { + const binaryPath = path.join(context.extensionPath, 'core'); + console.log(binaryPath); + + const workspacePath = workspace.workspaceFolders?.[0].uri.fsPath; + const configPath = path.join(workspace.workspaceFolders?.[0].uri.fsPath, '.solidhunter.json'); + + if (!workspacePath) { + return; + } + + const serverOptions: ServerOptions = { + run: { command: binaryPath, args: ['-p', workspacePath, '-r', configPath], transport: TransportKind.stdio }, + debug: { command: binaryPath, args: ['-p', workspacePath, '-r', configPath], transport: TransportKind.stdio } + }; + + const traceOutputChannel = window.createOutputChannel("Osmium Solidity Linter Trace"); + // Options to control the language client + const clientOptions: LanguageClientOptions = { + // Register the server for plain text documents + documentSelector: [ + {scheme: "file", language:'sol'} + ], + synchronize: { + // Notify the server about file changes to '.clientrc files contained in the workspace + fileEvents: workspace.createFileSystemWatcher('**/.clientrc') + }, + traceOutputChannel + }; + + // Create the language client and start the client. + client = new LanguageClient( + 'osmium-solidity-linter', + 'Osmium Solidity Linter', + serverOptions, + clientOptions + ); + + // Start the client. This will also launch the server + await client.start(); +} + +// This method is called when your extension is deactivated +export function deactivate() { + if (!client) { + return undefined; + } + return client.stop(); +} \ No newline at end of file diff --git a/toolchains/solidity/linter/extension/tsconfig.json b/toolchains/solidity/linter/extension/tsconfig.json new file mode 100644 index 00000000..965a7b4c --- /dev/null +++ b/toolchains/solidity/linter/extension/tsconfig.json @@ -0,0 +1,16 @@ +{ + "compilerOptions": { + "module": "commonjs", + "target": "ES2020", + "lib": [ + "ES2020" + ], + "sourceMap": true, + "rootDir": "src", + "strict": true /* enable all strict type-checking options */ + /* Additional Checks */ + // "noImplicitReturns": true, /* Report error when not all code paths in function return a value. */ + // "noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */ + // "noUnusedParameters": true, /* Report errors on unused parameters. */ + } +} diff --git a/toolchains/solidity/linter/extension/vsc-extension-quickstart.md b/toolchains/solidity/linter/extension/vsc-extension-quickstart.md new file mode 100644 index 00000000..b2eb4a43 --- /dev/null +++ b/toolchains/solidity/linter/extension/vsc-extension-quickstart.md @@ -0,0 +1,47 @@ +# Welcome to your VS Code Extension + +## What's in the folder + +* This folder contains all of the files necessary for your extension. +* `package.json` - this is the manifest file in which you declare your extension and command. + * The sample plugin registers a command and defines its title and command name. With this information VS Code can show the command in the command palette. It doesn’t yet need to load the plugin. +* `src/extension.ts` - this is the main file where you will provide the implementation of your command. + * The file exports one function, `activate`, which is called the very first time your extension is activated (in this case by executing the command). Inside the `activate` function we call `registerCommand`. + * We pass the function containing the implementation of the command as the second parameter to `registerCommand`. + +## Setup + +* install the recommended extensions (amodio.tsl-problem-matcher and dbaeumer.vscode-eslint) + + +## Get up and running straight away + +* Press `F5` to open a new window with your extension loaded. +* Run your command from the command palette by pressing (`Ctrl+Shift+P` or `Cmd+Shift+P` on Mac) and typing `Hello World`. +* Set breakpoints in your code inside `src/extension.ts` to debug your extension. +* Find output from your extension in the debug console. + +## Make changes + +* You can relaunch the extension from the debug toolbar after changing code in `src/extension.ts`. +* You can also reload (`Ctrl+R` or `Cmd+R` on Mac) the VS Code window with your extension to load your changes. + + +## Explore the API + +* You can open the full set of our API when you open the file `node_modules/@types/vscode/index.d.ts`. + +## Run tests + +* Open the debug viewlet (`Ctrl+Shift+D` or `Cmd+Shift+D` on Mac) and from the launch configuration dropdown pick `Extension Tests`. +* Press `F5` to run the tests in a new window with your extension loaded. +* See the output of the test result in the debug console. +* Make changes to `src/test/suite/extension.test.ts` or create new test files inside the `test/suite` folder. + * The provided test runner will only consider files matching the name pattern `**.test.ts`. + * You can create folders inside the `test` folder to structure your tests any way you want. + +## Go further + +* Reduce the extension size and improve the startup time by [bundling your extension](https://code.visualstudio.com/api/working-with-extensions/bundling-extension). +* [Publish your extension](https://code.visualstudio.com/api/working-with-extensions/publishing-extension) on the VS Code extension marketplace. +* Automate builds by setting up [Continuous Integration](https://code.visualstudio.com/api/working-with-extensions/continuous-integration). diff --git a/toolchains/solidity/linter/extension/webpack.config.js b/toolchains/solidity/linter/extension/webpack.config.js new file mode 100644 index 00000000..7b84959c --- /dev/null +++ b/toolchains/solidity/linter/extension/webpack.config.js @@ -0,0 +1,61 @@ +//@ts-check + +'use strict'; + +const path = require('path'); + +//@ts-check +/** @typedef {import('webpack').Configuration} WebpackConfig **/ + +/** @type WebpackConfig */ +const extensionConfig = { + target: 'node', // VS Code extensions run in a Node.js-context 📖 -> https://webpack.js.org/configuration/node/ + mode: 'none', // this leaves the source code as close as possible to the original (when packaging we set this to 'production') + + entry: './src/extension.ts', // the entry point of this extension, 📖 -> https://webpack.js.org/configuration/entry-context/ + output: { + // the bundle is stored in the 'dist' folder (check package.json), 📖 -> https://webpack.js.org/configuration/output/ + path: path.resolve(__dirname, 'dist'), + filename: 'extension.js', + libraryTarget: 'commonjs2' + }, + externals: { + vscode: 'commonjs vscode' // the vscode-module is created on-the-fly and must be excluded. Add other modules that cannot be webpack'ed, 📖 -> https://webpack.js.org/configuration/externals/ + // modules added here also need to be added in the .vscodeignore file + }, + resolve: { + // support reading TypeScript and JavaScript files, 📖 -> https://github.com/TypeStrong/ts-loader + extensions: ['.ts', '.js'] + }, + module: { + rules: [ + { + test: /\.ts$/, + exclude: /node_modules/, + use: [ + { + loader: 'ts-loader' + } + ] + }, + { + // Solidhunter binary + test: /solidhunter/, + use: [ + { + loader: 'file-loader', + options: { + name: '[name]', + outputPath: 'dist' + } + }, + ] + }, + ] + }, + devtool: 'nosources-source-map', + infrastructureLogging: { + level: "log", // enables logging required for problem matchers + }, +}; +module.exports = [ extensionConfig ]; \ No newline at end of file diff --git a/toolchains/solidity/linter/package.json b/toolchains/solidity/linter/package.json index b3d5cd61..49b15a0f 100644 --- a/toolchains/solidity/linter/package.json +++ b/toolchains/solidity/linter/package.json @@ -4,7 +4,8 @@ "license": "MIT", "private": true, "workspaces": [ - "core" + "core", + "extension" ], "scripts": { "build": "yarn workspaces foreach run build", From 82e15c05df09e1b8ee8075e4ee3b375d96c08874 Mon Sep 17 00:00:00 2001 From: 0xMemoryGrinder <35138272+0xMemoryGrinder@users.noreply.github.com> Date: Fri, 29 Sep 2023 18:20:32 -0400 Subject: [PATCH 102/325] chore: deleted remove-me --- remove-me-87b2f04faae04ab39afd.txt | 1 - 1 file changed, 1 deletion(-) delete mode 100644 remove-me-87b2f04faae04ab39afd.txt diff --git a/remove-me-87b2f04faae04ab39afd.txt b/remove-me-87b2f04faae04ab39afd.txt deleted file mode 100644 index e47371fb..00000000 --- a/remove-me-87b2f04faae04ab39afd.txt +++ /dev/null @@ -1 +0,0 @@ -87b2f04faae04ab39afd From 57bd1ce9354258da7df5c1c7e821330d8226d95a Mon Sep 17 00:00:00 2001 From: 0xMemoryGrinder <35138272+0xMemoryGrinder@users.noreply.github.com> Date: Fri, 29 Sep 2023 19:51:33 -0400 Subject: [PATCH 103/325] fix(solidity/linter/core): fix package.json scripts for ci run --- toolchains/solidity/linter/extension/package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/toolchains/solidity/linter/extension/package.json b/toolchains/solidity/linter/extension/package.json index 6a649683..c9d3de90 100644 --- a/toolchains/solidity/linter/extension/package.json +++ b/toolchains/solidity/linter/extension/package.json @@ -65,8 +65,8 @@ "compile-tests": "tsc -p . --outDir out", "watch-tests": "tsc -p . -w --outDir out", "pretest": "yarn run compile-tests && yarn run compile && yarn run lint", - "lint": "eslint src --ext ts", - "test": "node ./out/test/runTest.js" + "lint": "yarn install && eslint src --ext ts", + "test": "echo \"no tests\"" }, "devDependencies": { "@types/glob": "^8.1.0", From 29308f443d0089494c2e354740d9006859aa806c Mon Sep 17 00:00:00 2001 From: 0xMemoryGrinder <35138272+0xMemoryGrinder@users.noreply.github.com> Date: Fri, 29 Sep 2023 20:00:05 -0400 Subject: [PATCH 104/325] chore: added missing package.json and updated lockfile --- .pnp.cjs | 14 ++++++++++++++ libs/lsp-server-wrapper/package.json | 10 ++++++++++ yarn.lock | 6 ++++++ 3 files changed, 30 insertions(+) create mode 100644 libs/lsp-server-wrapper/package.json diff --git a/.pnp.cjs b/.pnp.cjs index 85929c31..948dbcae 100644 --- a/.pnp.cjs +++ b/.pnp.cjs @@ -23,6 +23,10 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { "name": "@osmium-libs/lsp-launcher",\ "reference": "workspace:libs/lsp-launcher"\ },\ + {\ + "name": "@osmium-libs/lsp-server-wrapper",\ + "reference": "workspace:libs/lsp-server-wrapper"\ + },\ {\ "name": "@osmium/manager",\ "reference": "workspace:manager"\ @@ -61,6 +65,7 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { "fallbackExclusionList": [\ ["@osmium-libs/ast-extractor", ["workspace:libs/ast-extractor"]],\ ["@osmium-libs/lsp-launcher", ["workspace:libs/lsp-launcher"]],\ + ["@osmium-libs/lsp-server-wrapper", ["workspace:libs/lsp-server-wrapper"]],\ ["@osmium-packages/eslint-config", ["workspace:packages/eslint-config"]],\ ["@osmium-packages/prettier-config", ["workspace:packages/prettier-config"]],\ ["@osmium-toolchains/solidity", ["workspace:toolchains/solidity"]],\ @@ -388,6 +393,15 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { "linkType": "SOFT"\ }]\ ]],\ + ["@osmium-libs/lsp-server-wrapper", [\ + ["workspace:libs/lsp-server-wrapper", {\ + "packageLocation": "./libs/lsp-server-wrapper/",\ + "packageDependencies": [\ + ["@osmium-libs/lsp-server-wrapper", "workspace:libs/lsp-server-wrapper"]\ + ],\ + "linkType": "SOFT"\ + }]\ + ]],\ ["@osmium-packages/eslint-config", [\ ["workspace:packages/eslint-config", {\ "packageLocation": "./packages/eslint-config/",\ diff --git a/libs/lsp-server-wrapper/package.json b/libs/lsp-server-wrapper/package.json new file mode 100644 index 00000000..a6986729 --- /dev/null +++ b/libs/lsp-server-wrapper/package.json @@ -0,0 +1,10 @@ +{ + "name": "@osmium-libs/lsp-server-wrapper", + "packageManager": "yarn@3.6.1", + "scripts": { + "build": "cargo build --release", + "format": "cargo fmt", + "test": "cargo test", + "lint": "cargo clippy --all-targets --all-features -- -D warnings" + } +} diff --git a/yarn.lock b/yarn.lock index 4e067ff7..849b4f01 100644 --- a/yarn.lock +++ b/yarn.lock @@ -242,6 +242,12 @@ __metadata: languageName: unknown linkType: soft +"@osmium-libs/lsp-server-wrapper@workspace:libs/lsp-server-wrapper": + version: 0.0.0-use.local + resolution: "@osmium-libs/lsp-server-wrapper@workspace:libs/lsp-server-wrapper" + languageName: unknown + linkType: soft + "@osmium-packages/eslint-config@workspace:packages/eslint-config": version: 0.0.0-use.local resolution: "@osmium-packages/eslint-config@workspace:packages/eslint-config" From 20b742c044998ea1281a253f750fb0792233301a Mon Sep 17 00:00:00 2001 From: 0xMemoryGrinder <35138272+0xMemoryGrinder@users.noreply.github.com> Date: Fri, 29 Sep 2023 20:47:24 -0400 Subject: [PATCH 105/325] fix(libs/lsp-server-wrapper): removed mandatory yarn version --- libs/lsp-server-wrapper/package.json | 1 - 1 file changed, 1 deletion(-) diff --git a/libs/lsp-server-wrapper/package.json b/libs/lsp-server-wrapper/package.json index a6986729..d3f5d643 100644 --- a/libs/lsp-server-wrapper/package.json +++ b/libs/lsp-server-wrapper/package.json @@ -1,6 +1,5 @@ { "name": "@osmium-libs/lsp-server-wrapper", - "packageManager": "yarn@3.6.1", "scripts": { "build": "cargo build --release", "format": "cargo fmt", From cc68dfdb1e340ea3b550f0a43ce565fcdc037865 Mon Sep 17 00:00:00 2001 From: 0xMemoryGrinder <35138272+0xMemoryGrinder@users.noreply.github.com> Date: Sat, 30 Sep 2023 13:11:08 -0400 Subject: [PATCH 106/325] fix(solidity/linter/extension): ran yarn install to fix yarn.lock --- .pnp.cjs | 20 ++++++++++---------- .pnp.loader.mjs | 2 +- yarn.lock | 4 ++-- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/.pnp.cjs b/.pnp.cjs index 948dbcae..42178f1e 100644 --- a/.pnp.cjs +++ b/.pnp.cjs @@ -447,7 +447,7 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { ["glob", "npm:8.1.0"],\ ["mocha", "npm:10.2.0"],\ ["ts-loader", "virtual:114e6097baba06f1f7194aa147cc16af7c3daf193a49e5fc802ef9cf9d7ac56ceb0639593345639ab943707d850061c33067576340115e57cb282fb86146f6a5#npm:9.4.4"],\ - ["typescript", "patch:typescript@npm%3A5.2.2#~builtin::version=5.2.2&hash=14eedb"],\ + ["typescript", "patch:typescript@npm%3A5.2.2#~builtin::version=5.2.2&hash=f3b441"],\ ["vscode-languageclient", "npm:8.1.0"],\ ["webpack", "virtual:114e6097baba06f1f7194aa147cc16af7c3daf193a49e5fc802ef9cf9d7ac56ceb0639593345639ab943707d850061c33067576340115e57cb282fb86146f6a5#npm:5.88.2"],\ ["webpack-cli", "virtual:114e6097baba06f1f7194aa147cc16af7c3daf193a49e5fc802ef9cf9d7ac56ceb0639593345639ab943707d850061c33067576340115e57cb282fb86146f6a5#npm:5.1.4"]\ @@ -646,7 +646,7 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { ["natural-compare-lite", "npm:1.4.0"],\ ["semver", "npm:7.5.4"],\ ["tsutils", "virtual:3aca1ca16440e1ff7da0d6f5eed3f78efd0b8a2affea9a555b157df0fdba643060f7eef6665d606c0072b2d888384117b8c28f3e1839eba9cd360ad78efcb4d2#npm:3.21.0"],\ - ["typescript", "patch:typescript@npm%3A5.2.2#~builtin::version=5.2.2&hash=14eedb"]\ + ["typescript", "patch:typescript@npm%3A5.2.2#~builtin::version=5.2.2&hash=f3b441"]\ ],\ "packagePeers": [\ "@types/eslint",\ @@ -678,7 +678,7 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { ["@typescript-eslint/typescript-estree", "virtual:09a32c5d05445519672e7033850acc14806599ea4e35ceaa13d5f96f4ca63755fceba3d6f7c6e23aa5ec1c9d607a5bed84c29c92a52c0d9190e407626c2343da#npm:5.62.0"],\ ["debug", "virtual:ced87d94ab05a28b44536eb0cd61a9458e757a0ae7bb35e5ab5d27e03d08b996abd275928b29aad2eb0973d5bb0800e75ba8ca3e26bf62cbe8ea0fae8cca70a8#npm:4.3.4"],\ ["eslint", "npm:8.49.0"],\ - ["typescript", "patch:typescript@npm%3A5.2.2#~builtin::version=5.2.2&hash=14eedb"]\ + ["typescript", "patch:typescript@npm%3A5.2.2#~builtin::version=5.2.2&hash=f3b441"]\ ],\ "packagePeers": [\ "@types/eslint",\ @@ -719,7 +719,7 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { ["debug", "virtual:ced87d94ab05a28b44536eb0cd61a9458e757a0ae7bb35e5ab5d27e03d08b996abd275928b29aad2eb0973d5bb0800e75ba8ca3e26bf62cbe8ea0fae8cca70a8#npm:4.3.4"],\ ["eslint", "npm:8.49.0"],\ ["tsutils", "virtual:3aca1ca16440e1ff7da0d6f5eed3f78efd0b8a2affea9a555b157df0fdba643060f7eef6665d606c0072b2d888384117b8c28f3e1839eba9cd360ad78efcb4d2#npm:3.21.0"],\ - ["typescript", "patch:typescript@npm%3A5.2.2#~builtin::version=5.2.2&hash=14eedb"]\ + ["typescript", "patch:typescript@npm%3A5.2.2#~builtin::version=5.2.2&hash=f3b441"]\ ],\ "packagePeers": [\ "@types/eslint",\ @@ -759,7 +759,7 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { ["is-glob", "npm:4.0.3"],\ ["semver", "npm:7.5.4"],\ ["tsutils", "virtual:3aca1ca16440e1ff7da0d6f5eed3f78efd0b8a2affea9a555b157df0fdba643060f7eef6665d606c0072b2d888384117b8c28f3e1839eba9cd360ad78efcb4d2#npm:3.21.0"],\ - ["typescript", "patch:typescript@npm%3A5.2.2#~builtin::version=5.2.2&hash=14eedb"]\ + ["typescript", "patch:typescript@npm%3A5.2.2#~builtin::version=5.2.2&hash=f3b441"]\ ],\ "packagePeers": [\ "@types/typescript",\ @@ -4025,7 +4025,7 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { ["enhanced-resolve", "npm:5.15.0"],\ ["micromatch", "npm:4.0.5"],\ ["semver", "npm:7.5.4"],\ - ["typescript", "patch:typescript@npm%3A5.2.2#~builtin::version=5.2.2&hash=14eedb"],\ + ["typescript", "patch:typescript@npm%3A5.2.2#~builtin::version=5.2.2&hash=f3b441"],\ ["webpack", "virtual:114e6097baba06f1f7194aa147cc16af7c3daf193a49e5fc802ef9cf9d7ac56ceb0639593345639ab943707d850061c33067576340115e57cb282fb86146f6a5#npm:5.88.2"]\ ],\ "packagePeers": [\ @@ -4060,7 +4060,7 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { ["tsutils", "virtual:3aca1ca16440e1ff7da0d6f5eed3f78efd0b8a2affea9a555b157df0fdba643060f7eef6665d606c0072b2d888384117b8c28f3e1839eba9cd360ad78efcb4d2#npm:3.21.0"],\ ["@types/typescript", null],\ ["tslib", "npm:1.14.1"],\ - ["typescript", "patch:typescript@npm%3A5.2.2#~builtin::version=5.2.2&hash=14eedb"]\ + ["typescript", "patch:typescript@npm%3A5.2.2#~builtin::version=5.2.2&hash=f3b441"]\ ],\ "packagePeers": [\ "@types/typescript",\ @@ -4103,10 +4103,10 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { }]\ ]],\ ["typescript", [\ - ["patch:typescript@npm%3A5.2.2#~builtin::version=5.2.2&hash=14eedb", {\ - "packageLocation": "./.yarn/cache/typescript-patch-79198159d7-07106822b4.zip/node_modules/typescript/",\ + ["patch:typescript@npm%3A5.2.2#~builtin::version=5.2.2&hash=f3b441", {\ + "packageLocation": "./.yarn/cache/typescript-patch-2e8dbfb8ab-0f4da2f15e.zip/node_modules/typescript/",\ "packageDependencies": [\ - ["typescript", "patch:typescript@npm%3A5.2.2#~builtin::version=5.2.2&hash=14eedb"]\ + ["typescript", "patch:typescript@npm%3A5.2.2#~builtin::version=5.2.2&hash=f3b441"]\ ],\ "linkType": "HARD"\ }]\ diff --git a/.pnp.loader.mjs b/.pnp.loader.mjs index 7390f92d..4b7f9f84 100644 --- a/.pnp.loader.mjs +++ b/.pnp.loader.mjs @@ -1471,7 +1471,7 @@ async function load$1(urlString, context, nextLoad) { } return { format, - source: await fs.promises.readFile(filePath, `utf8`), + source: format === `commonjs` ? void 0 : await fs.promises.readFile(filePath, `utf8`), shortCircuit: true }; } diff --git a/yarn.lock b/yarn.lock index 849b4f01..dd20b2aa 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3366,11 +3366,11 @@ __metadata: "typescript@patch:typescript@^5.1.3#~builtin": version: 5.2.2 - resolution: "typescript@patch:typescript@npm%3A5.2.2#~builtin::version=5.2.2&hash=14eedb" + resolution: "typescript@patch:typescript@npm%3A5.2.2#~builtin::version=5.2.2&hash=f3b441" bin: tsc: bin/tsc tsserver: bin/tsserver - checksum: 07106822b4305de3f22835cbba949a2b35451cad50888759b6818421290ff95d522b38ef7919e70fb381c5fe9c1c643d7dea22c8b31652a717ddbd57b7f4d554 + checksum: 0f4da2f15e6f1245e49db15801dbee52f2bbfb267e1c39225afdab5afee1a72839cd86000e65ee9d7e4dfaff12239d28beaf5ee431357fcced15fb08583d72ca languageName: node linkType: hard From 5111aea3f4461b967346d8d347c499cdaff78f54 Mon Sep 17 00:00:00 2001 From: Astrodevs CI Date: Wed, 27 Sep 2023 02:48:03 +0000 Subject: [PATCH 107/325] chore: create branch chore/134-solidity-ast-crate-generic-visitor-staging --- remove-me-d052cd56fae0467c9d53.txt | 1 + 1 file changed, 1 insertion(+) create mode 100644 remove-me-d052cd56fae0467c9d53.txt diff --git a/remove-me-d052cd56fae0467c9d53.txt b/remove-me-d052cd56fae0467c9d53.txt new file mode 100644 index 00000000..9026bec9 --- /dev/null +++ b/remove-me-d052cd56fae0467c9d53.txt @@ -0,0 +1 @@ +d052cd56fae0467c9d53 From f8a1c7850bf5ebfc5760fdafd1168002de8b20dd Mon Sep 17 00:00:00 2001 From: 0xMemoryGrinder <35138272+0xMemoryGrinder@users.noreply.github.com> Date: Thu, 28 Sep 2023 22:45:46 -0400 Subject: [PATCH 108/325] wip(solidity/ast-crate/node-finder): base finder engine --- libs/ast-extractor/interactable_nodes.md | 12 + libs/ast-extractor/src/extract.rs | 1 + libs/ast-extractor/src/retriever.rs | 4 + libs/ast-extractor/src/retriever/finder.rs | 265 ++++++++++++++++++ .../src/retriever/finder/find_node.rs | 21 ++ 5 files changed, 303 insertions(+) create mode 100644 libs/ast-extractor/interactable_nodes.md create mode 100644 libs/ast-extractor/src/retriever/finder.rs create mode 100644 libs/ast-extractor/src/retriever/finder/find_node.rs diff --git a/libs/ast-extractor/interactable_nodes.md b/libs/ast-extractor/interactable_nodes.md new file mode 100644 index 00000000..3723830c --- /dev/null +++ b/libs/ast-extractor/interactable_nodes.md @@ -0,0 +1,12 @@ +File : + Imports (name) + Contract { definition } (name, Inheritance): contract Test is ERC20 {} + Contract { instantiation } (type) : new Test(param1, param2) + Contract { scope } (type) : Test::Enum1::ONE + Variable { definition } (name, type, visibility, storage) + Variable { usage } (name) + Property { definition } (name, type, visibility, storage) + Property { usage } (name) + Function { definition } (name, visibility, storage, pure, payable, modifiers, return_type, parameters) + Function { usage } (name, parameters) + Method \ No newline at end of file diff --git a/libs/ast-extractor/src/extract.rs b/libs/ast-extractor/src/extract.rs index 0b88575d..e51cd39a 100644 --- a/libs/ast-extractor/src/extract.rs +++ b/libs/ast-extractor/src/extract.rs @@ -13,6 +13,7 @@ pub fn extract_ast_from_content(content: &str) -> Result Self { + Self { + line: 0, + char: 0, + } + } + pub fn from(line: usize, char: usize) -> Self { + Self { + line, + char, + } + } + +} + +pub struct FoundNode { + node_type: String, + node: Box, + sub_span: Option>, +} + + +impl FoundNode { + pub fn new(node_type: String, node: Box, sub_span: Option>) -> Self { + Self { + node, + node_type, + sub_span, + } + } +} +struct FinderVisitor { + found: Option, + to_find: Position, +} + + +impl FinderVisitor { + + pub fn new(pos: Position) -> Self { + Self { + found: None, + to_find: pos, + } + } + pub fn check_matching(&mut self, node: Box, node_type: String) -> bool { + let start_pos = node.span().start(); + let end_pos = node.span().end(); + if self._is_in_range(start_pos, end_pos) { + self.found = Some(FoundNode::new( + node_type, + node, + None + )); + return true; + } + return false; + } + + fn _is_in_range(&self, start: LineColumn, end: LineColumn) -> bool { + if self.to_find.char >= start.column && self.to_find.line <= start.line + && self.to_find.char <= end.column && self.to_find.line <= end.line { + return true; + } + return false; + } + + pub fn check_matching_sub_span(&mut self, node: Box, node_type: String, sub_span: Option>) -> bool{ + let start_pos = sub_span.span().start(); + let end_pos = sub_span.span().end(); + if self._is_in_range(start_pos, end_pos) { + self.found = Some(FoundNode::new( + node_type, + node, + sub_span + )); + return true; + } + return false; + } + + pub fn stmts_finder(&mut self, block: Block) -> (bool, Option) { + let mut found = false; + + for stmt in &block.stmts { + if found { + break + } + match stmt { + Stmt::VarDecl(node) => { + match &*node.declaration { + VarDeclDecl::VarDecl(decl) => { + match &decl.ty { + Type::Address(span, payable) => { + if self.check_matching_sub_span(Box::new(decl.clone()), String::from("address"), Some(Box::new(span.clone()))) { + break + } + } + Type::String(span) => { + if self.check_matching_sub_span(Box::new(decl.clone()), String::from("string"), Some(Box::new(span.clone()))) { + break + } + } + Type::Bytes(span) => { + if self.check_matching_sub_span(Box::new(decl.clone()), String::from("bytes"), Some(Box::new(span.clone()))) { + break + + } + } + Type::Custom(span) => { + if self.check_matching_sub_span(Box::new(decl.clone()), String::from("custom"), Some(Box::new(span.clone()))) { + break + } + + } + _ => {} + } + if found { + break + } + + } + _ => {} + } + if found { + break + } + + }, + _ => {} + } + } + return (false, None); + } + +} + +impl<'ast> Visit<'ast> for FinderVisitor { + fn visit_item_function(&mut self, function: &'ast ItemFunction) { + let mut found: bool = false; + + match &function.body { + FunctionBody::Block(block) => { + for stmt in &block.stmts { + println!("stmt: {:?}", stmt); + if found { + break + } + match stmt { + Stmt::VarDecl(node) => { + match &*node.declaration { + VarDeclDecl::VarDecl(decl) => { + match &decl.ty { + Type::Address(span, payable) => { + if self.check_matching_sub_span(Box::new(decl.clone()), String::from("address"), Some(Box::new(span.clone()))) { + break + } + } + Type::String(span) => { + if self.check_matching_sub_span(Box::new(decl.clone()), String::from("string"), Some(Box::new(span.clone()))) { + break + } + } + Type::Bytes(span) => { + if self.check_matching_sub_span(Box::new(decl.clone()), String::from("bytes"), Some(Box::new(span.clone()))) { + break + + } + } + Type::Custom(span) => { + if self.check_matching_sub_span(Box::new(decl.clone()), String::from("custom"), Some(Box::new(span.clone()))) { + break + } + + } + _ => {} + } + if found { + break + } + + } + _ => {} + } + if found { + break + } + + }, + _ => {} + } + } + }, + _ => {} + } + syn_solidity::visit::visit_item_function(self, function); + } + +} + + +pub fn retrieve_node_from_position(ast: &syn_solidity::File, pos: Position) -> Option { + let mut visitor = FinderVisitor::new(pos); + visitor.visit_file(ast); + visitor.found +} + + +#[cfg(test)] +mod tests { + use proc_macro2::TokenStream; + + use super::*; + use std::fs; + use std::path::PathBuf; + use std::str::FromStr; + + #[test] + fn test_retrieve_node_type_decl_string() { + let source = String::from("pragma solidity ^0.8.0;\ + abstract contract One { + uint storedData; + function set(uint x) public { + storedData = x; + string test2; + } + + function get() public view returns (uint) { + return storedData; + } +}"); + let tokens = TokenStream::from_str(source.as_str()).unwrap(); + let ast = syn_solidity::parse2(tokens).unwrap(); + let res = retrieve_node_from_position(&ast, Position::from(5, 8)); + match &res { + Some(node) => { + match &node.sub_span { + Some(span) => {assert!(true)} + _ => {} + } + assert_eq!(node.node_type, "string"); + + } + _ => {assert!(false)} + } + + } +} diff --git a/libs/ast-extractor/src/retriever/finder/find_node.rs b/libs/ast-extractor/src/retriever/finder/find_node.rs new file mode 100644 index 00000000..b8a46bab --- /dev/null +++ b/libs/ast-extractor/src/retriever/finder/find_node.rs @@ -0,0 +1,21 @@ +/** + * find_node.rs + * Enum for all possible ast types that can be found + * author: 0xMemoryGrinder + */ + +use syn_solidity::{ItemContract, ItemEnum}; + +pub enum FoundNode { + // Contract Definition + ContractDef(ItemContract), + ContractRef(ItemContract), + + + + + + FileEnum(ItemEnum), + ContractEnum((ItemContract, ItemEnum)) + +} \ No newline at end of file From 7313e69e2cc793eea34e9c3345d4c11d1e4deb0b Mon Sep 17 00:00:00 2001 From: 0xSwapFeeder Date: Mon, 25 Sep 2023 23:33:45 -0400 Subject: [PATCH 109/325] wip(solidity/ast-crate/node-finder): listed most of the references needed --- libs/ast-extractor/interactable_nodes.md | 61 +++++++++++++++++++----- 1 file changed, 50 insertions(+), 11 deletions(-) diff --git a/libs/ast-extractor/interactable_nodes.md b/libs/ast-extractor/interactable_nodes.md index 3723830c..8e953d81 100644 --- a/libs/ast-extractor/interactable_nodes.md +++ b/libs/ast-extractor/interactable_nodes.md @@ -1,12 +1,51 @@ File : - Imports (name) - Contract { definition } (name, Inheritance): contract Test is ERC20 {} - Contract { instantiation } (type) : new Test(param1, param2) - Contract { scope } (type) : Test::Enum1::ONE - Variable { definition } (name, type, visibility, storage) - Variable { usage } (name) - Property { definition } (name, type, visibility, storage) - Property { usage } (name) - Function { definition } (name, visibility, storage, pure, payable, modifiers, return_type, parameters) - Function { usage } (name, parameters) - Method \ No newline at end of file + * Imports (name): + * Contract { definition } (name, Inheritance): contract Test is ERC20 {} + - ContractName(contract) + - ContractInheritance(contract, inheritance) + + * Contract { instantiation } (type) : new Test(param1, param2) + - ContractInstantiation(file, contract, Option, new) + + * Contract { scope } (type) : Test::Enum1::ONE + - ContractScope(file, contract, Option, scope) //TODO: search contract scope as + - Contract: + * Function { definition } (name, return_type, parameters) + - ReturnType(file, contract, function, type) + - FunctionParameter(file, contract, function, parameter) + - FunctionName(file, contract, function) + * Function { usages } (name) + - FunctionName(file, contract, function) + + * Property { definition } (name, type) + - PropertyName(file, contract, property, name) + - PropertyType(file, contract, property, type) + + * Variable { definition } (name, type) + - VariableName(file, Option, Option, variable) + - VariableType(file, Option, Option, variable) + + * Variable { usages } (name) + - VariableName(file, contract, function, property) + + Enum + Struct + Event + Emit + Error(e en miniscule) + Library + usage + // TODO: search cast ast node + // TODO: search super ast node + + + + +contract Test { +modifier onlyOwner() { +... +} + +function a(param1) public return uint256 onlyOwner { +.. +} \ No newline at end of file From d6314d468d420ffabbf1f2f504fae24a0583308e Mon Sep 17 00:00:00 2001 From: 0xSwapFeeder Date: Tue, 26 Sep 2023 22:47:01 -0400 Subject: [PATCH 110/325] wip(solidity/ast-crate/node-finder): listed some missing node types to find --- libs/ast-extractor/interactable_nodes.md | 37 +++++++++++++++++++----- 1 file changed, 30 insertions(+), 7 deletions(-) diff --git a/libs/ast-extractor/interactable_nodes.md b/libs/ast-extractor/interactable_nodes.md index 8e953d81..6397cbdc 100644 --- a/libs/ast-extractor/interactable_nodes.md +++ b/libs/ast-extractor/interactable_nodes.md @@ -28,13 +28,36 @@ File : * Variable { usages } (name) - VariableName(file, contract, function, property) - Enum - Struct - Event - Emit - Error(e en miniscule) - Library - usage + Enum { definition } (name, values) + - EnumName(file, Option, enum, name) + - EnumValue(file, contract, enum, value) + Enum { usages } (name) + - EnumName(file, Option, Option, enum, name) + + Struct { definition } (name) + - StructName(file, Option, struct, name) + Struct { instantiation } (type) + - StructInstantiation(file, contract, Option, struct, new) + Struct { usages } (name) + - StructName(file, contract, Option, struct, name) + + Event { definition } (name, parameters) + - EventName(file, contract, event, name) + - EventParameter(file, contract, event, parameter) + Event { usages } (name) + - EventName(file, contract, Option, event, name) + + Error { definition } (name, type) + - ErrorName(file, contract, error, name) + - ErrorType(file, contract, error, type) + Error { usages } + - ErrorName(file, contract, Option, error, name) + + Library { definition } (name) + - LibraryName(file, Option, library, name) + Library { usages } + - LibraryName(file, contract, Option, library, name) + // TODO: search cast ast node // TODO: search super ast node From 33c3b872efb02e047f467c40a151732b9b547199 Mon Sep 17 00:00:00 2001 From: 0xMemoryGrinder <35138272+0xMemoryGrinder@users.noreply.github.com> Date: Thu, 28 Sep 2023 16:44:40 -0400 Subject: [PATCH 111/325] feat(libs/ast-extractor): added enum values for some clickable types --- .../src/retriever/finder/find_node.rs | 32 ++++++++++++++++--- 1 file changed, 28 insertions(+), 4 deletions(-) diff --git a/libs/ast-extractor/src/retriever/finder/find_node.rs b/libs/ast-extractor/src/retriever/finder/find_node.rs index b8a46bab..1e955a1b 100644 --- a/libs/ast-extractor/src/retriever/finder/find_node.rs +++ b/libs/ast-extractor/src/retriever/finder/find_node.rs @@ -4,12 +4,36 @@ * author: 0xMemoryGrinder */ -use syn_solidity::{ItemContract, ItemEnum}; +use syn_solidity::{ExprNew, ItemContract, ItemEnum, ItemFunction, VariableDeclaration, ExprCall, SolIdent, VariableDefinition, Type, VarDeclDecl, Expr}; pub enum FoundNode { - // Contract Definition - ContractDef(ItemContract), - ContractRef(ItemContract), + + + + + + // Contracts + ContractDefName(ItemContract), + ContractDefInheritance(ItemContract), + ContractInstantiation(ItemContract, Option, ExprNew), + //TODO : ContractScope(ItemContract, Option, ????), + + // Functions + FunctionDefName(ItemContract, ItemFunction), + FunctionDefParameter(ItemContract, ItemFunction, VariableDeclaration), + FunctionDefReturn(ItemContract, ItemFunction, VariableDeclaration), + FunctionUsageName(ItemContract, ItemFunction, ExprCall), + + // Properties + PropertyDefName(ItemContract, VariableDefinition, SolIdent), + PropertyDefType(ItemContract, VariableDefinition, Type), + + // Variables + VariableDefName(ItemContract, VarDeclDecl, VariableDeclaration, Option), + VariableDefType(ItemContract, VarDeclDecl, VariableDeclaration, Type), + VariableUsageName(Option, Option, Expr, SolIdent), + + From 4d4337f9026d69d551c432051d71569b72268753 Mon Sep 17 00:00:00 2001 From: 0xMemoryGrinder <35138272+0xMemoryGrinder@users.noreply.github.com> Date: Fri, 29 Sep 2023 12:09:25 -0400 Subject: [PATCH 112/325] wip: more wip --- libs/ast-extractor/Cargo.lock | 3 +- libs/ast-extractor/Cargo.toml | 2 +- libs/ast-extractor/interactable_nodes.md | 6 - libs/ast-extractor/src/retriever/finder.rs | 277 +++++++++--------- .../src/retriever/finder/find_node.rs | 63 +++- 5 files changed, 192 insertions(+), 159 deletions(-) diff --git a/libs/ast-extractor/Cargo.lock b/libs/ast-extractor/Cargo.lock index fedac976..46a525ce 100644 --- a/libs/ast-extractor/Cargo.lock +++ b/libs/ast-extractor/Cargo.lock @@ -51,8 +51,7 @@ dependencies = [ [[package]] name = "syn-solidity" version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "397f229dc34c7b8231b6ef85502f9ca4e3425b8625e6d403bb74779e6b1917b5" +source = "git+https://github.com/alloy-rs/core.git#73e4e51ef4fccbdfb4ebf6c1e028430fdfbfc51a" dependencies = [ "paste", "proc-macro2", diff --git a/libs/ast-extractor/Cargo.toml b/libs/ast-extractor/Cargo.toml index e76d6905..a570cb36 100644 --- a/libs/ast-extractor/Cargo.toml +++ b/libs/ast-extractor/Cargo.toml @@ -8,6 +8,6 @@ edition = "2021" [dependencies] quote = "1.0.33" proc-macro2 = { version = "1.0.66", features = ["span-locations"]} -syn-solidity = { version = "0.3.1", features = ["visit"] } +syn-solidity = { git = "https://github.com/alloy-rs/core.git", features = ["visit"] } thiserror = "1" syn = "2" \ No newline at end of file diff --git a/libs/ast-extractor/interactable_nodes.md b/libs/ast-extractor/interactable_nodes.md index 6397cbdc..70860310 100644 --- a/libs/ast-extractor/interactable_nodes.md +++ b/libs/ast-extractor/interactable_nodes.md @@ -49,15 +49,9 @@ File : Error { definition } (name, type) - ErrorName(file, contract, error, name) - - ErrorType(file, contract, error, type) Error { usages } - ErrorName(file, contract, Option, error, name) - Library { definition } (name) - - LibraryName(file, Option, library, name) - Library { usages } - - LibraryName(file, contract, Option, library, name) - // TODO: search cast ast node // TODO: search super ast node diff --git a/libs/ast-extractor/src/retriever/finder.rs b/libs/ast-extractor/src/retriever/finder.rs index 99b0b376..72567f94 100644 --- a/libs/ast-extractor/src/retriever/finder.rs +++ b/libs/ast-extractor/src/retriever/finder.rs @@ -1,13 +1,23 @@ /** * finder.rs * Function to retrieve contract nodes from position - * author: 0xMemoryGrinder + * author: 0xSwapFeeder */ use syn_solidity::*; use proc_macro2::LineColumn; -mod find_node; +use syn::ExprLit; +use syn_solidity::kw::contract; +use syn_solidity::visit::visit_variable_declaration; +use crate::retriever::finder::find_node::FoundNode; +mod find_node; +macro_rules! is_in_range { + ($start:expr, $end:expr, $pos:expr) => { + $pos.char >= $start.column && $pos.line <= $start.line + && $pos.char <= $end.column && $pos.line <= $end.line + }; +} pub struct Position { line: usize, @@ -15,13 +25,7 @@ pub struct Position { } impl Position { - pub fn new() -> Self { - Self { - line: 0, - char: 0, - } - } - pub fn from(line: usize, char: usize) -> Self { + pub fn new(line: usize, char: usize) -> Self { Self { line, char, @@ -30,23 +34,26 @@ impl Position { } -pub struct FoundNode { - node_type: String, - node: Box, - sub_span: Option>, -} - - -impl FoundNode { - pub fn new(node_type: String, node: Box, sub_span: Option>) -> Self { +impl Default for Position { + fn default() -> Self { Self { - node, - node_type, - sub_span, + line: 0, + char: 0, } } } + struct FinderVisitor { + current_contract: Option>, + current_function: Option>, + current_property: Option>, + current_variable: Option>, + current_enum: Option>, + current_struct: Option>, + current_error: Option>, + current_event: Option>, + current_expr: Option>, + current_stmt: Option>, found: Option, to_find: Position, } @@ -56,10 +63,35 @@ impl FinderVisitor { pub fn new(pos: Position) -> Self { Self { + current_contract: None, + current_function: None, + current_property: None, + current_variable: None, + current_enum: None, + current_struct: None, + current_error: None, + current_event: None, + current_expr: None, + current_stmt: None, found: None, to_find: pos, } } + + fn check_inheritance_matching(&mut self, contract: &ItemContract) -> bool { + if let Some(inheritance) = &contract.inheritance { + if is_in_range!(inheritance.span().start(), inheritance.span().end(), self.to_find) { + for inherit in inheritance.inheritance { + if is_in_range!(inherit.span().start(), inherit.span().end(), self.to_find) { + self.found = Some(FoundNode::ContractDefInheritance(contract.clone(), inherit)); + return true; + } + } + } + } + return false; + } + pub fn check_matching(&mut self, node: Box, node_type: String) -> bool { let start_pos = node.span().start(); let end_pos = node.span().end(); @@ -74,14 +106,6 @@ impl FinderVisitor { return false; } - fn _is_in_range(&self, start: LineColumn, end: LineColumn) -> bool { - if self.to_find.char >= start.column && self.to_find.line <= start.line - && self.to_find.char <= end.column && self.to_find.line <= end.line { - return true; - } - return false; - } - pub fn check_matching_sub_span(&mut self, node: Box, node_type: String, sub_span: Option>) -> bool{ let start_pos = sub_span.span().start(); let end_pos = sub_span.span().end(); @@ -96,127 +120,112 @@ impl FinderVisitor { return false; } - pub fn stmts_finder(&mut self, block: Block) -> (bool, Option) { - let mut found = false; +} - for stmt in &block.stmts { - if found { - break +impl<'ast> Visit<'ast> for FinderVisitor { + fn visit_expr_call(&mut self, i: &'ast ExprCall) { + todo!() + } + + fn visit_variable_declaration(&mut self, var: &'ast VariableDeclaration) { + if is_in_range!(var.span().start(), var.span().end(), self.to_find) { + self.current_variable = Some(Box::new(var.clone())); + if is_in_range!(var.name.span().start(), var.name.span().end(), self.to_find) { + if let VarDeclDecl(); + self.found = Some(FoundNode::VariableDefName(*self.current_contract.clone(), *self.current_function, var.clone())); + return; + } } - match stmt { - Stmt::VarDecl(node) => { - match &*node.declaration { - VarDeclDecl::VarDecl(decl) => { - match &decl.ty { - Type::Address(span, payable) => { - if self.check_matching_sub_span(Box::new(decl.clone()), String::from("address"), Some(Box::new(span.clone()))) { - break - } - } - Type::String(span) => { - if self.check_matching_sub_span(Box::new(decl.clone()), String::from("string"), Some(Box::new(span.clone()))) { - break - } - } - Type::Bytes(span) => { - if self.check_matching_sub_span(Box::new(decl.clone()), String::from("bytes"), Some(Box::new(span.clone()))) { - break - - } - } - Type::Custom(span) => { - if self.check_matching_sub_span(Box::new(decl.clone()), String::from("custom"), Some(Box::new(span.clone()))) { - break - } - - } - _ => {} - } - if found { - break - } - - } - _ => {} - } - if found { - break - } + visit_variable_declaration(self, var); + } + + fn visit_parameter_list(&mut self, params: &'ast ParameterList) { + todo!() + } - }, - _ => {} + fn visit_stmt_var_decl(&mut self, stmt_var_decl: &'ast StmtVarDecl) { + todo!("VariableDefName and variableDefType") + } + + fn visit_variable_definition(&mut self, var: &'ast VariableDefinition) { + if is_in_range!(var.span().start(), var.span().end(), self.to_find) { + self.current_property = Some(Box::new(var.clone())); + if is_in_range!(var.ty.span().start(), var.ty.span().end(), self.to_find) { + + self.found = Some(FoundNode::TypeUsage(*self.current_contract,self.current_function,None, *var.ty)); + return; + } + if is_in_range!(var.name.span().start(), var.name.span().end(), self.to_find) { + if self.current_contract.is_none() { + self.found = Some(FoundNode::ConstantVariableDefName(var.clone(), *var.name)) + } else { + self.found = Some(FoundNode::PropertyDefName(*self.current_contract,var.clone(), *var.name)); + } + return; } + visit::visit_variable_definition(self, var); } - return (false, None); } -} + fn visit_item_contract(&mut self, contract: &'ast ItemContract) { + + if is_in_range!(contract.span().start(), contract.span().end(), self.to_find) { + self.current_contract = Some(Box::new(contract.clone())); + if is_in_range!(contract.name.span().start(), contract.name.span().end(), self.to_find) { + self.found = Some(FoundNode::ContractDefName(contract.clone())); + return; + } + if self.check_inheritance_matching(contract) { + return; + } + + visit::visit_item_contract(self, contract); + } + } -impl<'ast> Visit<'ast> for FinderVisitor { fn visit_item_function(&mut self, function: &'ast ItemFunction) { - let mut found: bool = false; - - match &function.body { - FunctionBody::Block(block) => { - for stmt in &block.stmts { - println!("stmt: {:?}", stmt); - if found { - break - } - match stmt { - Stmt::VarDecl(node) => { - match &*node.declaration { - VarDeclDecl::VarDecl(decl) => { - match &decl.ty { - Type::Address(span, payable) => { - if self.check_matching_sub_span(Box::new(decl.clone()), String::from("address"), Some(Box::new(span.clone()))) { - break - } - } - Type::String(span) => { - if self.check_matching_sub_span(Box::new(decl.clone()), String::from("string"), Some(Box::new(span.clone()))) { - break - } - } - Type::Bytes(span) => { - if self.check_matching_sub_span(Box::new(decl.clone()), String::from("bytes"), Some(Box::new(span.clone()))) { - break - - } - } - Type::Custom(span) => { - if self.check_matching_sub_span(Box::new(decl.clone()), String::from("custom"), Some(Box::new(span.clone()))) { - break - } - - } - _ => {} - } - if found { - break - } - - } - _ => {} - } - if found { - break - } - - }, - _ => {} + if is_in_range!(function.span().start(), function.span().end(), self.to_find) { + self.current_function = Some(Box::new(function.clone())); + if is_in_range!(function.name.span().start(), function.name.span().end(), self.to_find) { + self.found = Some(FoundNode::FunctionDefName(*self.current_contract.clone(), function.clone())); + return; + } + if let Some(rturn) = &function.returns { + rturn.returns.iter().for_each(|r| { + if is_in_range!(r.ty.span().start(), r.ty.span().end(), self.to_find) { + self.found = Some(FoundNode::TypeUsage(*self.current_contract, Some(function.clone()), None, r.ty.clone())); + return; } + }) + } + for param in &function.arguments { + if is_in_range!(param.name.span().start(), param.name.span().end(), self.to_find) { + self.found = Some(FoundNode::FunctionDefParameterName(*self.current_contract, function.clone(), param.clone(), *param.name)); + return; } - }, - _ => {} + } + visit::visit_item_function(self, function); + } + } + + fn visit_stmt(&mut self, stmt: &'ast Stmt) { + self.current_stmt = Some(Box::new(stmt.clone())); + visit::visit_stmt(self, stmt); + } + + //TODO: Found Limitation: cannot check parameter list of a new expr + // Therefore we can not goto or list_ref any variable used in a new expr + fn visit_expr_new(&mut self, new: &'ast ExprNew) { + if is_in_range!(new.span().start(), new.span().end(), self.to_find) { + self.current_expr = Some(Box::new(Expr::New(new.clone()))); + self.found = Some(FoundNode::ContractInstantiation(*self.current_contract.clone(), *self.current_function.clone(), new.clone())); } - syn_solidity::visit::visit_item_function(self, function); } } -pub fn retrieve_node_from_position(ast: &syn_solidity::File, pos: Position) -> Option { +pub fn retrieve_node_from_position(ast: &syn_solidity::File, pos: Position) -> Option { let mut visitor = FinderVisitor::new(pos); visitor.visit_file(ast); visitor.found @@ -248,7 +257,7 @@ mod tests { }"); let tokens = TokenStream::from_str(source.as_str()).unwrap(); let ast = syn_solidity::parse2(tokens).unwrap(); - let res = retrieve_node_from_position(&ast, Position::from(5, 8)); + let res = retrieve_node_from_position(&ast, Position::new(5, 8)); match &res { Some(node) => { match &node.sub_span { diff --git a/libs/ast-extractor/src/retriever/finder/find_node.rs b/libs/ast-extractor/src/retriever/finder/find_node.rs index 1e955a1b..7bc78547 100644 --- a/libs/ast-extractor/src/retriever/finder/find_node.rs +++ b/libs/ast-extractor/src/retriever/finder/find_node.rs @@ -1,45 +1,76 @@ +use syn::token::Struct; /** * find_node.rs * Enum for all possible ast types that can be found * author: 0xMemoryGrinder */ -use syn_solidity::{ExprNew, ItemContract, ItemEnum, ItemFunction, VariableDeclaration, ExprCall, SolIdent, VariableDefinition, Type, VarDeclDecl, Expr}; +use syn_solidity::{ExprNew, ItemContract, ItemEnum, ItemFunction, VariableDeclaration, ExprCall, SolIdent, VariableDefinition, Type, VarDeclDecl, Expr, SolPath, File, Variant, Item, ItemEvent, ItemError, Modifier}; pub enum FoundNode { - - - - - // Contracts ContractDefName(ItemContract), - ContractDefInheritance(ItemContract), + ContractDefInheritance(ItemContract, Modifier), ContractInstantiation(ItemContract, Option, ExprNew), - //TODO : ContractScope(ItemContract, Option, ????), + // Functions FunctionDefName(ItemContract, ItemFunction), - FunctionDefParameter(ItemContract, ItemFunction, VariableDeclaration), - FunctionDefReturn(ItemContract, ItemFunction, VariableDeclaration), - FunctionUsageName(ItemContract, ItemFunction, ExprCall), + FunctionDefParameterName(ItemContract, ItemFunction, VariableDeclaration, SolIdent), // Properties PropertyDefName(ItemContract, VariableDefinition, SolIdent), - PropertyDefType(ItemContract, VariableDefinition, Type), + //PropertyDefType(ItemContract, VariableDefinition, Type), + ConstantVariableDefName(VariableDefinition, SolIdent), + + + + + + + + + + //ContractScope(ItemContract, Option, SolPath), + + //FunctionDefParameterType(ItemContract, ItemFunction, VariableDeclaration, Type), + + FunctionUsageName(ItemContract, ItemFunction, ExprCall), + + // Properties // Variables - VariableDefName(ItemContract, VarDeclDecl, VariableDeclaration, Option), - VariableDefType(ItemContract, VarDeclDecl, VariableDeclaration, Type), + VariableDefName(Option, Option VarDeclDecl, VariableDeclaration, Option), + VariableDefType(File,ItemContract, VarDeclDecl, VariableDeclaration, Type), VariableUsageName(Option, Option, Expr, SolIdent), + // Enum + EnumDefName(File,Option, ItemEnum, SolIdent), + EnumDefValue(Option, ItemEnum, Variant, SolIdent), + + + // Structs + StructDefName(Option, SolIdent), + StructInstantiation(ItemContract, Option, SolIdent), + StructDefPropertyName(ItemContract, Option, VariableDeclaration, SolIdent), + //StructUsageName(ItemContract, Option, Expr, Type), + //StructUsageProperty(ItemContract, Option, Expr, SolIdent, Type), + // Errors + ErrorDefName(Option, ItemError, SolIdent), + ErrorDefParameter(Option, ItemError, VariableDeclaration), + //ErrorUsageName(ItemContract, Option, ExprCall, SolIdent), + // Events + EventDefName(ItemContract, ItemEvent, SolIdent), + EventDefParameter(ItemContract, ItemEvent, VariableDeclaration), + //EventUsageName(ItemContract, Option, Expr, SolIdent), - FileEnum(ItemEnum), - ContractEnum((ItemContract, ItemEnum)) + TypeUsage(Option, Option, Option, Type), + //TODO type cast + // TODO super ast node } \ No newline at end of file From 5e056471cde941e211277aea4e5c478a142e7959 Mon Sep 17 00:00:00 2001 From: 0xSwapFeeder Date: Fri, 29 Sep 2023 13:03:29 -0400 Subject: [PATCH 113/325] feat(solidity/ast/finder): implemented core finder with found node enum (need tests!) --- libs/ast-extractor/src/retriever/finder.rs | 245 +++++++++++------- .../src/retriever/finder/find_node.rs | 51 ++-- 2 files changed, 177 insertions(+), 119 deletions(-) diff --git a/libs/ast-extractor/src/retriever/finder.rs b/libs/ast-extractor/src/retriever/finder.rs index 72567f94..c3fb07b3 100644 --- a/libs/ast-extractor/src/retriever/finder.rs +++ b/libs/ast-extractor/src/retriever/finder.rs @@ -7,7 +7,7 @@ use syn_solidity::*; use proc_macro2::LineColumn; use syn::ExprLit; use syn_solidity::kw::contract; -use syn_solidity::visit::visit_variable_declaration; +use syn_solidity::visit::{visit_expr_new, visit_variable_declaration}; use crate::retriever::finder::find_node::FoundNode; mod find_node; @@ -44,16 +44,16 @@ impl Default for Position { } struct FinderVisitor { - current_contract: Option>, - current_function: Option>, - current_property: Option>, - current_variable: Option>, - current_enum: Option>, - current_struct: Option>, - current_error: Option>, - current_event: Option>, - current_expr: Option>, - current_stmt: Option>, + current_contract: Option, + current_function: Option, + current_property: Option, + current_variable: Option, + current_enum: Option, + current_struct: Option, + current_error: Option, + current_event: Option, + current_expr: Option, + current_stmt: Option, found: Option, to_find: Position, } @@ -81,9 +81,9 @@ impl FinderVisitor { fn check_inheritance_matching(&mut self, contract: &ItemContract) -> bool { if let Some(inheritance) = &contract.inheritance { if is_in_range!(inheritance.span().start(), inheritance.span().end(), self.to_find) { - for inherit in inheritance.inheritance { + for inherit in &inheritance.inheritance { if is_in_range!(inherit.span().start(), inherit.span().end(), self.to_find) { - self.found = Some(FoundNode::ContractDefInheritance(contract.clone(), inherit)); + self.found = Some(FoundNode::ContractDefInheritance(contract.clone(), inherit.clone())); return true; } } @@ -91,86 +91,83 @@ impl FinderVisitor { } return false; } +} - pub fn check_matching(&mut self, node: Box, node_type: String) -> bool { - let start_pos = node.span().start(); - let end_pos = node.span().end(); - if self._is_in_range(start_pos, end_pos) { - self.found = Some(FoundNode::new( - node_type, - node, - None - )); - return true; +impl<'ast> Visit<'ast> for FinderVisitor { + fn visit_stmt(&mut self, stmt: &'ast Stmt) { + if is_in_range!(stmt.span().start(), stmt.span().end(), self.to_find) { + self.current_stmt = Some(stmt.clone()); } - return false; + visit::visit_stmt(self, stmt); } - pub fn check_matching_sub_span(&mut self, node: Box, node_type: String, sub_span: Option>) -> bool{ - let start_pos = sub_span.span().start(); - let end_pos = sub_span.span().end(); - if self._is_in_range(start_pos, end_pos) { - self.found = Some(FoundNode::new( - node_type, - node, - sub_span - )); - return true; + fn visit_expr(&mut self, expr: &'ast Expr) { + if is_in_range!(expr.span().start(), expr.span().end(), self.to_find) { + self.current_expr = Some(expr.clone()); } - return false; + visit::visit_expr(self, expr); } -} -impl<'ast> Visit<'ast> for FinderVisitor { - fn visit_expr_call(&mut self, i: &'ast ExprCall) { - todo!() + fn visit_expr_call(&mut self, call: &'ast ExprCall) { + if is_in_range!(call.span().start(), call.span().end(), self.to_find) { + self.current_expr = Some(Expr::Call(call.clone())); + if !is_in_range!(call.args.span().start(), call.args.span().end(), self.to_find) { + self.found = Some(FoundNode::FunctionUsageName(self.current_contract.clone().unwrap().clone(), self.current_function.clone().unwrap().clone(), call.clone())); + return; + } + } + visit::visit_expr_call(self, call); + } + + //TODO: Found Limitation: cannot check parameter list of a new expr + // Therefore we can not goto or list_ref any variable used in a new expr + fn visit_expr_new(&mut self, new: &'ast ExprNew) { + if is_in_range!(new.span().start(), new.span().end(), self.to_find) { + self.current_expr = Some(Expr::New(new.clone())); + self.found = Some(FoundNode::ContractInstantiation(self.current_contract.clone().unwrap().clone(), self.current_function.clone(), new.clone())); + } + visit_expr_new(self, new); + } + + fn visit_type(&mut self, ty: &'ast Type) { + if is_in_range!(ty.span().start(), ty.span().end(), self.to_find) { + self.found = Some(FoundNode::TypeUsage(self.current_contract.clone(), self.current_function.clone(), self.current_expr.clone(), ty.clone())); + return; + } + visit::visit_type(self, ty); } fn visit_variable_declaration(&mut self, var: &'ast VariableDeclaration) { if is_in_range!(var.span().start(), var.span().end(), self.to_find) { - self.current_variable = Some(Box::new(var.clone())); + self.current_variable = Some(var.clone()); if is_in_range!(var.name.span().start(), var.name.span().end(), self.to_find) { - if let VarDeclDecl(); - self.found = Some(FoundNode::VariableDefName(*self.current_contract.clone(), *self.current_function, var.clone())); + self.found = Some(FoundNode::VariableDefName(self.current_contract.clone(), self.current_function.clone(), var.clone(), var.name.clone())); return; - } } - visit_variable_declaration(self, var); - } - - fn visit_parameter_list(&mut self, params: &'ast ParameterList) { - todo!() - } - - fn visit_stmt_var_decl(&mut self, stmt_var_decl: &'ast StmtVarDecl) { - todo!("VariableDefName and variableDefType") + } + visit_variable_declaration(self, var); } - fn visit_variable_definition(&mut self, var: &'ast VariableDefinition) { if is_in_range!(var.span().start(), var.span().end(), self.to_find) { - self.current_property = Some(Box::new(var.clone())); - if is_in_range!(var.ty.span().start(), var.ty.span().end(), self.to_find) { - - self.found = Some(FoundNode::TypeUsage(*self.current_contract,self.current_function,None, *var.ty)); - return; - } + self.current_property = Some(var.clone()); if is_in_range!(var.name.span().start(), var.name.span().end(), self.to_find) { if self.current_contract.is_none() { - self.found = Some(FoundNode::ConstantVariableDefName(var.clone(), *var.name)) + self.found = Some(FoundNode::ConstantVariableDefName(var.clone(), var.name.clone())) } else { - self.found = Some(FoundNode::PropertyDefName(*self.current_contract,var.clone(), *var.name)); + self.found = Some(FoundNode::PropertyDefName(self.current_contract.clone().unwrap(),var.clone(), var.name.clone())); } return; } - visit::visit_variable_definition(self, var); } + visit::visit_variable_definition(self, var); + } fn visit_item_contract(&mut self, contract: &'ast ItemContract) { if is_in_range!(contract.span().start(), contract.span().end(), self.to_find) { - self.current_contract = Some(Box::new(contract.clone())); + self.current_contract = Some(contract.clone()); if is_in_range!(contract.name.span().start(), contract.name.span().end(), self.to_find) { self.found = Some(FoundNode::ContractDefName(contract.clone())); return; @@ -178,54 +175,112 @@ impl<'ast> Visit<'ast> for FinderVisitor { if self.check_inheritance_matching(contract) { return; } + } + visit::visit_item_contract(self, contract); + + } - visit::visit_item_contract(self, contract); + fn visit_item_enum(&mut self, enumm: &'ast ItemEnum) { + if is_in_range!(enumm.span().start(), enumm.span().end(), self.to_find) { + self.current_enum = Some(enumm.clone()); + if is_in_range!(enumm.name.span().start(), enumm.name.span().end(), self.to_find) { + self.found = Some(FoundNode::EnumDefName(self.current_contract.clone(),enumm.clone(), enumm.name.clone())); + return; + } + for variant in &enumm.variants { + if is_in_range!(variant.ident.span().start(), variant.ident.span().end(), self.to_find) { + self.found = Some(FoundNode::EnumDefValue(self.current_contract.clone(), enumm.clone(), variant.clone(), variant.ident.clone())); + return; + } + } } + visit::visit_item_enum(self, enumm); + + } + + fn visit_item_error(&mut self, error: &'ast ItemError) { + if is_in_range!(error.span().start(), error.span().end(), self.to_find) { + self.current_error = Some(error.clone()); + if is_in_range!(error.name.span().start(), error.name.span().end(), self.to_find) { + self.found = Some(FoundNode::ErrorDefName(self.current_contract.clone(), error.clone(), error.name.clone())); + return; + } + for param in &error.parameters { + if is_in_range!(param.name.span().start(), param.name.span().end(), self.to_find) { + self.found = Some(FoundNode::ErrorDefParameter(self.current_contract.clone(), error.clone(), param.clone())); + return; + } + } + } + visit::visit_item_error(self, error); + + } + + fn visit_item_event(&mut self, event: &'ast ItemEvent) { + if is_in_range!(event.span().start(), event.span().end(), self.to_find) { + self.current_event = Some(event.clone()); + if is_in_range!(event.name.span().start(), event.name.span().end(), self.to_find) { + self.found = Some(FoundNode::EventDefName(self.current_contract.clone().unwrap().clone(), event.clone(), event.name.clone())); + return; + } + for param in &event.parameters { + if is_in_range!(param.name.span().start(), param.name.span().end(), self.to_find) { + self.found = Some(FoundNode::EventDefParameter(self.current_contract.clone().unwrap().clone(), event.clone(), param.clone())); + return; + } + } + } + visit::visit_item_event(self, event); + } fn visit_item_function(&mut self, function: &'ast ItemFunction) { if is_in_range!(function.span().start(), function.span().end(), self.to_find) { - self.current_function = Some(Box::new(function.clone())); + self.current_function = Some(function.clone()); if is_in_range!(function.name.span().start(), function.name.span().end(), self.to_find) { - self.found = Some(FoundNode::FunctionDefName(*self.current_contract.clone(), function.clone())); + self.found = Some(FoundNode::FunctionDefName(self.current_contract.clone().unwrap(), function.clone())); return; } - if let Some(rturn) = &function.returns { - rturn.returns.iter().for_each(|r| { - if is_in_range!(r.ty.span().start(), r.ty.span().end(), self.to_find) { - self.found = Some(FoundNode::TypeUsage(*self.current_contract, Some(function.clone()), None, r.ty.clone())); - return; - } - }) - } for param in &function.arguments { if is_in_range!(param.name.span().start(), param.name.span().end(), self.to_find) { - self.found = Some(FoundNode::FunctionDefParameterName(*self.current_contract, function.clone(), param.clone(), *param.name)); + self.found = Some(FoundNode::FunctionDefParameterName(self.current_contract.clone().unwrap(), function.clone(), param.clone(), param.name.clone())); return; } } - visit::visit_item_function(self, function); } + visit::visit_item_function(self, function); + } - fn visit_stmt(&mut self, stmt: &'ast Stmt) { - self.current_stmt = Some(Box::new(stmt.clone())); - visit::visit_stmt(self, stmt); + fn visit_ident(&mut self, ident: &'ast SolIdent) { + if is_in_range!(ident.span().start(), ident.span().end(), self.to_find) { + self.found = Some(FoundNode::VariableUsageName(self.current_contract.clone(), self.current_function.clone(), self.current_expr.clone().unwrap(), ident.clone())); + return; + } + visit::visit_ident(self, ident); } - //TODO: Found Limitation: cannot check parameter list of a new expr - // Therefore we can not goto or list_ref any variable used in a new expr - fn visit_expr_new(&mut self, new: &'ast ExprNew) { - if is_in_range!(new.span().start(), new.span().end(), self.to_find) { - self.current_expr = Some(Box::new(Expr::New(new.clone()))); - self.found = Some(FoundNode::ContractInstantiation(*self.current_contract.clone(), *self.current_function.clone(), new.clone())); + fn visit_item_struct(&mut self, strukt: &'ast ItemStruct) { + if is_in_range!(strukt.span().start(), strukt.span().end(), self.to_find) { + self.current_struct = Some(strukt.clone()); + if is_in_range!(strukt.name.span().start(), strukt.name.span().end(), self.to_find) { + self.found = Some(FoundNode::StructDefName(self.current_contract.clone(), strukt.name.clone())); + return; + } + for field in &strukt.fields { + if is_in_range!(field.name.span().start(), field.name.span().end(), self.to_find) { + self.found = Some(FoundNode::StructDefPropertyName(self.current_contract.clone().unwrap().clone(), self.current_function.clone(), field.clone(), field.name.clone())); + return; + } + } } + visit::visit_item_struct(self, strukt); } } -pub fn retrieve_node_from_position(ast: &syn_solidity::File, pos: Position) -> Option { +pub fn retrieve_node_from_position(ast: &File, pos: Position) -> Option { let mut visitor = FinderVisitor::new(pos); visitor.visit_file(ast); visitor.found @@ -258,17 +313,19 @@ mod tests { let tokens = TokenStream::from_str(source.as_str()).unwrap(); let ast = syn_solidity::parse2(tokens).unwrap(); let res = retrieve_node_from_position(&ast, Position::new(5, 8)); - match &res { - Some(node) => { - match &node.sub_span { - Some(span) => {assert!(true)} + if let Some(node) = res { + match &node { + FoundNode::TypeUsage(_,_,_,ty) => { + match ty { + Type::String(_) => {assert!(true)} + _ => {assert!(true)} + } + } _ => {} } - assert_eq!(node.node_type, "string"); + } else { + assert!(false) } - _ => {assert!(false)} - } - } } diff --git a/libs/ast-extractor/src/retriever/finder/find_node.rs b/libs/ast-extractor/src/retriever/finder/find_node.rs index 7bc78547..5256115c 100644 --- a/libs/ast-extractor/src/retriever/finder/find_node.rs +++ b/libs/ast-extractor/src/retriever/finder/find_node.rs @@ -5,7 +5,7 @@ use syn::token::Struct; * author: 0xMemoryGrinder */ -use syn_solidity::{ExprNew, ItemContract, ItemEnum, ItemFunction, VariableDeclaration, ExprCall, SolIdent, VariableDefinition, Type, VarDeclDecl, Expr, SolPath, File, Variant, Item, ItemEvent, ItemError, Modifier}; +use syn_solidity::{ExprNew, ItemContract, ItemEnum, ItemFunction, VariableDeclaration, ExprCall, SolIdent, VariableDefinition, Type, VarDeclDecl, Expr, SolPath, File, Variant, Item, ItemEvent, ItemError, Modifier, EventParameter}; pub enum FoundNode { // Contracts @@ -16,60 +16,61 @@ pub enum FoundNode { // Functions FunctionDefName(ItemContract, ItemFunction), - FunctionDefParameterName(ItemContract, ItemFunction, VariableDeclaration, SolIdent), + FunctionDefParameterName(ItemContract, ItemFunction, VariableDeclaration, Option), + FunctionUsageName(ItemContract, ItemFunction, ExprCall), - // Properties + // Properties/Variables/Constants PropertyDefName(ItemContract, VariableDefinition, SolIdent), - //PropertyDefType(ItemContract, VariableDefinition, Type), ConstantVariableDefName(VariableDefinition, SolIdent), + VariableDefName(Option, Option, VariableDeclaration, Option), + TypeUsage(Option, Option, Option, Type), + // Structs + StructDefName(Option, SolIdent), + StructDefPropertyName(ItemContract, Option, VariableDeclaration, Option), + // Enum + EnumDefName(Option, ItemEnum, SolIdent), + EnumDefValue(Option, ItemEnum, Variant, SolIdent), + // Errors + ErrorDefName(Option, ItemError, SolIdent), + ErrorDefParameter(Option, ItemError, VariableDeclaration), + // Events + EventDefName(ItemContract, ItemEvent, SolIdent), + EventDefParameter(ItemContract, ItemEvent, EventParameter), + /// TODO!: + /// HOW TO DIFFERENTIATE BETWEEN THESE TWO? + VariableUsageName(Option, Option, Expr, SolIdent), + StructInstantiation(ItemContract, Option, SolIdent), - - + // Contracts //ContractScope(ItemContract, Option, SolPath), + // Functions //FunctionDefParameterType(ItemContract, ItemFunction, VariableDeclaration, Type), - FunctionUsageName(ItemContract, ItemFunction, ExprCall), - // Properties + //PropertyDefType(ItemContract, VariableDefinition, Type), // Variables - VariableDefName(Option, Option VarDeclDecl, VariableDeclaration, Option), - VariableDefType(File,ItemContract, VarDeclDecl, VariableDeclaration, Type), - VariableUsageName(Option, Option, Expr, SolIdent), - - // Enum - EnumDefName(File,Option, ItemEnum, SolIdent), - EnumDefValue(Option, ItemEnum, Variant, SolIdent), - + //VariableDefType(File,ItemContract, VarDeclDecl, VariableDeclaration, Type), // Structs - StructDefName(Option, SolIdent), - StructInstantiation(ItemContract, Option, SolIdent), - StructDefPropertyName(ItemContract, Option, VariableDeclaration, SolIdent), //StructUsageName(ItemContract, Option, Expr, Type), - //StructUsageProperty(ItemContract, Option, Expr, SolIdent, Type), // Errors - ErrorDefName(Option, ItemError, SolIdent), - ErrorDefParameter(Option, ItemError, VariableDeclaration), //ErrorUsageName(ItemContract, Option, ExprCall, SolIdent), // Events - EventDefName(ItemContract, ItemEvent, SolIdent), - EventDefParameter(ItemContract, ItemEvent, VariableDeclaration), //EventUsageName(ItemContract, Option, Expr, SolIdent), - TypeUsage(Option, Option, Option, Type), //TODO type cast // TODO super ast node From 79c1a6dbca91717999320e982a10148ef1ea8af8 Mon Sep 17 00:00:00 2001 From: 0xSwapFeeder Date: Fri, 29 Sep 2023 15:31:06 -0400 Subject: [PATCH 114/325] wip(solidity/ast/finder): testing ... --- libs/ast-extractor/src/retriever/finder.rs | 149 ++++++++++++++++++--- 1 file changed, 131 insertions(+), 18 deletions(-) diff --git a/libs/ast-extractor/src/retriever/finder.rs b/libs/ast-extractor/src/retriever/finder.rs index c3fb07b3..6242951a 100644 --- a/libs/ast-extractor/src/retriever/finder.rs +++ b/libs/ast-extractor/src/retriever/finder.rs @@ -95,21 +95,36 @@ impl FinderVisitor { impl<'ast> Visit<'ast> for FinderVisitor { fn visit_stmt(&mut self, stmt: &'ast Stmt) { + if self.found.is_some() { + return; + } if is_in_range!(stmt.span().start(), stmt.span().end(), self.to_find) { self.current_stmt = Some(stmt.clone()); } + if self.found.is_some() { + return; + } visit::visit_stmt(self, stmt); } fn visit_expr(&mut self, expr: &'ast Expr) { + if self.found.is_some() { + return; + } if is_in_range!(expr.span().start(), expr.span().end(), self.to_find) { self.current_expr = Some(expr.clone()); } + if self.found.is_some() { + return; + } visit::visit_expr(self, expr); } fn visit_expr_call(&mut self, call: &'ast ExprCall) { + if self.found.is_some() { + return; + } if is_in_range!(call.span().start(), call.span().end(), self.to_find) { self.current_expr = Some(Expr::Call(call.clone())); if !is_in_range!(call.args.span().start(), call.args.span().end(), self.to_find) { @@ -117,27 +132,55 @@ impl<'ast> Visit<'ast> for FinderVisitor { return; } } + if self.found.is_some() { + return; + } visit::visit_expr_call(self, call); } //TODO: Found Limitation: cannot check parameter list of a new expr // Therefore we can not goto or list_ref any variable used in a new expr fn visit_expr_new(&mut self, new: &'ast ExprNew) { + if self.found.is_some() { + return; + } if is_in_range!(new.span().start(), new.span().end(), self.to_find) { self.current_expr = Some(Expr::New(new.clone())); self.found = Some(FoundNode::ContractInstantiation(self.current_contract.clone().unwrap().clone(), self.current_function.clone(), new.clone())); } + if self.found.is_some() { + return; + } visit_expr_new(self, new); } + fn visit_ident(&mut self, ident: &'ast SolIdent) { + if self.found.is_some() { + return; + } + if is_in_range!(ident.span().start(), ident.span().end(), self.to_find) { + self.found = Some(FoundNode::VariableUsageName(self.current_contract.clone(), self.current_function.clone(), self.current_expr.clone().unwrap(), ident.clone())); + return; + } + if self.found.is_some() { + return; + } + visit::visit_ident(self, ident); + } + fn visit_type(&mut self, ty: &'ast Type) { + if self.found.is_some() { + return; + } if is_in_range!(ty.span().start(), ty.span().end(), self.to_find) { self.found = Some(FoundNode::TypeUsage(self.current_contract.clone(), self.current_function.clone(), self.current_expr.clone(), ty.clone())); return; } + if self.found.is_some() { + return; + } visit::visit_type(self, ty); } - fn visit_variable_declaration(&mut self, var: &'ast VariableDeclaration) { if is_in_range!(var.span().start(), var.span().end(), self.to_find) { self.current_variable = Some(var.clone()); @@ -146,9 +189,17 @@ impl<'ast> Visit<'ast> for FinderVisitor { return; } } + if self.found.is_some() { + return; + } visit_variable_declaration(self, var); + } + fn visit_variable_definition(&mut self, var: &'ast VariableDefinition) { + if self.found.is_some() { + return; + } if is_in_range!(var.span().start(), var.span().end(), self.to_find) { self.current_property = Some(var.clone()); if is_in_range!(var.name.span().start(), var.name.span().end(), self.to_find) { @@ -160,14 +211,18 @@ impl<'ast> Visit<'ast> for FinderVisitor { return; } } + if self.found.is_some() { + return; + } visit::visit_variable_definition(self, var); - } fn visit_item_contract(&mut self, contract: &'ast ItemContract) { - + if self.found.is_some() { + return; + } + self.current_contract = Some(contract.clone()); if is_in_range!(contract.span().start(), contract.span().end(), self.to_find) { - self.current_contract = Some(contract.clone()); if is_in_range!(contract.name.span().start(), contract.name.span().end(), self.to_find) { self.found = Some(FoundNode::ContractDefName(contract.clone())); return; @@ -176,11 +231,16 @@ impl<'ast> Visit<'ast> for FinderVisitor { return; } } + if self.found.is_some() { + return; + } visit::visit_item_contract(self, contract); - } fn visit_item_enum(&mut self, enumm: &'ast ItemEnum) { + if self.found.is_some() { + return; + } if is_in_range!(enumm.span().start(), enumm.span().end(), self.to_find) { self.current_enum = Some(enumm.clone()); if is_in_range!(enumm.name.span().start(), enumm.name.span().end(), self.to_find) { @@ -195,10 +255,15 @@ impl<'ast> Visit<'ast> for FinderVisitor { } } visit::visit_item_enum(self, enumm); - + if self.found.is_some() { + return; + } } fn visit_item_error(&mut self, error: &'ast ItemError) { + if self.found.is_some() { + return; + } if is_in_range!(error.span().start(), error.span().end(), self.to_find) { self.current_error = Some(error.clone()); if is_in_range!(error.name.span().start(), error.name.span().end(), self.to_find) { @@ -213,10 +278,15 @@ impl<'ast> Visit<'ast> for FinderVisitor { } } visit::visit_item_error(self, error); - + if self.found.is_some() { + return; + } } fn visit_item_event(&mut self, event: &'ast ItemEvent) { + if self.found.is_some() { + return; + } if is_in_range!(event.span().start(), event.span().end(), self.to_find) { self.current_event = Some(event.clone()); if is_in_range!(event.name.span().start(), event.name.span().end(), self.to_find) { @@ -230,11 +300,16 @@ impl<'ast> Visit<'ast> for FinderVisitor { } } } + if self.found.is_some() { + return; + } visit::visit_item_event(self, event); - } fn visit_item_function(&mut self, function: &'ast ItemFunction) { + if self.found.is_some() { + return; + } if is_in_range!(function.span().start(), function.span().end(), self.to_find) { self.current_function = Some(function.clone()); if is_in_range!(function.name.span().start(), function.name.span().end(), self.to_find) { @@ -248,19 +323,16 @@ impl<'ast> Visit<'ast> for FinderVisitor { } } } - visit::visit_item_function(self, function); - - } - - fn visit_ident(&mut self, ident: &'ast SolIdent) { - if is_in_range!(ident.span().start(), ident.span().end(), self.to_find) { - self.found = Some(FoundNode::VariableUsageName(self.current_contract.clone(), self.current_function.clone(), self.current_expr.clone().unwrap(), ident.clone())); + if self.found.is_some() { return; } - visit::visit_ident(self, ident); + visit::visit_item_function(self, function); } fn visit_item_struct(&mut self, strukt: &'ast ItemStruct) { + if self.found.is_some() { + return; + } if is_in_range!(strukt.span().start(), strukt.span().end(), self.to_find) { self.current_struct = Some(strukt.clone()); if is_in_range!(strukt.name.span().start(), strukt.name.span().end(), self.to_find) { @@ -274,6 +346,9 @@ impl<'ast> Visit<'ast> for FinderVisitor { } } } + if self.found.is_some() { + return; + } visit::visit_item_struct(self, strukt); } @@ -318,14 +393,52 @@ mod tests { FoundNode::TypeUsage(_,_,_,ty) => { match ty { Type::String(_) => {assert!(true)} - _ => {assert!(true)} + _ => {assert!(false)} } } - _ => {} + _ => { + assert!(false) + } } } else { assert!(false) } } + + #[test] + fn test_retrieve_function_def_name() { + let source = String::from("pragma solidity ^0.8.0;\ + abstract contract One { + uint storedData; + function set(uint x) public { + storedData = x; + string test2; + } + + function get() public view returns (uint) { + return storedData; + } +}"); + let tokens = TokenStream::from_str(source.as_str()).unwrap(); + let ast = parse2(tokens).unwrap(); + let res = retrieve_node_from_position(&ast, Position::new(3, 14)); + if let Some(node) = res { + match &node { + FoundNode::FunctionDefName(_,f) => { + if let Some(name) = &f.name { + assert_eq!(name.to_string(), "set"); + } else { + assert!(false) + } + } + _ => { + assert!(false) + } + } + + } else { + assert!(false) + } + } } From 7214cff0b91fecf341890dbd73062993913002ba Mon Sep 17 00:00:00 2001 From: 0xSwapFeeder Date: Sun, 1 Oct 2023 01:20:38 -0400 Subject: [PATCH 115/325] wip(solidity/ast/finder): impl some tests --- libs/ast-extractor/Cargo.lock | 5 +- libs/ast-extractor/Cargo.toml | 2 +- libs/ast-extractor/src/retriever/finder.rs | 384 +++++++++++------- .../src/retriever/finder/find_node.rs | 1 + .../tests/files/contracts/inheritance.sol | 11 + .../tests/files/contracts/inheritance_3.sol | 10 + .../tests/files/contracts/instantiation.sol | 22 + .../tests/files/contracts/two.sol | 1 + .../tests/files/functions/internal_call.sol | 11 + 9 files changed, 303 insertions(+), 144 deletions(-) create mode 100644 libs/ast-extractor/tests/files/contracts/inheritance.sol create mode 100644 libs/ast-extractor/tests/files/contracts/inheritance_3.sol create mode 100644 libs/ast-extractor/tests/files/contracts/instantiation.sol create mode 100644 libs/ast-extractor/tests/files/functions/internal_call.sol diff --git a/libs/ast-extractor/Cargo.lock b/libs/ast-extractor/Cargo.lock index 46a525ce..6889f718 100644 --- a/libs/ast-extractor/Cargo.lock +++ b/libs/ast-extractor/Cargo.lock @@ -50,8 +50,9 @@ dependencies = [ [[package]] name = "syn-solidity" -version = "0.3.2" -source = "git+https://github.com/alloy-rs/core.git#73e4e51ef4fccbdfb4ebf6c1e028430fdfbfc51a" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b8a5a633f1172a0c80b1516a988e7e8efa7ce9cededf56590f54e593e4513b3" dependencies = [ "paste", "proc-macro2", diff --git a/libs/ast-extractor/Cargo.toml b/libs/ast-extractor/Cargo.toml index a570cb36..315239d3 100644 --- a/libs/ast-extractor/Cargo.toml +++ b/libs/ast-extractor/Cargo.toml @@ -8,6 +8,6 @@ edition = "2021" [dependencies] quote = "1.0.33" proc-macro2 = { version = "1.0.66", features = ["span-locations"]} -syn-solidity = { git = "https://github.com/alloy-rs/core.git", features = ["visit"] } +syn-solidity = { version="0.4.0", features = ["visit"] } thiserror = "1" syn = "2" \ No newline at end of file diff --git a/libs/ast-extractor/src/retriever/finder.rs b/libs/ast-extractor/src/retriever/finder.rs index 6242951a..f1dad504 100644 --- a/libs/ast-extractor/src/retriever/finder.rs +++ b/libs/ast-extractor/src/retriever/finder.rs @@ -14,8 +14,10 @@ mod find_node; macro_rules! is_in_range { ($start:expr, $end:expr, $pos:expr) => { - $pos.char >= $start.column && $pos.line <= $start.line - && $pos.char <= $end.column && $pos.line <= $end.line + ($pos.line == $start.line && $pos.char >= $start.column && $start.line != $end.line) || + ($pos.line == $end.line && $pos.char <= $end.column && $start.line != $end.line) || + ($pos.line == $start.line && $pos.line == $end.line && $pos.char >= $start.column && $pos.char <= $end.column) || + ($pos.line > $start.line && $pos.line < $end.line) }; } @@ -95,111 +97,70 @@ impl FinderVisitor { impl<'ast> Visit<'ast> for FinderVisitor { fn visit_stmt(&mut self, stmt: &'ast Stmt) { - if self.found.is_some() { - return; - } if is_in_range!(stmt.span().start(), stmt.span().end(), self.to_find) { + println!("stmt: {:?}", stmt); self.current_stmt = Some(stmt.clone()); + visit::visit_stmt(self, stmt); } - if self.found.is_some() { - return; - } - visit::visit_stmt(self, stmt); } fn visit_expr(&mut self, expr: &'ast Expr) { - if self.found.is_some() { - return; - } if is_in_range!(expr.span().start(), expr.span().end(), self.to_find) { + println!("expr: {:?}", expr); self.current_expr = Some(expr.clone()); + visit::visit_expr(self, expr); } - if self.found.is_some() { - return; - } - visit::visit_expr(self, expr); } fn visit_expr_call(&mut self, call: &'ast ExprCall) { - if self.found.is_some() { - return; - } if is_in_range!(call.span().start(), call.span().end(), self.to_find) { - self.current_expr = Some(Expr::Call(call.clone())); if !is_in_range!(call.args.span().start(), call.args.span().end(), self.to_find) { self.found = Some(FoundNode::FunctionUsageName(self.current_contract.clone().unwrap().clone(), self.current_function.clone().unwrap().clone(), call.clone())); return; } + visit::visit_expr_call(self, call); } - if self.found.is_some() { - return; - } - visit::visit_expr_call(self, call); } //TODO: Found Limitation: cannot check parameter list of a new expr // Therefore we can not goto or list_ref any variable used in a new expr fn visit_expr_new(&mut self, new: &'ast ExprNew) { - if self.found.is_some() { - return; - } if is_in_range!(new.span().start(), new.span().end(), self.to_find) { - self.current_expr = Some(Expr::New(new.clone())); self.found = Some(FoundNode::ContractInstantiation(self.current_contract.clone().unwrap().clone(), self.current_function.clone(), new.clone())); - } - if self.found.is_some() { - return; - } - visit_expr_new(self, new); - } - - fn visit_ident(&mut self, ident: &'ast SolIdent) { - if self.found.is_some() { - return; - } - if is_in_range!(ident.span().start(), ident.span().end(), self.to_find) { - self.found = Some(FoundNode::VariableUsageName(self.current_contract.clone(), self.current_function.clone(), self.current_expr.clone().unwrap(), ident.clone())); return; } - if self.found.is_some() { - return; - } - visit::visit_ident(self, ident); } fn visit_type(&mut self, ty: &'ast Type) { - if self.found.is_some() { - return; - } if is_in_range!(ty.span().start(), ty.span().end(), self.to_find) { self.found = Some(FoundNode::TypeUsage(self.current_contract.clone(), self.current_function.clone(), self.current_expr.clone(), ty.clone())); - return; - } - if self.found.is_some() { - return; + visit::visit_type(self, ty); } - visit::visit_type(self, ty); } + fn visit_variable_declaration(&mut self, var: &'ast VariableDeclaration) { if is_in_range!(var.span().start(), var.span().end(), self.to_find) { self.current_variable = Some(var.clone()); + let s = var.name.span().start(); + let e = var.name.span().end(); if is_in_range!(var.name.span().start(), var.name.span().end(), self.to_find) { self.found = Some(FoundNode::VariableDefName(self.current_contract.clone(), self.current_function.clone(), var.clone(), var.name.clone())); return; } + visit_variable_declaration(self, var); } - if self.found.is_some() { - return; - } - visit_variable_declaration(self, var); } - fn visit_variable_definition(&mut self, var: &'ast VariableDefinition) { - if self.found.is_some() { - return; + fn visit_stmt_var_decl(&mut self, stmt_var_decl: &'ast StmtVarDecl) { + if is_in_range!(stmt_var_decl.span().start(), stmt_var_decl.span().end(), self.to_find) { + + visit::visit_stmt_var_decl(self, stmt_var_decl); } + } + + fn visit_variable_definition(&mut self, var: &'ast VariableDefinition) { if is_in_range!(var.span().start(), var.span().end(), self.to_find) { self.current_property = Some(var.clone()); if is_in_range!(var.name.span().start(), var.name.span().end(), self.to_find) { @@ -210,37 +171,25 @@ impl<'ast> Visit<'ast> for FinderVisitor { } return; } + visit::visit_variable_definition(self, var); } - if self.found.is_some() { - return; - } - visit::visit_variable_definition(self, var); } fn visit_item_contract(&mut self, contract: &'ast ItemContract) { - if self.found.is_some() { - return; - } + let contract_start = contract.brace_token.span().start(); + let contract_end = contract.brace_token.span().end(); self.current_contract = Some(contract.clone()); if is_in_range!(contract.span().start(), contract.span().end(), self.to_find) { - if is_in_range!(contract.name.span().start(), contract.name.span().end(), self.to_find) { - self.found = Some(FoundNode::ContractDefName(contract.clone())); - return; - } - if self.check_inheritance_matching(contract) { - return; - } + self.found = Some(FoundNode::ContractDefName(contract.clone())); } - if self.found.is_some() { - return; + self.check_inheritance_matching(contract); + if is_in_range!(contract.brace_token.span().start(), contract.brace_token.span().end(), self.to_find) { + visit::visit_item_contract(self, contract); } - visit::visit_item_contract(self, contract); + self.current_contract = None; } fn visit_item_enum(&mut self, enumm: &'ast ItemEnum) { - if self.found.is_some() { - return; - } if is_in_range!(enumm.span().start(), enumm.span().end(), self.to_find) { self.current_enum = Some(enumm.clone()); if is_in_range!(enumm.name.span().start(), enumm.name.span().end(), self.to_find) { @@ -253,17 +202,12 @@ impl<'ast> Visit<'ast> for FinderVisitor { return; } } + visit::visit_item_enum(self, enumm); } - visit::visit_item_enum(self, enumm); - if self.found.is_some() { - return; - } + } fn visit_item_error(&mut self, error: &'ast ItemError) { - if self.found.is_some() { - return; - } if is_in_range!(error.span().start(), error.span().end(), self.to_find) { self.current_error = Some(error.clone()); if is_in_range!(error.name.span().start(), error.name.span().end(), self.to_find) { @@ -276,17 +220,12 @@ impl<'ast> Visit<'ast> for FinderVisitor { return; } } + visit::visit_item_error(self, error); } - visit::visit_item_error(self, error); - if self.found.is_some() { - return; - } + } fn visit_item_event(&mut self, event: &'ast ItemEvent) { - if self.found.is_some() { - return; - } if is_in_range!(event.span().start(), event.span().end(), self.to_find) { self.current_event = Some(event.clone()); if is_in_range!(event.name.span().start(), event.name.span().end(), self.to_find) { @@ -299,40 +238,34 @@ impl<'ast> Visit<'ast> for FinderVisitor { return; } } + visit::visit_item_event(self, event); } - if self.found.is_some() { - return; - } - visit::visit_item_event(self, event); } fn visit_item_function(&mut self, function: &'ast ItemFunction) { - if self.found.is_some() { + self.current_function = Some(function.clone()); + if is_in_range!(function.name.span().start(), function.name.span().end(), self.to_find) { + self.found = Some(FoundNode::FunctionDefName(self.current_contract.clone().unwrap(), function.clone())); return; } - if is_in_range!(function.span().start(), function.span().end(), self.to_find) { - self.current_function = Some(function.clone()); - if is_in_range!(function.name.span().start(), function.name.span().end(), self.to_find) { - self.found = Some(FoundNode::FunctionDefName(self.current_contract.clone().unwrap(), function.clone())); - return; - } + + if is_in_range!(function.arguments.span().start(), function.arguments.span().end(), self.to_find) { for param in &function.arguments { if is_in_range!(param.name.span().start(), param.name.span().end(), self.to_find) { self.found = Some(FoundNode::FunctionDefParameterName(self.current_contract.clone().unwrap(), function.clone(), param.clone(), param.name.clone())); - return; + break; } } } - if self.found.is_some() { - return; + if let FunctionBody::Block(block) = &function.body { + if is_in_range!(block.span().start(), block.span().end(), self.to_find) { + visit::visit_item_function(self, function); + } } - visit::visit_item_function(self, function); + self.current_function = None; } fn visit_item_struct(&mut self, strukt: &'ast ItemStruct) { - if self.found.is_some() { - return; - } if is_in_range!(strukt.span().start(), strukt.span().end(), self.to_find) { self.current_struct = Some(strukt.clone()); if is_in_range!(strukt.name.span().start(), strukt.name.span().end(), self.to_find) { @@ -345,11 +278,8 @@ impl<'ast> Visit<'ast> for FinderVisitor { return; } } + visit::visit_item_struct(self, strukt); } - if self.found.is_some() { - return; - } - visit::visit_item_struct(self, strukt); } } @@ -364,30 +294,26 @@ pub fn retrieve_node_from_position(ast: &File, pos: Position) -> Option { @@ -406,20 +332,130 @@ mod tests { } } + #[test] - fn test_retrieve_function_def_name() { - let source = String::from("pragma solidity ^0.8.0;\ - abstract contract One { - uint storedData; - function set(uint x) public { - storedData = x; - string test2; + fn test_retrieve_contract_def_name() { + let mut path = PathBuf::from(env!("CARGO_MANIFEST_DIR")); + path.push("tests"); + path.push("files"); + path.push("contracts"); + path.push("one.sol"); + let source = fs::read_to_string(path).unwrap(); + + let tokens = TokenStream::from_str(source.as_str()).unwrap(); + let ast = parse2(tokens).unwrap(); + let res = retrieve_node_from_position(&ast, Position::new(1, 20)); + if let Some(node) = res { + match &node { + FoundNode::ContractDefName(contract) => { + assert_eq!(contract.name.to_string(), "One"); + } + _ => { + assert!(false) + } + } + + } else { + assert!(false) + } } - function get() public view returns (uint) { - return storedData; + #[test] + fn test_retrieve_contract_inheritance() { + let mut path = PathBuf::from(env!("CARGO_MANIFEST_DIR")); + path.push("tests"); + path.push("files"); + path.push("contracts"); + path.push("inheritance.sol"); + let source = fs::read_to_string(path).unwrap(); + + let tokens = TokenStream::from_str(source.as_str()).unwrap(); + let ast = parse2(tokens).unwrap(); + let res = retrieve_node_from_position(&ast, Position::new(1, 28)); + if let Some(node) = res { + match &node { + FoundNode::ContractDefInheritance(contract, modifier) => { + assert_eq!(modifier.name.to_string(), "ERC20"); + } + _ => { + assert!(false) + } + } + + } else { + assert!(false) + } } -}"); + #[test] + fn test_retrieve_contract_inheritance_second() { + let mut path = PathBuf::from(env!("CARGO_MANIFEST_DIR")); + path.push("tests"); + path.push("files"); + path.push("contracts"); + path.push("inheritance_3.sol"); + let source = fs::read_to_string(path).unwrap(); + + let tokens = TokenStream::from_str(source.as_str()).unwrap(); + let ast = parse2(tokens).unwrap(); + let res = retrieve_node_from_position(&ast, Position::new(1, 34)); + if let Some(node) = res { + match &node { + FoundNode::ContractDefInheritance(contract, modifier) => { + assert_eq!(modifier.name.to_string(), "ERC721"); + } + _ => { + assert!(false) + } + } + + } else { + assert!(false) + } + } + + #[test] + fn test_retrieve_contract_instantiation() { + let mut path = PathBuf::from(env!("CARGO_MANIFEST_DIR")); + path.push("tests"); + path.push("files"); + path.push("contracts"); + path.push("instantiation.sol"); + let source = fs::read_to_string(path).unwrap(); + + let tokens = TokenStream::from_str(source.as_str()).unwrap(); + let ast = parse2(tokens).unwrap(); + let res = retrieve_node_from_position(&ast, Position::new(15, 22)); + if let Some(node) = res { + match &node { + FoundNode::ContractInstantiation(contract, func, expr) => { + match &expr.ty { + Type::Custom(sol_path) => { + assert_eq!(sol_path.to_string(), "One"); + } + _ => { + assert!(false) + } + } + } + _ => { + assert!(false) + } + } + + } else { + assert!(false) + } + } + + #[test] + fn test_retrieve_function_def_name() { + let mut path = PathBuf::from(env!("CARGO_MANIFEST_DIR")); + path.push("tests"); + path.push("files"); + path.push("contracts"); + path.push("one.sol"); + let source = fs::read_to_string(path).unwrap(); + let tokens = TokenStream::from_str(source.as_str()).unwrap(); let ast = parse2(tokens).unwrap(); let res = retrieve_node_from_position(&ast, Position::new(3, 14)); @@ -441,4 +477,70 @@ mod tests { assert!(false) } } + + #[test] + fn test_retrieve_def_parameter_name() { + let mut path = PathBuf::from(env!("CARGO_MANIFEST_DIR")); + path.push("tests"); + path.push("files"); + path.push("contracts"); + path.push("internal_call.sol"); + let source = fs::read_to_string(path).unwrap(); + + let tokens = TokenStream::from_str(source.as_str()).unwrap(); + let ast = parse2(tokens).unwrap(); + let res = retrieve_node_from_position(&ast, Position::new(9, 18)); + if let Some(node) = res { + match &node { + FoundNode::FunctionUsageName(contract, func, expr) => { + match &*expr.expr { + Expr::Ident(ident) => { + assert_eq!(ident.to_string(), "test"); + } + _ => { + assert!(false) + } + } + } + _ => { + assert!(false) + } + } + + } else { + assert!(false) + } + } + + #[test] + fn test_retrieve_function_usage() { + let mut path = PathBuf::from(env!("CARGO_MANIFEST_DIR")); + path.push("tests"); + path.push("files"); + path.push("functions"); + path.push("one.sol"); + let source = fs::read_to_string(path).unwrap(); + + let tokens = TokenStream::from_str(source.as_str()).unwrap(); + let ast = parse2(tokens).unwrap(); + let res = retrieve_node_from_position(&ast, Position::new(3, 23)); + if let Some(node) = res { + match &node { + FoundNode::FunctionDefParameterName(contract, func, var, ident) => { + if let Some(name) = &ident { + assert_eq!(name.to_string(), "value"); + } else { + assert!(false) + } + } + _ => { + assert!(false) + } + } + + } else { + assert!(false) + } + } + } diff --git a/libs/ast-extractor/src/retriever/finder/find_node.rs b/libs/ast-extractor/src/retriever/finder/find_node.rs index 5256115c..e4e872d3 100644 --- a/libs/ast-extractor/src/retriever/finder/find_node.rs +++ b/libs/ast-extractor/src/retriever/finder/find_node.rs @@ -7,6 +7,7 @@ use syn::token::Struct; use syn_solidity::{ExprNew, ItemContract, ItemEnum, ItemFunction, VariableDeclaration, ExprCall, SolIdent, VariableDefinition, Type, VarDeclDecl, Expr, SolPath, File, Variant, Item, ItemEvent, ItemError, Modifier, EventParameter}; +#[derive(Debug)] pub enum FoundNode { // Contracts ContractDefName(ItemContract), diff --git a/libs/ast-extractor/tests/files/contracts/inheritance.sol b/libs/ast-extractor/tests/files/contracts/inheritance.sol new file mode 100644 index 00000000..83f1bd6c --- /dev/null +++ b/libs/ast-extractor/tests/files/contracts/inheritance.sol @@ -0,0 +1,11 @@ + +import "../using/one.sol";abstract contract One is ERC20{ + uint storedData; + function set(uint x) public { + storedData = x; + } + + function get() public view returns (uint) { + return storedData; + } +} \ No newline at end of file diff --git a/libs/ast-extractor/tests/files/contracts/inheritance_3.sol b/libs/ast-extractor/tests/files/contracts/inheritance_3.sol new file mode 100644 index 00000000..ea0ceac7 --- /dev/null +++ b/libs/ast-extractor/tests/files/contracts/inheritance_3.sol @@ -0,0 +1,10 @@ +abstract contract One is ERC20, ERC721, ERC4626 { + uint storedData; + function set(uint x) public { + storedData = x; + } + + function get() public view returns (uint) { + return storedData; + } +} \ No newline at end of file diff --git a/libs/ast-extractor/tests/files/contracts/instantiation.sol b/libs/ast-extractor/tests/files/contracts/instantiation.sol new file mode 100644 index 00000000..c4e5faea --- /dev/null +++ b/libs/ast-extractor/tests/files/contracts/instantiation.sol @@ -0,0 +1,22 @@ +abstract contract One { + uint storedData; + function set(uint x) public { + storedData = x; + } + + function get() public view returns (uint) { + return storedData; + } +} + +abstract contract Two { + uint storedData; + function set(uint x) public { + var c = new One(); + storedData = x; + } + + function get() public view returns (uint) { + return storedData; + } +} \ No newline at end of file diff --git a/libs/ast-extractor/tests/files/contracts/two.sol b/libs/ast-extractor/tests/files/contracts/two.sol index 4c318703..31a22d93 100644 --- a/libs/ast-extractor/tests/files/contracts/two.sol +++ b/libs/ast-extractor/tests/files/contracts/two.sol @@ -1,6 +1,7 @@ abstract contract One { uint storedData; function set(uint x) public { + string myString = "hello"; storedData = x; } diff --git a/libs/ast-extractor/tests/files/functions/internal_call.sol b/libs/ast-extractor/tests/files/functions/internal_call.sol new file mode 100644 index 00000000..f19fade5 --- /dev/null +++ b/libs/ast-extractor/tests/files/functions/internal_call.sol @@ -0,0 +1,11 @@ +contract One { + uint storedData; + + function test() internal { + + } + + function get() public { + return test(); + } +} From 6f8a421690341e80498aaa6eba3d3f2f93894c6b Mon Sep 17 00:00:00 2001 From: 0xSwapFeeder Date: Mon, 2 Oct 2023 15:54:01 -0400 Subject: [PATCH 116/325] feat(solidity/ast/finder): reworked FoundNode enum and tested all cases --- libs/ast-extractor/src/retriever/finder.rs | 867 ++++++++++++++++-- .../src/retriever/finder/find_node.rs | 15 +- .../tests/files/constants/constant.sol | 1 + .../tests/files/contracts/inheritance.sol | 3 +- libs/ast-extractor/tests/files/errors/one.sol | 4 +- libs/ast-extractor/tests/files/event/one.sol | 2 +- .../ast-extractor/tests/files/structs/one.sol | 4 + 7 files changed, 803 insertions(+), 93 deletions(-) create mode 100644 libs/ast-extractor/tests/files/constants/constant.sol diff --git a/libs/ast-extractor/src/retriever/finder.rs b/libs/ast-extractor/src/retriever/finder.rs index f1dad504..96e77463 100644 --- a/libs/ast-extractor/src/retriever/finder.rs +++ b/libs/ast-extractor/src/retriever/finder.rs @@ -116,8 +116,7 @@ impl<'ast> Visit<'ast> for FinderVisitor { fn visit_expr_call(&mut self, call: &'ast ExprCall) { if is_in_range!(call.span().start(), call.span().end(), self.to_find) { if !is_in_range!(call.args.span().start(), call.args.span().end(), self.to_find) { - self.found = Some(FoundNode::FunctionUsageName(self.current_contract.clone().unwrap().clone(), self.current_function.clone().unwrap().clone(), call.clone())); - return; + self.found = Some(FoundNode::IdentUsageCall(self.current_contract.clone(), self.current_function.clone(), call.clone())); } visit::visit_expr_call(self, call); } @@ -126,13 +125,14 @@ impl<'ast> Visit<'ast> for FinderVisitor { //TODO: Found Limitation: cannot check parameter list of a new expr // Therefore we can not goto or list_ref any variable used in a new expr fn visit_expr_new(&mut self, new: &'ast ExprNew) { - if is_in_range!(new.span().start(), new.span().end(), self.to_find) { + if is_in_range!(new.ty.span().start(), new.ty.span().end(), self.to_find) { self.found = Some(FoundNode::ContractInstantiation(self.current_contract.clone().unwrap().clone(), self.current_function.clone(), new.clone())); return; } } fn visit_type(&mut self, ty: &'ast Type) { + println!("type: {:?}", ty); if is_in_range!(ty.span().start(), ty.span().end(), self.to_find) { self.found = Some(FoundNode::TypeUsage(self.current_contract.clone(), self.current_function.clone(), self.current_expr.clone(), ty.clone())); visit::visit_type(self, ty); @@ -155,7 +155,6 @@ impl<'ast> Visit<'ast> for FinderVisitor { fn visit_stmt_var_decl(&mut self, stmt_var_decl: &'ast StmtVarDecl) { if is_in_range!(stmt_var_decl.span().start(), stmt_var_decl.span().end(), self.to_find) { - visit::visit_stmt_var_decl(self, stmt_var_decl); } } @@ -190,56 +189,52 @@ impl<'ast> Visit<'ast> for FinderVisitor { } fn visit_item_enum(&mut self, enumm: &'ast ItemEnum) { - if is_in_range!(enumm.span().start(), enumm.span().end(), self.to_find) { - self.current_enum = Some(enumm.clone()); - if is_in_range!(enumm.name.span().start(), enumm.name.span().end(), self.to_find) { - self.found = Some(FoundNode::EnumDefName(self.current_contract.clone(),enumm.clone(), enumm.name.clone())); + self.current_enum = Some(enumm.clone()); + if is_in_range!(enumm.name.span().start(), enumm.name.span().end(), self.to_find) { + self.found = Some(FoundNode::EnumDefName(self.current_contract.clone(),enumm.clone(), enumm.name.clone())); + return; + } + for variant in &enumm.variants { + if is_in_range!(variant.ident.span().start(), variant.ident.span().end(), self.to_find) { + self.found = Some(FoundNode::EnumDefValue(self.current_contract.clone(), enumm.clone(), variant.clone(), variant.ident.clone())); return; } - for variant in &enumm.variants { - if is_in_range!(variant.ident.span().start(), variant.ident.span().end(), self.to_find) { - self.found = Some(FoundNode::EnumDefValue(self.current_contract.clone(), enumm.clone(), variant.clone(), variant.ident.clone())); - return; - } - } - visit::visit_item_enum(self, enumm); } - + visit::visit_item_enum(self, enumm); + self.current_enum = None; } fn visit_item_error(&mut self, error: &'ast ItemError) { - if is_in_range!(error.span().start(), error.span().end(), self.to_find) { - self.current_error = Some(error.clone()); - if is_in_range!(error.name.span().start(), error.name.span().end(), self.to_find) { - self.found = Some(FoundNode::ErrorDefName(self.current_contract.clone(), error.clone(), error.name.clone())); + self.current_error = Some(error.clone()); + if is_in_range!(error.name.span().start(), error.name.span().end(), self.to_find) { + self.found = Some(FoundNode::ErrorDefName(self.current_contract.clone(), error.clone(), error.name.clone())); + return; + } + for param in &error.parameters { + if is_in_range!(param.name.span().start(), param.name.span().end(), self.to_find) { + self.found = Some(FoundNode::ErrorDefParameter(self.current_contract.clone(), error.clone(), param.clone())); return; } - for param in &error.parameters { - if is_in_range!(param.name.span().start(), param.name.span().end(), self.to_find) { - self.found = Some(FoundNode::ErrorDefParameter(self.current_contract.clone(), error.clone(), param.clone())); - return; - } - } - visit::visit_item_error(self, error); } + visit::visit_item_error(self, error); + self.current_error = None; } fn visit_item_event(&mut self, event: &'ast ItemEvent) { - if is_in_range!(event.span().start(), event.span().end(), self.to_find) { - self.current_event = Some(event.clone()); - if is_in_range!(event.name.span().start(), event.name.span().end(), self.to_find) { - self.found = Some(FoundNode::EventDefName(self.current_contract.clone().unwrap().clone(), event.clone(), event.name.clone())); + self.current_event = Some(event.clone()); + if is_in_range!(event.name.span().start(), event.name.span().end(), self.to_find) { + self.found = Some(FoundNode::EventDefName(self.current_contract.clone().unwrap().clone(), event.clone(), event.name.clone())); + return; + } + for param in &event.parameters { + if is_in_range!(param.name.span().start(), param.name.span().end(), self.to_find) { + self.found = Some(FoundNode::EventDefParameter(self.current_contract.clone().unwrap().clone(), event.clone(), param.clone())); return; } - for param in &event.parameters { - if is_in_range!(param.name.span().start(), param.name.span().end(), self.to_find) { - self.found = Some(FoundNode::EventDefParameter(self.current_contract.clone().unwrap().clone(), event.clone(), param.clone())); - return; - } - } - visit::visit_item_event(self, event); } + visit::visit_item_event(self, event); + self.current_event = None; } fn visit_item_function(&mut self, function: &'ast ItemFunction) { @@ -262,24 +257,38 @@ impl<'ast> Visit<'ast> for FinderVisitor { visit::visit_item_function(self, function); } } + if let Some(ret) = function.return_type() { + visit::visit_type(self, &ret); + } self.current_function = None; } + fn visit_ident(&mut self, ident: &'ast SolIdent) { + if self.found.is_some() { + return; + } + if is_in_range!(ident.span().start(), ident.span().end(), self.to_find) { + self.found = Some(FoundNode::IdentUsageName(self.current_contract.clone(), self.current_function.clone(), self.current_expr.clone(), ident.clone())); + return; + } + } + fn visit_item_struct(&mut self, strukt: &'ast ItemStruct) { - if is_in_range!(strukt.span().start(), strukt.span().end(), self.to_find) { - self.current_struct = Some(strukt.clone()); - if is_in_range!(strukt.name.span().start(), strukt.name.span().end(), self.to_find) { - self.found = Some(FoundNode::StructDefName(self.current_contract.clone(), strukt.name.clone())); - return; - } + self.current_struct = Some(strukt.clone()); + if is_in_range!(strukt.name.span().start(), strukt.name.span().end(), self.to_find) { + self.found = Some(FoundNode::StructDefName(self.current_contract.clone(), strukt.name.clone())); + return; + } + if is_in_range!(strukt.brace_token.span().start(), strukt.brace_token.span().end(), self.to_find) { for field in &strukt.fields { if is_in_range!(field.name.span().start(), field.name.span().end(), self.to_find) { - self.found = Some(FoundNode::StructDefPropertyName(self.current_contract.clone().unwrap().clone(), self.current_function.clone(), field.clone(), field.name.clone())); + self.found = Some(FoundNode::StructDefPropertyName( self.current_contract.clone(), field.clone(), field.name.clone())); return; } } visit::visit_item_struct(self, strukt); } + self.current_struct = None; } } @@ -301,36 +310,6 @@ mod tests { use super::*; use std::str::FromStr; - #[test] - fn test_retrieve_node_type_decl_string() { - let mut path = PathBuf::from(env!("CARGO_MANIFEST_DIR")); - path.push("tests"); - path.push("files"); - path.push("contracts"); - path.push("two.sol"); - let source = fs::read_to_string(path).unwrap(); - - let tokens = TokenStream::from_str(source.as_str()).unwrap(); - let ast = parse2(tokens).unwrap(); - let res = retrieve_node_from_position(&ast, Position::new(4, 10)); - println!("{:?}", res); - if let Some(node) = res { - match &node { - FoundNode::TypeUsage(_,_,_,ty) => { - match ty { - Type::String(_) => {assert!(true)} - _ => {assert!(false)} - } - } - _ => { - assert!(false) - } - } - - } else { - assert!(false) - } - } #[test] @@ -425,6 +404,7 @@ mod tests { let tokens = TokenStream::from_str(source.as_str()).unwrap(); let ast = parse2(tokens).unwrap(); let res = retrieve_node_from_position(&ast, Position::new(15, 22)); + println!("{:?}", res); if let Some(node) = res { match &node { FoundNode::ContractInstantiation(contract, func, expr) => { @@ -479,11 +459,11 @@ mod tests { } #[test] - fn test_retrieve_def_parameter_name() { + fn test_retrieve_function_usage() { let mut path = PathBuf::from(env!("CARGO_MANIFEST_DIR")); path.push("tests"); path.push("files"); - path.push("contracts"); + path.push("functions"); path.push("internal_call.sol"); let source = fs::read_to_string(path).unwrap(); @@ -492,7 +472,7 @@ mod tests { let res = retrieve_node_from_position(&ast, Position::new(9, 18)); if let Some(node) = res { match &node { - FoundNode::FunctionUsageName(contract, func, expr) => { + FoundNode::IdentUsageCall(contract, func, expr) => { match &*expr.expr { Expr::Ident(ident) => { assert_eq!(ident.to_string(), "test"); @@ -513,11 +493,11 @@ mod tests { } #[test] - fn test_retrieve_function_usage() { + fn test_retrieve_function_param() { let mut path = PathBuf::from(env!("CARGO_MANIFEST_DIR")); path.push("tests"); path.push("files"); - path.push("functions"); + path.push("contracts"); path.push("one.sol"); let source = fs::read_to_string(path).unwrap(); @@ -528,7 +508,92 @@ mod tests { match &node { FoundNode::FunctionDefParameterName(contract, func, var, ident) => { if let Some(name) = &ident { - assert_eq!(name.to_string(), "value"); + assert_eq!(name.to_string(), "x"); + } else { + assert!(false) + } + } + _ => { + assert!(false) + } + } + + } else { + assert!(false) + } + } + + #[test] + fn test_retrieve_prop_def() { + let mut path = PathBuf::from(env!("CARGO_MANIFEST_DIR")); + path.push("tests"); + path.push("files"); + path.push("functions"); + path.push("one.sol"); + let source = fs::read_to_string(path).unwrap(); + + let tokens = TokenStream::from_str(source.as_str()).unwrap(); + let ast = parse2(tokens).unwrap(); + let res = retrieve_node_from_position(&ast, Position::new(2, 13)); + if let Some(node) = res { + match &node { + FoundNode::PropertyDefName(contract, var, ident) => { + assert_eq!(ident.to_string(), "storedData"); + } + _ => { + assert!(false) + } + } + + } else { + assert!(false) + } + } + + #[test] + fn test_retrieve_constant_def() { + let mut path = PathBuf::from(env!("CARGO_MANIFEST_DIR")); + path.push("tests"); + path.push("files"); + path.push("constants"); + path.push("constant.sol"); + let source = fs::read_to_string(path).unwrap(); + + let tokens = TokenStream::from_str(source.as_str()).unwrap(); + let ast = parse2(tokens).unwrap(); + let res = retrieve_node_from_position(&ast, Position::new(1, 21)); + if let Some(node) = res { + match &node { + FoundNode::ConstantVariableDefName(var, ident ) => { + assert_eq!(ident.to_string(), "myConst"); + } + _ => { + assert!(false) + } + } + + } else { + assert!(false) + } + } + + #[test] + fn test_retrieve_var_def() { + let mut path = PathBuf::from(env!("CARGO_MANIFEST_DIR")); + path.push("tests"); + path.push("files"); + path.push("contracts"); + path.push("two.sol"); + let source = fs::read_to_string(path).unwrap(); + + let tokens = TokenStream::from_str(source.as_str()).unwrap(); + let ast = parse2(tokens).unwrap(); + let res = retrieve_node_from_position(&ast, Position::new(4, 17)); + if let Some(node) = res { + match &node { + FoundNode::VariableDefName(contract, func, var , ident) => { + if let Some(name) = ident { + assert_eq!(name.to_string(), "myString"); } else { assert!(false) } @@ -543,4 +608,644 @@ mod tests { } } + + #[test] + fn test_retrieve_type_string() { + let mut path = PathBuf::from(env!("CARGO_MANIFEST_DIR")); + path.push("tests"); + path.push("files"); + path.push("contracts"); + path.push("two.sol"); + let source = fs::read_to_string(path).unwrap(); + + let tokens = TokenStream::from_str(source.as_str()).unwrap(); + let ast = parse2(tokens).unwrap(); + let res = retrieve_node_from_position(&ast, Position::new(4, 10)); + println!("{:?}", res); + if let Some(node) = res { + match &node { + FoundNode::TypeUsage(_,_,_,ty) => { + match ty { + Type::String(_) => {assert!(true)} + _ => {assert!(false)} + } + } + _ => { + assert!(false) + } + } + + } else { + assert!(false) + } + } + + #[test] + fn test_retrieve_type_call() { + let mut path = PathBuf::from(env!("CARGO_MANIFEST_DIR")); + path.push("tests"); + path.push("files"); + path.push("structs"); + path.push("one.sol"); + let source = fs::read_to_string(path).unwrap(); + + let tokens = TokenStream::from_str(source.as_str()).unwrap(); + let ast = parse2(tokens).unwrap(); + let res = retrieve_node_from_position(&ast, Position::new(13, 36)); + println!("{:?}", res); + if let Some(node) = res { + match &node { + FoundNode::IdentUsageCall(_, _, expr) => { + match &*expr.expr { + Expr::Ident(ident) => { + assert_eq!(ident.to_string(), "another_one"); + } + _ => {assert!(false)} + } + } + _ => { + assert!(false) + } + } + + } else { + assert!(false) + } + } + + #[test] + fn test_retrieve_type_custom() { + let mut path = PathBuf::from(env!("CARGO_MANIFEST_DIR")); + path.push("tests"); + path.push("files"); + path.push("structs"); + path.push("one.sol"); + let source = fs::read_to_string(path).unwrap(); + + let tokens = TokenStream::from_str(source.as_str()).unwrap(); + let ast = parse2(tokens).unwrap(); + let res = retrieve_node_from_position(&ast, Position::new(13, 12)); + println!("{:?}", res); + if let Some(node) = res { + match &node { + FoundNode::TypeUsage(_,_,expr, ty) => { + match ty { + Type::Custom(ident) => { + assert_eq!(ident.to_string(), "another_one"); + } + _ => {assert!(false)} + } + } + _ => { + assert!(false) + } + } + + } else { + assert!(false) + } + } + + #[test] + fn test_retrieve_type_rturn() { + let mut path = PathBuf::from(env!("CARGO_MANIFEST_DIR")); + path.push("tests"); + path.push("files"); + path.push("contracts"); + path.push("one.sol"); + let source = fs::read_to_string(path).unwrap(); + + let tokens = TokenStream::from_str(source.as_str()).unwrap(); + let ast = parse2(tokens).unwrap(); + let res = retrieve_node_from_position(&ast, Position::new(7, 42)); + println!("{:?}", res); + if let Some(node) = res { + match &node { + FoundNode::TypeUsage(_,_,expr, ty) => { + match ty { + Type::Uint(_, _) => {} + _ => {assert!(false)} + } + } + _ => { + assert!(false) + } + } + + } else { + assert!(false) + } + } + + #[test] + fn test_retrieve_contract_struct_def() { + let mut path = PathBuf::from(env!("CARGO_MANIFEST_DIR")); + path.push("tests"); + path.push("files"); + path.push("structs"); + path.push("one.sol"); + let source = fs::read_to_string(path).unwrap(); + + let tokens = TokenStream::from_str(source.as_str()).unwrap(); + let ast = parse2(tokens).unwrap(); + let res = retrieve_node_from_position(&ast, Position::new(7, 14)); + println!("{:?}", res); + if let Some(node) = res { + match &node { + FoundNode::StructDefName(contract, ident) => { + assert_eq!(contract.is_some(), true); + assert_eq!(ident.to_string(), "another_one"); + } + _ => { + assert!(false) + } + } + + } else { + assert!(false) + } + } + + #[test] + fn test_retrieve_file_struct_def() { + let mut path = PathBuf::from(env!("CARGO_MANIFEST_DIR")); + path.push("tests"); + path.push("files"); + path.push("structs"); + path.push("one.sol"); + let source = fs::read_to_string(path).unwrap(); + + let tokens = TokenStream::from_str(source.as_str()).unwrap(); + let ast = parse2(tokens).unwrap(); + let res = retrieve_node_from_position(&ast, Position::new(1, 10)); + println!("{:?}", res); + if let Some(node) = res { + match &node { + FoundNode::StructDefName(contract, ident) => { + assert_eq!(contract.is_none(), true); + assert_eq!(ident.to_string(), "one"); + } + _ => { + assert!(false) + } + } + + } else { + assert!(false) + } + } + + #[test] + fn test_retrieve_contract_struct_prop() { + let mut path = PathBuf::from(env!("CARGO_MANIFEST_DIR")); + path.push("tests"); + path.push("files"); + path.push("structs"); + path.push("one.sol"); + let source = fs::read_to_string(path).unwrap(); + + let tokens = TokenStream::from_str(source.as_str()).unwrap(); + let ast = parse2(tokens).unwrap(); + let res = retrieve_node_from_position(&ast, Position::new(8, 18)); + println!("{:?}", res); + if let Some(node) = res { + match &node { + FoundNode::StructDefPropertyName(contract, var, ident) => { + assert_eq!(contract.is_none(), false); + if let Some(name) = ident { + assert_eq!(name.to_string(), "storedData1"); + } else { + assert!(false) + } + } + _ => { + assert!(false) + } + } + + } else { + assert!(false) + } + } + + #[test] + fn test_retrieve_file_struct_prop() { + let mut path = PathBuf::from(env!("CARGO_MANIFEST_DIR")); + path.push("tests"); + path.push("files"); + path.push("structs"); + path.push("one.sol"); + let source = fs::read_to_string(path).unwrap(); + + let tokens = TokenStream::from_str(source.as_str()).unwrap(); + let ast = parse2(tokens).unwrap(); + let res = retrieve_node_from_position(&ast, Position::new(2, 17)); + println!("{:?}", res); + if let Some(node) = res { + match &node { + FoundNode::StructDefPropertyName(contract, var, ident) => { + assert_eq!(contract.is_none(), true); + if let Some(name) = ident { + assert_eq!(name.to_string(), "storedData1"); + } else { + assert!(false) + } + } + _ => { + assert!(false) + } + } + + } else { + assert!(false) + } + } + + #[test] + fn test_retrieve_contract_enum_def_name() { + let mut path = PathBuf::from(env!("CARGO_MANIFEST_DIR")); + path.push("tests"); + path.push("files"); + path.push("enums"); + path.push("one.sol"); + let source = fs::read_to_string(path).unwrap(); + + let tokens = TokenStream::from_str(source.as_str()).unwrap(); + let ast = parse2(tokens).unwrap(); + let res = retrieve_node_from_position(&ast, Position::new(12, 14)); + println!("{:?}", res); + if let Some(node) = res { + match &node { + FoundNode::EnumDefName(contract, ennum, ident) => { + assert_eq!(contract.is_none(), false); + assert_eq!(ident.to_string(), "another_one"); + } + _ => { + assert!(false) + } + } + + } else { + assert!(false) + } + } + + #[test] + fn test_retrieve_contract_enum_def_value() { + let mut path = PathBuf::from(env!("CARGO_MANIFEST_DIR")); + path.push("tests"); + path.push("files"); + path.push("enums"); + path.push("one.sol"); + let source = fs::read_to_string(path).unwrap(); + + let tokens = TokenStream::from_str(source.as_str()).unwrap(); + let ast = parse2(tokens).unwrap(); + let res = retrieve_node_from_position(&ast, Position::new(14, 12)); + println!("{:?}", res); + if let Some(node) = res { + match &node { + FoundNode::EnumDefValue(contract, ennum, variant, ident) => { + assert_eq!(contract.is_none(), false); + assert_eq!(ident.to_string(), "Tuesday"); + } + _ => { + assert!(false) + } + } + + } else { + assert!(false) + } + } + + #[test] + fn test_retrieve_file_enum_def_name() { + let mut path = PathBuf::from(env!("CARGO_MANIFEST_DIR")); + path.push("tests"); + path.push("files"); + path.push("enums"); + path.push("one.sol"); + let source = fs::read_to_string(path).unwrap(); + + let tokens = TokenStream::from_str(source.as_str()).unwrap(); + let ast = parse2(tokens).unwrap(); + let res = retrieve_node_from_position(&ast, Position::new(1, 8)); + println!("{:?}", res); + if let Some(node) = res { + match &node { + FoundNode::EnumDefName(contract, ennum, ident) => { + assert_eq!(contract.is_none(), true); + assert_eq!(ident.to_string(), "one"); + } + _ => { + assert!(false) + } + } + + } else { + assert!(false) + } + } + + #[test] + fn test_retrieve_file_enum_def_value() { + let mut path = PathBuf::from(env!("CARGO_MANIFEST_DIR")); + path.push("tests"); + path.push("files"); + path.push("enums"); + path.push("one.sol"); + let source = fs::read_to_string(path).unwrap(); + + let tokens = TokenStream::from_str(source.as_str()).unwrap(); + let ast = parse2(tokens).unwrap(); + let res = retrieve_node_from_position(&ast, Position::new(3, 8)); + println!("{:?}", res); + if let Some(node) = res { + match &node { + FoundNode::EnumDefValue(contract, ennum, variant, ident) => { + assert_eq!(contract.is_none(), true); + assert_eq!(ident.to_string(), "Tuesday"); + } + _ => { + assert!(false) + } + } + + } else { + assert!(false) + } + } + + #[test] + fn test_retrieve_file_error_def_name() { + let mut path = PathBuf::from(env!("CARGO_MANIFEST_DIR")); + path.push("tests"); + path.push("files"); + path.push("errors"); + path.push("one.sol"); + let source = fs::read_to_string(path).unwrap(); + + let tokens = TokenStream::from_str(source.as_str()).unwrap(); + let ast = parse2(tokens).unwrap(); + let res = retrieve_node_from_position(&ast, Position::new(1, 8)); + println!("{:?}", res); + if let Some(node) = res { + match &node { + FoundNode::ErrorDefName(contract, err, ident) => { + assert_eq!(contract.is_none(), true); + assert_eq!(ident.to_string(), "one"); + } + _ => { + assert!(false) + } + } + + } else { + assert!(false) + } + } + + #[test] + fn test_retrieve_contract_error_def_name() { + let mut path = PathBuf::from(env!("CARGO_MANIFEST_DIR")); + path.push("tests"); + path.push("files"); + path.push("errors"); + path.push("one.sol"); + let source = fs::read_to_string(path).unwrap(); + + let tokens = TokenStream::from_str(source.as_str()).unwrap(); + let ast = parse2(tokens).unwrap(); + let res = retrieve_node_from_position(&ast, Position::new(4, 16)); + println!("{:?}", res); + if let Some(node) = res { + match &node { + FoundNode::ErrorDefName(contract, err, ident) => { + assert_eq!(contract.is_none(), false); + assert_eq!(ident.to_string(), "another_one"); + } + _ => { + assert!(false) + } + } + + } else { + assert!(false) + } + } + + #[test] + fn test_retrieve_contract_error_def_param() { + let mut path = PathBuf::from(env!("CARGO_MANIFEST_DIR")); + path.push("tests"); + path.push("files"); + path.push("errors"); + path.push("one.sol"); + let source = fs::read_to_string(path).unwrap(); + + let tokens = TokenStream::from_str(source.as_str()).unwrap(); + let ast = parse2(tokens).unwrap(); + let res = retrieve_node_from_position(&ast, Position::new(4, 33)); + println!("{:?}", res); + if let Some(node) = res { + match &node { + FoundNode::ErrorDefParameter(contract, err, ident) => { + assert_eq!(contract.is_none(), false); + if let Some(name) = &ident.name { + assert_eq!(name.to_string(), "val1"); + } + else { + assert!(false) + } + } + _ => { + assert!(false) + } + } + + } else { + assert!(false) + } + } + + #[test] + fn test_retrieve_file_error_def_param() { + let mut path = PathBuf::from(env!("CARGO_MANIFEST_DIR")); + path.push("tests"); + path.push("files"); + path.push("errors"); + path.push("one.sol"); + let source = fs::read_to_string(path).unwrap(); + + let tokens = TokenStream::from_str(source.as_str()).unwrap(); + let ast = parse2(tokens).unwrap(); + let res = retrieve_node_from_position(&ast, Position::new(1, 21)); + println!("{:?}", res); + if let Some(node) = res { + match &node { + FoundNode::ErrorDefParameter(contract, err, ident) => { + assert_eq!(contract.is_none(), true); + if let Some(name) = &ident.name { + assert_eq!(name.to_string(), "val1"); + } + else { + assert!(false) + } + } + _ => { + assert!(false) + } + } + + } else { + assert!(false) + } + } + + #[test] + fn test_retrieve_event_def_name() { + let mut path = PathBuf::from(env!("CARGO_MANIFEST_DIR")); + path.push("tests"); + path.push("files"); + path.push("event"); + path.push("one.sol"); + let source = fs::read_to_string(path).unwrap(); + + let tokens = TokenStream::from_str(source.as_str()).unwrap(); + let ast = parse2(tokens).unwrap(); + let res = retrieve_node_from_position(&ast, Position::new(4, 16)); + println!("{:?}", res); + if let Some(node) = res { + match &node { + FoundNode::EventDefName(contract, err, ident) => { + assert_eq!(ident.to_string(), "another_one"); + } + _ => { + assert!(false) + } + } + + } else { + assert!(false) + } + } + + #[test] + fn test_retrieve_event_def_param() { + let mut path = PathBuf::from(env!("CARGO_MANIFEST_DIR")); + path.push("tests"); + path.push("files"); + path.push("event"); + path.push("one.sol"); + let source = fs::read_to_string(path).unwrap(); + + let tokens = TokenStream::from_str(source.as_str()).unwrap(); + let ast = parse2(tokens).unwrap(); + let res = retrieve_node_from_position(&ast, Position::new(4, 32)); + println!("{:?}", res); + if let Some(node) = res { + match &node { + FoundNode::EventDefParameter(contract, err, ident) => { + if let Some(name) = &ident.name { + assert_eq!(name.to_string(), "val1"); + } else { + assert!(false); + } + } + _ => { + assert!(false) + } + } + + } else { + assert!(false) + } + } + + + #[test] + fn test_retrieve_prop_usage_on_assign() { + let mut path = PathBuf::from(env!("CARGO_MANIFEST_DIR")); + path.push("tests"); + path.push("files"); + path.push("contracts"); + path.push("two.sol"); + let source = fs::read_to_string(path).unwrap(); + + let tokens = TokenStream::from_str(source.as_str()).unwrap(); + let ast = parse2(tokens).unwrap(); + let res = retrieve_node_from_position(&ast, Position::new(5, 14)); + println!("{:?}", res); + if let Some(node) = res { + match &node { + FoundNode::IdentUsageName(contract, func, expr, ident) => { + assert_eq!(ident.to_string(), "storedData"); + } + _ => { + assert!(false) + } + } + + } else { + assert!(false) + } + } + + #[test] + fn test_retrieve_prop_usage_on_rturn() { + let mut path = PathBuf::from(env!("CARGO_MANIFEST_DIR")); + path.push("tests"); + path.push("files"); + path.push("contracts"); + path.push("two.sol"); + let source = fs::read_to_string(path).unwrap(); + + let tokens = TokenStream::from_str(source.as_str()).unwrap(); + let ast = parse2(tokens).unwrap(); + let res = retrieve_node_from_position(&ast, Position::new(9, 22)); + println!("{:?}", res); + if let Some(node) = res { + match &node { + FoundNode::IdentUsageName(contract, func, expr, ident) => { + assert_eq!(ident.to_string(), "storedData"); + } + _ => { + assert!(false) + } + } + + } else { + assert!(false) + } + } + + #[test] + fn test_retrieve_var_usage_on_assign() { + let mut path = PathBuf::from(env!("CARGO_MANIFEST_DIR")); + path.push("tests"); + path.push("files"); + path.push("contracts"); + path.push("two.sol"); + let source = fs::read_to_string(path).unwrap(); + + let tokens = TokenStream::from_str(source.as_str()).unwrap(); + let ast = parse2(tokens).unwrap(); + let res = retrieve_node_from_position(&ast, Position::new(5, 22)); + println!("{:?}", res); + if let Some(node) = res { + match &node { + FoundNode::IdentUsageName(contract, func, expr, ident) => { + assert_eq!(ident.to_string(), "x"); + } + _ => { + assert!(false) + } + } + + } else { + assert!(false) + } + } + } diff --git a/libs/ast-extractor/src/retriever/finder/find_node.rs b/libs/ast-extractor/src/retriever/finder/find_node.rs index e4e872d3..14859275 100644 --- a/libs/ast-extractor/src/retriever/finder/find_node.rs +++ b/libs/ast-extractor/src/retriever/finder/find_node.rs @@ -18,18 +18,21 @@ pub enum FoundNode { // Functions FunctionDefName(ItemContract, ItemFunction), FunctionDefParameterName(ItemContract, ItemFunction, VariableDeclaration, Option), - FunctionUsageName(ItemContract, ItemFunction, ExprCall), // Properties/Variables/Constants PropertyDefName(ItemContract, VariableDefinition, SolIdent), ConstantVariableDefName(VariableDefinition, SolIdent), VariableDefName(Option, Option, VariableDeclaration, Option), + + // Types and Identifiers TypeUsage(Option, Option, Option, Type), + IdentUsageCall(Option, Option, ExprCall), + IdentUsageName(Option, Option, Option, SolIdent), + // Structs StructDefName(Option, SolIdent), - StructDefPropertyName(ItemContract, Option, VariableDeclaration, Option), - + StructDefPropertyName(Option, VariableDeclaration, Option), // Enum EnumDefName(Option, ItemEnum, SolIdent), @@ -39,14 +42,12 @@ pub enum FoundNode { ErrorDefName(Option, ItemError, SolIdent), ErrorDefParameter(Option, ItemError, VariableDeclaration), + + // Events EventDefName(ItemContract, ItemEvent, SolIdent), EventDefParameter(ItemContract, ItemEvent, EventParameter), - /// TODO!: - /// HOW TO DIFFERENTIATE BETWEEN THESE TWO? - VariableUsageName(Option, Option, Expr, SolIdent), - StructInstantiation(ItemContract, Option, SolIdent), // Contracts //ContractScope(ItemContract, Option, SolPath), diff --git a/libs/ast-extractor/tests/files/constants/constant.sol b/libs/ast-extractor/tests/files/constants/constant.sol new file mode 100644 index 00000000..1af9c959 --- /dev/null +++ b/libs/ast-extractor/tests/files/constants/constant.sol @@ -0,0 +1 @@ +uint8 constant myConst = 1; diff --git a/libs/ast-extractor/tests/files/contracts/inheritance.sol b/libs/ast-extractor/tests/files/contracts/inheritance.sol index 83f1bd6c..b634fc78 100644 --- a/libs/ast-extractor/tests/files/contracts/inheritance.sol +++ b/libs/ast-extractor/tests/files/contracts/inheritance.sol @@ -1,5 +1,4 @@ - -import "../using/one.sol";abstract contract One is ERC20{ +abstract contract One is ERC20 { uint storedData; function set(uint x) public { storedData = x; diff --git a/libs/ast-extractor/tests/files/errors/one.sol b/libs/ast-extractor/tests/files/errors/one.sol index fbccd3e0..31cccc16 100644 --- a/libs/ast-extractor/tests/files/errors/one.sol +++ b/libs/ast-extractor/tests/files/errors/one.sol @@ -1,5 +1,5 @@ -error one(); +error one(uint256 val1, address val2); contract One { - error another_one(); + error another_one(uint256 val1, address val2); } diff --git a/libs/ast-extractor/tests/files/event/one.sol b/libs/ast-extractor/tests/files/event/one.sol index 4b054318..df2ecf7f 100644 --- a/libs/ast-extractor/tests/files/event/one.sol +++ b/libs/ast-extractor/tests/files/event/one.sol @@ -1,5 +1,5 @@ event one(); contract One { - event another_one(); + event another_one(uint256 val1, address val2); } diff --git a/libs/ast-extractor/tests/files/structs/one.sol b/libs/ast-extractor/tests/files/structs/one.sol index 01f5c5be..239839aa 100644 --- a/libs/ast-extractor/tests/files/structs/one.sol +++ b/libs/ast-extractor/tests/files/structs/one.sol @@ -8,4 +8,8 @@ contract One { uint storedData1; uint storedData2; } + + function test() public view { + another_one test = another_one(0, 0); + } } From 5dc93e5526da06dc338cfdfeddc22141b2811fff Mon Sep 17 00:00:00 2001 From: 0xSwapFeeder Date: Mon, 2 Oct 2023 16:00:42 -0400 Subject: [PATCH 117/325] fix(solidity/ast/finder): replaced assert false by panic --- libs/ast-extractor/src/retriever/finder.rs | 152 ++++++++++----------- 1 file changed, 76 insertions(+), 76 deletions(-) diff --git a/libs/ast-extractor/src/retriever/finder.rs b/libs/ast-extractor/src/retriever/finder.rs index 96e77463..53b1cd7f 100644 --- a/libs/ast-extractor/src/retriever/finder.rs +++ b/libs/ast-extractor/src/retriever/finder.rs @@ -330,12 +330,12 @@ mod tests { assert_eq!(contract.name.to_string(), "One"); } _ => { - assert!(false) + panic!() } } } else { - assert!(false) + panic!() } } @@ -357,12 +357,12 @@ mod tests { assert_eq!(modifier.name.to_string(), "ERC20"); } _ => { - assert!(false) + panic!() } } } else { - assert!(false) + panic!() } } #[test] @@ -383,12 +383,12 @@ mod tests { assert_eq!(modifier.name.to_string(), "ERC721"); } _ => { - assert!(false) + panic!() } } } else { - assert!(false) + panic!() } } @@ -413,17 +413,17 @@ mod tests { assert_eq!(sol_path.to_string(), "One"); } _ => { - assert!(false) + panic!() } } } _ => { - assert!(false) + panic!() } } } else { - assert!(false) + panic!() } } @@ -445,16 +445,16 @@ mod tests { if let Some(name) = &f.name { assert_eq!(name.to_string(), "set"); } else { - assert!(false) + panic!() } } _ => { - assert!(false) + panic!() } } } else { - assert!(false) + panic!() } } @@ -478,17 +478,17 @@ mod tests { assert_eq!(ident.to_string(), "test"); } _ => { - assert!(false) + panic!() } } } _ => { - assert!(false) + panic!() } } } else { - assert!(false) + panic!() } } @@ -510,16 +510,16 @@ mod tests { if let Some(name) = &ident { assert_eq!(name.to_string(), "x"); } else { - assert!(false) + panic!() } } _ => { - assert!(false) + panic!() } } } else { - assert!(false) + panic!() } } @@ -541,12 +541,12 @@ mod tests { assert_eq!(ident.to_string(), "storedData"); } _ => { - assert!(false) + panic!() } } } else { - assert!(false) + panic!() } } @@ -568,12 +568,12 @@ mod tests { assert_eq!(ident.to_string(), "myConst"); } _ => { - assert!(false) + panic!() } } } else { - assert!(false) + panic!() } } @@ -595,16 +595,16 @@ mod tests { if let Some(name) = ident { assert_eq!(name.to_string(), "myString"); } else { - assert!(false) + panic!() } } _ => { - assert!(false) + panic!() } } } else { - assert!(false) + panic!() } } @@ -627,16 +627,16 @@ mod tests { FoundNode::TypeUsage(_,_,_,ty) => { match ty { Type::String(_) => {assert!(true)} - _ => {assert!(false)} + _ => {panic!()} } } _ => { - assert!(false) + panic!() } } } else { - assert!(false) + panic!() } } @@ -660,16 +660,16 @@ mod tests { Expr::Ident(ident) => { assert_eq!(ident.to_string(), "another_one"); } - _ => {assert!(false)} + _ => {panic!()} } } _ => { - assert!(false) + panic!() } } } else { - assert!(false) + panic!() } } @@ -693,16 +693,16 @@ mod tests { Type::Custom(ident) => { assert_eq!(ident.to_string(), "another_one"); } - _ => {assert!(false)} + _ => {panic!()} } } _ => { - assert!(false) + panic!() } } } else { - assert!(false) + panic!() } } @@ -724,16 +724,16 @@ mod tests { FoundNode::TypeUsage(_,_,expr, ty) => { match ty { Type::Uint(_, _) => {} - _ => {assert!(false)} + _ => {panic!()} } } _ => { - assert!(false) + panic!() } } } else { - assert!(false) + panic!() } } @@ -757,12 +757,12 @@ mod tests { assert_eq!(ident.to_string(), "another_one"); } _ => { - assert!(false) + panic!() } } } else { - assert!(false) + panic!() } } @@ -786,12 +786,12 @@ mod tests { assert_eq!(ident.to_string(), "one"); } _ => { - assert!(false) + panic!() } } } else { - assert!(false) + panic!() } } @@ -815,16 +815,16 @@ mod tests { if let Some(name) = ident { assert_eq!(name.to_string(), "storedData1"); } else { - assert!(false) + panic!() } } _ => { - assert!(false) + panic!() } } } else { - assert!(false) + panic!() } } @@ -848,16 +848,16 @@ mod tests { if let Some(name) = ident { assert_eq!(name.to_string(), "storedData1"); } else { - assert!(false) + panic!() } } _ => { - assert!(false) + panic!() } } } else { - assert!(false) + panic!() } } @@ -881,12 +881,12 @@ mod tests { assert_eq!(ident.to_string(), "another_one"); } _ => { - assert!(false) + panic!() } } } else { - assert!(false) + panic!() } } @@ -910,12 +910,12 @@ mod tests { assert_eq!(ident.to_string(), "Tuesday"); } _ => { - assert!(false) + panic!() } } } else { - assert!(false) + panic!() } } @@ -939,12 +939,12 @@ mod tests { assert_eq!(ident.to_string(), "one"); } _ => { - assert!(false) + panic!() } } } else { - assert!(false) + panic!() } } @@ -968,12 +968,12 @@ mod tests { assert_eq!(ident.to_string(), "Tuesday"); } _ => { - assert!(false) + panic!() } } } else { - assert!(false) + panic!() } } @@ -997,12 +997,12 @@ mod tests { assert_eq!(ident.to_string(), "one"); } _ => { - assert!(false) + panic!() } } } else { - assert!(false) + panic!() } } @@ -1026,12 +1026,12 @@ mod tests { assert_eq!(ident.to_string(), "another_one"); } _ => { - assert!(false) + panic!() } } } else { - assert!(false) + panic!() } } @@ -1056,16 +1056,16 @@ mod tests { assert_eq!(name.to_string(), "val1"); } else { - assert!(false) + panic!() } } _ => { - assert!(false) + panic!() } } } else { - assert!(false) + panic!() } } @@ -1090,16 +1090,16 @@ mod tests { assert_eq!(name.to_string(), "val1"); } else { - assert!(false) + panic!() } } _ => { - assert!(false) + panic!() } } } else { - assert!(false) + panic!() } } @@ -1122,12 +1122,12 @@ mod tests { assert_eq!(ident.to_string(), "another_one"); } _ => { - assert!(false) + panic!() } } } else { - assert!(false) + panic!() } } @@ -1150,16 +1150,16 @@ mod tests { if let Some(name) = &ident.name { assert_eq!(name.to_string(), "val1"); } else { - assert!(false); + panic!(); } } _ => { - assert!(false) + panic!() } } } else { - assert!(false) + panic!() } } @@ -1183,12 +1183,12 @@ mod tests { assert_eq!(ident.to_string(), "storedData"); } _ => { - assert!(false) + panic!() } } } else { - assert!(false) + panic!() } } @@ -1211,12 +1211,12 @@ mod tests { assert_eq!(ident.to_string(), "storedData"); } _ => { - assert!(false) + panic!() } } } else { - assert!(false) + panic!() } } @@ -1239,12 +1239,12 @@ mod tests { assert_eq!(ident.to_string(), "x"); } _ => { - assert!(false) + panic!() } } } else { - assert!(false) + panic!() } } From cee6fc6c818c2398366058c2a82f982d1fa946b8 Mon Sep 17 00:00:00 2001 From: 0xSwapFeeder Date: Mon, 2 Oct 2023 16:15:54 -0400 Subject: [PATCH 118/325] fix(solidity/ast/finder): runned clippy to try fix ci --- libs/ast-extractor/src/retriever/finder.rs | 110 ++++++++---------- .../src/retriever/finder/find_node.rs | 4 +- 2 files changed, 53 insertions(+), 61 deletions(-) diff --git a/libs/ast-extractor/src/retriever/finder.rs b/libs/ast-extractor/src/retriever/finder.rs index 53b1cd7f..b0c5ee8c 100644 --- a/libs/ast-extractor/src/retriever/finder.rs +++ b/libs/ast-extractor/src/retriever/finder.rs @@ -4,10 +4,10 @@ * author: 0xSwapFeeder */ use syn_solidity::*; -use proc_macro2::LineColumn; -use syn::ExprLit; -use syn_solidity::kw::contract; -use syn_solidity::visit::{visit_expr_new, visit_variable_declaration}; + + + +use syn_solidity::visit::{visit_variable_declaration}; use crate::retriever::finder::find_node::FoundNode; mod find_node; @@ -21,6 +21,7 @@ macro_rules! is_in_range { }; } +#[derive(Default)] pub struct Position { line: usize, char: usize, @@ -36,14 +37,7 @@ impl Position { } -impl Default for Position { - fn default() -> Self { - Self { - line: 0, - char: 0, - } - } -} + struct FinderVisitor { current_contract: Option, @@ -91,7 +85,7 @@ impl FinderVisitor { } } } - return false; + false } } @@ -126,8 +120,7 @@ impl<'ast> Visit<'ast> for FinderVisitor { // Therefore we can not goto or list_ref any variable used in a new expr fn visit_expr_new(&mut self, new: &'ast ExprNew) { if is_in_range!(new.ty.span().start(), new.ty.span().end(), self.to_find) { - self.found = Some(FoundNode::ContractInstantiation(self.current_contract.clone().unwrap().clone(), self.current_function.clone(), new.clone())); - return; + self.found = Some(FoundNode::ContractInstantiation(self.current_contract.clone().unwrap(), self.current_function.clone(), new.clone())); } } @@ -142,8 +135,8 @@ impl<'ast> Visit<'ast> for FinderVisitor { fn visit_variable_declaration(&mut self, var: &'ast VariableDeclaration) { if is_in_range!(var.span().start(), var.span().end(), self.to_find) { self.current_variable = Some(var.clone()); - let s = var.name.span().start(); - let e = var.name.span().end(); + let _s = var.name.span().start(); + let _e = var.name.span().end(); if is_in_range!(var.name.span().start(), var.name.span().end(), self.to_find) { self.found = Some(FoundNode::VariableDefName(self.current_contract.clone(), self.current_function.clone(), var.clone(), var.name.clone())); return; @@ -175,8 +168,8 @@ impl<'ast> Visit<'ast> for FinderVisitor { } fn visit_item_contract(&mut self, contract: &'ast ItemContract) { - let contract_start = contract.brace_token.span().start(); - let contract_end = contract.brace_token.span().end(); + let _contract_start = contract.brace_token.span().start(); + let _contract_end = contract.brace_token.span().end(); self.current_contract = Some(contract.clone()); if is_in_range!(contract.span().start(), contract.span().end(), self.to_find) { self.found = Some(FoundNode::ContractDefName(contract.clone())); @@ -224,12 +217,12 @@ impl<'ast> Visit<'ast> for FinderVisitor { fn visit_item_event(&mut self, event: &'ast ItemEvent) { self.current_event = Some(event.clone()); if is_in_range!(event.name.span().start(), event.name.span().end(), self.to_find) { - self.found = Some(FoundNode::EventDefName(self.current_contract.clone().unwrap().clone(), event.clone(), event.name.clone())); + self.found = Some(FoundNode::EventDefName(self.current_contract.clone().unwrap(), event.clone(), event.name.clone())); return; } for param in &event.parameters { if is_in_range!(param.name.span().start(), param.name.span().end(), self.to_find) { - self.found = Some(FoundNode::EventDefParameter(self.current_contract.clone().unwrap().clone(), event.clone(), param.clone())); + self.found = Some(FoundNode::EventDefParameter(self.current_contract.clone().unwrap(), event.clone(), param.clone())); return; } } @@ -269,7 +262,6 @@ impl<'ast> Visit<'ast> for FinderVisitor { } if is_in_range!(ident.span().start(), ident.span().end(), self.to_find) { self.found = Some(FoundNode::IdentUsageName(self.current_contract.clone(), self.current_function.clone(), self.current_expr.clone(), ident.clone())); - return; } } @@ -353,7 +345,7 @@ mod tests { let res = retrieve_node_from_position(&ast, Position::new(1, 28)); if let Some(node) = res { match &node { - FoundNode::ContractDefInheritance(contract, modifier) => { + FoundNode::ContractDefInheritance(_contract, modifier) => { assert_eq!(modifier.name.to_string(), "ERC20"); } _ => { @@ -379,7 +371,7 @@ mod tests { let res = retrieve_node_from_position(&ast, Position::new(1, 34)); if let Some(node) = res { match &node { - FoundNode::ContractDefInheritance(contract, modifier) => { + FoundNode::ContractDefInheritance(_contract, modifier) => { assert_eq!(modifier.name.to_string(), "ERC721"); } _ => { @@ -407,7 +399,7 @@ mod tests { println!("{:?}", res); if let Some(node) = res { match &node { - FoundNode::ContractInstantiation(contract, func, expr) => { + FoundNode::ContractInstantiation(_contract, _func, expr) => { match &expr.ty { Type::Custom(sol_path) => { assert_eq!(sol_path.to_string(), "One"); @@ -472,7 +464,7 @@ mod tests { let res = retrieve_node_from_position(&ast, Position::new(9, 18)); if let Some(node) = res { match &node { - FoundNode::IdentUsageCall(contract, func, expr) => { + FoundNode::IdentUsageCall(_contract, _func, expr) => { match &*expr.expr { Expr::Ident(ident) => { assert_eq!(ident.to_string(), "test"); @@ -506,7 +498,7 @@ mod tests { let res = retrieve_node_from_position(&ast, Position::new(3, 23)); if let Some(node) = res { match &node { - FoundNode::FunctionDefParameterName(contract, func, var, ident) => { + FoundNode::FunctionDefParameterName(_contract, _func, _var, ident) => { if let Some(name) = &ident { assert_eq!(name.to_string(), "x"); } else { @@ -537,7 +529,7 @@ mod tests { let res = retrieve_node_from_position(&ast, Position::new(2, 13)); if let Some(node) = res { match &node { - FoundNode::PropertyDefName(contract, var, ident) => { + FoundNode::PropertyDefName(_contract, _var, ident) => { assert_eq!(ident.to_string(), "storedData"); } _ => { @@ -564,7 +556,7 @@ mod tests { let res = retrieve_node_from_position(&ast, Position::new(1, 21)); if let Some(node) = res { match &node { - FoundNode::ConstantVariableDefName(var, ident ) => { + FoundNode::ConstantVariableDefName(_var, ident ) => { assert_eq!(ident.to_string(), "myConst"); } _ => { @@ -591,7 +583,7 @@ mod tests { let res = retrieve_node_from_position(&ast, Position::new(4, 17)); if let Some(node) = res { match &node { - FoundNode::VariableDefName(contract, func, var , ident) => { + FoundNode::VariableDefName(_contract, _func, _var , ident) => { if let Some(name) = ident { assert_eq!(name.to_string(), "myString"); } else { @@ -688,7 +680,7 @@ mod tests { println!("{:?}", res); if let Some(node) = res { match &node { - FoundNode::TypeUsage(_,_,expr, ty) => { + FoundNode::TypeUsage(_,_,_expr, ty) => { match ty { Type::Custom(ident) => { assert_eq!(ident.to_string(), "another_one"); @@ -721,7 +713,7 @@ mod tests { println!("{:?}", res); if let Some(node) = res { match &node { - FoundNode::TypeUsage(_,_,expr, ty) => { + FoundNode::TypeUsage(_,_,_expr, ty) => { match ty { Type::Uint(_, _) => {} _ => {panic!()} @@ -753,7 +745,7 @@ mod tests { if let Some(node) = res { match &node { FoundNode::StructDefName(contract, ident) => { - assert_eq!(contract.is_some(), true); + assert!(contract.is_some()); assert_eq!(ident.to_string(), "another_one"); } _ => { @@ -782,7 +774,7 @@ mod tests { if let Some(node) = res { match &node { FoundNode::StructDefName(contract, ident) => { - assert_eq!(contract.is_none(), true); + assert!(contract.is_none()); assert_eq!(ident.to_string(), "one"); } _ => { @@ -810,8 +802,8 @@ mod tests { println!("{:?}", res); if let Some(node) = res { match &node { - FoundNode::StructDefPropertyName(contract, var, ident) => { - assert_eq!(contract.is_none(), false); + FoundNode::StructDefPropertyName(contract, _var, ident) => { + assert!(!contract.is_none()); if let Some(name) = ident { assert_eq!(name.to_string(), "storedData1"); } else { @@ -843,8 +835,8 @@ mod tests { println!("{:?}", res); if let Some(node) = res { match &node { - FoundNode::StructDefPropertyName(contract, var, ident) => { - assert_eq!(contract.is_none(), true); + FoundNode::StructDefPropertyName(contract, _var, ident) => { + assert!(contract.is_none()); if let Some(name) = ident { assert_eq!(name.to_string(), "storedData1"); } else { @@ -876,8 +868,8 @@ mod tests { println!("{:?}", res); if let Some(node) = res { match &node { - FoundNode::EnumDefName(contract, ennum, ident) => { - assert_eq!(contract.is_none(), false); + FoundNode::EnumDefName(contract, _ennum, ident) => { + assert!(!contract.is_none()); assert_eq!(ident.to_string(), "another_one"); } _ => { @@ -905,8 +897,8 @@ mod tests { println!("{:?}", res); if let Some(node) = res { match &node { - FoundNode::EnumDefValue(contract, ennum, variant, ident) => { - assert_eq!(contract.is_none(), false); + FoundNode::EnumDefValue(contract, _ennum, _variant, ident) => { + assert!(!contract.is_none()); assert_eq!(ident.to_string(), "Tuesday"); } _ => { @@ -934,8 +926,8 @@ mod tests { println!("{:?}", res); if let Some(node) = res { match &node { - FoundNode::EnumDefName(contract, ennum, ident) => { - assert_eq!(contract.is_none(), true); + FoundNode::EnumDefName(contract, _ennum, ident) => { + assert!(contract.is_none()); assert_eq!(ident.to_string(), "one"); } _ => { @@ -963,8 +955,8 @@ mod tests { println!("{:?}", res); if let Some(node) = res { match &node { - FoundNode::EnumDefValue(contract, ennum, variant, ident) => { - assert_eq!(contract.is_none(), true); + FoundNode::EnumDefValue(contract, _ennum, _variant, ident) => { + assert!(contract.is_none()); assert_eq!(ident.to_string(), "Tuesday"); } _ => { @@ -992,8 +984,8 @@ mod tests { println!("{:?}", res); if let Some(node) = res { match &node { - FoundNode::ErrorDefName(contract, err, ident) => { - assert_eq!(contract.is_none(), true); + FoundNode::ErrorDefName(contract, _err, ident) => { + assert!(contract.is_none()); assert_eq!(ident.to_string(), "one"); } _ => { @@ -1021,8 +1013,8 @@ mod tests { println!("{:?}", res); if let Some(node) = res { match &node { - FoundNode::ErrorDefName(contract, err, ident) => { - assert_eq!(contract.is_none(), false); + FoundNode::ErrorDefName(contract, _err, ident) => { + assert!(!contract.is_none()); assert_eq!(ident.to_string(), "another_one"); } _ => { @@ -1050,8 +1042,8 @@ mod tests { println!("{:?}", res); if let Some(node) = res { match &node { - FoundNode::ErrorDefParameter(contract, err, ident) => { - assert_eq!(contract.is_none(), false); + FoundNode::ErrorDefParameter(contract, _err, ident) => { + assert!(!contract.is_none()); if let Some(name) = &ident.name { assert_eq!(name.to_string(), "val1"); } @@ -1084,8 +1076,8 @@ mod tests { println!("{:?}", res); if let Some(node) = res { match &node { - FoundNode::ErrorDefParameter(contract, err, ident) => { - assert_eq!(contract.is_none(), true); + FoundNode::ErrorDefParameter(contract, _err, ident) => { + assert!(contract.is_none()); if let Some(name) = &ident.name { assert_eq!(name.to_string(), "val1"); } @@ -1118,7 +1110,7 @@ mod tests { println!("{:?}", res); if let Some(node) = res { match &node { - FoundNode::EventDefName(contract, err, ident) => { + FoundNode::EventDefName(_contract, _err, ident) => { assert_eq!(ident.to_string(), "another_one"); } _ => { @@ -1146,7 +1138,7 @@ mod tests { println!("{:?}", res); if let Some(node) = res { match &node { - FoundNode::EventDefParameter(contract, err, ident) => { + FoundNode::EventDefParameter(_contract, _err, ident) => { if let Some(name) = &ident.name { assert_eq!(name.to_string(), "val1"); } else { @@ -1179,7 +1171,7 @@ mod tests { println!("{:?}", res); if let Some(node) = res { match &node { - FoundNode::IdentUsageName(contract, func, expr, ident) => { + FoundNode::IdentUsageName(_contract, _func, _expr, ident) => { assert_eq!(ident.to_string(), "storedData"); } _ => { @@ -1207,7 +1199,7 @@ mod tests { println!("{:?}", res); if let Some(node) = res { match &node { - FoundNode::IdentUsageName(contract, func, expr, ident) => { + FoundNode::IdentUsageName(_contract, _func, _expr, ident) => { assert_eq!(ident.to_string(), "storedData"); } _ => { @@ -1235,7 +1227,7 @@ mod tests { println!("{:?}", res); if let Some(node) = res { match &node { - FoundNode::IdentUsageName(contract, func, expr, ident) => { + FoundNode::IdentUsageName(_contract, _func, _expr, ident) => { assert_eq!(ident.to_string(), "x"); } _ => { diff --git a/libs/ast-extractor/src/retriever/finder/find_node.rs b/libs/ast-extractor/src/retriever/finder/find_node.rs index 14859275..83878f1e 100644 --- a/libs/ast-extractor/src/retriever/finder/find_node.rs +++ b/libs/ast-extractor/src/retriever/finder/find_node.rs @@ -1,11 +1,11 @@ -use syn::token::Struct; + /** * find_node.rs * Enum for all possible ast types that can be found * author: 0xMemoryGrinder */ -use syn_solidity::{ExprNew, ItemContract, ItemEnum, ItemFunction, VariableDeclaration, ExprCall, SolIdent, VariableDefinition, Type, VarDeclDecl, Expr, SolPath, File, Variant, Item, ItemEvent, ItemError, Modifier, EventParameter}; +use syn_solidity::{ExprNew, ItemContract, ItemEnum, ItemFunction, VariableDeclaration, ExprCall, SolIdent, VariableDefinition, Type, Expr, Variant, ItemEvent, ItemError, Modifier, EventParameter}; #[derive(Debug)] pub enum FoundNode { From 7e1063638a476883c9a8e102b1a61d4352c2600e Mon Sep 17 00:00:00 2001 From: 0xSwapFeeder Date: Mon, 2 Oct 2023 17:07:47 -0400 Subject: [PATCH 119/325] fix(soldity/ast/finder): removed all useless matching --- libs/ast-extractor/src/retriever/finder.rs | 513 +++++---------------- 1 file changed, 111 insertions(+), 402 deletions(-) diff --git a/libs/ast-extractor/src/retriever/finder.rs b/libs/ast-extractor/src/retriever/finder.rs index b0c5ee8c..f7150a9d 100644 --- a/libs/ast-extractor/src/retriever/finder.rs +++ b/libs/ast-extractor/src/retriever/finder.rs @@ -303,7 +303,6 @@ mod tests { use std::str::FromStr; - #[test] fn test_retrieve_contract_def_name() { let mut path = PathBuf::from(env!("CARGO_MANIFEST_DIR")); @@ -316,16 +315,8 @@ mod tests { let tokens = TokenStream::from_str(source.as_str()).unwrap(); let ast = parse2(tokens).unwrap(); let res = retrieve_node_from_position(&ast, Position::new(1, 20)); - if let Some(node) = res { - match &node { - FoundNode::ContractDefName(contract) => { - assert_eq!(contract.name.to_string(), "One"); - } - _ => { - panic!() - } - } - + if let Some(FoundNode::ContractDefName(contract)) = res { + assert_eq!(contract.name.to_string(), "One"); } else { panic!() } @@ -343,16 +334,8 @@ mod tests { let tokens = TokenStream::from_str(source.as_str()).unwrap(); let ast = parse2(tokens).unwrap(); let res = retrieve_node_from_position(&ast, Position::new(1, 28)); - if let Some(node) = res { - match &node { - FoundNode::ContractDefInheritance(_contract, modifier) => { - assert_eq!(modifier.name.to_string(), "ERC20"); - } - _ => { - panic!() - } - } - + if let Some(FoundNode::ContractDefInheritance(_contract, modifier)) = res { + assert_eq!(modifier.name.to_string(), "ERC20"); } else { panic!() } @@ -369,16 +352,8 @@ mod tests { let tokens = TokenStream::from_str(source.as_str()).unwrap(); let ast = parse2(tokens).unwrap(); let res = retrieve_node_from_position(&ast, Position::new(1, 34)); - if let Some(node) = res { - match &node { - FoundNode::ContractDefInheritance(_contract, modifier) => { - assert_eq!(modifier.name.to_string(), "ERC721"); - } - _ => { - panic!() - } - } - + if let Some(FoundNode::ContractDefInheritance(_contract, modifier)) = res { + assert_eq!(modifier.name.to_string(), "ERC721"); } else { panic!() } @@ -396,24 +371,13 @@ mod tests { let tokens = TokenStream::from_str(source.as_str()).unwrap(); let ast = parse2(tokens).unwrap(); let res = retrieve_node_from_position(&ast, Position::new(15, 22)); - println!("{:?}", res); - if let Some(node) = res { - match &node { - FoundNode::ContractInstantiation(_contract, _func, expr) => { - match &expr.ty { - Type::Custom(sol_path) => { - assert_eq!(sol_path.to_string(), "One"); - } - _ => { - panic!() - } - } - } - _ => { - panic!() - } + + if let Some(FoundNode::ContractInstantiation(_contract, _func, expr)) = res { + if let Type::Custom(sol_path) = &expr.ty { + assert_eq!(sol_path.to_string(), "One"); + } else { + panic!() } - } else { panic!() } @@ -431,20 +395,12 @@ mod tests { let tokens = TokenStream::from_str(source.as_str()).unwrap(); let ast = parse2(tokens).unwrap(); let res = retrieve_node_from_position(&ast, Position::new(3, 14)); - if let Some(node) = res { - match &node { - FoundNode::FunctionDefName(_,f) => { - if let Some(name) = &f.name { - assert_eq!(name.to_string(), "set"); - } else { - panic!() - } - } - _ => { - panic!() - } + if let Some(FoundNode::FunctionDefName(_contract, func)) = res { + if let Some(name) = func.name { + assert_eq!(name.to_string(), "set"); + } else { + panic!() } - } else { panic!() } @@ -462,23 +418,12 @@ mod tests { let tokens = TokenStream::from_str(source.as_str()).unwrap(); let ast = parse2(tokens).unwrap(); let res = retrieve_node_from_position(&ast, Position::new(9, 18)); - if let Some(node) = res { - match &node { - FoundNode::IdentUsageCall(_contract, _func, expr) => { - match &*expr.expr { - Expr::Ident(ident) => { - assert_eq!(ident.to_string(), "test"); - } - _ => { - panic!() - } - } - } - _ => { - panic!() - } + if let Some(FoundNode::IdentUsageCall(_contract, _func, expr)) = res { + if let Expr::Ident(ident) = &*expr.expr { + assert_eq!(ident.to_string(), "test"); + } else { + panic!() } - } else { panic!() } @@ -496,20 +441,8 @@ mod tests { let tokens = TokenStream::from_str(source.as_str()).unwrap(); let ast = parse2(tokens).unwrap(); let res = retrieve_node_from_position(&ast, Position::new(3, 23)); - if let Some(node) = res { - match &node { - FoundNode::FunctionDefParameterName(_contract, _func, _var, ident) => { - if let Some(name) = &ident { - assert_eq!(name.to_string(), "x"); - } else { - panic!() - } - } - _ => { - panic!() - } - } - + if let Some(FoundNode::FunctionDefParameterName(_, _, _var, Some(ident))) = res { + assert_eq!(ident.to_string(), "x"); } else { panic!() } @@ -527,16 +460,8 @@ mod tests { let tokens = TokenStream::from_str(source.as_str()).unwrap(); let ast = parse2(tokens).unwrap(); let res = retrieve_node_from_position(&ast, Position::new(2, 13)); - if let Some(node) = res { - match &node { - FoundNode::PropertyDefName(_contract, _var, ident) => { - assert_eq!(ident.to_string(), "storedData"); - } - _ => { - panic!() - } - } - + if let Some(FoundNode::PropertyDefName(_contract, _var, ident)) = res { + assert_eq!(ident.to_string(), "storedData"); } else { panic!() } @@ -554,16 +479,8 @@ mod tests { let tokens = TokenStream::from_str(source.as_str()).unwrap(); let ast = parse2(tokens).unwrap(); let res = retrieve_node_from_position(&ast, Position::new(1, 21)); - if let Some(node) = res { - match &node { - FoundNode::ConstantVariableDefName(_var, ident ) => { - assert_eq!(ident.to_string(), "myConst"); - } - _ => { - panic!() - } - } - + if let Some(FoundNode::ConstantVariableDefName(_var, ident)) = res { + assert_eq!(ident.to_string(), "myConst"); } else { panic!() } @@ -581,20 +498,8 @@ mod tests { let tokens = TokenStream::from_str(source.as_str()).unwrap(); let ast = parse2(tokens).unwrap(); let res = retrieve_node_from_position(&ast, Position::new(4, 17)); - if let Some(node) = res { - match &node { - FoundNode::VariableDefName(_contract, _func, _var , ident) => { - if let Some(name) = ident { - assert_eq!(name.to_string(), "myString"); - } else { - panic!() - } - } - _ => { - panic!() - } - } - + if let Some(FoundNode::VariableDefName(_contract, _func, _var, Some(ident))) = res { + assert_eq!(ident.to_string(), "myString"); } else { panic!() } @@ -613,20 +518,7 @@ mod tests { let tokens = TokenStream::from_str(source.as_str()).unwrap(); let ast = parse2(tokens).unwrap(); let res = retrieve_node_from_position(&ast, Position::new(4, 10)); - println!("{:?}", res); - if let Some(node) = res { - match &node { - FoundNode::TypeUsage(_,_,_,ty) => { - match ty { - Type::String(_) => {assert!(true)} - _ => {panic!()} - } - } - _ => { - panic!() - } - } - + if let Some(FoundNode::TypeUsage(_,_,_,Type::String(_))) = res { } else { panic!() } @@ -644,22 +536,12 @@ mod tests { let tokens = TokenStream::from_str(source.as_str()).unwrap(); let ast = parse2(tokens).unwrap(); let res = retrieve_node_from_position(&ast, Position::new(13, 36)); - println!("{:?}", res); - if let Some(node) = res { - match &node { - FoundNode::IdentUsageCall(_, _, expr) => { - match &*expr.expr { - Expr::Ident(ident) => { - assert_eq!(ident.to_string(), "another_one"); - } - _ => {panic!()} - } - } - _ => { - panic!() - } + if let Some(FoundNode::IdentUsageCall(_, _, expr)) = res { + if let Expr::Ident(ident) = &*expr.expr { + assert_eq!(ident.to_string(), "another_one"); + } else { + panic!() } - } else { panic!() } @@ -677,22 +559,8 @@ mod tests { let tokens = TokenStream::from_str(source.as_str()).unwrap(); let ast = parse2(tokens).unwrap(); let res = retrieve_node_from_position(&ast, Position::new(13, 12)); - println!("{:?}", res); - if let Some(node) = res { - match &node { - FoundNode::TypeUsage(_,_,_expr, ty) => { - match ty { - Type::Custom(ident) => { - assert_eq!(ident.to_string(), "another_one"); - } - _ => {panic!()} - } - } - _ => { - panic!() - } - } - + if let Some(FoundNode::TypeUsage(_,_,_expr, Type::Custom(ident))) = res { + assert_eq!(ident.to_string(), "another_one"); } else { panic!() } @@ -710,20 +578,8 @@ mod tests { let tokens = TokenStream::from_str(source.as_str()).unwrap(); let ast = parse2(tokens).unwrap(); let res = retrieve_node_from_position(&ast, Position::new(7, 42)); - println!("{:?}", res); - if let Some(node) = res { - match &node { - FoundNode::TypeUsage(_,_,_expr, ty) => { - match ty { - Type::Uint(_, _) => {} - _ => {panic!()} - } - } - _ => { - panic!() - } - } - + + if let Some(FoundNode::TypeUsage(_,_,_expr, Type::Uint(_,_))) = res { } else { panic!() } @@ -741,18 +597,9 @@ mod tests { let tokens = TokenStream::from_str(source.as_str()).unwrap(); let ast = parse2(tokens).unwrap(); let res = retrieve_node_from_position(&ast, Position::new(7, 14)); - println!("{:?}", res); - if let Some(node) = res { - match &node { - FoundNode::StructDefName(contract, ident) => { - assert!(contract.is_some()); - assert_eq!(ident.to_string(), "another_one"); - } - _ => { - panic!() - } - } - + if let Some(FoundNode::StructDefName(contract, ident)) = res { + assert!(contract.is_some()); + assert_eq!(ident.to_string(), "another_one"); } else { panic!() } @@ -770,18 +617,9 @@ mod tests { let tokens = TokenStream::from_str(source.as_str()).unwrap(); let ast = parse2(tokens).unwrap(); let res = retrieve_node_from_position(&ast, Position::new(1, 10)); - println!("{:?}", res); - if let Some(node) = res { - match &node { - FoundNode::StructDefName(contract, ident) => { - assert!(contract.is_none()); - assert_eq!(ident.to_string(), "one"); - } - _ => { - panic!() - } - } - + if let Some(FoundNode::StructDefName(contract, ident)) = res { + assert!(contract.is_none()); + assert_eq!(ident.to_string(), "one"); } else { panic!() } @@ -799,22 +637,10 @@ mod tests { let tokens = TokenStream::from_str(source.as_str()).unwrap(); let ast = parse2(tokens).unwrap(); let res = retrieve_node_from_position(&ast, Position::new(8, 18)); - println!("{:?}", res); - if let Some(node) = res { - match &node { - FoundNode::StructDefPropertyName(contract, _var, ident) => { - assert!(!contract.is_none()); - if let Some(name) = ident { - assert_eq!(name.to_string(), "storedData1"); - } else { - panic!() - } - } - _ => { - panic!() - } - } - + + if let Some(FoundNode::StructDefPropertyName(contract, _var, Some(ident))) = res { + assert!(contract.is_some()); + assert_eq!(ident.to_string(), "storedData1"); } else { panic!() } @@ -832,22 +658,10 @@ mod tests { let tokens = TokenStream::from_str(source.as_str()).unwrap(); let ast = parse2(tokens).unwrap(); let res = retrieve_node_from_position(&ast, Position::new(2, 17)); - println!("{:?}", res); - if let Some(node) = res { - match &node { - FoundNode::StructDefPropertyName(contract, _var, ident) => { - assert!(contract.is_none()); - if let Some(name) = ident { - assert_eq!(name.to_string(), "storedData1"); - } else { - panic!() - } - } - _ => { - panic!() - } - } - + + if let Some(FoundNode::StructDefPropertyName(contract, _var, Some(ident))) = res { + assert!(contract.is_none()); + assert_eq!(ident.to_string(), "storedData1"); } else { panic!() } @@ -865,18 +679,10 @@ mod tests { let tokens = TokenStream::from_str(source.as_str()).unwrap(); let ast = parse2(tokens).unwrap(); let res = retrieve_node_from_position(&ast, Position::new(12, 14)); - println!("{:?}", res); - if let Some(node) = res { - match &node { - FoundNode::EnumDefName(contract, _ennum, ident) => { - assert!(!contract.is_none()); - assert_eq!(ident.to_string(), "another_one"); - } - _ => { - panic!() - } - } - + + if let Some(FoundNode::EnumDefName(contract, _ennum, ident)) = res { + assert!(contract.is_some()); + assert_eq!(ident.to_string(), "another_one"); } else { panic!() } @@ -894,18 +700,10 @@ mod tests { let tokens = TokenStream::from_str(source.as_str()).unwrap(); let ast = parse2(tokens).unwrap(); let res = retrieve_node_from_position(&ast, Position::new(14, 12)); - println!("{:?}", res); - if let Some(node) = res { - match &node { - FoundNode::EnumDefValue(contract, _ennum, _variant, ident) => { - assert!(!contract.is_none()); - assert_eq!(ident.to_string(), "Tuesday"); - } - _ => { - panic!() - } - } - + + if let Some(FoundNode::EnumDefValue(contract, _ennum, _variant, ident)) = res { + assert!(contract.is_some()); + assert_eq!(ident.to_string(), "Tuesday"); } else { panic!() } @@ -923,18 +721,10 @@ mod tests { let tokens = TokenStream::from_str(source.as_str()).unwrap(); let ast = parse2(tokens).unwrap(); let res = retrieve_node_from_position(&ast, Position::new(1, 8)); - println!("{:?}", res); - if let Some(node) = res { - match &node { - FoundNode::EnumDefName(contract, _ennum, ident) => { - assert!(contract.is_none()); - assert_eq!(ident.to_string(), "one"); - } - _ => { - panic!() - } - } - + + if let Some(FoundNode::EnumDefName(contract, _ennum, ident)) = res { + assert!(contract.is_none()); + assert_eq!(ident.to_string(), "one"); } else { panic!() } @@ -952,18 +742,10 @@ mod tests { let tokens = TokenStream::from_str(source.as_str()).unwrap(); let ast = parse2(tokens).unwrap(); let res = retrieve_node_from_position(&ast, Position::new(3, 8)); - println!("{:?}", res); - if let Some(node) = res { - match &node { - FoundNode::EnumDefValue(contract, _ennum, _variant, ident) => { - assert!(contract.is_none()); - assert_eq!(ident.to_string(), "Tuesday"); - } - _ => { - panic!() - } - } - + + if let Some(FoundNode::EnumDefValue(contract, _ennum, _variant, ident)) = res { + assert!(contract.is_none()); + assert_eq!(ident.to_string(), "Tuesday"); } else { panic!() } @@ -981,18 +763,10 @@ mod tests { let tokens = TokenStream::from_str(source.as_str()).unwrap(); let ast = parse2(tokens).unwrap(); let res = retrieve_node_from_position(&ast, Position::new(1, 8)); - println!("{:?}", res); - if let Some(node) = res { - match &node { - FoundNode::ErrorDefName(contract, _err, ident) => { - assert!(contract.is_none()); - assert_eq!(ident.to_string(), "one"); - } - _ => { - panic!() - } - } - + + if let Some(FoundNode::ErrorDefName(contract, _err, ident)) = res { + assert!(contract.is_none()); + assert_eq!(ident.to_string(), "one"); } else { panic!() } @@ -1010,18 +784,10 @@ mod tests { let tokens = TokenStream::from_str(source.as_str()).unwrap(); let ast = parse2(tokens).unwrap(); let res = retrieve_node_from_position(&ast, Position::new(4, 16)); - println!("{:?}", res); - if let Some(node) = res { - match &node { - FoundNode::ErrorDefName(contract, _err, ident) => { - assert!(!contract.is_none()); - assert_eq!(ident.to_string(), "another_one"); - } - _ => { - panic!() - } - } - + + if let Some(FoundNode::ErrorDefName(contract, _err, ident)) = res { + assert!(contract.is_some()); + assert_eq!(ident.to_string(), "another_one"); } else { panic!() } @@ -1039,23 +805,14 @@ mod tests { let tokens = TokenStream::from_str(source.as_str()).unwrap(); let ast = parse2(tokens).unwrap(); let res = retrieve_node_from_position(&ast, Position::new(4, 33)); - println!("{:?}", res); - if let Some(node) = res { - match &node { - FoundNode::ErrorDefParameter(contract, _err, ident) => { - assert!(!contract.is_none()); - if let Some(name) = &ident.name { - assert_eq!(name.to_string(), "val1"); - } - else { - panic!() - } - } - _ => { - panic!() - } + + if let Some(FoundNode::ErrorDefParameter(contract, _err, ident)) = res { + assert!(contract.is_some()); + if let Some(name) = &ident.name { + assert_eq!(name.to_string(), "val1"); + } else { + panic!() } - } else { panic!() } @@ -1073,23 +830,15 @@ mod tests { let tokens = TokenStream::from_str(source.as_str()).unwrap(); let ast = parse2(tokens).unwrap(); let res = retrieve_node_from_position(&ast, Position::new(1, 21)); - println!("{:?}", res); - if let Some(node) = res { - match &node { - FoundNode::ErrorDefParameter(contract, _err, ident) => { - assert!(contract.is_none()); - if let Some(name) = &ident.name { - assert_eq!(name.to_string(), "val1"); - } - else { - panic!() - } - } - _ => { - panic!() - } + + if let Some(FoundNode::ErrorDefParameter(contract, _err, ident)) = res { + assert!(contract.is_none()); + if let Some(name) = &ident.name { + assert_eq!(name.to_string(), "val1"); + } + else { + panic!() } - } else { panic!() } @@ -1107,17 +856,9 @@ mod tests { let tokens = TokenStream::from_str(source.as_str()).unwrap(); let ast = parse2(tokens).unwrap(); let res = retrieve_node_from_position(&ast, Position::new(4, 16)); - println!("{:?}", res); - if let Some(node) = res { - match &node { - FoundNode::EventDefName(_contract, _err, ident) => { - assert_eq!(ident.to_string(), "another_one"); - } - _ => { - panic!() - } - } - + + if let Some(FoundNode::EventDefName(_contract, _err, ident) ) = res { + assert_eq!(ident.to_string(), "another_one"); } else { panic!() } @@ -1135,21 +876,13 @@ mod tests { let tokens = TokenStream::from_str(source.as_str()).unwrap(); let ast = parse2(tokens).unwrap(); let res = retrieve_node_from_position(&ast, Position::new(4, 32)); - println!("{:?}", res); - if let Some(node) = res { - match &node { - FoundNode::EventDefParameter(_contract, _err, ident) => { - if let Some(name) = &ident.name { - assert_eq!(name.to_string(), "val1"); - } else { - panic!(); - } - } - _ => { - panic!() - } - } + if let Some(FoundNode::EventDefParameter(_contract, _err, ident)) = res { + if let Some(name) = &ident.name { + assert_eq!(name.to_string(), "val1"); + } else { + panic!() + } } else { panic!() } @@ -1168,17 +901,9 @@ mod tests { let tokens = TokenStream::from_str(source.as_str()).unwrap(); let ast = parse2(tokens).unwrap(); let res = retrieve_node_from_position(&ast, Position::new(5, 14)); - println!("{:?}", res); - if let Some(node) = res { - match &node { - FoundNode::IdentUsageName(_contract, _func, _expr, ident) => { - assert_eq!(ident.to_string(), "storedData"); - } - _ => { - panic!() - } - } - + + if let Some(FoundNode::IdentUsageName(_contract, _func, _expr, ident)) = res { + assert_eq!(ident.to_string(), "storedData"); } else { panic!() } @@ -1196,17 +921,9 @@ mod tests { let tokens = TokenStream::from_str(source.as_str()).unwrap(); let ast = parse2(tokens).unwrap(); let res = retrieve_node_from_position(&ast, Position::new(9, 22)); - println!("{:?}", res); - if let Some(node) = res { - match &node { - FoundNode::IdentUsageName(_contract, _func, _expr, ident) => { - assert_eq!(ident.to_string(), "storedData"); - } - _ => { - panic!() - } - } - + + if let Some(FoundNode::IdentUsageName(_contract, _func, _expr, ident) ) = res { + assert_eq!(ident.to_string(), "storedData"); } else { panic!() } @@ -1224,17 +941,9 @@ mod tests { let tokens = TokenStream::from_str(source.as_str()).unwrap(); let ast = parse2(tokens).unwrap(); let res = retrieve_node_from_position(&ast, Position::new(5, 22)); - println!("{:?}", res); - if let Some(node) = res { - match &node { - FoundNode::IdentUsageName(_contract, _func, _expr, ident) => { - assert_eq!(ident.to_string(), "x"); - } - _ => { - panic!() - } - } - + + if let Some(FoundNode::IdentUsageName(_contract, _func, _expr, ident)) = res { + assert_eq!(ident.to_string(), "x"); } else { panic!() } From 116ca8d1ade2c492708a28e379ad3d6d6a882733 Mon Sep 17 00:00:00 2001 From: Astrodevs CI Date: Fri, 6 Oct 2023 23:49:31 +0000 Subject: [PATCH 120/325] chore: create branch chore/159-ci-cd-fixes-staging --- remove-me-169bf1f7b3864572b7f3.txt | 1 + 1 file changed, 1 insertion(+) create mode 100644 remove-me-169bf1f7b3864572b7f3.txt diff --git a/remove-me-169bf1f7b3864572b7f3.txt b/remove-me-169bf1f7b3864572b7f3.txt new file mode 100644 index 00000000..7be46539 --- /dev/null +++ b/remove-me-169bf1f7b3864572b7f3.txt @@ -0,0 +1 @@ +169bf1f7b3864572b7f3 From 5e54263411a9613da44184f81a2c0a46ea8bc2c2 Mon Sep 17 00:00:00 2001 From: 0xMemoryGrinder <35138272+0xMemoryGrinder@users.noreply.github.com> Date: Fri, 6 Oct 2023 20:06:45 -0400 Subject: [PATCH 121/325] ci: made CI run on any PR --- .github/workflows/ci.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5dd509cd..f6801521 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -2,7 +2,6 @@ name: CI on: pull_request: - branches: [main, dev] jobs: setup: From dd4d476b6ad15c06f21892c5a89ed4b501689db5 Mon Sep 17 00:00:00 2001 From: 0xMemoryGrinder <35138272+0xMemoryGrinder@users.noreply.github.com> Date: Fri, 6 Oct 2023 20:07:33 -0400 Subject: [PATCH 122/325] ci: added mnual trigger for CD --- .github/workflows/cd.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index dfd466ce..3db0a0c0 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -5,8 +5,7 @@ on: branches: - main - dev -# pull_request: -# branches: [master] + workflow_dispatch: jobs: find-last-commit: From 1903023d902d2fe8a36270fecf594b6223d9fce0 Mon Sep 17 00:00:00 2001 From: 0xMemoryGrinder <35138272+0xMemoryGrinder@users.noreply.github.com> Date: Fri, 6 Oct 2023 21:44:26 -0400 Subject: [PATCH 123/325] chore: renamed yarn workspaces to comply with VS-Code naming convention --- .github/workflows/detect-workspace-changes.yml | 8 ++++---- manager/package.json | 2 +- toolchains/solidity/linter/core/package.json | 2 +- toolchains/solidity/linter/extension/package.json | 2 +- toolchains/solidity/linter/package.json | 2 +- toolchains/solidity/lsp/package.json | 2 +- toolchains/solidity/package.json | 2 +- 7 files changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/detect-workspace-changes.yml b/.github/workflows/detect-workspace-changes.yml index 4149f26a..baab67a0 100644 --- a/.github/workflows/detect-workspace-changes.yml +++ b/.github/workflows/detect-workspace-changes.yml @@ -82,7 +82,7 @@ jobs: }) console.log(affectedWorkspaces) const toolchainsWorkspaces = affectedWorkspaces.filter(workspace => { - return workspace.name.startsWith('@osmium-toolchains/') + return workspace.name.match(/^osmium-(?!manager)[^-\s]+$/) }).map(workspace => ({ name: workspace.name })) @@ -97,18 +97,18 @@ jobs: name: workspace.name })) const extensionsWorkspaces = affectedWorkspaces.filter(workspace => { - return workspace.name.match(/@osmium\/(?:manager|(?!\w+-\w+-\w+)(?:\w+-\w+))/) + return workspace.name.match(/^osmium-(?:manager|(?!\w+-\w+-\w+)(?:\w+-\w+))$/) }).map(workspace => ({ name: workspace.name })) const extensionsFoldersWorkspaces = affectedWorkspaces.filter(workspace => { - return workspace.name.match(/@osmium\/\w+-\w+-\w+/) + return workspace.name.match(/^osmium-\w+-\w+-\w+$/) }).map(workspace => ({ name: workspace.name })) const missingExtensionsWorkspaces = extensionsFoldersWorkspaces.map(workspaceFolder => { - const extensionName = workspaceFolder.name.split('-').slice(0, 2).join('-') + const extensionName = workspaceFolder.name.split('-').slice(0, 3).join('-') const extensionWorkspace = extensionsWorkspaces.find(workspace => { return workspace.name === extensionName }) diff --git a/manager/package.json b/manager/package.json index 02deb8d9..5fa33758 100644 --- a/manager/package.json +++ b/manager/package.json @@ -1,5 +1,5 @@ { - "name": "@osmium/manager", + "name": "osmium-manager", "version": "0.0.1", "main": "index.js", "license": "MIT", diff --git a/toolchains/solidity/linter/core/package.json b/toolchains/solidity/linter/core/package.json index feca568b..3228ba9c 100644 --- a/toolchains/solidity/linter/core/package.json +++ b/toolchains/solidity/linter/core/package.json @@ -1,5 +1,5 @@ { - "name": "@osmium/solidity-linter-core", + "name": "osmium-solidity-linter-core", "version": "0.0.1", "license": "MIT", "scripts": { diff --git a/toolchains/solidity/linter/extension/package.json b/toolchains/solidity/linter/extension/package.json index c9d3de90..4c385a0d 100644 --- a/toolchains/solidity/linter/extension/package.json +++ b/toolchains/solidity/linter/extension/package.json @@ -1,5 +1,5 @@ { - "name": "@osmium-toolchains/solidity-linter-extension", + "name": "osmium-solidity-linter-extension", "displayName": "solidhunter", "description": "", "version": "0.0.1", diff --git a/toolchains/solidity/linter/package.json b/toolchains/solidity/linter/package.json index 49b15a0f..ffced6b0 100644 --- a/toolchains/solidity/linter/package.json +++ b/toolchains/solidity/linter/package.json @@ -1,5 +1,5 @@ { - "name": "@osmium/solidity-linter", + "name": "osmium-solidity-linter", "version": "0.0.1", "license": "MIT", "private": true, diff --git a/toolchains/solidity/lsp/package.json b/toolchains/solidity/lsp/package.json index e596e7be..016ed563 100644 --- a/toolchains/solidity/lsp/package.json +++ b/toolchains/solidity/lsp/package.json @@ -1,5 +1,5 @@ { - "name": "@osmium/solidity-lsp", + "name": "osmium-solidity-lsp", "version": "0.0.1", "license": "MIT", "workspaces": [ diff --git a/toolchains/solidity/package.json b/toolchains/solidity/package.json index df4522f4..48297a97 100644 --- a/toolchains/solidity/package.json +++ b/toolchains/solidity/package.json @@ -1,5 +1,5 @@ { - "name": "@osmium-toolchains/solidity", + "name": "osmium-solidity", "version": "0.0.1", "workspaces": [ "*" From c357773bd3140078370f51881a0ef8c68c80aecb Mon Sep 17 00:00:00 2001 From: 0xMemoryGrinder <35138272+0xMemoryGrinder@users.noreply.github.com> Date: Fri, 6 Oct 2023 22:06:47 -0400 Subject: [PATCH 124/325] ci: added yarn instalkl step inside CI pipeline --- .github/workflows/ci.yml | 63 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f6801521..af9d713b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -45,14 +45,32 @@ jobs: steps: - uses: actions/checkout@v3 - uses: actions/setup-node@v3 + - name: Setup yarn id: setup-yarn run: | corepack enable corepack prepare yarn@stable --activate yarn plugin import workspace-tools + + - name: Get yarn cache directory path + id: yarn-cache-dir-path + run: echo "dir=$(yarn config get cacheFolder)" >> $GITHUB_OUTPUT + - uses: actions/cache@v3 + id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`) + with: + path: ${{ steps.yarn-cache-dir-path.outputs.dir }} + key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} + restore-keys: | + ${{ runner.os }}-yarn- + - run: yarn install --frozen-lockfile + if: steps.yarn-cache.outputs.cache-hit != 'true' + - run: yarn workspace ${{ matrix.workspace.name }} run lint + + + format: runs-on: ubuntu-latest needs: flatten-deps @@ -63,12 +81,27 @@ jobs: steps: - uses: actions/checkout@v3 - uses: actions/setup-node@v3 + - name: Setup yarn id: setup-yarn run: | corepack enable corepack prepare yarn@stable --activate yarn plugin import workspace-tools + + - name: Get yarn cache directory path + id: yarn-cache-dir-path + run: echo "dir=$(yarn config get cacheFolder)" >> $GITHUB_OUTPUT + - uses: actions/cache@v3 + id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`) + with: + path: ${{ steps.yarn-cache-dir-path.outputs.dir }} + key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} + restore-keys: | + ${{ runner.os }}-yarn- + - run: yarn install --frozen-lockfile + if: steps.yarn-cache.outputs.cache-hit != 'true' + - run: yarn workspace ${{ matrix.workspace.name }} run format build: @@ -81,12 +114,27 @@ jobs: steps: - uses: actions/checkout@v3 - uses: actions/setup-node@v3 + - name: Setup yarn id: setup-yarn run: | corepack enable corepack prepare yarn@stable --activate yarn plugin import workspace-tools + + - name: Get yarn cache directory path + id: yarn-cache-dir-path + run: echo "dir=$(yarn config get cacheFolder)" >> $GITHUB_OUTPUT + - uses: actions/cache@v3 + id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`) + with: + path: ${{ steps.yarn-cache-dir-path.outputs.dir }} + key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} + restore-keys: | + ${{ runner.os }}-yarn- + - run: yarn install --frozen-lockfile + if: steps.yarn-cache.outputs.cache-hit != 'true' + - run: yarn workspace ${{ matrix.workspace.name }} run build test: @@ -99,10 +147,25 @@ jobs: steps: - uses: actions/checkout@v3 - uses: actions/setup-node@v3 + - name: Setup yarn id: setup-yarn run: | corepack enable corepack prepare yarn@stable --activate yarn plugin import workspace-tools + + - name: Get yarn cache directory path + id: yarn-cache-dir-path + run: echo "dir=$(yarn config get cacheFolder)" >> $GITHUB_OUTPUT + - uses: actions/cache@v3 + id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`) + with: + path: ${{ steps.yarn-cache-dir-path.outputs.dir }} + key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} + restore-keys: | + ${{ runner.os }}-yarn- + - run: yarn install --frozen-lockfile + if: steps.yarn-cache.outputs.cache-hit != 'true' + - run: yarn workspace ${{ matrix.workspace.name }} run test \ No newline at end of file From dfb87d07c494771b58d5d23e49c3111e094c555d Mon Sep 17 00:00:00 2001 From: 0xMemoryGrinder <35138272+0xMemoryGrinder@users.noreply.github.com> Date: Fri, 6 Oct 2023 22:14:48 -0400 Subject: [PATCH 125/325] chore: ran yarn install to update lockfile --- .pnp.cjs | 320 +++++++++++++++++++++++++++--------------------------- yarn.lock | 104 +++++++++--------- 2 files changed, 212 insertions(+), 212 deletions(-) diff --git a/.pnp.cjs b/.pnp.cjs index 42178f1e..bb821798 100644 --- a/.pnp.cjs +++ b/.pnp.cjs @@ -28,7 +28,7 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { "reference": "workspace:libs/lsp-server-wrapper"\ },\ {\ - "name": "@osmium/manager",\ + "name": "osmium-manager",\ "reference": "workspace:manager"\ },\ {\ @@ -40,23 +40,23 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { "reference": "workspace:packages/prettier-config"\ },\ {\ - "name": "@osmium-toolchains/solidity",\ + "name": "osmium-solidity",\ "reference": "workspace:toolchains/solidity"\ },\ {\ - "name": "@osmium/solidity-linter",\ + "name": "osmium-solidity-linter",\ "reference": "workspace:toolchains/solidity/linter"\ },\ {\ - "name": "@osmium/solidity-linter-core",\ + "name": "osmium-solidity-linter-core",\ "reference": "workspace:toolchains/solidity/linter/core"\ },\ {\ - "name": "@osmium-toolchains/solidity-linter-extension",\ + "name": "osmium-solidity-linter-extension",\ "reference": "workspace:toolchains/solidity/linter/extension"\ },\ {\ - "name": "@osmium/solidity-lsp",\ + "name": "osmium-solidity-lsp",\ "reference": "workspace:toolchains/solidity/lsp"\ }\ ],\ @@ -68,13 +68,13 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { ["@osmium-libs/lsp-server-wrapper", ["workspace:libs/lsp-server-wrapper"]],\ ["@osmium-packages/eslint-config", ["workspace:packages/eslint-config"]],\ ["@osmium-packages/prettier-config", ["workspace:packages/prettier-config"]],\ - ["@osmium-toolchains/solidity", ["workspace:toolchains/solidity"]],\ - ["@osmium-toolchains/solidity-linter-extension", ["workspace:toolchains/solidity/linter/extension"]],\ - ["@osmium/manager", ["workspace:manager"]],\ - ["@osmium/solidity-linter", ["workspace:toolchains/solidity/linter"]],\ - ["@osmium/solidity-linter-core", ["workspace:toolchains/solidity/linter/core"]],\ - ["@osmium/solidity-lsp", ["workspace:toolchains/solidity/lsp"]],\ - ["osmium", ["workspace:."]]\ + ["osmium", ["workspace:."]],\ + ["osmium-manager", ["workspace:manager"]],\ + ["osmium-solidity", ["workspace:toolchains/solidity"]],\ + ["osmium-solidity-linter", ["workspace:toolchains/solidity/linter"]],\ + ["osmium-solidity-linter-core", ["workspace:toolchains/solidity/linter/core"]],\ + ["osmium-solidity-linter-extension", ["workspace:toolchains/solidity/linter/extension"]],\ + ["osmium-solidity-lsp", ["workspace:toolchains/solidity/lsp"]]\ ],\ "fallbackPool": [\ ],\ @@ -422,75 +422,6 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { "linkType": "SOFT"\ }]\ ]],\ - ["@osmium-toolchains/solidity", [\ - ["workspace:toolchains/solidity", {\ - "packageLocation": "./toolchains/solidity/",\ - "packageDependencies": [\ - ["@osmium-toolchains/solidity", "workspace:toolchains/solidity"]\ - ],\ - "linkType": "SOFT"\ - }]\ - ]],\ - ["@osmium-toolchains/solidity-linter-extension", [\ - ["workspace:toolchains/solidity/linter/extension", {\ - "packageLocation": "./toolchains/solidity/linter/extension/",\ - "packageDependencies": [\ - ["@osmium-toolchains/solidity-linter-extension", "workspace:toolchains/solidity/linter/extension"],\ - ["@types/glob", "npm:8.1.0"],\ - ["@types/mocha", "npm:10.0.1"],\ - ["@types/node", "npm:20.2.5"],\ - ["@types/vscode", "npm:1.82.0"],\ - ["@typescript-eslint/eslint-plugin", "virtual:114e6097baba06f1f7194aa147cc16af7c3daf193a49e5fc802ef9cf9d7ac56ceb0639593345639ab943707d850061c33067576340115e57cb282fb86146f6a5#npm:5.62.0"],\ - ["@typescript-eslint/parser", "virtual:114e6097baba06f1f7194aa147cc16af7c3daf193a49e5fc802ef9cf9d7ac56ceb0639593345639ab943707d850061c33067576340115e57cb282fb86146f6a5#npm:5.62.0"],\ - ["@vscode/test-electron", "npm:2.3.4"],\ - ["eslint", "npm:8.49.0"],\ - ["glob", "npm:8.1.0"],\ - ["mocha", "npm:10.2.0"],\ - ["ts-loader", "virtual:114e6097baba06f1f7194aa147cc16af7c3daf193a49e5fc802ef9cf9d7ac56ceb0639593345639ab943707d850061c33067576340115e57cb282fb86146f6a5#npm:9.4.4"],\ - ["typescript", "patch:typescript@npm%3A5.2.2#~builtin::version=5.2.2&hash=f3b441"],\ - ["vscode-languageclient", "npm:8.1.0"],\ - ["webpack", "virtual:114e6097baba06f1f7194aa147cc16af7c3daf193a49e5fc802ef9cf9d7ac56ceb0639593345639ab943707d850061c33067576340115e57cb282fb86146f6a5#npm:5.88.2"],\ - ["webpack-cli", "virtual:114e6097baba06f1f7194aa147cc16af7c3daf193a49e5fc802ef9cf9d7ac56ceb0639593345639ab943707d850061c33067576340115e57cb282fb86146f6a5#npm:5.1.4"]\ - ],\ - "linkType": "SOFT"\ - }]\ - ]],\ - ["@osmium/manager", [\ - ["workspace:manager", {\ - "packageLocation": "./manager/",\ - "packageDependencies": [\ - ["@osmium/manager", "workspace:manager"]\ - ],\ - "linkType": "SOFT"\ - }]\ - ]],\ - ["@osmium/solidity-linter", [\ - ["workspace:toolchains/solidity/linter", {\ - "packageLocation": "./toolchains/solidity/linter/",\ - "packageDependencies": [\ - ["@osmium/solidity-linter", "workspace:toolchains/solidity/linter"]\ - ],\ - "linkType": "SOFT"\ - }]\ - ]],\ - ["@osmium/solidity-linter-core", [\ - ["workspace:toolchains/solidity/linter/core", {\ - "packageLocation": "./toolchains/solidity/linter/core/",\ - "packageDependencies": [\ - ["@osmium/solidity-linter-core", "workspace:toolchains/solidity/linter/core"]\ - ],\ - "linkType": "SOFT"\ - }]\ - ]],\ - ["@osmium/solidity-lsp", [\ - ["workspace:toolchains/solidity/lsp", {\ - "packageLocation": "./toolchains/solidity/lsp/",\ - "packageDependencies": [\ - ["@osmium/solidity-lsp", "workspace:toolchains/solidity/lsp"]\ - ],\ - "linkType": "SOFT"\ - }]\ - ]],\ ["@pkgjs/parseargs", [\ ["npm:0.11.0", {\ "packageLocation": "./.yarn/cache/@pkgjs-parseargs-npm-0.11.0-cd2a3fe948-6ad6a00fc4.zip/node_modules/@pkgjs/parseargs/",\ @@ -627,25 +558,25 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { ],\ "linkType": "SOFT"\ }],\ - ["virtual:114e6097baba06f1f7194aa147cc16af7c3daf193a49e5fc802ef9cf9d7ac56ceb0639593345639ab943707d850061c33067576340115e57cb282fb86146f6a5#npm:5.62.0", {\ - "packageLocation": "./.yarn/__virtual__/@typescript-eslint-eslint-plugin-virtual-3aca1ca164/0/cache/@typescript-eslint-eslint-plugin-npm-5.62.0-c48b9a5492-fc104b389c.zip/node_modules/@typescript-eslint/eslint-plugin/",\ + ["virtual:52255392bc7c855b3a7ca4b9b99f4d75a3b9d689264acbbe839776f76900c0302139aac1239332d2de96876e944fbdfcccf8eb06eedae6162f8c837cb3407ca8#npm:5.62.0", {\ + "packageLocation": "./.yarn/__virtual__/@typescript-eslint-eslint-plugin-virtual-886143a71d/0/cache/@typescript-eslint-eslint-plugin-npm-5.62.0-c48b9a5492-fc104b389c.zip/node_modules/@typescript-eslint/eslint-plugin/",\ "packageDependencies": [\ - ["@typescript-eslint/eslint-plugin", "virtual:114e6097baba06f1f7194aa147cc16af7c3daf193a49e5fc802ef9cf9d7ac56ceb0639593345639ab943707d850061c33067576340115e57cb282fb86146f6a5#npm:5.62.0"],\ + ["@typescript-eslint/eslint-plugin", "virtual:52255392bc7c855b3a7ca4b9b99f4d75a3b9d689264acbbe839776f76900c0302139aac1239332d2de96876e944fbdfcccf8eb06eedae6162f8c837cb3407ca8#npm:5.62.0"],\ ["@eslint-community/regexpp", "npm:4.8.0"],\ ["@types/eslint", null],\ ["@types/typescript", null],\ ["@types/typescript-eslint__parser", null],\ - ["@typescript-eslint/parser", "virtual:114e6097baba06f1f7194aa147cc16af7c3daf193a49e5fc802ef9cf9d7ac56ceb0639593345639ab943707d850061c33067576340115e57cb282fb86146f6a5#npm:5.62.0"],\ + ["@typescript-eslint/parser", "virtual:52255392bc7c855b3a7ca4b9b99f4d75a3b9d689264acbbe839776f76900c0302139aac1239332d2de96876e944fbdfcccf8eb06eedae6162f8c837cb3407ca8#npm:5.62.0"],\ ["@typescript-eslint/scope-manager", "npm:5.62.0"],\ - ["@typescript-eslint/type-utils", "virtual:3aca1ca16440e1ff7da0d6f5eed3f78efd0b8a2affea9a555b157df0fdba643060f7eef6665d606c0072b2d888384117b8c28f3e1839eba9cd360ad78efcb4d2#npm:5.62.0"],\ - ["@typescript-eslint/utils", "virtual:3aca1ca16440e1ff7da0d6f5eed3f78efd0b8a2affea9a555b157df0fdba643060f7eef6665d606c0072b2d888384117b8c28f3e1839eba9cd360ad78efcb4d2#npm:5.62.0"],\ + ["@typescript-eslint/type-utils", "virtual:886143a71dbd16c7dff857b41f76376562a0e00b73297c242842020b27304f674219cf3e7b9cfd86b31a507d7d2502a83c34027c7ed5757aa6c9457392679a04#npm:5.62.0"],\ + ["@typescript-eslint/utils", "virtual:886143a71dbd16c7dff857b41f76376562a0e00b73297c242842020b27304f674219cf3e7b9cfd86b31a507d7d2502a83c34027c7ed5757aa6c9457392679a04#npm:5.62.0"],\ ["debug", "virtual:ced87d94ab05a28b44536eb0cd61a9458e757a0ae7bb35e5ab5d27e03d08b996abd275928b29aad2eb0973d5bb0800e75ba8ca3e26bf62cbe8ea0fae8cca70a8#npm:4.3.4"],\ ["eslint", "npm:8.49.0"],\ ["graphemer", "npm:1.4.0"],\ ["ignore", "npm:5.2.4"],\ ["natural-compare-lite", "npm:1.4.0"],\ ["semver", "npm:7.5.4"],\ - ["tsutils", "virtual:3aca1ca16440e1ff7da0d6f5eed3f78efd0b8a2affea9a555b157df0fdba643060f7eef6665d606c0072b2d888384117b8c28f3e1839eba9cd360ad78efcb4d2#npm:3.21.0"],\ + ["tsutils", "virtual:886143a71dbd16c7dff857b41f76376562a0e00b73297c242842020b27304f674219cf3e7b9cfd86b31a507d7d2502a83c34027c7ed5757aa6c9457392679a04#npm:3.21.0"],\ ["typescript", "patch:typescript@npm%3A5.2.2#~builtin::version=5.2.2&hash=f3b441"]\ ],\ "packagePeers": [\ @@ -667,15 +598,15 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { ],\ "linkType": "SOFT"\ }],\ - ["virtual:114e6097baba06f1f7194aa147cc16af7c3daf193a49e5fc802ef9cf9d7ac56ceb0639593345639ab943707d850061c33067576340115e57cb282fb86146f6a5#npm:5.62.0", {\ - "packageLocation": "./.yarn/__virtual__/@typescript-eslint-parser-virtual-34b9bf55e1/0/cache/@typescript-eslint-parser-npm-5.62.0-c6b29fa302-d168f4c7f2.zip/node_modules/@typescript-eslint/parser/",\ + ["virtual:52255392bc7c855b3a7ca4b9b99f4d75a3b9d689264acbbe839776f76900c0302139aac1239332d2de96876e944fbdfcccf8eb06eedae6162f8c837cb3407ca8#npm:5.62.0", {\ + "packageLocation": "./.yarn/__virtual__/@typescript-eslint-parser-virtual-718019f438/0/cache/@typescript-eslint-parser-npm-5.62.0-c6b29fa302-d168f4c7f2.zip/node_modules/@typescript-eslint/parser/",\ "packageDependencies": [\ - ["@typescript-eslint/parser", "virtual:114e6097baba06f1f7194aa147cc16af7c3daf193a49e5fc802ef9cf9d7ac56ceb0639593345639ab943707d850061c33067576340115e57cb282fb86146f6a5#npm:5.62.0"],\ + ["@typescript-eslint/parser", "virtual:52255392bc7c855b3a7ca4b9b99f4d75a3b9d689264acbbe839776f76900c0302139aac1239332d2de96876e944fbdfcccf8eb06eedae6162f8c837cb3407ca8#npm:5.62.0"],\ ["@types/eslint", null],\ ["@types/typescript", null],\ ["@typescript-eslint/scope-manager", "npm:5.62.0"],\ ["@typescript-eslint/types", "npm:5.62.0"],\ - ["@typescript-eslint/typescript-estree", "virtual:09a32c5d05445519672e7033850acc14806599ea4e35ceaa13d5f96f4ca63755fceba3d6f7c6e23aa5ec1c9d607a5bed84c29c92a52c0d9190e407626c2343da#npm:5.62.0"],\ + ["@typescript-eslint/typescript-estree", "virtual:e501561d03359d3ad14358bb798a1c3e9b934095fed9debec78c49fa03a035928f77c41a677c9a4e2b1c3dc5b324d140accd38b981f2cb2a9e17165fbc0e0d02#npm:5.62.0"],\ ["debug", "virtual:ced87d94ab05a28b44536eb0cd61a9458e757a0ae7bb35e5ab5d27e03d08b996abd275928b29aad2eb0973d5bb0800e75ba8ca3e26bf62cbe8ea0fae8cca70a8#npm:4.3.4"],\ ["eslint", "npm:8.49.0"],\ ["typescript", "patch:typescript@npm%3A5.2.2#~builtin::version=5.2.2&hash=f3b441"]\ @@ -708,17 +639,17 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { ],\ "linkType": "SOFT"\ }],\ - ["virtual:3aca1ca16440e1ff7da0d6f5eed3f78efd0b8a2affea9a555b157df0fdba643060f7eef6665d606c0072b2d888384117b8c28f3e1839eba9cd360ad78efcb4d2#npm:5.62.0", {\ - "packageLocation": "./.yarn/__virtual__/@typescript-eslint-type-utils-virtual-09a32c5d05/0/cache/@typescript-eslint-type-utils-npm-5.62.0-220216d668-fc41eece5f.zip/node_modules/@typescript-eslint/type-utils/",\ + ["virtual:886143a71dbd16c7dff857b41f76376562a0e00b73297c242842020b27304f674219cf3e7b9cfd86b31a507d7d2502a83c34027c7ed5757aa6c9457392679a04#npm:5.62.0", {\ + "packageLocation": "./.yarn/__virtual__/@typescript-eslint-type-utils-virtual-e501561d03/0/cache/@typescript-eslint-type-utils-npm-5.62.0-220216d668-fc41eece5f.zip/node_modules/@typescript-eslint/type-utils/",\ "packageDependencies": [\ - ["@typescript-eslint/type-utils", "virtual:3aca1ca16440e1ff7da0d6f5eed3f78efd0b8a2affea9a555b157df0fdba643060f7eef6665d606c0072b2d888384117b8c28f3e1839eba9cd360ad78efcb4d2#npm:5.62.0"],\ + ["@typescript-eslint/type-utils", "virtual:886143a71dbd16c7dff857b41f76376562a0e00b73297c242842020b27304f674219cf3e7b9cfd86b31a507d7d2502a83c34027c7ed5757aa6c9457392679a04#npm:5.62.0"],\ ["@types/eslint", null],\ ["@types/typescript", null],\ - ["@typescript-eslint/typescript-estree", "virtual:09a32c5d05445519672e7033850acc14806599ea4e35ceaa13d5f96f4ca63755fceba3d6f7c6e23aa5ec1c9d607a5bed84c29c92a52c0d9190e407626c2343da#npm:5.62.0"],\ - ["@typescript-eslint/utils", "virtual:3aca1ca16440e1ff7da0d6f5eed3f78efd0b8a2affea9a555b157df0fdba643060f7eef6665d606c0072b2d888384117b8c28f3e1839eba9cd360ad78efcb4d2#npm:5.62.0"],\ + ["@typescript-eslint/typescript-estree", "virtual:e501561d03359d3ad14358bb798a1c3e9b934095fed9debec78c49fa03a035928f77c41a677c9a4e2b1c3dc5b324d140accd38b981f2cb2a9e17165fbc0e0d02#npm:5.62.0"],\ + ["@typescript-eslint/utils", "virtual:886143a71dbd16c7dff857b41f76376562a0e00b73297c242842020b27304f674219cf3e7b9cfd86b31a507d7d2502a83c34027c7ed5757aa6c9457392679a04#npm:5.62.0"],\ ["debug", "virtual:ced87d94ab05a28b44536eb0cd61a9458e757a0ae7bb35e5ab5d27e03d08b996abd275928b29aad2eb0973d5bb0800e75ba8ca3e26bf62cbe8ea0fae8cca70a8#npm:4.3.4"],\ ["eslint", "npm:8.49.0"],\ - ["tsutils", "virtual:3aca1ca16440e1ff7da0d6f5eed3f78efd0b8a2affea9a555b157df0fdba643060f7eef6665d606c0072b2d888384117b8c28f3e1839eba9cd360ad78efcb4d2#npm:3.21.0"],\ + ["tsutils", "virtual:886143a71dbd16c7dff857b41f76376562a0e00b73297c242842020b27304f674219cf3e7b9cfd86b31a507d7d2502a83c34027c7ed5757aa6c9457392679a04#npm:3.21.0"],\ ["typescript", "patch:typescript@npm%3A5.2.2#~builtin::version=5.2.2&hash=f3b441"]\ ],\ "packagePeers": [\ @@ -747,10 +678,10 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { ],\ "linkType": "SOFT"\ }],\ - ["virtual:09a32c5d05445519672e7033850acc14806599ea4e35ceaa13d5f96f4ca63755fceba3d6f7c6e23aa5ec1c9d607a5bed84c29c92a52c0d9190e407626c2343da#npm:5.62.0", {\ - "packageLocation": "./.yarn/__virtual__/@typescript-eslint-typescript-estree-virtual-7584c3ce67/0/cache/@typescript-eslint-typescript-estree-npm-5.62.0-5d1ea132a9-3624520abb.zip/node_modules/@typescript-eslint/typescript-estree/",\ + ["virtual:c5c581d9613c51eb3e937c55675dd6f39afb2a6747015ab1a2b5d7daaf0ad1388342b1c235a19f98c480d414c467cb6800bb05ed69c5c50c3af4b64d41b5a2ef#npm:5.62.0", {\ + "packageLocation": "./.yarn/__virtual__/@typescript-eslint-typescript-estree-virtual-1836c4b55e/0/cache/@typescript-eslint-typescript-estree-npm-5.62.0-5d1ea132a9-3624520abb.zip/node_modules/@typescript-eslint/typescript-estree/",\ "packageDependencies": [\ - ["@typescript-eslint/typescript-estree", "virtual:09a32c5d05445519672e7033850acc14806599ea4e35ceaa13d5f96f4ca63755fceba3d6f7c6e23aa5ec1c9d607a5bed84c29c92a52c0d9190e407626c2343da#npm:5.62.0"],\ + ["@typescript-eslint/typescript-estree", "virtual:c5c581d9613c51eb3e937c55675dd6f39afb2a6747015ab1a2b5d7daaf0ad1388342b1c235a19f98c480d414c467cb6800bb05ed69c5c50c3af4b64d41b5a2ef#npm:5.62.0"],\ ["@types/typescript", null],\ ["@typescript-eslint/types", "npm:5.62.0"],\ ["@typescript-eslint/visitor-keys", "npm:5.62.0"],\ @@ -758,8 +689,8 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { ["globby", "npm:11.1.0"],\ ["is-glob", "npm:4.0.3"],\ ["semver", "npm:7.5.4"],\ - ["tsutils", "virtual:3aca1ca16440e1ff7da0d6f5eed3f78efd0b8a2affea9a555b157df0fdba643060f7eef6665d606c0072b2d888384117b8c28f3e1839eba9cd360ad78efcb4d2#npm:3.21.0"],\ - ["typescript", "patch:typescript@npm%3A5.2.2#~builtin::version=5.2.2&hash=f3b441"]\ + ["tsutils", "virtual:1836c4b55e4791907b99a91792908a4e565ff351d6fe50457374c8344922cbd89593d0c9abd7d0ccd312021e4d197b4bea65df32526c387593eb4df73ba12425#npm:3.21.0"],\ + ["typescript", null]\ ],\ "packagePeers": [\ "@types/typescript",\ @@ -767,10 +698,10 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { ],\ "linkType": "HARD"\ }],\ - ["virtual:2485497fabb6561c5ed091b21a93f92081faec16bdf12fb8700f0c5d6f41a9885e0707015e3dd31bfa247fced0568c0befc65eeed5e2802607799a38721425d3#npm:5.62.0", {\ - "packageLocation": "./.yarn/__virtual__/@typescript-eslint-typescript-estree-virtual-3c24b03900/0/cache/@typescript-eslint-typescript-estree-npm-5.62.0-5d1ea132a9-3624520abb.zip/node_modules/@typescript-eslint/typescript-estree/",\ + ["virtual:e501561d03359d3ad14358bb798a1c3e9b934095fed9debec78c49fa03a035928f77c41a677c9a4e2b1c3dc5b324d140accd38b981f2cb2a9e17165fbc0e0d02#npm:5.62.0", {\ + "packageLocation": "./.yarn/__virtual__/@typescript-eslint-typescript-estree-virtual-ba38db7306/0/cache/@typescript-eslint-typescript-estree-npm-5.62.0-5d1ea132a9-3624520abb.zip/node_modules/@typescript-eslint/typescript-estree/",\ "packageDependencies": [\ - ["@typescript-eslint/typescript-estree", "virtual:2485497fabb6561c5ed091b21a93f92081faec16bdf12fb8700f0c5d6f41a9885e0707015e3dd31bfa247fced0568c0befc65eeed5e2802607799a38721425d3#npm:5.62.0"],\ + ["@typescript-eslint/typescript-estree", "virtual:e501561d03359d3ad14358bb798a1c3e9b934095fed9debec78c49fa03a035928f77c41a677c9a4e2b1c3dc5b324d140accd38b981f2cb2a9e17165fbc0e0d02#npm:5.62.0"],\ ["@types/typescript", null],\ ["@typescript-eslint/types", "npm:5.62.0"],\ ["@typescript-eslint/visitor-keys", "npm:5.62.0"],\ @@ -778,8 +709,8 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { ["globby", "npm:11.1.0"],\ ["is-glob", "npm:4.0.3"],\ ["semver", "npm:7.5.4"],\ - ["tsutils", "virtual:3c24b039002baf4da6de8f43a9856dedfe0870f0a250583774a5fe002029c55adf6dedcdc27b0c37b845157e72a671413cf99bdffefc9e78eecbe9051dc7da9a#npm:3.21.0"],\ - ["typescript", null]\ + ["tsutils", "virtual:886143a71dbd16c7dff857b41f76376562a0e00b73297c242842020b27304f674219cf3e7b9cfd86b31a507d7d2502a83c34027c7ed5757aa6c9457392679a04#npm:3.21.0"],\ + ["typescript", "patch:typescript@npm%3A5.2.2#~builtin::version=5.2.2&hash=f3b441"]\ ],\ "packagePeers": [\ "@types/typescript",\ @@ -796,17 +727,17 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { ],\ "linkType": "SOFT"\ }],\ - ["virtual:3aca1ca16440e1ff7da0d6f5eed3f78efd0b8a2affea9a555b157df0fdba643060f7eef6665d606c0072b2d888384117b8c28f3e1839eba9cd360ad78efcb4d2#npm:5.62.0", {\ - "packageLocation": "./.yarn/__virtual__/@typescript-eslint-utils-virtual-2485497fab/0/cache/@typescript-eslint-utils-npm-5.62.0-907f2d579e-ee9398c8c5.zip/node_modules/@typescript-eslint/utils/",\ + ["virtual:886143a71dbd16c7dff857b41f76376562a0e00b73297c242842020b27304f674219cf3e7b9cfd86b31a507d7d2502a83c34027c7ed5757aa6c9457392679a04#npm:5.62.0", {\ + "packageLocation": "./.yarn/__virtual__/@typescript-eslint-utils-virtual-c5c581d961/0/cache/@typescript-eslint-utils-npm-5.62.0-907f2d579e-ee9398c8c5.zip/node_modules/@typescript-eslint/utils/",\ "packageDependencies": [\ - ["@typescript-eslint/utils", "virtual:3aca1ca16440e1ff7da0d6f5eed3f78efd0b8a2affea9a555b157df0fdba643060f7eef6665d606c0072b2d888384117b8c28f3e1839eba9cd360ad78efcb4d2#npm:5.62.0"],\ + ["@typescript-eslint/utils", "virtual:886143a71dbd16c7dff857b41f76376562a0e00b73297c242842020b27304f674219cf3e7b9cfd86b31a507d7d2502a83c34027c7ed5757aa6c9457392679a04#npm:5.62.0"],\ ["@eslint-community/eslint-utils", "virtual:1b802e43a1d6cfd4888588e031e9b9539c10922666207f02b37e1572beffa71b5952c5b88bdcc1e2ff0080ea3baa9b39a63225d9ea667488d5ab782bed5718c7#npm:4.4.0"],\ ["@types/eslint", null],\ ["@types/json-schema", "npm:7.0.12"],\ ["@types/semver", "npm:7.5.1"],\ ["@typescript-eslint/scope-manager", "npm:5.62.0"],\ ["@typescript-eslint/types", "npm:5.62.0"],\ - ["@typescript-eslint/typescript-estree", "virtual:2485497fabb6561c5ed091b21a93f92081faec16bdf12fb8700f0c5d6f41a9885e0707015e3dd31bfa247fced0568c0befc65eeed5e2802607799a38721425d3#npm:5.62.0"],\ + ["@typescript-eslint/typescript-estree", "virtual:c5c581d9613c51eb3e937c55675dd6f39afb2a6747015ab1a2b5d7daaf0ad1388342b1c235a19f98c480d414c467cb6800bb05ed69c5c50c3af4b64d41b5a2ef#npm:5.62.0"],\ ["eslint", "npm:8.49.0"],\ ["eslint-scope", "npm:5.1.1"],\ ["semver", "npm:7.5.4"]\ @@ -1021,14 +952,14 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { ],\ "linkType": "SOFT"\ }],\ - ["virtual:8ad348135e0848a579c70b3c72ac45cb01fbea9f7615ac07352453f68ac778fe8e57c5e7134a509f01e2186e4b4a924a1d476017d220e3e47d4d5c59aca52d8f#npm:2.1.1", {\ - "packageLocation": "./.yarn/__virtual__/@webpack-cli-configtest-virtual-953a62b3fa/0/cache/@webpack-cli-configtest-npm-2.1.1-2aa637b6bc-9f9f9145c2.zip/node_modules/@webpack-cli/configtest/",\ + ["virtual:ad701b078cc2408c5791666f6d120096fd9f1cd66f63c26aaf307312ac91fee8153bad89ca107dc1f4886c4e5ab34def89b17331043d75175a43c752a58a41c5#npm:2.1.1", {\ + "packageLocation": "./.yarn/__virtual__/@webpack-cli-configtest-virtual-3280ca13e1/0/cache/@webpack-cli-configtest-npm-2.1.1-2aa637b6bc-9f9f9145c2.zip/node_modules/@webpack-cli/configtest/",\ "packageDependencies": [\ - ["@webpack-cli/configtest", "virtual:8ad348135e0848a579c70b3c72ac45cb01fbea9f7615ac07352453f68ac778fe8e57c5e7134a509f01e2186e4b4a924a1d476017d220e3e47d4d5c59aca52d8f#npm:2.1.1"],\ + ["@webpack-cli/configtest", "virtual:ad701b078cc2408c5791666f6d120096fd9f1cd66f63c26aaf307312ac91fee8153bad89ca107dc1f4886c4e5ab34def89b17331043d75175a43c752a58a41c5#npm:2.1.1"],\ ["@types/webpack", null],\ ["@types/webpack-cli", null],\ - ["webpack", "virtual:114e6097baba06f1f7194aa147cc16af7c3daf193a49e5fc802ef9cf9d7ac56ceb0639593345639ab943707d850061c33067576340115e57cb282fb86146f6a5#npm:5.88.2"],\ - ["webpack-cli", "virtual:114e6097baba06f1f7194aa147cc16af7c3daf193a49e5fc802ef9cf9d7ac56ceb0639593345639ab943707d850061c33067576340115e57cb282fb86146f6a5#npm:5.1.4"]\ + ["webpack", "virtual:52255392bc7c855b3a7ca4b9b99f4d75a3b9d689264acbbe839776f76900c0302139aac1239332d2de96876e944fbdfcccf8eb06eedae6162f8c837cb3407ca8#npm:5.88.2"],\ + ["webpack-cli", "virtual:52255392bc7c855b3a7ca4b9b99f4d75a3b9d689264acbbe839776f76900c0302139aac1239332d2de96876e944fbdfcccf8eb06eedae6162f8c837cb3407ca8#npm:5.1.4"]\ ],\ "packagePeers": [\ "@types/webpack-cli",\ @@ -1047,14 +978,14 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { ],\ "linkType": "SOFT"\ }],\ - ["virtual:8ad348135e0848a579c70b3c72ac45cb01fbea9f7615ac07352453f68ac778fe8e57c5e7134a509f01e2186e4b4a924a1d476017d220e3e47d4d5c59aca52d8f#npm:2.0.2", {\ - "packageLocation": "./.yarn/__virtual__/@webpack-cli-info-virtual-e8df45aa08/0/cache/@webpack-cli-info-npm-2.0.2-494be2e91a-8f9a178afc.zip/node_modules/@webpack-cli/info/",\ + ["virtual:ad701b078cc2408c5791666f6d120096fd9f1cd66f63c26aaf307312ac91fee8153bad89ca107dc1f4886c4e5ab34def89b17331043d75175a43c752a58a41c5#npm:2.0.2", {\ + "packageLocation": "./.yarn/__virtual__/@webpack-cli-info-virtual-bb374f0da2/0/cache/@webpack-cli-info-npm-2.0.2-494be2e91a-8f9a178afc.zip/node_modules/@webpack-cli/info/",\ "packageDependencies": [\ - ["@webpack-cli/info", "virtual:8ad348135e0848a579c70b3c72ac45cb01fbea9f7615ac07352453f68ac778fe8e57c5e7134a509f01e2186e4b4a924a1d476017d220e3e47d4d5c59aca52d8f#npm:2.0.2"],\ + ["@webpack-cli/info", "virtual:ad701b078cc2408c5791666f6d120096fd9f1cd66f63c26aaf307312ac91fee8153bad89ca107dc1f4886c4e5ab34def89b17331043d75175a43c752a58a41c5#npm:2.0.2"],\ ["@types/webpack", null],\ ["@types/webpack-cli", null],\ - ["webpack", "virtual:114e6097baba06f1f7194aa147cc16af7c3daf193a49e5fc802ef9cf9d7ac56ceb0639593345639ab943707d850061c33067576340115e57cb282fb86146f6a5#npm:5.88.2"],\ - ["webpack-cli", "virtual:114e6097baba06f1f7194aa147cc16af7c3daf193a49e5fc802ef9cf9d7ac56ceb0639593345639ab943707d850061c33067576340115e57cb282fb86146f6a5#npm:5.1.4"]\ + ["webpack", "virtual:52255392bc7c855b3a7ca4b9b99f4d75a3b9d689264acbbe839776f76900c0302139aac1239332d2de96876e944fbdfcccf8eb06eedae6162f8c837cb3407ca8#npm:5.88.2"],\ + ["webpack-cli", "virtual:52255392bc7c855b3a7ca4b9b99f4d75a3b9d689264acbbe839776f76900c0302139aac1239332d2de96876e944fbdfcccf8eb06eedae6162f8c837cb3407ca8#npm:5.1.4"]\ ],\ "packagePeers": [\ "@types/webpack-cli",\ @@ -1073,15 +1004,15 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { ],\ "linkType": "SOFT"\ }],\ - ["virtual:8ad348135e0848a579c70b3c72ac45cb01fbea9f7615ac07352453f68ac778fe8e57c5e7134a509f01e2186e4b4a924a1d476017d220e3e47d4d5c59aca52d8f#npm:2.0.5", {\ - "packageLocation": "./.yarn/__virtual__/@webpack-cli-serve-virtual-dd1f736c3f/0/cache/@webpack-cli-serve-npm-2.0.5-5a220c2601-75f0e54681.zip/node_modules/@webpack-cli/serve/",\ + ["virtual:ad701b078cc2408c5791666f6d120096fd9f1cd66f63c26aaf307312ac91fee8153bad89ca107dc1f4886c4e5ab34def89b17331043d75175a43c752a58a41c5#npm:2.0.5", {\ + "packageLocation": "./.yarn/__virtual__/@webpack-cli-serve-virtual-3174bf12f6/0/cache/@webpack-cli-serve-npm-2.0.5-5a220c2601-75f0e54681.zip/node_modules/@webpack-cli/serve/",\ "packageDependencies": [\ - ["@webpack-cli/serve", "virtual:8ad348135e0848a579c70b3c72ac45cb01fbea9f7615ac07352453f68ac778fe8e57c5e7134a509f01e2186e4b4a924a1d476017d220e3e47d4d5c59aca52d8f#npm:2.0.5"],\ + ["@webpack-cli/serve", "virtual:ad701b078cc2408c5791666f6d120096fd9f1cd66f63c26aaf307312ac91fee8153bad89ca107dc1f4886c4e5ab34def89b17331043d75175a43c752a58a41c5#npm:2.0.5"],\ ["@types/webpack", null],\ ["@types/webpack-cli", null],\ ["@types/webpack-dev-server", null],\ - ["webpack", "virtual:114e6097baba06f1f7194aa147cc16af7c3daf193a49e5fc802ef9cf9d7ac56ceb0639593345639ab943707d850061c33067576340115e57cb282fb86146f6a5#npm:5.88.2"],\ - ["webpack-cli", "virtual:114e6097baba06f1f7194aa147cc16af7c3daf193a49e5fc802ef9cf9d7ac56ceb0639593345639ab943707d850061c33067576340115e57cb282fb86146f6a5#npm:5.1.4"],\ + ["webpack", "virtual:52255392bc7c855b3a7ca4b9b99f4d75a3b9d689264acbbe839776f76900c0302139aac1239332d2de96876e944fbdfcccf8eb06eedae6162f8c837cb3407ca8#npm:5.88.2"],\ + ["webpack-cli", "virtual:52255392bc7c855b3a7ca4b9b99f4d75a3b9d689264acbbe839776f76900c0302139aac1239332d2de96876e944fbdfcccf8eb06eedae6162f8c837cb3407ca8#npm:5.1.4"],\ ["webpack-dev-server", null]\ ],\ "packagePeers": [\ @@ -1139,10 +1070,10 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { ],\ "linkType": "SOFT"\ }],\ - ["virtual:3ef4e983f64ff1a1e4c258f749269351ee3a43d8f85cba4f0b0f19708d052251a4e5cf013249fab72dce740ad98b16023faceb07b90994c348f059fa80742598#npm:1.9.0", {\ - "packageLocation": "./.yarn/__virtual__/acorn-import-assertions-virtual-3d8a833826/0/cache/acorn-import-assertions-npm-1.9.0-22f56507c7-944fb2659d.zip/node_modules/acorn-import-assertions/",\ + ["virtual:d9c05c4f9709e030529533d0ddfe05c0b547bb7476ef97252e4dbbccaae19c175fe286f7789e966bfc4890744043e3ec1e1e7c75b4e24776bd07cbed32cd0806#npm:1.9.0", {\ + "packageLocation": "./.yarn/__virtual__/acorn-import-assertions-virtual-2d1f9d4162/0/cache/acorn-import-assertions-npm-1.9.0-22f56507c7-944fb2659d.zip/node_modules/acorn-import-assertions/",\ "packageDependencies": [\ - ["acorn-import-assertions", "virtual:3ef4e983f64ff1a1e4c258f749269351ee3a43d8f85cba4f0b0f19708d052251a4e5cf013249fab72dce740ad98b16023faceb07b90994c348f059fa80742598#npm:1.9.0"],\ + ["acorn-import-assertions", "virtual:d9c05c4f9709e030529533d0ddfe05c0b547bb7476ef97252e4dbbccaae19c175fe286f7789e966bfc4890744043e3ec1e1e7c75b4e24776bd07cbed32cd0806#npm:1.9.0"],\ ["@types/acorn", null],\ ["acorn", "npm:8.10.0"]\ ],\ @@ -3264,6 +3195,75 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { "linkType": "SOFT"\ }]\ ]],\ + ["osmium-manager", [\ + ["workspace:manager", {\ + "packageLocation": "./manager/",\ + "packageDependencies": [\ + ["osmium-manager", "workspace:manager"]\ + ],\ + "linkType": "SOFT"\ + }]\ + ]],\ + ["osmium-solidity", [\ + ["workspace:toolchains/solidity", {\ + "packageLocation": "./toolchains/solidity/",\ + "packageDependencies": [\ + ["osmium-solidity", "workspace:toolchains/solidity"]\ + ],\ + "linkType": "SOFT"\ + }]\ + ]],\ + ["osmium-solidity-linter", [\ + ["workspace:toolchains/solidity/linter", {\ + "packageLocation": "./toolchains/solidity/linter/",\ + "packageDependencies": [\ + ["osmium-solidity-linter", "workspace:toolchains/solidity/linter"]\ + ],\ + "linkType": "SOFT"\ + }]\ + ]],\ + ["osmium-solidity-linter-core", [\ + ["workspace:toolchains/solidity/linter/core", {\ + "packageLocation": "./toolchains/solidity/linter/core/",\ + "packageDependencies": [\ + ["osmium-solidity-linter-core", "workspace:toolchains/solidity/linter/core"]\ + ],\ + "linkType": "SOFT"\ + }]\ + ]],\ + ["osmium-solidity-linter-extension", [\ + ["workspace:toolchains/solidity/linter/extension", {\ + "packageLocation": "./toolchains/solidity/linter/extension/",\ + "packageDependencies": [\ + ["osmium-solidity-linter-extension", "workspace:toolchains/solidity/linter/extension"],\ + ["@types/glob", "npm:8.1.0"],\ + ["@types/mocha", "npm:10.0.1"],\ + ["@types/node", "npm:20.2.5"],\ + ["@types/vscode", "npm:1.82.0"],\ + ["@typescript-eslint/eslint-plugin", "virtual:52255392bc7c855b3a7ca4b9b99f4d75a3b9d689264acbbe839776f76900c0302139aac1239332d2de96876e944fbdfcccf8eb06eedae6162f8c837cb3407ca8#npm:5.62.0"],\ + ["@typescript-eslint/parser", "virtual:52255392bc7c855b3a7ca4b9b99f4d75a3b9d689264acbbe839776f76900c0302139aac1239332d2de96876e944fbdfcccf8eb06eedae6162f8c837cb3407ca8#npm:5.62.0"],\ + ["@vscode/test-electron", "npm:2.3.4"],\ + ["eslint", "npm:8.49.0"],\ + ["glob", "npm:8.1.0"],\ + ["mocha", "npm:10.2.0"],\ + ["ts-loader", "virtual:52255392bc7c855b3a7ca4b9b99f4d75a3b9d689264acbbe839776f76900c0302139aac1239332d2de96876e944fbdfcccf8eb06eedae6162f8c837cb3407ca8#npm:9.4.4"],\ + ["typescript", "patch:typescript@npm%3A5.2.2#~builtin::version=5.2.2&hash=f3b441"],\ + ["vscode-languageclient", "npm:8.1.0"],\ + ["webpack", "virtual:52255392bc7c855b3a7ca4b9b99f4d75a3b9d689264acbbe839776f76900c0302139aac1239332d2de96876e944fbdfcccf8eb06eedae6162f8c837cb3407ca8#npm:5.88.2"],\ + ["webpack-cli", "virtual:52255392bc7c855b3a7ca4b9b99f4d75a3b9d689264acbbe839776f76900c0302139aac1239332d2de96876e944fbdfcccf8eb06eedae6162f8c837cb3407ca8#npm:5.1.4"]\ + ],\ + "linkType": "SOFT"\ + }]\ + ]],\ + ["osmium-solidity-lsp", [\ + ["workspace:toolchains/solidity/lsp", {\ + "packageLocation": "./toolchains/solidity/lsp/",\ + "packageDependencies": [\ + ["osmium-solidity-lsp", "workspace:toolchains/solidity/lsp"]\ + ],\ + "linkType": "SOFT"\ + }]\ + ]],\ ["p-limit", [\ ["npm:2.3.0", {\ "packageLocation": "./.yarn/cache/p-limit-npm-2.3.0-94a0310039-84ff17f1a3.zip/node_modules/p-limit/",\ @@ -3957,10 +3957,10 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { ],\ "linkType": "SOFT"\ }],\ - ["virtual:3ef4e983f64ff1a1e4c258f749269351ee3a43d8f85cba4f0b0f19708d052251a4e5cf013249fab72dce740ad98b16023faceb07b90994c348f059fa80742598#npm:5.3.9", {\ - "packageLocation": "./.yarn/__virtual__/terser-webpack-plugin-virtual-1f540bc554/0/cache/terser-webpack-plugin-npm-5.3.9-7ba1eb45f4-41705713d6.zip/node_modules/terser-webpack-plugin/",\ + ["virtual:d9c05c4f9709e030529533d0ddfe05c0b547bb7476ef97252e4dbbccaae19c175fe286f7789e966bfc4890744043e3ec1e1e7c75b4e24776bd07cbed32cd0806#npm:5.3.9", {\ + "packageLocation": "./.yarn/__virtual__/terser-webpack-plugin-virtual-0de9129109/0/cache/terser-webpack-plugin-npm-5.3.9-7ba1eb45f4-41705713d6.zip/node_modules/terser-webpack-plugin/",\ "packageDependencies": [\ - ["terser-webpack-plugin", "virtual:3ef4e983f64ff1a1e4c258f749269351ee3a43d8f85cba4f0b0f19708d052251a4e5cf013249fab72dce740ad98b16023faceb07b90994c348f059fa80742598#npm:5.3.9"],\ + ["terser-webpack-plugin", "virtual:d9c05c4f9709e030529533d0ddfe05c0b547bb7476ef97252e4dbbccaae19c175fe286f7789e966bfc4890744043e3ec1e1e7c75b4e24776bd07cbed32cd0806#npm:5.3.9"],\ ["@jridgewell/trace-mapping", "npm:0.3.19"],\ ["@swc/core", null],\ ["@types/esbuild", null],\ @@ -3973,7 +3973,7 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { ["serialize-javascript", "npm:6.0.1"],\ ["terser", "npm:5.19.4"],\ ["uglify-js", null],\ - ["webpack", "virtual:114e6097baba06f1f7194aa147cc16af7c3daf193a49e5fc802ef9cf9d7ac56ceb0639593345639ab943707d850061c33067576340115e57cb282fb86146f6a5#npm:5.88.2"]\ + ["webpack", "virtual:52255392bc7c855b3a7ca4b9b99f4d75a3b9d689264acbbe839776f76900c0302139aac1239332d2de96876e944fbdfcccf8eb06eedae6162f8c837cb3407ca8#npm:5.88.2"]\ ],\ "packagePeers": [\ "@swc/core",\ @@ -4015,10 +4015,10 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { ],\ "linkType": "SOFT"\ }],\ - ["virtual:114e6097baba06f1f7194aa147cc16af7c3daf193a49e5fc802ef9cf9d7ac56ceb0639593345639ab943707d850061c33067576340115e57cb282fb86146f6a5#npm:9.4.4", {\ - "packageLocation": "./.yarn/__virtual__/ts-loader-virtual-7c7f7426be/0/cache/ts-loader-npm-9.4.4-f7a7993559-8e5e6b839b.zip/node_modules/ts-loader/",\ + ["virtual:52255392bc7c855b3a7ca4b9b99f4d75a3b9d689264acbbe839776f76900c0302139aac1239332d2de96876e944fbdfcccf8eb06eedae6162f8c837cb3407ca8#npm:9.4.4", {\ + "packageLocation": "./.yarn/__virtual__/ts-loader-virtual-692e2115b3/0/cache/ts-loader-npm-9.4.4-f7a7993559-8e5e6b839b.zip/node_modules/ts-loader/",\ "packageDependencies": [\ - ["ts-loader", "virtual:114e6097baba06f1f7194aa147cc16af7c3daf193a49e5fc802ef9cf9d7ac56ceb0639593345639ab943707d850061c33067576340115e57cb282fb86146f6a5#npm:9.4.4"],\ + ["ts-loader", "virtual:52255392bc7c855b3a7ca4b9b99f4d75a3b9d689264acbbe839776f76900c0302139aac1239332d2de96876e944fbdfcccf8eb06eedae6162f8c837cb3407ca8#npm:9.4.4"],\ ["@types/typescript", null],\ ["@types/webpack", null],\ ["chalk", "npm:4.1.2"],\ @@ -4026,7 +4026,7 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { ["micromatch", "npm:4.0.5"],\ ["semver", "npm:7.5.4"],\ ["typescript", "patch:typescript@npm%3A5.2.2#~builtin::version=5.2.2&hash=f3b441"],\ - ["webpack", "virtual:114e6097baba06f1f7194aa147cc16af7c3daf193a49e5fc802ef9cf9d7ac56ceb0639593345639ab943707d850061c33067576340115e57cb282fb86146f6a5#npm:5.88.2"]\ + ["webpack", "virtual:52255392bc7c855b3a7ca4b9b99f4d75a3b9d689264acbbe839776f76900c0302139aac1239332d2de96876e944fbdfcccf8eb06eedae6162f8c837cb3407ca8#npm:5.88.2"]\ ],\ "packagePeers": [\ "@types/typescript",\ @@ -4054,13 +4054,13 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { ],\ "linkType": "SOFT"\ }],\ - ["virtual:3aca1ca16440e1ff7da0d6f5eed3f78efd0b8a2affea9a555b157df0fdba643060f7eef6665d606c0072b2d888384117b8c28f3e1839eba9cd360ad78efcb4d2#npm:3.21.0", {\ - "packageLocation": "./.yarn/__virtual__/tsutils-virtual-6eb87d37df/0/cache/tsutils-npm-3.21.0-347e6636c5-1843f4c1b2.zip/node_modules/tsutils/",\ + ["virtual:1836c4b55e4791907b99a91792908a4e565ff351d6fe50457374c8344922cbd89593d0c9abd7d0ccd312021e4d197b4bea65df32526c387593eb4df73ba12425#npm:3.21.0", {\ + "packageLocation": "./.yarn/__virtual__/tsutils-virtual-d01ee2c6e7/0/cache/tsutils-npm-3.21.0-347e6636c5-1843f4c1b2.zip/node_modules/tsutils/",\ "packageDependencies": [\ - ["tsutils", "virtual:3aca1ca16440e1ff7da0d6f5eed3f78efd0b8a2affea9a555b157df0fdba643060f7eef6665d606c0072b2d888384117b8c28f3e1839eba9cd360ad78efcb4d2#npm:3.21.0"],\ + ["tsutils", "virtual:1836c4b55e4791907b99a91792908a4e565ff351d6fe50457374c8344922cbd89593d0c9abd7d0ccd312021e4d197b4bea65df32526c387593eb4df73ba12425#npm:3.21.0"],\ ["@types/typescript", null],\ ["tslib", "npm:1.14.1"],\ - ["typescript", "patch:typescript@npm%3A5.2.2#~builtin::version=5.2.2&hash=f3b441"]\ + ["typescript", null]\ ],\ "packagePeers": [\ "@types/typescript",\ @@ -4068,13 +4068,13 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { ],\ "linkType": "HARD"\ }],\ - ["virtual:3c24b039002baf4da6de8f43a9856dedfe0870f0a250583774a5fe002029c55adf6dedcdc27b0c37b845157e72a671413cf99bdffefc9e78eecbe9051dc7da9a#npm:3.21.0", {\ - "packageLocation": "./.yarn/__virtual__/tsutils-virtual-188f559577/0/cache/tsutils-npm-3.21.0-347e6636c5-1843f4c1b2.zip/node_modules/tsutils/",\ + ["virtual:886143a71dbd16c7dff857b41f76376562a0e00b73297c242842020b27304f674219cf3e7b9cfd86b31a507d7d2502a83c34027c7ed5757aa6c9457392679a04#npm:3.21.0", {\ + "packageLocation": "./.yarn/__virtual__/tsutils-virtual-6fd84bff07/0/cache/tsutils-npm-3.21.0-347e6636c5-1843f4c1b2.zip/node_modules/tsutils/",\ "packageDependencies": [\ - ["tsutils", "virtual:3c24b039002baf4da6de8f43a9856dedfe0870f0a250583774a5fe002029c55adf6dedcdc27b0c37b845157e72a671413cf99bdffefc9e78eecbe9051dc7da9a#npm:3.21.0"],\ + ["tsutils", "virtual:886143a71dbd16c7dff857b41f76376562a0e00b73297c242842020b27304f674219cf3e7b9cfd86b31a507d7d2502a83c34027c7ed5757aa6c9457392679a04#npm:3.21.0"],\ ["@types/typescript", null],\ ["tslib", "npm:1.14.1"],\ - ["typescript", null]\ + ["typescript", "patch:typescript@npm%3A5.2.2#~builtin::version=5.2.2&hash=f3b441"]\ ],\ "packagePeers": [\ "@types/typescript",\ @@ -4234,10 +4234,10 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { ],\ "linkType": "SOFT"\ }],\ - ["virtual:114e6097baba06f1f7194aa147cc16af7c3daf193a49e5fc802ef9cf9d7ac56ceb0639593345639ab943707d850061c33067576340115e57cb282fb86146f6a5#npm:5.88.2", {\ - "packageLocation": "./.yarn/__virtual__/webpack-virtual-3ef4e983f6/0/cache/webpack-npm-5.88.2-38717ace6f-79476a782d.zip/node_modules/webpack/",\ + ["virtual:52255392bc7c855b3a7ca4b9b99f4d75a3b9d689264acbbe839776f76900c0302139aac1239332d2de96876e944fbdfcccf8eb06eedae6162f8c837cb3407ca8#npm:5.88.2", {\ + "packageLocation": "./.yarn/__virtual__/webpack-virtual-d9c05c4f97/0/cache/webpack-npm-5.88.2-38717ace6f-79476a782d.zip/node_modules/webpack/",\ "packageDependencies": [\ - ["webpack", "virtual:114e6097baba06f1f7194aa147cc16af7c3daf193a49e5fc802ef9cf9d7ac56ceb0639593345639ab943707d850061c33067576340115e57cb282fb86146f6a5#npm:5.88.2"],\ + ["webpack", "virtual:52255392bc7c855b3a7ca4b9b99f4d75a3b9d689264acbbe839776f76900c0302139aac1239332d2de96876e944fbdfcccf8eb06eedae6162f8c837cb3407ca8#npm:5.88.2"],\ ["@types/eslint-scope", "npm:3.7.4"],\ ["@types/estree", "npm:1.0.1"],\ ["@types/webpack-cli", null],\ @@ -4245,7 +4245,7 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { ["@webassemblyjs/wasm-edit", "npm:1.11.6"],\ ["@webassemblyjs/wasm-parser", "npm:1.11.6"],\ ["acorn", "npm:8.10.0"],\ - ["acorn-import-assertions", "virtual:3ef4e983f64ff1a1e4c258f749269351ee3a43d8f85cba4f0b0f19708d052251a4e5cf013249fab72dce740ad98b16023faceb07b90994c348f059fa80742598#npm:1.9.0"],\ + ["acorn-import-assertions", "virtual:d9c05c4f9709e030529533d0ddfe05c0b547bb7476ef97252e4dbbccaae19c175fe286f7789e966bfc4890744043e3ec1e1e7c75b4e24776bd07cbed32cd0806#npm:1.9.0"],\ ["browserslist", "npm:4.21.10"],\ ["chrome-trace-event", "npm:1.0.3"],\ ["enhanced-resolve", "npm:5.15.0"],\ @@ -4260,9 +4260,9 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { ["neo-async", "npm:2.6.2"],\ ["schema-utils", "npm:3.3.0"],\ ["tapable", "npm:2.2.1"],\ - ["terser-webpack-plugin", "virtual:3ef4e983f64ff1a1e4c258f749269351ee3a43d8f85cba4f0b0f19708d052251a4e5cf013249fab72dce740ad98b16023faceb07b90994c348f059fa80742598#npm:5.3.9"],\ + ["terser-webpack-plugin", "virtual:d9c05c4f9709e030529533d0ddfe05c0b547bb7476ef97252e4dbbccaae19c175fe286f7789e966bfc4890744043e3ec1e1e7c75b4e24776bd07cbed32cd0806#npm:5.3.9"],\ ["watchpack", "npm:2.4.0"],\ - ["webpack-cli", "virtual:114e6097baba06f1f7194aa147cc16af7c3daf193a49e5fc802ef9cf9d7ac56ceb0639593345639ab943707d850061c33067576340115e57cb282fb86146f6a5#npm:5.1.4"],\ + ["webpack-cli", "virtual:52255392bc7c855b3a7ca4b9b99f4d75a3b9d689264acbbe839776f76900c0302139aac1239332d2de96876e944fbdfcccf8eb06eedae6162f8c837cb3407ca8#npm:5.1.4"],\ ["webpack-sources", "npm:3.2.3"]\ ],\ "packagePeers": [\ @@ -4280,19 +4280,19 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { ],\ "linkType": "SOFT"\ }],\ - ["virtual:114e6097baba06f1f7194aa147cc16af7c3daf193a49e5fc802ef9cf9d7ac56ceb0639593345639ab943707d850061c33067576340115e57cb282fb86146f6a5#npm:5.1.4", {\ - "packageLocation": "./.yarn/__virtual__/webpack-cli-virtual-8ad348135e/0/cache/webpack-cli-npm-5.1.4-7be5b53b38-3a4ad0d034.zip/node_modules/webpack-cli/",\ + ["virtual:52255392bc7c855b3a7ca4b9b99f4d75a3b9d689264acbbe839776f76900c0302139aac1239332d2de96876e944fbdfcccf8eb06eedae6162f8c837cb3407ca8#npm:5.1.4", {\ + "packageLocation": "./.yarn/__virtual__/webpack-cli-virtual-ad701b078c/0/cache/webpack-cli-npm-5.1.4-7be5b53b38-3a4ad0d034.zip/node_modules/webpack-cli/",\ "packageDependencies": [\ - ["webpack-cli", "virtual:114e6097baba06f1f7194aa147cc16af7c3daf193a49e5fc802ef9cf9d7ac56ceb0639593345639ab943707d850061c33067576340115e57cb282fb86146f6a5#npm:5.1.4"],\ + ["webpack-cli", "virtual:52255392bc7c855b3a7ca4b9b99f4d75a3b9d689264acbbe839776f76900c0302139aac1239332d2de96876e944fbdfcccf8eb06eedae6162f8c837cb3407ca8#npm:5.1.4"],\ ["@discoveryjs/json-ext", "npm:0.5.7"],\ ["@types/webpack", null],\ ["@types/webpack-bundle-analyzer", null],\ ["@types/webpack-cli__generators", null],\ ["@types/webpack-dev-server", null],\ - ["@webpack-cli/configtest", "virtual:8ad348135e0848a579c70b3c72ac45cb01fbea9f7615ac07352453f68ac778fe8e57c5e7134a509f01e2186e4b4a924a1d476017d220e3e47d4d5c59aca52d8f#npm:2.1.1"],\ + ["@webpack-cli/configtest", "virtual:ad701b078cc2408c5791666f6d120096fd9f1cd66f63c26aaf307312ac91fee8153bad89ca107dc1f4886c4e5ab34def89b17331043d75175a43c752a58a41c5#npm:2.1.1"],\ ["@webpack-cli/generators", null],\ - ["@webpack-cli/info", "virtual:8ad348135e0848a579c70b3c72ac45cb01fbea9f7615ac07352453f68ac778fe8e57c5e7134a509f01e2186e4b4a924a1d476017d220e3e47d4d5c59aca52d8f#npm:2.0.2"],\ - ["@webpack-cli/serve", "virtual:8ad348135e0848a579c70b3c72ac45cb01fbea9f7615ac07352453f68ac778fe8e57c5e7134a509f01e2186e4b4a924a1d476017d220e3e47d4d5c59aca52d8f#npm:2.0.5"],\ + ["@webpack-cli/info", "virtual:ad701b078cc2408c5791666f6d120096fd9f1cd66f63c26aaf307312ac91fee8153bad89ca107dc1f4886c4e5ab34def89b17331043d75175a43c752a58a41c5#npm:2.0.2"],\ + ["@webpack-cli/serve", "virtual:ad701b078cc2408c5791666f6d120096fd9f1cd66f63c26aaf307312ac91fee8153bad89ca107dc1f4886c4e5ab34def89b17331043d75175a43c752a58a41c5#npm:2.0.5"],\ ["colorette", "npm:2.0.20"],\ ["commander", "npm:10.0.1"],\ ["cross-spawn", "npm:7.0.3"],\ @@ -4301,7 +4301,7 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { ["import-local", "npm:3.1.0"],\ ["interpret", "npm:3.1.1"],\ ["rechoir", "npm:0.8.0"],\ - ["webpack", "virtual:114e6097baba06f1f7194aa147cc16af7c3daf193a49e5fc802ef9cf9d7ac56ceb0639593345639ab943707d850061c33067576340115e57cb282fb86146f6a5#npm:5.88.2"],\ + ["webpack", "virtual:52255392bc7c855b3a7ca4b9b99f4d75a3b9d689264acbbe839776f76900c0302139aac1239332d2de96876e944fbdfcccf8eb06eedae6162f8c837cb3407ca8#npm:5.88.2"],\ ["webpack-bundle-analyzer", null],\ ["webpack-dev-server", null],\ ["webpack-merge", "npm:5.9.0"]\ diff --git a/yarn.lock b/yarn.lock index dd20b2aa..4da7d6e2 100644 --- a/yarn.lock +++ b/yarn.lock @@ -264,58 +264,6 @@ __metadata: languageName: unknown linkType: soft -"@osmium-toolchains/solidity-linter-extension@workspace:toolchains/solidity/linter/extension": - version: 0.0.0-use.local - resolution: "@osmium-toolchains/solidity-linter-extension@workspace:toolchains/solidity/linter/extension" - dependencies: - "@types/glob": ^8.1.0 - "@types/mocha": ^10.0.1 - "@types/node": 20.2.5 - "@types/vscode": ^1.82.0 - "@typescript-eslint/eslint-plugin": ^5.59.8 - "@typescript-eslint/parser": ^5.59.8 - "@vscode/test-electron": ^2.3.2 - eslint: ^8.41.0 - glob: ^8.1.0 - mocha: ^10.2.0 - ts-loader: ^9.4.3 - typescript: ^5.1.3 - vscode-languageclient: ^8.1.0 - webpack: ^5.85.0 - webpack-cli: ^5.1.1 - languageName: unknown - linkType: soft - -"@osmium-toolchains/solidity@workspace:toolchains/solidity": - version: 0.0.0-use.local - resolution: "@osmium-toolchains/solidity@workspace:toolchains/solidity" - languageName: unknown - linkType: soft - -"@osmium/manager@workspace:manager": - version: 0.0.0-use.local - resolution: "@osmium/manager@workspace:manager" - languageName: unknown - linkType: soft - -"@osmium/solidity-linter-core@workspace:toolchains/solidity/linter/core": - version: 0.0.0-use.local - resolution: "@osmium/solidity-linter-core@workspace:toolchains/solidity/linter/core" - languageName: unknown - linkType: soft - -"@osmium/solidity-linter@workspace:toolchains/solidity/linter": - version: 0.0.0-use.local - resolution: "@osmium/solidity-linter@workspace:toolchains/solidity/linter" - languageName: unknown - linkType: soft - -"@osmium/solidity-lsp@workspace:toolchains/solidity/lsp": - version: 0.0.0-use.local - resolution: "@osmium/solidity-lsp@workspace:toolchains/solidity/lsp" - languageName: unknown - linkType: soft - "@pkgjs/parseargs@npm:^0.11.0": version: 0.11.0 resolution: "@pkgjs/parseargs@npm:0.11.0" @@ -2633,6 +2581,58 @@ __metadata: languageName: node linkType: hard +"osmium-manager@workspace:manager": + version: 0.0.0-use.local + resolution: "osmium-manager@workspace:manager" + languageName: unknown + linkType: soft + +"osmium-solidity-linter-core@workspace:toolchains/solidity/linter/core": + version: 0.0.0-use.local + resolution: "osmium-solidity-linter-core@workspace:toolchains/solidity/linter/core" + languageName: unknown + linkType: soft + +"osmium-solidity-linter-extension@workspace:toolchains/solidity/linter/extension": + version: 0.0.0-use.local + resolution: "osmium-solidity-linter-extension@workspace:toolchains/solidity/linter/extension" + dependencies: + "@types/glob": ^8.1.0 + "@types/mocha": ^10.0.1 + "@types/node": 20.2.5 + "@types/vscode": ^1.82.0 + "@typescript-eslint/eslint-plugin": ^5.59.8 + "@typescript-eslint/parser": ^5.59.8 + "@vscode/test-electron": ^2.3.2 + eslint: ^8.41.0 + glob: ^8.1.0 + mocha: ^10.2.0 + ts-loader: ^9.4.3 + typescript: ^5.1.3 + vscode-languageclient: ^8.1.0 + webpack: ^5.85.0 + webpack-cli: ^5.1.1 + languageName: unknown + linkType: soft + +"osmium-solidity-linter@workspace:toolchains/solidity/linter": + version: 0.0.0-use.local + resolution: "osmium-solidity-linter@workspace:toolchains/solidity/linter" + languageName: unknown + linkType: soft + +"osmium-solidity-lsp@workspace:toolchains/solidity/lsp": + version: 0.0.0-use.local + resolution: "osmium-solidity-lsp@workspace:toolchains/solidity/lsp" + languageName: unknown + linkType: soft + +"osmium-solidity@workspace:toolchains/solidity": + version: 0.0.0-use.local + resolution: "osmium-solidity@workspace:toolchains/solidity" + languageName: unknown + linkType: soft + "osmium@workspace:.": version: 0.0.0-use.local resolution: "osmium@workspace:." From 24147cc68d544154c09e7977d685e10c725278eb Mon Sep 17 00:00:00 2001 From: 0xMemoryGrinder <35138272+0xMemoryGrinder@users.noreply.github.com> Date: Sat, 7 Oct 2023 15:03:10 -0400 Subject: [PATCH 126/325] ci: added necessary scripts and packages to publish extensions in CD --- .github/workflows/cd.yml | 4 +- .pnp.cjs | 885 ++++++++++++++++++ toolchains/solidity/linter/core/Cargo.lock | 4 +- toolchains/solidity/linter/core/package.json | 3 +- .../solidity/linter/extension/.vscodeignore | 1 + .../solidity/linter/extension/LICENSE.md | 675 +++++++++++++ .../solidity/linter/extension/README.md | 72 +- .../solidity/linter/extension/package.json | 6 +- .../linter/extension/src/extension.ts | 4 +- toolchains/solidity/linter/package.json | 3 +- yarn.lock | 811 +++++++++++++++- 11 files changed, 2383 insertions(+), 85 deletions(-) create mode 100644 toolchains/solidity/linter/extension/LICENSE.md diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index 3db0a0c0..03f80a17 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -101,7 +101,9 @@ jobs: yarn workspace ${{ matrix.workspace.name }} build - name: Publish - run: yarn workspace ${{ matrix.workspace.name }} dlx @vscode/vsce publish ${{ github.ref_name == 'dev' && '--pre-release' || '' }} ${{ steps.tag.outputs.result }} + run: yarn workspace ${{ matrix.workspace.name }} run publish ${{ github.ref_name == 'dev' && '--pre-release' || '' }} ${{ steps.tag.outputs.result }} + env: + VSCE_PAT: ${{ secrets.VSCE_PAT }} #- name: Run latest-tag # uses: EndBug/latest-tag@latest diff --git a/.pnp.cjs b/.pnp.cjs index bb821798..7b737fb6 100644 --- a/.pnp.cjs +++ b/.pnp.cjs @@ -773,6 +773,36 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { "linkType": "HARD"\ }]\ ]],\ + ["@vscode/vsce", [\ + ["npm:2.21.1", {\ + "packageLocation": "./.yarn/cache/@vscode-vsce-npm-2.21.1-51e6accf0d-d597d97683.zip/node_modules/@vscode/vsce/",\ + "packageDependencies": [\ + ["@vscode/vsce", "npm:2.21.1"],\ + ["azure-devops-node-api", "npm:11.2.0"],\ + ["chalk", "npm:2.4.2"],\ + ["cheerio", "npm:1.0.0-rc.12"],\ + ["commander", "npm:6.2.1"],\ + ["glob", "npm:7.2.3"],\ + ["hosted-git-info", "npm:4.1.0"],\ + ["jsonc-parser", "npm:3.2.0"],\ + ["keytar", "npm:7.9.0"],\ + ["leven", "npm:3.1.0"],\ + ["markdown-it", "npm:12.3.2"],\ + ["mime", "npm:1.6.0"],\ + ["minimatch", "npm:3.1.2"],\ + ["parse-semver", "npm:1.1.1"],\ + ["read", "npm:1.0.7"],\ + ["semver", "npm:7.5.4"],\ + ["tmp", "npm:0.2.1"],\ + ["typed-rest-client", "npm:1.8.11"],\ + ["url-join", "npm:4.0.1"],\ + ["xml2js", "npm:0.5.0"],\ + ["yauzl", "npm:2.10.0"],\ + ["yazl", "npm:2.5.1"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ ["@webassemblyjs/ast", [\ ["npm:1.11.6", {\ "packageLocation": "./.yarn/cache/@webassemblyjs-ast-npm-1.11.6-d3fd2bb49a-38ef1b526c.zip/node_modules/@webassemblyjs/ast/",\ @@ -1198,6 +1228,14 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { }]\ ]],\ ["ansi-styles", [\ + ["npm:3.2.1", {\ + "packageLocation": "./.yarn/cache/ansi-styles-npm-3.2.1-8cb8107983-d85ade01c1.zip/node_modules/ansi-styles/",\ + "packageDependencies": [\ + ["ansi-styles", "npm:3.2.1"],\ + ["color-convert", "npm:1.9.3"]\ + ],\ + "linkType": "HARD"\ + }],\ ["npm:4.3.0", {\ "packageLocation": "./.yarn/cache/ansi-styles-npm-4.3.0-245c7d42c7-513b44c3b2.zip/node_modules/ansi-styles/",\ "packageDependencies": [\ @@ -1263,6 +1301,17 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { "linkType": "HARD"\ }]\ ]],\ + ["azure-devops-node-api", [\ + ["npm:11.2.0", {\ + "packageLocation": "./.yarn/cache/azure-devops-node-api-npm-11.2.0-4f40e3421f-52e84379b4.zip/node_modules/azure-devops-node-api/",\ + "packageDependencies": [\ + ["azure-devops-node-api", "npm:11.2.0"],\ + ["tunnel", "npm:0.0.6"],\ + ["typed-rest-client", "npm:1.8.11"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ ["balanced-match", [\ ["npm:1.0.2", {\ "packageLocation": "./.yarn/cache/balanced-match-npm-1.0.2-a53c126459-9706c088a2.zip/node_modules/balanced-match/",\ @@ -1272,6 +1321,15 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { "linkType": "HARD"\ }]\ ]],\ + ["base64-js", [\ + ["npm:1.5.1", {\ + "packageLocation": "./.yarn/cache/base64-js-npm-1.5.1-b2f7275641-669632eb37.zip/node_modules/base64-js/",\ + "packageDependencies": [\ + ["base64-js", "npm:1.5.1"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ ["binary-extensions", [\ ["npm:2.2.0", {\ "packageLocation": "./.yarn/cache/binary-extensions-npm-2.2.0-180c33fec7-ccd267956c.zip/node_modules/binary-extensions/",\ @@ -1281,6 +1339,27 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { "linkType": "HARD"\ }]\ ]],\ + ["bl", [\ + ["npm:4.1.0", {\ + "packageLocation": "./.yarn/cache/bl-npm-4.1.0-7f94cdcf3f-9e8521fa7e.zip/node_modules/bl/",\ + "packageDependencies": [\ + ["bl", "npm:4.1.0"],\ + ["buffer", "npm:5.7.1"],\ + ["inherits", "npm:2.0.4"],\ + ["readable-stream", "npm:3.6.2"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["boolbase", [\ + ["npm:1.0.0", {\ + "packageLocation": "./.yarn/cache/boolbase-npm-1.0.0-965fe9af6d-3e25c80ef6.zip/node_modules/boolbase/",\ + "packageDependencies": [\ + ["boolbase", "npm:1.0.0"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ ["brace-expansion", [\ ["npm:1.1.11", {\ "packageLocation": "./.yarn/cache/brace-expansion-npm-1.1.11-fb95eb05ad-faf34a7bb0.zip/node_modules/brace-expansion/",\ @@ -1332,6 +1411,26 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { "linkType": "HARD"\ }]\ ]],\ + ["buffer", [\ + ["npm:5.7.1", {\ + "packageLocation": "./.yarn/cache/buffer-npm-5.7.1-513ef8259e-e2cf8429e1.zip/node_modules/buffer/",\ + "packageDependencies": [\ + ["buffer", "npm:5.7.1"],\ + ["base64-js", "npm:1.5.1"],\ + ["ieee754", "npm:1.2.1"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["buffer-crc32", [\ + ["npm:0.2.13", {\ + "packageLocation": "./.yarn/cache/buffer-crc32-npm-0.2.13-c4b6fceac1-06252347ae.zip/node_modules/buffer-crc32/",\ + "packageDependencies": [\ + ["buffer-crc32", "npm:0.2.13"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ ["buffer-from", [\ ["npm:1.1.2", {\ "packageLocation": "./.yarn/cache/buffer-from-npm-1.1.2-03d2f20d7e-0448524a56.zip/node_modules/buffer-from/",\ @@ -1362,6 +1461,17 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { "linkType": "HARD"\ }]\ ]],\ + ["call-bind", [\ + ["npm:1.0.2", {\ + "packageLocation": "./.yarn/cache/call-bind-npm-1.0.2-c957124861-f8e31de9d1.zip/node_modules/call-bind/",\ + "packageDependencies": [\ + ["call-bind", "npm:1.0.2"],\ + ["function-bind", "npm:1.1.1"],\ + ["get-intrinsic", "npm:1.2.1"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ ["callsites", [\ ["npm:3.1.0", {\ "packageLocation": "./.yarn/cache/callsites-npm-3.1.0-268f989910-072d17b6ab.zip/node_modules/callsites/",\ @@ -1390,6 +1500,16 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { }]\ ]],\ ["chalk", [\ + ["npm:2.4.2", {\ + "packageLocation": "./.yarn/cache/chalk-npm-2.4.2-3ea16dd91e-ec3661d38f.zip/node_modules/chalk/",\ + "packageDependencies": [\ + ["chalk", "npm:2.4.2"],\ + ["ansi-styles", "npm:3.2.1"],\ + ["escape-string-regexp", "npm:1.0.5"],\ + ["supports-color", "npm:5.5.0"]\ + ],\ + "linkType": "HARD"\ + }],\ ["npm:4.1.2", {\ "packageLocation": "./.yarn/cache/chalk-npm-4.1.2-ba8b67ab80-fe75c9d5c7.zip/node_modules/chalk/",\ "packageDependencies": [\ @@ -1400,6 +1520,37 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { "linkType": "HARD"\ }]\ ]],\ + ["cheerio", [\ + ["npm:1.0.0-rc.12", {\ + "packageLocation": "./.yarn/cache/cheerio-npm-1.0.0-rc.12-6785a97c2a-5d4c1b7a53.zip/node_modules/cheerio/",\ + "packageDependencies": [\ + ["cheerio", "npm:1.0.0-rc.12"],\ + ["cheerio-select", "npm:2.1.0"],\ + ["dom-serializer", "npm:2.0.0"],\ + ["domhandler", "npm:5.0.3"],\ + ["domutils", "npm:3.1.0"],\ + ["htmlparser2", "npm:8.0.2"],\ + ["parse5", "npm:7.1.2"],\ + ["parse5-htmlparser2-tree-adapter", "npm:7.0.0"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["cheerio-select", [\ + ["npm:2.1.0", {\ + "packageLocation": "./.yarn/cache/cheerio-select-npm-2.1.0-e92bc2f296-843d6d4799.zip/node_modules/cheerio-select/",\ + "packageDependencies": [\ + ["cheerio-select", "npm:2.1.0"],\ + ["boolbase", "npm:1.0.0"],\ + ["css-select", "npm:5.1.0"],\ + ["css-what", "npm:6.1.0"],\ + ["domelementtype", "npm:2.3.0"],\ + ["domhandler", "npm:5.0.3"],\ + ["domutils", "npm:3.1.0"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ ["chokidar", [\ ["npm:3.5.3", {\ "packageLocation": "./.yarn/cache/chokidar-npm-3.5.3-c5f9b0a56a-b49fcde401.zip/node_modules/chokidar/",\ @@ -1418,6 +1569,13 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { }]\ ]],\ ["chownr", [\ + ["npm:1.1.4", {\ + "packageLocation": "./.yarn/cache/chownr-npm-1.1.4-5bd400ab08-115648f8eb.zip/node_modules/chownr/",\ + "packageDependencies": [\ + ["chownr", "npm:1.1.4"]\ + ],\ + "linkType": "HARD"\ + }],\ ["npm:2.0.0", {\ "packageLocation": "./.yarn/cache/chownr-npm-2.0.0-638f1c9c61-c57cf9dd07.zip/node_modules/chownr/",\ "packageDependencies": [\ @@ -1469,6 +1627,14 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { }]\ ]],\ ["color-convert", [\ + ["npm:1.9.3", {\ + "packageLocation": "./.yarn/cache/color-convert-npm-1.9.3-1fe690075e-fd7a64a17c.zip/node_modules/color-convert/",\ + "packageDependencies": [\ + ["color-convert", "npm:1.9.3"],\ + ["color-name", "npm:1.1.3"]\ + ],\ + "linkType": "HARD"\ + }],\ ["npm:2.0.1", {\ "packageLocation": "./.yarn/cache/color-convert-npm-2.0.1-79730e935b-79e6bdb9fd.zip/node_modules/color-convert/",\ "packageDependencies": [\ @@ -1479,6 +1645,13 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { }]\ ]],\ ["color-name", [\ + ["npm:1.1.3", {\ + "packageLocation": "./.yarn/cache/color-name-npm-1.1.3-728b7b5d39-09c5d3e33d.zip/node_modules/color-name/",\ + "packageDependencies": [\ + ["color-name", "npm:1.1.3"]\ + ],\ + "linkType": "HARD"\ + }],\ ["npm:1.1.4", {\ "packageLocation": "./.yarn/cache/color-name-npm-1.1.4-025792b0ea-b044585952.zip/node_modules/color-name/",\ "packageDependencies": [\ @@ -1519,6 +1692,13 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { ["commander", "npm:2.20.3"]\ ],\ "linkType": "HARD"\ + }],\ + ["npm:6.2.1", {\ + "packageLocation": "./.yarn/cache/commander-npm-6.2.1-d5b635f237-d7090410c0.zip/node_modules/commander/",\ + "packageDependencies": [\ + ["commander", "npm:6.2.1"]\ + ],\ + "linkType": "HARD"\ }]\ ]],\ ["concat-map", [\ @@ -1560,6 +1740,29 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { "linkType": "HARD"\ }]\ ]],\ + ["css-select", [\ + ["npm:5.1.0", {\ + "packageLocation": "./.yarn/cache/css-select-npm-5.1.0-9365a79de5-2772c049b1.zip/node_modules/css-select/",\ + "packageDependencies": [\ + ["css-select", "npm:5.1.0"],\ + ["boolbase", "npm:1.0.0"],\ + ["css-what", "npm:6.1.0"],\ + ["domhandler", "npm:5.0.3"],\ + ["domutils", "npm:3.1.0"],\ + ["nth-check", "npm:2.1.1"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["css-what", [\ + ["npm:6.1.0", {\ + "packageLocation": "./.yarn/cache/css-what-npm-6.1.0-57f751efbb-b975e547e1.zip/node_modules/css-what/",\ + "packageDependencies": [\ + ["css-what", "npm:6.1.0"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ ["debug", [\ ["npm:4.3.4", {\ "packageLocation": "./.yarn/cache/debug-npm-4.3.4-4513954577-3dbad3f94e.zip/node_modules/debug/",\ @@ -1606,6 +1809,25 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { "linkType": "HARD"\ }]\ ]],\ + ["decompress-response", [\ + ["npm:6.0.0", {\ + "packageLocation": "./.yarn/cache/decompress-response-npm-6.0.0-359de2878c-d377cf47e0.zip/node_modules/decompress-response/",\ + "packageDependencies": [\ + ["decompress-response", "npm:6.0.0"],\ + ["mimic-response", "npm:3.1.0"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["deep-extend", [\ + ["npm:0.6.0", {\ + "packageLocation": "./.yarn/cache/deep-extend-npm-0.6.0-e182924219-7be7e5a8d4.zip/node_modules/deep-extend/",\ + "packageDependencies": [\ + ["deep-extend", "npm:0.6.0"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ ["deep-is", [\ ["npm:0.1.4", {\ "packageLocation": "./.yarn/cache/deep-is-npm-0.1.4-88938b5a67-edb65dd0d7.zip/node_modules/deep-is/",\ @@ -1624,6 +1846,15 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { "linkType": "HARD"\ }]\ ]],\ + ["detect-libc", [\ + ["npm:2.0.2", {\ + "packageLocation": "./.yarn/cache/detect-libc-npm-2.0.2-03afa59137-2b2cd3649b.zip/node_modules/detect-libc/",\ + "packageDependencies": [\ + ["detect-libc", "npm:2.0.2"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ ["diff", [\ ["npm:5.0.0", {\ "packageLocation": "./.yarn/cache/diff-npm-5.0.0-ad6900db18-f19fe29284.zip/node_modules/diff/",\ @@ -1653,6 +1884,49 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { "linkType": "HARD"\ }]\ ]],\ + ["dom-serializer", [\ + ["npm:2.0.0", {\ + "packageLocation": "./.yarn/cache/dom-serializer-npm-2.0.0-378ebc7200-cd1810544f.zip/node_modules/dom-serializer/",\ + "packageDependencies": [\ + ["dom-serializer", "npm:2.0.0"],\ + ["domelementtype", "npm:2.3.0"],\ + ["domhandler", "npm:5.0.3"],\ + ["entities", "npm:4.5.0"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["domelementtype", [\ + ["npm:2.3.0", {\ + "packageLocation": "./.yarn/cache/domelementtype-npm-2.3.0-02de7cbfba-ee837a318f.zip/node_modules/domelementtype/",\ + "packageDependencies": [\ + ["domelementtype", "npm:2.3.0"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["domhandler", [\ + ["npm:5.0.3", {\ + "packageLocation": "./.yarn/cache/domhandler-npm-5.0.3-3ede73dc10-0f58f4a6af.zip/node_modules/domhandler/",\ + "packageDependencies": [\ + ["domhandler", "npm:5.0.3"],\ + ["domelementtype", "npm:2.3.0"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["domutils", [\ + ["npm:3.1.0", {\ + "packageLocation": "./.yarn/cache/domutils-npm-3.1.0-66c92ef7eb-e5757456dd.zip/node_modules/domutils/",\ + "packageDependencies": [\ + ["domutils", "npm:3.1.0"],\ + ["dom-serializer", "npm:2.0.0"],\ + ["domelementtype", "npm:2.3.0"],\ + ["domhandler", "npm:5.0.3"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ ["eastasianwidth", [\ ["npm:0.2.0", {\ "packageLocation": "./.yarn/cache/eastasianwidth-npm-0.2.0-c37eb16bd1-7d00d7cd8e.zip/node_modules/eastasianwidth/",\ @@ -1697,6 +1971,16 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { "linkType": "HARD"\ }]\ ]],\ + ["end-of-stream", [\ + ["npm:1.4.4", {\ + "packageLocation": "./.yarn/cache/end-of-stream-npm-1.4.4-497fc6dee1-530a5a5a1e.zip/node_modules/end-of-stream/",\ + "packageDependencies": [\ + ["end-of-stream", "npm:1.4.4"],\ + ["once", "npm:1.4.0"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ ["enhanced-resolve", [\ ["npm:5.15.0", {\ "packageLocation": "./.yarn/cache/enhanced-resolve-npm-5.15.0-16eb7ddef9-fbd8cdc926.zip/node_modules/enhanced-resolve/",\ @@ -1708,6 +1992,22 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { "linkType": "HARD"\ }]\ ]],\ + ["entities", [\ + ["npm:2.1.0", {\ + "packageLocation": "./.yarn/cache/entities-npm-2.1.0-b27b8aebc6-a10a877e48.zip/node_modules/entities/",\ + "packageDependencies": [\ + ["entities", "npm:2.1.0"]\ + ],\ + "linkType": "HARD"\ + }],\ + ["npm:4.5.0", {\ + "packageLocation": "./.yarn/cache/entities-npm-4.5.0-7cdb83b832-853f8ebd5b.zip/node_modules/entities/",\ + "packageDependencies": [\ + ["entities", "npm:4.5.0"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ ["env-paths", [\ ["npm:2.2.1", {\ "packageLocation": "./.yarn/cache/env-paths-npm-2.2.1-7c7577428c-65b5df55a8.zip/node_modules/env-paths/",\ @@ -1754,6 +2054,13 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { }]\ ]],\ ["escape-string-regexp", [\ + ["npm:1.0.5", {\ + "packageLocation": "./.yarn/cache/escape-string-regexp-npm-1.0.5-3284de402f-6092fda75c.zip/node_modules/escape-string-regexp/",\ + "packageDependencies": [\ + ["escape-string-regexp", "npm:1.0.5"]\ + ],\ + "linkType": "HARD"\ + }],\ ["npm:4.0.0", {\ "packageLocation": "./.yarn/cache/escape-string-regexp-npm-4.0.0-4b531d8d59-98b48897d9.zip/node_modules/escape-string-regexp/",\ "packageDependencies": [\ @@ -1954,6 +2261,15 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { "linkType": "HARD"\ }]\ ]],\ + ["expand-template", [\ + ["npm:2.0.3", {\ + "packageLocation": "./.yarn/cache/expand-template-npm-2.0.3-80de959306-588c198472.zip/node_modules/expand-template/",\ + "packageDependencies": [\ + ["expand-template", "npm:2.0.3"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ ["exponential-backoff", [\ ["npm:3.1.1", {\ "packageLocation": "./.yarn/cache/exponential-backoff-npm-3.1.1-04df458b30-3d21519a4f.zip/node_modules/exponential-backoff/",\ @@ -2023,6 +2339,16 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { "linkType": "HARD"\ }]\ ]],\ + ["fd-slicer", [\ + ["npm:1.1.0", {\ + "packageLocation": "./.yarn/cache/fd-slicer-npm-1.1.0-3cade0050a-c8585fd571.zip/node_modules/fd-slicer/",\ + "packageDependencies": [\ + ["fd-slicer", "npm:1.1.0"],\ + ["pend", "npm:1.2.0"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ ["file-entry-cache", [\ ["npm:6.0.1", {\ "packageLocation": "./.yarn/cache/file-entry-cache-npm-6.0.1-31965cf0af-f49701feaa.zip/node_modules/file-entry-cache/",\ @@ -2103,6 +2429,15 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { "linkType": "HARD"\ }]\ ]],\ + ["fs-constants", [\ + ["npm:1.0.0", {\ + "packageLocation": "./.yarn/cache/fs-constants-npm-1.0.0-59576b2177-18f5b71837.zip/node_modules/fs-constants/",\ + "packageDependencies": [\ + ["fs-constants", "npm:1.0.0"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ ["fs-minipass", [\ ["npm:2.1.0", {\ "packageLocation": "./.yarn/cache/fs-minipass-npm-2.1.0-501ef87306-1b8d128dae.zip/node_modules/fs-minipass/",\ @@ -2175,6 +2510,28 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { "linkType": "HARD"\ }]\ ]],\ + ["get-intrinsic", [\ + ["npm:1.2.1", {\ + "packageLocation": "./.yarn/cache/get-intrinsic-npm-1.2.1-ae857fd610-5b61d88552.zip/node_modules/get-intrinsic/",\ + "packageDependencies": [\ + ["get-intrinsic", "npm:1.2.1"],\ + ["function-bind", "npm:1.1.1"],\ + ["has", "npm:1.0.3"],\ + ["has-proto", "npm:1.0.1"],\ + ["has-symbols", "npm:1.0.3"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["github-from-package", [\ + ["npm:0.0.0", {\ + "packageLocation": "./.yarn/cache/github-from-package-npm-0.0.0-519f80c9a1-14e448192a.zip/node_modules/github-from-package/",\ + "packageDependencies": [\ + ["github-from-package", "npm:0.0.0"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ ["glob", [\ ["npm:10.3.4", {\ "packageLocation": "./.yarn/cache/glob-npm-10.3.4-f58cd31f55-176b97c124.zip/node_modules/glob/",\ @@ -2308,6 +2665,13 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { }]\ ]],\ ["has-flag", [\ + ["npm:3.0.0", {\ + "packageLocation": "./.yarn/cache/has-flag-npm-3.0.0-16ac11fe05-4a15638b45.zip/node_modules/has-flag/",\ + "packageDependencies": [\ + ["has-flag", "npm:3.0.0"]\ + ],\ + "linkType": "HARD"\ + }],\ ["npm:4.0.0", {\ "packageLocation": "./.yarn/cache/has-flag-npm-4.0.0-32af9f0536-261a135703.zip/node_modules/has-flag/",\ "packageDependencies": [\ @@ -2316,6 +2680,24 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { "linkType": "HARD"\ }]\ ]],\ + ["has-proto", [\ + ["npm:1.0.1", {\ + "packageLocation": "./.yarn/cache/has-proto-npm-1.0.1-631ea9d820-febc5b5b53.zip/node_modules/has-proto/",\ + "packageDependencies": [\ + ["has-proto", "npm:1.0.1"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["has-symbols", [\ + ["npm:1.0.3", {\ + "packageLocation": "./.yarn/cache/has-symbols-npm-1.0.3-1986bff2c4-a054c40c63.zip/node_modules/has-symbols/",\ + "packageDependencies": [\ + ["has-symbols", "npm:1.0.3"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ ["has-unicode", [\ ["npm:2.0.1", {\ "packageLocation": "./.yarn/cache/has-unicode-npm-2.0.1-893adb4747-1eab07a743.zip/node_modules/has-unicode/",\ @@ -2334,6 +2716,29 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { "linkType": "HARD"\ }]\ ]],\ + ["hosted-git-info", [\ + ["npm:4.1.0", {\ + "packageLocation": "./.yarn/cache/hosted-git-info-npm-4.1.0-4efcdf8fd3-c3f87b3c2f.zip/node_modules/hosted-git-info/",\ + "packageDependencies": [\ + ["hosted-git-info", "npm:4.1.0"],\ + ["lru-cache", "npm:6.0.0"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["htmlparser2", [\ + ["npm:8.0.2", {\ + "packageLocation": "./.yarn/cache/htmlparser2-npm-8.0.2-5d9f901bb6-29167a0f92.zip/node_modules/htmlparser2/",\ + "packageDependencies": [\ + ["htmlparser2", "npm:8.0.2"],\ + ["domelementtype", "npm:2.3.0"],\ + ["domhandler", "npm:5.0.3"],\ + ["domutils", "npm:3.1.0"],\ + ["entities", "npm:4.5.0"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ ["http-cache-semantics", [\ ["npm:4.1.1", {\ "packageLocation": "./.yarn/cache/http-cache-semantics-npm-4.1.1-1120131375-83ac0bc60b.zip/node_modules/http-cache-semantics/",\ @@ -2405,6 +2810,15 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { "linkType": "HARD"\ }]\ ]],\ + ["ieee754", [\ + ["npm:1.2.1", {\ + "packageLocation": "./.yarn/cache/ieee754-npm-1.2.1-fb63b3caeb-5144c0c981.zip/node_modules/ieee754/",\ + "packageDependencies": [\ + ["ieee754", "npm:1.2.1"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ ["ignore", [\ ["npm:5.2.4", {\ "packageLocation": "./.yarn/cache/ignore-npm-5.2.4-fbe6e989e5-3d4c309c60.zip/node_modules/ignore/",\ @@ -2483,6 +2897,15 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { "linkType": "HARD"\ }]\ ]],\ + ["ini", [\ + ["npm:1.3.8", {\ + "packageLocation": "./.yarn/cache/ini-npm-1.3.8-fb5040b4c0-dfd98b0ca3.zip/node_modules/ini/",\ + "packageDependencies": [\ + ["ini", "npm:1.3.8"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ ["interpret", [\ ["npm:3.1.1", {\ "packageLocation": "./.yarn/cache/interpret-npm-3.1.1-715bac2bd7-35cebcf48c.zip/node_modules/interpret/",\ @@ -2691,6 +3114,15 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { "linkType": "HARD"\ }]\ ]],\ + ["jsonc-parser", [\ + ["npm:3.2.0", {\ + "packageLocation": "./.yarn/cache/jsonc-parser-npm-3.2.0-1896ece3b7-946dd9a5f3.zip/node_modules/jsonc-parser/",\ + "packageDependencies": [\ + ["jsonc-parser", "npm:3.2.0"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ ["jszip", [\ ["npm:3.10.1", {\ "packageLocation": "./.yarn/cache/jszip-npm-3.10.1-2862546cfb-abc77bfbe3.zip/node_modules/jszip/",\ @@ -2704,6 +3136,18 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { "linkType": "HARD"\ }]\ ]],\ + ["keytar", [\ + ["npm:7.9.0", {\ + "packageLocation": "./.yarn/unplugged/keytar-npm-7.9.0-682d6e5c1d/node_modules/keytar/",\ + "packageDependencies": [\ + ["keytar", "npm:7.9.0"],\ + ["node-addon-api", "npm:4.3.0"],\ + ["node-gyp", "npm:9.4.0"],\ + ["prebuild-install", "npm:7.1.1"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ ["kind-of", [\ ["npm:6.0.3", {\ "packageLocation": "./.yarn/cache/kind-of-npm-6.0.3-ab15f36220-3ab01e7b1d.zip/node_modules/kind-of/",\ @@ -2713,6 +3157,15 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { "linkType": "HARD"\ }]\ ]],\ + ["leven", [\ + ["npm:3.1.0", {\ + "packageLocation": "./.yarn/cache/leven-npm-3.1.0-b7697736a3-638401d534.zip/node_modules/leven/",\ + "packageDependencies": [\ + ["leven", "npm:3.1.0"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ ["levn", [\ ["npm:0.4.1", {\ "packageLocation": "./.yarn/cache/levn-npm-0.4.1-d183b2d7bb-12c5021c85.zip/node_modules/levn/",\ @@ -2734,6 +3187,16 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { "linkType": "HARD"\ }]\ ]],\ + ["linkify-it", [\ + ["npm:3.0.3", {\ + "packageLocation": "./.yarn/cache/linkify-it-npm-3.0.3-6880fe29c1-31367a4bb7.zip/node_modules/linkify-it/",\ + "packageDependencies": [\ + ["linkify-it", "npm:3.0.3"],\ + ["uc.micro", "npm:1.0.6"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ ["loader-runner", [\ ["npm:4.3.0", {\ "packageLocation": "./.yarn/cache/loader-runner-npm-4.3.0-9ca67df372-a90e00dee9.zip/node_modules/loader-runner/",\ @@ -2829,6 +3292,29 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { "linkType": "HARD"\ }]\ ]],\ + ["markdown-it", [\ + ["npm:12.3.2", {\ + "packageLocation": "./.yarn/cache/markdown-it-npm-12.3.2-6c66b716e8-890555711c.zip/node_modules/markdown-it/",\ + "packageDependencies": [\ + ["markdown-it", "npm:12.3.2"],\ + ["argparse", "npm:2.0.1"],\ + ["entities", "npm:2.1.0"],\ + ["linkify-it", "npm:3.0.3"],\ + ["mdurl", "npm:1.0.1"],\ + ["uc.micro", "npm:1.0.6"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["mdurl", [\ + ["npm:1.0.1", {\ + "packageLocation": "./.yarn/cache/mdurl-npm-1.0.1-054d974269-71731ecba9.zip/node_modules/mdurl/",\ + "packageDependencies": [\ + ["mdurl", "npm:1.0.1"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ ["merge-stream", [\ ["npm:2.0.0", {\ "packageLocation": "./.yarn/cache/merge-stream-npm-2.0.0-2ac83efea5-6fa4dcc8d8.zip/node_modules/merge-stream/",\ @@ -2858,6 +3344,15 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { "linkType": "HARD"\ }]\ ]],\ + ["mime", [\ + ["npm:1.6.0", {\ + "packageLocation": "./.yarn/cache/mime-npm-1.6.0-60ae95038a-fef25e3926.zip/node_modules/mime/",\ + "packageDependencies": [\ + ["mime", "npm:1.6.0"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ ["mime-db", [\ ["npm:1.52.0", {\ "packageLocation": "./.yarn/cache/mime-db-npm-1.52.0-b5371d6fd2-0d99a03585.zip/node_modules/mime-db/",\ @@ -2877,6 +3372,15 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { "linkType": "HARD"\ }]\ ]],\ + ["mimic-response", [\ + ["npm:3.1.0", {\ + "packageLocation": "./.yarn/cache/mimic-response-npm-3.1.0-a4a24b4e96-25739fee32.zip/node_modules/mimic-response/",\ + "packageDependencies": [\ + ["mimic-response", "npm:3.1.0"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ ["minimatch", [\ ["npm:3.1.2", {\ "packageLocation": "./.yarn/cache/minimatch-npm-3.1.2-9405269906-c154e56640.zip/node_modules/minimatch/",\ @@ -2911,6 +3415,15 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { "linkType": "HARD"\ }]\ ]],\ + ["minimist", [\ + ["npm:1.2.8", {\ + "packageLocation": "./.yarn/cache/minimist-npm-1.2.8-d7af7b1dce-75a6d645fb.zip/node_modules/minimist/",\ + "packageDependencies": [\ + ["minimist", "npm:1.2.8"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ ["minipass", [\ ["npm:3.3.6", {\ "packageLocation": "./.yarn/cache/minipass-npm-3.3.6-b8d93a945b-a30d083c80.zip/node_modules/minipass/",\ @@ -3008,6 +3521,15 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { "linkType": "HARD"\ }]\ ]],\ + ["mkdirp-classic", [\ + ["npm:0.5.3", {\ + "packageLocation": "./.yarn/cache/mkdirp-classic-npm-0.5.3-3b5c991910-3f4e088208.zip/node_modules/mkdirp-classic/",\ + "packageDependencies": [\ + ["mkdirp-classic", "npm:0.5.3"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ ["mocha", [\ ["npm:10.2.0", {\ "packageLocation": "./.yarn/cache/mocha-npm-10.2.0-87db25c7c5-406c45eab1.zip/node_modules/mocha/",\ @@ -3054,6 +3576,15 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { "linkType": "HARD"\ }]\ ]],\ + ["mute-stream", [\ + ["npm:0.0.8", {\ + "packageLocation": "./.yarn/cache/mute-stream-npm-0.0.8-489a7d6c2b-ff48d251fc.zip/node_modules/mute-stream/",\ + "packageDependencies": [\ + ["mute-stream", "npm:0.0.8"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ ["nanoid", [\ ["npm:3.3.3", {\ "packageLocation": "./.yarn/cache/nanoid-npm-3.3.3-25d865be84-ada019402a.zip/node_modules/nanoid/",\ @@ -3063,6 +3594,15 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { "linkType": "HARD"\ }]\ ]],\ + ["napi-build-utils", [\ + ["npm:1.0.2", {\ + "packageLocation": "./.yarn/cache/napi-build-utils-npm-1.0.2-892e4bba56-06c14271ee.zip/node_modules/napi-build-utils/",\ + "packageDependencies": [\ + ["napi-build-utils", "npm:1.0.2"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ ["natural-compare", [\ ["npm:1.4.0", {\ "packageLocation": "./.yarn/cache/natural-compare-npm-1.4.0-97b75b362d-23ad088b08.zip/node_modules/natural-compare/",\ @@ -3099,6 +3639,26 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { "linkType": "HARD"\ }]\ ]],\ + ["node-abi", [\ + ["npm:3.47.0", {\ + "packageLocation": "./.yarn/cache/node-abi-npm-3.47.0-9d2a86a633-ff8498dcd4.zip/node_modules/node-abi/",\ + "packageDependencies": [\ + ["node-abi", "npm:3.47.0"],\ + ["semver", "npm:7.5.4"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["node-addon-api", [\ + ["npm:4.3.0", {\ + "packageLocation": "./.yarn/unplugged/node-addon-api-npm-4.3.0-a07a1232df/node_modules/node-addon-api/",\ + "packageDependencies": [\ + ["node-addon-api", "npm:4.3.0"],\ + ["node-gyp", "npm:9.4.0"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ ["node-gyp", [\ ["npm:9.4.0", {\ "packageLocation": "./.yarn/unplugged/node-gyp-npm-9.4.0-ebf5f5573e/node_modules/node-gyp/",\ @@ -3160,6 +3720,25 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { "linkType": "HARD"\ }]\ ]],\ + ["nth-check", [\ + ["npm:2.1.1", {\ + "packageLocation": "./.yarn/cache/nth-check-npm-2.1.1-f97afc8169-5afc3dafcd.zip/node_modules/nth-check/",\ + "packageDependencies": [\ + ["nth-check", "npm:2.1.1"],\ + ["boolbase", "npm:1.0.0"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["object-inspect", [\ + ["npm:1.12.3", {\ + "packageLocation": "./.yarn/cache/object-inspect-npm-1.12.3-1e7d20f5ff-dabfd824d9.zip/node_modules/object-inspect/",\ + "packageDependencies": [\ + ["object-inspect", "npm:1.12.3"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ ["once", [\ ["npm:1.4.0", {\ "packageLocation": "./.yarn/cache/once-npm-1.4.0-ccf03ef07a-cd0a885013.zip/node_modules/once/",\ @@ -3243,6 +3822,7 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { ["@typescript-eslint/eslint-plugin", "virtual:52255392bc7c855b3a7ca4b9b99f4d75a3b9d689264acbbe839776f76900c0302139aac1239332d2de96876e944fbdfcccf8eb06eedae6162f8c837cb3407ca8#npm:5.62.0"],\ ["@typescript-eslint/parser", "virtual:52255392bc7c855b3a7ca4b9b99f4d75a3b9d689264acbbe839776f76900c0302139aac1239332d2de96876e944fbdfcccf8eb06eedae6162f8c837cb3407ca8#npm:5.62.0"],\ ["@vscode/test-electron", "npm:2.3.4"],\ + ["@vscode/vsce", "npm:2.21.1"],\ ["eslint", "npm:8.49.0"],\ ["glob", "npm:8.1.0"],\ ["mocha", "npm:10.2.0"],\ @@ -3338,6 +3918,37 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { "linkType": "HARD"\ }]\ ]],\ + ["parse-semver", [\ + ["npm:1.1.1", {\ + "packageLocation": "./.yarn/cache/parse-semver-npm-1.1.1-45d28f8138-0a9abc24b8.zip/node_modules/parse-semver/",\ + "packageDependencies": [\ + ["parse-semver", "npm:1.1.1"],\ + ["semver", "npm:5.7.2"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["parse5", [\ + ["npm:7.1.2", {\ + "packageLocation": "./.yarn/cache/parse5-npm-7.1.2-aa9a92c270-59465dd05e.zip/node_modules/parse5/",\ + "packageDependencies": [\ + ["parse5", "npm:7.1.2"],\ + ["entities", "npm:4.5.0"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["parse5-htmlparser2-tree-adapter", [\ + ["npm:7.0.0", {\ + "packageLocation": "./.yarn/cache/parse5-htmlparser2-tree-adapter-npm-7.0.0-38e1b3a974-fc5d01e077.zip/node_modules/parse5-htmlparser2-tree-adapter/",\ + "packageDependencies": [\ + ["parse5-htmlparser2-tree-adapter", "npm:7.0.0"],\ + ["domhandler", "npm:5.0.3"],\ + ["parse5", "npm:7.1.2"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ ["path-exists", [\ ["npm:4.0.0", {\ "packageLocation": "./.yarn/cache/path-exists-npm-4.0.0-e9e4f63eb0-505807199d.zip/node_modules/path-exists/",\ @@ -3394,6 +4005,15 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { "linkType": "HARD"\ }]\ ]],\ + ["pend", [\ + ["npm:1.2.0", {\ + "packageLocation": "./.yarn/cache/pend-npm-1.2.0-7a13d93266-6c72f52433.zip/node_modules/pend/",\ + "packageDependencies": [\ + ["pend", "npm:1.2.0"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ ["picocolors", [\ ["npm:1.0.0", {\ "packageLocation": "./.yarn/cache/picocolors-npm-1.0.0-d81e0b1927-a2e8092dd8.zip/node_modules/picocolors/",\ @@ -3422,6 +4042,27 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { "linkType": "HARD"\ }]\ ]],\ + ["prebuild-install", [\ + ["npm:7.1.1", {\ + "packageLocation": "./.yarn/cache/prebuild-install-npm-7.1.1-cb9fc9d341-dbf96d0146.zip/node_modules/prebuild-install/",\ + "packageDependencies": [\ + ["prebuild-install", "npm:7.1.1"],\ + ["detect-libc", "npm:2.0.2"],\ + ["expand-template", "npm:2.0.3"],\ + ["github-from-package", "npm:0.0.0"],\ + ["minimist", "npm:1.2.8"],\ + ["mkdirp-classic", "npm:0.5.3"],\ + ["napi-build-utils", "npm:1.0.2"],\ + ["node-abi", "npm:3.47.0"],\ + ["pump", "npm:3.0.0"],\ + ["rc", "npm:1.2.8"],\ + ["simple-get", "npm:4.0.1"],\ + ["tar-fs", "npm:2.1.1"],\ + ["tunnel-agent", "npm:0.6.0"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ ["prelude-ls", [\ ["npm:1.2.1", {\ "packageLocation": "./.yarn/cache/prelude-ls-npm-1.2.1-3e4d272a55-cd192ec0d0.zip/node_modules/prelude-ls/",\ @@ -3460,6 +4101,17 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { "linkType": "HARD"\ }]\ ]],\ + ["pump", [\ + ["npm:3.0.0", {\ + "packageLocation": "./.yarn/cache/pump-npm-3.0.0-0080bf6a7a-e42e9229fb.zip/node_modules/pump/",\ + "packageDependencies": [\ + ["pump", "npm:3.0.0"],\ + ["end-of-stream", "npm:1.4.4"],\ + ["once", "npm:1.4.0"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ ["punycode", [\ ["npm:2.3.0", {\ "packageLocation": "./.yarn/cache/punycode-npm-2.3.0-df4bdce06b-39f760e09a.zip/node_modules/punycode/",\ @@ -3469,6 +4121,16 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { "linkType": "HARD"\ }]\ ]],\ + ["qs", [\ + ["npm:6.11.2", {\ + "packageLocation": "./.yarn/cache/qs-npm-6.11.2-b118bc1c6f-e812f3c590.zip/node_modules/qs/",\ + "packageDependencies": [\ + ["qs", "npm:6.11.2"],\ + ["side-channel", "npm:1.0.4"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ ["queue-microtask", [\ ["npm:1.2.3", {\ "packageLocation": "./.yarn/cache/queue-microtask-npm-1.2.3-fcc98e4e2d-b676f8c040.zip/node_modules/queue-microtask/",\ @@ -3488,6 +4150,29 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { "linkType": "HARD"\ }]\ ]],\ + ["rc", [\ + ["npm:1.2.8", {\ + "packageLocation": "./.yarn/cache/rc-npm-1.2.8-d6768ac936-2e26e052f8.zip/node_modules/rc/",\ + "packageDependencies": [\ + ["rc", "npm:1.2.8"],\ + ["deep-extend", "npm:0.6.0"],\ + ["ini", "npm:1.3.8"],\ + ["minimist", "npm:1.2.8"],\ + ["strip-json-comments", "npm:2.0.1"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["read", [\ + ["npm:1.0.7", {\ + "packageLocation": "./.yarn/cache/read-npm-1.0.7-950ec74ca8-2777c254e5.zip/node_modules/read/",\ + "packageDependencies": [\ + ["read", "npm:1.0.7"],\ + ["mute-stream", "npm:0.0.8"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ ["readable-stream", [\ ["npm:2.3.8", {\ "packageLocation": "./.yarn/cache/readable-stream-npm-2.3.8-67a94c2cb1-6564546703.zip/node_modules/readable-stream/",\ @@ -3644,6 +4329,15 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { "linkType": "HARD"\ }]\ ]],\ + ["sax", [\ + ["npm:1.3.0", {\ + "packageLocation": "./.yarn/cache/sax-npm-1.3.0-e6c479267f-238ab3a9ba.zip/node_modules/sax/",\ + "packageDependencies": [\ + ["sax", "npm:1.3.0"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ ["schema-utils", [\ ["npm:3.3.0", {\ "packageLocation": "./.yarn/cache/schema-utils-npm-3.3.0-f2b36937f1-ea56971926.zip/node_modules/schema-utils/",\ @@ -3657,6 +4351,13 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { }]\ ]],\ ["semver", [\ + ["npm:5.7.2", {\ + "packageLocation": "./.yarn/cache/semver-npm-5.7.2-938ee91eaa-fb4ab5e0dd.zip/node_modules/semver/",\ + "packageDependencies": [\ + ["semver", "npm:5.7.2"]\ + ],\ + "linkType": "HARD"\ + }],\ ["npm:7.5.4", {\ "packageLocation": "./.yarn/cache/semver-npm-7.5.4-c4ad957fcd-12d8ad952f.zip/node_modules/semver/",\ "packageDependencies": [\ @@ -3731,6 +4432,18 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { "linkType": "HARD"\ }]\ ]],\ + ["side-channel", [\ + ["npm:1.0.4", {\ + "packageLocation": "./.yarn/cache/side-channel-npm-1.0.4-e1f38b9e06-351e41b947.zip/node_modules/side-channel/",\ + "packageDependencies": [\ + ["side-channel", "npm:1.0.4"],\ + ["call-bind", "npm:1.0.2"],\ + ["get-intrinsic", "npm:1.2.1"],\ + ["object-inspect", "npm:1.12.3"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ ["signal-exit", [\ ["npm:3.0.7", {\ "packageLocation": "./.yarn/cache/signal-exit-npm-3.0.7-bd270458a3-a2f098f247.zip/node_modules/signal-exit/",\ @@ -3747,6 +4460,27 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { "linkType": "HARD"\ }]\ ]],\ + ["simple-concat", [\ + ["npm:1.0.1", {\ + "packageLocation": "./.yarn/cache/simple-concat-npm-1.0.1-48df70de29-4d211042cc.zip/node_modules/simple-concat/",\ + "packageDependencies": [\ + ["simple-concat", "npm:1.0.1"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["simple-get", [\ + ["npm:4.0.1", {\ + "packageLocation": "./.yarn/cache/simple-get-npm-4.0.1-fa2a97645d-e4132fd27c.zip/node_modules/simple-get/",\ + "packageDependencies": [\ + ["simple-get", "npm:4.0.1"],\ + ["decompress-response", "npm:6.0.0"],\ + ["once", "npm:1.4.0"],\ + ["simple-concat", "npm:1.0.1"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ ["slash", [\ ["npm:3.0.0", {\ "packageLocation": "./.yarn/cache/slash-npm-3.0.0-b87de2279a-94a93fff61.zip/node_modules/slash/",\ @@ -3877,6 +4611,13 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { }]\ ]],\ ["strip-json-comments", [\ + ["npm:2.0.1", {\ + "packageLocation": "./.yarn/cache/strip-json-comments-npm-2.0.1-e7883b2d04-1074ccb632.zip/node_modules/strip-json-comments/",\ + "packageDependencies": [\ + ["strip-json-comments", "npm:2.0.1"]\ + ],\ + "linkType": "HARD"\ + }],\ ["npm:3.1.1", {\ "packageLocation": "./.yarn/cache/strip-json-comments-npm-3.1.1-dcb2324823-492f73e272.zip/node_modules/strip-json-comments/",\ "packageDependencies": [\ @@ -3886,6 +4627,14 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { }]\ ]],\ ["supports-color", [\ + ["npm:5.5.0", {\ + "packageLocation": "./.yarn/cache/supports-color-npm-5.5.0-183ac537bc-95f6f4ba5a.zip/node_modules/supports-color/",\ + "packageDependencies": [\ + ["supports-color", "npm:5.5.0"],\ + ["has-flag", "npm:3.0.0"]\ + ],\ + "linkType": "HARD"\ + }],\ ["npm:7.2.0", {\ "packageLocation": "./.yarn/cache/supports-color-npm-7.2.0-606bfcf7da-3dda818de0.zip/node_modules/supports-color/",\ "packageDependencies": [\ @@ -3936,6 +4685,33 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { "linkType": "HARD"\ }]\ ]],\ + ["tar-fs", [\ + ["npm:2.1.1", {\ + "packageLocation": "./.yarn/cache/tar-fs-npm-2.1.1-e374d3b7a2-f5b9a70059.zip/node_modules/tar-fs/",\ + "packageDependencies": [\ + ["tar-fs", "npm:2.1.1"],\ + ["chownr", "npm:1.1.4"],\ + ["mkdirp-classic", "npm:0.5.3"],\ + ["pump", "npm:3.0.0"],\ + ["tar-stream", "npm:2.2.0"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["tar-stream", [\ + ["npm:2.2.0", {\ + "packageLocation": "./.yarn/cache/tar-stream-npm-2.2.0-884c79b510-699831a8b9.zip/node_modules/tar-stream/",\ + "packageDependencies": [\ + ["tar-stream", "npm:2.2.0"],\ + ["bl", "npm:4.1.0"],\ + ["end-of-stream", "npm:1.4.4"],\ + ["fs-constants", "npm:1.0.0"],\ + ["inherits", "npm:2.0.4"],\ + ["readable-stream", "npm:3.6.2"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ ["terser", [\ ["npm:5.19.4", {\ "packageLocation": "./.yarn/cache/terser-npm-5.19.4-0504dfe160-09273ce7d3.zip/node_modules/terser/",\ @@ -3997,6 +4773,16 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { "linkType": "HARD"\ }]\ ]],\ + ["tmp", [\ + ["npm:0.2.1", {\ + "packageLocation": "./.yarn/cache/tmp-npm-0.2.1-a9c8d9c0ca-8b12146541.zip/node_modules/tmp/",\ + "packageDependencies": [\ + ["tmp", "npm:0.2.1"],\ + ["rimraf", "npm:3.0.2"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ ["to-regex-range", [\ ["npm:5.0.1", {\ "packageLocation": "./.yarn/cache/to-regex-range-npm-5.0.1-f1e8263b00-f76fa01b3d.zip/node_modules/to-regex-range/",\ @@ -4083,6 +4869,25 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { "linkType": "HARD"\ }]\ ]],\ + ["tunnel", [\ + ["npm:0.0.6", {\ + "packageLocation": "./.yarn/cache/tunnel-npm-0.0.6-b1c0830ea4-c362948df9.zip/node_modules/tunnel/",\ + "packageDependencies": [\ + ["tunnel", "npm:0.0.6"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["tunnel-agent", [\ + ["npm:0.6.0", {\ + "packageLocation": "./.yarn/cache/tunnel-agent-npm-0.6.0-64345ab7eb-05f6510358.zip/node_modules/tunnel-agent/",\ + "packageDependencies": [\ + ["tunnel-agent", "npm:0.6.0"],\ + ["safe-buffer", "npm:5.2.1"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ ["type-check", [\ ["npm:0.4.0", {\ "packageLocation": "./.yarn/cache/type-check-npm-0.4.0-60565800ce-ec688ebfc9.zip/node_modules/type-check/",\ @@ -4102,6 +4907,18 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { "linkType": "HARD"\ }]\ ]],\ + ["typed-rest-client", [\ + ["npm:1.8.11", {\ + "packageLocation": "./.yarn/cache/typed-rest-client-npm-1.8.11-7be28960b2-baba878063.zip/node_modules/typed-rest-client/",\ + "packageDependencies": [\ + ["typed-rest-client", "npm:1.8.11"],\ + ["qs", "npm:6.11.2"],\ + ["tunnel", "npm:0.0.6"],\ + ["underscore", "npm:1.13.6"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ ["typescript", [\ ["patch:typescript@npm%3A5.2.2#~builtin::version=5.2.2&hash=f3b441", {\ "packageLocation": "./.yarn/cache/typescript-patch-2e8dbfb8ab-0f4da2f15e.zip/node_modules/typescript/",\ @@ -4111,6 +4928,24 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { "linkType": "HARD"\ }]\ ]],\ + ["uc.micro", [\ + ["npm:1.0.6", {\ + "packageLocation": "./.yarn/cache/uc.micro-npm-1.0.6-36f3dc2fc4-6898bb5563.zip/node_modules/uc.micro/",\ + "packageDependencies": [\ + ["uc.micro", "npm:1.0.6"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["underscore", [\ + ["npm:1.13.6", {\ + "packageLocation": "./.yarn/cache/underscore-npm-1.13.6-3ebe9d92fb-d5cedd14a9.zip/node_modules/underscore/",\ + "packageDependencies": [\ + ["underscore", "npm:1.13.6"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ ["unique-filename", [\ ["npm:3.0.0", {\ "packageLocation": "./.yarn/cache/unique-filename-npm-3.0.0-77d68e0a45-8e2f59b356.zip/node_modules/unique-filename/",\ @@ -4165,6 +5000,15 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { "linkType": "HARD"\ }]\ ]],\ + ["url-join", [\ + ["npm:4.0.1", {\ + "packageLocation": "./.yarn/cache/url-join-npm-4.0.1-e1f4415722-f74e868bf2.zip/node_modules/url-join/",\ + "packageDependencies": [\ + ["url-join", "npm:4.0.1"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ ["util-deprecate", [\ ["npm:1.0.2", {\ "packageLocation": "./.yarn/cache/util-deprecate-npm-1.0.2-e3fe1a219c-474acf1146.zip/node_modules/util-deprecate/",\ @@ -4408,6 +5252,26 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { "linkType": "HARD"\ }]\ ]],\ + ["xml2js", [\ + ["npm:0.5.0", {\ + "packageLocation": "./.yarn/cache/xml2js-npm-0.5.0-06e57a2771-1aa71d62e5.zip/node_modules/xml2js/",\ + "packageDependencies": [\ + ["xml2js", "npm:0.5.0"],\ + ["sax", "npm:1.3.0"],\ + ["xmlbuilder", "npm:11.0.1"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["xmlbuilder", [\ + ["npm:11.0.1", {\ + "packageLocation": "./.yarn/cache/xmlbuilder-npm-11.0.1-b8b04dc929-7152695e16.zip/node_modules/xmlbuilder/",\ + "packageDependencies": [\ + ["xmlbuilder", "npm:11.0.1"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ ["y18n", [\ ["npm:5.0.8", {\ "packageLocation": "./.yarn/cache/y18n-npm-5.0.8-5f3a0a7e62-54f0fb9562.zip/node_modules/y18n/",\ @@ -4471,6 +5335,27 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { "linkType": "HARD"\ }]\ ]],\ + ["yauzl", [\ + ["npm:2.10.0", {\ + "packageLocation": "./.yarn/cache/yauzl-npm-2.10.0-72e70ea021-7f21fe0bba.zip/node_modules/yauzl/",\ + "packageDependencies": [\ + ["yauzl", "npm:2.10.0"],\ + ["buffer-crc32", "npm:0.2.13"],\ + ["fd-slicer", "npm:1.1.0"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["yazl", [\ + ["npm:2.5.1", {\ + "packageLocation": "./.yarn/cache/yazl-npm-2.5.1-07fc697bef-daec5154b5.zip/node_modules/yazl/",\ + "packageDependencies": [\ + ["yazl", "npm:2.5.1"],\ + ["buffer-crc32", "npm:0.2.13"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ ["yocto-queue", [\ ["npm:0.1.0", {\ "packageLocation": "./.yarn/cache/yocto-queue-npm-0.1.0-c6c9a7db29-f77b3d8d00.zip/node_modules/yocto-queue/",\ diff --git a/toolchains/solidity/linter/core/Cargo.lock b/toolchains/solidity/linter/core/Cargo.lock index 715f9323..0d21a114 100644 --- a/toolchains/solidity/linter/core/Cargo.lock +++ b/toolchains/solidity/linter/core/Cargo.lock @@ -631,9 +631,9 @@ dependencies = [ [[package]] name = "syn-solidity" -version = "0.3.2" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "397f229dc34c7b8231b6ef85502f9ca4e3425b8625e6d403bb74779e6b1917b5" +checksum = "1b8a5a633f1172a0c80b1516a988e7e8efa7ce9cededf56590f54e593e4513b3" dependencies = [ "paste", "proc-macro2", diff --git a/toolchains/solidity/linter/core/package.json b/toolchains/solidity/linter/core/package.json index 3228ba9c..19e9ee70 100644 --- a/toolchains/solidity/linter/core/package.json +++ b/toolchains/solidity/linter/core/package.json @@ -6,6 +6,7 @@ "build": "cargo build --release", "lint": "cargo clippy -- -D warnings", "format": "cargo fmt", - "test": "cargo test" + "test": "cargo test", + "publish": "yarn run build && cp target/release/solidhunter ../extension/core" } } diff --git a/toolchains/solidity/linter/extension/.vscodeignore b/toolchains/solidity/linter/extension/.vscodeignore index c6136798..cf4a2f50 100644 --- a/toolchains/solidity/linter/extension/.vscodeignore +++ b/toolchains/solidity/linter/extension/.vscodeignore @@ -11,3 +11,4 @@ vsc-extension-quickstart.md **/.eslintrc.json **/*.map **/*.ts +../.unstable \ No newline at end of file diff --git a/toolchains/solidity/linter/extension/LICENSE.md b/toolchains/solidity/linter/extension/LICENSE.md new file mode 100644 index 00000000..5dc6b429 --- /dev/null +++ b/toolchains/solidity/linter/extension/LICENSE.md @@ -0,0 +1,675 @@ + + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + {project} Copyright (C) {year} {fullname} + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +. + + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +. diff --git a/toolchains/solidity/linter/extension/README.md b/toolchains/solidity/linter/extension/README.md index f5ef46a3..cbf2fdf7 100644 --- a/toolchains/solidity/linter/extension/README.md +++ b/toolchains/solidity/linter/extension/README.md @@ -1,71 +1,3 @@ -# solidhunter README +# Osmium solidity linter README -This is the README for your extension "solidhunter". After writing up a brief description, we recommend including the following sections. - -## Features - -Describe specific features of your extension including screenshots of your extension in action. Image paths are relative to this README file. - -For example if there is an image subfolder under your extension project workspace: - -\!\[feature X\]\(images/feature-x.png\) - -> Tip: Many popular extensions utilize animations. This is an excellent way to show off your extension! We recommend short, focused animations that are easy to follow. - -## Requirements - -If you have any requirements or dependencies, add a section describing those and how to install and configure them. - -## Extension Settings - -Include if your extension adds any VS Code settings through the `contributes.configuration` extension point. - -For example: - -This extension contributes the following settings: - -* `myExtension.enable`: Enable/disable this extension. -* `myExtension.thing`: Set to `blah` to do something. - -## Known Issues - -Calling out known issues can help limit users opening duplicate issues against your extension. - -## Release Notes - -Users appreciate release notes as you update your extension. - -### 1.0.0 - -Initial release of ... - -### 1.0.1 - -Fixed issue #. - -### 1.1.0 - -Added features X, Y, and Z. - ---- - -## Following extension guidelines - -Ensure that you've read through the extensions guidelines and follow the best practices for creating your extension. - -* [Extension Guidelines](https://code.visualstudio.com/api/references/extension-guidelines) - -## Working with Markdown - -You can author your README using Visual Studio Code. Here are some useful editor keyboard shortcuts: - -* Split the editor (`Cmd+\` on macOS or `Ctrl+\` on Windows and Linux). -* Toggle preview (`Shift+Cmd+V` on macOS or `Shift+Ctrl+V` on Windows and Linux). -* Press `Ctrl+Space` (Windows, Linux, macOS) to see a list of Markdown snippets. - -## For more information - -* [Visual Studio Code's Markdown Support](http://code.visualstudio.com/docs/languages/markdown) -* [Markdown Syntax Reference](https://help.github.com/articles/markdown-basics/) - -**Enjoy!** +Solidhunter is a linter for the smart-contract language solidity. It allows the developpers to enforce coding standards accross projects diff --git a/toolchains/solidity/linter/extension/package.json b/toolchains/solidity/linter/extension/package.json index 4c385a0d..68a536ec 100644 --- a/toolchains/solidity/linter/extension/package.json +++ b/toolchains/solidity/linter/extension/package.json @@ -2,6 +2,8 @@ "name": "osmium-solidity-linter-extension", "displayName": "solidhunter", "description": "", + "publisher": "OsmiumToolchains", + "repository": "https://github.com/astrodevs-labs/osmium/toolchains/solidity", "version": "0.0.1", "engines": { "vscode": "^1.82.0" @@ -66,7 +68,8 @@ "watch-tests": "tsc -p . -w --outDir out", "pretest": "yarn run compile-tests && yarn run compile && yarn run lint", "lint": "yarn install && eslint src --ext ts", - "test": "echo \"no tests\"" + "test": "echo \"no tests\"", + "publish": "yarn run package && vsce publish --no-dependencies" }, "devDependencies": { "@types/glob": "^8.1.0", @@ -76,6 +79,7 @@ "@typescript-eslint/eslint-plugin": "^5.59.8", "@typescript-eslint/parser": "^5.59.8", "@vscode/test-electron": "^2.3.2", + "@vscode/vsce": "^2.21.1", "eslint": "^8.41.0", "glob": "^8.1.0", "mocha": "^10.2.0", diff --git a/toolchains/solidity/linter/extension/src/extension.ts b/toolchains/solidity/linter/extension/src/extension.ts index f96c8307..16b53d90 100644 --- a/toolchains/solidity/linter/extension/src/extension.ts +++ b/toolchains/solidity/linter/extension/src/extension.ts @@ -12,8 +12,8 @@ export async function activate(context: ExtensionContext) { const binaryPath = path.join(context.extensionPath, 'core'); console.log(binaryPath); - const workspacePath = workspace.workspaceFolders?.[0].uri.fsPath; - const configPath = path.join(workspace.workspaceFolders?.[0].uri.fsPath, '.solidhunter.json'); + const workspacePath = workspace.workspaceFolders?.[0].uri.fsPath!; + const configPath = path.join(workspacePath, '.solidhunter.json'); if (!workspacePath) { return; diff --git a/toolchains/solidity/linter/package.json b/toolchains/solidity/linter/package.json index ffced6b0..314777e2 100644 --- a/toolchains/solidity/linter/package.json +++ b/toolchains/solidity/linter/package.json @@ -11,6 +11,7 @@ "build": "yarn workspaces foreach run build", "lint": "yarn workspaces foreach run lint", "format": "yarn workspaces foreach run format", - "test": "yarn workspaces foreach run test" + "test": "yarn workspaces foreach run test", + "publish": "yarn workspace osmium-solidity-linter-core run publish && yarn workspace osmium-solidity-linter-extension run publish" } } diff --git a/yarn.lock b/yarn.lock index 4da7d6e2..3b0e5ebe 100644 --- a/yarn.lock +++ b/yarn.lock @@ -504,6 +504,40 @@ __metadata: languageName: node linkType: hard +"@vscode/vsce@npm:^2.21.1": + version: 2.21.1 + resolution: "@vscode/vsce@npm:2.21.1" + dependencies: + azure-devops-node-api: ^11.0.1 + chalk: ^2.4.2 + cheerio: ^1.0.0-rc.9 + commander: ^6.2.1 + glob: ^7.0.6 + hosted-git-info: ^4.0.2 + jsonc-parser: ^3.2.0 + keytar: ^7.7.0 + leven: ^3.1.0 + markdown-it: ^12.3.2 + mime: ^1.3.4 + minimatch: ^3.0.3 + parse-semver: ^1.1.1 + read: ^1.0.7 + semver: ^7.5.2 + tmp: ^0.2.1 + typed-rest-client: ^1.8.4 + url-join: ^4.0.1 + xml2js: ^0.5.0 + yauzl: ^2.3.1 + yazl: ^2.2.2 + dependenciesMeta: + keytar: + optional: true + bin: + vsce: vsce + checksum: d597d97683ef9e592383a33906313534fc40ca2a030fc63c226451e3754baa013845f93b93e7648396a8d79106626ad65b60733fa03c47e4964ee98c6b7b6734 + languageName: node + linkType: hard + "@webassemblyjs/ast@npm:1.11.6, @webassemblyjs/ast@npm:^1.11.5": version: 1.11.6 resolution: "@webassemblyjs/ast@npm:1.11.6" @@ -806,6 +840,15 @@ __metadata: languageName: node linkType: hard +"ansi-styles@npm:^3.2.1": + version: 3.2.1 + resolution: "ansi-styles@npm:3.2.1" + dependencies: + color-convert: ^1.9.0 + checksum: d85ade01c10e5dd77b6c89f34ed7531da5830d2cb5882c645f330079975b716438cd7ebb81d0d6e6b4f9c577f19ae41ab55f07f19786b02f9dfd9e0377395665 + languageName: node + linkType: hard + "ansi-styles@npm:^4.0.0, ansi-styles@npm:^4.1.0": version: 4.3.0 resolution: "ansi-styles@npm:4.3.0" @@ -863,6 +906,16 @@ __metadata: languageName: node linkType: hard +"azure-devops-node-api@npm:^11.0.1": + version: 11.2.0 + resolution: "azure-devops-node-api@npm:11.2.0" + dependencies: + tunnel: 0.0.6 + typed-rest-client: ^1.8.4 + checksum: 52e84379b4ce71ad8a79470ba89e1d1217b28ee3670c7e484e1b1d9c210acf406ab09132c241cb481f78354df701dae7752ba3c4e3d28b2b6c0b0ff2d9eb7199 + languageName: node + linkType: hard + "balanced-match@npm:^1.0.0": version: 1.0.2 resolution: "balanced-match@npm:1.0.2" @@ -870,6 +923,13 @@ __metadata: languageName: node linkType: hard +"base64-js@npm:^1.3.1": + version: 1.5.1 + resolution: "base64-js@npm:1.5.1" + checksum: 669632eb3745404c2f822a18fc3a0122d2f9a7a13f7fb8b5823ee19d1d2ff9ee5b52c53367176ea4ad093c332fd5ab4bd0ebae5a8e27917a4105a4cfc86b1005 + languageName: node + linkType: hard + "binary-extensions@npm:^2.0.0": version: 2.2.0 resolution: "binary-extensions@npm:2.2.0" @@ -877,6 +937,24 @@ __metadata: languageName: node linkType: hard +"bl@npm:^4.0.3": + version: 4.1.0 + resolution: "bl@npm:4.1.0" + dependencies: + buffer: ^5.5.0 + inherits: ^2.0.4 + readable-stream: ^3.4.0 + checksum: 9e8521fa7e83aa9427c6f8ccdcba6e8167ef30cc9a22df26effcc5ab682ef91d2cbc23a239f945d099289e4bbcfae7a192e9c28c84c6202e710a0dfec3722662 + languageName: node + linkType: hard + +"boolbase@npm:^1.0.0": + version: 1.0.0 + resolution: "boolbase@npm:1.0.0" + checksum: 3e25c80ef626c3a3487c73dbfc70ac322ec830666c9ad915d11b701142fab25ec1e63eff2c450c74347acfd2de854ccde865cd79ef4db1683f7c7b046ea43bb0 + languageName: node + linkType: hard + "brace-expansion@npm:^1.1.7": version: 1.1.11 resolution: "brace-expansion@npm:1.1.11" @@ -926,6 +1004,13 @@ __metadata: languageName: node linkType: hard +"buffer-crc32@npm:~0.2.3": + version: 0.2.13 + resolution: "buffer-crc32@npm:0.2.13" + checksum: 06252347ae6daca3453b94e4b2f1d3754a3b146a111d81c68924c22d91889a40623264e95e67955b1cb4a68cbedf317abeabb5140a9766ed248973096db5ce1c + languageName: node + linkType: hard + "buffer-from@npm:^1.0.0": version: 1.1.2 resolution: "buffer-from@npm:1.1.2" @@ -933,6 +1018,16 @@ __metadata: languageName: node linkType: hard +"buffer@npm:^5.5.0": + version: 5.7.1 + resolution: "buffer@npm:5.7.1" + dependencies: + base64-js: ^1.3.1 + ieee754: ^1.1.13 + checksum: e2cf8429e1c4c7b8cbd30834ac09bd61da46ce35f5c22a78e6c2f04497d6d25541b16881e30a019c6fd3154150650ccee27a308eff3e26229d788bbdeb08ab84 + languageName: node + linkType: hard + "cacache@npm:^17.0.0": version: 17.1.4 resolution: "cacache@npm:17.1.4" @@ -953,6 +1048,16 @@ __metadata: languageName: node linkType: hard +"call-bind@npm:^1.0.0": + version: 1.0.2 + resolution: "call-bind@npm:1.0.2" + dependencies: + function-bind: ^1.1.1 + get-intrinsic: ^1.0.2 + checksum: f8e31de9d19988a4b80f3e704788c4a2d6b6f3d17cfec4f57dc29ced450c53a49270dc66bf0fbd693329ee948dd33e6c90a329519aef17474a4d961e8d6426b0 + languageName: node + linkType: hard + "callsites@npm:^3.0.0": version: 3.1.0 resolution: "callsites@npm:3.1.0" @@ -974,6 +1079,17 @@ __metadata: languageName: node linkType: hard +"chalk@npm:^2.4.2": + version: 2.4.2 + resolution: "chalk@npm:2.4.2" + dependencies: + ansi-styles: ^3.2.1 + escape-string-regexp: ^1.0.5 + supports-color: ^5.3.0 + checksum: ec3661d38fe77f681200f878edbd9448821924e0f93a9cefc0e26a33b145f1027a2084bf19967160d11e1f03bfe4eaffcabf5493b89098b2782c3fe0b03d80c2 + languageName: node + linkType: hard + "chalk@npm:^4.0.0, chalk@npm:^4.1.0": version: 4.1.2 resolution: "chalk@npm:4.1.2" @@ -984,6 +1100,35 @@ __metadata: languageName: node linkType: hard +"cheerio-select@npm:^2.1.0": + version: 2.1.0 + resolution: "cheerio-select@npm:2.1.0" + dependencies: + boolbase: ^1.0.0 + css-select: ^5.1.0 + css-what: ^6.1.0 + domelementtype: ^2.3.0 + domhandler: ^5.0.3 + domutils: ^3.0.1 + checksum: 843d6d479922f28a6c5342c935aff1347491156814de63c585a6eb73baf7bb4185c1b4383a1195dca0f12e3946d737c7763bcef0b9544c515d905c5c44c5308b + languageName: node + linkType: hard + +"cheerio@npm:^1.0.0-rc.9": + version: 1.0.0-rc.12 + resolution: "cheerio@npm:1.0.0-rc.12" + dependencies: + cheerio-select: ^2.1.0 + dom-serializer: ^2.0.0 + domhandler: ^5.0.3 + domutils: ^3.0.1 + htmlparser2: ^8.0.1 + parse5: ^7.0.0 + parse5-htmlparser2-tree-adapter: ^7.0.0 + checksum: 5d4c1b7a53cf22d3a2eddc0aff70cf23cbb30d01a4c79013e703a012475c02461aa1fcd99127e8d83a02216386ed6942b2c8103845fd0812300dd199e6e7e054 + languageName: node + linkType: hard + "chokidar@npm:3.5.3": version: 3.5.3 resolution: "chokidar@npm:3.5.3" @@ -1003,6 +1148,13 @@ __metadata: languageName: node linkType: hard +"chownr@npm:^1.1.1": + version: 1.1.4 + resolution: "chownr@npm:1.1.4" + checksum: 115648f8eb38bac5e41c3857f3e663f9c39ed6480d1349977c4d96c95a47266fcacc5a5aabf3cb6c481e22d72f41992827db47301851766c4fd77ac21a4f081d + languageName: node + linkType: hard + "chownr@npm:^2.0.0": version: 2.0.0 resolution: "chownr@npm:2.0.0" @@ -1046,6 +1198,15 @@ __metadata: languageName: node linkType: hard +"color-convert@npm:^1.9.0": + version: 1.9.3 + resolution: "color-convert@npm:1.9.3" + dependencies: + color-name: 1.1.3 + checksum: fd7a64a17cde98fb923b1dd05c5f2e6f7aefda1b60d67e8d449f9328b4e53b228a428fd38bfeaeb2db2ff6b6503a776a996150b80cdf224062af08a5c8a3a203 + languageName: node + linkType: hard + "color-convert@npm:^2.0.1": version: 2.0.1 resolution: "color-convert@npm:2.0.1" @@ -1055,6 +1216,13 @@ __metadata: languageName: node linkType: hard +"color-name@npm:1.1.3": + version: 1.1.3 + resolution: "color-name@npm:1.1.3" + checksum: 09c5d3e33d2105850153b14466501f2bfb30324a2f76568a408763a3b7433b0e50e5b4ab1947868e65cb101bb7cb75029553f2c333b6d4b8138a73fcc133d69d + languageName: node + linkType: hard + "color-name@npm:~1.1.4": version: 1.1.4 resolution: "color-name@npm:1.1.4" @@ -1092,6 +1260,13 @@ __metadata: languageName: node linkType: hard +"commander@npm:^6.2.1": + version: 6.2.1 + resolution: "commander@npm:6.2.1" + checksum: d7090410c0de6bc5c67d3ca41c41760d6d268f3c799e530aafb73b7437d1826bbf0d2a3edac33f8b57cc9887b4a986dce307fa5557e109be40eadb7c43b21742 + languageName: node + linkType: hard + "concat-map@npm:0.0.1": version: 0.0.1 resolution: "concat-map@npm:0.0.1" @@ -1124,6 +1299,26 @@ __metadata: languageName: node linkType: hard +"css-select@npm:^5.1.0": + version: 5.1.0 + resolution: "css-select@npm:5.1.0" + dependencies: + boolbase: ^1.0.0 + css-what: ^6.1.0 + domhandler: ^5.0.2 + domutils: ^3.0.1 + nth-check: ^2.0.1 + checksum: 2772c049b188d3b8a8159907192e926e11824aea525b8282981f72ba3f349cf9ecd523fdf7734875ee2cb772246c22117fc062da105b6d59afe8dcd5c99c9bda + languageName: node + linkType: hard + +"css-what@npm:^6.1.0": + version: 6.1.0 + resolution: "css-what@npm:6.1.0" + checksum: b975e547e1e90b79625918f84e67db5d33d896e6de846c9b584094e529f0c63e2ab85ee33b9daffd05bff3a146a1916bec664e18bb76dd5f66cbff9fc13b2bbe + languageName: node + linkType: hard + "debug@npm:4, debug@npm:4.3.4, debug@npm:^4.1.1, debug@npm:^4.3.2, debug@npm:^4.3.3, debug@npm:^4.3.4": version: 4.3.4 resolution: "debug@npm:4.3.4" @@ -1143,6 +1338,22 @@ __metadata: languageName: node linkType: hard +"decompress-response@npm:^6.0.0": + version: 6.0.0 + resolution: "decompress-response@npm:6.0.0" + dependencies: + mimic-response: ^3.1.0 + checksum: d377cf47e02d805e283866c3f50d3d21578b779731e8c5072d6ce8c13cc31493db1c2f6784da9d1d5250822120cefa44f1deab112d5981015f2e17444b763812 + languageName: node + linkType: hard + +"deep-extend@npm:^0.6.0": + version: 0.6.0 + resolution: "deep-extend@npm:0.6.0" + checksum: 7be7e5a8d468d6b10e6a67c3de828f55001b6eb515d014f7aeb9066ce36bd5717161eb47d6a0f7bed8a9083935b465bc163ee2581c8b128d29bf61092fdf57a7 + languageName: node + linkType: hard + "deep-is@npm:^0.1.3": version: 0.1.4 resolution: "deep-is@npm:0.1.4" @@ -1157,6 +1368,13 @@ __metadata: languageName: node linkType: hard +"detect-libc@npm:^2.0.0": + version: 2.0.2 + resolution: "detect-libc@npm:2.0.2" + checksum: 2b2cd3649b83d576f4be7cc37eb3b1815c79969c8b1a03a40a4d55d83bc74d010753485753448eacb98784abf22f7dbd3911fd3b60e29fda28fed2d1a997944d + languageName: node + linkType: hard + "diff@npm:5.0.0": version: 5.0.0 resolution: "diff@npm:5.0.0" @@ -1182,6 +1400,44 @@ __metadata: languageName: node linkType: hard +"dom-serializer@npm:^2.0.0": + version: 2.0.0 + resolution: "dom-serializer@npm:2.0.0" + dependencies: + domelementtype: ^2.3.0 + domhandler: ^5.0.2 + entities: ^4.2.0 + checksum: cd1810544fd8cdfbd51fa2c0c1128ec3a13ba92f14e61b7650b5de421b88205fd2e3f0cc6ace82f13334114addb90ed1c2f23074a51770a8e9c1273acbc7f3e6 + languageName: node + linkType: hard + +"domelementtype@npm:^2.3.0": + version: 2.3.0 + resolution: "domelementtype@npm:2.3.0" + checksum: ee837a318ff702622f383409d1f5b25dd1024b692ef64d3096ff702e26339f8e345820f29a68bcdcea8cfee3531776b3382651232fbeae95612d6f0a75efb4f6 + languageName: node + linkType: hard + +"domhandler@npm:^5.0.2, domhandler@npm:^5.0.3": + version: 5.0.3 + resolution: "domhandler@npm:5.0.3" + dependencies: + domelementtype: ^2.3.0 + checksum: 0f58f4a6af63e6f3a4320aa446d28b5790a009018707bce2859dcb1d21144c7876482b5188395a188dfa974238c019e0a1e610d2fc269a12b2c192ea2b0b131c + languageName: node + linkType: hard + +"domutils@npm:^3.0.1": + version: 3.1.0 + resolution: "domutils@npm:3.1.0" + dependencies: + dom-serializer: ^2.0.0 + domelementtype: ^2.3.0 + domhandler: ^5.0.3 + checksum: e5757456ddd173caa411cfc02c2bb64133c65546d2c4081381a3bafc8a57411a41eed70494551aa58030be9e58574fcc489828bebd673863d39924fb4878f416 + languageName: node + linkType: hard + "eastasianwidth@npm:^0.2.0": version: 0.2.0 resolution: "eastasianwidth@npm:0.2.0" @@ -1219,6 +1475,15 @@ __metadata: languageName: node linkType: hard +"end-of-stream@npm:^1.1.0, end-of-stream@npm:^1.4.1": + version: 1.4.4 + resolution: "end-of-stream@npm:1.4.4" + dependencies: + once: ^1.4.0 + checksum: 530a5a5a1e517e962854a31693dbb5c0b2fc40b46dad2a56a2deec656ca040631124f4795823acc68238147805f8b021abbe221f4afed5ef3c8e8efc2024908b + languageName: node + linkType: hard + "enhanced-resolve@npm:^5.0.0, enhanced-resolve@npm:^5.15.0": version: 5.15.0 resolution: "enhanced-resolve@npm:5.15.0" @@ -1229,6 +1494,20 @@ __metadata: languageName: node linkType: hard +"entities@npm:^4.2.0, entities@npm:^4.4.0": + version: 4.5.0 + resolution: "entities@npm:4.5.0" + checksum: 853f8ebd5b425d350bffa97dd6958143179a5938352ccae092c62d1267c4e392a039be1bae7d51b6e4ffad25f51f9617531fedf5237f15df302ccfb452cbf2d7 + languageName: node + linkType: hard + +"entities@npm:~2.1.0": + version: 2.1.0 + resolution: "entities@npm:2.1.0" + checksum: a10a877e489586a3f6a691fe49bf3fc4e58f06c8e80522f08214a5150ba457e7017b447d4913a3fa041bda06ee4c92517baa4d8d75373eaa79369e9639225ffd + languageName: node + linkType: hard + "env-paths@npm:^2.2.0": version: 2.2.1 resolution: "env-paths@npm:2.2.1" @@ -1273,6 +1552,13 @@ __metadata: languageName: node linkType: hard +"escape-string-regexp@npm:^1.0.5": + version: 1.0.5 + resolution: "escape-string-regexp@npm:1.0.5" + checksum: 6092fda75c63b110c706b6a9bfde8a612ad595b628f0bd2147eea1d3406723020810e591effc7db1da91d80a71a737a313567c5abb3813e8d9c71f4aa595b410 + languageName: node + linkType: hard + "eslint-scope@npm:5.1.1, eslint-scope@npm:^5.1.1": version: 5.1.1 resolution: "eslint-scope@npm:5.1.1" @@ -1458,6 +1744,13 @@ __metadata: languageName: node linkType: hard +"expand-template@npm:^2.0.3": + version: 2.0.3 + resolution: "expand-template@npm:2.0.3" + checksum: 588c19847216421ed92befb521767b7018dc88f88b0576df98cb242f20961425e96a92cbece525ef28cc5becceae5d544ae0f5b9b5e2aa05acb13716ca5b3099 + languageName: node + linkType: hard + "exponential-backoff@npm:^3.1.1": version: 3.1.1 resolution: "exponential-backoff@npm:3.1.1" @@ -1515,6 +1808,15 @@ __metadata: languageName: node linkType: hard +"fd-slicer@npm:~1.1.0": + version: 1.1.0 + resolution: "fd-slicer@npm:1.1.0" + dependencies: + pend: ~1.2.0 + checksum: c8585fd5713f4476eb8261150900d2cb7f6ff2d87f8feb306ccc8a1122efd152f1783bdb2b8dc891395744583436bfd8081d8e63ece0ec8687eeefea394d4ff2 + languageName: node + linkType: hard + "file-entry-cache@npm:^6.0.1": version: 6.0.1 resolution: "file-entry-cache@npm:6.0.1" @@ -1589,6 +1891,13 @@ __metadata: languageName: node linkType: hard +"fs-constants@npm:^1.0.0": + version: 1.0.0 + resolution: "fs-constants@npm:1.0.0" + checksum: 18f5b718371816155849475ac36c7d0b24d39a11d91348cfcb308b4494824413e03572c403c86d3a260e049465518c4f0d5bd00f0371cdfcad6d4f30a85b350d + languageName: node + linkType: hard + "fs-minipass@npm:^2.0.0": version: 2.1.0 resolution: "fs-minipass@npm:2.1.0" @@ -1663,6 +1972,25 @@ __metadata: languageName: node linkType: hard +"get-intrinsic@npm:^1.0.2": + version: 1.2.1 + resolution: "get-intrinsic@npm:1.2.1" + dependencies: + function-bind: ^1.1.1 + has: ^1.0.3 + has-proto: ^1.0.1 + has-symbols: ^1.0.3 + checksum: 5b61d88552c24b0cf6fa2d1b3bc5459d7306f699de060d76442cce49a4721f52b8c560a33ab392cf5575b7810277d54ded9d4d39a1ea61855619ebc005aa7e5f + languageName: node + linkType: hard + +"github-from-package@npm:0.0.0": + version: 0.0.0 + resolution: "github-from-package@npm:0.0.0" + checksum: 14e448192a35c1e42efee94c9d01a10f42fe790375891a24b25261246ce9336ab9df5d274585aedd4568f7922246c2a78b8a8cd2571bfe99c693a9718e7dd0e3 + languageName: node + linkType: hard + "glob-parent@npm:^5.1.2, glob-parent@npm:~5.1.2": version: 5.1.2 resolution: "glob-parent@npm:5.1.2" @@ -1717,7 +2045,7 @@ __metadata: languageName: node linkType: hard -"glob@npm:^7.1.3, glob@npm:^7.1.4": +"glob@npm:^7.0.6, glob@npm:^7.1.3, glob@npm:^7.1.4": version: 7.2.3 resolution: "glob@npm:7.2.3" dependencies: @@ -1781,6 +2109,13 @@ __metadata: languageName: node linkType: hard +"has-flag@npm:^3.0.0": + version: 3.0.0 + resolution: "has-flag@npm:3.0.0" + checksum: 4a15638b454bf086c8148979aae044dd6e39d63904cd452d970374fa6a87623423da485dfb814e7be882e05c096a7ccf1ebd48e7e7501d0208d8384ff4dea73b + languageName: node + linkType: hard + "has-flag@npm:^4.0.0": version: 4.0.0 resolution: "has-flag@npm:4.0.0" @@ -1788,6 +2123,20 @@ __metadata: languageName: node linkType: hard +"has-proto@npm:^1.0.1": + version: 1.0.1 + resolution: "has-proto@npm:1.0.1" + checksum: febc5b5b531de8022806ad7407935e2135f1cc9e64636c3916c6842bd7995994ca3b29871ecd7954bd35f9e2986c17b3b227880484d22259e2f8e6ce63fd383e + languageName: node + linkType: hard + +"has-symbols@npm:^1.0.3": + version: 1.0.3 + resolution: "has-symbols@npm:1.0.3" + checksum: a054c40c631c0d5741a8285010a0777ea0c068f99ed43e5d6eb12972da223f8af553a455132fdb0801bdcfa0e0f443c0c03a68d8555aa529b3144b446c3f2410 + languageName: node + linkType: hard + "has-unicode@npm:^2.0.1": version: 2.0.1 resolution: "has-unicode@npm:2.0.1" @@ -1813,6 +2162,27 @@ __metadata: languageName: node linkType: hard +"hosted-git-info@npm:^4.0.2": + version: 4.1.0 + resolution: "hosted-git-info@npm:4.1.0" + dependencies: + lru-cache: ^6.0.0 + checksum: c3f87b3c2f7eb8c2748c8f49c0c2517c9a95f35d26f4bf54b2a8cba05d2e668f3753548b6ea366b18ec8dadb4e12066e19fa382a01496b0ffa0497eb23cbe461 + languageName: node + linkType: hard + +"htmlparser2@npm:^8.0.1": + version: 8.0.2 + resolution: "htmlparser2@npm:8.0.2" + dependencies: + domelementtype: ^2.3.0 + domhandler: ^5.0.3 + domutils: ^3.0.1 + entities: ^4.4.0 + checksum: 29167a0f9282f181da8a6d0311b76820c8a59bc9e3c87009e21968264c2987d2723d6fde5a964d4b7b6cba663fca96ffb373c06d8223a85f52a6089ced942700 + languageName: node + linkType: hard + "http-cache-semantics@npm:^4.1.1": version: 4.1.1 resolution: "http-cache-semantics@npm:4.1.1" @@ -1879,6 +2249,13 @@ __metadata: languageName: node linkType: hard +"ieee754@npm:^1.1.13": + version: 1.2.1 + resolution: "ieee754@npm:1.2.1" + checksum: 5144c0c9815e54ada181d80a0b810221a253562422e7c6c3a60b1901154184f49326ec239d618c416c1c5945a2e197107aee8d986a3dd836b53dffefd99b5e7e + languageName: node + linkType: hard + "ignore@npm:^5.2.0": version: 5.2.4 resolution: "ignore@npm:5.2.4" @@ -1939,13 +2316,20 @@ __metadata: languageName: node linkType: hard -"inherits@npm:2, inherits@npm:^2.0.3, inherits@npm:~2.0.3": +"inherits@npm:2, inherits@npm:^2.0.3, inherits@npm:^2.0.4, inherits@npm:~2.0.3": version: 2.0.4 resolution: "inherits@npm:2.0.4" checksum: 4a48a733847879d6cf6691860a6b1e3f0f4754176e4d71494c41f3475553768b10f84b5ce1d40fbd0e34e6bfbb864ee35858ad4dd2cf31e02fc4a154b724d7f1 languageName: node linkType: hard +"ini@npm:~1.3.0": + version: 1.3.8 + resolution: "ini@npm:1.3.8" + checksum: dfd98b0ca3a4fc1e323e38a6c8eb8936e31a97a918d3b377649ea15bdb15d481207a0dda1021efbd86b464cae29a0d33c1d7dcaf6c5672bee17fa849bc50a1b3 + languageName: node + linkType: hard + "interpret@npm:^3.1.1": version: 3.1.1 resolution: "interpret@npm:3.1.1" @@ -2122,6 +2506,13 @@ __metadata: languageName: node linkType: hard +"jsonc-parser@npm:^3.2.0": + version: 3.2.0 + resolution: "jsonc-parser@npm:3.2.0" + checksum: 946dd9a5f326b745aa326d48a7257e3f4a4b62c5e98ec8e49fa2bdd8d96cef7e6febf1399f5c7016114fd1f68a1c62c6138826d5d90bc650448e3cf0951c53c7 + languageName: node + linkType: hard + "jszip@npm:^3.10.1": version: 3.10.1 resolution: "jszip@npm:3.10.1" @@ -2134,6 +2525,17 @@ __metadata: languageName: node linkType: hard +"keytar@npm:^7.7.0": + version: 7.9.0 + resolution: "keytar@npm:7.9.0" + dependencies: + node-addon-api: ^4.3.0 + node-gyp: latest + prebuild-install: ^7.0.1 + checksum: 4dbdd21f69e21a53032cbc949847f57338e42df763c5eec04e1b5d7142a689f95d8c3d74fb3b7dc321b5d678271d8d8d1a0dcaa919673ebc50ef8ce76f354e21 + languageName: node + linkType: hard + "kind-of@npm:^6.0.2": version: 6.0.3 resolution: "kind-of@npm:6.0.3" @@ -2141,6 +2543,13 @@ __metadata: languageName: node linkType: hard +"leven@npm:^3.1.0": + version: 3.1.0 + resolution: "leven@npm:3.1.0" + checksum: 638401d534585261b6003db9d99afd244dfe82d75ddb6db5c0df412842d5ab30b2ef18de471aaec70fe69a46f17b4ae3c7f01d8a4e6580ef7adb9f4273ad1e55 + languageName: node + linkType: hard + "levn@npm:^0.4.1": version: 0.4.1 resolution: "levn@npm:0.4.1" @@ -2160,6 +2569,15 @@ __metadata: languageName: node linkType: hard +"linkify-it@npm:^3.0.1": + version: 3.0.3 + resolution: "linkify-it@npm:3.0.3" + dependencies: + uc.micro: ^1.0.1 + checksum: 31367a4bb70c5bbc9703246236b504b0a8e049bcd4e0de4291fa50f0ebdebf235b5eb54db6493cb0b1319357c6eeafc4324c9f4aa34b0b943d9f2e11a1268fbc + languageName: node + linkType: hard + "loader-runner@npm:^4.2.0": version: 4.3.0 resolution: "loader-runner@npm:4.3.0" @@ -2248,6 +2666,28 @@ __metadata: languageName: node linkType: hard +"markdown-it@npm:^12.3.2": + version: 12.3.2 + resolution: "markdown-it@npm:12.3.2" + dependencies: + argparse: ^2.0.1 + entities: ~2.1.0 + linkify-it: ^3.0.1 + mdurl: ^1.0.1 + uc.micro: ^1.0.5 + bin: + markdown-it: bin/markdown-it.js + checksum: 890555711c1c00fa03b936ca2b213001a3b9b37dea140d8445ae4130ce16628392aad24b12e2a0a9935336ca5951f2957a38f4e5309a2e38eab44e25ff32a41e + languageName: node + linkType: hard + +"mdurl@npm:^1.0.1": + version: 1.0.1 + resolution: "mdurl@npm:1.0.1" + checksum: 71731ecba943926bfbf9f9b51e28b5945f9411c4eda80894221b47cc105afa43ba2da820732b436f0798fd3edbbffcd1fc1415843c41a87fea08a41cc1e3d02b + languageName: node + linkType: hard + "merge-stream@npm:^2.0.0": version: 2.0.0 resolution: "merge-stream@npm:2.0.0" @@ -2288,6 +2728,22 @@ __metadata: languageName: node linkType: hard +"mime@npm:^1.3.4": + version: 1.6.0 + resolution: "mime@npm:1.6.0" + bin: + mime: cli.js + checksum: fef25e39263e6d207580bdc629f8872a3f9772c923c7f8c7e793175cee22777bbe8bba95e5d509a40aaa292d8974514ce634ae35769faa45f22d17edda5e8557 + languageName: node + linkType: hard + +"mimic-response@npm:^3.1.0": + version: 3.1.0 + resolution: "mimic-response@npm:3.1.0" + checksum: 25739fee32c17f433626bf19f016df9036b75b3d84a3046c7d156e72ec963dd29d7fc8a302f55a3d6c5a4ff24259676b15d915aad6480815a969ff2ec0836867 + languageName: node + linkType: hard + "minimatch@npm:5.0.1": version: 5.0.1 resolution: "minimatch@npm:5.0.1" @@ -2297,7 +2753,7 @@ __metadata: languageName: node linkType: hard -"minimatch@npm:^3.0.4, minimatch@npm:^3.0.5, minimatch@npm:^3.1.1, minimatch@npm:^3.1.2": +"minimatch@npm:^3.0.3, minimatch@npm:^3.0.4, minimatch@npm:^3.0.5, minimatch@npm:^3.1.1, minimatch@npm:^3.1.2": version: 3.1.2 resolution: "minimatch@npm:3.1.2" dependencies: @@ -2324,6 +2780,13 @@ __metadata: languageName: node linkType: hard +"minimist@npm:^1.2.0, minimist@npm:^1.2.3": + version: 1.2.8 + resolution: "minimist@npm:1.2.8" + checksum: 75a6d645fb122dad29c06a7597bddea977258957ed88d7a6df59b5cd3fe4a527e253e9bbf2e783e4b73657f9098b96a5fe96ab8a113655d4109108577ecf85b0 + languageName: node + linkType: hard + "minipass-collect@npm:^1.0.2": version: 1.0.2 resolution: "minipass-collect@npm:1.0.2" @@ -2408,6 +2871,13 @@ __metadata: languageName: node linkType: hard +"mkdirp-classic@npm:^0.5.2, mkdirp-classic@npm:^0.5.3": + version: 0.5.3 + resolution: "mkdirp-classic@npm:0.5.3" + checksum: 3f4e088208270bbcc148d53b73e9a5bd9eef05ad2cbf3b3d0ff8795278d50dd1d11a8ef1875ff5aea3fa888931f95bfcb2ad5b7c1061cfefd6284d199e6776ac + languageName: node + linkType: hard + "mkdirp@npm:^1.0.3": version: 1.0.4 resolution: "mkdirp@npm:1.0.4" @@ -2463,6 +2933,13 @@ __metadata: languageName: node linkType: hard +"mute-stream@npm:~0.0.4": + version: 0.0.8 + resolution: "mute-stream@npm:0.0.8" + checksum: ff48d251fc3f827e5b1206cda0ffdaec885e56057ee86a3155e1951bc940fd5f33531774b1cc8414d7668c10a8907f863f6561875ee6e8768931a62121a531a1 + languageName: node + linkType: hard + "nanoid@npm:3.3.3": version: 3.3.3 resolution: "nanoid@npm:3.3.3" @@ -2472,6 +2949,13 @@ __metadata: languageName: node linkType: hard +"napi-build-utils@npm:^1.0.1": + version: 1.0.2 + resolution: "napi-build-utils@npm:1.0.2" + checksum: 06c14271ee966e108d55ae109f340976a9556c8603e888037145d6522726aebe89dd0c861b4b83947feaf6d39e79e08817559e8693deedc2c94e82c5cbd090c7 + languageName: node + linkType: hard + "natural-compare-lite@npm:^1.4.0": version: 1.4.0 resolution: "natural-compare-lite@npm:1.4.0" @@ -2500,6 +2984,24 @@ __metadata: languageName: node linkType: hard +"node-abi@npm:^3.3.0": + version: 3.47.0 + resolution: "node-abi@npm:3.47.0" + dependencies: + semver: ^7.3.5 + checksum: ff8498dcd4a805ebf0af27162023bb17e56cb973c955d6c411ebce0938b0827e34323ede846b635daff516d5cd2ea8d64f9d99f2d63f61d1d7469415323fa9a6 + languageName: node + linkType: hard + +"node-addon-api@npm:^4.3.0": + version: 4.3.0 + resolution: "node-addon-api@npm:4.3.0" + dependencies: + node-gyp: latest + checksum: 3de396e23cc209f539c704583e8e99c148850226f6e389a641b92e8967953713228109f919765abc1f4355e801e8f41842f96210b8d61c7dcc10a477002dcf00 + languageName: node + linkType: hard + "node-gyp@npm:latest": version: 9.4.0 resolution: "node-gyp@npm:9.4.0" @@ -2558,7 +3060,23 @@ __metadata: languageName: node linkType: hard -"once@npm:^1.3.0": +"nth-check@npm:^2.0.1": + version: 2.1.1 + resolution: "nth-check@npm:2.1.1" + dependencies: + boolbase: ^1.0.0 + checksum: 5afc3dafcd1573b08877ca8e6148c52abd565f1d06b1eb08caf982e3fa289a82f2cae697ffb55b5021e146d60443f1590a5d6b944844e944714a5b549675bcd3 + languageName: node + linkType: hard + +"object-inspect@npm:^1.9.0": + version: 1.12.3 + resolution: "object-inspect@npm:1.12.3" + checksum: dabfd824d97a5f407e6d5d24810d888859f6be394d8b733a77442b277e0808860555176719c5905e765e3743a7cada6b8b0a3b85e5331c530fd418cc8ae991db + languageName: node + linkType: hard + +"once@npm:^1.3.0, once@npm:^1.3.1, once@npm:^1.4.0": version: 1.4.0 resolution: "once@npm:1.4.0" dependencies: @@ -2604,6 +3122,7 @@ __metadata: "@typescript-eslint/eslint-plugin": ^5.59.8 "@typescript-eslint/parser": ^5.59.8 "@vscode/test-electron": ^2.3.2 + "@vscode/vsce": ^2.21.1 eslint: ^8.41.0 glob: ^8.1.0 mocha: ^10.2.0 @@ -2709,6 +3228,34 @@ __metadata: languageName: node linkType: hard +"parse-semver@npm:^1.1.1": + version: 1.1.1 + resolution: "parse-semver@npm:1.1.1" + dependencies: + semver: ^5.1.0 + checksum: 0a9abc24b829b4db6dfd733727c2dd15b085c388b7c0bcc03e801412c1ebfe53a087613240f90af0dbed3a3283057bd320014b0df4b9222e01b4e3757b5c6e6a + languageName: node + linkType: hard + +"parse5-htmlparser2-tree-adapter@npm:^7.0.0": + version: 7.0.0 + resolution: "parse5-htmlparser2-tree-adapter@npm:7.0.0" + dependencies: + domhandler: ^5.0.2 + parse5: ^7.0.0 + checksum: fc5d01e07733142a1baf81de5c2a9c41426c04b7ab29dd218acb80cd34a63177c90aff4a4aee66cf9f1d0aeecff1389adb7452ad6f8af0a5888e3e9ad6ef733d + languageName: node + linkType: hard + +"parse5@npm:^7.0.0": + version: 7.1.2 + resolution: "parse5@npm:7.1.2" + dependencies: + entities: ^4.4.0 + checksum: 59465dd05eb4c5ec87b76173d1c596e152a10e290b7abcda1aecf0f33be49646ea74840c69af975d7887543ea45564801736356c568d6b5e71792fd0f4055713 + languageName: node + linkType: hard + "path-exists@npm:^4.0.0": version: 4.0.0 resolution: "path-exists@npm:4.0.0" @@ -2754,6 +3301,13 @@ __metadata: languageName: node linkType: hard +"pend@npm:~1.2.0": + version: 1.2.0 + resolution: "pend@npm:1.2.0" + checksum: 6c72f5243303d9c60bd98e6446ba7d30ae29e3d56fdb6fae8767e8ba6386f33ee284c97efe3230a0d0217e2b1723b8ab490b1bbf34fcbb2180dbc8a9de47850d + languageName: node + linkType: hard + "picocolors@npm:^1.0.0": version: 1.0.0 resolution: "picocolors@npm:1.0.0" @@ -2777,6 +3331,28 @@ __metadata: languageName: node linkType: hard +"prebuild-install@npm:^7.0.1": + version: 7.1.1 + resolution: "prebuild-install@npm:7.1.1" + dependencies: + detect-libc: ^2.0.0 + expand-template: ^2.0.3 + github-from-package: 0.0.0 + minimist: ^1.2.3 + mkdirp-classic: ^0.5.3 + napi-build-utils: ^1.0.1 + node-abi: ^3.3.0 + pump: ^3.0.0 + rc: ^1.2.7 + simple-get: ^4.0.0 + tar-fs: ^2.0.0 + tunnel-agent: ^0.6.0 + bin: + prebuild-install: bin.js + checksum: dbf96d0146b6b5827fc8f67f72074d2e19c69628b9a7a0a17d0fad1bf37e9f06922896972e074197fc00a52eae912993e6ef5a0d471652f561df5cb516f3f467 + languageName: node + linkType: hard + "prelude-ls@npm:^1.2.1": version: 1.2.1 resolution: "prelude-ls@npm:1.2.1" @@ -2810,6 +3386,16 @@ __metadata: languageName: node linkType: hard +"pump@npm:^3.0.0": + version: 3.0.0 + resolution: "pump@npm:3.0.0" + dependencies: + end-of-stream: ^1.1.0 + once: ^1.3.1 + checksum: e42e9229fba14732593a718b04cb5e1cfef8254544870997e0ecd9732b189a48e1256e4e5478148ecb47c8511dca2b09eae56b4d0aad8009e6fac8072923cfc9 + languageName: node + linkType: hard + "punycode@npm:^2.1.0": version: 2.3.0 resolution: "punycode@npm:2.3.0" @@ -2817,6 +3403,15 @@ __metadata: languageName: node linkType: hard +"qs@npm:^6.9.1": + version: 6.11.2 + resolution: "qs@npm:6.11.2" + dependencies: + side-channel: ^1.0.4 + checksum: e812f3c590b2262548647d62f1637b6989cc56656dc960b893fe2098d96e1bd633f36576f4cd7564dfbff9db42e17775884db96d846bebe4f37420d073ecdc0b + languageName: node + linkType: hard + "queue-microtask@npm:^1.2.2": version: 1.2.3 resolution: "queue-microtask@npm:1.2.3" @@ -2833,7 +3428,30 @@ __metadata: languageName: node linkType: hard -"readable-stream@npm:^3.6.0": +"rc@npm:^1.2.7": + version: 1.2.8 + resolution: "rc@npm:1.2.8" + dependencies: + deep-extend: ^0.6.0 + ini: ~1.3.0 + minimist: ^1.2.0 + strip-json-comments: ~2.0.1 + bin: + rc: ./cli.js + checksum: 2e26e052f8be2abd64e6d1dabfbd7be03f80ec18ccbc49562d31f617d0015fbdbcf0f9eed30346ea6ab789e0fdfe4337f033f8016efdbee0df5354751842080e + languageName: node + linkType: hard + +"read@npm:^1.0.7": + version: 1.0.7 + resolution: "read@npm:1.0.7" + dependencies: + mute-stream: ~0.0.4 + checksum: 2777c254e5732cac96f5d0a1c0f6b836c89ae23d8febd405b206f6f24d5de1873420f1a0795e0e3721066650d19adf802c7882c4027143ee0acf942a4f34f97b + languageName: node + linkType: hard + +"readable-stream@npm:^3.1.1, readable-stream@npm:^3.4.0, readable-stream@npm:^3.6.0": version: 3.6.2 resolution: "readable-stream@npm:3.6.2" dependencies: @@ -2947,7 +3565,7 @@ __metadata: languageName: node linkType: hard -"rimraf@npm:^3.0.2": +"rimraf@npm:^3.0.0, rimraf@npm:^3.0.2": version: 3.0.2 resolution: "rimraf@npm:3.0.2" dependencies: @@ -2967,7 +3585,7 @@ __metadata: languageName: node linkType: hard -"safe-buffer@npm:^5.1.0, safe-buffer@npm:~5.2.0": +"safe-buffer@npm:^5.0.1, safe-buffer@npm:^5.1.0, safe-buffer@npm:~5.2.0": version: 5.2.1 resolution: "safe-buffer@npm:5.2.1" checksum: b99c4b41fdd67a6aaf280fcd05e9ffb0813654894223afb78a31f14a19ad220bba8aba1cb14eddce1fcfb037155fe6de4e861784eb434f7d11ed58d1e70dd491 @@ -2988,6 +3606,13 @@ __metadata: languageName: node linkType: hard +"sax@npm:>=0.6.0": + version: 1.3.0 + resolution: "sax@npm:1.3.0" + checksum: 238ab3a9ba8c8f8aaf1c5ea9120386391f6ee0af52f1a6a40bbb6df78241dd05d782f2359d614ac6aae08c4c4125208b456548a6cf68625aa4fe178486e63ecd + languageName: node + linkType: hard + "schema-utils@npm:^3.1.1, schema-utils@npm:^3.2.0": version: 3.3.0 resolution: "schema-utils@npm:3.3.0" @@ -2999,6 +3624,15 @@ __metadata: languageName: node linkType: hard +"semver@npm:^5.1.0": + version: 5.7.2 + resolution: "semver@npm:5.7.2" + bin: + semver: bin/semver + checksum: fb4ab5e0dd1c22ce0c937ea390b4a822147a9c53dbd2a9a0132f12fe382902beef4fbf12cf51bb955248d8d15874ce8cd89532569756384f994309825f10b686 + languageName: node + linkType: hard + "semver@npm:^7.3.4, semver@npm:^7.3.5, semver@npm:^7.3.7, semver@npm:^7.5.2": version: 7.5.4 resolution: "semver@npm:7.5.4" @@ -3067,6 +3701,17 @@ __metadata: languageName: node linkType: hard +"side-channel@npm:^1.0.4": + version: 1.0.4 + resolution: "side-channel@npm:1.0.4" + dependencies: + call-bind: ^1.0.0 + get-intrinsic: ^1.0.2 + object-inspect: ^1.9.0 + checksum: 351e41b947079c10bd0858364f32bb3a7379514c399edb64ab3dce683933483fc63fb5e4efe0a15a2e8a7e3c436b6a91736ddb8d8c6591b0460a24bb4a1ee245 + languageName: node + linkType: hard + "signal-exit@npm:^3.0.7": version: 3.0.7 resolution: "signal-exit@npm:3.0.7" @@ -3081,6 +3726,24 @@ __metadata: languageName: node linkType: hard +"simple-concat@npm:^1.0.0": + version: 1.0.1 + resolution: "simple-concat@npm:1.0.1" + checksum: 4d211042cc3d73a718c21ac6c4e7d7a0363e184be6a5ad25c8a1502e49df6d0a0253979e3d50dbdd3f60ef6c6c58d756b5d66ac1e05cda9cacd2e9fc59e3876a + languageName: node + linkType: hard + +"simple-get@npm:^4.0.0": + version: 4.0.1 + resolution: "simple-get@npm:4.0.1" + dependencies: + decompress-response: ^6.0.0 + once: ^1.3.1 + simple-concat: ^1.0.0 + checksum: e4132fd27cf7af230d853fa45c1b8ce900cb430dd0a3c6d3829649fe4f2b26574c803698076c4006450efb0fad2ba8c5455fbb5755d4b0a5ec42d4f12b31d27e + languageName: node + linkType: hard + "slash@npm:^3.0.0": version: 3.0.0 resolution: "slash@npm:3.0.0" @@ -3207,6 +3870,13 @@ __metadata: languageName: node linkType: hard +"strip-json-comments@npm:~2.0.1": + version: 2.0.1 + resolution: "strip-json-comments@npm:2.0.1" + checksum: 1074ccb63270d32ca28edfb0a281c96b94dc679077828135141f27d52a5a398ef5e78bcf22809d23cadc2b81dfbe345eb5fd8699b385c8b1128907dec4a7d1e1 + languageName: node + linkType: hard + "supports-color@npm:8.1.1, supports-color@npm:^8.0.0": version: 8.1.1 resolution: "supports-color@npm:8.1.1" @@ -3216,6 +3886,15 @@ __metadata: languageName: node linkType: hard +"supports-color@npm:^5.3.0": + version: 5.5.0 + resolution: "supports-color@npm:5.5.0" + dependencies: + has-flag: ^3.0.0 + checksum: 95f6f4ba5afdf92f495b5a912d4abee8dcba766ae719b975c56c084f5004845f6f5a5f7769f52d53f40e21952a6d87411bafe34af4a01e65f9926002e38e1dac + languageName: node + linkType: hard + "supports-color@npm:^7.1.0": version: 7.2.0 resolution: "supports-color@npm:7.2.0" @@ -3239,6 +3918,31 @@ __metadata: languageName: node linkType: hard +"tar-fs@npm:^2.0.0": + version: 2.1.1 + resolution: "tar-fs@npm:2.1.1" + dependencies: + chownr: ^1.1.1 + mkdirp-classic: ^0.5.2 + pump: ^3.0.0 + tar-stream: ^2.1.4 + checksum: f5b9a70059f5b2969e65f037b4e4da2daf0fa762d3d232ffd96e819e3f94665dbbbe62f76f084f1acb4dbdcce16c6e4dac08d12ffc6d24b8d76720f4d9cf032d + languageName: node + linkType: hard + +"tar-stream@npm:^2.1.4": + version: 2.2.0 + resolution: "tar-stream@npm:2.2.0" + dependencies: + bl: ^4.0.3 + end-of-stream: ^1.4.1 + fs-constants: ^1.0.0 + inherits: ^2.0.3 + readable-stream: ^3.1.1 + checksum: 699831a8b97666ef50021c767f84924cfee21c142c2eb0e79c63254e140e6408d6d55a065a2992548e72b06de39237ef2b802b99e3ece93ca3904a37622a66f3 + languageName: node + linkType: hard + "tar@npm:^6.1.11, tar@npm:^6.1.2": version: 6.2.0 resolution: "tar@npm:6.2.0" @@ -3296,6 +4000,15 @@ __metadata: languageName: node linkType: hard +"tmp@npm:^0.2.1": + version: 0.2.1 + resolution: "tmp@npm:0.2.1" + dependencies: + rimraf: ^3.0.0 + checksum: 8b1214654182575124498c87ca986ac53dc76ff36e8f0e0b67139a8d221eaecfdec108c0e6ec54d76f49f1f72ab9325500b246f562b926f85bcdfca8bf35df9e + languageName: node + linkType: hard + "to-regex-range@npm:^5.0.1": version: 5.0.1 resolution: "to-regex-range@npm:5.0.1" @@ -3338,6 +4051,22 @@ __metadata: languageName: node linkType: hard +"tunnel-agent@npm:^0.6.0": + version: 0.6.0 + resolution: "tunnel-agent@npm:0.6.0" + dependencies: + safe-buffer: ^5.0.1 + checksum: 05f6510358f8afc62a057b8b692f05d70c1782b70db86d6a1e0d5e28a32389e52fa6e7707b6c5ecccacc031462e4bc35af85ecfe4bbc341767917b7cf6965711 + languageName: node + linkType: hard + +"tunnel@npm:0.0.6": + version: 0.0.6 + resolution: "tunnel@npm:0.0.6" + checksum: c362948df9ad34b649b5585e54ce2838fa583aa3037091aaed66793c65b423a264e5229f0d7e9a95513a795ac2bd4cb72cda7e89a74313f182c1e9ae0b0994fa + languageName: node + linkType: hard + "type-check@npm:^0.4.0, type-check@npm:~0.4.0": version: 0.4.0 resolution: "type-check@npm:0.4.0" @@ -3354,6 +4083,17 @@ __metadata: languageName: node linkType: hard +"typed-rest-client@npm:^1.8.4": + version: 1.8.11 + resolution: "typed-rest-client@npm:1.8.11" + dependencies: + qs: ^6.9.1 + tunnel: 0.0.6 + underscore: ^1.12.1 + checksum: baba87806381cb8e686e07dc0907bbc4a7588410f13f73f5a9fe662274d1961b84d0037bf2cb3966cb288ed6146b3350edcd896c42422f7dbc06625c347f3035 + languageName: node + linkType: hard + "typescript@npm:^5.1.3": version: 5.2.2 resolution: "typescript@npm:5.2.2" @@ -3374,6 +4114,20 @@ __metadata: languageName: node linkType: hard +"uc.micro@npm:^1.0.1, uc.micro@npm:^1.0.5": + version: 1.0.6 + resolution: "uc.micro@npm:1.0.6" + checksum: 6898bb556319a38e9cf175e3628689347bd26fec15fc6b29fa38e0045af63075ff3fea4cf1fdba9db46c9f0cbf07f2348cd8844889dd31ebd288c29fe0d27e7a + languageName: node + linkType: hard + +"underscore@npm:^1.12.1": + version: 1.13.6 + resolution: "underscore@npm:1.13.6" + checksum: d5cedd14a9d0d91dd38c1ce6169e4455bb931f0aaf354108e47bd46d3f2da7464d49b2171a5cf786d61963204a42d01ea1332a903b7342ad428deaafaf70ec36 + languageName: node + linkType: hard + "unique-filename@npm:^3.0.0": version: 3.0.0 resolution: "unique-filename@npm:3.0.0" @@ -3415,6 +4169,13 @@ __metadata: languageName: node linkType: hard +"url-join@npm:^4.0.1": + version: 4.0.1 + resolution: "url-join@npm:4.0.1" + checksum: f74e868bf25dbc8be6a8d7237d4c36bb5b6c62c72e594d5ab1347fe91d6af7ccd9eb5d621e30152e4da45c2e9a26bec21390e911ab54a62d4d82e76028374ee5 + languageName: node + linkType: hard + "util-deprecate@npm:^1.0.1, util-deprecate@npm:~1.0.1": version: 1.0.2 resolution: "util-deprecate@npm:1.0.2" @@ -3616,6 +4377,23 @@ __metadata: languageName: node linkType: hard +"xml2js@npm:^0.5.0": + version: 0.5.0 + resolution: "xml2js@npm:0.5.0" + dependencies: + sax: ">=0.6.0" + xmlbuilder: ~11.0.0 + checksum: 1aa71d62e5bc2d89138e3929b9ea46459157727759cbc62ef99484b778641c0cd21fb637696c052d901a22f82d092a3e740a16b4ce218e81ac59b933535124ea + languageName: node + linkType: hard + +"xmlbuilder@npm:~11.0.0": + version: 11.0.1 + resolution: "xmlbuilder@npm:11.0.1" + checksum: 7152695e16f1a9976658215abab27e55d08b1b97bca901d58b048d2b6e106b5af31efccbdecf9b07af37c8377d8e7e821b494af10b3a68b0ff4ae60331b415b0 + languageName: node + linkType: hard + "y18n@npm:^5.0.5": version: 5.0.8 resolution: "y18n@npm:5.0.8" @@ -3671,6 +4449,25 @@ __metadata: languageName: node linkType: hard +"yauzl@npm:^2.3.1": + version: 2.10.0 + resolution: "yauzl@npm:2.10.0" + dependencies: + buffer-crc32: ~0.2.3 + fd-slicer: ~1.1.0 + checksum: 7f21fe0bbad6e2cb130044a5d1d0d5a0e5bf3d8d4f8c4e6ee12163ce798fee3de7388d22a7a0907f563ac5f9d40f8699a223d3d5c1718da90b0156da6904022b + languageName: node + linkType: hard + +"yazl@npm:^2.2.2": + version: 2.5.1 + resolution: "yazl@npm:2.5.1" + dependencies: + buffer-crc32: ~0.2.3 + checksum: daec5154b5485d8621bfea359e905ddca0b2f068430a4aa0a802bf5d67391157a383e0c2767acccbf5964264851da643bc740155a9458e2d8dce55b94c1cc2ed + languageName: node + linkType: hard + "yocto-queue@npm:^0.1.0": version: 0.1.0 resolution: "yocto-queue@npm:0.1.0" From f21c46fc42e19ee61f17a0d4e1683600e418ed0d Mon Sep 17 00:00:00 2001 From: 0xMemoryGrinder <35138272+0xMemoryGrinder@users.noreply.github.com> Date: Sat, 7 Oct 2023 15:10:18 -0400 Subject: [PATCH 127/325] chore: delete forgotten remove-me files --- remove-me-02fd9ae66d2443f1a92b.txt | 1 - remove-me-169bf1f7b3864572b7f3.txt | 1 - remove-me-3ebde08f11694be5b2a3.txt | 1 - remove-me-d052cd56fae0467c9d53.txt | 1 - remove-me-f4e34cee726748d383d7.txt | 1 - 5 files changed, 5 deletions(-) delete mode 100644 remove-me-02fd9ae66d2443f1a92b.txt delete mode 100644 remove-me-169bf1f7b3864572b7f3.txt delete mode 100644 remove-me-3ebde08f11694be5b2a3.txt delete mode 100644 remove-me-d052cd56fae0467c9d53.txt delete mode 100644 remove-me-f4e34cee726748d383d7.txt diff --git a/remove-me-02fd9ae66d2443f1a92b.txt b/remove-me-02fd9ae66d2443f1a92b.txt deleted file mode 100644 index 4fd24081..00000000 --- a/remove-me-02fd9ae66d2443f1a92b.txt +++ /dev/null @@ -1 +0,0 @@ -02fd9ae66d2443f1a92b diff --git a/remove-me-169bf1f7b3864572b7f3.txt b/remove-me-169bf1f7b3864572b7f3.txt deleted file mode 100644 index 7be46539..00000000 --- a/remove-me-169bf1f7b3864572b7f3.txt +++ /dev/null @@ -1 +0,0 @@ -169bf1f7b3864572b7f3 diff --git a/remove-me-3ebde08f11694be5b2a3.txt b/remove-me-3ebde08f11694be5b2a3.txt deleted file mode 100644 index b5d657a5..00000000 --- a/remove-me-3ebde08f11694be5b2a3.txt +++ /dev/null @@ -1 +0,0 @@ -3ebde08f11694be5b2a3 diff --git a/remove-me-d052cd56fae0467c9d53.txt b/remove-me-d052cd56fae0467c9d53.txt deleted file mode 100644 index 9026bec9..00000000 --- a/remove-me-d052cd56fae0467c9d53.txt +++ /dev/null @@ -1 +0,0 @@ -d052cd56fae0467c9d53 diff --git a/remove-me-f4e34cee726748d383d7.txt b/remove-me-f4e34cee726748d383d7.txt deleted file mode 100644 index 33c21276..00000000 --- a/remove-me-f4e34cee726748d383d7.txt +++ /dev/null @@ -1 +0,0 @@ -f4e34cee726748d383d7 From 6aa18172e45405548eda7b228fe621e38165524c Mon Sep 17 00:00:00 2001 From: Astrodevs CI Date: Fri, 29 Sep 2023 02:16:27 +0000 Subject: [PATCH 128/325] chore: create branch feature/50-solidity-linter-rules-staging --- remove-me-340ad02ee7b54230a9fa.txt | 1 + 1 file changed, 1 insertion(+) create mode 100644 remove-me-340ad02ee7b54230a9fa.txt diff --git a/remove-me-340ad02ee7b54230a9fa.txt b/remove-me-340ad02ee7b54230a9fa.txt new file mode 100644 index 00000000..2081b8b1 --- /dev/null +++ b/remove-me-340ad02ee7b54230a9fa.txt @@ -0,0 +1 @@ +340ad02ee7b54230a9fa From 05a112b799b3465cd56d6731b9c7475ee84df232 Mon Sep 17 00:00:00 2001 From: Astrodevs CI Date: Fri, 29 Sep 2023 15:40:04 +0000 Subject: [PATCH 129/325] chore: create branch feature/50-solidity-linter-rules/106-one-contract-per-file-rule-staging --- remove-me-a91421aa214c4eed9a31.txt | 1 + 1 file changed, 1 insertion(+) create mode 100644 remove-me-a91421aa214c4eed9a31.txt diff --git a/remove-me-a91421aa214c4eed9a31.txt b/remove-me-a91421aa214c4eed9a31.txt new file mode 100644 index 00000000..1d9cf279 --- /dev/null +++ b/remove-me-a91421aa214c4eed9a31.txt @@ -0,0 +1 @@ +a91421aa214c4eed9a31 From 1c74958410e68c2289687f2a8efce147ba9d5927 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A9o=20Maringer?= Date: Fri, 29 Sep 2023 17:23:36 +0100 Subject: [PATCH 130/325] feat(solidity/linter/core): OneContractPerFile rule --- remove-me-340ad02ee7b54230a9fa.txt | 1 - remove-me-a91421aa214c4eed9a31.txt | 1 - .../src/rules/best_practises/mod.rs | 8 ++ .../best_practises/one_contract_per_file.rs | 73 +++++++++++++++++++ .../OneContractPerFile/.solidhunter.json | 65 +++++++++++++++++ .../testdata/OneContractPerFile/file.sol | 7 ++ .../testdata/OneContractPerFile/findings.csv | 2 + .../core/solidhunter-lib/tests/linter.rs | 1 + 8 files changed, 156 insertions(+), 2 deletions(-) delete mode 100644 remove-me-340ad02ee7b54230a9fa.txt delete mode 100644 remove-me-a91421aa214c4eed9a31.txt create mode 100644 toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/one_contract_per_file.rs create mode 100644 toolchains/solidity/linter/core/solidhunter-lib/testdata/OneContractPerFile/.solidhunter.json create mode 100644 toolchains/solidity/linter/core/solidhunter-lib/testdata/OneContractPerFile/file.sol create mode 100644 toolchains/solidity/linter/core/solidhunter-lib/testdata/OneContractPerFile/findings.csv diff --git a/remove-me-340ad02ee7b54230a9fa.txt b/remove-me-340ad02ee7b54230a9fa.txt deleted file mode 100644 index 2081b8b1..00000000 --- a/remove-me-340ad02ee7b54230a9fa.txt +++ /dev/null @@ -1 +0,0 @@ -340ad02ee7b54230a9fa diff --git a/remove-me-a91421aa214c4eed9a31.txt b/remove-me-a91421aa214c4eed9a31.txt deleted file mode 100644 index 1d9cf279..00000000 --- a/remove-me-a91421aa214c4eed9a31.txt +++ /dev/null @@ -1 +0,0 @@ -a91421aa214c4eed9a31 diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/mod.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/mod.rs index 3991bee1..b5e87eb3 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/mod.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/mod.rs @@ -7,11 +7,14 @@ pub mod function_max_lines; pub mod max_states_count; pub mod reason_string; +pub mod one_contract_per_file; + // List all rules use crate::rules::best_practises::function_max_lines::FunctionMaxLines; use crate::rules::best_practises::line_maxlen::LineMaxLen; use crate::rules::best_practises::max_states_count::MaxStatesCount; +use crate::rules::best_practises::one_contract_per_file::OneContractPerFile; use crate::rules::best_practises::reason_string::ReasonString; use crate::rules::RuleBuilder; @@ -21,6 +24,7 @@ pub fn create_default_rules() -> Vec { MaxStatesCount::create_default(), FunctionMaxLines::create_default(), ReasonString::create_default(), + OneContractPerFile::create_default(), ] } @@ -38,6 +42,10 @@ pub fn create_rules() -> RulesMap { FunctionMaxLines::create, ); rules.insert(reason_string::RULE_ID.to_string(), ReasonString::create); + rules.insert( + one_contract_per_file::RULE_ID.to_string(), + OneContractPerFile::create, + ); rules } diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/one_contract_per_file.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/one_contract_per_file.rs new file mode 100644 index 00000000..0c3b1c01 --- /dev/null +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/one_contract_per_file.rs @@ -0,0 +1,73 @@ +use ast_extractor::Spanned; + +use crate::linter::SolidFile; +use crate::rules::types::*; +use crate::types::*; + +pub const RULE_ID: &str = "one-contract-per-file"; +const MESSAGE: &str = "Only one contract per file"; + +pub struct OneContractPerFile { + data: RuleEntry, +} + +impl OneContractPerFile { + fn create_diag( + &self, + location: (ast_extractor::LineColumn, ast_extractor::LineColumn), + file: &SolidFile, + ) -> LintDiag { + LintDiag { + id: RULE_ID.to_string(), + range: Range { + start: Position { + line: location.0.line, + character: location.0.column, + }, + end: Position { + line: location.1.line, + character: location.1.column, + }, + }, + message: MESSAGE.to_string(), + severity: Some(self.data.severity), + code: None, + source: None, + uri: file.path.clone(), + source_file_content: file.content.clone(), + } + } +} + +impl RuleType for OneContractPerFile { + fn diagnose(&self, file: &SolidFile, _files: &[SolidFile]) -> Vec { + let mut res = Vec::new(); + let contracts = ast_extractor::retriever::retrieve_contract_nodes(&file.data); + let contract_count = contracts.len(); + + if contract_count <= 1 { + return res; + } + + for contract in contracts { + let span = contract.name.span(); + res.push(self.create_diag((span.start(), span.end()), file)); + } + res + } +} + +impl OneContractPerFile { + pub(crate) fn create(data: RuleEntry) -> Box { + let rule = OneContractPerFile { data }; + Box::new(rule) + } + + pub(crate) fn create_default() -> RuleEntry { + RuleEntry { + id: RULE_ID.to_string(), + severity: Severity::WARNING, + data: vec![], + } + } +} diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/OneContractPerFile/.solidhunter.json b/toolchains/solidity/linter/core/solidhunter-lib/testdata/OneContractPerFile/.solidhunter.json new file mode 100644 index 00000000..8f23b009 --- /dev/null +++ b/toolchains/solidity/linter/core/solidhunter-lib/testdata/OneContractPerFile/.solidhunter.json @@ -0,0 +1,65 @@ +{ + "name": "solidhunter", + "includes": [], + "plugins": [], + "rules": [ + { + "id": "line-max-len", + "severity": "WARNING", + "data": [ + "80" + ] + }, + { + "id": "max-states-count", + "severity": "WARNING", + "data": [ + "15" + ] + }, + { + "id": "function-max-lines", + "severity": "WARNING", + "data": [ + "20" + ] + }, + { + "id": "reason-string", + "severity": "WARNING", + "data": [ + "32" + ] + }, + { + "id": "contract-name-pascalcase", + "severity": "WARNING", + "data": [] + }, + { + "id": "func-name-camelcase", + "severity": "WARNING", + "data": [] + }, + { + "id": "func-param-name-camelcase", + "severity": "WARNING", + "data": [] + }, + { + "id": "use-forbidden-name", + "severity": "WARNING", + "data": [] + }, + { + "id": "import-on-top", + "severity": "WARNING", + "data": [] + }, + { + "id": "one-contract-per-file", + "severity": "WARNING", + "data": [] + } + ] +} \ No newline at end of file diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/OneContractPerFile/file.sol b/toolchains/solidity/linter/core/solidhunter-lib/testdata/OneContractPerFile/file.sol new file mode 100644 index 00000000..b073ccd2 --- /dev/null +++ b/toolchains/solidity/linter/core/solidhunter-lib/testdata/OneContractPerFile/file.sol @@ -0,0 +1,7 @@ +pragma solidity 0.8.0; + +contract Test { +} + +contract Test2 { +} diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/OneContractPerFile/findings.csv b/toolchains/solidity/linter/core/solidhunter-lib/testdata/OneContractPerFile/findings.csv new file mode 100644 index 00000000..d6ba4030 --- /dev/null +++ b/toolchains/solidity/linter/core/solidhunter-lib/testdata/OneContractPerFile/findings.csv @@ -0,0 +1,2 @@ +one-contract-per-file:3:9:3:13 +one-contract-per-file:6:9:6:13 \ No newline at end of file diff --git a/toolchains/solidity/linter/core/solidhunter-lib/tests/linter.rs b/toolchains/solidity/linter/core/solidhunter-lib/tests/linter.rs index 618fc090..4b3bd41f 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/tests/linter.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/tests/linter.rs @@ -102,4 +102,5 @@ test_directories! { FunctionParamNameCamelCase, UseForbiddenName, ReasonString, + OneContractPerFile, } From 7469c3217cc3517ee76e2ff8333fd51af1d77cbc Mon Sep 17 00:00:00 2001 From: Astrodevs CI Date: Fri, 29 Sep 2023 18:21:05 +0000 Subject: [PATCH 131/325] chore: create branch feature/50-solidity-linter-rules/119-no-inline-assembly-rule-staging --- remove-me-4d39e9d091cc4ff496a6.txt | 1 + 1 file changed, 1 insertion(+) create mode 100644 remove-me-4d39e9d091cc4ff496a6.txt diff --git a/remove-me-4d39e9d091cc4ff496a6.txt b/remove-me-4d39e9d091cc4ff496a6.txt new file mode 100644 index 00000000..170349e7 --- /dev/null +++ b/remove-me-4d39e9d091cc4ff496a6.txt @@ -0,0 +1 @@ +4d39e9d091cc4ff496a6 From 8ff6b63e898f5a2cff8c042f40d9d507b4689446 Mon Sep 17 00:00:00 2001 From: 0xtekgrinder <0xtekgrinder@protonmail.com> Date: Sun, 24 Sep 2023 17:28:04 -0400 Subject: [PATCH 132/325] feat(solidity/linter/core): NoInlineAssembly Rule --- .../core/solidhunter-lib/src/rules/mod.rs | 3 + .../solidhunter-lib/src/rules/security/mod.rs | 21 +++++ .../src/rules/security/no_inline_assembly.rs | 76 +++++++++++++++++++ .../NoInlineAssembly/.solidhunter.json | 65 ++++++++++++++++ .../testdata/NoInlineAssembly/file.sol | 14 ++++ .../testdata/NoInlineAssembly/findings.csv | 1 + 6 files changed, 180 insertions(+) create mode 100644 toolchains/solidity/linter/core/solidhunter-lib/src/rules/security/mod.rs create mode 100644 toolchains/solidity/linter/core/solidhunter-lib/src/rules/security/no_inline_assembly.rs create mode 100644 toolchains/solidity/linter/core/solidhunter-lib/testdata/NoInlineAssembly/.solidhunter.json create mode 100644 toolchains/solidity/linter/core/solidhunter-lib/testdata/NoInlineAssembly/file.sol create mode 100644 toolchains/solidity/linter/core/solidhunter-lib/testdata/NoInlineAssembly/findings.csv diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/mod.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/mod.rs index 22f2c202..5e9a3e3b 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/mod.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/mod.rs @@ -11,6 +11,7 @@ pub mod best_practises; pub mod miscellaneous; pub mod naming; pub mod order; +pub mod security; pub fn create_default_rules() -> Vec { let mut rules = Vec::new(); @@ -19,6 +20,7 @@ pub fn create_default_rules() -> Vec { rules.append(&mut miscellaneous::create_default_rules()); rules.append(&mut naming::create_default_rules()); rules.append(&mut order::create_default_rules()); + rules.append(&mut security::create_default_rules()); rules } @@ -38,6 +40,7 @@ pub fn create_rules() -> RulesMap { add_rules(&mut rules, naming::create_rules()); add_rules(&mut rules, order::create_rules()); add_rules(&mut rules, miscellaneous::create_rules()); + add_rules(&mut rules, security::create_rules()); rules } diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/security/mod.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/security/mod.rs new file mode 100644 index 00000000..527f1b76 --- /dev/null +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/security/mod.rs @@ -0,0 +1,21 @@ +use crate::rules::types::{RuleEntry, RulesMap}; +use std::collections::HashMap; + +#[macro_use] +pub(crate) mod no_inline_assembly; + +// List all rules +use crate::rules::security::no_inline_assembly::NoInlineAssembly; +use crate::rules::RuleBuilder; + +pub fn create_default_rules() -> Vec { + vec![NoInlineAssembly::create_default()] +} + +pub fn create_rules() -> RulesMap { + let mut rules: HashMap = HashMap::new(); + + rules.insert(no_inline_assembly::RULE_ID.to_string(), NoInlineAssembly::create); + + rules +} diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/security/no_inline_assembly.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/security/no_inline_assembly.rs new file mode 100644 index 00000000..e2f9e870 --- /dev/null +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/security/no_inline_assembly.rs @@ -0,0 +1,76 @@ +use crate::linter::SolidFile; +use crate::rules::types::*; +use crate::types::*; +use ast_extractor::*; + +pub const RULE_ID: &str = "no-inline-assembly"; +const MESSAGE: &str = "Avoid to use inline assembly. It is acceptable only in rare cases"; + +pub struct NoInlineAssembly { + data: RuleEntry, +} + +impl NoInlineAssembly { + fn create_diag( + &self, + file: &SolidFile, + location: (LineColumn, LineColumn), + ) -> LintDiag { + LintDiag { + id: RULE_ID.to_string(), + range: Range { + start: Position { + line: location.0.line, + character: location.0.column, + }, + end: Position { + line: location.1.line, + character: location.1.column, + }, + }, + message: MESSAGE.to_string(), + severity: Some(self.data.severity), + code: None, + source: None, + uri: file.path.clone(), + source_file_content: file.content.clone(), + } + } +} + +impl RuleType for NoInlineAssembly { + fn diagnose(&self, file: &SolidFile, _files: &[SolidFile]) -> Vec { + let mut res = Vec::new(); + + for contract in retriever::retrieve_contract_nodes(&file.data) { + for function in retriever::retrieve_functions_nodes(&contract) { + if function.body().is_none() { + continue; + } + let wow = function.body().unwrap(); + for stmt in wow.iter() { + if let Stmt::Assembly(_) = stmt { + let location = (stmt.span().start(), stmt.span().end()); + res.push(self.create_diag(file, location)); + } + } + } + } + res + } +} + +impl NoInlineAssembly { + pub(crate) fn create(data: RuleEntry) -> Box { + let rule = NoInlineAssembly { data }; + Box::new(rule) + } + + pub(crate) fn create_default() -> RuleEntry { + RuleEntry { + id: RULE_ID.to_string(), + severity: Severity::WARNING, + data: vec![], + } + } +} diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/NoInlineAssembly/.solidhunter.json b/toolchains/solidity/linter/core/solidhunter-lib/testdata/NoInlineAssembly/.solidhunter.json new file mode 100644 index 00000000..8e3f092e --- /dev/null +++ b/toolchains/solidity/linter/core/solidhunter-lib/testdata/NoInlineAssembly/.solidhunter.json @@ -0,0 +1,65 @@ +{ + "name": "solidhunter", + "includes": [], + "plugins": [], + "rules": [ + { + "id": "line-max-len", + "severity": "WARNING", + "data": [ + "80" + ] + }, + { + "id": "no-inline-assembly", + "severity": "WARNING", + "data": [] + }, + { + "id": "max-states-count", + "severity": "WARNING", + "data": [ + "15" + ] + }, + { + "id": "function-max-lines", + "severity": "WARNING", + "data": [ + "20" + ] + }, + { + "id": "reason-string", + "severity": "WARNING", + "data": [ + "32" + ] + }, + { + "id": "contract-name-pascalcase", + "severity": "WARNING", + "data": [] + }, + { + "id": "func-name-camelcase", + "severity": "WARNING", + "data": [] + }, + { + "id": "func-param-name-camelcase", + "severity": "WARNING", + "data": [] + }, + { + "id": "use-forbidden-name", + "severity": "WARNING", + "data": [] + }, + { + "id": "import-on-top", + "severity": "WARNING", + "data": [] + } + ] +} \ No newline at end of file diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/NoInlineAssembly/file.sol b/toolchains/solidity/linter/core/solidhunter-lib/testdata/NoInlineAssembly/file.sol new file mode 100644 index 00000000..4d1947cf --- /dev/null +++ b/toolchains/solidity/linter/core/solidhunter-lib/testdata/NoInlineAssembly/file.sol @@ -0,0 +1,14 @@ +pragma solidity 0.8.0; + +contract Test { + function combineToFunctionPointer(address newAddress, uint256 newSelector) + public + pure + returns (function() external fun) + { + assembly { + fun.selector := newSelector + fun.address := newAddress + } + } +} diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/NoInlineAssembly/findings.csv b/toolchains/solidity/linter/core/solidhunter-lib/testdata/NoInlineAssembly/findings.csv new file mode 100644 index 00000000..d145b7e7 --- /dev/null +++ b/toolchains/solidity/linter/core/solidhunter-lib/testdata/NoInlineAssembly/findings.csv @@ -0,0 +1 @@ +no-inline-assembly:9:8:12:9 \ No newline at end of file From 4370fcf503a312acb6dce7cabc1e06ce36646fdc Mon Sep 17 00:00:00 2001 From: 0xtekgrinder <0xtekgrinder@protonmail.com> Date: Sun, 24 Sep 2023 17:28:15 -0400 Subject: [PATCH 133/325] tests: functionMaxLines test works --- .../core/solidhunter-lib/testdata/FunctionMaxLines/findings.csv | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/FunctionMaxLines/findings.csv b/toolchains/solidity/linter/core/solidhunter-lib/testdata/FunctionMaxLines/findings.csv index eb4ddda0..385f59d7 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/testdata/FunctionMaxLines/findings.csv +++ b/toolchains/solidity/linter/core/solidhunter-lib/testdata/FunctionMaxLines/findings.csv @@ -1 +1 @@ -function-max-lines:4:13:28:1 \ No newline at end of file +function-max-lines:4:13:27:1 \ No newline at end of file From 8d5c842da29f25959e917badb18c65b3cd748e90 Mon Sep 17 00:00:00 2001 From: 0xMemoryGrinder <35138272+0xMemoryGrinder@users.noreply.github.com> Date: Sat, 30 Sep 2023 13:23:57 -0400 Subject: [PATCH 134/325] chore: deleted remove-me --- remove-me-4d39e9d091cc4ff496a6.txt | 1 - 1 file changed, 1 deletion(-) delete mode 100644 remove-me-4d39e9d091cc4ff496a6.txt diff --git a/remove-me-4d39e9d091cc4ff496a6.txt b/remove-me-4d39e9d091cc4ff496a6.txt deleted file mode 100644 index 170349e7..00000000 --- a/remove-me-4d39e9d091cc4ff496a6.txt +++ /dev/null @@ -1 +0,0 @@ -4d39e9d091cc4ff496a6 From 4aff782478833893f49fd98f411d183319af964e Mon Sep 17 00:00:00 2001 From: Astrodevs CI Date: Fri, 29 Sep 2023 19:23:17 +0000 Subject: [PATCH 135/325] chore: create branch feature/50-solidity-linter-rules/117-func-visibility-rule-staging --- remove-me-d5f774861e6e4989b30a.txt | 1 + 1 file changed, 1 insertion(+) create mode 100644 remove-me-d5f774861e6e4989b30a.txt diff --git a/remove-me-d5f774861e6e4989b30a.txt b/remove-me-d5f774861e6e4989b30a.txt new file mode 100644 index 00000000..9886801f --- /dev/null +++ b/remove-me-d5f774861e6e4989b30a.txt @@ -0,0 +1 @@ +d5f774861e6e4989b30a From 0c95f52cfa861916492a91c5d1c69fe85a565a02 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A9o=20Maringer?= Date: Sun, 24 Sep 2023 15:51:12 +0100 Subject: [PATCH 136/325] feat(solidity/linter/core): FuncVisibility rule --- .../src/rules/naming/func_visibility.rs | 91 +++++++++++++++++++ .../solidhunter-lib/src/rules/naming/mod.rs | 8 +- .../FunctionVisibility/.solidhunter.json | 67 ++++++++++++++ .../testdata/FunctionVisibility/file.sol | 10 ++ .../testdata/FunctionVisibility/findings.csv | 2 + .../core/solidhunter-lib/tests/linter.rs | 1 + 6 files changed, 178 insertions(+), 1 deletion(-) create mode 100644 toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/func_visibility.rs create mode 100644 toolchains/solidity/linter/core/solidhunter-lib/testdata/FunctionVisibility/.solidhunter.json create mode 100644 toolchains/solidity/linter/core/solidhunter-lib/testdata/FunctionVisibility/file.sol create mode 100644 toolchains/solidity/linter/core/solidhunter-lib/testdata/FunctionVisibility/findings.csv diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/func_visibility.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/func_visibility.rs new file mode 100644 index 00000000..0a5c931c --- /dev/null +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/func_visibility.rs @@ -0,0 +1,91 @@ +use ast_extractor::Spanned; +use crate::linter::SolidFile; +use crate::rules::types::*; +use crate::types::*; + +pub const RULE_ID: &str = "func-visibility"; +const MESSAGE: &str = "Explicitly mark visibility in function (public, private, internal, external)"; + +pub const DEFAULT_IGNORE_CONSTRUCTORS: bool = false; + +pub struct FuncVisibility { + ignore_constructors: bool, + _data: RuleEntry, +} + +impl FuncVisibility { + fn create_diag( + &self, + location: (ast_extractor::LineColumn, ast_extractor::LineColumn), + file: &SolidFile, + ) -> LintDiag { + LintDiag { + id: RULE_ID.to_string(), + range: Range { + start: Position { + line: location.0.line, + character: location.0.column, + }, + end: Position { + line: location.1.line, + character: location.1.column, + }, + }, + message: MESSAGE.to_string(), + severity: Some(self._data.severity), + code: None, + source: None, + uri: file.path.clone(), + source_file_content: file.content.clone(), + } + } +} + +impl RuleType for FuncVisibility { + fn diagnose(&self, file: &SolidFile, _files: &[SolidFile]) -> Vec { + let mut res = Vec::new(); + let contracts = ast_extractor::retriever::retrieve_contract_nodes(&file.data); + + for contract in contracts { + for function in ast_extractor::retriever::retrieve_functions_nodes(&contract) { + if function.attributes.visibility().is_some() || (function.kind.is_constructor() && self.ignore_constructors) { + continue; + } + if function.kind.is_function() { + let span = function.name.unwrap().span(); + res.push(self.create_diag((span.start(), span.end()), file)); + } else { + let span = function.kind.span(); + res.push(self.create_diag((span.start(), span.end()), file)); + } + } + } + res + } +} + +impl FuncVisibility { + pub(crate) fn create(data: RuleEntry) -> Box { + let mut ignore_constructors = DEFAULT_IGNORE_CONSTRUCTORS; + + if !data.data.is_empty() { + ignore_constructors = match data.data[0].parse::() { + Ok(v) => v, + Err(_) => DEFAULT_IGNORE_CONSTRUCTORS, + }; + } + let rule = FuncVisibility { + ignore_constructors, + _data: data, + }; + Box::new(rule) + } + + pub(crate) fn create_default() -> RuleEntry { + RuleEntry { + id: RULE_ID.to_string(), + severity: Severity::WARNING, + data: vec![DEFAULT_IGNORE_CONSTRUCTORS.to_string()], + } + } +} diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/mod.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/mod.rs index 94654601..37935822 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/mod.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/mod.rs @@ -1,6 +1,6 @@ use crate::rules::naming::contract_name_pascalcase::ContractNamePascalCase; use crate::rules::naming::func_name_camelcase::FuncNameCamelCase; - +use crate::rules::naming::func_visibility::FuncVisibility; use crate::rules::naming::func_param_name_camelcase::FuncParamNameCamelcase; use crate::rules::naming::use_forbidden_name::UseForbiddenName; use crate::rules::types::{RuleEntry, RulesMap}; @@ -12,6 +12,7 @@ pub(crate) mod func_param_name_camelcase; pub(crate) mod contract_name_pascalcase; pub(crate) mod func_name_camelcase; pub(crate) mod use_forbidden_name; +pub(crate) mod func_visibility; // List all rules @@ -21,6 +22,7 @@ pub fn create_default_rules() -> Vec { FuncNameCamelCase::create_default(), FuncParamNameCamelcase::create_default(), UseForbiddenName::create_default(), + FuncVisibility::create_default(), ] } @@ -43,6 +45,10 @@ pub fn create_rules() -> RulesMap { use_forbidden_name::RULE_ID.to_string(), UseForbiddenName::create, ); + rules.insert( + func_visibility::RULE_ID.to_string(), + FuncVisibility::create, + ); rules } diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/FunctionVisibility/.solidhunter.json b/toolchains/solidity/linter/core/solidhunter-lib/testdata/FunctionVisibility/.solidhunter.json new file mode 100644 index 00000000..f0434c83 --- /dev/null +++ b/toolchains/solidity/linter/core/solidhunter-lib/testdata/FunctionVisibility/.solidhunter.json @@ -0,0 +1,67 @@ +{ + "name": "solidhunter", + "includes": [], + "plugins": [], + "rules": [ + { + "id": "line-max-len", + "severity": "WARNING", + "data": [ + "80" + ] + }, + { + "id": "max-states-count", + "severity": "WARNING", + "data": [ + "15" + ] + }, + { + "id": "function-max-lines", + "severity": "WARNING", + "data": [ + "20" + ] + }, + { + "id": "reason-string", + "severity": "WARNING", + "data": [ + "32" + ] + }, + { + "id": "contract-name-pascalcase", + "severity": "WARNING", + "data": [] + }, + { + "id": "func-name-camelcase", + "severity": "WARNING", + "data": [] + }, + { + "id": "func-param-name-camelcase", + "severity": "WARNING", + "data": [] + }, + { + "id": "use-forbidden-name", + "severity": "WARNING", + "data": [] + }, + { + "id": "import-on-top", + "severity": "WARNING", + "data": [] + }, + { + "id": "func-visibility", + "severity": "WARNING", + "data": [ + "false" + ] + } + ] +} \ No newline at end of file diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/FunctionVisibility/file.sol b/toolchains/solidity/linter/core/solidhunter-lib/testdata/FunctionVisibility/file.sol new file mode 100644 index 00000000..79bd6118 --- /dev/null +++ b/toolchains/solidity/linter/core/solidhunter-lib/testdata/FunctionVisibility/file.sol @@ -0,0 +1,10 @@ +pragma solidity 0.8.0; + +contract Test { + function a() internal { } + function b() external { } + function c() private { } + function d() public { } + constructor() { } + function e() { } +} \ No newline at end of file diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/FunctionVisibility/findings.csv b/toolchains/solidity/linter/core/solidhunter-lib/testdata/FunctionVisibility/findings.csv new file mode 100644 index 00000000..e6b83c02 --- /dev/null +++ b/toolchains/solidity/linter/core/solidhunter-lib/testdata/FunctionVisibility/findings.csv @@ -0,0 +1,2 @@ +func-visibility:9:13:9:14 +func-visibility:8:3:8:14 \ No newline at end of file diff --git a/toolchains/solidity/linter/core/solidhunter-lib/tests/linter.rs b/toolchains/solidity/linter/core/solidhunter-lib/tests/linter.rs index 4b3bd41f..9d8052e8 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/tests/linter.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/tests/linter.rs @@ -102,5 +102,6 @@ test_directories! { FunctionParamNameCamelCase, UseForbiddenName, ReasonString, + FunctionVisibility, OneContractPerFile, } From 6410efef8da5a5410e1ddfa257c470c73403c0b0 Mon Sep 17 00:00:00 2001 From: 0xMemoryGrinder <35138272+0xMemoryGrinder@users.noreply.github.com> Date: Fri, 29 Sep 2023 15:24:01 -0400 Subject: [PATCH 137/325] chore: deleted remove-me --- remove-me-d5f774861e6e4989b30a.txt | 1 - 1 file changed, 1 deletion(-) delete mode 100644 remove-me-d5f774861e6e4989b30a.txt diff --git a/remove-me-d5f774861e6e4989b30a.txt b/remove-me-d5f774861e6e4989b30a.txt deleted file mode 100644 index 9886801f..00000000 --- a/remove-me-d5f774861e6e4989b30a.txt +++ /dev/null @@ -1 +0,0 @@ -d5f774861e6e4989b30a From c258dd490eefd7c45bd5f698f3b818896c9d5e2e Mon Sep 17 00:00:00 2001 From: 0xtekgrinder <0xtekgrinder@protonmail.com> Date: Mon, 2 Oct 2023 13:55:12 -0400 Subject: [PATCH 138/325] feat(ast-extractor): add stmts retriever --- libs/ast-extractor/Cargo.toml | 2 +- libs/ast-extractor/src/retriever.rs | 3 + libs/ast-extractor/src/retriever/stmts.rs | 82 +++++++++++++++++++ .../tests/files/stmts/complex.sol | 11 +++ .../ast-extractor/tests/files/stmts/empty.sol | 1 + 5 files changed, 98 insertions(+), 1 deletion(-) create mode 100644 libs/ast-extractor/src/retriever/stmts.rs create mode 100644 libs/ast-extractor/tests/files/stmts/complex.sol create mode 100644 libs/ast-extractor/tests/files/stmts/empty.sol diff --git a/libs/ast-extractor/Cargo.toml b/libs/ast-extractor/Cargo.toml index 315239d3..c7ddac5f 100644 --- a/libs/ast-extractor/Cargo.toml +++ b/libs/ast-extractor/Cargo.toml @@ -8,6 +8,6 @@ edition = "2021" [dependencies] quote = "1.0.33" proc-macro2 = { version = "1.0.66", features = ["span-locations"]} -syn-solidity = { version="0.4.0", features = ["visit"] } +syn-solidity = { version = "0.4.0", features = ["visit"] } thiserror = "1" syn = "2" \ No newline at end of file diff --git a/libs/ast-extractor/src/retriever.rs b/libs/ast-extractor/src/retriever.rs index 7cea2262..304d0fc5 100644 --- a/libs/ast-extractor/src/retriever.rs +++ b/libs/ast-extractor/src/retriever.rs @@ -24,4 +24,7 @@ mod finder; pub use using::*; +mod stmts; +pub use stmts::*; + pub use finder::*; diff --git a/libs/ast-extractor/src/retriever/stmts.rs b/libs/ast-extractor/src/retriever/stmts.rs new file mode 100644 index 00000000..b4310a53 --- /dev/null +++ b/libs/ast-extractor/src/retriever/stmts.rs @@ -0,0 +1,82 @@ +/** + * contract.rs + * Function to retrieve statements nodes from contract AST + * author: 0xtekgrinder +*/ +use syn_solidity::{Stmt, Visit}; + +struct SmtsVisitor { + stmts: Vec, +} + +impl SmtsVisitor { + pub fn new() -> Self { + Self { + stmts: Vec::new(), + } + } +} + +impl<'ast> Visit<'ast> for SmtsVisitor { + fn visit_stmt(&mut self, i: &Stmt) { + self.stmts.push(i.clone()); + syn_solidity::visit::visit_stmt(self, i); + } +} + +pub fn retrieve_stmts_nodes(ast: &syn_solidity::ItemContract) -> Vec { + let mut visitor = SmtsVisitor::new(); + visitor.visit_item_contract(ast); + visitor.stmts +} + +#[cfg(test)] +mod tests { + use proc_macro2::TokenStream; + use syn_solidity::Item; + + use super::*; + use std::fs; + use std::path::PathBuf; + use std::str::FromStr; + + #[test] + fn test_retrieve_stmts_nodes_empty() { + let mut path = PathBuf::from(env!("CARGO_MANIFEST_DIR")); + path.push("tests"); + path.push("files"); + path.push("stmts"); + path.push("empty.sol"); + let source = fs::read_to_string(path).unwrap(); + let tokens = TokenStream::from_str(source.as_str()).unwrap(); + let ast = syn_solidity::parse2(tokens).unwrap(); + let item = ast.items.first().unwrap().clone(); + + if let Item::Contract(contract) = item { + let res = retrieve_stmts_nodes(&contract); + assert_eq!(res.len(), 0); + } else { + panic!("Item is not a contract"); + } + } + + #[test] + fn test_retrieve_stmts_nodes_complex() { + let mut path = PathBuf::from(env!("CARGO_MANIFEST_DIR")); + path.push("tests"); + path.push("files"); + path.push("stmts"); + path.push("complex.sol"); + let source = fs::read_to_string(path).unwrap(); + let tokens = TokenStream::from_str(source.as_str()).unwrap(); + let ast = syn_solidity::parse2(tokens).unwrap(); + let item = ast.items.first().unwrap().clone(); + + if let Item::Contract(contract) = item { + let res = retrieve_stmts_nodes(&contract); + assert_eq!(res.len(), 7); + } else { + panic!("Item is not a contract"); + } + } +} diff --git a/libs/ast-extractor/tests/files/stmts/complex.sol b/libs/ast-extractor/tests/files/stmts/complex.sol new file mode 100644 index 00000000..00f026b3 --- /dev/null +++ b/libs/ast-extractor/tests/files/stmts/complex.sol @@ -0,0 +1,11 @@ +contract Complex { + function trustMe() public pure returns (bool) { + if (true) { + uint256 a = 1; + return true; + } else { + uint256 b = 2; + return false; + } + } +} \ No newline at end of file diff --git a/libs/ast-extractor/tests/files/stmts/empty.sol b/libs/ast-extractor/tests/files/stmts/empty.sol new file mode 100644 index 00000000..89f8fe40 --- /dev/null +++ b/libs/ast-extractor/tests/files/stmts/empty.sol @@ -0,0 +1 @@ +contract Empty {} \ No newline at end of file From 027262a23bd03e9988aa2f3ae0d01eb217e275e5 Mon Sep 17 00:00:00 2001 From: 0xtekgrinder <0xtekgrinder@protonmail.com> Date: Mon, 2 Oct 2023 14:20:24 -0400 Subject: [PATCH 139/325] feat(solidity/linter/core): apply stmts retriever to NoInlineAssembly --- .../src/rules/security/no_inline_assembly.rs | 8 +------- .../solidhunter-lib/testdata/NoInlineAssembly/file.sol | 6 ++++++ .../testdata/NoInlineAssembly/findings.csv | 3 ++- .../solidity/linter/core/solidhunter-lib/tests/linter.rs | 1 + 4 files changed, 10 insertions(+), 8 deletions(-) diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/security/no_inline_assembly.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/security/no_inline_assembly.rs index e2f9e870..a7f524ec 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/security/no_inline_assembly.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/security/no_inline_assembly.rs @@ -43,17 +43,11 @@ impl RuleType for NoInlineAssembly { let mut res = Vec::new(); for contract in retriever::retrieve_contract_nodes(&file.data) { - for function in retriever::retrieve_functions_nodes(&contract) { - if function.body().is_none() { - continue; - } - let wow = function.body().unwrap(); - for stmt in wow.iter() { + for stmt in retriever::retrieve_stmts_nodes(&contract) { if let Stmt::Assembly(_) = stmt { let location = (stmt.span().start(), stmt.span().end()); res.push(self.create_diag(file, location)); } - } } } res diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/NoInlineAssembly/file.sol b/toolchains/solidity/linter/core/solidhunter-lib/testdata/NoInlineAssembly/file.sol index 4d1947cf..c4c3bb16 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/testdata/NoInlineAssembly/file.sol +++ b/toolchains/solidity/linter/core/solidhunter-lib/testdata/NoInlineAssembly/file.sol @@ -6,6 +6,12 @@ contract Test { pure returns (function() external fun) { + if (true) { + assembly { + fun.selector := newSelector + fun.address := newAddress + } + } assembly { fun.selector := newSelector fun.address := newAddress diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/NoInlineAssembly/findings.csv b/toolchains/solidity/linter/core/solidhunter-lib/testdata/NoInlineAssembly/findings.csv index d145b7e7..6d19a348 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/testdata/NoInlineAssembly/findings.csv +++ b/toolchains/solidity/linter/core/solidhunter-lib/testdata/NoInlineAssembly/findings.csv @@ -1 +1,2 @@ -no-inline-assembly:9:8:12:9 \ No newline at end of file +no-inline-assembly:10:12:13:13 +no-inline-assembly:15:8:18:9 \ No newline at end of file diff --git a/toolchains/solidity/linter/core/solidhunter-lib/tests/linter.rs b/toolchains/solidity/linter/core/solidhunter-lib/tests/linter.rs index 9d8052e8..85b8c7a3 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/tests/linter.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/tests/linter.rs @@ -102,6 +102,7 @@ test_directories! { FunctionParamNameCamelCase, UseForbiddenName, ReasonString, + NoInlineAssembly, FunctionVisibility, OneContractPerFile, } From 01d66b0c0f9f34e81ebe88698c63d0ade5a9a604 Mon Sep 17 00:00:00 2001 From: Astrodevs CI Date: Mon, 2 Oct 2023 17:20:56 +0000 Subject: [PATCH 140/325] chore: create branch feature/50-solidity-linter-rules/98-custom-errors-rule-staging --- remove-me-346569b75914458289e6.txt | 1 + 1 file changed, 1 insertion(+) create mode 100644 remove-me-346569b75914458289e6.txt diff --git a/remove-me-346569b75914458289e6.txt b/remove-me-346569b75914458289e6.txt new file mode 100644 index 00000000..f378182f --- /dev/null +++ b/remove-me-346569b75914458289e6.txt @@ -0,0 +1 @@ +346569b75914458289e6 From 32dd7f51fd6df1932cb3ec86ed42734b1cbb7c83 Mon Sep 17 00:00:00 2001 From: 0xtekgrinder <0xtekgrinder@protonmail.com> Date: Mon, 2 Oct 2023 20:45:42 -0400 Subject: [PATCH 141/325] feat(solidity/linter/core): add CustomErrors Rule --- .../linter/core/solidhunter-lib/src/linter.rs | 12 +-- .../src/rules/best_practises/custom_errors.rs | 82 +++++++++++++++++++ .../src/rules/best_practises/mod.rs | 4 + .../solidhunter-lib/src/rules/security/mod.rs | 5 +- .../src/rules/security/no_inline_assembly.rs | 14 ++-- .../testdata/CustomErrors/.solidhunter.json | 65 +++++++++++++++ .../testdata/CustomErrors/file.sol | 17 ++++ .../testdata/CustomErrors/findings.csv | 7 ++ .../core/solidhunter-lib/tests/linter.rs | 1 + 9 files changed, 191 insertions(+), 16 deletions(-) create mode 100644 toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/custom_errors.rs create mode 100644 toolchains/solidity/linter/core/solidhunter-lib/testdata/CustomErrors/.solidhunter.json create mode 100644 toolchains/solidity/linter/core/solidhunter-lib/testdata/CustomErrors/file.sol create mode 100644 toolchains/solidity/linter/core/solidhunter-lib/testdata/CustomErrors/findings.csv diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/linter.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/linter.rs index c61bc1e4..ec431199 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/linter.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/linter.rs @@ -1,6 +1,6 @@ use crate::errors::SolidHunterError; -use crate::rules::factory::RuleFactory; use crate::rules::create_default_rules; +use crate::rules::factory::RuleFactory; use crate::rules::rule_impl::parse_rules; use crate::rules::types::*; use crate::types::*; @@ -23,12 +23,12 @@ pub struct SolidLinter { impl Default for SolidLinter { fn default() -> Self { - SolidLinter::new(&".solidhunter.json".to_string()) + SolidLinter::new(".solidhunter.json") } } impl SolidLinter { - pub fn new(rules_config: &String) -> Self { + pub fn new(rules_config: &str) -> Self { let mut linter = SolidLinter { files: Vec::new(), rule_factory: RuleFactory::default(), @@ -39,7 +39,7 @@ impl SolidLinter { } pub fn new_fileless() -> Self { - let default_rules = create_default_rules(); + let default_rules = create_default_rules(); let mut linter = SolidLinter { files: Vec::new(), rule_factory: RuleFactory::default(), @@ -102,10 +102,10 @@ impl SolidLinter { Ok(res) } - pub fn parse_content(&mut self, filepath: String, content: &String) -> LintResult { + pub fn parse_content(&mut self, filepath: String, content: &str) -> LintResult { let res = ast_extractor::extract::extract_ast_from_content(content)?; - self._add_file(filepath.as_str(), res, content.as_str()); + self._add_file(filepath.as_str(), res, content); let mut res: Vec = Vec::new(); for rule in &self.rules { diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/custom_errors.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/custom_errors.rs new file mode 100644 index 00000000..692cef11 --- /dev/null +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/custom_errors.rs @@ -0,0 +1,82 @@ +use crate::linter::SolidFile; +use crate::rules::types::*; +use crate::types::*; +use ast_extractor::*; + +pub const RULE_ID: &str = "custom-errors"; + +pub struct CustomErrors { + data: RuleEntry, +} + +impl CustomErrors { + fn create_diag( + &self, + file: &SolidFile, + location: (LineColumn, LineColumn), + diag_type: String, + ) -> LintDiag { + LintDiag { + id: RULE_ID.to_string(), + range: Range { + start: Position { + line: location.0.line, + character: location.0.column, + }, + end: Position { + line: location.1.line, + character: location.1.column, + }, + }, + message: format!("Use Custom Errors instead of {} statements", diag_type), + severity: Some(self.data.severity), + code: None, + source: None, + uri: file.path.clone(), + source_file_content: file.content.clone(), + } + } +} + +impl RuleType for CustomErrors { + fn diagnose(&self, file: &SolidFile, _files: &[SolidFile]) -> Vec { + let mut res = Vec::new(); + + for contract in retriever::retrieve_contract_nodes(&file.data) { + for stmt in retriever::retrieve_stmts_nodes(&contract) { + if let Stmt::Revert(revert) = &stmt { + if let Expr::Tuple(_) = &revert.expr { + let location = (revert.span().start(), revert.span().end()); + res.push(self.create_diag(file, location, "revert".to_string())); + } + } + if let Stmt::Expr(expr) = &stmt { + if let Expr::Call(call) = &expr.expr { + if let Expr::Ident(ref ident) = *(call.expr) { + if *ident == "require" || *ident == "assert" { + let location = (expr.span().start(), expr.span().end()); + res.push(self.create_diag(file, location, ident.to_string())); + } + } + } + } + } + } + res + } +} + +impl CustomErrors { + pub(crate) fn create(data: RuleEntry) -> Box { + let rule = CustomErrors { data }; + Box::new(rule) + } + + pub(crate) fn create_default() -> RuleEntry { + RuleEntry { + id: RULE_ID.to_string(), + severity: Severity::WARNING, + data: vec![], + } + } +} diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/mod.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/mod.rs index b5e87eb3..b9b07cb7 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/mod.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/mod.rs @@ -3,6 +3,7 @@ use std::collections::HashMap; #[macro_use] pub mod line_maxlen; +pub mod custom_errors; pub mod function_max_lines; pub mod max_states_count; pub mod reason_string; @@ -11,6 +12,7 @@ pub mod one_contract_per_file; // List all rules +use crate::rules::best_practises::custom_errors::CustomErrors; use crate::rules::best_practises::function_max_lines::FunctionMaxLines; use crate::rules::best_practises::line_maxlen::LineMaxLen; use crate::rules::best_practises::max_states_count::MaxStatesCount; @@ -25,6 +27,7 @@ pub fn create_default_rules() -> Vec { FunctionMaxLines::create_default(), ReasonString::create_default(), OneContractPerFile::create_default(), + CustomErrors::create_default(), ] } @@ -41,6 +44,7 @@ pub fn create_rules() -> RulesMap { function_max_lines::RULE_ID.to_string(), FunctionMaxLines::create, ); + rules.insert(custom_errors::RULE_ID.to_string(), CustomErrors::create); rules.insert(reason_string::RULE_ID.to_string(), ReasonString::create); rules.insert( one_contract_per_file::RULE_ID.to_string(), diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/security/mod.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/security/mod.rs index 527f1b76..fc7d630c 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/security/mod.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/security/mod.rs @@ -15,7 +15,10 @@ pub fn create_default_rules() -> Vec { pub fn create_rules() -> RulesMap { let mut rules: HashMap = HashMap::new(); - rules.insert(no_inline_assembly::RULE_ID.to_string(), NoInlineAssembly::create); + rules.insert( + no_inline_assembly::RULE_ID.to_string(), + NoInlineAssembly::create, + ); rules } diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/security/no_inline_assembly.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/security/no_inline_assembly.rs index a7f524ec..b61f2a1f 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/security/no_inline_assembly.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/security/no_inline_assembly.rs @@ -11,11 +11,7 @@ pub struct NoInlineAssembly { } impl NoInlineAssembly { - fn create_diag( - &self, - file: &SolidFile, - location: (LineColumn, LineColumn), - ) -> LintDiag { + fn create_diag(&self, file: &SolidFile, location: (LineColumn, LineColumn)) -> LintDiag { LintDiag { id: RULE_ID.to_string(), range: Range { @@ -44,10 +40,10 @@ impl RuleType for NoInlineAssembly { for contract in retriever::retrieve_contract_nodes(&file.data) { for stmt in retriever::retrieve_stmts_nodes(&contract) { - if let Stmt::Assembly(_) = stmt { - let location = (stmt.span().start(), stmt.span().end()); - res.push(self.create_diag(file, location)); - } + if let Stmt::Assembly(_) = stmt { + let location = (stmt.span().start(), stmt.span().end()); + res.push(self.create_diag(file, location)); + } } } res diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/CustomErrors/.solidhunter.json b/toolchains/solidity/linter/core/solidhunter-lib/testdata/CustomErrors/.solidhunter.json new file mode 100644 index 00000000..22a078db --- /dev/null +++ b/toolchains/solidity/linter/core/solidhunter-lib/testdata/CustomErrors/.solidhunter.json @@ -0,0 +1,65 @@ +{ + "name": "solidhunter", + "includes": [], + "plugins": [], + "rules": [ + { + "id": "line-max-len", + "severity": "WARNING", + "data": [ + "80" + ] + }, + { + "id": "max-states-count", + "severity": "WARNING", + "data": [ + "15" + ] + }, + { + "id": "function-max-lines", + "severity": "WARNING", + "data": [ + "20" + ] + }, + { + "id": "reason-string", + "severity": "WARNING", + "data": [ + "32" + ] + }, + { + "id": "contract-name-pascalcase", + "severity": "WARNING", + "data": [] + }, + { + "id": "func-name-camelcase", + "severity": "WARNING", + "data": [] + }, + { + "id": "func-param-name-camelcase", + "severity": "WARNING", + "data": [] + }, + { + "id": "use-forbidden-name", + "severity": "WARNING", + "data": [] + }, + { + "id": "import-on-top", + "severity": "WARNING", + "data": [] + }, + { + "id": "custom-errors", + "severity": "WARNING", + "data": [] + } + ] +} \ No newline at end of file diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/CustomErrors/file.sol b/toolchains/solidity/linter/core/solidhunter-lib/testdata/CustomErrors/file.sol new file mode 100644 index 00000000..b3c455ff --- /dev/null +++ b/toolchains/solidity/linter/core/solidhunter-lib/testdata/CustomErrors/file.sol @@ -0,0 +1,17 @@ +pragma solidity 0.8.0; + +contract Test { + error CustomError(string message); + error CustomError2(); + + function test() public { + revert CustomError("test"); + revert CustomError2(); + require(false, "test"); + require(false); + assert(false, "test"); + assert(true); + revert("test"); + revert(); + } +} diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/CustomErrors/findings.csv b/toolchains/solidity/linter/core/solidhunter-lib/testdata/CustomErrors/findings.csv new file mode 100644 index 00000000..b9f84178 --- /dev/null +++ b/toolchains/solidity/linter/core/solidhunter-lib/testdata/CustomErrors/findings.csv @@ -0,0 +1,7 @@ +custom-errors:10:8:10:30 +custom-errors:11:8:11:22 +custom-errors:12:8:12:29 +custom-errors:13:8:13:20 +custom-errors:14:8:14:22 +custom-errors:15:8:15:16 +reason-string:11:8:11:15 \ No newline at end of file diff --git a/toolchains/solidity/linter/core/solidhunter-lib/tests/linter.rs b/toolchains/solidity/linter/core/solidhunter-lib/tests/linter.rs index 85b8c7a3..33f17e3e 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/tests/linter.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/tests/linter.rs @@ -105,4 +105,5 @@ test_directories! { NoInlineAssembly, FunctionVisibility, OneContractPerFile, + CustomErrors, } From e9adb170eec600dfaa9f2669209c81133ab8e44d Mon Sep 17 00:00:00 2001 From: 0xtekgrinder <0xtekgrinder@protonmail.com> Date: Mon, 2 Oct 2023 21:04:20 -0400 Subject: [PATCH 142/325] chore: remove remove-me file --- remove-me-346569b75914458289e6.txt | 1 - 1 file changed, 1 deletion(-) delete mode 100644 remove-me-346569b75914458289e6.txt diff --git a/remove-me-346569b75914458289e6.txt b/remove-me-346569b75914458289e6.txt deleted file mode 100644 index f378182f..00000000 --- a/remove-me-346569b75914458289e6.txt +++ /dev/null @@ -1 +0,0 @@ -346569b75914458289e6 From 26b84359239af947ab31848f82042b26ad9ea8e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A9o=20Maringer?= Date: Tue, 3 Oct 2023 15:30:33 +0100 Subject: [PATCH 143/325] feat(solidity/linter/core): add removeme --- remove-me-a91421aa214c4eed9a31.txt.txt | 1 + 1 file changed, 1 insertion(+) create mode 100644 remove-me-a91421aa214c4eed9a31.txt.txt diff --git a/remove-me-a91421aa214c4eed9a31.txt.txt b/remove-me-a91421aa214c4eed9a31.txt.txt new file mode 100644 index 00000000..89fa57d5 --- /dev/null +++ b/remove-me-a91421aa214c4eed9a31.txt.txt @@ -0,0 +1 @@ +a91421aa214c4eed9a31 \ No newline at end of file From e0ad4ddf129e4b9cc1c338d5513226fe24c42d6f Mon Sep 17 00:00:00 2001 From: Astrodevs CI Date: Fri, 29 Sep 2023 19:14:39 +0000 Subject: [PATCH 144/325] chore: create branch feature/50-solidity-linter-rules/108-event-name-camelcase-rule-staging --- remove-me-46f6f27d2c1440dcba65.txt | 1 + 1 file changed, 1 insertion(+) create mode 100644 remove-me-46f6f27d2c1440dcba65.txt diff --git a/remove-me-46f6f27d2c1440dcba65.txt b/remove-me-46f6f27d2c1440dcba65.txt new file mode 100644 index 00000000..b2cb3a32 --- /dev/null +++ b/remove-me-46f6f27d2c1440dcba65.txt @@ -0,0 +1 @@ +46f6f27d2c1440dcba65 From 5a3bc8a1c68ac5fdd8f9a48a732098987b1a9f05 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A9o=20Maringer?= Date: Sun, 24 Sep 2023 01:04:03 +0100 Subject: [PATCH 145/325] feat(solidity/linter/core): EventNameCamelCase rule --- .../src/rules/naming/event_name_camelcase.rs | 89 +++++++++++++++++++ .../solidhunter-lib/src/rules/naming/mod.rs | 8 ++ .../EventNameCamelCase/.solidhunter.json | 65 ++++++++++++++ .../testdata/EventNameCamelCase/file.sol | 5 ++ .../testdata/EventNameCamelCase/findings.csv | 1 + .../core/solidhunter-lib/tests/linter.rs | 1 + 6 files changed, 169 insertions(+) create mode 100644 toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/event_name_camelcase.rs create mode 100644 toolchains/solidity/linter/core/solidhunter-lib/testdata/EventNameCamelCase/.solidhunter.json create mode 100644 toolchains/solidity/linter/core/solidhunter-lib/testdata/EventNameCamelCase/file.sol create mode 100644 toolchains/solidity/linter/core/solidhunter-lib/testdata/EventNameCamelCase/findings.csv diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/event_name_camelcase.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/event_name_camelcase.rs new file mode 100644 index 00000000..5c59f80d --- /dev/null +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/event_name_camelcase.rs @@ -0,0 +1,89 @@ +use ast_extractor::Spanned; + +use crate::linter::SolidFile; +use crate::rules::types::*; +use crate::types::*; + +pub const RULE_ID: &str = "event-name-camelcase"; +const MESSAGE: &str = "Event name must be in CamelCase"; + +pub struct EventNameCamelCase { + data: RuleEntry, +} + +impl EventNameCamelCase { + fn create_diag( + &self, + location: (ast_extractor::LineColumn, ast_extractor::LineColumn), + file: &SolidFile, + ) -> LintDiag { + LintDiag { + id: RULE_ID.to_string(), + range: Range { + start: Position { + line: location.0.line, + character: location.0.column, + }, + end: Position { + line: location.1.line, + character: location.1.column, + }, + }, + message: MESSAGE.to_string(), + severity: Some(self.data.severity), + code: None, + source: None, + uri: file.path.clone(), + source_file_content: file.content.clone(), + } + } +} + +fn is_camel_case(name: &String) -> bool { + if !(name.chars().nth(0).unwrap_or(' ') >= 'A' && name.chars().nth(0).unwrap_or(' ') <= 'Z') { + return false; + } + if name.contains('_') || name.contains('-') { + return false; + } + true +} + +impl RuleType for EventNameCamelCase { + fn diagnose(&self, file: &SolidFile, _files: &[SolidFile]) -> Vec { + let mut res = Vec::new(); + let contracts = ast_extractor::retriever::retrieve_contract_nodes(&file.data); + + for event in ast_extractor::retriever::retrieve_events_file_nodes(&file.data) { + if !is_camel_case(&event.name.as_string()) { + let span = event.name.span(); + res.push(self.create_diag((span.start(), span.end()), file)); + } + } + + for contract in contracts { + for event in ast_extractor::retriever::retrieve_events_contract_nodes(&contract) { + if !is_camel_case(&event.name.as_string()) { + let span = event.name.span(); + res.push(self.create_diag((span.start(), span.end()), file)); + } + } + } + res + } +} + +impl EventNameCamelCase { + pub(crate) fn create(data: RuleEntry) -> Box { + let rule = EventNameCamelCase { data }; + Box::new(rule) + } + + pub(crate) fn create_default() -> RuleEntry { + RuleEntry { + id: RULE_ID.to_string(), + severity: Severity::WARNING, + data: vec![], + } + } +} diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/mod.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/mod.rs index 37935822..35539d9d 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/mod.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/mod.rs @@ -1,18 +1,21 @@ use crate::rules::naming::contract_name_pascalcase::ContractNamePascalCase; use crate::rules::naming::func_name_camelcase::FuncNameCamelCase; use crate::rules::naming::func_visibility::FuncVisibility; +use crate::rules::naming::event_name_camelcase::EventNameCamelCase; use crate::rules::naming::func_param_name_camelcase::FuncParamNameCamelcase; use crate::rules::naming::use_forbidden_name::UseForbiddenName; use crate::rules::types::{RuleEntry, RulesMap}; use crate::rules::RuleBuilder; use std::collections::HashMap; + #[macro_use] pub(crate) mod func_param_name_camelcase; pub(crate) mod contract_name_pascalcase; pub(crate) mod func_name_camelcase; pub(crate) mod use_forbidden_name; pub(crate) mod func_visibility; +pub(crate) mod event_name_camelcase; // List all rules @@ -23,6 +26,7 @@ pub fn create_default_rules() -> Vec { FuncParamNameCamelcase::create_default(), UseForbiddenName::create_default(), FuncVisibility::create_default(), + EventNameCamelCase::create_default(), ] } @@ -49,6 +53,10 @@ pub fn create_rules() -> RulesMap { func_visibility::RULE_ID.to_string(), FuncVisibility::create, ); + rules.insert( + event_name_camelcase::RULE_ID.to_string(), + EventNameCamelCase::create, + ); rules } diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/EventNameCamelCase/.solidhunter.json b/toolchains/solidity/linter/core/solidhunter-lib/testdata/EventNameCamelCase/.solidhunter.json new file mode 100644 index 00000000..e4376d47 --- /dev/null +++ b/toolchains/solidity/linter/core/solidhunter-lib/testdata/EventNameCamelCase/.solidhunter.json @@ -0,0 +1,65 @@ +{ + "name": "solidhunter", + "includes": [], + "plugins": [], + "rules": [ + { + "id": "line-max-len", + "severity": "WARNING", + "data": [ + "80" + ] + }, + { + "id": "max-states-count", + "severity": "WARNING", + "data": [ + "15" + ] + }, + { + "id": "function-max-lines", + "severity": "WARNING", + "data": [ + "20" + ] + }, + { + "id": "reason-string", + "severity": "WARNING", + "data": [ + "32" + ] + }, + { + "id": "contract-name-pascalcase", + "severity": "WARNING", + "data": [] + }, + { + "id": "func-name-camelcase", + "severity": "WARNING", + "data": [] + }, + { + "id": "func-param-name-camelcase", + "severity": "WARNING", + "data": [] + }, + { + "id": "use-forbidden-name", + "severity": "WARNING", + "data": [] + }, + { + "id": "import-on-top", + "severity": "WARNING", + "data": [] + }, + { + "id": "event-name-camelcase", + "severity": "WARNING", + "data": [] + } + ] +} \ No newline at end of file diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/EventNameCamelCase/file.sol b/toolchains/solidity/linter/core/solidhunter-lib/testdata/EventNameCamelCase/file.sol new file mode 100644 index 00000000..6b454bbc --- /dev/null +++ b/toolchains/solidity/linter/core/solidhunter-lib/testdata/EventNameCamelCase/file.sol @@ -0,0 +1,5 @@ +pragma solidity 0.8.0; + +contract Test { + event deposit(address indexed _from, bytes32 indexed _id, uint _value); +} \ No newline at end of file diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/EventNameCamelCase/findings.csv b/toolchains/solidity/linter/core/solidhunter-lib/testdata/EventNameCamelCase/findings.csv new file mode 100644 index 00000000..f11a6717 --- /dev/null +++ b/toolchains/solidity/linter/core/solidhunter-lib/testdata/EventNameCamelCase/findings.csv @@ -0,0 +1 @@ +event-name-camelcase:4:10:4:17 \ No newline at end of file diff --git a/toolchains/solidity/linter/core/solidhunter-lib/tests/linter.rs b/toolchains/solidity/linter/core/solidhunter-lib/tests/linter.rs index 33f17e3e..e0f3b001 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/tests/linter.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/tests/linter.rs @@ -106,4 +106,5 @@ test_directories! { FunctionVisibility, OneContractPerFile, CustomErrors, + EventNameCamelCase } From 9662675866b0e8b918ff52e1791ff22e44513475 Mon Sep 17 00:00:00 2001 From: 0xMemoryGrinder <35138272+0xMemoryGrinder@users.noreply.github.com> Date: Fri, 29 Sep 2023 15:15:36 -0400 Subject: [PATCH 146/325] chore: deleted remove-me --- remove-me-46f6f27d2c1440dcba65.txt | 1 - 1 file changed, 1 deletion(-) delete mode 100644 remove-me-46f6f27d2c1440dcba65.txt diff --git a/remove-me-46f6f27d2c1440dcba65.txt b/remove-me-46f6f27d2c1440dcba65.txt deleted file mode 100644 index b2cb3a32..00000000 --- a/remove-me-46f6f27d2c1440dcba65.txt +++ /dev/null @@ -1 +0,0 @@ -46f6f27d2c1440dcba65 From f861e6e391890052af02f0a198b8d8dca96ceacd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A9o=20Maringer?= Date: Tue, 3 Oct 2023 18:04:17 +0100 Subject: [PATCH 147/325] feat(solidity/linter/core): add counter test --- .../core/solidhunter-lib/testdata/EventNameCamelCase/file.sol | 4 ++++ .../solidhunter-lib/testdata/EventNameCamelCase/findings.csv | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/EventNameCamelCase/file.sol b/toolchains/solidity/linter/core/solidhunter-lib/testdata/EventNameCamelCase/file.sol index 6b454bbc..c8d097c3 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/testdata/EventNameCamelCase/file.sol +++ b/toolchains/solidity/linter/core/solidhunter-lib/testdata/EventNameCamelCase/file.sol @@ -2,4 +2,8 @@ pragma solidity 0.8.0; contract Test { event deposit(address indexed _from, bytes32 indexed _id, uint _value); + event depositTest(address indexed _from, bytes32 indexed _id, uint _value); + + event Deposit(address indexed _from, bytes32 indexed _id, uint _value); + event DepositTest(address indexed _from, bytes32 indexed _id, uint _value); } \ No newline at end of file diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/EventNameCamelCase/findings.csv b/toolchains/solidity/linter/core/solidhunter-lib/testdata/EventNameCamelCase/findings.csv index f11a6717..75263e39 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/testdata/EventNameCamelCase/findings.csv +++ b/toolchains/solidity/linter/core/solidhunter-lib/testdata/EventNameCamelCase/findings.csv @@ -1 +1,2 @@ -event-name-camelcase:4:10:4:17 \ No newline at end of file +event-name-camelcase:4:10:4:17 +event-name-camelcase:5:10:5:21 \ No newline at end of file From e6f9c8c5214a35c166bed52c114353e9c6422c37 Mon Sep 17 00:00:00 2001 From: Astrodevs CI Date: Fri, 29 Sep 2023 19:11:58 +0000 Subject: [PATCH 148/325] chore: create branch feature/50-solidity-linter-rules/107-const-name-snakecase-rule-staging --- remove-me-359f8e4bca33446f9c21.txt | 1 + 1 file changed, 1 insertion(+) create mode 100644 remove-me-359f8e4bca33446f9c21.txt diff --git a/remove-me-359f8e4bca33446f9c21.txt b/remove-me-359f8e4bca33446f9c21.txt new file mode 100644 index 00000000..79bbbc07 --- /dev/null +++ b/remove-me-359f8e4bca33446f9c21.txt @@ -0,0 +1 @@ +359f8e4bca33446f9c21 From b84a9284bc4e9884e2b7b6f12a9e16d66ba4326e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A9o=20Maringer?= Date: Sat, 23 Sep 2023 21:41:52 +0100 Subject: [PATCH 149/325] feat(solidity/linter/core): ConstNameSnakeCase rule --- .../src/rules/naming/const_name_snakecase.rs | 88 +++++++++++++++++++ .../solidhunter-lib/src/rules/naming/mod.rs | 7 ++ .../ConstNameSnakeCase/.solidhunter.json | 65 ++++++++++++++ .../testdata/ConstNameSnakeCase/file.sol | 5 ++ .../testdata/ConstNameSnakeCase/findings.csv | 1 + .../core/solidhunter-lib/tests/linter.rs | 1 + 6 files changed, 167 insertions(+) create mode 100644 toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/const_name_snakecase.rs create mode 100644 toolchains/solidity/linter/core/solidhunter-lib/testdata/ConstNameSnakeCase/.solidhunter.json create mode 100644 toolchains/solidity/linter/core/solidhunter-lib/testdata/ConstNameSnakeCase/file.sol create mode 100644 toolchains/solidity/linter/core/solidhunter-lib/testdata/ConstNameSnakeCase/findings.csv diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/const_name_snakecase.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/const_name_snakecase.rs new file mode 100644 index 00000000..8adf6fed --- /dev/null +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/const_name_snakecase.rs @@ -0,0 +1,88 @@ +use ast_extractor::{Item, retriever, Spanned}; + +use crate::linter::SolidFile; +use crate::rules::types::*; +use crate::types::*; + +pub const RULE_ID: &str = "const-name-snakecase"; +const MESSAGE: &str = "Constant name must be in capitalized SNAKE_CASE"; + +pub struct ConstNameSnakeCase { + data: RuleEntry, +} + +impl ConstNameSnakeCase { + fn create_diag( + &self, + location: (ast_extractor::LineColumn, ast_extractor::LineColumn), + file: &SolidFile, + ) -> LintDiag { + LintDiag { + id: RULE_ID.to_string(), + range: Range { + start: Position { + line: location.0.line, + character: location.0.column, + }, + end: Position { + line: location.1.line, + character: location.1.column, + }, + }, + message: MESSAGE.to_string(), + severity: Some(self.data.severity), + code: None, + source: None, + uri: file.path.clone(), + source_file_content: file.content.clone(), + } + } +} + +fn is_snake_case(name: &str) -> bool { + for c in name.chars() { + if c != '_' && !c.is_ascii_uppercase() { + false + } + } + true +} + +impl RuleType for ConstNameSnakeCase { + fn diagnose(&self, file: &SolidFile, _files: &[SolidFile]) -> Vec { + let mut res = Vec::new(); + let contracts = retriever::retrieve_contract_nodes(&file.data); + + for contract in contracts.iter() { + for node_var in contract.body.iter() { + let var = match node_var { + Item::Variable(var) => var, + _ => continue, + }; + if !var.attributes.has_constant() { + continue; + } + if !is_snake_case(&var.name.as_string()) { + let span = var.name.span(); + res.push(self.create_diag((span.start(), span.end()), file)); + } + } + } + res + } +} + +impl ConstNameSnakeCase { + pub(crate) fn create(data: RuleEntry) -> Box { + let rule = ConstNameSnakeCase { data }; + Box::new(rule) + } + + pub(crate) fn create_default() -> RuleEntry { + RuleEntry { + id: RULE_ID.to_string(), + severity: Severity::WARNING, + data: vec![], + } + } +} diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/mod.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/mod.rs index 35539d9d..b5c2ed9e 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/mod.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/mod.rs @@ -2,6 +2,7 @@ use crate::rules::naming::contract_name_pascalcase::ContractNamePascalCase; use crate::rules::naming::func_name_camelcase::FuncNameCamelCase; use crate::rules::naming::func_visibility::FuncVisibility; use crate::rules::naming::event_name_camelcase::EventNameCamelCase; +use crate::rules::naming::const_name_snakecase::ConstNameSnakeCase; use crate::rules::naming::func_param_name_camelcase::FuncParamNameCamelcase; use crate::rules::naming::use_forbidden_name::UseForbiddenName; use crate::rules::types::{RuleEntry, RulesMap}; @@ -16,6 +17,7 @@ pub(crate) mod func_name_camelcase; pub(crate) mod use_forbidden_name; pub(crate) mod func_visibility; pub(crate) mod event_name_camelcase; +pub(crate) mod const_name_snakecase; // List all rules @@ -27,6 +29,7 @@ pub fn create_default_rules() -> Vec { UseForbiddenName::create_default(), FuncVisibility::create_default(), EventNameCamelCase::create_default(), + ConstNameSnakeCase::create_default(), ] } @@ -57,6 +60,10 @@ pub fn create_rules() -> RulesMap { event_name_camelcase::RULE_ID.to_string(), EventNameCamelCase::create, ); + rules.insert( + const_name_snakecase::RULE_ID.to_string(), + ConstNameSnakeCase::create + ); rules } diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/ConstNameSnakeCase/.solidhunter.json b/toolchains/solidity/linter/core/solidhunter-lib/testdata/ConstNameSnakeCase/.solidhunter.json new file mode 100644 index 00000000..b1ce835e --- /dev/null +++ b/toolchains/solidity/linter/core/solidhunter-lib/testdata/ConstNameSnakeCase/.solidhunter.json @@ -0,0 +1,65 @@ +{ + "name": "solidhunter", + "includes": [], + "plugins": [], + "rules": [ + { + "id": "line-max-len", + "severity": "WARNING", + "data": [ + "80" + ] + }, + { + "id": "max-states-count", + "severity": "WARNING", + "data": [ + "15" + ] + }, + { + "id": "function-max-lines", + "severity": "WARNING", + "data": [ + "20" + ] + }, + { + "id": "reason-string", + "severity": "WARNING", + "data": [ + "32" + ] + }, + { + "id": "contract-name-pascalcase", + "severity": "WARNING", + "data": [] + }, + { + "id": "func-name-camelcase", + "severity": "WARNING", + "data": [] + }, + { + "id": "func-param-name-camelcase", + "severity": "WARNING", + "data": [] + }, + { + "id": "use-forbidden-name", + "severity": "WARNING", + "data": [] + }, + { + "id": "import-on-top", + "severity": "WARNING", + "data": [] + }, + { + "id": "const-name-snakecase", + "severity": "WARNING", + "data": [] + } + ] +} \ No newline at end of file diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/ConstNameSnakeCase/file.sol b/toolchains/solidity/linter/core/solidhunter-lib/testdata/ConstNameSnakeCase/file.sol new file mode 100644 index 00000000..7a9f640f --- /dev/null +++ b/toolchains/solidity/linter/core/solidhunter-lib/testdata/ConstNameSnakeCase/file.sol @@ -0,0 +1,5 @@ +pragma solidity 0.8.0; + +contract Test { + string public constant symbol = "TEST"; +} \ No newline at end of file diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/ConstNameSnakeCase/findings.csv b/toolchains/solidity/linter/core/solidhunter-lib/testdata/ConstNameSnakeCase/findings.csv new file mode 100644 index 00000000..d2ddf7f0 --- /dev/null +++ b/toolchains/solidity/linter/core/solidhunter-lib/testdata/ConstNameSnakeCase/findings.csv @@ -0,0 +1 @@ +const-name-snakecase:4:27:4:33 \ No newline at end of file diff --git a/toolchains/solidity/linter/core/solidhunter-lib/tests/linter.rs b/toolchains/solidity/linter/core/solidhunter-lib/tests/linter.rs index e0f3b001..51ec9d0a 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/tests/linter.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/tests/linter.rs @@ -107,4 +107,5 @@ test_directories! { OneContractPerFile, CustomErrors, EventNameCamelCase + ConstNameSnakeCase, } From ffec0d647b2199d9b2d332661111f0bb9ac9bc24 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A9o=20Maringer?= Date: Sun, 24 Sep 2023 00:35:14 +0100 Subject: [PATCH 150/325] feat(solidity/linter/core): edit return syntax --- .../solidhunter-lib/src/rules/naming/const_name_snakecase.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/const_name_snakecase.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/const_name_snakecase.rs index 8adf6fed..34aae61c 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/const_name_snakecase.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/const_name_snakecase.rs @@ -42,7 +42,7 @@ impl ConstNameSnakeCase { fn is_snake_case(name: &str) -> bool { for c in name.chars() { if c != '_' && !c.is_ascii_uppercase() { - false + return false; } } true From 2af42613d2742edd4a8fe1a692ff5649ae85b28f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A9o=20Maringer?= Date: Sun, 24 Sep 2023 14:19:18 +0100 Subject: [PATCH 151/325] feat(solidity/linter/core): use if instead of match --- .../src/rules/naming/const_name_snakecase.rs | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/const_name_snakecase.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/const_name_snakecase.rs index 34aae61c..99fe2b24 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/const_name_snakecase.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/const_name_snakecase.rs @@ -55,16 +55,14 @@ impl RuleType for ConstNameSnakeCase { for contract in contracts.iter() { for node_var in contract.body.iter() { - let var = match node_var { - Item::Variable(var) => var, - _ => continue, - }; - if !var.attributes.has_constant() { - continue; - } - if !is_snake_case(&var.name.as_string()) { - let span = var.name.span(); - res.push(self.create_diag((span.start(), span.end()), file)); + if let Item::Variable(var) = node_var { + if !var.attributes.has_constant() { + continue; + } + if !is_snake_case(&var.name.as_string()) { + let span = var.name.span(); + res.push(self.create_diag((span.start(), span.end()), file)); + } } } } From 320417f56d377fb855d9ea0cc678c49297c33ca2 Mon Sep 17 00:00:00 2001 From: 0xMemoryGrinder <35138272+0xMemoryGrinder@users.noreply.github.com> Date: Fri, 29 Sep 2023 15:13:11 -0400 Subject: [PATCH 152/325] chore: deleted remove-me --- remove-me-359f8e4bca33446f9c21.txt | 1 - 1 file changed, 1 deletion(-) delete mode 100644 remove-me-359f8e4bca33446f9c21.txt diff --git a/remove-me-359f8e4bca33446f9c21.txt b/remove-me-359f8e4bca33446f9c21.txt deleted file mode 100644 index 79bbbc07..00000000 --- a/remove-me-359f8e4bca33446f9c21.txt +++ /dev/null @@ -1 +0,0 @@ -359f8e4bca33446f9c21 From 514b56d218ced4a6c92be2cea0dbdbe251c11e3e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A9o=20Maringer?= Date: Tue, 3 Oct 2023 18:01:26 +0100 Subject: [PATCH 153/325] feat(solidity/linter/core): add counter test --- .../core/solidhunter-lib/testdata/ConstNameSnakeCase/file.sol | 3 +++ .../solidhunter-lib/testdata/ConstNameSnakeCase/findings.csv | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/ConstNameSnakeCase/file.sol b/toolchains/solidity/linter/core/solidhunter-lib/testdata/ConstNameSnakeCase/file.sol index 7a9f640f..48bc2518 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/testdata/ConstNameSnakeCase/file.sol +++ b/toolchains/solidity/linter/core/solidhunter-lib/testdata/ConstNameSnakeCase/file.sol @@ -2,4 +2,7 @@ pragma solidity 0.8.0; contract Test { string public constant symbol = "TEST"; + string public constant its_a_test = "TEST"; + string public constant SYMBOL = "TEST"; + string public constant ITS_A_TEST = "TEST"; } \ No newline at end of file diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/ConstNameSnakeCase/findings.csv b/toolchains/solidity/linter/core/solidhunter-lib/testdata/ConstNameSnakeCase/findings.csv index d2ddf7f0..2f6244a2 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/testdata/ConstNameSnakeCase/findings.csv +++ b/toolchains/solidity/linter/core/solidhunter-lib/testdata/ConstNameSnakeCase/findings.csv @@ -1 +1,2 @@ -const-name-snakecase:4:27:4:33 \ No newline at end of file +const-name-snakecase:4:27:4:33 +const-name-snakecase:5:27:4:37 \ No newline at end of file From 5f66ff7c8fd7076992c1f6862f874940e0835c1a Mon Sep 17 00:00:00 2001 From: Astrodevs CI Date: Tue, 3 Oct 2023 15:17:59 +0000 Subject: [PATCH 154/325] chore: create branch feature/50-solidity-linter-rules/120-state-visibility-rule-staging --- remove-me-436d1796492c4a7b805d.txt | 1 + 1 file changed, 1 insertion(+) create mode 100644 remove-me-436d1796492c4a7b805d.txt diff --git a/remove-me-436d1796492c4a7b805d.txt b/remove-me-436d1796492c4a7b805d.txt new file mode 100644 index 00000000..ad2cbfb5 --- /dev/null +++ b/remove-me-436d1796492c4a7b805d.txt @@ -0,0 +1 @@ +436d1796492c4a7b805d From f3cf5fee509400f99f106eb9b9829f56fc768152 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A9o=20Maringer?= Date: Tue, 3 Oct 2023 18:20:16 +0100 Subject: [PATCH 155/325] feat(solidity/linter/core): StateVisibility rule --- remove-me-436d1796492c4a7b805d.txt | 1 - .../solidhunter-lib/src/rules/security/mod.rs | 9 ++- .../src/rules/security/state_visibility.rs | 73 +++++++++++++++++++ .../StateVisibility/.solidhunter.json | 72 ++++++++++++++++++ .../testdata/StateVisibility/file.sol | 11 +++ .../testdata/StateVisibility/findings.csv | 2 + .../core/solidhunter-lib/tests/linter.rs | 1 + 7 files changed, 167 insertions(+), 2 deletions(-) delete mode 100644 remove-me-436d1796492c4a7b805d.txt create mode 100644 toolchains/solidity/linter/core/solidhunter-lib/src/rules/security/state_visibility.rs create mode 100644 toolchains/solidity/linter/core/solidhunter-lib/testdata/StateVisibility/.solidhunter.json create mode 100644 toolchains/solidity/linter/core/solidhunter-lib/testdata/StateVisibility/file.sol create mode 100644 toolchains/solidity/linter/core/solidhunter-lib/testdata/StateVisibility/findings.csv diff --git a/remove-me-436d1796492c4a7b805d.txt b/remove-me-436d1796492c4a7b805d.txt deleted file mode 100644 index ad2cbfb5..00000000 --- a/remove-me-436d1796492c4a7b805d.txt +++ /dev/null @@ -1 +0,0 @@ -436d1796492c4a7b805d diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/security/mod.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/security/mod.rs index fc7d630c..2154a98c 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/security/mod.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/security/mod.rs @@ -3,13 +3,15 @@ use std::collections::HashMap; #[macro_use] pub(crate) mod no_inline_assembly; +pub(crate) mod state_visibility; // List all rules use crate::rules::security::no_inline_assembly::NoInlineAssembly; +use crate::rules::security::state_visibility::StateVisibility; use crate::rules::RuleBuilder; pub fn create_default_rules() -> Vec { - vec![NoInlineAssembly::create_default()] + vec![NoInlineAssembly::create_default(), StateVisibility::create_default()] } pub fn create_rules() -> RulesMap { @@ -20,5 +22,10 @@ pub fn create_rules() -> RulesMap { NoInlineAssembly::create, ); + rules.insert( + state_visibility::RULE_ID.to_string(), + StateVisibility::create, + ); + rules } diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/security/state_visibility.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/security/state_visibility.rs new file mode 100644 index 00000000..6abc8294 --- /dev/null +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/security/state_visibility.rs @@ -0,0 +1,73 @@ +use crate::linter::SolidFile; +use crate::rules::types::*; +use crate::types::*; +use ast_extractor::*; + +pub const RULE_ID: &str = "state-visibility"; +const MESSAGE: &str = "Explicitly mark visibility of state"; + +pub struct StateVisibility { + data: RuleEntry, +} + +impl StateVisibility { + fn create_diag( + &self, + location: (ast_extractor::LineColumn, ast_extractor::LineColumn), + file: &SolidFile, + ) -> LintDiag { + LintDiag { + id: RULE_ID.to_string(), + range: Range { + start: Position { + line: location.0.line, + character: location.0.column, + }, + end: Position { + line: location.1.line, + character: location.1.column, + }, + }, + message: MESSAGE.to_string(), + severity: Some(self.data.severity), + code: None, + source: None, + uri: file.path.clone(), + source_file_content: file.content.clone(), + } + } +} + +impl RuleType for StateVisibility { + fn diagnose(&self, file: &SolidFile, _files: &[SolidFile]) -> Vec { + let mut res = Vec::new(); + let contracts = retriever::retrieve_contract_nodes(&file.data); + + for contract in contracts.iter() { + for node_var in contract.body.iter() { + if let Item::Variable(var) = node_var { + if var.attributes.visibility().is_none() { + let span = var.name.span(); + res.push(self.create_diag((span.start(), span.end()), file)); + } + } + } + } + res + } +} + +impl StateVisibility { + pub(crate) fn create(data: RuleEntry) -> Box { + let rule = StateVisibility { data }; + Box::new(rule) + } + + pub(crate) fn create_default() -> RuleEntry { + RuleEntry { + id: RULE_ID.to_string(), + severity: Severity::WARNING, + data: vec![], + } + } +} diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/StateVisibility/.solidhunter.json b/toolchains/solidity/linter/core/solidhunter-lib/testdata/StateVisibility/.solidhunter.json new file mode 100644 index 00000000..eee3b681 --- /dev/null +++ b/toolchains/solidity/linter/core/solidhunter-lib/testdata/StateVisibility/.solidhunter.json @@ -0,0 +1,72 @@ +{ + "name": "solidhunter", + "includes": [], + "plugins": [], + "rules": [ + { + "id": "line-max-len", + "severity": "WARNING", + "data": [ + "80" + ] + }, + { + "id": "max-states-count", + "severity": "WARNING", + "data": [ + "15" + ] + }, + { + "id": "function-max-lines", + "severity": "WARNING", + "data": [ + "20" + ] + }, + { + "id": "reason-string", + "severity": "WARNING", + "data": [ + "32" + ] + }, + { + "id": "contract-name-pascalcase", + "severity": "WARNING", + "data": [] + }, + { + "id": "func-name-camelcase", + "severity": "WARNING", + "data": [] + }, + { + "id": "func-param-name-camelcase", + "severity": "WARNING", + "data": [] + }, + { + "id": "use-forbidden-name", + "severity": "WARNING", + "data": [] + }, + { + "id": "import-on-top", + "severity": "WARNING", + "data": [] + }, + { + "id": "func-visibility", + "severity": "WARNING", + "data": [ + "false" + ] + }, + { + "id": "state-visibility", + "severity": "WARNING", + "data": [] + } + ] +} \ No newline at end of file diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/StateVisibility/file.sol b/toolchains/solidity/linter/core/solidhunter-lib/testdata/StateVisibility/file.sol new file mode 100644 index 00000000..63956aaf --- /dev/null +++ b/toolchains/solidity/linter/core/solidhunter-lib/testdata/StateVisibility/file.sol @@ -0,0 +1,11 @@ +pragma solidity 0.8.0; + +contract Test { + uint data; + uint public data; + uint private data; + + string data = "test"; + string public data = "test"; + string private data = "test"; +} \ No newline at end of file diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/StateVisibility/findings.csv b/toolchains/solidity/linter/core/solidhunter-lib/testdata/StateVisibility/findings.csv new file mode 100644 index 00000000..f96ed879 --- /dev/null +++ b/toolchains/solidity/linter/core/solidhunter-lib/testdata/StateVisibility/findings.csv @@ -0,0 +1,2 @@ +state-visibility:4:9:4:13 +state-visibility:8:11:8:15 \ No newline at end of file diff --git a/toolchains/solidity/linter/core/solidhunter-lib/tests/linter.rs b/toolchains/solidity/linter/core/solidhunter-lib/tests/linter.rs index 51ec9d0a..af68380f 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/tests/linter.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/tests/linter.rs @@ -108,4 +108,5 @@ test_directories! { CustomErrors, EventNameCamelCase ConstNameSnakeCase, + StateVisibility, } From 851166de43efc4a76c6bb1037378f5eece980518 Mon Sep 17 00:00:00 2001 From: 0xtekgrinder <0xtekgrinder@protonmail.com> Date: Sun, 8 Oct 2023 17:00:02 -0400 Subject: [PATCH 156/325] chore(solidity/linter/core): test all the workspace --- toolchains/solidity/linter/core/Cargo.toml | 5 +++++ toolchains/solidity/linter/core/package.json | 2 +- .../solidity/linter/core/solidhunter-lib/tests/linter.rs | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/toolchains/solidity/linter/core/Cargo.toml b/toolchains/solidity/linter/core/Cargo.toml index a240ad10..7d38fad5 100644 --- a/toolchains/solidity/linter/core/Cargo.toml +++ b/toolchains/solidity/linter/core/Cargo.toml @@ -1,3 +1,8 @@ +[workspace] +members = [ + "solidhunter-lib" +] + [package] name = "solidhunter" version = "0.0.1" diff --git a/toolchains/solidity/linter/core/package.json b/toolchains/solidity/linter/core/package.json index 19e9ee70..7567ffa6 100644 --- a/toolchains/solidity/linter/core/package.json +++ b/toolchains/solidity/linter/core/package.json @@ -6,7 +6,7 @@ "build": "cargo build --release", "lint": "cargo clippy -- -D warnings", "format": "cargo fmt", - "test": "cargo test", + "test": "cargo test --workspace", "publish": "yarn run build && cp target/release/solidhunter ../extension/core" } } diff --git a/toolchains/solidity/linter/core/solidhunter-lib/tests/linter.rs b/toolchains/solidity/linter/core/solidhunter-lib/tests/linter.rs index af68380f..99a44b9e 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/tests/linter.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/tests/linter.rs @@ -106,7 +106,7 @@ test_directories! { FunctionVisibility, OneContractPerFile, CustomErrors, - EventNameCamelCase + EventNameCamelCase, ConstNameSnakeCase, StateVisibility, } From c87cb2599078a4059e3d2de094d14038b75e54e8 Mon Sep 17 00:00:00 2001 From: 0xSwapFeeder Date: Sun, 8 Oct 2023 17:32:03 -0400 Subject: [PATCH 157/325] chore(solidity/linter/core): fixed test engine that was asserting true even if only one test passed --- .../core/solidhunter-lib/tests/linter.rs | 33 ++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) diff --git a/toolchains/solidity/linter/core/solidhunter-lib/tests/linter.rs b/toolchains/solidity/linter/core/solidhunter-lib/tests/linter.rs index 99a44b9e..589c2ec7 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/tests/linter.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/tests/linter.rs @@ -53,6 +53,9 @@ fn test_linter(config: &str, source: &str, expected_findings: &Vec) { let mut linter: SolidLinter = SolidLinter::new(&String::from(config)); let result = linter.parse_file(String::from(source)); + let mut found_findings: Vec<&Finding> = Vec::new(); + let mut not_found_findings: Vec<&Finding> = Vec::new(); + match result { Ok(diags) => { assert_eq!( @@ -68,13 +71,41 @@ fn test_linter(config: &str, source: &str, expected_findings: &Vec) { if (diag.range.start == expected_finding.start) && (diag.range.end == expected_finding.end) && (diag.id == expected_finding.id) + { + found_findings.push(expected_finding.clone()); + break; + } + } + } + for (_, expected_finding) in expected_findings.iter().enumerate() { + found = false; + for (_, found_finding) in found_findings.iter().enumerate() { + if (expected_finding.start == found_finding.start) + && (expected_finding.end == found_finding.end) + && (expected_finding.id == found_finding.id) { found = true; break; } } + if found == false { + not_found_findings.push(expected_finding.clone()); + } + } + if not_found_findings.len() > 0 { + println!("Missing diagnostics:"); + for (_, finding) in not_found_findings.iter().enumerate() { + println!( + "{}:{}:{}:{}:{}", + finding.id, + finding.start.line, + finding.start.character, + finding.end.line, + finding.end.character + ); + } } - assert_eq!(found, true, "Can't find the diagnostic for {}", source); + assert_eq!(found_findings.len(), expected_findings.len(), "There are some missing diagnostics!"); } Err(e) => { panic!("{}", e); From 74d42c46754e25af909e733974717adc20e82976 Mon Sep 17 00:00:00 2001 From: 0xtekgrinder <0xtekgrinder@protonmail.com> Date: Sun, 8 Oct 2023 17:49:23 -0400 Subject: [PATCH 158/325] fix(solidity/linter/core): custom errors now takes right span --- .../src/rules/best_practises/custom_errors.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/custom_errors.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/custom_errors.rs index 692cef11..694d627b 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/custom_errors.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/custom_errors.rs @@ -16,6 +16,7 @@ impl CustomErrors { location: (LineColumn, LineColumn), diag_type: String, ) -> LintDiag { + println!("{:?}", location); LintDiag { id: RULE_ID.to_string(), range: Range { @@ -46,7 +47,7 @@ impl RuleType for CustomErrors { for stmt in retriever::retrieve_stmts_nodes(&contract) { if let Stmt::Revert(revert) = &stmt { if let Expr::Tuple(_) = &revert.expr { - let location = (revert.span().start(), revert.span().end()); + let location = (revert.span().start(), revert.expr.span().end()); res.push(self.create_diag(file, location, "revert".to_string())); } } @@ -54,7 +55,7 @@ impl RuleType for CustomErrors { if let Expr::Call(call) = &expr.expr { if let Expr::Ident(ref ident) = *(call.expr) { if *ident == "require" || *ident == "assert" { - let location = (expr.span().start(), expr.span().end()); + let location = (call.span().start(), call.span().end()); res.push(self.create_diag(file, location, ident.to_string())); } } From e58bcdec0c09ff772cf51b60ed4ec11f457d1f4a Mon Sep 17 00:00:00 2001 From: 0xtekgrinder <0xtekgrinder@protonmail.com> Date: Sun, 8 Oct 2023 17:58:41 -0400 Subject: [PATCH 159/325] fix(solidity/linter/core): one contract per file now takes only the second elements and so on --- .../solidhunter-lib/src/rules/best_practises/custom_errors.rs | 1 - .../src/rules/best_practises/one_contract_per_file.rs | 2 +- .../solidhunter-lib/testdata/OneContractPerFile/findings.csv | 3 +-- .../solidity/linter/core/solidhunter-lib/tests/linter.rs | 2 +- 4 files changed, 3 insertions(+), 5 deletions(-) diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/custom_errors.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/custom_errors.rs index 694d627b..c91e9b0c 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/custom_errors.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/custom_errors.rs @@ -16,7 +16,6 @@ impl CustomErrors { location: (LineColumn, LineColumn), diag_type: String, ) -> LintDiag { - println!("{:?}", location); LintDiag { id: RULE_ID.to_string(), range: Range { diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/one_contract_per_file.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/one_contract_per_file.rs index 0c3b1c01..9894ba3c 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/one_contract_per_file.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/one_contract_per_file.rs @@ -49,7 +49,7 @@ impl RuleType for OneContractPerFile { return res; } - for contract in contracts { + for contract in &contracts[1..] { let span = contract.name.span(); res.push(self.create_diag((span.start(), span.end()), file)); } diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/OneContractPerFile/findings.csv b/toolchains/solidity/linter/core/solidhunter-lib/testdata/OneContractPerFile/findings.csv index d6ba4030..1b6de611 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/testdata/OneContractPerFile/findings.csv +++ b/toolchains/solidity/linter/core/solidhunter-lib/testdata/OneContractPerFile/findings.csv @@ -1,2 +1 @@ -one-contract-per-file:3:9:3:13 -one-contract-per-file:6:9:6:13 \ No newline at end of file +one-contract-per-file:6:9:6:14 \ No newline at end of file diff --git a/toolchains/solidity/linter/core/solidhunter-lib/tests/linter.rs b/toolchains/solidity/linter/core/solidhunter-lib/tests/linter.rs index 589c2ec7..6c071723 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/tests/linter.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/tests/linter.rs @@ -64,7 +64,7 @@ fn test_linter(config: &str, source: &str, expected_findings: &Vec) { "Wrong number of findings for {}", source ); - let mut found = false; + let mut found; for (_, diag) in diags.iter().enumerate() { for (_, expected_finding) in expected_findings.iter().enumerate() { From 131caaf35b17a13aeeff13946757676b57af7651 Mon Sep 17 00:00:00 2001 From: 0xtekgrinder <0xtekgrinder@protonmail.com> Date: Sun, 8 Oct 2023 18:00:47 -0400 Subject: [PATCH 160/325] fix(solidity/linter/core): const name snakecase wrong findings --- .../solidhunter-lib/testdata/ConstNameSnakeCase/findings.csv | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/ConstNameSnakeCase/findings.csv b/toolchains/solidity/linter/core/solidhunter-lib/testdata/ConstNameSnakeCase/findings.csv index 2f6244a2..fbb49938 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/testdata/ConstNameSnakeCase/findings.csv +++ b/toolchains/solidity/linter/core/solidhunter-lib/testdata/ConstNameSnakeCase/findings.csv @@ -1,2 +1,2 @@ const-name-snakecase:4:27:4:33 -const-name-snakecase:5:27:4:37 \ No newline at end of file +const-name-snakecase:5:27:5:37 \ No newline at end of file From fe1c5420f681fef5985b7952b8660b420e8283e0 Mon Sep 17 00:00:00 2001 From: 0xSwapFeeder Date: Sun, 8 Oct 2023 18:15:24 -0400 Subject: [PATCH 161/325] fix(solidity/linter/core): added usable logs for tests --- .../core/solidhunter-lib/tests/linter.rs | 37 ++++++++++++++----- 1 file changed, 27 insertions(+), 10 deletions(-) diff --git a/toolchains/solidity/linter/core/solidhunter-lib/tests/linter.rs b/toolchains/solidity/linter/core/solidhunter-lib/tests/linter.rs index 6c071723..71a906b7 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/tests/linter.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/tests/linter.rs @@ -1,5 +1,5 @@ use solidhunter_lib::linter::SolidLinter; -use solidhunter_lib::types::Position; +use solidhunter_lib::types::{LintDiag, Position}; use std::{fs, path::PathBuf}; struct Finding { @@ -55,27 +55,29 @@ fn test_linter(config: &str, source: &str, expected_findings: &Vec) { let result = linter.parse_file(String::from(source)); let mut found_findings: Vec<&Finding> = Vec::new(); let mut not_found_findings: Vec<&Finding> = Vec::new(); + let mut not_needed_findings: Vec<&LintDiag> = Vec::new(); + let mut not_needed_found = false; + let mut not_found = false; match result { Ok(diags) => { - assert_eq!( - diags.len(), - expected_findings.len(), - "Wrong number of findings for {}", - source - ); let mut found; - for (_, diag) in diags.iter().enumerate() { + found = false; for (_, expected_finding) in expected_findings.iter().enumerate() { if (diag.range.start == expected_finding.start) && (diag.range.end == expected_finding.end) && (diag.id == expected_finding.id) { found_findings.push(expected_finding.clone()); + found = true; break; } } + if !found { + not_needed_findings.push(diag); + } + } for (_, expected_finding) in expected_findings.iter().enumerate() { found = false; @@ -92,8 +94,22 @@ fn test_linter(config: &str, source: &str, expected_findings: &Vec) { not_found_findings.push(expected_finding.clone()); } } + if not_needed_findings.len() > 0 { + println!("Diagnostics not expected:"); + for (_, finding) in not_needed_findings.iter().enumerate() { + println!( + "{}:{}:{}:{}:{}", + finding.id, + finding.range.start.line, + finding.range.start.character, + finding.range.end.line, + finding.range.end.character + ); + } + not_needed_found = true; + } if not_found_findings.len() > 0 { - println!("Missing diagnostics:"); + println!("\nMissing diagnostics:"); for (_, finding) in not_found_findings.iter().enumerate() { println!( "{}:{}:{}:{}:{}", @@ -104,8 +120,9 @@ fn test_linter(config: &str, source: &str, expected_findings: &Vec) { finding.end.character ); } + not_found = true; } - assert_eq!(found_findings.len(), expected_findings.len(), "There are some missing diagnostics!"); + assert_eq!(not_needed_found == true || not_found == true, false, "There are some missing or not needed diagnostics:\n Not needed found: {}\n Not found: {}", not_needed_findings.len(), not_found_findings.len()); } Err(e) => { panic!("{}", e); From 791ab292abc304e45d80fdbd224a2ac216edc9a0 Mon Sep 17 00:00:00 2001 From: 0xtekgrinder <0xtekgrinder@protonmail.com> Date: Sun, 8 Oct 2023 18:24:05 -0400 Subject: [PATCH 162/325] fix(solidity/linter/core): function visibility now takes good span --- .../core/solidhunter-lib/src/rules/naming/func_visibility.rs | 3 +-- .../solidhunter-lib/testdata/FunctionVisibility/findings.csv | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/func_visibility.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/func_visibility.rs index 0a5c931c..54a0135e 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/func_visibility.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/func_visibility.rs @@ -52,8 +52,7 @@ impl RuleType for FuncVisibility { continue; } if function.kind.is_function() { - let span = function.name.unwrap().span(); - res.push(self.create_diag((span.start(), span.end()), file)); + res.push(self.create_diag((function.kind.span().start(), function.span().end()), file)); } else { let span = function.kind.span(); res.push(self.create_diag((span.start(), span.end()), file)); diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/FunctionVisibility/findings.csv b/toolchains/solidity/linter/core/solidhunter-lib/testdata/FunctionVisibility/findings.csv index e6b83c02..8bb1a14b 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/testdata/FunctionVisibility/findings.csv +++ b/toolchains/solidity/linter/core/solidhunter-lib/testdata/FunctionVisibility/findings.csv @@ -1,2 +1,2 @@ -func-visibility:9:13:9:14 -func-visibility:8:3:8:14 \ No newline at end of file +func-visibility:9:4:9:14 +func-visibility:8:4:8:15 \ No newline at end of file From 14fb1a6d56127396bfa6321e28cd23d282efb4ed Mon Sep 17 00:00:00 2001 From: 0xtekgrinder <0xtekgrinder@protonmail.com> Date: Sun, 8 Oct 2023 18:28:34 -0400 Subject: [PATCH 163/325] fix(solidity/linter/core): UseForbidenName has now correct findings --- .../core/solidhunter-lib/testdata/UseForbiddenName/findings.csv | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/UseForbiddenName/findings.csv b/toolchains/solidity/linter/core/solidhunter-lib/testdata/UseForbiddenName/findings.csv index 5f69d1f9..09289f01 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/testdata/UseForbiddenName/findings.csv +++ b/toolchains/solidity/linter/core/solidhunter-lib/testdata/UseForbiddenName/findings.csv @@ -1,3 +1,3 @@ use-forbidden-name:4:19:4:20 use-forbidden-name:5:19:5:20 -use-forbidden-name:5:19:5:20 \ No newline at end of file +use-forbidden-name:6:19:6:20 \ No newline at end of file From bccb3d51ea55b7fc73bf07485f44e15227cc9962 Mon Sep 17 00:00:00 2001 From: 0xSwapFeeder Date: Sun, 8 Oct 2023 19:25:50 -0400 Subject: [PATCH 164/325] chore: fixed lint --- .../src/rules/naming/event_name_camelcase.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/event_name_camelcase.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/event_name_camelcase.rs index 5c59f80d..c4cc09b6 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/event_name_camelcase.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/event_name_camelcase.rs @@ -39,8 +39,8 @@ impl EventNameCamelCase { } } -fn is_camel_case(name: &String) -> bool { - if !(name.chars().nth(0).unwrap_or(' ') >= 'A' && name.chars().nth(0).unwrap_or(' ') <= 'Z') { +fn is_camel_case(name: &str) -> bool { + if !(name.chars().next().unwrap_or(' ') >= 'A' && name.chars().next().unwrap_or(' ') <= 'Z') { return false; } if name.contains('_') || name.contains('-') { @@ -55,7 +55,7 @@ impl RuleType for EventNameCamelCase { let contracts = ast_extractor::retriever::retrieve_contract_nodes(&file.data); for event in ast_extractor::retriever::retrieve_events_file_nodes(&file.data) { - if !is_camel_case(&event.name.as_string()) { + if !is_camel_case(&event.name.to_string()) { let span = event.name.span(); res.push(self.create_diag((span.start(), span.end()), file)); } @@ -63,7 +63,7 @@ impl RuleType for EventNameCamelCase { for contract in contracts { for event in ast_extractor::retriever::retrieve_events_contract_nodes(&contract) { - if !is_camel_case(&event.name.as_string()) { + if !is_camel_case(&event.name.to_string()) { let span = event.name.span(); res.push(self.create_diag((span.start(), span.end()), file)); } From ba700c121e29f87101e2697dc6862d0fb75a7c79 Mon Sep 17 00:00:00 2001 From: 0xMemoryGrinder <35138272+0xMemoryGrinder@users.noreply.github.com> Date: Sun, 8 Oct 2023 20:31:23 -0400 Subject: [PATCH 165/325] fix(solidity/linter/core): corrected reason string end character chore(solidity/linter/core): removed useless default data for reason string --- libs/ast-extractor/src/retriever.rs | 3 + libs/ast-extractor/src/retriever/expr_call.rs | 64 +++++++++++++++++++ .../tests/files/expr_calls/one.sol | 8 +++ .../src/rules/best_practises/reason_string.rs | 37 +---------- .../testdata/ReasonString/findings.csv | 2 +- 5 files changed, 78 insertions(+), 36 deletions(-) create mode 100644 libs/ast-extractor/src/retriever/expr_call.rs create mode 100644 libs/ast-extractor/tests/files/expr_calls/one.sol diff --git a/libs/ast-extractor/src/retriever.rs b/libs/ast-extractor/src/retriever.rs index 304d0fc5..896fbd61 100644 --- a/libs/ast-extractor/src/retriever.rs +++ b/libs/ast-extractor/src/retriever.rs @@ -28,3 +28,6 @@ mod stmts; pub use stmts::*; pub use finder::*; + +mod expr_call; +pub use expr_call::*; \ No newline at end of file diff --git a/libs/ast-extractor/src/retriever/expr_call.rs b/libs/ast-extractor/src/retriever/expr_call.rs new file mode 100644 index 00000000..62065000 --- /dev/null +++ b/libs/ast-extractor/src/retriever/expr_call.rs @@ -0,0 +1,64 @@ +/** + * expr_call.rs + * Function to retrieve expr calls from AST + * author: EnergyCube + * + * !!! UNTESTED !!! +*/ +use syn_solidity::{ExprCall, Visit}; + +struct CallVisitor { + calls: Vec, +} + +impl CallVisitor { + pub fn new() -> Self { + Self { calls: Vec::new() } + } +} + +impl<'ast> Visit<'ast> for CallVisitor { + fn visit_expr_call(&mut self, i: &ExprCall) { + self.calls.push(i.clone()); + syn_solidity::visit::visit_expr_call(self, i); + } +} + +pub fn retrieve_expr_call_nodes(ast: &syn_solidity::File) -> Vec { + let mut visitor = CallVisitor::new(); + visitor.visit_file(ast); + visitor.calls +} + +#[cfg(test)] +mod tests { + use proc_macro2::TokenStream; + + use super::*; + use std::fs; + use std::path::PathBuf; + use std::str::FromStr; + + #[test] + fn test_retrieve_expr_call_nodes_empty() { + let source = String::from("pragma solidity ^0.8.0;"); + let tokens = TokenStream::from_str(source.as_str()).unwrap(); + let ast = syn_solidity::parse2(tokens).unwrap(); + let res = retrieve_expr_call_nodes(&ast); + assert_eq!(res.len(), 0); + } + + #[test] + fn test_retrieve_expr_call_nodes_one() { + let mut path = PathBuf::from(env!("CARGO_MANIFEST_DIR")); + path.push("tests"); + path.push("files"); + path.push("expr_calls"); + path.push("one.sol"); + let source = fs::read_to_string(path).unwrap(); + let tokens = TokenStream::from_str(source.as_str()).unwrap(); + let ast = syn_solidity::parse2(tokens).unwrap(); + let res = retrieve_expr_call_nodes(&ast); + assert_eq!(res.len(), 1); + } +} \ No newline at end of file diff --git a/libs/ast-extractor/tests/files/expr_calls/one.sol b/libs/ast-extractor/tests/files/expr_calls/one.sol new file mode 100644 index 00000000..c7adfec1 --- /dev/null +++ b/libs/ast-extractor/tests/files/expr_calls/one.sol @@ -0,0 +1,8 @@ +contract One { + + function emptyfn() public { } + + function emptyCall() public { + emptyCall(); + } +} \ No newline at end of file diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/reason_string.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/reason_string.rs index 0a0b832a..13ab1c2b 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/reason_string.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/reason_string.rs @@ -7,9 +7,6 @@ use crate::types::{LintDiag, Position, Range, Severity}; pub const RULE_ID: &str = "reason-string"; const DEFAULT_SEVERITY: Severity = Severity::WARNING; -// Specific -const DEFAULT_LENGTH: u32 = 32; - pub struct ReasonString { max_length: u32, data: RuleEntry, @@ -44,41 +41,11 @@ impl ReasonString { } } -fn get_call_expressions(ast_nodes: &ast_extractor::File) -> Vec { - let mut res = Vec::new(); - let mut calls: Vec = Vec::new(); - let contract = ast_nodes - .items - .iter() - .filter_map(|item| match item { - ast_extractor::Item::Contract(contract) => Some(contract), - _ => None, - }) - .next(); - - if let Some(contract) = contract { - res = ast_extractor::retriever::retrieve_functions_nodes(contract); - } - for func in res { - if let FunctionBody::Block(fn_body) = func.body { - for stmt in fn_body.stmts { - if let Stmt::Expr(stmt_expr) = stmt { - if let Expr::Call(call_expr) = stmt_expr.expr { - calls.push(call_expr); - } - } - } - } - } - calls -} - impl RuleType for ReasonString { fn diagnose(&self, file: &SolidFile, _files: &[SolidFile]) -> Vec { let mut res = Vec::new(); - let calls = get_call_expressions(&file.data); - for call_expr in calls { + for call_expr in retriever::retrieve_expr_call_nodes(&file.data) { let expr_require = match *call_expr.expr { Expr::Ident(require_ident) => require_ident, _ => continue, @@ -147,7 +114,7 @@ impl ReasonString { RuleEntry { id: RULE_ID.to_string(), severity: DEFAULT_SEVERITY, - data: vec![DEFAULT_LENGTH.to_string()], + data: vec![], } } } diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/ReasonString/findings.csv b/toolchains/solidity/linter/core/solidhunter-lib/testdata/ReasonString/findings.csv index abf94805..d0c35af6 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/testdata/ReasonString/findings.csv +++ b/toolchains/solidity/linter/core/solidhunter-lib/testdata/ReasonString/findings.csv @@ -1,2 +1,2 @@ -reason-string:8:37:8:133 +reason-string:8:37:8:75 reason-string:11:8:11:15 \ No newline at end of file From 19f1c4864c2553699d345cf32d32072384003444 Mon Sep 17 00:00:00 2001 From: Astrodevs CI Date: Fri, 29 Sep 2023 18:59:48 +0000 Subject: [PATCH 166/325] chore: create branch feature/50-solidity-linter-rules/102-no-global-import-rule-staging --- remove-me-4630e16a9c3d455b8ed3.txt | 1 + 1 file changed, 1 insertion(+) create mode 100644 remove-me-4630e16a9c3d455b8ed3.txt diff --git a/remove-me-4630e16a9c3d455b8ed3.txt b/remove-me-4630e16a9c3d455b8ed3.txt new file mode 100644 index 00000000..f9c58801 --- /dev/null +++ b/remove-me-4630e16a9c3d455b8ed3.txt @@ -0,0 +1 @@ +4630e16a9c3d455b8ed3 From af188cd52667706ff475864883a9a61dbf0d53f5 Mon Sep 17 00:00:00 2001 From: leon3108 Date: Fri, 6 Oct 2023 22:26:32 +0100 Subject: [PATCH 167/325] feat(solidity/linter/core): global import rule --- remove-me-4630e16a9c3d455b8ed3.txt | 1 - .../src/rules/best_practises/global_import.rs | 90 +++++++++++++++++++ .../src/rules/best_practises/mod.rs | 4 + .../testdata/GlobalImport/.solidhunter.json | 65 ++++++++++++++ .../testdata/GlobalImport/add.sol | 5 ++ .../testdata/GlobalImport/file.sol | 17 ++++ .../testdata/GlobalImport/findings.csv | 2 + .../core/solidhunter-lib/tests/linter.rs | 1 + 8 files changed, 184 insertions(+), 1 deletion(-) delete mode 100644 remove-me-4630e16a9c3d455b8ed3.txt create mode 100644 toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/global_import.rs create mode 100644 toolchains/solidity/linter/core/solidhunter-lib/testdata/GlobalImport/.solidhunter.json create mode 100644 toolchains/solidity/linter/core/solidhunter-lib/testdata/GlobalImport/add.sol create mode 100644 toolchains/solidity/linter/core/solidhunter-lib/testdata/GlobalImport/file.sol create mode 100644 toolchains/solidity/linter/core/solidhunter-lib/testdata/GlobalImport/findings.csv diff --git a/remove-me-4630e16a9c3d455b8ed3.txt b/remove-me-4630e16a9c3d455b8ed3.txt deleted file mode 100644 index f9c58801..00000000 --- a/remove-me-4630e16a9c3d455b8ed3.txt +++ /dev/null @@ -1 +0,0 @@ -4630e16a9c3d455b8ed3 diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/global_import.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/global_import.rs new file mode 100644 index 00000000..a241f667 --- /dev/null +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/global_import.rs @@ -0,0 +1,90 @@ +use ast_extractor::{ImportPath, Item, Spanned}; + +use crate::linter::SolidFile; +use crate::rules::types::*; +use crate::types::*; + +// const DEFAULT_SEVERITY: &str = "warn"; +const DEFAULT_MESSAGE: &str = "Import should not be global"; +pub const RULE_ID: &str = "global-import"; + +pub struct GlobalImport { + _data: RuleEntry, +} + +impl RuleType for GlobalImport { + fn diagnose(&self, _file: &SolidFile, _files: &[SolidFile]) -> Vec { + let mut res = Vec::new(); + + let reports = check_global_import(_file); + for report in reports { + if let Some(rep) = report { + res.push(LintDiag { + id: RULE_ID.to_string(), + range: rep, + severity: Some(Severity::WARNING), + code: None, + source: None, + message: DEFAULT_MESSAGE.to_string(), + uri: _file.path.clone(), + source_file_content: _file.content.clone(), + }); + } + } + println!("res: {:?}", res); + res + } +} + +fn check_global_import(file: &SolidFile) -> Vec> { + let mut reports: Vec> = Vec::new(); + + file.data.items.iter().for_each(|item| { + if let Item::Import(import) = item { + if let ImportPath::Plain(plain) = &import.path { + if plain.alias.is_none() { + reports.push(Some(Range { + start: Position { + line: plain.span().start().line, + character: plain.span().start().column, + }, + end: Position { + line: plain.span().end().line, + character: plain.span().end().column, + }, + })); + } + } + if let ImportPath::Glob(glob) = &import.path { + if glob.alias.is_none() { + reports.push(Some(Range { + start: Position { + line: glob.span().start().line, + character: glob.span().start().column, + }, + end: Position { + line: glob.span().end().line, + character: glob.span().end().column, + }, + })); + } + } + } + }); + reports +} + +impl GlobalImport { + pub(crate) fn create(data: RuleEntry) -> Box { + let rule = GlobalImport { _data: data }; + Box::new(rule) + } + + pub(crate) fn create_default() -> RuleEntry { + RuleEntry { + id: RULE_ID.to_string(), + severity: Severity::WARNING, + data: vec![], + } + } +} diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/mod.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/mod.rs index b9b07cb7..98ca1bdd 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/mod.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/mod.rs @@ -5,6 +5,7 @@ use std::collections::HashMap; pub mod line_maxlen; pub mod custom_errors; pub mod function_max_lines; +pub mod global_import; pub mod max_states_count; pub mod reason_string; @@ -14,6 +15,7 @@ pub mod one_contract_per_file; use crate::rules::best_practises::custom_errors::CustomErrors; use crate::rules::best_practises::function_max_lines::FunctionMaxLines; +use crate::rules::best_practises::global_import::GlobalImport; use crate::rules::best_practises::line_maxlen::LineMaxLen; use crate::rules::best_practises::max_states_count::MaxStatesCount; use crate::rules::best_practises::one_contract_per_file::OneContractPerFile; @@ -28,6 +30,7 @@ pub fn create_default_rules() -> Vec { ReasonString::create_default(), OneContractPerFile::create_default(), CustomErrors::create_default(), + GlobalImport::create_default(), ] } @@ -50,6 +53,7 @@ pub fn create_rules() -> RulesMap { one_contract_per_file::RULE_ID.to_string(), OneContractPerFile::create, ); + rules.insert(global_import::RULE_ID.to_string(), GlobalImport::create); rules } diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/GlobalImport/.solidhunter.json b/toolchains/solidity/linter/core/solidhunter-lib/testdata/GlobalImport/.solidhunter.json new file mode 100644 index 00000000..24cda77c --- /dev/null +++ b/toolchains/solidity/linter/core/solidhunter-lib/testdata/GlobalImport/.solidhunter.json @@ -0,0 +1,65 @@ +{ + "name": "solidhunter", + "includes": [], + "plugins": [], + "rules": [ + { + "id": "line-max-len", + "severity": "WARNING", + "data": [ + "80" + ] + }, + { + "id": "max-states-count", + "severity": "WARNING", + "data": [ + "15" + ] + }, + { + "id": "function-max-lines", + "severity": "WARNING", + "data": [ + "20" + ] + }, + { + "id": "reason-string", + "severity": "WARNING", + "data": [ + "32" + ] + }, + { + "id": "contract-name-pascalcase", + "severity": "WARNING", + "data": [] + }, + { + "id": "func-name-camelcase", + "severity": "WARNING", + "data": [] + }, + { + "id": "func-param-name-camelcase", + "severity": "WARNING", + "data": [] + }, + { + "id": "use-forbidden-name", + "severity": "WARNING", + "data": [] + }, + { + "id": "import-on-top", + "severity": "WARNING", + "data": [] + }, + { + "id": "global-import", + "severity": "WARNING", + "data": [] + } + ] +} \ No newline at end of file diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/GlobalImport/add.sol b/toolchains/solidity/linter/core/solidhunter-lib/testdata/GlobalImport/add.sol new file mode 100644 index 00000000..e76ed9ab --- /dev/null +++ b/toolchains/solidity/linter/core/solidhunter-lib/testdata/GlobalImport/add.sol @@ -0,0 +1,5 @@ +pragma solidity ^0.8.0; + +function add(uint a, uint b) pure returns (uint) { + return a + b; +} diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/GlobalImport/file.sol b/toolchains/solidity/linter/core/solidhunter-lib/testdata/GlobalImport/file.sol new file mode 100644 index 00000000..93526a0e --- /dev/null +++ b/toolchains/solidity/linter/core/solidhunter-lib/testdata/GlobalImport/file.sol @@ -0,0 +1,17 @@ +pragma solidity ^0.8.0; + +import {add} from "./add.sol"; //pas flag + +import "./A.sol" as A; //pas flag + +import * as B from "./B.sol"; //pas flag + +import * from "C.sol"; //flag + +import "./D.sol"; //flag + +contract Test { + function test() public pure returns (uint256) { + return add(1, 1); + } +} diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/GlobalImport/findings.csv b/toolchains/solidity/linter/core/solidhunter-lib/testdata/GlobalImport/findings.csv new file mode 100644 index 00000000..d553f1be --- /dev/null +++ b/toolchains/solidity/linter/core/solidhunter-lib/testdata/GlobalImport/findings.csv @@ -0,0 +1,2 @@ +global-import:9:7:9:21 +global-import:11:7:11:16 \ No newline at end of file diff --git a/toolchains/solidity/linter/core/solidhunter-lib/tests/linter.rs b/toolchains/solidity/linter/core/solidhunter-lib/tests/linter.rs index 71a906b7..7ee33a11 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/tests/linter.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/tests/linter.rs @@ -157,4 +157,5 @@ test_directories! { EventNameCamelCase, ConstNameSnakeCase, StateVisibility, + GlobalImport } From 83363c6a9388255974acff98ebfb4f1f15bf640a Mon Sep 17 00:00:00 2001 From: 0xMemoryGrinder <35138272+0xMemoryGrinder@users.noreply.github.com> Date: Sun, 8 Oct 2023 18:29:27 -0400 Subject: [PATCH 168/325] fix(solidity/linter/core): ran lint --- .../src/rules/best_practises/global_import.rs | 24 +++++++++---------- .../rules/naming/contract_name_pascalcase.rs | 4 ++-- .../src/rules/naming/func_name_camelcase.rs | 4 ++-- .../rules/naming/func_param_name_camelcase.rs | 4 ++-- 4 files changed, 17 insertions(+), 19 deletions(-) diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/global_import.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/global_import.rs index a241f667..01d0cb52 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/global_import.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/global_import.rs @@ -17,19 +17,17 @@ impl RuleType for GlobalImport { let mut res = Vec::new(); let reports = check_global_import(_file); - for report in reports { - if let Some(rep) = report { - res.push(LintDiag { - id: RULE_ID.to_string(), - range: rep, - severity: Some(Severity::WARNING), - code: None, - source: None, - message: DEFAULT_MESSAGE.to_string(), - uri: _file.path.clone(), - source_file_content: _file.content.clone(), - }); - } + for report in reports.into_iter().flatten() { + res.push(LintDiag { + id: RULE_ID.to_string(), + range: report, + severity: Some(Severity::WARNING), + code: None, + source: None, + message: DEFAULT_MESSAGE.to_string(), + uri: _file.path.clone(), + source_file_content: _file.content.clone(), + }); } println!("res: {:?}", res); res diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/contract_name_pascalcase.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/contract_name_pascalcase.rs index 1fdabe06..8497cc7b 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/contract_name_pascalcase.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/contract_name_pascalcase.rs @@ -45,8 +45,8 @@ impl RuleType for ContractNamePascalCase { let contracts = ast_extractor::retriever::retrieve_contract_nodes(&file.data); for contract in contracts { - if (contract.name.as_string().chars().nth(0).unwrap() >= 'a' - && contract.name.as_string().chars().nth(0).unwrap() <= 'z') + if (contract.name.as_string().chars().next().unwrap() >= 'a' + && contract.name.as_string().chars().next().unwrap() <= 'z') || contract.name.as_string().contains('_') || contract.name.as_string().contains('-') { diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/func_name_camelcase.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/func_name_camelcase.rs index 8ae09d81..9e2655e3 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/func_name_camelcase.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/func_name_camelcase.rs @@ -47,8 +47,8 @@ impl RuleType for FuncNameCamelCase { for contract in contracts { for function in ast_extractor::retriever::retrieve_functions_nodes(&contract) { if let Some(name) = function.name { - if !(name.as_string().chars().nth(0).unwrap_or(' ') >= 'a' - && name.as_string().chars().nth(0).unwrap_or(' ') <= 'z') + if !(name.as_string().chars().next().unwrap_or(' ') >= 'a' + && name.as_string().chars().next().unwrap_or(' ') <= 'z') || name.as_string().contains('_') || name.as_string().contains('-') { diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/func_param_name_camelcase.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/func_param_name_camelcase.rs index abf5e77a..e1e958e3 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/func_param_name_camelcase.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/func_param_name_camelcase.rs @@ -47,8 +47,8 @@ impl RuleType for FuncParamNameCamelcase { for function in ast_extractor::retriever::retrieve_functions_nodes(&contract) { for arg in function.arguments.iter() { if let Some(name) = &arg.name { - if !(name.as_string().chars().nth(0).unwrap() >= 'a' - && name.as_string().chars().nth(0).unwrap() <= 'z') + if !(name.as_string().chars().next().unwrap() >= 'a' + && name.as_string().chars().next().unwrap() <= 'z') || name.as_string().contains('_') || name.as_string().contains('-') { From c7f554b88ebf43f27eb60e4597ea61832a4d9120 Mon Sep 17 00:00:00 2001 From: Astrodevs CI Date: Fri, 29 Sep 2023 19:05:22 +0000 Subject: [PATCH 169/325] chore: create branch feature/50-solidity-linter-rules/101-no-empty-blocks-rule-staging --- remove-me-443a258d5150475d83cb.txt | 1 + 1 file changed, 1 insertion(+) create mode 100644 remove-me-443a258d5150475d83cb.txt diff --git a/remove-me-443a258d5150475d83cb.txt b/remove-me-443a258d5150475d83cb.txt new file mode 100644 index 00000000..5195fa92 --- /dev/null +++ b/remove-me-443a258d5150475d83cb.txt @@ -0,0 +1 @@ +443a258d5150475d83cb From ec1fdb06e890354c3814838419ddfeba7ac00e51 Mon Sep 17 00:00:00 2001 From: 0xMemoryGrinder <35138272+0xMemoryGrinder@users.noreply.github.com> Date: Sat, 7 Oct 2023 18:29:10 -0400 Subject: [PATCH 170/325] feat: push emptyBlock (test doesn't works) --- .../src/rules/best_practises/mod.rs | 4 + .../rules/best_practises/no_empty_block.rs | 92 +++++++++++++++++++ .../testdata/NoEmptyBlock/.solidhunter.json | 65 +++++++++++++ .../testdata/NoEmptyBlock/file.sol | 3 + .../testdata/NoEmptyBlock/findings.csv | 1 + .../core/solidhunter-lib/tests/linter.rs | 1 + 6 files changed, 166 insertions(+) create mode 100644 toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/no_empty_block.rs create mode 100644 toolchains/solidity/linter/core/solidhunter-lib/testdata/NoEmptyBlock/.solidhunter.json create mode 100644 toolchains/solidity/linter/core/solidhunter-lib/testdata/NoEmptyBlock/file.sol create mode 100644 toolchains/solidity/linter/core/solidhunter-lib/testdata/NoEmptyBlock/findings.csv diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/mod.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/mod.rs index 98ca1bdd..ea6c4a4e 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/mod.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/mod.rs @@ -7,6 +7,7 @@ pub mod custom_errors; pub mod function_max_lines; pub mod global_import; pub mod max_states_count; +pub mod no_empty_block; pub mod reason_string; pub mod one_contract_per_file; @@ -19,6 +20,7 @@ use crate::rules::best_practises::global_import::GlobalImport; use crate::rules::best_practises::line_maxlen::LineMaxLen; use crate::rules::best_practises::max_states_count::MaxStatesCount; use crate::rules::best_practises::one_contract_per_file::OneContractPerFile; +use crate::rules::best_practises::no_empty_block::NoEmptyBlock; use crate::rules::best_practises::reason_string::ReasonString; use crate::rules::RuleBuilder; @@ -31,6 +33,7 @@ pub fn create_default_rules() -> Vec { OneContractPerFile::create_default(), CustomErrors::create_default(), GlobalImport::create_default(), + NoEmptyBlock::create_default(), ] } @@ -54,6 +57,7 @@ pub fn create_rules() -> RulesMap { OneContractPerFile::create, ); rules.insert(global_import::RULE_ID.to_string(), GlobalImport::create); + rules.insert(no_empty_block::RULE_ID.to_string(), NoEmptyBlock::create); rules } diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/no_empty_block.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/no_empty_block.rs new file mode 100644 index 00000000..eb07112c --- /dev/null +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/no_empty_block.rs @@ -0,0 +1,92 @@ +use crate::linter::SolidFile; +use crate::rules::types::*; +use crate::types::*; + +// const DEFAULT_SEVERITY: &str = "warn"; +const DEFAULT_MESSAGE: &str = "should not be an empty block"; +pub const RULE_ID: &str = "no-empty-block"; + +pub struct NoEmptyBlock { + _data: RuleEntry, +} + +impl RuleType for NoEmptyBlock { + fn diagnose(&self, _file: &SolidFile, _files: &[SolidFile]) -> Vec { + let mut res = Vec::new(); + let _report = check_empty_block(_file); + if let Some(report) = _report { + res.push(LintDiag { + id: RULE_ID.to_string(), + severity: Some(Severity::WARNING), + range: report, + code: None, + source: None, + message: DEFAULT_MESSAGE.to_string(), + uri: _file.path.clone(), + source_file_content: _file.content.clone(), + }) + } + print!("{:?}", res); + println!(""); + res + } +} + +fn check_empty_block(file: &SolidFile) -> Option { + let mut res: Option = None; + let mut line_index = 1; + let mut current_index = 1; + + file.content.lines().for_each(|line| { + let left_bracket_index = line.find("{"); + if left_bracket_index.is_some() { + let mut index_in_line = 1; + for (_, c) in file + .content + .chars() + .enumerate() + .skip(current_index + left_bracket_index.unwrap()) + { + if (c != ' ') && (c != '\n') && (c != '}') { + break; + } + if c == '\n' { + line_index += 1; + index_in_line = 0; + } + if c == '}' { + res = Some(Range { + start: Position { + line: line_index, + character: left_bracket_index.unwrap() + 1, + }, + end: Position { + line: line_index, + character: left_bracket_index.unwrap() + 1 + index_in_line, + }, + }); + break; + } + index_in_line += 1; + } + } + line_index += 1; + current_index += line.len() + 1; + }); + res +} + +impl NoEmptyBlock { + pub fn create(data: RuleEntry) -> Box { + let rule = NoEmptyBlock { _data: data }; + Box::new(rule) + } + + pub fn create_default() -> RuleEntry { + RuleEntry { + id: RULE_ID.to_string(), + severity: Severity::WARNING, + data: vec![], + } + } +} diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/NoEmptyBlock/.solidhunter.json b/toolchains/solidity/linter/core/solidhunter-lib/testdata/NoEmptyBlock/.solidhunter.json new file mode 100644 index 00000000..5ec28c69 --- /dev/null +++ b/toolchains/solidity/linter/core/solidhunter-lib/testdata/NoEmptyBlock/.solidhunter.json @@ -0,0 +1,65 @@ +{ + "name": "solidhunter", + "includes": [], + "plugins": [], + "rules": [ + { + "id": "line-max-len", + "severity": "WARNING", + "data": [ + "80" + ] + }, + { + "id": "max-states-count", + "severity": "WARNING", + "data": [ + "15" + ] + }, + { + "id": "function-max-lines", + "severity": "WARNING", + "data": [ + "20" + ] + }, + { + "id": "reason-string", + "severity": "WARNING", + "data": [ + "32" + ] + }, + { + "id": "contract-name-pascalcase", + "severity": "WARNING", + "data": [] + }, + { + "id": "func-name-camelcase", + "severity": "WARNING", + "data": [] + }, + { + "id": "func-param-name-camelcase", + "severity": "WARNING", + "data": [] + }, + { + "id": "use-forbidden-name", + "severity": "WARNING", + "data": [] + }, + { + "id": "import-on-top", + "severity": "WARNING", + "data": [] + }, + { + "id": "no-empty-block", + "severity": "WARNING", + "data": [] + } + ] +} \ No newline at end of file diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/NoEmptyBlock/file.sol b/toolchains/solidity/linter/core/solidhunter-lib/testdata/NoEmptyBlock/file.sol new file mode 100644 index 00000000..e5645b58 --- /dev/null +++ b/toolchains/solidity/linter/core/solidhunter-lib/testdata/NoEmptyBlock/file.sol @@ -0,0 +1,3 @@ +pragma solidity 0.8.19; + +contract test {} diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/NoEmptyBlock/findings.csv b/toolchains/solidity/linter/core/solidhunter-lib/testdata/NoEmptyBlock/findings.csv new file mode 100644 index 00000000..d6c6a3b8 --- /dev/null +++ b/toolchains/solidity/linter/core/solidhunter-lib/testdata/NoEmptyBlock/findings.csv @@ -0,0 +1 @@ +no-empty-block:3:15:3:16 \ No newline at end of file diff --git a/toolchains/solidity/linter/core/solidhunter-lib/tests/linter.rs b/toolchains/solidity/linter/core/solidhunter-lib/tests/linter.rs index 7ee33a11..a40230af 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/tests/linter.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/tests/linter.rs @@ -157,5 +157,6 @@ test_directories! { EventNameCamelCase, ConstNameSnakeCase, StateVisibility, + NoEmptyBlock, GlobalImport } From 84d1ea5d22c958c0f759b2cf75497c32775392db Mon Sep 17 00:00:00 2001 From: leon3108 Date: Wed, 27 Sep 2023 17:11:06 +0100 Subject: [PATCH 171/325] chore: rename rule --- .../{no_empty_block.rs => empty_block.rs} | 10 +++++----- .../solidhunter-lib/src/rules/best_practises/mod.rs | 5 ++++- .../{NoEmptyBlock => EmptyBlock}/.solidhunter.json | 2 +- .../testdata/{NoEmptyBlock => EmptyBlock}/file.sol | 0 .../solidhunter-lib/testdata/EmptyBlock/findings.csv | 1 + .../solidhunter-lib/testdata/NoEmptyBlock/findings.csv | 1 - .../linter/core/solidhunter-lib/tests/linter.rs | 1 + 7 files changed, 12 insertions(+), 8 deletions(-) rename toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/{no_empty_block.rs => empty_block.rs} (93%) rename toolchains/solidity/linter/core/solidhunter-lib/testdata/{NoEmptyBlock => EmptyBlock}/.solidhunter.json (97%) rename toolchains/solidity/linter/core/solidhunter-lib/testdata/{NoEmptyBlock => EmptyBlock}/file.sol (100%) create mode 100644 toolchains/solidity/linter/core/solidhunter-lib/testdata/EmptyBlock/findings.csv delete mode 100644 toolchains/solidity/linter/core/solidhunter-lib/testdata/NoEmptyBlock/findings.csv diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/no_empty_block.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/empty_block.rs similarity index 93% rename from toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/no_empty_block.rs rename to toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/empty_block.rs index eb07112c..08e85d37 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/no_empty_block.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/empty_block.rs @@ -4,13 +4,13 @@ use crate::types::*; // const DEFAULT_SEVERITY: &str = "warn"; const DEFAULT_MESSAGE: &str = "should not be an empty block"; -pub const RULE_ID: &str = "no-empty-block"; +pub const RULE_ID: &str = "empty-block"; -pub struct NoEmptyBlock { +pub struct EmptyBlock { _data: RuleEntry, } -impl RuleType for NoEmptyBlock { +impl RuleType for EmptyBlock { fn diagnose(&self, _file: &SolidFile, _files: &[SolidFile]) -> Vec { let mut res = Vec::new(); let _report = check_empty_block(_file); @@ -76,9 +76,9 @@ fn check_empty_block(file: &SolidFile) -> Option { res } -impl NoEmptyBlock { +impl EmptyBlock { pub fn create(data: RuleEntry) -> Box { - let rule = NoEmptyBlock { _data: data }; + let rule = EmptyBlock { _data: data }; Box::new(rule) } diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/mod.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/mod.rs index ea6c4a4e..aa370eea 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/mod.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/mod.rs @@ -4,10 +4,10 @@ use std::collections::HashMap; #[macro_use] pub mod line_maxlen; pub mod custom_errors; +pub mod empty_block; pub mod function_max_lines; pub mod global_import; pub mod max_states_count; -pub mod no_empty_block; pub mod reason_string; pub mod one_contract_per_file; @@ -15,6 +15,7 @@ pub mod one_contract_per_file; // List all rules use crate::rules::best_practises::custom_errors::CustomErrors; +use crate::rules::best_practises::empty_block::EmptyBlock; use crate::rules::best_practises::function_max_lines::FunctionMaxLines; use crate::rules::best_practises::global_import::GlobalImport; use crate::rules::best_practises::line_maxlen::LineMaxLen; @@ -34,6 +35,7 @@ pub fn create_default_rules() -> Vec { CustomErrors::create_default(), GlobalImport::create_default(), NoEmptyBlock::create_default(), + EmptyBlock::create_default(), ] } @@ -58,6 +60,7 @@ pub fn create_rules() -> RulesMap { ); rules.insert(global_import::RULE_ID.to_string(), GlobalImport::create); rules.insert(no_empty_block::RULE_ID.to_string(), NoEmptyBlock::create); + rules.insert(empty_block::RULE_ID.to_string(), EmptyBlock::create); rules } diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/NoEmptyBlock/.solidhunter.json b/toolchains/solidity/linter/core/solidhunter-lib/testdata/EmptyBlock/.solidhunter.json similarity index 97% rename from toolchains/solidity/linter/core/solidhunter-lib/testdata/NoEmptyBlock/.solidhunter.json rename to toolchains/solidity/linter/core/solidhunter-lib/testdata/EmptyBlock/.solidhunter.json index 5ec28c69..632a7ffa 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/testdata/NoEmptyBlock/.solidhunter.json +++ b/toolchains/solidity/linter/core/solidhunter-lib/testdata/EmptyBlock/.solidhunter.json @@ -57,7 +57,7 @@ "data": [] }, { - "id": "no-empty-block", + "id": "empty-block", "severity": "WARNING", "data": [] } diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/NoEmptyBlock/file.sol b/toolchains/solidity/linter/core/solidhunter-lib/testdata/EmptyBlock/file.sol similarity index 100% rename from toolchains/solidity/linter/core/solidhunter-lib/testdata/NoEmptyBlock/file.sol rename to toolchains/solidity/linter/core/solidhunter-lib/testdata/EmptyBlock/file.sol diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/EmptyBlock/findings.csv b/toolchains/solidity/linter/core/solidhunter-lib/testdata/EmptyBlock/findings.csv new file mode 100644 index 00000000..f7967120 --- /dev/null +++ b/toolchains/solidity/linter/core/solidhunter-lib/testdata/EmptyBlock/findings.csv @@ -0,0 +1 @@ +empty-block:3:15:3:16 \ No newline at end of file diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/NoEmptyBlock/findings.csv b/toolchains/solidity/linter/core/solidhunter-lib/testdata/NoEmptyBlock/findings.csv deleted file mode 100644 index d6c6a3b8..00000000 --- a/toolchains/solidity/linter/core/solidhunter-lib/testdata/NoEmptyBlock/findings.csv +++ /dev/null @@ -1 +0,0 @@ -no-empty-block:3:15:3:16 \ No newline at end of file diff --git a/toolchains/solidity/linter/core/solidhunter-lib/tests/linter.rs b/toolchains/solidity/linter/core/solidhunter-lib/tests/linter.rs index a40230af..57df0df4 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/tests/linter.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/tests/linter.rs @@ -158,5 +158,6 @@ test_directories! { ConstNameSnakeCase, StateVisibility, NoEmptyBlock, + EmptyBlock, GlobalImport } From 618cbb0cb0a2e248470ece541c17cb90af1c0f15 Mon Sep 17 00:00:00 2001 From: leon3108 Date: Wed, 27 Sep 2023 19:10:08 +0100 Subject: [PATCH 172/325] test: pass test wit h pascalcase name --- .../linter/core/solidhunter-lib/testdata/EmptyBlock/file.sol | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/EmptyBlock/file.sol b/toolchains/solidity/linter/core/solidhunter-lib/testdata/EmptyBlock/file.sol index e5645b58..c282126d 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/testdata/EmptyBlock/file.sol +++ b/toolchains/solidity/linter/core/solidhunter-lib/testdata/EmptyBlock/file.sol @@ -1,3 +1,3 @@ pragma solidity 0.8.19; -contract test {} +contract Test {} From 2089479bfa8791e70968868dfa726c26cbf995c5 Mon Sep 17 00:00:00 2001 From: leon3108 Date: Thu, 5 Oct 2023 23:39:03 +0100 Subject: [PATCH 173/325] refactor: use ast instead of parsing file --- libs/ast-extractor/src/retriever.rs | 4 +- libs/ast-extractor/src/retriever/block.rs | 24 ++++ .../src/rules/best_practises/empty_block.rs | 103 +++++++++--------- .../src/rules/best_practises/mod.rs | 1 - .../testdata/EmptyBlock/file.sol | 2 + .../testdata/EmptyBlock/findings.csv | 3 +- 6 files changed, 81 insertions(+), 56 deletions(-) create mode 100644 libs/ast-extractor/src/retriever/block.rs diff --git a/libs/ast-extractor/src/retriever.rs b/libs/ast-extractor/src/retriever.rs index 896fbd61..a4efd6d4 100644 --- a/libs/ast-extractor/src/retriever.rs +++ b/libs/ast-extractor/src/retriever.rs @@ -19,14 +19,16 @@ pub use r#struct::*; mod udt; pub use udt::*; -mod using; mod finder; +mod using; pub use using::*; mod stmts; pub use stmts::*; +mod block; +pub use block::*; pub use finder::*; mod expr_call; diff --git a/libs/ast-extractor/src/retriever/block.rs b/libs/ast-extractor/src/retriever/block.rs new file mode 100644 index 00000000..74f68fe2 --- /dev/null +++ b/libs/ast-extractor/src/retriever/block.rs @@ -0,0 +1,24 @@ +use syn_solidity::{Block, Visit}; + +struct BlockVisitor { + blocks: Vec, +} + +impl BlockVisitor { + pub fn new() -> Self { + Self { blocks: Vec::new() } + } +} + +impl<'ast> Visit<'ast> for BlockVisitor { + fn visit_block(&mut self, i: &Block) { + self.blocks.push(i.clone()); + syn_solidity::visit::visit_block(self, i); + } +} + +pub fn retrieve_block_nodes(ast: &syn_solidity::File) -> Vec { + let mut visitor = BlockVisitor::new(); + visitor.visit_file(ast); + visitor.blocks +} diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/empty_block.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/empty_block.rs index 08e85d37..f491369d 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/empty_block.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/empty_block.rs @@ -1,6 +1,10 @@ use crate::linter::SolidFile; use crate::rules::types::*; use crate::types::*; +use ast_extractor::{ + retriever::{retrieve_block_nodes, retrieve_contract_nodes}, + Spanned, +}; // const DEFAULT_SEVERITY: &str = "warn"; const DEFAULT_MESSAGE: &str = "should not be an empty block"; @@ -13,66 +17,59 @@ pub struct EmptyBlock { impl RuleType for EmptyBlock { fn diagnose(&self, _file: &SolidFile, _files: &[SolidFile]) -> Vec { let mut res = Vec::new(); - let _report = check_empty_block(_file); - if let Some(report) = _report { - res.push(LintDiag { - id: RULE_ID.to_string(), - severity: Some(Severity::WARNING), - range: report, - code: None, - source: None, - message: DEFAULT_MESSAGE.to_string(), - uri: _file.path.clone(), - source_file_content: _file.content.clone(), - }) + let _reports = check_empty_block(_file); + for report in _reports.iter() { + if let Some(report) = report { + res.push(LintDiag { + id: RULE_ID.to_string(), + severity: Some(Severity::WARNING), + range: report.clone(), + code: None, + source: None, + message: DEFAULT_MESSAGE.to_string(), + uri: _file.path.clone(), + source_file_content: _file.content.clone(), + }) + } } - print!("{:?}", res); - println!(""); res } } -fn check_empty_block(file: &SolidFile) -> Option { - let mut res: Option = None; - let mut line_index = 1; - let mut current_index = 1; +fn check_empty_block(file: &SolidFile) -> Vec> { + let mut res: Vec> = Vec::new(); - file.content.lines().for_each(|line| { - let left_bracket_index = line.find("{"); - if left_bracket_index.is_some() { - let mut index_in_line = 1; - for (_, c) in file - .content - .chars() - .enumerate() - .skip(current_index + left_bracket_index.unwrap()) - { - if (c != ' ') && (c != '\n') && (c != '}') { - break; - } - if c == '\n' { - line_index += 1; - index_in_line = 0; - } - if c == '}' { - res = Some(Range { - start: Position { - line: line_index, - character: left_bracket_index.unwrap() + 1, - }, - end: Position { - line: line_index, - character: left_bracket_index.unwrap() + 1 + index_in_line, - }, - }); - break; - } - index_in_line += 1; - } + let contracts = retrieve_contract_nodes(&file.data); + for contract in contracts.iter() { + if contract.body.is_empty() { + res.push(Some(Range { + start: Position { + line: contract.span().start().line, + character: contract.span().start().column + 1, + }, + end: Position { + line: contract.span().end().line, + character: contract.span().end().column, + }, + })); + } + } + + let blocks = retrieve_block_nodes(&file.data); + for block in blocks.iter() { + if block.stmts.is_empty() { + res.push(Some(Range { + start: Position { + line: block.span().start().line, + character: block.span().start().column + 1, + }, + end: Position { + line: block.span().end().line, + character: block.span().end().column, + }, + })); } - line_index += 1; - current_index += line.len() + 1; - }); + } res } diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/mod.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/mod.rs index aa370eea..2f248d27 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/mod.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/mod.rs @@ -21,7 +21,6 @@ use crate::rules::best_practises::global_import::GlobalImport; use crate::rules::best_practises::line_maxlen::LineMaxLen; use crate::rules::best_practises::max_states_count::MaxStatesCount; use crate::rules::best_practises::one_contract_per_file::OneContractPerFile; -use crate::rules::best_practises::no_empty_block::NoEmptyBlock; use crate::rules::best_practises::reason_string::ReasonString; use crate::rules::RuleBuilder; diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/EmptyBlock/file.sol b/toolchains/solidity/linter/core/solidhunter-lib/testdata/EmptyBlock/file.sol index c282126d..4622342a 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/testdata/EmptyBlock/file.sol +++ b/toolchains/solidity/linter/core/solidhunter-lib/testdata/EmptyBlock/file.sol @@ -1,3 +1,5 @@ pragma solidity 0.8.19; contract Test {} + +contract Test_b {} diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/EmptyBlock/findings.csv b/toolchains/solidity/linter/core/solidhunter-lib/testdata/EmptyBlock/findings.csv index f7967120..9e1b21a3 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/testdata/EmptyBlock/findings.csv +++ b/toolchains/solidity/linter/core/solidhunter-lib/testdata/EmptyBlock/findings.csv @@ -1 +1,2 @@ -empty-block:3:15:3:16 \ No newline at end of file +empty-block:3:10:3:13 +empty-block:5:10:5:15 \ No newline at end of file From ac7657da0810c6204333bd4641027714e7086a01 Mon Sep 17 00:00:00 2001 From: leon3108 Date: Thu, 5 Oct 2023 23:40:46 +0100 Subject: [PATCH 174/325] rm remove-me --- remove-me-443a258d5150475d83cb.txt | 1 - 1 file changed, 1 deletion(-) delete mode 100644 remove-me-443a258d5150475d83cb.txt diff --git a/remove-me-443a258d5150475d83cb.txt b/remove-me-443a258d5150475d83cb.txt deleted file mode 100644 index 5195fa92..00000000 --- a/remove-me-443a258d5150475d83cb.txt +++ /dev/null @@ -1 +0,0 @@ -443a258d5150475d83cb From 521c7d1cca47a3f8d4687edbc597bde0475b804d Mon Sep 17 00:00:00 2001 From: 0xMemoryGrinder <35138272+0xMemoryGrinder@users.noreply.github.com> Date: Sun, 8 Oct 2023 21:08:33 -0400 Subject: [PATCH 175/325] fix(solidity/linter/core): compile and test errors --- .../src/rules/best_practises/empty_block.rs | 24 +++++++++---------- .../src/rules/best_practises/mod.rs | 3 --- .../testdata/EmptyBlock/.solidhunter.json | 5 ---- .../core/solidhunter-lib/tests/linter.rs | 1 - 4 files changed, 11 insertions(+), 22 deletions(-) diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/empty_block.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/empty_block.rs index f491369d..f62b4ee9 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/empty_block.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/empty_block.rs @@ -18,19 +18,17 @@ impl RuleType for EmptyBlock { fn diagnose(&self, _file: &SolidFile, _files: &[SolidFile]) -> Vec { let mut res = Vec::new(); let _reports = check_empty_block(_file); - for report in _reports.iter() { - if let Some(report) = report { - res.push(LintDiag { - id: RULE_ID.to_string(), - severity: Some(Severity::WARNING), - range: report.clone(), - code: None, - source: None, - message: DEFAULT_MESSAGE.to_string(), - uri: _file.path.clone(), - source_file_content: _file.content.clone(), - }) - } + for report in _reports.iter().flatten() { + res.push(LintDiag { + id: RULE_ID.to_string(), + severity: Some(Severity::WARNING), + range: report.clone(), + code: None, + source: None, + message: DEFAULT_MESSAGE.to_string(), + uri: _file.path.clone(), + source_file_content: _file.content.clone(), + }); } res } diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/mod.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/mod.rs index 2f248d27..25961c60 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/mod.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/mod.rs @@ -9,7 +9,6 @@ pub mod function_max_lines; pub mod global_import; pub mod max_states_count; pub mod reason_string; - pub mod one_contract_per_file; // List all rules @@ -33,7 +32,6 @@ pub fn create_default_rules() -> Vec { OneContractPerFile::create_default(), CustomErrors::create_default(), GlobalImport::create_default(), - NoEmptyBlock::create_default(), EmptyBlock::create_default(), ] } @@ -58,7 +56,6 @@ pub fn create_rules() -> RulesMap { OneContractPerFile::create, ); rules.insert(global_import::RULE_ID.to_string(), GlobalImport::create); - rules.insert(no_empty_block::RULE_ID.to_string(), NoEmptyBlock::create); rules.insert(empty_block::RULE_ID.to_string(), EmptyBlock::create); rules diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/EmptyBlock/.solidhunter.json b/toolchains/solidity/linter/core/solidhunter-lib/testdata/EmptyBlock/.solidhunter.json index 632a7ffa..ed3fa9fa 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/testdata/EmptyBlock/.solidhunter.json +++ b/toolchains/solidity/linter/core/solidhunter-lib/testdata/EmptyBlock/.solidhunter.json @@ -31,11 +31,6 @@ "32" ] }, - { - "id": "contract-name-pascalcase", - "severity": "WARNING", - "data": [] - }, { "id": "func-name-camelcase", "severity": "WARNING", diff --git a/toolchains/solidity/linter/core/solidhunter-lib/tests/linter.rs b/toolchains/solidity/linter/core/solidhunter-lib/tests/linter.rs index 57df0df4..3a8135af 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/tests/linter.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/tests/linter.rs @@ -157,7 +157,6 @@ test_directories! { EventNameCamelCase, ConstNameSnakeCase, StateVisibility, - NoEmptyBlock, EmptyBlock, GlobalImport } From 93b964080393e199d343410bb9d7e9dac72c9e64 Mon Sep 17 00:00:00 2001 From: Astrodevs CI Date: Fri, 29 Sep 2023 17:01:25 +0000 Subject: [PATCH 176/325] chore: create branch feature/50-solidity-linter-rules/100-no-console-rule-staging --- remove-me-8a1ba1d16ec74ff0a06f.txt | 1 + 1 file changed, 1 insertion(+) create mode 100644 remove-me-8a1ba1d16ec74ff0a06f.txt diff --git a/remove-me-8a1ba1d16ec74ff0a06f.txt b/remove-me-8a1ba1d16ec74ff0a06f.txt new file mode 100644 index 00000000..16ea03bc --- /dev/null +++ b/remove-me-8a1ba1d16ec74ff0a06f.txt @@ -0,0 +1 @@ +8a1ba1d16ec74ff0a06f From 3c18cb89e09c28928df2fd6628092d03f39a034e Mon Sep 17 00:00:00 2001 From: EnergyCube Date: Sun, 8 Oct 2023 16:11:48 -0700 Subject: [PATCH 177/325] feat: completed no-console rule --- libs/ast-extractor/src/retriever.rs | 14 ++- .../src/retriever/expr_member.rs | 66 +++++++++++ .../src/retriever/import_directive.rs | 76 +++++++++++++ .../tests/files/expr_members/empty.sol | 1 + .../tests/files/expr_members/one.sol | 6 + .../tests/files/header/empty.sol | 1 + libs/ast-extractor/tests/files/header/one.sol | 3 + libs/ast-extractor/tests/files/header/ten.sol | 12 ++ .../src/rules/best_practises/mod.rs | 5 + .../src/rules/best_practises/no_console.rs | 106 ++++++++++++++++++ .../testdata/NoConsole/.solidhunter.json | 65 +++++++++++ .../testdata/NoConsole/file.sol | 10 ++ .../testdata/NoConsole/findings.csv | 3 + .../core/solidhunter-lib/tests/linter.rs | 1 + 14 files changed, 365 insertions(+), 4 deletions(-) create mode 100644 libs/ast-extractor/src/retriever/expr_member.rs create mode 100644 libs/ast-extractor/src/retriever/import_directive.rs create mode 100644 libs/ast-extractor/tests/files/expr_members/empty.sol create mode 100644 libs/ast-extractor/tests/files/expr_members/one.sol create mode 100644 libs/ast-extractor/tests/files/header/empty.sol create mode 100644 libs/ast-extractor/tests/files/header/one.sol create mode 100644 libs/ast-extractor/tests/files/header/ten.sol create mode 100644 toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/no_console.rs create mode 100644 toolchains/solidity/linter/core/solidhunter-lib/testdata/NoConsole/.solidhunter.json create mode 100644 toolchains/solidity/linter/core/solidhunter-lib/testdata/NoConsole/file.sol create mode 100644 toolchains/solidity/linter/core/solidhunter-lib/testdata/NoConsole/findings.csv diff --git a/libs/ast-extractor/src/retriever.rs b/libs/ast-extractor/src/retriever.rs index a4efd6d4..a08e38ec 100644 --- a/libs/ast-extractor/src/retriever.rs +++ b/libs/ast-extractor/src/retriever.rs @@ -10,6 +10,15 @@ pub use error::*; mod event; pub use event::*; +mod expr_call; +pub use expr_call::*; + +mod expr_member; +pub use expr_member::*; + +mod import_directive; +pub use import_directive::*; + mod function; pub use function::*; @@ -29,7 +38,4 @@ pub use stmts::*; mod block; pub use block::*; -pub use finder::*; - -mod expr_call; -pub use expr_call::*; \ No newline at end of file +pub use finder::*; \ No newline at end of file diff --git a/libs/ast-extractor/src/retriever/expr_member.rs b/libs/ast-extractor/src/retriever/expr_member.rs new file mode 100644 index 00000000..fc1e56fb --- /dev/null +++ b/libs/ast-extractor/src/retriever/expr_member.rs @@ -0,0 +1,66 @@ +/** + * expr_member.rs + * Function to retrieve expr memners from AST + * author: EnergyCube + * + * !!! UNTESTED !!! +*/ +use syn_solidity::{ExprMember, Visit}; + +struct MemberVisitor { + members: Vec, +} + +impl MemberVisitor { + pub fn new() -> Self { + Self { + members: Vec::new(), + } + } +} + +impl<'ast> Visit<'ast> for MemberVisitor { + fn visit_expr_member(&mut self, i: &ExprMember) { + self.members.push(i.clone()); + syn_solidity::visit::visit_expr_member(self, i); + } +} + +pub fn retrieve_expr_member_nodes(ast: &syn_solidity::File) -> Vec { + let mut visitor = MemberVisitor::new(); + visitor.visit_file(ast); + visitor.members +} + +#[cfg(test)] +mod tests { + use proc_macro2::TokenStream; + + use super::*; + use std::fs; + use std::path::PathBuf; + use std::str::FromStr; + + #[test] + fn test_retrieve_expr_member_nodes_empty() { + let source = String::from("pragma solidity ^0.8.0;"); + let tokens = TokenStream::from_str(source.as_str()).unwrap(); + let ast = syn_solidity::parse2(tokens).unwrap(); + let res = retrieve_expr_member_nodes(&ast); + assert_eq!(res.len(), 0); + } + + #[test] + fn test_retrieve_expr_member_nodes_one() { + let mut path = PathBuf::from(env!("CARGO_MANIFEST_DIR")); + path.push("tests"); + path.push("files"); + path.push("expr_members"); + path.push("one.sol"); + let source = fs::read_to_string(path).unwrap(); + let tokens = TokenStream::from_str(source.as_str()).unwrap(); + let ast = syn_solidity::parse2(tokens).unwrap(); + let res = retrieve_expr_member_nodes(&ast); + assert_eq!(res.len(), 1); + } +} diff --git a/libs/ast-extractor/src/retriever/import_directive.rs b/libs/ast-extractor/src/retriever/import_directive.rs new file mode 100644 index 00000000..7bb22a10 --- /dev/null +++ b/libs/ast-extractor/src/retriever/import_directive.rs @@ -0,0 +1,76 @@ +/** + * import_directive.rs + * Function to retrieve import directive from AST + * author: EnergyCube +*/ +use syn_solidity::{ImportDirective, Visit}; + +struct HeaderVisitor { + import: Vec, +} + +impl HeaderVisitor { + pub fn new() -> Self { + Self { import: Vec::new() } + } +} + +impl<'ast> Visit<'ast> for HeaderVisitor { + fn visit_import_directive(&mut self, i: &ImportDirective) { + self.import.push(i.clone()); + syn_solidity::visit::visit_import_directive(self, i); + } +} + +pub fn retrieve_import_directive_nodes(ast: &syn_solidity::File) -> Vec { + let mut visitor = HeaderVisitor::new(); + visitor.visit_file(ast); + visitor.import +} + +#[cfg(test)] +mod tests { + use proc_macro2::TokenStream; + + use super::*; + use std::fs; + use std::path::PathBuf; + use std::str::FromStr; + + #[test] + fn test_retrieve_header_nodes_empty() { + let source = String::from("pragma solidity ^0.8.0;"); + let tokens = TokenStream::from_str(source.as_str()).unwrap(); + let ast = syn_solidity::parse2(tokens).unwrap(); + let res = retrieve_import_directive_nodes(&ast); + assert_eq!(res.len(), 0); + } + + #[test] + fn test_retrieve_header_nodes_one() { + let mut path = PathBuf::from(env!("CARGO_MANIFEST_DIR")); + path.push("tests"); + path.push("files"); + path.push("header"); + path.push("one.sol"); + let source = fs::read_to_string(path).unwrap(); + let tokens = TokenStream::from_str(source.as_str()).unwrap(); + let ast = syn_solidity::parse2(tokens).unwrap(); + let res = retrieve_import_directive_nodes(&ast); + assert_eq!(res.len(), 1); + } + + #[test] + fn test_retrieve_header_nodes_ten() { + let mut path = PathBuf::from(env!("CARGO_MANIFEST_DIR")); + path.push("tests"); + path.push("files"); + path.push("header"); + path.push("ten.sol"); + let source = fs::read_to_string(path).unwrap(); + let tokens = TokenStream::from_str(source.as_str()).unwrap(); + let ast = syn_solidity::parse2(tokens).unwrap(); + let res = retrieve_import_directive_nodes(&ast); + assert_eq!(res.len(), 10); + } +} diff --git a/libs/ast-extractor/tests/files/expr_members/empty.sol b/libs/ast-extractor/tests/files/expr_members/empty.sol new file mode 100644 index 00000000..89f8fe40 --- /dev/null +++ b/libs/ast-extractor/tests/files/expr_members/empty.sol @@ -0,0 +1 @@ +contract Empty {} \ No newline at end of file diff --git a/libs/ast-extractor/tests/files/expr_members/one.sol b/libs/ast-extractor/tests/files/expr_members/one.sol new file mode 100644 index 00000000..9249700e --- /dev/null +++ b/libs/ast-extractor/tests/files/expr_members/one.sol @@ -0,0 +1,6 @@ +contract One { + + function exprMemberCall() public { + test.wow(); + } +} \ No newline at end of file diff --git a/libs/ast-extractor/tests/files/header/empty.sol b/libs/ast-extractor/tests/files/header/empty.sol new file mode 100644 index 00000000..89f8fe40 --- /dev/null +++ b/libs/ast-extractor/tests/files/header/empty.sol @@ -0,0 +1 @@ +contract Empty {} \ No newline at end of file diff --git a/libs/ast-extractor/tests/files/header/one.sol b/libs/ast-extractor/tests/files/header/one.sol new file mode 100644 index 00000000..00181e67 --- /dev/null +++ b/libs/ast-extractor/tests/files/header/one.sol @@ -0,0 +1,3 @@ +import "wow.sol"; + +contract One {} \ No newline at end of file diff --git a/libs/ast-extractor/tests/files/header/ten.sol b/libs/ast-extractor/tests/files/header/ten.sol new file mode 100644 index 00000000..21c7d402 --- /dev/null +++ b/libs/ast-extractor/tests/files/header/ten.sol @@ -0,0 +1,12 @@ +import "wow.sol"; +import "wow.sol"; +import "wow.sol"; +import "wow.sol"; +import "incredible.sol"; +import "wow.sol"; +import "wow.sol"; +import "wow.sol"; +import "wow.sol"; +import "wow.sol"; + +contract One {} \ No newline at end of file diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/mod.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/mod.rs index 25961c60..e3d963ed 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/mod.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/mod.rs @@ -8,6 +8,7 @@ pub mod empty_block; pub mod function_max_lines; pub mod global_import; pub mod max_states_count; +pub mod no_console; pub mod reason_string; pub mod one_contract_per_file; @@ -20,6 +21,7 @@ use crate::rules::best_practises::global_import::GlobalImport; use crate::rules::best_practises::line_maxlen::LineMaxLen; use crate::rules::best_practises::max_states_count::MaxStatesCount; use crate::rules::best_practises::one_contract_per_file::OneContractPerFile; +use crate::rules::best_practises::no_console::NoConsole; use crate::rules::best_practises::reason_string::ReasonString; use crate::rules::RuleBuilder; @@ -29,6 +31,7 @@ pub fn create_default_rules() -> Vec { MaxStatesCount::create_default(), FunctionMaxLines::create_default(), ReasonString::create_default(), + NoConsole::create_default(), OneContractPerFile::create_default(), CustomErrors::create_default(), GlobalImport::create_default(), @@ -58,5 +61,7 @@ pub fn create_rules() -> RulesMap { rules.insert(global_import::RULE_ID.to_string(), GlobalImport::create); rules.insert(empty_block::RULE_ID.to_string(), EmptyBlock::create); + rules.insert(no_console::RULE_ID.to_string(), NoConsole::create); + rules } diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/no_console.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/no_console.rs new file mode 100644 index 00000000..73040b6a --- /dev/null +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/no_console.rs @@ -0,0 +1,106 @@ +use ast_extractor::*; + +use crate::linter::SolidFile; +use crate::rules::types::{RuleEntry, RuleType}; +use crate::types::{LintDiag, Position, Range, Severity}; + +pub const RULE_ID: &str = "no-console"; +const DEFAULT_SEVERITY: Severity = Severity::WARNING; + +pub struct NoConsole { + data: RuleEntry, +} + +impl NoConsole { + fn create_diag( + &self, + file: &SolidFile, + location: (LineColumn, LineColumn), + message: String, + ) -> LintDiag { + LintDiag { + id: RULE_ID.to_string(), + range: Range { + start: Position { + line: location.0.line, + character: location.0.column, + }, + end: Position { + line: location.1.line, + character: location.1.column, + }, + }, + message, + severity: Some(self.data.severity), + code: None, + source: None, + uri: file.path.clone(), + source_file_content: file.content.clone(), + } + } +} + +impl RuleType for NoConsole { + fn diagnose(&self, file: &SolidFile, _files: &[SolidFile]) -> Vec { + let mut res: Vec = Vec::new(); + + // Check functions calls + for expr_member in retriever::retrieve_expr_member_nodes(&file.data) { + if let Expr::Ident(expr_ident) = *expr_member.expr { + if expr_ident == "console" { + if let Expr::Call(expr_call) = *expr_member.member { + if let Expr::Ident(expr_ident) = *expr_call.expr { + if expr_ident.as_string().starts_with("log") { + let diag = self.create_diag( + file, + (expr_ident.span().start(), expr_ident.span().end()), + format!("{}: console.log(...) is forbidden", RULE_ID), + ); + res.push(diag); + } + } + } + } + } + } + + // Check imports + let mut blacklist: Vec = Vec::new(); + blacklist.push("hardhat/console.sol".to_string()); + blacklist.push("forge-std/console".to_string()); // console?.sol (easier to blacklist this way) + + for header in retriever::retrieve_import_directive_nodes(&file.data) { + if let ImportPath::Plain(pathplain) = &header.path { + for test in &pathplain.path.values { + for refused in blacklist.clone() { + if test.value().contains(&refused) { + let diag = self.create_diag( + file, + (header.span().start(), header.span().end()), + format!("{}: forbidden usage of console headers", RULE_ID), + ); + res.push(diag); + } + } + } + } + } + + res + } +} + +impl NoConsole { + pub fn create(data: RuleEntry) -> Box { + let rule = NoConsole { data }; + Box::new(rule) + } + + pub fn create_default() -> RuleEntry { + RuleEntry { + id: RULE_ID.to_string(), + severity: DEFAULT_SEVERITY, + data: vec![], + } + } +} diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/NoConsole/.solidhunter.json b/toolchains/solidity/linter/core/solidhunter-lib/testdata/NoConsole/.solidhunter.json new file mode 100644 index 00000000..1e7606ee --- /dev/null +++ b/toolchains/solidity/linter/core/solidhunter-lib/testdata/NoConsole/.solidhunter.json @@ -0,0 +1,65 @@ +{ + "name": "solidhunter", + "includes": [], + "plugins": [], + "rules": [ + { + "id": "line-max-len", + "severity": "WARNING", + "data": [ + "80" + ] + }, + { + "id": "max-states-count", + "severity": "WARNING", + "data": [ + "15" + ] + }, + { + "id": "function-max-lines", + "severity": "WARNING", + "data": [ + "20" + ] + }, + { + "id": "reason-string", + "severity": "WARNING", + "data": [ + "32" + ] + }, + { + "id": "contract-name-pascalcase", + "severity": "WARNING", + "data": [] + }, + { + "id": "func-name-camelcase", + "severity": "WARNING", + "data": [] + }, + { + "id": "func-param-name-camelcase", + "severity": "WARNING", + "data": [] + }, + { + "id": "use-forbidden-name", + "severity": "WARNING", + "data": [] + }, + { + "id": "import-on-top", + "severity": "WARNING", + "data": [] + }, + { + "id": "no-console", + "severity": "WARNING", + "data": [] + } + ] +} \ No newline at end of file diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/NoConsole/file.sol b/toolchains/solidity/linter/core/solidhunter-lib/testdata/NoConsole/file.sol new file mode 100644 index 00000000..5a242ba4 --- /dev/null +++ b/toolchains/solidity/linter/core/solidhunter-lib/testdata/NoConsole/file.sol @@ -0,0 +1,10 @@ +pragma solidity 0.8.0; + +import "hardhat/console.sol"; +import "forge-std/consoleN.sol"; + +contract Test { + function awesome() public { + console.log("test"); + } +} \ No newline at end of file diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/NoConsole/findings.csv b/toolchains/solidity/linter/core/solidhunter-lib/testdata/NoConsole/findings.csv new file mode 100644 index 00000000..0a683eb8 --- /dev/null +++ b/toolchains/solidity/linter/core/solidhunter-lib/testdata/NoConsole/findings.csv @@ -0,0 +1,3 @@ +no-console:8:16:8:19 +no-console:3:0:3:29 +no-console:4:0:4:32 \ No newline at end of file diff --git a/toolchains/solidity/linter/core/solidhunter-lib/tests/linter.rs b/toolchains/solidity/linter/core/solidhunter-lib/tests/linter.rs index 3a8135af..c2696ebb 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/tests/linter.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/tests/linter.rs @@ -158,5 +158,6 @@ test_directories! { ConstNameSnakeCase, StateVisibility, EmptyBlock, + NoConsole, GlobalImport } From 1b6676a4f6b3837e0c4b00167ae2771c4bc07b20 Mon Sep 17 00:00:00 2001 From: 0xMemoryGrinder <35138272+0xMemoryGrinder@users.noreply.github.com> Date: Sun, 8 Oct 2023 21:28:42 -0400 Subject: [PATCH 178/325] chore(solidity/linter/core): fixed lintiing error --- .../src/rules/best_practises/mod.rs | 4 +- .../src/rules/best_practises/no_console.rs | 7 +- .../src/rules/naming/const_name_snakecase.rs | 2 +- .../src/rules/naming/func_visibility.rs | 18 ++-- .../solidhunter-lib/src/rules/naming/mod.rs | 20 ++--- .../solidhunter-lib/src/rules/security/mod.rs | 5 +- .../core/solidhunter-lib/tests/linter.rs | 1 - toolchains/solidity/linter/core/src/server.rs | 85 ++++++++++++++----- 8 files changed, 96 insertions(+), 46 deletions(-) diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/mod.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/mod.rs index e3d963ed..88acc849 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/mod.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/mod.rs @@ -9,8 +9,8 @@ pub mod function_max_lines; pub mod global_import; pub mod max_states_count; pub mod no_console; -pub mod reason_string; pub mod one_contract_per_file; +pub mod reason_string; // List all rules @@ -20,8 +20,8 @@ use crate::rules::best_practises::function_max_lines::FunctionMaxLines; use crate::rules::best_practises::global_import::GlobalImport; use crate::rules::best_practises::line_maxlen::LineMaxLen; use crate::rules::best_practises::max_states_count::MaxStatesCount; -use crate::rules::best_practises::one_contract_per_file::OneContractPerFile; use crate::rules::best_practises::no_console::NoConsole; +use crate::rules::best_practises::one_contract_per_file::OneContractPerFile; use crate::rules::best_practises::reason_string::ReasonString; use crate::rules::RuleBuilder; diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/no_console.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/no_console.rs index 73040b6a..50e8e64c 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/no_console.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/no_console.rs @@ -65,9 +65,10 @@ impl RuleType for NoConsole { } // Check imports - let mut blacklist: Vec = Vec::new(); - blacklist.push("hardhat/console.sol".to_string()); - blacklist.push("forge-std/console".to_string()); // console?.sol (easier to blacklist this way) + let blacklist: Vec = vec![ + "hardhat/console.sol".to_string(), + "forge-std/console".to_string(), // console?.sol (easier to blacklist this way) + ]; for header in retriever::retrieve_import_directive_nodes(&file.data) { if let ImportPath::Plain(pathplain) = &header.path { diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/const_name_snakecase.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/const_name_snakecase.rs index 99fe2b24..ca1084b2 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/const_name_snakecase.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/const_name_snakecase.rs @@ -1,4 +1,4 @@ -use ast_extractor::{Item, retriever, Spanned}; +use ast_extractor::{retriever, Item, Spanned}; use crate::linter::SolidFile; use crate::rules::types::*; diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/func_visibility.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/func_visibility.rs index 54a0135e..d426368c 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/func_visibility.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/func_visibility.rs @@ -1,10 +1,11 @@ -use ast_extractor::Spanned; use crate::linter::SolidFile; use crate::rules::types::*; use crate::types::*; +use ast_extractor::Spanned; pub const RULE_ID: &str = "func-visibility"; -const MESSAGE: &str = "Explicitly mark visibility in function (public, private, internal, external)"; +const MESSAGE: &str = + "Explicitly mark visibility in function (public, private, internal, external)"; pub const DEFAULT_IGNORE_CONSTRUCTORS: bool = false; @@ -48,13 +49,20 @@ impl RuleType for FuncVisibility { for contract in contracts { for function in ast_extractor::retriever::retrieve_functions_nodes(&contract) { - if function.attributes.visibility().is_some() || (function.kind.is_constructor() && self.ignore_constructors) { + if function.attributes.visibility().is_some() + || (function.kind.is_constructor() && self.ignore_constructors) + { continue; } if function.kind.is_function() { - res.push(self.create_diag((function.kind.span().start(), function.span().end()), file)); + res.push( + self.create_diag( + (function.kind.span().start(), function.span().end()), + file, + ), + ); } else { - let span = function.kind.span(); + let span = function.kind.span(); res.push(self.create_diag((span.start(), span.end()), file)); } } diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/mod.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/mod.rs index b5c2ed9e..0d4a6b30 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/mod.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/mod.rs @@ -1,23 +1,22 @@ +use crate::rules::naming::const_name_snakecase::ConstNameSnakeCase; use crate::rules::naming::contract_name_pascalcase::ContractNamePascalCase; -use crate::rules::naming::func_name_camelcase::FuncNameCamelCase; -use crate::rules::naming::func_visibility::FuncVisibility; use crate::rules::naming::event_name_camelcase::EventNameCamelCase; -use crate::rules::naming::const_name_snakecase::ConstNameSnakeCase; +use crate::rules::naming::func_name_camelcase::FuncNameCamelCase; use crate::rules::naming::func_param_name_camelcase::FuncParamNameCamelcase; +use crate::rules::naming::func_visibility::FuncVisibility; use crate::rules::naming::use_forbidden_name::UseForbiddenName; use crate::rules::types::{RuleEntry, RulesMap}; use crate::rules::RuleBuilder; use std::collections::HashMap; - #[macro_use] pub(crate) mod func_param_name_camelcase; +pub(crate) mod const_name_snakecase; pub(crate) mod contract_name_pascalcase; +pub(crate) mod event_name_camelcase; pub(crate) mod func_name_camelcase; -pub(crate) mod use_forbidden_name; pub(crate) mod func_visibility; -pub(crate) mod event_name_camelcase; -pub(crate) mod const_name_snakecase; +pub(crate) mod use_forbidden_name; // List all rules @@ -52,17 +51,14 @@ pub fn create_rules() -> RulesMap { use_forbidden_name::RULE_ID.to_string(), UseForbiddenName::create, ); - rules.insert( - func_visibility::RULE_ID.to_string(), - FuncVisibility::create, - ); + rules.insert(func_visibility::RULE_ID.to_string(), FuncVisibility::create); rules.insert( event_name_camelcase::RULE_ID.to_string(), EventNameCamelCase::create, ); rules.insert( const_name_snakecase::RULE_ID.to_string(), - ConstNameSnakeCase::create + ConstNameSnakeCase::create, ); rules diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/security/mod.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/security/mod.rs index 2154a98c..f42200ce 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/security/mod.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/security/mod.rs @@ -11,7 +11,10 @@ use crate::rules::security::state_visibility::StateVisibility; use crate::rules::RuleBuilder; pub fn create_default_rules() -> Vec { - vec![NoInlineAssembly::create_default(), StateVisibility::create_default()] + vec![ + NoInlineAssembly::create_default(), + StateVisibility::create_default(), + ] } pub fn create_rules() -> RulesMap { diff --git a/toolchains/solidity/linter/core/solidhunter-lib/tests/linter.rs b/toolchains/solidity/linter/core/solidhunter-lib/tests/linter.rs index c2696ebb..fb860cf5 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/tests/linter.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/tests/linter.rs @@ -77,7 +77,6 @@ fn test_linter(config: &str, source: &str, expected_findings: &Vec) { if !found { not_needed_findings.push(diag); } - } for (_, expected_finding) in expected_findings.iter().enumerate() { found = false; diff --git a/toolchains/solidity/linter/core/src/server.rs b/toolchains/solidity/linter/core/src/server.rs index 7b185cb3..ecfee797 100644 --- a/toolchains/solidity/linter/core/src/server.rs +++ b/toolchains/solidity/linter/core/src/server.rs @@ -1,12 +1,19 @@ use std::{cell::RefCell, rc::Rc}; -use lsp_server_wrapper::{ LanguageServer, Client, lsp_types::{InitializeParams, InitializeResult, InitializedParams, MessageType, ServerCapabilities, TextDocumentSyncCapability, TextDocumentSyncKind, DidOpenTextDocumentParams, DidChangeTextDocumentParams, Diagnostic, DiagnosticSeverity, Range, Position, Url}, Result, LspStdioServer }; +use lsp_server_wrapper::{ + lsp_types::{ + Diagnostic, DiagnosticSeverity, DidChangeTextDocumentParams, DidOpenTextDocumentParams, + InitializeParams, InitializeResult, InitializedParams, MessageType, Position, Range, + ServerCapabilities, TextDocumentSyncCapability, TextDocumentSyncKind, Url, + }, + Client, LanguageServer, LspStdioServer, Result, +}; use solidhunter_lib::{linter::SolidLinter, types::LintDiag}; struct Backend { client: Rc>, config_file_path: String, - linter: RefCell> + linter: RefCell>, } impl LanguageServer for Backend { @@ -24,8 +31,13 @@ impl LanguageServer for Backend { } fn initialized(&self, _: InitializedParams) { - eprintln!("Initializing server with config file: {:?}", self.config_file_path); - self.client.as_ref().borrow() + eprintln!( + "Initializing server with config file: {:?}", + self.config_file_path + ); + self.client + .as_ref() + .borrow() .log_message(MessageType::INFO, "Server initialized!"); let file_res = std::fs::read_to_string(&self.config_file_path); @@ -33,23 +45,30 @@ impl LanguageServer for Backend { if let Ok(file) = file_res { self.linter.borrow_mut().replace(SolidLinter::new(&file)); } else { - self.linter.borrow_mut().replace(SolidLinter::new_fileless()); + self.linter + .borrow_mut() + .replace(SolidLinter::new_fileless()); } - self.client.as_ref().borrow() + self.client + .as_ref() + .borrow() .log_message(MessageType::INFO, "Linter initialized!"); - } fn shutdown(&self) -> Result<()> { - self.client.as_ref().borrow() + self.client + .as_ref() + .borrow() .log_message(MessageType::INFO, "Server shutdown!"); Ok(()) } fn did_open(&self, params: DidOpenTextDocumentParams) { eprintln!("file opened!"); - self.client.as_ref().borrow() + self.client + .as_ref() + .borrow() .log_message(MessageType::INFO, "file opened!"); let filepath = filepath_from_uri(¶ms.text_document.uri); @@ -58,19 +77,33 @@ impl LanguageServer for Backend { let diags_res = linter.parse_content(filepath, ¶ms.text_document.text); if let Ok(diags) = diags_res { - let diags = diags.iter().map(|d| diagnostic_from_lintdiag(d.clone())).collect(); + let diags = diags + .iter() + .map(|d| diagnostic_from_lintdiag(d.clone())) + .collect(); eprintln!("diags: {:?}", diags); - self.client.as_ref().borrow().log_message(MessageType::INFO, "diags: "); - self.client.as_ref().borrow().publish_diagnostics(params.text_document.uri.clone(), diags, None); + self.client + .as_ref() + .borrow() + .log_message(MessageType::INFO, "diags: "); + self.client.as_ref().borrow().publish_diagnostics( + params.text_document.uri.clone(), + diags, + None, + ); } else if let Err(e) = diags_res { - self.client.as_ref().borrow().log_message(MessageType::ERROR, e.to_string()); + self.client + .as_ref() + .borrow() + .log_message(MessageType::ERROR, e.to_string()); } - } fn did_change(&self, params: DidChangeTextDocumentParams) { eprintln!("file changed!"); - self.client.as_ref().borrow() + self.client + .as_ref() + .borrow() .log_message(MessageType::INFO, "file changed!"); let filepath = filepath_from_uri(¶ms.text_document.uri); @@ -79,11 +112,21 @@ impl LanguageServer for Backend { let diags_res = linter.parse_content(filepath, ¶ms.content_changes[0].text); if let Ok(diags) = diags_res { - let diags = diags.iter().map(|d| diagnostic_from_lintdiag(d.clone())).collect(); + let diags = diags + .iter() + .map(|d| diagnostic_from_lintdiag(d.clone())) + .collect(); eprintln!("diags: {:?}", diags); - self.client.as_ref().borrow().publish_diagnostics(params.text_document.uri.clone(), diags, None); + self.client.as_ref().borrow().publish_diagnostics( + params.text_document.uri.clone(), + diags, + None, + ); } else if let Err(e) = diags_res { - self.client.as_ref().borrow().log_message(MessageType::ERROR, e.to_string()); + self.client + .as_ref() + .borrow() + .log_message(MessageType::ERROR, e.to_string()); } } } @@ -120,9 +163,9 @@ fn diagnostic_from_lintdiag(diag: LintDiag) -> Diagnostic { pub fn run_server(config_file_path: String) { eprintln!("starting LSP server"); let server = LspStdioServer::new(); - let _ = LspStdioServer::serve(server, |client| Backend { + let _ = LspStdioServer::serve(server, |client| Backend { client, config_file_path, - linter: RefCell::new(None) + linter: RefCell::new(None), }); -} \ No newline at end of file +} From de5d0287b67a6afc0e336b7365169419d0ba48d5 Mon Sep 17 00:00:00 2001 From: 0xMemoryGrinder <35138272+0xMemoryGrinder@users.noreply.github.com> Date: Sun, 8 Oct 2023 21:33:14 -0400 Subject: [PATCH 179/325] chore: delete remove-me --- remove-me-8a1ba1d16ec74ff0a06f.txt | 1 - 1 file changed, 1 deletion(-) delete mode 100644 remove-me-8a1ba1d16ec74ff0a06f.txt diff --git a/remove-me-8a1ba1d16ec74ff0a06f.txt b/remove-me-8a1ba1d16ec74ff0a06f.txt deleted file mode 100644 index 16ea03bc..00000000 --- a/remove-me-8a1ba1d16ec74ff0a06f.txt +++ /dev/null @@ -1 +0,0 @@ -8a1ba1d16ec74ff0a06f From f4ce396ea44780cad44d943d842c2034c3f74927 Mon Sep 17 00:00:00 2001 From: Astrodevs CI Date: Sat, 7 Oct 2023 19:41:05 +0000 Subject: [PATCH 180/325] chore: create branch feature/50-solidity-linter-rules/99-explicit-type-rule-staging --- remove-me-2ae576bd38cf4420ac78.txt | 1 + 1 file changed, 1 insertion(+) create mode 100644 remove-me-2ae576bd38cf4420ac78.txt diff --git a/remove-me-2ae576bd38cf4420ac78.txt b/remove-me-2ae576bd38cf4420ac78.txt new file mode 100644 index 00000000..5098f378 --- /dev/null +++ b/remove-me-2ae576bd38cf4420ac78.txt @@ -0,0 +1 @@ +2ae576bd38cf4420ac78 From b9cad79324aaf019036ca7498e54d3a96c5964bd Mon Sep 17 00:00:00 2001 From: 0xSwapFeeder Date: Sun, 8 Oct 2023 19:10:50 -0400 Subject: [PATCH 181/325] feat(solidity/linter/core): added explicit types rule + tests --- toolchains/solidity/linter/core/Cargo.lock | 39 ++++++ .../linter/core/solidhunter-lib/Cargo.toml | 1 + .../rules/best_practises/explicit_types.rs | 118 ++++++++++++++++++ .../src/rules/best_practises/mod.rs | 5 +- .../testdata/ExplicitTypes/.solidhunter.json | 14 +++ .../testdata/ExplicitTypes/file.sol | 10 ++ .../testdata/ExplicitTypes/findings.csv | 2 + .../testdata/ImplicitTypes/.solidhunter.json | 14 +++ .../testdata/ImplicitTypes/file.sol | 10 ++ .../testdata/ImplicitTypes/findings.csv | 6 + .../core/solidhunter-lib/tests/linter.rs | 2 + 11 files changed, 220 insertions(+), 1 deletion(-) create mode 100644 toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/explicit_types.rs create mode 100644 toolchains/solidity/linter/core/solidhunter-lib/testdata/ExplicitTypes/.solidhunter.json create mode 100644 toolchains/solidity/linter/core/solidhunter-lib/testdata/ExplicitTypes/file.sol create mode 100644 toolchains/solidity/linter/core/solidhunter-lib/testdata/ExplicitTypes/findings.csv create mode 100644 toolchains/solidity/linter/core/solidhunter-lib/testdata/ImplicitTypes/.solidhunter.json create mode 100644 toolchains/solidity/linter/core/solidhunter-lib/testdata/ImplicitTypes/file.sol create mode 100644 toolchains/solidity/linter/core/solidhunter-lib/testdata/ImplicitTypes/findings.csv diff --git a/toolchains/solidity/linter/core/Cargo.lock b/toolchains/solidity/linter/core/Cargo.lock index 0d21a114..6c1e119c 100644 --- a/toolchains/solidity/linter/core/Cargo.lock +++ b/toolchains/solidity/linter/core/Cargo.lock @@ -17,6 +17,15 @@ version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" +[[package]] +name = "aho-corasick" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ea5d730647d4fadd988536d06fecce94b7b4f2a7efdae548f1cf4b63205518ab" +dependencies = [ + "memchr", +] + [[package]] name = "anstream" version = "0.5.0" @@ -482,6 +491,35 @@ dependencies = [ "bitflags 1.3.2", ] +[[package]] +name = "regex" +version = "1.9.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ebee201405406dbf528b8b672104ae6d6d63e6d118cb10e4d51abbc7b58044ff" +dependencies = [ + "aho-corasick", + "memchr", + "regex-automata", + "regex-syntax", +] + +[[package]] +name = "regex-automata" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59b23e92ee4318893fa3fe3e6fb365258efbfe6ac6ab30f090cdcbb7aa37efa9" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax", +] + +[[package]] +name = "regex-syntax" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dbb5fb1acd8a1a18b3dd5be62d25485eb770e05afb408a9627d14d451bae12da" + [[package]] name = "rustc-demangle" version = "0.1.23" @@ -606,6 +644,7 @@ dependencies = [ "clap", "colored", "glob", + "regex", "serde", "serde_json", "thiserror", diff --git a/toolchains/solidity/linter/core/solidhunter-lib/Cargo.toml b/toolchains/solidity/linter/core/solidhunter-lib/Cargo.toml index c41e9990..58cb7c42 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/Cargo.toml +++ b/toolchains/solidity/linter/core/solidhunter-lib/Cargo.toml @@ -15,3 +15,4 @@ glob = "0.3.0" thiserror = "1.0" ast-extractor = { path = "../../../../../libs/ast-extractor" } tokio = { version = "1.17.0", features = ["full"] } +regex = "1.9.6" diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/explicit_types.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/explicit_types.rs new file mode 100644 index 00000000..59086537 --- /dev/null +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/explicit_types.rs @@ -0,0 +1,118 @@ +use crate::linter::SolidFile; +use crate::rules::types::*; +use crate::types::*; +use ast_extractor::*; + +pub const RULE_ID: &str = "explicit-types"; + +const DEFAULT_RULE: &str = "explicit"; + +pub struct ExplicitTypes { + rule: String, + data: RuleEntry, +} + +pub struct ExplicitTypesVisitor { + type_names: Vec, + type_inits: Vec, +} + +impl <'ast> Visit<'ast> for ExplicitTypesVisitor { + + fn visit_type(&mut self, ty: &'ast Type) { + match ty { + Type::Int(_, _) => { + self.type_names.push(ty.clone()); + } + Type::Uint(_, _) => { + self.type_names.push(ty.clone()); + } + _ => {visit::visit_type(self, ty)} + } + } + + fn visit_variable_definition(&mut self, var: &'ast VariableDefinition) { + if let Some((_, expr)) = &var.initializer { + visit::visit_expr(self, expr); + } + visit::visit_variable_definition(self, var); + } + +} + +impl ExplicitTypes { + fn create_diag(&self, file: &SolidFile, ty: Box, line: &str) -> LintDiag { + let rule_formated = match self.rule.as_str() { + "explicit" => "Explicit", + "implicit" => "Implicit", + _ => "Explicit", + }; + LintDiag { + range: Range { + start: Position { + line: ty.span().start().line, + character: ty.span().start().column, + }, + end: Position { + line: ty.span().end().line, + character: ty.span().end().column, + }, + }, + id: RULE_ID.to_string(), + message: format!("{} types are not allowed: {}", rule_formated, line.len()), + severity: Some(self.data.severity), + code: None, + source: None, + uri: file.path.clone(), + source_file_content: file.content.clone(), + } + } + + fn _check_type(&self, ty: &str, file: &SolidFile, span: Box) -> Option { + if (self.rule == "explicit" && (ty == "int" || ty == "uint")) + || (self.rule == "implicit" && (ty != "int" && ty != "uint")) { + return Some(self.create_diag(file, span, ty)); + } + None + } +} + +impl RuleType for ExplicitTypes { + fn diagnose(&self, file: &SolidFile, _files: &[SolidFile]) -> Vec { + let mut res = Vec::new(); + let mut visitor = ExplicitTypesVisitor { + type_names: vec![], + type_inits: vec![], + }; + visitor.visit_file(&file.data); + for ty in visitor.type_names { + if let Some(diag) = self._check_type(&ty.to_string(), file, Box::new(ty.clone())) { + res.push(diag); + } + } + for ty in visitor.type_inits { + if let Some(diag) = self._check_type(&ty.to_string(), file, Box::new(ty.clone())) { + res.push(diag); + } + } + res + } +} + +impl ExplicitTypes { + pub(crate) fn create(data: RuleEntry) -> Box { + let rule = ExplicitTypes { + rule: data.data[0].clone(), + data, + }; + Box::new(rule) + } + + pub(crate) fn create_default() -> RuleEntry { + RuleEntry { + id: RULE_ID.to_string(), + severity: Severity::WARNING, + data: vec![DEFAULT_RULE.to_string()], + } + } +} diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/mod.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/mod.rs index 88acc849..5312f37c 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/mod.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/mod.rs @@ -11,11 +11,13 @@ pub mod max_states_count; pub mod no_console; pub mod one_contract_per_file; pub mod reason_string; +mod explicit_types; // List all rules use crate::rules::best_practises::custom_errors::CustomErrors; use crate::rules::best_practises::empty_block::EmptyBlock; +use crate::rules::best_practises::explicit_types::ExplicitTypes; use crate::rules::best_practises::function_max_lines::FunctionMaxLines; use crate::rules::best_practises::global_import::GlobalImport; use crate::rules::best_practises::line_maxlen::LineMaxLen; @@ -36,6 +38,7 @@ pub fn create_default_rules() -> Vec { CustomErrors::create_default(), GlobalImport::create_default(), EmptyBlock::create_default(), + ExplicitTypes::create_default(), ] } @@ -60,7 +63,7 @@ pub fn create_rules() -> RulesMap { ); rules.insert(global_import::RULE_ID.to_string(), GlobalImport::create); rules.insert(empty_block::RULE_ID.to_string(), EmptyBlock::create); - + rules.insert(explicit_types::RULE_ID.to_string(), ExplicitTypes::create); rules.insert(no_console::RULE_ID.to_string(), NoConsole::create); rules diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/ExplicitTypes/.solidhunter.json b/toolchains/solidity/linter/core/solidhunter-lib/testdata/ExplicitTypes/.solidhunter.json new file mode 100644 index 00000000..dee9a783 --- /dev/null +++ b/toolchains/solidity/linter/core/solidhunter-lib/testdata/ExplicitTypes/.solidhunter.json @@ -0,0 +1,14 @@ +{ + "name": "solidhunter", + "includes": [], + "plugins": [], + "rules": [ + { + "id": "explicit-types", + "severity": "WARNING", + "data": [ + "explicit" + ] + } + ] +} \ No newline at end of file diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/ExplicitTypes/file.sol b/toolchains/solidity/linter/core/solidhunter-lib/testdata/ExplicitTypes/file.sol new file mode 100644 index 00000000..f65a3e12 --- /dev/null +++ b/toolchains/solidity/linter/core/solidhunter-lib/testdata/ExplicitTypes/file.sol @@ -0,0 +1,10 @@ +pragma solidity 0.8.0; + +contract Test { + uint public constant var1; + int public constant var2; + uint256 public constant var3; + int256 public constant var4; + uint256 public constant var5 = uint256(1); + int8 public constant var6 = int8(1); +} \ No newline at end of file diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/ExplicitTypes/findings.csv b/toolchains/solidity/linter/core/solidhunter-lib/testdata/ExplicitTypes/findings.csv new file mode 100644 index 00000000..61fcefa6 --- /dev/null +++ b/toolchains/solidity/linter/core/solidhunter-lib/testdata/ExplicitTypes/findings.csv @@ -0,0 +1,2 @@ +explicit-types:4:4:4:8 +explicit-types:5:4:5:7 diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/ImplicitTypes/.solidhunter.json b/toolchains/solidity/linter/core/solidhunter-lib/testdata/ImplicitTypes/.solidhunter.json new file mode 100644 index 00000000..8deb89c9 --- /dev/null +++ b/toolchains/solidity/linter/core/solidhunter-lib/testdata/ImplicitTypes/.solidhunter.json @@ -0,0 +1,14 @@ +{ + "name": "solidhunter", + "includes": [], + "plugins": [], + "rules": [ + { + "id": "explicit-types", + "severity": "WARNING", + "data": [ + "implicit" + ] + } + ] +} \ No newline at end of file diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/ImplicitTypes/file.sol b/toolchains/solidity/linter/core/solidhunter-lib/testdata/ImplicitTypes/file.sol new file mode 100644 index 00000000..f65a3e12 --- /dev/null +++ b/toolchains/solidity/linter/core/solidhunter-lib/testdata/ImplicitTypes/file.sol @@ -0,0 +1,10 @@ +pragma solidity 0.8.0; + +contract Test { + uint public constant var1; + int public constant var2; + uint256 public constant var3; + int256 public constant var4; + uint256 public constant var5 = uint256(1); + int8 public constant var6 = int8(1); +} \ No newline at end of file diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/ImplicitTypes/findings.csv b/toolchains/solidity/linter/core/solidhunter-lib/testdata/ImplicitTypes/findings.csv new file mode 100644 index 00000000..1f338249 --- /dev/null +++ b/toolchains/solidity/linter/core/solidhunter-lib/testdata/ImplicitTypes/findings.csv @@ -0,0 +1,6 @@ +explicit-types:6:4:6:11 +explicit-types:7:4:7:10 +explicit-types:8:4:8:11 +explicit-types:9:4:9:8 +explicit-types:8:35:8:42 +explicit-types:9:32:9:36 diff --git a/toolchains/solidity/linter/core/solidhunter-lib/tests/linter.rs b/toolchains/solidity/linter/core/solidhunter-lib/tests/linter.rs index fb860cf5..117e661c 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/tests/linter.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/tests/linter.rs @@ -158,5 +158,7 @@ test_directories! { StateVisibility, EmptyBlock, NoConsole, + ExplicitTypes, + ImplicitTypes, GlobalImport } From 608cb2b139330f047ed5145ce49eefc9cf221bb0 Mon Sep 17 00:00:00 2001 From: 0xMemoryGrinder <35138272+0xMemoryGrinder@users.noreply.github.com> Date: Sun, 8 Oct 2023 21:37:06 -0400 Subject: [PATCH 182/325] chore: deleted remove-me --- remove-me-2ae576bd38cf4420ac78.txt | 1 - 1 file changed, 1 deletion(-) delete mode 100644 remove-me-2ae576bd38cf4420ac78.txt diff --git a/remove-me-2ae576bd38cf4420ac78.txt b/remove-me-2ae576bd38cf4420ac78.txt deleted file mode 100644 index 5098f378..00000000 --- a/remove-me-2ae576bd38cf4420ac78.txt +++ /dev/null @@ -1 +0,0 @@ -2ae576bd38cf4420ac78 From 11600a0b113955ce150249566192917e1014cf7e Mon Sep 17 00:00:00 2001 From: Astrodevs CI Date: Fri, 29 Sep 2023 19:02:13 +0000 Subject: [PATCH 183/325] chore: create branch feature/50-solidity-linter-rules/105-payable-fallback-rule-staging --- remove-me-b331263f074c45509be1.txt | 1 + 1 file changed, 1 insertion(+) create mode 100644 remove-me-b331263f074c45509be1.txt diff --git a/remove-me-b331263f074c45509be1.txt b/remove-me-b331263f074c45509be1.txt new file mode 100644 index 00000000..42617c4f --- /dev/null +++ b/remove-me-b331263f074c45509be1.txt @@ -0,0 +1 @@ +b331263f074c45509be1 From cb518df89d4d9f0305666b7306f97b31d8cce84d Mon Sep 17 00:00:00 2001 From: 0xMemoryGrinder <35138272+0xMemoryGrinder@users.noreply.github.com> Date: Sat, 7 Oct 2023 18:30:54 -0400 Subject: [PATCH 184/325] feat: push payable fallback rule --- .../src/rules/best_practises/mod.rs | 7 ++ .../rules/best_practises/payable_fallback.rs | 75 +++++++++++++++++++ .../PayableFallback/.solidhunter.json | 65 ++++++++++++++++ .../testdata/PayableFallback/file.sol | 5 ++ .../testdata/PayableFallback/findings.csv | 1 + .../core/solidhunter-lib/tests/linter.rs | 1 + 6 files changed, 154 insertions(+) create mode 100644 toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/payable_fallback.rs create mode 100644 toolchains/solidity/linter/core/solidhunter-lib/testdata/PayableFallback/.solidhunter.json create mode 100644 toolchains/solidity/linter/core/solidhunter-lib/testdata/PayableFallback/file.sol create mode 100644 toolchains/solidity/linter/core/solidhunter-lib/testdata/PayableFallback/findings.csv diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/mod.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/mod.rs index 5312f37c..8ad9d7d7 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/mod.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/mod.rs @@ -10,6 +10,7 @@ pub mod global_import; pub mod max_states_count; pub mod no_console; pub mod one_contract_per_file; +pub mod payable_fallback; pub mod reason_string; mod explicit_types; @@ -24,6 +25,7 @@ use crate::rules::best_practises::line_maxlen::LineMaxLen; use crate::rules::best_practises::max_states_count::MaxStatesCount; use crate::rules::best_practises::no_console::NoConsole; use crate::rules::best_practises::one_contract_per_file::OneContractPerFile; +use crate::rules::best_practises::payable_fallback::PayableFallback; use crate::rules::best_practises::reason_string::ReasonString; use crate::rules::RuleBuilder; @@ -39,6 +41,7 @@ pub fn create_default_rules() -> Vec { GlobalImport::create_default(), EmptyBlock::create_default(), ExplicitTypes::create_default(), + PayableFallback::create_default(), ] } @@ -65,6 +68,10 @@ pub fn create_rules() -> RulesMap { rules.insert(empty_block::RULE_ID.to_string(), EmptyBlock::create); rules.insert(explicit_types::RULE_ID.to_string(), ExplicitTypes::create); rules.insert(no_console::RULE_ID.to_string(), NoConsole::create); + rules.insert( + payable_fallback::RULE_ID.to_string(), + PayableFallback::create, + ); rules } diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/payable_fallback.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/payable_fallback.rs new file mode 100644 index 00000000..ac6fc05f --- /dev/null +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/payable_fallback.rs @@ -0,0 +1,75 @@ +use ast_extractor::Spanned; + +use crate::linter::SolidFile; +use crate::rules::types::*; +use crate::types::*; + +// const DEFAULT_SEVERITY: &str = "warn"; +const DEFAULT_MESSAGE: &str = "Fallback should contains payable attributs"; +pub const RULE_ID: &str = "payable-fallback"; + +pub struct PayableFallback { + _data: RuleEntry, +} + +impl RuleType for PayableFallback { + fn diagnose(&self, _file: &SolidFile, _files: &[SolidFile]) -> Vec { + let mut res = Vec::new(); + let _report = check_fallback_payable(_file); + + if let Some(report) = _report { + res.push(LintDiag { + id: RULE_ID.to_string(), + severity: Some(Severity::WARNING), + range: report, + code: None, + source: None, + message: DEFAULT_MESSAGE.to_string(), + uri: _file.path.clone(), + source_file_content: _file.content.clone(), + }) + } + print!("{:?}", res); + println!(""); + res + } +} + +fn check_fallback_payable(file: &SolidFile) -> Option { + let mut res: Option = None; + let mut line_index = 1; + + file.content.lines().for_each(|line| { + if line.find("fallback").is_some() { + if !line.find("payable").is_some() { + res = Some(Range { + start: Position { + line: line_index, + character: 0, + }, + end: Position { + line: line_index, + character: 0, + }, + }) + } + } + line_index += 1; + }); + res +} + +impl PayableFallback { + pub fn create(data: RuleEntry) -> Box { + let rule = PayableFallback { _data: data }; + Box::new(rule) + } + + pub fn create_default() -> RuleEntry { + RuleEntry { + id: RULE_ID.to_string(), + severity: Severity::WARNING, + data: vec![], + } + } +} diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/PayableFallback/.solidhunter.json b/toolchains/solidity/linter/core/solidhunter-lib/testdata/PayableFallback/.solidhunter.json new file mode 100644 index 00000000..ee5b30ed --- /dev/null +++ b/toolchains/solidity/linter/core/solidhunter-lib/testdata/PayableFallback/.solidhunter.json @@ -0,0 +1,65 @@ +{ + "name": "solidhunter", + "includes": [], + "plugins": [], + "rules": [ + { + "id": "line-max-len", + "severity": "WARNING", + "data": [ + "80" + ] + }, + { + "id": "max-states-count", + "severity": "WARNING", + "data": [ + "15" + ] + }, + { + "id": "function-max-lines", + "severity": "WARNING", + "data": [ + "20" + ] + }, + { + "id": "reason-string", + "severity": "WARNING", + "data": [ + "32" + ] + }, + { + "id": "contract-name-pascalcase", + "severity": "WARNING", + "data": [] + }, + { + "id": "func-name-camelcase", + "severity": "WARNING", + "data": [] + }, + { + "id": "func-param-name-camelcase", + "severity": "WARNING", + "data": [] + }, + { + "id": "use-forbidden-name", + "severity": "WARNING", + "data": [] + }, + { + "id": "import-on-top", + "severity": "WARNING", + "data": [] + }, + { + "id": "payable-fallback", + "severity": "WARNING", + "data": [] + } + ] +} \ No newline at end of file diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/PayableFallback/file.sol b/toolchains/solidity/linter/core/solidhunter-lib/testdata/PayableFallback/file.sol new file mode 100644 index 00000000..24b1d740 --- /dev/null +++ b/toolchains/solidity/linter/core/solidhunter-lib/testdata/PayableFallback/file.sol @@ -0,0 +1,5 @@ +pragma solidity 0.8.19; + +contract Test { + fallback() external {} +} diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/PayableFallback/findings.csv b/toolchains/solidity/linter/core/solidhunter-lib/testdata/PayableFallback/findings.csv new file mode 100644 index 00000000..e1a8b756 --- /dev/null +++ b/toolchains/solidity/linter/core/solidhunter-lib/testdata/PayableFallback/findings.csv @@ -0,0 +1 @@ +payable-fallback:4:0:4:0 \ No newline at end of file diff --git a/toolchains/solidity/linter/core/solidhunter-lib/tests/linter.rs b/toolchains/solidity/linter/core/solidhunter-lib/tests/linter.rs index 117e661c..29f9ced2 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/tests/linter.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/tests/linter.rs @@ -160,5 +160,6 @@ test_directories! { NoConsole, ExplicitTypes, ImplicitTypes, + PayableFallback, GlobalImport } From a097f64ab1f6bd978166fc9062589381a0c828e0 Mon Sep 17 00:00:00 2001 From: leon3108 Date: Tue, 26 Sep 2023 18:14:50 +0100 Subject: [PATCH 185/325] feat: diag return the good char position --- .../src/rules/best_practises/payable_fallback.rs | 7 ++++--- .../solidhunter-lib/testdata/PayableFallback/findings.csv | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/payable_fallback.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/payable_fallback.rs index ac6fc05f..074b4640 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/payable_fallback.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/payable_fallback.rs @@ -40,16 +40,17 @@ fn check_fallback_payable(file: &SolidFile) -> Option { let mut line_index = 1; file.content.lines().for_each(|line| { - if line.find("fallback").is_some() { + let fallback_index = line.find("fallback"); + if fallback_index.is_some() { if !line.find("payable").is_some() { res = Some(Range { start: Position { line: line_index, - character: 0, + character: fallback_index.unwrap() + 1, }, end: Position { line: line_index, - character: 0, + character: fallback_index.unwrap() + 1 + "payable".len(), }, }) } diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/PayableFallback/findings.csv b/toolchains/solidity/linter/core/solidhunter-lib/testdata/PayableFallback/findings.csv index e1a8b756..6690f352 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/testdata/PayableFallback/findings.csv +++ b/toolchains/solidity/linter/core/solidhunter-lib/testdata/PayableFallback/findings.csv @@ -1 +1 @@ -payable-fallback:4:0:4:0 \ No newline at end of file +payable-fallback:4:5:4:12 \ No newline at end of file From c4f8ef74b98a35573568ff0eab303c2668953246 Mon Sep 17 00:00:00 2001 From: leon3108 Date: Wed, 27 Sep 2023 11:12:07 +0100 Subject: [PATCH 186/325] feat: add text case when fallback is not explicit --- .../src/rules/best_practises/payable_fallback.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/payable_fallback.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/payable_fallback.rs index 074b4640..e5574854 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/payable_fallback.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/payable_fallback.rs @@ -40,7 +40,10 @@ fn check_fallback_payable(file: &SolidFile) -> Option { let mut line_index = 1; file.content.lines().for_each(|line| { - let fallback_index = line.find("fallback"); + let mut fallback_index = line.find("fallback"); + if !fallback_index.is_some() { + fallback_index = line.find("function"); + } if fallback_index.is_some() { if !line.find("payable").is_some() { res = Some(Range { From 7bfc0ca835a679b8e5153801d77117a33673099b Mon Sep 17 00:00:00 2001 From: leon3108 Date: Wed, 27 Sep 2023 11:29:21 +0100 Subject: [PATCH 187/325] chore: restore valide remove-me files --- remove-me-02fd9ae66d2443f1a92b.txt | 1 + remove-me-34219c48b31d404ab611.txt | 1 + remove-me-3ebde08f11694be5b2a3.txt | 1 + 3 files changed, 3 insertions(+) create mode 100644 remove-me-02fd9ae66d2443f1a92b.txt create mode 100644 remove-me-34219c48b31d404ab611.txt create mode 100644 remove-me-3ebde08f11694be5b2a3.txt diff --git a/remove-me-02fd9ae66d2443f1a92b.txt b/remove-me-02fd9ae66d2443f1a92b.txt new file mode 100644 index 00000000..4fd24081 --- /dev/null +++ b/remove-me-02fd9ae66d2443f1a92b.txt @@ -0,0 +1 @@ +02fd9ae66d2443f1a92b diff --git a/remove-me-34219c48b31d404ab611.txt b/remove-me-34219c48b31d404ab611.txt new file mode 100644 index 00000000..78564588 --- /dev/null +++ b/remove-me-34219c48b31d404ab611.txt @@ -0,0 +1 @@ +34219c48b31d404ab611 diff --git a/remove-me-3ebde08f11694be5b2a3.txt b/remove-me-3ebde08f11694be5b2a3.txt new file mode 100644 index 00000000..b5d657a5 --- /dev/null +++ b/remove-me-3ebde08f11694be5b2a3.txt @@ -0,0 +1 @@ +3ebde08f11694be5b2a3 From ebdaca1fc45c9c1c2e9da93486b9df2154d8ab1d Mon Sep 17 00:00:00 2001 From: leon3108 Date: Fri, 6 Oct 2023 10:36:46 +0100 Subject: [PATCH 188/325] refactor: use ast extractor now --- .../rules/best_practises/payable_fallback.rs | 74 +++++++++---------- .../testdata/PayableFallback/findings.csv | 2 +- 2 files changed, 38 insertions(+), 38 deletions(-) diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/payable_fallback.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/payable_fallback.rs index e5574854..e3f477fe 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/payable_fallback.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/payable_fallback.rs @@ -1,4 +1,5 @@ -use ast_extractor::Spanned; +use ast_extractor::retriever::{retrieve_contract_nodes, retrieve_functions_nodes}; +use ast_extractor::{FunctionKind, Spanned, Visibility}; use crate::linter::SolidFile; use crate::rules::types::*; @@ -15,51 +16,50 @@ pub struct PayableFallback { impl RuleType for PayableFallback { fn diagnose(&self, _file: &SolidFile, _files: &[SolidFile]) -> Vec { let mut res = Vec::new(); - let _report = check_fallback_payable(_file); + let reports = check_fallback_payable(_file); - if let Some(report) = _report { - res.push(LintDiag { - id: RULE_ID.to_string(), - severity: Some(Severity::WARNING), - range: report, - code: None, - source: None, - message: DEFAULT_MESSAGE.to_string(), - uri: _file.path.clone(), - source_file_content: _file.content.clone(), - }) + for report in reports { + if let Some(rep) = report { + res.push(LintDiag { + id: RULE_ID.to_string(), + severity: Some(Severity::WARNING), + range: rep, + code: None, + source: None, + message: DEFAULT_MESSAGE.to_string(), + uri: _file.path.clone(), + source_file_content: _file.content.clone(), + }) + } } - print!("{:?}", res); - println!(""); res } } -fn check_fallback_payable(file: &SolidFile) -> Option { - let mut res: Option = None; - let mut line_index = 1; +fn check_fallback_payable(file: &SolidFile) -> Vec> { + let mut res: Vec> = Vec::new(); - file.content.lines().for_each(|line| { - let mut fallback_index = line.find("fallback"); - if !fallback_index.is_some() { - fallback_index = line.find("function"); - } - if fallback_index.is_some() { - if !line.find("payable").is_some() { - res = Some(Range { - start: Position { - line: line_index, - character: fallback_index.unwrap() + 1, - }, - end: Position { - line: line_index, - character: fallback_index.unwrap() + 1 + "payable".len(), - }, - }) + let contracts = retrieve_contract_nodes(&file.data); + for contract in contracts { + let functions = retrieve_functions_nodes(&contract); + + for function in functions { + if FunctionKind::is_fallback(function.kind) { + if Visibility::is_external(function.attributes.visibility().unwrap()) { + res.push(Some(Range { + start: Position { + line: function.attributes.span().start().line, + character: function.attributes.span().start().column + 1, + }, + end: Position { + line: function.attributes.span().end().line, + character: function.attributes.span().end().column, + }, + })); + } } } - line_index += 1; - }); + } res } diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/PayableFallback/findings.csv b/toolchains/solidity/linter/core/solidhunter-lib/testdata/PayableFallback/findings.csv index 6690f352..12770f45 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/testdata/PayableFallback/findings.csv +++ b/toolchains/solidity/linter/core/solidhunter-lib/testdata/PayableFallback/findings.csv @@ -1 +1 @@ -payable-fallback:4:5:4:12 \ No newline at end of file +payable-fallback:4:16:4:23 \ No newline at end of file From 1d0802436d2fadbe25593056b84e7f591d9dd42e Mon Sep 17 00:00:00 2001 From: leon3108 Date: Sun, 8 Oct 2023 17:25:14 +0100 Subject: [PATCH 189/325] fix: check is it's a fallback instead of visibility --- remove-me-02fd9ae66d2443f1a92b.txt | 1 - .../rules/best_practises/payable_fallback.rs | 48 +++++++++++++------ .../testdata/PayableFallback/file.sol | 8 +++- .../testdata/PayableFallback/findings.csv | 3 +- 4 files changed, 43 insertions(+), 17 deletions(-) delete mode 100644 remove-me-02fd9ae66d2443f1a92b.txt diff --git a/remove-me-02fd9ae66d2443f1a92b.txt b/remove-me-02fd9ae66d2443f1a92b.txt deleted file mode 100644 index 4fd24081..00000000 --- a/remove-me-02fd9ae66d2443f1a92b.txt +++ /dev/null @@ -1 +0,0 @@ -02fd9ae66d2443f1a92b diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/payable_fallback.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/payable_fallback.rs index e3f477fe..5beab8ae 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/payable_fallback.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/payable_fallback.rs @@ -1,12 +1,12 @@ use ast_extractor::retriever::{retrieve_contract_nodes, retrieve_functions_nodes}; -use ast_extractor::{FunctionKind, Spanned, Visibility}; +use ast_extractor::{FunctionKind, ItemFunction, Mutability, Spanned}; use crate::linter::SolidFile; use crate::rules::types::*; use crate::types::*; // const DEFAULT_SEVERITY: &str = "warn"; -const DEFAULT_MESSAGE: &str = "Fallback should contains payable attributs"; +const DEFAULT_MESSAGE: &str = "Fallback should contains payable attributes"; pub const RULE_ID: &str = "payable-fallback"; pub struct PayableFallback { @@ -32,6 +32,7 @@ impl RuleType for PayableFallback { }) } } + println!("res {:?}", res); res } } @@ -45,23 +46,42 @@ fn check_fallback_payable(file: &SolidFile) -> Vec> { for function in functions { if FunctionKind::is_fallback(function.kind) { - if Visibility::is_external(function.attributes.visibility().unwrap()) { - res.push(Some(Range { - start: Position { - line: function.attributes.span().start().line, - character: function.attributes.span().start().column + 1, - }, - end: Position { - line: function.attributes.span().end().line, - character: function.attributes.span().end().column, - }, - })); - } + res = check_attribute(res, function); + } else if function.name.is_none() { + res = check_attribute(res, function); } } } res } +fn check_attribute(mut res: Vec>, function: ItemFunction) -> Vec> { + let mut is_payable = false; + for attributes in function.attributes.iter() { + if attributes.mutability().is_some() + && Mutability::is_payable(attributes.mutability().unwrap()) + { + is_payable = true; + } + } + if !is_payable { + res.push(create_diag(function)); + } + res +} + +fn create_diag(function: ItemFunction) -> Option { + let res = Some(Range { + start: Position { + line: function.attributes.span().start().line, + character: function.attributes.span().start().column + 1, + }, + end: Position { + line: function.attributes.span().end().line, + character: function.attributes.span().end().column, + }, + }); + res +} impl PayableFallback { pub fn create(data: RuleEntry) -> Box { diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/PayableFallback/file.sol b/toolchains/solidity/linter/core/solidhunter-lib/testdata/PayableFallback/file.sol index 24b1d740..65db5175 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/testdata/PayableFallback/file.sol +++ b/toolchains/solidity/linter/core/solidhunter-lib/testdata/PayableFallback/file.sol @@ -1,5 +1,11 @@ pragma solidity 0.8.19; contract Test { - fallback() external {} + function() public payable {} // Valid + + fallback() external payable {} // Valid + + function() public {} // Not Valid + + fallback() external {} // Not Valid } diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/PayableFallback/findings.csv b/toolchains/solidity/linter/core/solidhunter-lib/testdata/PayableFallback/findings.csv index 12770f45..6e8d9550 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/testdata/PayableFallback/findings.csv +++ b/toolchains/solidity/linter/core/solidhunter-lib/testdata/PayableFallback/findings.csv @@ -1 +1,2 @@ -payable-fallback:4:16:4:23 \ No newline at end of file +payable-fallback:8:16:8:21 +payable-fallback:10:16:10:22 \ No newline at end of file From 1a2666f4b13f95c8e8075f9d1414dd222b209b63 Mon Sep 17 00:00:00 2001 From: leon3108 Date: Sun, 8 Oct 2023 21:58:14 +0100 Subject: [PATCH 190/325] rm remove-me --- remove-me-34219c48b31d404ab611.txt | 1 - remove-me-3ebde08f11694be5b2a3.txt | 1 - remove-me-b331263f074c45509be1.txt | 1 - 3 files changed, 3 deletions(-) delete mode 100644 remove-me-34219c48b31d404ab611.txt delete mode 100644 remove-me-3ebde08f11694be5b2a3.txt delete mode 100644 remove-me-b331263f074c45509be1.txt diff --git a/remove-me-34219c48b31d404ab611.txt b/remove-me-34219c48b31d404ab611.txt deleted file mode 100644 index 78564588..00000000 --- a/remove-me-34219c48b31d404ab611.txt +++ /dev/null @@ -1 +0,0 @@ -34219c48b31d404ab611 diff --git a/remove-me-3ebde08f11694be5b2a3.txt b/remove-me-3ebde08f11694be5b2a3.txt deleted file mode 100644 index b5d657a5..00000000 --- a/remove-me-3ebde08f11694be5b2a3.txt +++ /dev/null @@ -1 +0,0 @@ -3ebde08f11694be5b2a3 diff --git a/remove-me-b331263f074c45509be1.txt b/remove-me-b331263f074c45509be1.txt deleted file mode 100644 index 42617c4f..00000000 --- a/remove-me-b331263f074c45509be1.txt +++ /dev/null @@ -1 +0,0 @@ -b331263f074c45509be1 From aa1df2c2f8f971239aa180e8f6b506dd0c6ab7fa Mon Sep 17 00:00:00 2001 From: leon3108 Date: Sun, 8 Oct 2023 22:07:15 +0100 Subject: [PATCH 191/325] fix: remove println --- .../solidhunter-lib/src/rules/best_practises/payable_fallback.rs | 1 - 1 file changed, 1 deletion(-) diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/payable_fallback.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/payable_fallback.rs index 5beab8ae..a01cf5c4 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/payable_fallback.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/payable_fallback.rs @@ -32,7 +32,6 @@ impl RuleType for PayableFallback { }) } } - println!("res {:?}", res); res } } From 7c0fc2a3e82bd5936105e884f24365902c64148d Mon Sep 17 00:00:00 2001 From: leon3108 Date: Sun, 8 Oct 2023 23:58:03 +0100 Subject: [PATCH 192/325] fix: test --- .../src/rules/best_practises/payable_fallback.rs | 4 ++-- .../solidhunter-lib/testdata/PayableFallback/findings.csv | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/payable_fallback.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/payable_fallback.rs index a01cf5c4..86467b7f 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/payable_fallback.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/payable_fallback.rs @@ -63,12 +63,12 @@ fn check_attribute(mut res: Vec>, function: ItemFunction) -> Vec Option { +fn create_report(function: ItemFunction) -> Option { let res = Some(Range { start: Position { line: function.attributes.span().start().line, diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/PayableFallback/findings.csv b/toolchains/solidity/linter/core/solidhunter-lib/testdata/PayableFallback/findings.csv index 6e8d9550..0dc48874 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/testdata/PayableFallback/findings.csv +++ b/toolchains/solidity/linter/core/solidhunter-lib/testdata/PayableFallback/findings.csv @@ -1,2 +1,2 @@ payable-fallback:8:16:8:21 -payable-fallback:10:16:10:22 \ No newline at end of file +payable-fallback:10:16:10:23 \ No newline at end of file From 5ca2832f04d6ff8abdc6c9920aaa78b64047f5a8 Mon Sep 17 00:00:00 2001 From: 0xMemoryGrinder <35138272+0xMemoryGrinder@users.noreply.github.com> Date: Sun, 8 Oct 2023 21:52:08 -0400 Subject: [PATCH 193/325] chore(solidity/linter/core): fixed lint error --- .../rules/best_practises/payable_fallback.rs | 33 ++++++++----------- 1 file changed, 14 insertions(+), 19 deletions(-) diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/payable_fallback.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/payable_fallback.rs index 86467b7f..d7a157f8 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/payable_fallback.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/payable_fallback.rs @@ -18,19 +18,17 @@ impl RuleType for PayableFallback { let mut res = Vec::new(); let reports = check_fallback_payable(_file); - for report in reports { - if let Some(rep) = report { - res.push(LintDiag { - id: RULE_ID.to_string(), - severity: Some(Severity::WARNING), - range: rep, - code: None, - source: None, - message: DEFAULT_MESSAGE.to_string(), - uri: _file.path.clone(), - source_file_content: _file.content.clone(), - }) - } + for report in reports.into_iter().flatten() { + res.push(LintDiag { + id: RULE_ID.to_string(), + severity: Some(Severity::WARNING), + range: report, + code: None, + source: None, + message: DEFAULT_MESSAGE.to_string(), + uri: _file.path.clone(), + source_file_content: _file.content.clone(), + }); } res } @@ -44,9 +42,7 @@ fn check_fallback_payable(file: &SolidFile) -> Vec> { let functions = retrieve_functions_nodes(&contract); for function in functions { - if FunctionKind::is_fallback(function.kind) { - res = check_attribute(res, function); - } else if function.name.is_none() { + if FunctionKind::is_fallback(function.kind) || function.name.is_none() { res = check_attribute(res, function); } } @@ -69,7 +65,7 @@ fn check_attribute(mut res: Vec>, function: ItemFunction) -> Vec Option { - let res = Some(Range { + Some(Range { start: Position { line: function.attributes.span().start().line, character: function.attributes.span().start().column + 1, @@ -78,8 +74,7 @@ fn create_report(function: ItemFunction) -> Option { line: function.attributes.span().end().line, character: function.attributes.span().end().column, }, - }); - res + }) } impl PayableFallback { From 9327c14c5f1d077699cc091f439a9da94384792f Mon Sep 17 00:00:00 2001 From: Astrodevs CI Date: Mon, 2 Oct 2023 13:52:06 +0000 Subject: [PATCH 194/325] chore: create branch feature/50-solidity-linter-rules/115-visibility-modifier-order-rule-staging --- remove-me-bf771bf7c0554db6a496.txt | 1 + 1 file changed, 1 insertion(+) create mode 100644 remove-me-bf771bf7c0554db6a496.txt diff --git a/remove-me-bf771bf7c0554db6a496.txt b/remove-me-bf771bf7c0554db6a496.txt new file mode 100644 index 00000000..077d20ef --- /dev/null +++ b/remove-me-bf771bf7c0554db6a496.txt @@ -0,0 +1 @@ +bf771bf7c0554db6a496 From 047dfadcc9e5dbad8d221412c10ff0998847e6d8 Mon Sep 17 00:00:00 2001 From: 0xMemoryGrinder <35138272+0xMemoryGrinder@users.noreply.github.com> Date: Sat, 7 Oct 2023 18:36:35 -0400 Subject: [PATCH 195/325] feat: add rule --- .../src/rules/best_practises/mod.rs | 7 ++ .../visibility_modifier_order.rs | 68 +++++++++++++++++++ .../VisibilityModifierOrder/.solidhunter.json | 65 ++++++++++++++++++ .../testdata/VisibilityModifierOrder/file.sol | 5 ++ .../VisibilityModifierOrder/findings.csv | 1 + .../core/solidhunter-lib/tests/linter.rs | 1 + 6 files changed, 147 insertions(+) create mode 100644 toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/visibility_modifier_order.rs create mode 100644 toolchains/solidity/linter/core/solidhunter-lib/testdata/VisibilityModifierOrder/.solidhunter.json create mode 100644 toolchains/solidity/linter/core/solidhunter-lib/testdata/VisibilityModifierOrder/file.sol create mode 100644 toolchains/solidity/linter/core/solidhunter-lib/testdata/VisibilityModifierOrder/findings.csv diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/mod.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/mod.rs index 8ad9d7d7..9c9d70bf 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/mod.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/mod.rs @@ -13,6 +13,7 @@ pub mod one_contract_per_file; pub mod payable_fallback; pub mod reason_string; mod explicit_types; +pub mod visibility_modifier_order; // List all rules @@ -27,6 +28,7 @@ use crate::rules::best_practises::no_console::NoConsole; use crate::rules::best_practises::one_contract_per_file::OneContractPerFile; use crate::rules::best_practises::payable_fallback::PayableFallback; use crate::rules::best_practises::reason_string::ReasonString; +use crate::rules::best_practises::visibility_modifier_order::VisibilityModiferOrder; use crate::rules::RuleBuilder; pub fn create_default_rules() -> Vec { @@ -42,6 +44,7 @@ pub fn create_default_rules() -> Vec { EmptyBlock::create_default(), ExplicitTypes::create_default(), PayableFallback::create_default(), + VisibilityModiferOrder::create_default(), ] } @@ -72,6 +75,10 @@ pub fn create_rules() -> RulesMap { payable_fallback::RULE_ID.to_string(), PayableFallback::create, ); + rules.insert( + visibility_modifier_order::RULE_ID.to_string(), + VisibilityModiferOrder::create, + ); rules } diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/visibility_modifier_order.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/visibility_modifier_order.rs new file mode 100644 index 00000000..f18bf372 --- /dev/null +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/visibility_modifier_order.rs @@ -0,0 +1,68 @@ +use crate::linter::SolidFile; +use crate::rules::types::*; +use crate::types::*; + +// const DEFAULT_SEVERITY: &str = "warn"; +const DEFAULT_MESSAGE: &str = "Visibility modifier not placed first"; +pub const RULE_ID: &str = "visibility-modifier-order"; + +pub struct VisibilityModiferOrder { + _data: RuleEntry, +} + +// je retourne une erreur si la visibility modifier +// n'est pas juste apres nom_de_fonction() + +impl RuleType for VisibilityModiferOrder { + fn diagnose(&self, _file: &SolidFile, _files: &[SolidFile]) -> Vec { + let mut res = Vec::new(); + let mut line_index = 1; + + _file.content.lines().for_each(|line| { + if line.find("function").is_some() { + let line_splitted = line.split_whitespace().collect::>(); + if line_splitted[2] != "public" && line_splitted[2] != "private" { + let start_index = line.find(line_splitted[2]).unwrap(); + let range = Range { + start: Position { + line: line_index, + character: start_index + 1, + }, + end: Position { + line: line_index, + character: start_index + line_splitted[2].len(), + }, + }; + res.push(LintDiag { + id: RULE_ID.to_string(), + range: range, + severity: Some(Severity::WARNING), + code: None, + source: None, + message: DEFAULT_MESSAGE.to_string(), + uri: _file.path.clone(), + source_file_content: _file.content.clone(), + }); + } + } + line_index += 1; + }); + println!("res {:?}", res); + res + } +} + +impl VisibilityModiferOrder { + pub fn create(data: RuleEntry) -> Box { + let rule = VisibilityModiferOrder { _data: data }; + Box::new(rule) + } + + pub fn create_default() -> RuleEntry { + RuleEntry { + id: RULE_ID.to_string(), + severity: Severity::WARNING, + data: vec![], + } + } +} diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/VisibilityModifierOrder/.solidhunter.json b/toolchains/solidity/linter/core/solidhunter-lib/testdata/VisibilityModifierOrder/.solidhunter.json new file mode 100644 index 00000000..b7487bae --- /dev/null +++ b/toolchains/solidity/linter/core/solidhunter-lib/testdata/VisibilityModifierOrder/.solidhunter.json @@ -0,0 +1,65 @@ +{ + "name": "solidhunter", + "includes": [], + "plugins": [], + "rules": [ + { + "id": "line-max-len", + "severity": "WARNING", + "data": [ + "80" + ] + }, + { + "id": "max-states-count", + "severity": "WARNING", + "data": [ + "15" + ] + }, + { + "id": "function-max-lines", + "severity": "WARNING", + "data": [ + "20" + ] + }, + { + "id": "reason-string", + "severity": "WARNING", + "data": [ + "32" + ] + }, + { + "id": "contract-name-pascalcase", + "severity": "WARNING", + "data": [] + }, + { + "id": "func-name-camelcase", + "severity": "WARNING", + "data": [] + }, + { + "id": "func-param-name-camelcase", + "severity": "WARNING", + "data": [] + }, + { + "id": "use-forbidden-name", + "severity": "WARNING", + "data": [] + }, + { + "id": "import-on-top", + "severity": "WARNING", + "data": [] + }, + { + "id": "visibility-modifier-order", + "severity": "WARNING", + "data": [] + } + ] +} \ No newline at end of file diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/VisibilityModifierOrder/file.sol b/toolchains/solidity/linter/core/solidhunter-lib/testdata/VisibilityModifierOrder/file.sol new file mode 100644 index 00000000..03106eaa --- /dev/null +++ b/toolchains/solidity/linter/core/solidhunter-lib/testdata/VisibilityModifierOrder/file.sol @@ -0,0 +1,5 @@ +pragma solidity ^0.8.0; + +contract Test { + function test() ownable() public payable {} +} diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/VisibilityModifierOrder/findings.csv b/toolchains/solidity/linter/core/solidhunter-lib/testdata/VisibilityModifierOrder/findings.csv new file mode 100644 index 00000000..9df79273 --- /dev/null +++ b/toolchains/solidity/linter/core/solidhunter-lib/testdata/VisibilityModifierOrder/findings.csv @@ -0,0 +1 @@ +visibility-modifier-order:4:21:4:29 \ No newline at end of file diff --git a/toolchains/solidity/linter/core/solidhunter-lib/tests/linter.rs b/toolchains/solidity/linter/core/solidhunter-lib/tests/linter.rs index 29f9ced2..e376a7aa 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/tests/linter.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/tests/linter.rs @@ -161,5 +161,6 @@ test_directories! { ExplicitTypes, ImplicitTypes, PayableFallback, + VisibilityModifierOrder, GlobalImport } From ded9eb6e03674b0f16425e838fecab72d5fcec91 Mon Sep 17 00:00:00 2001 From: leon3108 Date: Mon, 2 Oct 2023 16:15:29 +0100 Subject: [PATCH 196/325] rm remove-me --- remove-me-bf771bf7c0554db6a496.txt | 1 - 1 file changed, 1 deletion(-) delete mode 100644 remove-me-bf771bf7c0554db6a496.txt diff --git a/remove-me-bf771bf7c0554db6a496.txt b/remove-me-bf771bf7c0554db6a496.txt deleted file mode 100644 index 077d20ef..00000000 --- a/remove-me-bf771bf7c0554db6a496.txt +++ /dev/null @@ -1 +0,0 @@ -bf771bf7c0554db6a496 From 952d7ac37fd254f73b18bdb83eaa09137c280452 Mon Sep 17 00:00:00 2001 From: leon3108 Date: Fri, 6 Oct 2023 23:09:49 +0100 Subject: [PATCH 197/325] refactor: use ast --- .../visibility_modifier_order.rs | 71 +++++++++++-------- .../VisibilityModifierOrder/findings.csv | 2 +- 2 files changed, 43 insertions(+), 30 deletions(-) diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/visibility_modifier_order.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/visibility_modifier_order.rs index f18bf372..01d1fefb 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/visibility_modifier_order.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/visibility_modifier_order.rs @@ -1,3 +1,6 @@ +use ast_extractor::retriever::{retrieve_contract_nodes, retrieve_functions_nodes}; +use ast_extractor::Spanned; + use crate::linter::SolidFile; use crate::rules::types::*; use crate::types::*; @@ -10,46 +13,56 @@ pub struct VisibilityModiferOrder { _data: RuleEntry, } -// je retourne une erreur si la visibility modifier -// n'est pas juste apres nom_de_fonction() - impl RuleType for VisibilityModiferOrder { fn diagnose(&self, _file: &SolidFile, _files: &[SolidFile]) -> Vec { let mut res = Vec::new(); - let mut line_index = 1; - _file.content.lines().for_each(|line| { - if line.find("function").is_some() { - let line_splitted = line.split_whitespace().collect::>(); - if line_splitted[2] != "public" && line_splitted[2] != "private" { - let start_index = line.find(line_splitted[2]).unwrap(); - let range = Range { + let reports = check_visibility_modifier_order(_file); + for report in reports { + res.push(LintDiag { + id: RULE_ID.to_string(), + range: report, + severity: Some(Severity::WARNING), + code: None, + source: None, + message: DEFAULT_MESSAGE.to_string(), + uri: _file.path.clone(), + source_file_content: _file.content.clone(), + }); + } + println!("res {:?}", res); + res + } +} + +fn check_visibility_modifier_order(file: &SolidFile) -> Vec { + let mut reports = Vec::new(); + + let contracts = retrieve_contract_nodes(&file.data); + for contract in contracts { + let functions = retrieve_functions_nodes(&contract); + for function in functions { + let mut is_attributes = false; + function.attributes.iter().for_each(|attributes| { + if attributes.modifier().is_some() || attributes.mutability().is_some() { + is_attributes = true; + } + if attributes.visibility().is_some() && is_attributes { + reports.push(Range { start: Position { - line: line_index, - character: start_index + 1, + line: attributes.span().start().line, + character: attributes.span().start().column, }, end: Position { - line: line_index, - character: start_index + line_splitted[2].len(), + line: attributes.span().end().line, + character: attributes.span().end().column, }, - }; - res.push(LintDiag { - id: RULE_ID.to_string(), - range: range, - severity: Some(Severity::WARNING), - code: None, - source: None, - message: DEFAULT_MESSAGE.to_string(), - uri: _file.path.clone(), - source_file_content: _file.content.clone(), }); } - } - line_index += 1; - }); - println!("res {:?}", res); - res + }); + } } + reports } impl VisibilityModiferOrder { diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/VisibilityModifierOrder/findings.csv b/toolchains/solidity/linter/core/solidhunter-lib/testdata/VisibilityModifierOrder/findings.csv index 9df79273..ab15e17c 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/testdata/VisibilityModifierOrder/findings.csv +++ b/toolchains/solidity/linter/core/solidhunter-lib/testdata/VisibilityModifierOrder/findings.csv @@ -1 +1 @@ -visibility-modifier-order:4:21:4:29 \ No newline at end of file +visibility-modifier-order:4:30:4:36 \ No newline at end of file From 981a0f2b559dd1241058b1fd8429d3aefdf1da6c Mon Sep 17 00:00:00 2001 From: Astrodevs CI Date: Mon, 2 Oct 2023 14:22:59 +0000 Subject: [PATCH 198/325] chore: create branch feature/50-solidity-linter-rules/113-var-name-mixedcase-rule-staging --- remove-me-309b4e3a7b084e2690ae.txt | 1 + 1 file changed, 1 insertion(+) create mode 100644 remove-me-309b4e3a7b084e2690ae.txt diff --git a/remove-me-309b4e3a7b084e2690ae.txt b/remove-me-309b4e3a7b084e2690ae.txt new file mode 100644 index 00000000..4c31d00e --- /dev/null +++ b/remove-me-309b4e3a7b084e2690ae.txt @@ -0,0 +1 @@ +309b4e3a7b084e2690ae From 54fa6eaba857cbd8e1a445830e368b7ef438e87f Mon Sep 17 00:00:00 2001 From: 0xMemoryGrinder <35138272+0xMemoryGrinder@users.noreply.github.com> Date: Sun, 8 Oct 2023 22:35:09 -0400 Subject: [PATCH 199/325] feat(solidity/linter/core): var name mixedCase rule --- libs/ast-extractor/src/retriever.rs | 6 ++ .../src/retriever/variable_declaration.rs | 64 ++++++++++++++ .../src/retriever/variable_definition.rs | 64 ++++++++++++++ .../files/variables_declaration/file.sol | 8 ++ .../tests/files/variables_definition/file.sol | 8 ++ remove-me-309b4e3a7b084e2690ae.txt | 1 - .../solidhunter-lib/src/rules/naming/mod.rs | 7 ++ .../src/rules/naming/var_name_mixedcase.rs | 83 +++++++++++++++++++ .../VarNameMixedCase/.solidhunter.json | 12 +++ .../testdata/VarNameMixedCase/file.sol | 16 ++++ .../testdata/VarNameMixedCase/findings.csv | 2 + .../core/solidhunter-lib/tests/linter.rs | 1 + 12 files changed, 271 insertions(+), 1 deletion(-) create mode 100644 libs/ast-extractor/src/retriever/variable_declaration.rs create mode 100644 libs/ast-extractor/src/retriever/variable_definition.rs create mode 100644 libs/ast-extractor/tests/files/variables_declaration/file.sol create mode 100644 libs/ast-extractor/tests/files/variables_definition/file.sol delete mode 100644 remove-me-309b4e3a7b084e2690ae.txt create mode 100644 toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/var_name_mixedcase.rs create mode 100644 toolchains/solidity/linter/core/solidhunter-lib/testdata/VarNameMixedCase/.solidhunter.json create mode 100644 toolchains/solidity/linter/core/solidhunter-lib/testdata/VarNameMixedCase/file.sol create mode 100644 toolchains/solidity/linter/core/solidhunter-lib/testdata/VarNameMixedCase/findings.csv diff --git a/libs/ast-extractor/src/retriever.rs b/libs/ast-extractor/src/retriever.rs index a08e38ec..1d9ba389 100644 --- a/libs/ast-extractor/src/retriever.rs +++ b/libs/ast-extractor/src/retriever.rs @@ -1,6 +1,12 @@ mod contract; pub use contract::*; +mod variable_definition; +pub use variable_definition::*; + +mod variable_declaration; +pub use variable_declaration::*; + mod r#enum; pub use r#enum::*; diff --git a/libs/ast-extractor/src/retriever/variable_declaration.rs b/libs/ast-extractor/src/retriever/variable_declaration.rs new file mode 100644 index 00000000..5ac52089 --- /dev/null +++ b/libs/ast-extractor/src/retriever/variable_declaration.rs @@ -0,0 +1,64 @@ +/** + * variable_declaration.rs + * Function to retrieve variable nodes from AST + * author: Leon +*/ +use syn_solidity::{VariableDeclaration, Visit}; + +struct VariableDeclarationVisitor { + variables: Vec, +} + +impl VariableDeclarationVisitor { + pub fn new() -> Self { + Self { + variables: Vec::new(), + } + } +} + +impl<'ast> Visit<'ast> for VariableDeclarationVisitor { + fn visit_variable_declaration(&mut self, i: &VariableDeclaration) { + self.variables.push(i.clone()); + syn_solidity::visit::visit_variable_declaration(self, i); + } +} + +pub fn retrieve_variable_declaration_nodes(ast: &syn_solidity::File) -> Vec { + let mut visitor = VariableDeclarationVisitor::new(); + visitor.visit_file(ast); + visitor.variables +} + +#[cfg(test)] +mod tests { + use proc_macro2::TokenStream; + + use super::*; + use std::fs; + use std::path::PathBuf; + use std::str::FromStr; + + // #[test] + // fn test_retrieve_variable_declaration_nodes_empty() { + // let source = String::from("pragma solidity ^0.8.0;"); + // let tokens = TokenStream::from_str(source.as_str()).unwrap(); + // let ast = syn_solidity::parse2(tokens).unwrap(); + // let res = retrieve_variable_declaration_nodes(&ast); + // assert_eq!(res.len(), 0); + // } + + #[test] + fn test_retrieve_variable_declaration_nodes_two() { + let mut path = PathBuf::from(env!("CARGO_MANIFEST_DIR")); + path.push("tests"); + path.push("files"); + path.push("variables_declaration"); + path.push("file.sol"); + let source = fs::read_to_string(path).unwrap(); + let tokens = TokenStream::from_str(source.as_str()).unwrap(); + let ast = syn_solidity::parse2(tokens).unwrap(); + let res = retrieve_variable_declaration_nodes(&ast); + assert_eq!(res.len(), 2); + } +} diff --git a/libs/ast-extractor/src/retriever/variable_definition.rs b/libs/ast-extractor/src/retriever/variable_definition.rs new file mode 100644 index 00000000..4a566153 --- /dev/null +++ b/libs/ast-extractor/src/retriever/variable_definition.rs @@ -0,0 +1,64 @@ +/** + * variable.rs + * Function to retrieve variable definition nodes from AST + * author: Leon +*/ +use syn_solidity::{VariableDefinition, Visit}; + +struct VariableDefinitionVisitor { + variables: Vec, +} + +impl VariableDefinitionVisitor { + pub fn new() -> Self { + Self { + variables: Vec::new(), + } + } +} + +impl<'ast> Visit<'ast> for VariableDefinitionVisitor { + fn visit_variable_definition(&mut self, i: &VariableDefinition) { + self.variables.push(i.clone()); + syn_solidity::visit::visit_variable_definition(self, i); + } +} + +pub fn retrieve_variable_definition_nodes(ast: &syn_solidity::File) -> Vec { + let mut visitor = VariableDefinitionVisitor::new(); + visitor.visit_file(ast); + visitor.variables +} + +#[cfg(test)] +mod tests { + use proc_macro2::TokenStream; + + use super::*; + use std::fs; + use std::path::PathBuf; + use std::str::FromStr; + + #[test] + fn test_retrieve_variable_definition_nodes_empty() { + let source = String::from("pragma solidity ^0.8.0;"); + let tokens = TokenStream::from_str(source.as_str()).unwrap(); + let ast = syn_solidity::parse2(tokens).unwrap(); + let res = retrieve_variable_definition_nodes(&ast); + assert_eq!(res.len(), 0); + } + + #[test] + fn test_retrieve_variable_definition_nodes_one() { + let mut path = PathBuf::from(env!("CARGO_MANIFEST_DIR")); + path.push("tests"); + path.push("files"); + path.push("variables_definition"); + path.push("file.sol"); + let source = fs::read_to_string(path).unwrap(); + let tokens = TokenStream::from_str(source.as_str()).unwrap(); + let ast = syn_solidity::parse2(tokens).unwrap(); + let res = retrieve_variable_definition_nodes(&ast); + assert_eq!(res.len(), 1); + } +} diff --git a/libs/ast-extractor/tests/files/variables_declaration/file.sol b/libs/ast-extractor/tests/files/variables_declaration/file.sol new file mode 100644 index 00000000..dffc1d93 --- /dev/null +++ b/libs/ast-extractor/tests/files/variables_declaration/file.sol @@ -0,0 +1,8 @@ +abstract contract Test { + uint256 public a; + + function add() public view returns (uint256) { + uint256 b = 1; + return a + b; + } +} diff --git a/libs/ast-extractor/tests/files/variables_definition/file.sol b/libs/ast-extractor/tests/files/variables_definition/file.sol new file mode 100644 index 00000000..dffc1d93 --- /dev/null +++ b/libs/ast-extractor/tests/files/variables_definition/file.sol @@ -0,0 +1,8 @@ +abstract contract Test { + uint256 public a; + + function add() public view returns (uint256) { + uint256 b = 1; + return a + b; + } +} diff --git a/remove-me-309b4e3a7b084e2690ae.txt b/remove-me-309b4e3a7b084e2690ae.txt deleted file mode 100644 index 4c31d00e..00000000 --- a/remove-me-309b4e3a7b084e2690ae.txt +++ /dev/null @@ -1 +0,0 @@ -309b4e3a7b084e2690ae diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/mod.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/mod.rs index 0d4a6b30..183632c7 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/mod.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/mod.rs @@ -5,6 +5,7 @@ use crate::rules::naming::func_name_camelcase::FuncNameCamelCase; use crate::rules::naming::func_param_name_camelcase::FuncParamNameCamelcase; use crate::rules::naming::func_visibility::FuncVisibility; use crate::rules::naming::use_forbidden_name::UseForbiddenName; +use crate::rules::naming::var_name_mixedcase::VarNameMixedCase; use crate::rules::types::{RuleEntry, RulesMap}; use crate::rules::RuleBuilder; use std::collections::HashMap; @@ -17,6 +18,7 @@ pub(crate) mod event_name_camelcase; pub(crate) mod func_name_camelcase; pub(crate) mod func_visibility; pub(crate) mod use_forbidden_name; +pub(crate) mod var_name_mixedcase; // List all rules @@ -29,6 +31,7 @@ pub fn create_default_rules() -> Vec { FuncVisibility::create_default(), EventNameCamelCase::create_default(), ConstNameSnakeCase::create_default(), + VarNameMixedCase::create_default(), ] } @@ -60,6 +63,10 @@ pub fn create_rules() -> RulesMap { const_name_snakecase::RULE_ID.to_string(), ConstNameSnakeCase::create, ); + rules.insert( + var_name_mixedcase::RULE_ID.to_string(), + VarNameMixedCase::create, + ); rules } diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/var_name_mixedcase.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/var_name_mixedcase.rs new file mode 100644 index 00000000..e868887f --- /dev/null +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/var_name_mixedcase.rs @@ -0,0 +1,83 @@ +use ast_extractor::Spanned; + +use crate::linter::SolidFile; +use crate::rules::types::*; +use crate::types::*; + +pub const RULE_ID: &str = "var-name-mixedcase"; +const MESSAGE: &str = "variable should be in MixedCase"; + +pub struct VarNameMixedCase { + data: RuleEntry, +} + +impl VarNameMixedCase { + fn create_diag( + &self, + location: (ast_extractor::LineColumn, ast_extractor::LineColumn), + file: &SolidFile, + ) -> LintDiag { + LintDiag { + id: RULE_ID.to_string(), + range: Range { + start: Position { + line: location.0.line, + character: location.0.column + 1, + }, + end: Position { + line: location.1.line, + character: location.1.column, + }, + }, + message: MESSAGE.to_string(), + severity: Some(self.data.severity), + code: None, + source: None, + uri: file.path.clone(), + source_file_content: file.content.clone(), + } + } +} + +impl RuleType for VarNameMixedCase { + fn diagnose(&self, file: &SolidFile, _files: &[SolidFile]) -> Vec { + let mut res = Vec::new(); + + let variables_definition = + ast_extractor::retriever::retrieve_variable_definition_nodes(&file.data); + for variable in variables_definition { + if variable.name.to_string()[1..].find('_').is_some() { + let span = variable.name.span(); + res.push(self.create_diag((span.start(), span.end()), file)); + } + } + + let variables_declaration = + ast_extractor::retriever::retrieve_variable_declaration_nodes(&file.data); + for variable in variables_declaration { + if variable.name.is_some() { + let name = variable.name.unwrap(); + if name.to_string()[1..].find('_').is_some() { + let span = name.span(); + res.push(self.create_diag((span.start(), span.end()), file)); + } + } + } + res + } +} + +impl VarNameMixedCase { + pub(crate) fn create(data: RuleEntry) -> Box { + let rule = VarNameMixedCase { data }; + Box::new(rule) + } + + pub(crate) fn create_default() -> RuleEntry { + RuleEntry { + id: RULE_ID.to_string(), + severity: Severity::WARNING, + data: vec![], + } + } +} diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/VarNameMixedCase/.solidhunter.json b/toolchains/solidity/linter/core/solidhunter-lib/testdata/VarNameMixedCase/.solidhunter.json new file mode 100644 index 00000000..5bc8d8e8 --- /dev/null +++ b/toolchains/solidity/linter/core/solidhunter-lib/testdata/VarNameMixedCase/.solidhunter.json @@ -0,0 +1,12 @@ +{ + "name": "solidhunter", + "includes": [], + "plugins": [], + "rules": [ + { + "id": "var-name-mixedcase", + "severity": "WARNING", + "data": [] + } + ] +} \ No newline at end of file diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/VarNameMixedCase/file.sol b/toolchains/solidity/linter/core/solidhunter-lib/testdata/VarNameMixedCase/file.sol new file mode 100644 index 00000000..1ffa14d6 --- /dev/null +++ b/toolchains/solidity/linter/core/solidhunter-lib/testdata/VarNameMixedCase/file.sol @@ -0,0 +1,16 @@ +pragma solidity ^0.8.0; + +contract Test { + uint256 contracts = 0; // Valid + uint256 _contract2 = 0; // Valid + uint256 testContractForLinter = 0; // Valid + uint256 test_contract_for_linter = 0; // Not Valid + + function test() public pure returns (string memory) { + uint256 test = 0; // Valid + uint256 _test2 = 0; // Valid + uint256 testForLinter = 0; // Valid + uint256 test_for_linter = 0; // Not Valid + return "TEST"; + } +} diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/VarNameMixedCase/findings.csv b/toolchains/solidity/linter/core/solidhunter-lib/testdata/VarNameMixedCase/findings.csv new file mode 100644 index 00000000..132f216b --- /dev/null +++ b/toolchains/solidity/linter/core/solidhunter-lib/testdata/VarNameMixedCase/findings.csv @@ -0,0 +1,2 @@ +var-name-mixedcase:7:13:7:36 +var-name-mixedcase:13:17:13:31 \ No newline at end of file diff --git a/toolchains/solidity/linter/core/solidhunter-lib/tests/linter.rs b/toolchains/solidity/linter/core/solidhunter-lib/tests/linter.rs index e376a7aa..b8fea94a 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/tests/linter.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/tests/linter.rs @@ -162,5 +162,6 @@ test_directories! { ImplicitTypes, PayableFallback, VisibilityModifierOrder, + VarNameMixedCase, GlobalImport } From cb18b74a689c9a7829a2ee1effcedbce0307270d Mon Sep 17 00:00:00 2001 From: 0xMemoryGrinder <35138272+0xMemoryGrinder@users.noreply.github.com> Date: Fri, 29 Sep 2023 15:13:11 -0400 Subject: [PATCH 200/325] chore: create branch feature/50-solidity-linter-rules/110-modifier-name-mixedcase-rule-staging chore: create branch feature/50-solidity-linter-rules-staging chore: create branch feature/50-solidity-linter-rules/106-one-contract-per-file-rule-staging feat(solidity/linter/core): OneContractPerFile rule chore: create branch feature/50-solidity-linter-rules/119-no-inline-assembly-rule-staging chore: deleted remove-me chore: create branch feature/50-solidity-linter-rules/117-func-visibility-rule-staging chore: deleted remove-me chore: create branch feature/50-solidity-linter-rules/98-custom-errors-rule-staging chore: remove remove-me file chore: create branch feature/50-solidity-linter-rules/108-event-name-camelcase-rule-staging chore: deleted remove-me chore: create branch feature/50-solidity-linter-rules/107-const-name-snakecase-rule-staging chore: deleted remove-me --- remove-me-514e1c9d41fb4b8190e8.txt | 1 + 1 file changed, 1 insertion(+) create mode 100644 remove-me-514e1c9d41fb4b8190e8.txt diff --git a/remove-me-514e1c9d41fb4b8190e8.txt b/remove-me-514e1c9d41fb4b8190e8.txt new file mode 100644 index 00000000..c401d03f --- /dev/null +++ b/remove-me-514e1c9d41fb4b8190e8.txt @@ -0,0 +1 @@ +514e1c9d41fb4b8190e8 From 85f9f62d110b84ced66c82d1a73acbcc1f7a4ee9 Mon Sep 17 00:00:00 2001 From: 0xMemoryGrinder <35138272+0xMemoryGrinder@users.noreply.github.com> Date: Sun, 8 Oct 2023 22:51:45 -0400 Subject: [PATCH 201/325] feat(solidity/linter/core): ModifierNameMixedCase rule --- remove-me-514e1c9d41fb4b8190e8.txt | 1 - .../solidhunter-lib/src/rules/naming/mod.rs | 7 ++ .../rules/naming/modifier_name_mixedcase.rs | 100 ++++++++++++++++++ .../ModifierNameMixedcase/.solidhunter.json | 65 ++++++++++++ .../testdata/ModifierNameMixedcase/file.sol | 10 ++ .../ModifierNameMixedcase/findings.csv | 3 + .../core/solidhunter-lib/tests/linter.rs | 1 + 7 files changed, 186 insertions(+), 1 deletion(-) delete mode 100644 remove-me-514e1c9d41fb4b8190e8.txt create mode 100644 toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/modifier_name_mixedcase.rs create mode 100644 toolchains/solidity/linter/core/solidhunter-lib/testdata/ModifierNameMixedcase/.solidhunter.json create mode 100644 toolchains/solidity/linter/core/solidhunter-lib/testdata/ModifierNameMixedcase/file.sol create mode 100644 toolchains/solidity/linter/core/solidhunter-lib/testdata/ModifierNameMixedcase/findings.csv diff --git a/remove-me-514e1c9d41fb4b8190e8.txt b/remove-me-514e1c9d41fb4b8190e8.txt deleted file mode 100644 index c401d03f..00000000 --- a/remove-me-514e1c9d41fb4b8190e8.txt +++ /dev/null @@ -1 +0,0 @@ -514e1c9d41fb4b8190e8 diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/mod.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/mod.rs index 183632c7..ddeecedd 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/mod.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/mod.rs @@ -9,6 +9,7 @@ use crate::rules::naming::var_name_mixedcase::VarNameMixedCase; use crate::rules::types::{RuleEntry, RulesMap}; use crate::rules::RuleBuilder; use std::collections::HashMap; +use crate::rules::naming::modifier_name_mixedcase::ModifierNameMixedcase; #[macro_use] pub(crate) mod func_param_name_camelcase; @@ -19,6 +20,7 @@ pub(crate) mod func_name_camelcase; pub(crate) mod func_visibility; pub(crate) mod use_forbidden_name; pub(crate) mod var_name_mixedcase; +pub(crate) mod modifier_name_mixedcase; // List all rules @@ -32,6 +34,7 @@ pub fn create_default_rules() -> Vec { EventNameCamelCase::create_default(), ConstNameSnakeCase::create_default(), VarNameMixedCase::create_default(), + ModifierNameMixedcase::create_default(), ] } @@ -67,6 +70,10 @@ pub fn create_rules() -> RulesMap { var_name_mixedcase::RULE_ID.to_string(), VarNameMixedCase::create, ); + rules.insert( + modifier_name_mixedcase::RULE_ID.to_string(), + ModifierNameMixedcase::create, + ); rules } diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/modifier_name_mixedcase.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/modifier_name_mixedcase.rs new file mode 100644 index 00000000..220ef0ad --- /dev/null +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/modifier_name_mixedcase.rs @@ -0,0 +1,100 @@ +use ast_extractor::{retriever, Spanned}; + +use crate::linter::SolidFile; +use crate::rules::types::*; +use crate::types::*; + +pub const RULE_ID: &str = "modifier-name-mixedcase"; +const MESSAGE: &str = "Modifier name must be in mixedCase"; + +pub struct ModifierNameMixedcase { + data: RuleEntry, +} + +impl ModifierNameMixedcase { + fn create_diag( + &self, + location: (ast_extractor::LineColumn, ast_extractor::LineColumn), + file: &SolidFile, + ) -> LintDiag { + LintDiag { + id: RULE_ID.to_string(), + range: Range { + start: Position { + line: location.0.line, + character: location.0.column, + }, + end: Position { + line: location.1.line, + character: location.1.column, + }, + }, + message: MESSAGE.to_string(), + severity: Some(self.data.severity), + code: None, + source: None, + uri: file.path.clone(), + source_file_content: file.content.clone(), + } + } +} + +fn is_mixed_case(name: &str) -> bool { + let has_leading_underscore = name.starts_with('_'); + + if has_leading_underscore { + if name.chars().nth(1).unwrap().is_ascii_uppercase() { + return false; + } + for c in name.chars().skip(1) { + if c == '_' || c == '-' { + return false; + } + } + return true; + } + + if name.chars().next().unwrap().is_ascii_uppercase() { + return false; + } + if name.contains('_') || name.contains('-') { + return false; + } + + true +} + +impl RuleType for ModifierNameMixedcase { + fn diagnose(&self, file: &SolidFile, _files: &[SolidFile]) -> Vec { + let mut res = Vec::new(); + let contracts = retriever::retrieve_contract_nodes(&file.data); + + + for contract in contracts.iter() { + let functions = retriever::retrieve_functions_nodes(contract); + + for function in functions { + if function.kind.is_modifier() && !is_mixed_case(&function.name().as_string()) { + let span = function.name().span(); + res.push(self.create_diag((span.start(), span.end()), file)); + } + } + } + res + } +} + +impl ModifierNameMixedcase { + pub(crate) fn create(data: RuleEntry) -> Box { + let rule = ModifierNameMixedcase { data }; + Box::new(rule) + } + + pub(crate) fn create_default() -> RuleEntry { + RuleEntry { + id: RULE_ID.to_string(), + severity: Severity::WARNING, + data: vec![], + } + } +} diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/ModifierNameMixedcase/.solidhunter.json b/toolchains/solidity/linter/core/solidhunter-lib/testdata/ModifierNameMixedcase/.solidhunter.json new file mode 100644 index 00000000..5f12afff --- /dev/null +++ b/toolchains/solidity/linter/core/solidhunter-lib/testdata/ModifierNameMixedcase/.solidhunter.json @@ -0,0 +1,65 @@ +{ + "name": "solidhunter", + "includes": [], + "plugins": [], + "rules": [ + { + "id": "line-max-len", + "severity": "WARNING", + "data": [ + "80" + ] + }, + { + "id": "max-states-count", + "severity": "WARNING", + "data": [ + "15" + ] + }, + { + "id": "function-max-lines", + "severity": "WARNING", + "data": [ + "20" + ] + }, + { + "id": "reason-string", + "severity": "WARNING", + "data": [ + "32" + ] + }, + { + "id": "contract-name-pascalcase", + "severity": "WARNING", + "data": [] + }, + { + "id": "func-param-name-camelcase", + "severity": "WARNING", + "data": [] + }, + { + "id": "use-forbidden-name", + "severity": "WARNING", + "data": [] + }, + { + "id": "import-on-top", + "severity": "WARNING", + "data": [] + }, + { + "id": "const-name-snakecase", + "severity": "WARNING", + "data": [] + }, + { + "id": "modifier-name-mixedcase", + "severity": "WARNING", + "data": [] + } + ] +} \ No newline at end of file diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/ModifierNameMixedcase/file.sol b/toolchains/solidity/linter/core/solidhunter-lib/testdata/ModifierNameMixedcase/file.sol new file mode 100644 index 00000000..c4039af5 --- /dev/null +++ b/toolchains/solidity/linter/core/solidhunter-lib/testdata/ModifierNameMixedcase/file.sol @@ -0,0 +1,10 @@ +pragma solidity 0.8.0; + +contract Test { + modifier owned_by(address a) {} + modifier OwnedBy(address a) {} + modifier _OwnedBy(address a) {} + + modifier ownedBy(address a) {} + modifier _ownedBy(address a) {} +} \ No newline at end of file diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/ModifierNameMixedcase/findings.csv b/toolchains/solidity/linter/core/solidhunter-lib/testdata/ModifierNameMixedcase/findings.csv new file mode 100644 index 00000000..0bbede92 --- /dev/null +++ b/toolchains/solidity/linter/core/solidhunter-lib/testdata/ModifierNameMixedcase/findings.csv @@ -0,0 +1,3 @@ +modifier-name-mixedcase:4:13:4:21 +modifier-name-mixedcase:5:13:5:20 +modifier-name-mixedcase:6:13:6:21 \ No newline at end of file diff --git a/toolchains/solidity/linter/core/solidhunter-lib/tests/linter.rs b/toolchains/solidity/linter/core/solidhunter-lib/tests/linter.rs index b8fea94a..a45c00b7 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/tests/linter.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/tests/linter.rs @@ -163,5 +163,6 @@ test_directories! { PayableFallback, VisibilityModifierOrder, VarNameMixedCase, + ModifierNameMixedcase, GlobalImport } From 2a3146207012b675c65fec0ee6d3905735192efe Mon Sep 17 00:00:00 2001 From: Astrodevs CI Date: Fri, 6 Oct 2023 16:45:35 +0000 Subject: [PATCH 202/325] chore: create branch feature/50-solidity-linter-rules/122-not-rely-on-time-rule-staging --- remove-me-de7a710be34c4e65a99a.txt | 1 + 1 file changed, 1 insertion(+) create mode 100644 remove-me-de7a710be34c4e65a99a.txt diff --git a/remove-me-de7a710be34c4e65a99a.txt b/remove-me-de7a710be34c4e65a99a.txt new file mode 100644 index 00000000..ebafebe5 --- /dev/null +++ b/remove-me-de7a710be34c4e65a99a.txt @@ -0,0 +1 @@ +de7a710be34c4e65a99a From bb153d24079a9194cf985e6150187d65fe16db00 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A9o=20Maringer?= Date: Sun, 8 Oct 2023 22:21:51 +0100 Subject: [PATCH 203/325] feat(solidity/linter/core): NotRelyOnTime rule --- .../solidhunter-lib/src/rules/security/mod.rs | 8 ++ .../src/rules/security/not_rely_on_time.rs | 87 +++++++++++++++++++ .../testdata/NotRelyOnTime/.solidhunter.json | 12 +++ .../testdata/NotRelyOnTime/file.sol | 23 +++++ .../testdata/NotRelyOnTime/findings.csv | 10 +++ .../core/solidhunter-lib/tests/linter.rs | 3 +- 6 files changed, 142 insertions(+), 1 deletion(-) create mode 100644 toolchains/solidity/linter/core/solidhunter-lib/src/rules/security/not_rely_on_time.rs create mode 100644 toolchains/solidity/linter/core/solidhunter-lib/testdata/NotRelyOnTime/.solidhunter.json create mode 100644 toolchains/solidity/linter/core/solidhunter-lib/testdata/NotRelyOnTime/file.sol create mode 100644 toolchains/solidity/linter/core/solidhunter-lib/testdata/NotRelyOnTime/findings.csv diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/security/mod.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/security/mod.rs index f42200ce..1a2092ac 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/security/mod.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/security/mod.rs @@ -4,16 +4,19 @@ use std::collections::HashMap; #[macro_use] pub(crate) mod no_inline_assembly; pub(crate) mod state_visibility; +pub(crate) mod not_rely_on_time; // List all rules use crate::rules::security::no_inline_assembly::NoInlineAssembly; use crate::rules::security::state_visibility::StateVisibility; +use crate::rules::security::not_rely_on_time::NotRelyOnTime; use crate::rules::RuleBuilder; pub fn create_default_rules() -> Vec { vec![ NoInlineAssembly::create_default(), StateVisibility::create_default(), + NotRelyOnTime::create_default() ] } @@ -30,5 +33,10 @@ pub fn create_rules() -> RulesMap { StateVisibility::create, ); + rules.insert( + not_rely_on_time::RULE_ID.to_string(), + NotRelyOnTime::create, + ); + rules } diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/security/not_rely_on_time.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/security/not_rely_on_time.rs new file mode 100644 index 00000000..9f2d33b9 --- /dev/null +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/security/not_rely_on_time.rs @@ -0,0 +1,87 @@ +use crate::linter::SolidFile; +use crate::rules::types::*; +use crate::types::*; +use ast_extractor::*; + +pub const RULE_ID: &str = "not-rely-on-time"; +const MESSAGE: &str = "Avoid making time-based decisions in your business logic"; + +pub struct NotRelyOnTime { + data: RuleEntry, +} + +impl NotRelyOnTime { + fn create_diag( + &self, + location: (ast_extractor::LineColumn, ast_extractor::LineColumn), + file: &SolidFile, + ) -> LintDiag { + LintDiag { + id: RULE_ID.to_string(), + range: Range { + start: Position { + line: location.0.line, + character: location.0.column, + }, + end: Position { + line: location.1.line, + character: location.1.column, + }, + }, + message: MESSAGE.to_string(), + severity: Some(self.data.severity), + code: None, + source: None, + uri: file.path.clone(), + source_file_content: file.content.clone(), + } + } +} + +impl RuleType for NotRelyOnTime { + fn diagnose(&self, file: &SolidFile, _files: &[SolidFile]) -> Vec { + let mut res = Vec::new(); + let mut i = 1; + + for line in file.content.lines() { + if let Some(index) = line.find("now") { + res.push(self.create_diag((LineColumn { + line: i, + column: index, + }, LineColumn { + line: i, + column: index + 3, + }), file)); + } + if let Some(index) = line.find("block.timestamp") { + res.push(self.create_diag((LineColumn { + line: i, + column: index, + }, LineColumn { + line: i, + column: index + 15, + }), file)); + } + i += 1; + } + for t in res.iter() { // FOR MATEO + println!("{:?}", t.range); + } + res + } +} + +impl NotRelyOnTime { + pub(crate) fn create(data: RuleEntry) -> Box { + let rule = NotRelyOnTime { data }; + Box::new(rule) + } + + pub(crate) fn create_default() -> RuleEntry { + RuleEntry { + id: RULE_ID.to_string(), + severity: Severity::WARNING, + data: vec![], + } + } +} diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/NotRelyOnTime/.solidhunter.json b/toolchains/solidity/linter/core/solidhunter-lib/testdata/NotRelyOnTime/.solidhunter.json new file mode 100644 index 00000000..96bcdbc5 --- /dev/null +++ b/toolchains/solidity/linter/core/solidhunter-lib/testdata/NotRelyOnTime/.solidhunter.json @@ -0,0 +1,12 @@ +{ + "name": "solidhunter", + "includes": [], + "plugins": [], + "rules": [ + { + "id": "not-rely-on-time", + "severity": "WARNING", + "data": [] + } + ] +} \ No newline at end of file diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/NotRelyOnTime/file.sol b/toolchains/solidity/linter/core/solidhunter-lib/testdata/NotRelyOnTime/file.sol new file mode 100644 index 00000000..72140e1d --- /dev/null +++ b/toolchains/solidity/linter/core/solidhunter-lib/testdata/NotRelyOnTime/file.sol @@ -0,0 +1,23 @@ +pragma solidity 0.8.0; + +contract Test { + + uint public tmp = now; + uint private tmp1 = block.timestamp; + + function name() public { + uint tmp2 = now; + uint tmp3 = block.timestamp; + + if (tmp2 == now || tmp3 == block.timestamp) {} + + if (block.timestamp) { + if (now) {} + } + + if (now) { + if (block.timestamp) {} + } + } + +} \ No newline at end of file diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/NotRelyOnTime/findings.csv b/toolchains/solidity/linter/core/solidhunter-lib/testdata/NotRelyOnTime/findings.csv new file mode 100644 index 00000000..3e88806b --- /dev/null +++ b/toolchains/solidity/linter/core/solidhunter-lib/testdata/NotRelyOnTime/findings.csv @@ -0,0 +1,10 @@ +not-rely-on-time:5:22:5:25 +not-rely-on-time:6:24:6:39 +not-rely-on-time:9:20:9:23 +not-rely-on-time:10:20:10:35 +not-rely-on-time:12:20:12:23 +not-rely-on-time:12:35:12:50 +not-rely-on-time:14:12:14:27 +not-rely-on-time:15:16:15:19 +not-rely-on-time:18:12:18:15 +not-rely-on-time:19:16:19:31 \ No newline at end of file diff --git a/toolchains/solidity/linter/core/solidhunter-lib/tests/linter.rs b/toolchains/solidity/linter/core/solidhunter-lib/tests/linter.rs index a45c00b7..99e7e242 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/tests/linter.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/tests/linter.rs @@ -164,5 +164,6 @@ test_directories! { VisibilityModifierOrder, VarNameMixedCase, ModifierNameMixedcase, - GlobalImport + GlobalImport, + NotRelyOnTime } From cf56a03d60e36268aee7d3e7567d10b7244d42e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A9o=20Maringer?= Date: Mon, 9 Oct 2023 16:13:55 +0100 Subject: [PATCH 204/325] fea(solidity/linter/core): remove debug print rebase branch --- .../solidhunter-lib/src/rules/security/not_rely_on_time.rs | 3 --- 1 file changed, 3 deletions(-) diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/security/not_rely_on_time.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/security/not_rely_on_time.rs index 9f2d33b9..527aa242 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/security/not_rely_on_time.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/security/not_rely_on_time.rs @@ -64,9 +64,6 @@ impl RuleType for NotRelyOnTime { } i += 1; } - for t in res.iter() { // FOR MATEO - println!("{:?}", t.range); - } res } } From 32022d3eea16f41bbd1af373457bcc4ba5e55f86 Mon Sep 17 00:00:00 2001 From: Astrodevs CI Date: Tue, 3 Oct 2023 17:22:43 +0000 Subject: [PATCH 205/325] chore: create branch feature/50-solidity-linter-rules/121-avoid-tx-origin-rule-staging --- remove-me-227b602026ca43dc8864.txt | 1 + 1 file changed, 1 insertion(+) create mode 100644 remove-me-227b602026ca43dc8864.txt diff --git a/remove-me-227b602026ca43dc8864.txt b/remove-me-227b602026ca43dc8864.txt new file mode 100644 index 00000000..8752f5a4 --- /dev/null +++ b/remove-me-227b602026ca43dc8864.txt @@ -0,0 +1 @@ +227b602026ca43dc8864 From 1f1db49ada2912ce2fc572c668708c62f9f9eda7 Mon Sep 17 00:00:00 2001 From: 0xtekgrinder <0xtekgrinder@protonmail.com> Date: Mon, 9 Oct 2023 15:37:21 -0400 Subject: [PATCH 206/325] feat(solidity/linter/core): Avoid Tx Oriign rule --- remove-me-227b602026ca43dc8864.txt | 1 - .../src/rules/security/avoid_tx_origin.rs | 95 +++++++++++++++++++ .../testdata/AvoidTxOrigin/.solidhunter.json | 12 +++ .../testdata/AvoidTxOrigin/file.sol | 10 ++ .../testdata/AvoidTxOrigin/findings.csv | 1 + 5 files changed, 118 insertions(+), 1 deletion(-) delete mode 100644 remove-me-227b602026ca43dc8864.txt create mode 100644 toolchains/solidity/linter/core/solidhunter-lib/src/rules/security/avoid_tx_origin.rs create mode 100644 toolchains/solidity/linter/core/solidhunter-lib/testdata/AvoidTxOrigin/.solidhunter.json create mode 100644 toolchains/solidity/linter/core/solidhunter-lib/testdata/AvoidTxOrigin/file.sol create mode 100644 toolchains/solidity/linter/core/solidhunter-lib/testdata/AvoidTxOrigin/findings.csv diff --git a/remove-me-227b602026ca43dc8864.txt b/remove-me-227b602026ca43dc8864.txt deleted file mode 100644 index 8752f5a4..00000000 --- a/remove-me-227b602026ca43dc8864.txt +++ /dev/null @@ -1 +0,0 @@ -227b602026ca43dc8864 diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/security/avoid_tx_origin.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/security/avoid_tx_origin.rs new file mode 100644 index 00000000..aded88ab --- /dev/null +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/security/avoid_tx_origin.rs @@ -0,0 +1,95 @@ +use crate::linter::SolidFile; +use crate::rules::types::*; +use crate::types::*; +use ast_extractor::*; + +pub const RULE_ID: &str = "avoid-tx-origin"; +const MESSAGE: &str = "Avoid to use tx.origin"; + +struct ExprVisitor { + exprs: Vec, +} + +impl ExprVisitor { + pub fn new() -> Self { + Self { + exprs: Vec::new(), + } + } +} + +impl<'ast> Visit<'ast> for ExprVisitor { + fn visit_expr_member(&mut self,i: &'ast ExprMember) { + self.exprs.push(i.clone()); + visit::visit_expr_member(self, i); + } +} + +pub struct AvoidTxOrigin { + data: RuleEntry, +} + +impl AvoidTxOrigin { + fn create_diag( + &self, + location: (LineColumn, LineColumn), + file: &SolidFile, + ) -> LintDiag { + LintDiag { + id: RULE_ID.to_string(), + range: Range { + start: Position { + line: location.0.line, + character: location.0.column, + }, + end: Position { + line: location.1.line, + character: location.1.column, + }, + }, + message: MESSAGE.to_string(), + severity: Some(self.data.severity), + code: None, + source: None, + uri: file.path.clone(), + source_file_content: file.content.clone(), + } + } +} + +impl RuleType for AvoidTxOrigin { + fn diagnose(&self, file: &SolidFile, _files: &[SolidFile]) -> Vec { + let mut res = Vec::new(); + let mut visitor = ExprVisitor::new(); + for contract in ast_extractor::retriever::retrieve_contract_nodes(&file.data) { + visitor.visit_item_contract(&contract); + } + + for expr in visitor.exprs { + if let Expr::Ident(ident) = &*expr.expr { + if let Expr::Ident(ident2) = &*expr.member { + if ident == "tx" && ident2 == "origin" { + let location = (expr.span().start(), expr.span().end()); + res.push(self.create_diag(location, file)); + } + } + } + } + res + } +} + +impl AvoidTxOrigin { + pub(crate) fn create(data: RuleEntry) -> Box { + let rule = AvoidTxOrigin { data }; + Box::new(rule) + } + + pub(crate) fn create_default() -> RuleEntry { + RuleEntry { + id: RULE_ID.to_string(), + severity: Severity::WARNING, + data: vec![], + } + } +} diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/AvoidTxOrigin/.solidhunter.json b/toolchains/solidity/linter/core/solidhunter-lib/testdata/AvoidTxOrigin/.solidhunter.json new file mode 100644 index 00000000..0ab201ac --- /dev/null +++ b/toolchains/solidity/linter/core/solidhunter-lib/testdata/AvoidTxOrigin/.solidhunter.json @@ -0,0 +1,12 @@ +{ + "name": "solidhunter", + "includes": [], + "plugins": [], + "rules": [ + { + "id": "avoid-tx-origin", + "severity": "WARNING", + "data": [] + } + ] +} \ No newline at end of file diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/AvoidTxOrigin/file.sol b/toolchains/solidity/linter/core/solidhunter-lib/testdata/AvoidTxOrigin/file.sol new file mode 100644 index 00000000..97291c3b --- /dev/null +++ b/toolchains/solidity/linter/core/solidhunter-lib/testdata/AvoidTxOrigin/file.sol @@ -0,0 +1,10 @@ +pragma solidity 0.8.0; + +contract Test { + function awesome() public returns (address) { + return tx.origin; + } + function notAwesome() public returns (address) { + return msg.sender; + } +} \ No newline at end of file diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/AvoidTxOrigin/findings.csv b/toolchains/solidity/linter/core/solidhunter-lib/testdata/AvoidTxOrigin/findings.csv new file mode 100644 index 00000000..0d8c8b8c --- /dev/null +++ b/toolchains/solidity/linter/core/solidhunter-lib/testdata/AvoidTxOrigin/findings.csv @@ -0,0 +1 @@ +avoid-tx-origin:5:15:5:24 \ No newline at end of file From 71b0410b70ea31a3c5bdbe9100bf3761a647e3ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A9o=20Maringer?= Date: Mon, 9 Oct 2023 20:47:51 +0100 Subject: [PATCH 207/325] fea(solidity/linter/core): delete removeme --- remove-me-de7a710be34c4e65a99a.txt | 1 - 1 file changed, 1 deletion(-) delete mode 100644 remove-me-de7a710be34c4e65a99a.txt diff --git a/remove-me-de7a710be34c4e65a99a.txt b/remove-me-de7a710be34c4e65a99a.txt deleted file mode 100644 index ebafebe5..00000000 --- a/remove-me-de7a710be34c4e65a99a.txt +++ /dev/null @@ -1 +0,0 @@ -de7a710be34c4e65a99a From a8502fd3c36f5b7797651293fe81cd1e22d78883 Mon Sep 17 00:00:00 2001 From: Astrodevs CI Date: Tue, 3 Oct 2023 01:08:41 +0000 Subject: [PATCH 208/325] chore: create branch feature/50-solidity-linter-rules/111-named-parameters-mapping-rule-staging --- remove-me-4d698f3fd60f4a78a59c.txt | 1 + 1 file changed, 1 insertion(+) create mode 100644 remove-me-4d698f3fd60f4a78a59c.txt diff --git a/remove-me-4d698f3fd60f4a78a59c.txt b/remove-me-4d698f3fd60f4a78a59c.txt new file mode 100644 index 00000000..a7c28942 --- /dev/null +++ b/remove-me-4d698f3fd60f4a78a59c.txt @@ -0,0 +1 @@ +4d698f3fd60f4a78a59c From 78c4c92bcb96052dc2400ee1ee56e9c5b576942e Mon Sep 17 00:00:00 2001 From: 0xtekgrinder <0xtekgrinder@protonmail.com> Date: Sun, 8 Oct 2023 15:42:17 -0400 Subject: [PATCH 209/325] feat(solidity/linter/core): namedParametersMapping --- remove-me-4d698f3fd60f4a78a59c.txt | 1 - .../rules/best_practises/explicit_types.rs | 11 +- .../src/rules/best_practises/mod.rs | 2 +- .../solidhunter-lib/src/rules/naming/mod.rs | 11 +- .../rules/naming/modifier_name_mixedcase.rs | 1 - .../rules/naming/named_parameters_mapping.rs | 106 ++++++++++++++++++ .../solidhunter-lib/src/rules/security/mod.rs | 11 +- .../src/rules/security/not_rely_on_time.rs | 40 ++++--- .../NamedParametersMapping/.solidhunter.json | 70 ++++++++++++ .../testdata/NamedParametersMapping/file.sol | 9 ++ .../NamedParametersMapping/findings.csv | 5 + .../core/solidhunter-lib/tests/linter.rs | 1 + 12 files changed, 236 insertions(+), 32 deletions(-) delete mode 100644 remove-me-4d698f3fd60f4a78a59c.txt create mode 100644 toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/named_parameters_mapping.rs create mode 100644 toolchains/solidity/linter/core/solidhunter-lib/testdata/NamedParametersMapping/.solidhunter.json create mode 100644 toolchains/solidity/linter/core/solidhunter-lib/testdata/NamedParametersMapping/file.sol create mode 100644 toolchains/solidity/linter/core/solidhunter-lib/testdata/NamedParametersMapping/findings.csv diff --git a/remove-me-4d698f3fd60f4a78a59c.txt b/remove-me-4d698f3fd60f4a78a59c.txt deleted file mode 100644 index a7c28942..00000000 --- a/remove-me-4d698f3fd60f4a78a59c.txt +++ /dev/null @@ -1 +0,0 @@ -4d698f3fd60f4a78a59c diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/explicit_types.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/explicit_types.rs index 59086537..979f1b18 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/explicit_types.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/explicit_types.rs @@ -17,8 +17,7 @@ pub struct ExplicitTypesVisitor { type_inits: Vec, } -impl <'ast> Visit<'ast> for ExplicitTypesVisitor { - +impl<'ast> Visit<'ast> for ExplicitTypesVisitor { fn visit_type(&mut self, ty: &'ast Type) { match ty { Type::Int(_, _) => { @@ -27,17 +26,16 @@ impl <'ast> Visit<'ast> for ExplicitTypesVisitor { Type::Uint(_, _) => { self.type_names.push(ty.clone()); } - _ => {visit::visit_type(self, ty)} + _ => visit::visit_type(self, ty), } } fn visit_variable_definition(&mut self, var: &'ast VariableDefinition) { - if let Some((_, expr)) = &var.initializer { + if let Some((_, expr)) = &var.initializer { visit::visit_expr(self, expr); } visit::visit_variable_definition(self, var); } - } impl ExplicitTypes { @@ -70,7 +68,8 @@ impl ExplicitTypes { fn _check_type(&self, ty: &str, file: &SolidFile, span: Box) -> Option { if (self.rule == "explicit" && (ty == "int" || ty == "uint")) - || (self.rule == "implicit" && (ty != "int" && ty != "uint")) { + || (self.rule == "implicit" && (ty != "int" && ty != "uint")) + { return Some(self.create_diag(file, span, ty)); } None diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/mod.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/mod.rs index 9c9d70bf..2ec7c9e9 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/mod.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/mod.rs @@ -5,6 +5,7 @@ use std::collections::HashMap; pub mod line_maxlen; pub mod custom_errors; pub mod empty_block; +pub mod explicit_types; pub mod function_max_lines; pub mod global_import; pub mod max_states_count; @@ -12,7 +13,6 @@ pub mod no_console; pub mod one_contract_per_file; pub mod payable_fallback; pub mod reason_string; -mod explicit_types; pub mod visibility_modifier_order; // List all rules diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/mod.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/mod.rs index ddeecedd..1a44f32d 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/mod.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/mod.rs @@ -4,12 +4,13 @@ use crate::rules::naming::event_name_camelcase::EventNameCamelCase; use crate::rules::naming::func_name_camelcase::FuncNameCamelCase; use crate::rules::naming::func_param_name_camelcase::FuncParamNameCamelcase; use crate::rules::naming::func_visibility::FuncVisibility; +use crate::rules::naming::modifier_name_mixedcase::ModifierNameMixedcase; +use crate::rules::naming::named_parameters_mapping::NamedParametersMapping; use crate::rules::naming::use_forbidden_name::UseForbiddenName; use crate::rules::naming::var_name_mixedcase::VarNameMixedCase; use crate::rules::types::{RuleEntry, RulesMap}; use crate::rules::RuleBuilder; use std::collections::HashMap; -use crate::rules::naming::modifier_name_mixedcase::ModifierNameMixedcase; #[macro_use] pub(crate) mod func_param_name_camelcase; @@ -18,9 +19,10 @@ pub(crate) mod contract_name_pascalcase; pub(crate) mod event_name_camelcase; pub(crate) mod func_name_camelcase; pub(crate) mod func_visibility; +pub(crate) mod modifier_name_mixedcase; +pub(crate) mod named_parameters_mapping; pub(crate) mod use_forbidden_name; pub(crate) mod var_name_mixedcase; -pub(crate) mod modifier_name_mixedcase; // List all rules @@ -35,6 +37,7 @@ pub fn create_default_rules() -> Vec { ConstNameSnakeCase::create_default(), VarNameMixedCase::create_default(), ModifierNameMixedcase::create_default(), + NamedParametersMapping::create_default(), ] } @@ -45,6 +48,10 @@ pub fn create_rules() -> RulesMap { contract_name_pascalcase::RULE_ID.to_string(), ContractNamePascalCase::create, ); + rules.insert( + named_parameters_mapping::RULE_ID.to_string(), + NamedParametersMapping::create, + ); rules.insert( func_name_camelcase::RULE_ID.to_string(), FuncNameCamelCase::create, diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/modifier_name_mixedcase.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/modifier_name_mixedcase.rs index 220ef0ad..0e553c53 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/modifier_name_mixedcase.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/modifier_name_mixedcase.rs @@ -69,7 +69,6 @@ impl RuleType for ModifierNameMixedcase { let mut res = Vec::new(); let contracts = retriever::retrieve_contract_nodes(&file.data); - for contract in contracts.iter() { let functions = retriever::retrieve_functions_nodes(contract); diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/named_parameters_mapping.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/named_parameters_mapping.rs new file mode 100644 index 00000000..cf86e6ae --- /dev/null +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/named_parameters_mapping.rs @@ -0,0 +1,106 @@ +use crate::linter::SolidFile; +use crate::rules::types::*; +use crate::types::*; +use ast_extractor::*; + +pub const RULE_ID: &str = "named-parameters-mapping"; + +pub struct NamedParametersMapping { + data: RuleEntry, +} + +pub struct MappingsVisitor { + mappings: Vec, +} + +impl MappingsVisitor { + pub fn new() -> Self { + Self { + mappings: Vec::new(), + } + } +} + +impl<'ast> Visit<'ast> for MappingsVisitor { + fn visit_type(&mut self, t: &Type) { + if let Type::Mapping(ty) = t { + self.mappings.push(ty.clone()); + } + visit::visit_type(self, t) + } +} + +impl NamedParametersMapping { + fn create_diag( + &self, + location: (LineColumn, LineColumn), + message: &str, + file: &SolidFile, + ) -> LintDiag { + LintDiag { + id: RULE_ID.to_string(), + range: Range { + start: Position { + line: location.0.line, + character: location.0.column, + }, + end: Position { + line: location.1.line, + character: location.1.column, + }, + }, + message: message.to_string(), + severity: Some(self.data.severity), + code: None, + source: None, + uri: file.path.clone(), + source_file_content: file.content.clone(), + } + } +} + +impl RuleType for NamedParametersMapping { + fn diagnose(&self, file: &SolidFile, _files: &[SolidFile]) -> Vec { + let mut res = Vec::new(); + let mut visitor = MappingsVisitor::new(); + for contract in ast_extractor::retriever::retrieve_contract_nodes(&file.data) { + visitor.visit_item_contract(&contract); + } + + for mapping in visitor.mappings.iter() { + println!("{:?}", mapping); + if mapping.key_name.is_none() { + let span = mapping.key.span(); + res.push(self.create_diag( + (span.start(), span.end()), + format!("{} parameter is not named", mapping.key).as_str(), + file, + )); + } + if mapping.value_name.is_none() { + let span = mapping.value.span(); + res.push(self.create_diag( + (span.start(), span.end()), + format!("{} parameter is not named", mapping.value).as_str(), + file, + )); + } + } + res + } +} + +impl NamedParametersMapping { + pub(crate) fn create(data: RuleEntry) -> Box { + let rule = NamedParametersMapping { data }; + Box::new(rule) + } + + pub(crate) fn create_default() -> RuleEntry { + RuleEntry { + id: RULE_ID.to_string(), + severity: Severity::WARNING, + data: vec![], + } + } +} diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/security/mod.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/security/mod.rs index 1a2092ac..8436d37d 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/security/mod.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/security/mod.rs @@ -3,20 +3,20 @@ use std::collections::HashMap; #[macro_use] pub(crate) mod no_inline_assembly; -pub(crate) mod state_visibility; pub(crate) mod not_rely_on_time; +pub(crate) mod state_visibility; // List all rules use crate::rules::security::no_inline_assembly::NoInlineAssembly; -use crate::rules::security::state_visibility::StateVisibility; use crate::rules::security::not_rely_on_time::NotRelyOnTime; +use crate::rules::security::state_visibility::StateVisibility; use crate::rules::RuleBuilder; pub fn create_default_rules() -> Vec { vec![ NoInlineAssembly::create_default(), StateVisibility::create_default(), - NotRelyOnTime::create_default() + NotRelyOnTime::create_default(), ] } @@ -33,10 +33,7 @@ pub fn create_rules() -> RulesMap { StateVisibility::create, ); - rules.insert( - not_rely_on_time::RULE_ID.to_string(), - NotRelyOnTime::create, - ); + rules.insert(not_rely_on_time::RULE_ID.to_string(), NotRelyOnTime::create); rules } diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/security/not_rely_on_time.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/security/not_rely_on_time.rs index 527aa242..d50037bd 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/security/not_rely_on_time.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/security/not_rely_on_time.rs @@ -45,22 +45,34 @@ impl RuleType for NotRelyOnTime { for line in file.content.lines() { if let Some(index) = line.find("now") { - res.push(self.create_diag((LineColumn { - line: i, - column: index, - }, LineColumn { - line: i, - column: index + 3, - }), file)); + res.push(self.create_diag( + ( + LineColumn { + line: i, + column: index, + }, + LineColumn { + line: i, + column: index + 3, + }, + ), + file, + )); } if let Some(index) = line.find("block.timestamp") { - res.push(self.create_diag((LineColumn { - line: i, - column: index, - }, LineColumn { - line: i, - column: index + 15, - }), file)); + res.push(self.create_diag( + ( + LineColumn { + line: i, + column: index, + }, + LineColumn { + line: i, + column: index + 15, + }, + ), + file, + )); } i += 1; } diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/NamedParametersMapping/.solidhunter.json b/toolchains/solidity/linter/core/solidhunter-lib/testdata/NamedParametersMapping/.solidhunter.json new file mode 100644 index 00000000..3d9c2ef7 --- /dev/null +++ b/toolchains/solidity/linter/core/solidhunter-lib/testdata/NamedParametersMapping/.solidhunter.json @@ -0,0 +1,70 @@ +{ + "name": "solidhunter", + "includes": [], + "plugins": [], + "rules": [ + { + "id": "line-max-len", + "severity": "WARNING", + "data": [ + "80" + ] + }, + { + "id": "no-inline-assembly", + "severity": "WARNING", + "data": [] + }, + { + "id": "named-parameters-mapping", + "severity": "WARNING", + "data": [] + }, + { + "id": "max-states-count", + "severity": "WARNING", + "data": [ + "15" + ] + }, + { + "id": "function-max-lines", + "severity": "WARNING", + "data": [ + "20" + ] + }, + { + "id": "reason-string", + "severity": "WARNING", + "data": [ + "32" + ] + }, + { + "id": "contract-name-pascalcase", + "severity": "WARNING", + "data": [] + }, + { + "id": "func-name-camelcase", + "severity": "WARNING", + "data": [] + }, + { + "id": "func-param-name-camelcase", + "severity": "WARNING", + "data": [] + }, + { + "id": "use-forbidden-name", + "severity": "WARNING", + "data": [] + }, + { + "id": "import-on-top", + "severity": "WARNING", + "data": [] + } + ] +} \ No newline at end of file diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/NamedParametersMapping/file.sol b/toolchains/solidity/linter/core/solidhunter-lib/testdata/NamedParametersMapping/file.sol new file mode 100644 index 00000000..26a38ba7 --- /dev/null +++ b/toolchains/solidity/linter/core/solidhunter-lib/testdata/NamedParametersMapping/file.sol @@ -0,0 +1,9 @@ +pragma solidity 0.8.0; + +contract Test { + mapping(address ok => uint256) public balances; + mapping(address => uint256 no) public balances; + mapping(address => uint256) public balances; + mapping(address named => mapping(uint256 ok => address) wow) public balan; + mapping(address balance => uint256 amount) public balances; +} diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/NamedParametersMapping/findings.csv b/toolchains/solidity/linter/core/solidhunter-lib/testdata/NamedParametersMapping/findings.csv new file mode 100644 index 00000000..df443859 --- /dev/null +++ b/toolchains/solidity/linter/core/solidhunter-lib/testdata/NamedParametersMapping/findings.csv @@ -0,0 +1,5 @@ +named-parameters-mapping:4:26:4:33 +named-parameters-mapping:5:12:5:19 +named-parameters-mapping:6:12:6:19 +named-parameters-mapping:6:23:6:30 +named-parameters-mapping:7:51:7:58 diff --git a/toolchains/solidity/linter/core/solidhunter-lib/tests/linter.rs b/toolchains/solidity/linter/core/solidhunter-lib/tests/linter.rs index 99e7e242..497caabe 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/tests/linter.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/tests/linter.rs @@ -166,4 +166,5 @@ test_directories! { ModifierNameMixedcase, GlobalImport, NotRelyOnTime + NamedParametersMapping, } From 8a9b29c42b844426eaf4f84e4e26f3d023c1b4cc Mon Sep 17 00:00:00 2001 From: 0xtekgrinder <0xtekgrinder@protonmail.com> Date: Mon, 9 Oct 2023 15:39:22 -0400 Subject: [PATCH 210/325] refactor(solidity/linter/core): remove debug log --- .../src/rules/naming/named_parameters_mapping.rs | 1 - toolchains/solidity/linter/core/solidhunter-lib/tests/linter.rs | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/named_parameters_mapping.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/named_parameters_mapping.rs index cf86e6ae..a854da3a 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/named_parameters_mapping.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/named_parameters_mapping.rs @@ -68,7 +68,6 @@ impl RuleType for NamedParametersMapping { } for mapping in visitor.mappings.iter() { - println!("{:?}", mapping); if mapping.key_name.is_none() { let span = mapping.key.span(); res.push(self.create_diag( diff --git a/toolchains/solidity/linter/core/solidhunter-lib/tests/linter.rs b/toolchains/solidity/linter/core/solidhunter-lib/tests/linter.rs index 497caabe..a123add4 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/tests/linter.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/tests/linter.rs @@ -165,6 +165,6 @@ test_directories! { VarNameMixedCase, ModifierNameMixedcase, GlobalImport, - NotRelyOnTime + NotRelyOnTime, NamedParametersMapping, } From fbd4826ed2811ca7c17a981d06b121c10b2c15ab Mon Sep 17 00:00:00 2001 From: Astrodevs CI Date: Sun, 8 Oct 2023 20:18:02 +0000 Subject: [PATCH 211/325] chore: create branch feature/50-solidity-linter-rules/114-ordering-rule-staging --- remove-me-8487a625f27e4be08463.txt | 1 + 1 file changed, 1 insertion(+) create mode 100644 remove-me-8487a625f27e4be08463.txt diff --git a/remove-me-8487a625f27e4be08463.txt b/remove-me-8487a625f27e4be08463.txt new file mode 100644 index 00000000..1fbc3d8f --- /dev/null +++ b/remove-me-8487a625f27e4be08463.txt @@ -0,0 +1 @@ +8487a625f27e4be08463 From 43a8fcd9912c0b4c0f3156e14b3de87ae179ebe6 Mon Sep 17 00:00:00 2001 From: 0xMemoryGrinder <35138272+0xMemoryGrinder@users.noreply.github.com> Date: Mon, 9 Oct 2023 15:52:49 -0400 Subject: [PATCH 212/325] feat(solidity/linter/core): ordering rule --- remove-me-8487a625f27e4be08463.txt | 1 - .../linter/core/solidhunter-lib/src/linter.rs | 2 +- .../solidhunter-lib/src/rules/order/mod.rs | 5 +- .../src/rules/order/ordering.rs | 504 ++++++++++++++++++ .../core/solidhunter-lib/src/rules/types.rs | 2 +- .../testdata/Ordering/.solidhunter.json | 12 + .../testdata/Ordering/file.sol | 12 + .../testdata/Ordering/findings.csv | 2 + .../core/solidhunter-lib/tests/linter.rs | 1 + 9 files changed, 537 insertions(+), 4 deletions(-) delete mode 100644 remove-me-8487a625f27e4be08463.txt create mode 100644 toolchains/solidity/linter/core/solidhunter-lib/src/rules/order/ordering.rs create mode 100644 toolchains/solidity/linter/core/solidhunter-lib/testdata/Ordering/.solidhunter.json create mode 100644 toolchains/solidity/linter/core/solidhunter-lib/testdata/Ordering/file.sol create mode 100644 toolchains/solidity/linter/core/solidhunter-lib/testdata/Ordering/findings.csv diff --git a/remove-me-8487a625f27e4be08463.txt b/remove-me-8487a625f27e4be08463.txt deleted file mode 100644 index 1fbc3d8f..00000000 --- a/remove-me-8487a625f27e4be08463.txt +++ /dev/null @@ -1 +0,0 @@ -8487a625f27e4be08463 diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/linter.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/linter.rs index ec431199..cf831efc 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/linter.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/linter.rs @@ -8,7 +8,7 @@ use std::fs; use glob::glob; -#[derive(Debug)] +#[derive(Debug, Clone)] pub struct SolidFile { pub data: ast_extractor::File, pub path: String, diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/order/mod.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/order/mod.rs index a22ad358..cc0c65c1 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/order/mod.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/order/mod.rs @@ -3,19 +3,22 @@ use std::collections::HashMap; #[macro_use] pub(crate) mod import_on_top; +pub(crate) mod ordering; // List all rules use crate::rules::order::import_on_top::ImportOnTop; +use crate::rules::order::ordering::Ordering; use crate::rules::RuleBuilder; pub fn create_default_rules() -> Vec { - vec![ImportOnTop::create_default()] + vec![ImportOnTop::create_default(), Ordering::create_default()] } pub fn create_rules() -> RulesMap { let mut rules: HashMap = HashMap::new(); rules.insert(import_on_top::RULE_ID.to_string(), ImportOnTop::create); + rules.insert(ordering::RULE_ID.to_string(), Ordering::create); rules } diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/order/ordering.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/order/ordering.rs new file mode 100644 index 00000000..c4a67c95 --- /dev/null +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/order/ordering.rs @@ -0,0 +1,504 @@ +use std::collections::HashMap; + +use ast_extractor::{Spanned, Visit, visit, FunctionKind, Visibility}; + +use crate::linter::SolidFile; +use crate::rules::types::*; +use crate::types::*; + +pub const RULE_ID: &str = "ordering"; +const MESSAGE: &str = "Import must be on top in the file"; + +struct OrderingVisitor { + file: SolidFile, + data: RuleEntry, + authorized_file_items: HashMap>>, + authorized_contract_items: HashMap>>, + file_current_item: Option, + contract_current_item: Option, + inside_contract: bool, + reports: Vec, +} + +impl OrderingVisitor { + fn new(file: SolidFile, data: RuleEntry) -> OrderingVisitor { + let authorized_file_items: HashMap>> = [ + (FileItemType::Pragma, vec![None]), + (FileItemType::Import, vec![None, Some(FileItemType::Pragma)]), + ( + FileItemType::Enum, + vec![ + None, + Some(FileItemType::Pragma), + Some(FileItemType::Import), + ], + ), + ( + FileItemType::Struct, + vec![ + None, + Some(FileItemType::Pragma), + Some(FileItemType::Import), + Some(FileItemType::Enum), + ], + ), + ( + FileItemType::ContractInterface, + vec![ + None, + Some(FileItemType::Pragma), + Some(FileItemType::Import), + Some(FileItemType::Enum), + Some(FileItemType::Struct), + ], + ), + ( + FileItemType::ContractLibrary, + vec![ + None, + Some(FileItemType::Pragma), + Some(FileItemType::Import), + Some(FileItemType::Enum), + Some(FileItemType::Struct), + Some(FileItemType::ContractInterface), + ], + ), + ( + FileItemType::Contract, + vec![ + None, + Some(FileItemType::Pragma), + Some(FileItemType::Import), + Some(FileItemType::Enum), + Some(FileItemType::Struct), + Some(FileItemType::ContractInterface), + Some(FileItemType::ContractLibrary), + ], + ), + ].iter() + .cloned() + .collect(); + + let authorized_contract_items: HashMap>> = [ + (ContractItemType::Udt, vec![None]), + ( + ContractItemType::Struct, + vec![None, Some(ContractItemType::Udt)], + ), + ( + ContractItemType::Enum, + vec![None, Some(ContractItemType::Udt), Some(ContractItemType::Struct)], + ), + ( + ContractItemType::Property, + vec![ + None, + Some(ContractItemType::Udt), + Some(ContractItemType::Struct), + Some(ContractItemType::Enum), + ], + ), + ( + ContractItemType::Event, + vec![ + None, + Some(ContractItemType::Udt), + Some(ContractItemType::Struct), + Some(ContractItemType::Enum), + Some(ContractItemType::Property), + ], + ), + ( + ContractItemType::Modifier, + vec![ + None, + Some(ContractItemType::Udt), + Some(ContractItemType::Struct), + Some(ContractItemType::Enum), + Some(ContractItemType::Property), + Some(ContractItemType::Event), + ], + ), + ( + ContractItemType::Constructor, + vec![ + None, + Some(ContractItemType::Udt), + Some(ContractItemType::Struct), + Some(ContractItemType::Enum), + Some(ContractItemType::Property), + Some(ContractItemType::Event), + Some(ContractItemType::Modifier), + ], + ), + ( + ContractItemType::Receive, + vec![ + None, + Some(ContractItemType::Udt), + Some(ContractItemType::Struct), + Some(ContractItemType::Enum), + Some(ContractItemType::Property), + Some(ContractItemType::Event), + Some(ContractItemType::Modifier), + Some(ContractItemType::Constructor), + ], + ), + ( + ContractItemType::FallBack, + vec![ + None, + Some(ContractItemType::Udt), + Some(ContractItemType::Struct), + Some(ContractItemType::Enum), + Some(ContractItemType::Property), + Some(ContractItemType::Event), + Some(ContractItemType::Modifier), + Some(ContractItemType::Constructor), + Some(ContractItemType::Receive), + ], + ), + ( + ContractItemType::ExternalFunction, + vec![ + None, + Some(ContractItemType::Udt), + Some(ContractItemType::Struct), + Some(ContractItemType::Enum), + Some(ContractItemType::Property), + Some(ContractItemType::Event), + Some(ContractItemType::Modifier), + Some(ContractItemType::Constructor), + Some(ContractItemType::Receive), + Some(ContractItemType::FallBack), + ], + ), + ( + ContractItemType::PublicFunction, + vec![ + None, + Some(ContractItemType::Udt), + Some(ContractItemType::Struct), + Some(ContractItemType::Enum), + Some(ContractItemType::Property), + Some(ContractItemType::Event), + Some(ContractItemType::Modifier), + Some(ContractItemType::Constructor), + Some(ContractItemType::Receive), + Some(ContractItemType::FallBack), + Some(ContractItemType::ExternalFunction), + ], + ), + ( + ContractItemType::InternalFunction, + vec![ + None, + Some(ContractItemType::Udt), + Some(ContractItemType::Struct), + Some(ContractItemType::Enum), + Some(ContractItemType::Property), + Some(ContractItemType::Event), + Some(ContractItemType::Modifier), + Some(ContractItemType::Constructor), + Some(ContractItemType::Receive), + Some(ContractItemType::FallBack), + Some(ContractItemType::ExternalFunction), + Some(ContractItemType::PublicFunction), + ], + ), + ( + ContractItemType::PrivateFunction, + vec![ + None, + Some(ContractItemType::Udt), + Some(ContractItemType::Struct), + Some(ContractItemType::Enum), + Some(ContractItemType::Property), + Some(ContractItemType::Event), + Some(ContractItemType::Modifier), + Some(ContractItemType::Constructor), + Some(ContractItemType::Receive), + Some(ContractItemType::FallBack), + Some(ContractItemType::ExternalFunction), + Some(ContractItemType::PublicFunction), + Some(ContractItemType::InternalFunction), + ], + ), + ].iter() + .cloned() + .collect(); + OrderingVisitor { + file, + data, + authorized_file_items, + authorized_contract_items, + file_current_item: None, + contract_current_item: None, + inside_contract: false, + reports: Vec::new(), + } + } + + fn create_diag( + &self, + file: &SolidFile, + location: (ast_extractor::LineColumn, ast_extractor::LineColumn), + ) -> LintDiag { + let range = Range { + start: Position { + line: location.0.line, + character: location.0.column, + }, + end: Position { + line: location.1.line, + character: location.1.column, + }, + }; + LintDiag { + id: RULE_ID.to_string(), + range, + message: MESSAGE.to_string(), + severity: Some(self.data.severity), + code: None, + source: None, + uri: file.path.clone(), + source_file_content: file.content.clone(), + } + } + + fn is_authorized_file_item(&self, item: FileItemType) -> bool { + if let Some(authorized_items) = self.authorized_file_items.get(&item) { + let res = authorized_items.contains(&self.file_current_item); + return res; + } + true + } + + fn is_authorized_contract_item(&self, item: ContractItemType) -> bool { + if let Some(authorized_items) = self.authorized_contract_items.get(&item) { + return authorized_items.contains(&self.contract_current_item); + } + true + } +} + +impl<'ast> Visit<'ast> for OrderingVisitor { + fn visit_pragma_directive(&mut self, pragma: &'ast ast_extractor::PragmaDirective) { + if !self.is_authorized_file_item(FileItemType::Pragma) { + let location = (pragma.span().start(), pragma.span().end()); + self.reports.push(self.create_diag(&self.file, location)); + } else { + self.file_current_item = Some(FileItemType::Pragma); + } + } + + fn visit_import_directive(&mut self, import: &'ast ast_extractor::ImportDirective) { + if !self.is_authorized_file_item(FileItemType::Import) { + let location = (import.span().start(), import.span().end()); + self.reports.push(self.create_diag(&self.file, location)); + } else { + self.file_current_item = Some(FileItemType::Import); + } + } + + fn visit_item_enum(&mut self, enum_def: &'ast ast_extractor::ItemEnum) { + if !self.is_authorized_file_item(FileItemType::Enum) { + let location = (enum_def.span().start(), enum_def.span().end()); + self.reports.push(self.create_diag(&self.file, location)); + } else { + self.file_current_item = Some(FileItemType::Enum); + } + } + + fn visit_item_struct(&mut self, struct_def: &'ast ast_extractor::ItemStruct) { + if !self.is_authorized_file_item(FileItemType::Struct) { + let location = (struct_def.span().start(), struct_def.span().end()); + self.reports.push(self.create_diag(&self.file, location)); + } else { + self.file_current_item = Some(FileItemType::Struct); + } + } + + fn visit_item_contract(&mut self, contract_def: &'ast ast_extractor::ItemContract) { + if contract_def.is_interface() && !self.is_authorized_file_item(FileItemType::ContractInterface) || + contract_def.is_library() && !self.is_authorized_file_item(FileItemType::ContractLibrary) || + !self.is_authorized_file_item(FileItemType::Contract) { + let location = (contract_def.span().start(), contract_def.span().end()); + self.reports.push(self.create_diag(&self.file, location)); + } else { + self.file_current_item = Some(FileItemType::Contract); + } + self.contract_current_item = None; + self.inside_contract = true; + visit::visit_item_contract(self, contract_def); + self.inside_contract = false; + } + + fn visit_item_udt(&mut self,udt: &'ast ast_extractor::ItemUdt) { + if !self.is_authorized_contract_item(ContractItemType::Udt) { + let location = (udt.span().start(), udt.span().end()); + self.reports.push(self.create_diag(&self.file, location)); + } else { + self.contract_current_item = Some(ContractItemType::Udt); + } + } + + fn visit_variable_definition(&mut self,var: &'ast ast_extractor::VariableDefinition) { + if !self.is_authorized_contract_item(ContractItemType::Property) { + let location = (var.span().start(), var.span().end()); + self.reports.push(self.create_diag(&self.file, location)); + } else { + self.contract_current_item = Some(ContractItemType::Property); + } + } + + fn visit_item_event(&mut self,event: &'ast ast_extractor::ItemEvent) { + if !self.is_authorized_contract_item(ContractItemType::Event) { + let location = (event.span().start(), event.span().end()); + self.reports.push(self.create_diag(&self.file, location)); + } else { + self.contract_current_item = Some(ContractItemType::Event); + } + } + + fn visit_item_function(&mut self,function: &'ast ast_extractor::ItemFunction) { + + match function.kind { + FunctionKind::Modifier(_) => { + if !self.is_authorized_contract_item(ContractItemType::Modifier) { + let location = (function.span().start(), function.span().end()); + self.reports.push(self.create_diag(&self.file, location)); + } else { + self.contract_current_item = Some(ContractItemType::Modifier); + } + }, + FunctionKind::Constructor(_) => { + if !self.is_authorized_contract_item(ContractItemType::Constructor) { + let location = (function.span().start(), function.span().end()); + self.reports.push(self.create_diag(&self.file, location)); + } else { + self.contract_current_item = Some(ContractItemType::Constructor); + } + }, + FunctionKind::Receive(_) => { + if !self.is_authorized_contract_item(ContractItemType::Receive) { + let location = (function.span().start(), function.span().end()); + self.reports.push(self.create_diag(&self.file, location)); + } else { + self.contract_current_item = Some(ContractItemType::Receive); + } + }, + FunctionKind::Fallback(_) => { + if !self.is_authorized_contract_item(ContractItemType::FallBack) { + let location = (function.span().start(), function.span().end()); + self.reports.push(self.create_diag(&self.file, location)); + } else { + self.contract_current_item = Some(ContractItemType::FallBack); + } + }, + FunctionKind::Function(_) => { + let visibility = function.attributes.iter().find(|attr| matches!(attr, ast_extractor::FunctionAttribute::Visibility(_))); + let visibility = match visibility { + Some(ast_extractor::FunctionAttribute::Visibility(visibility)) => visibility, + _ => return, + }; + + match visibility { + Visibility::External(_) => { + if !self.is_authorized_contract_item(ContractItemType::ExternalFunction) { + let location = (function.span().start(), function.span().end()); + self.reports.push(self.create_diag(&self.file, location)); + } else { + self.contract_current_item = Some(ContractItemType::ExternalFunction); + } + }, + Visibility::Public(_) => { + if !self.is_authorized_contract_item(ContractItemType::PublicFunction) { + let location = (function.span().start(), function.span().end()); + self.reports.push(self.create_diag(&self.file, location)); + } else { + self.contract_current_item = Some(ContractItemType::PublicFunction); + } + }, + Visibility::Internal(_) => { + if !self.is_authorized_contract_item(ContractItemType::InternalFunction) { + let location = (function.span().start(), function.span().end()); + self.reports.push(self.create_diag(&self.file, location)); + } else { + self.contract_current_item = Some(ContractItemType::InternalFunction); + } + }, + Visibility::Private(_) => { + if !self.is_authorized_contract_item(ContractItemType::PrivateFunction) { + let location = (function.span().start(), function.span().end()); + self.reports.push(self.create_diag(&self.file, location)); + } else { + self.contract_current_item = Some(ContractItemType::PrivateFunction); + } + }, + } + + } + } + } + + +} + +#[derive(Debug, Clone)] +pub struct Ordering { + data: RuleEntry, +} + + +impl RuleType for Ordering { + fn diagnose(&self, file: &SolidFile, _files: &[SolidFile]) -> Vec { + let mut visitor = OrderingVisitor::new(file.clone(), self.data.clone()); + visitor.visit_file(&file.data); + visitor.reports + } +} + +impl Ordering { + pub(crate) fn create(data: RuleEntry) -> Box { + let rule = Ordering { data }; + Box::new(rule) + } + + pub(crate) fn create_default() -> RuleEntry { + RuleEntry { + id: RULE_ID.to_string(), + severity: Severity::WARNING, + data: vec![], + } + } +} + +#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] +enum FileItemType { + Pragma, + Import, + Enum, + Struct, + ContractInterface, + ContractLibrary, + Contract, +} + +#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] +enum ContractItemType { + Udt, + Struct, + Enum, + Property, + Event, + Modifier, + Constructor, + Receive, + FallBack, + ExternalFunction, + PublicFunction, + InternalFunction, + PrivateFunction, +} + diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/types.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/types.rs index f18dedcf..08d0c0f9 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/types.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/types.rs @@ -3,7 +3,7 @@ use crate::types::*; use serde::{Deserialize, Serialize}; use std::collections::HashMap; -#[derive(Serialize, Deserialize, Debug)] +#[derive(Serialize, Deserialize, Debug, Clone)] pub struct RuleEntry { pub id: String, pub severity: Severity, diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/Ordering/.solidhunter.json b/toolchains/solidity/linter/core/solidhunter-lib/testdata/Ordering/.solidhunter.json new file mode 100644 index 00000000..8cd1f7d2 --- /dev/null +++ b/toolchains/solidity/linter/core/solidhunter-lib/testdata/Ordering/.solidhunter.json @@ -0,0 +1,12 @@ +{ + "name": "solidhunter", + "includes": [], + "plugins": [], + "rules": [ + { + "id": "ordering", + "severity": "WARNING", + "data": [] + } + ] +} \ No newline at end of file diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/Ordering/file.sol b/toolchains/solidity/linter/core/solidhunter-lib/testdata/Ordering/file.sol new file mode 100644 index 00000000..f3584746 --- /dev/null +++ b/toolchains/solidity/linter/core/solidhunter-lib/testdata/Ordering/file.sol @@ -0,0 +1,12 @@ +pragma solidity 0.8.19; + + +contract MyContract { + function foo() public {} + + using MyMathLib for uint; // NOK + + uint a; // NOK +} + +library MyLibrary {} // NOK \ No newline at end of file diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/Ordering/findings.csv b/toolchains/solidity/linter/core/solidhunter-lib/testdata/Ordering/findings.csv new file mode 100644 index 00000000..fb25cf75 --- /dev/null +++ b/toolchains/solidity/linter/core/solidhunter-lib/testdata/Ordering/findings.csv @@ -0,0 +1,2 @@ +ordering:9:4:9:11 +ordering:12:8:12:17 \ No newline at end of file diff --git a/toolchains/solidity/linter/core/solidhunter-lib/tests/linter.rs b/toolchains/solidity/linter/core/solidhunter-lib/tests/linter.rs index a123add4..1f129cd1 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/tests/linter.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/tests/linter.rs @@ -167,4 +167,5 @@ test_directories! { GlobalImport, NotRelyOnTime, NamedParametersMapping, + Ordering } From c67f21ccbcc476a7d733d1e22bc7e612ded0b2a2 Mon Sep 17 00:00:00 2001 From: 0xMemoryGrinder <35138272+0xMemoryGrinder@users.noreply.github.com> Date: Mon, 9 Oct 2023 15:52:49 -0400 Subject: [PATCH 213/325] feat(solidity/linter/core): ordering rule --- libs/ast-extractor/.idea/.gitignore | 8 ++++++++ libs/ast-extractor/.idea/vcs.xml | 6 ++++++ 2 files changed, 14 insertions(+) create mode 100644 libs/ast-extractor/.idea/.gitignore create mode 100644 libs/ast-extractor/.idea/vcs.xml diff --git a/libs/ast-extractor/.idea/.gitignore b/libs/ast-extractor/.idea/.gitignore new file mode 100644 index 00000000..13566b81 --- /dev/null +++ b/libs/ast-extractor/.idea/.gitignore @@ -0,0 +1,8 @@ +# Default ignored files +/shelf/ +/workspace.xml +# Editor-based HTTP Client requests +/httpRequests/ +# Datasource local storage ignored files +/dataSources/ +/dataSources.local.xml diff --git a/libs/ast-extractor/.idea/vcs.xml b/libs/ast-extractor/.idea/vcs.xml new file mode 100644 index 00000000..b2bdec2d --- /dev/null +++ b/libs/ast-extractor/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file From e2965bcbc8cab64670ba40ecd24830510c85b29a Mon Sep 17 00:00:00 2001 From: Astrodevs CI Date: Sat, 7 Oct 2023 19:40:30 +0000 Subject: [PATCH 214/325] chore: create branch feature/50-solidity-linter-rules/116-foundry-test-functions-rule-staging --- remove-me-6e6600447ae644d8ace4.txt | 1 + 1 file changed, 1 insertion(+) create mode 100644 remove-me-6e6600447ae644d8ace4.txt diff --git a/remove-me-6e6600447ae644d8ace4.txt b/remove-me-6e6600447ae644d8ace4.txt new file mode 100644 index 00000000..f63d65d1 --- /dev/null +++ b/remove-me-6e6600447ae644d8ace4.txt @@ -0,0 +1 @@ +6e6600447ae644d8ace4 From 2e9ff023898f70c817b55761078dd04230b6e4a3 Mon Sep 17 00:00:00 2001 From: 0xMemoryGrinder <35138272+0xMemoryGrinder@users.noreply.github.com> Date: Sun, 8 Oct 2023 02:48:03 -0400 Subject: [PATCH 215/325] feat(solidity/linter/rule): added foundry teest function name rule --- .../src/rules/naming/foundry_func_name.rs | 75 +++++++++++++++++++ .../solidhunter-lib/src/rules/naming/mod.rs | 7 ++ .../FoundryFunctionName/.solidhunter.json | 60 +++++++++++++++ .../testdata/FoundryFunctionName/file.sol | 11 +++ .../testdata/FoundryFunctionName/findings.csv | 1 + .../core/solidhunter-lib/tests/linter.rs | 3 +- 6 files changed, 156 insertions(+), 1 deletion(-) create mode 100644 toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/foundry_func_name.rs create mode 100644 toolchains/solidity/linter/core/solidhunter-lib/testdata/FoundryFunctionName/.solidhunter.json create mode 100644 toolchains/solidity/linter/core/solidhunter-lib/testdata/FoundryFunctionName/file.sol create mode 100644 toolchains/solidity/linter/core/solidhunter-lib/testdata/FoundryFunctionName/findings.csv diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/foundry_func_name.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/foundry_func_name.rs new file mode 100644 index 00000000..2dbe4c01 --- /dev/null +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/foundry_func_name.rs @@ -0,0 +1,75 @@ +use ast_extractor::Spanned; + +use crate::linter::SolidFile; +use crate::rules::types::*; +use crate::types::*; + +pub const RULE_ID: &str = "foundry-func-name"; +const MESSAGE: &str = "Founfry test function name need to respect the convention"; + +pub struct FoundryFuncName { + data: RuleEntry, +} + +impl FoundryFuncName { + fn create_diag( + &self, + location: (ast_extractor::LineColumn, ast_extractor::LineColumn), + file: &SolidFile, + ) -> LintDiag { + LintDiag { + id: RULE_ID.to_string(), + range: Range { + start: Position { + line: location.0.line, + character: location.0.column, + }, + end: Position { + line: location.1.line, + character: location.1.column, + }, + }, + message: MESSAGE.to_string(), + severity: Some(self.data.severity), + code: None, + source: None, + uri: file.path.clone(), + source_file_content: file.content.clone(), + } + } +} + +impl RuleType for FoundryFuncName { + fn diagnose(&self, file: &SolidFile, _files: &[SolidFile]) -> Vec { + let mut res = Vec::new(); + let re = regex::Regex::new(r"^test(Fork)?(Fuzz)?(Fail)?(_)?(Revert(If_|When_){1})?\w{1,}$").unwrap(); + let contracts = ast_extractor::retriever::retrieve_contract_nodes(&file.data); + + for contract in contracts { + for function in ast_extractor::retriever::retrieve_functions_nodes(&contract) { + if let Some(name) = function.name { + if !re.is_match(name.as_string().as_str()) { + let span = name.span(); + res.push(self.create_diag((span.start(), span.end()), file)); + } + } + } + } + res + } +} + +impl FoundryFuncName { + pub(crate) fn create(data: RuleEntry) -> Box { + let rule = FoundryFuncName { data }; + Box::new(rule) + } + + pub(crate) fn create_default() -> RuleEntry { + RuleEntry { + id: RULE_ID.to_string(), + severity: Severity::WARNING, + data: vec![], + } + } +} diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/mod.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/mod.rs index 1a44f32d..d26fb772 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/mod.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/mod.rs @@ -8,6 +8,7 @@ use crate::rules::naming::modifier_name_mixedcase::ModifierNameMixedcase; use crate::rules::naming::named_parameters_mapping::NamedParametersMapping; use crate::rules::naming::use_forbidden_name::UseForbiddenName; use crate::rules::naming::var_name_mixedcase::VarNameMixedCase; +use crate::rules::naming::foundry_func_name::FoundryFuncName; use crate::rules::types::{RuleEntry, RulesMap}; use crate::rules::RuleBuilder; use std::collections::HashMap; @@ -23,6 +24,7 @@ pub(crate) mod modifier_name_mixedcase; pub(crate) mod named_parameters_mapping; pub(crate) mod use_forbidden_name; pub(crate) mod var_name_mixedcase; +pub(crate) mod foundry_func_name; // List all rules @@ -38,6 +40,7 @@ pub fn create_default_rules() -> Vec { VarNameMixedCase::create_default(), ModifierNameMixedcase::create_default(), NamedParametersMapping::create_default(), + FoundryFuncName::create_default(), ] } @@ -81,6 +84,10 @@ pub fn create_rules() -> RulesMap { modifier_name_mixedcase::RULE_ID.to_string(), ModifierNameMixedcase::create, ); + rules.insert( + foundry_func_name::RULE_ID.to_string(), + FoundryFuncName::create, + ); rules } diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/FoundryFunctionName/.solidhunter.json b/toolchains/solidity/linter/core/solidhunter-lib/testdata/FoundryFunctionName/.solidhunter.json new file mode 100644 index 00000000..476e6f03 --- /dev/null +++ b/toolchains/solidity/linter/core/solidhunter-lib/testdata/FoundryFunctionName/.solidhunter.json @@ -0,0 +1,60 @@ +{ + "name": "solidhunter", + "includes": [], + "plugins": [], + "rules": [ + { + "id": "line-max-len", + "severity": "WARNING", + "data": [ + "80" + ] + }, + { + "id": "max-states-count", + "severity": "WARNING", + "data": [ + "15" + ] + }, + { + "id": "function-max-lines", + "severity": "WARNING", + "data": [ + "20" + ] + }, + { + "id": "reason-string", + "severity": "WARNING", + "data": [ + "32" + ] + }, + { + "id": "contract-name-pascalcase", + "severity": "WARNING", + "data": [] + }, + { + "id": "func-param-name-camelcase", + "severity": "WARNING", + "data": [] + }, + { + "id": "use-forbidden-name", + "severity": "WARNING", + "data": [] + }, + { + "id": "import-on-top", + "severity": "WARNING", + "data": [] + }, + { + "id": "foundry-func-name", + "severity": "WARNING", + "data": [] + } + ] +} \ No newline at end of file diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/FoundryFunctionName/file.sol b/toolchains/solidity/linter/core/solidhunter-lib/testdata/FoundryFunctionName/file.sol new file mode 100644 index 00000000..564fbef3 --- /dev/null +++ b/toolchains/solidity/linter/core/solidhunter-lib/testdata/FoundryFunctionName/file.sol @@ -0,0 +1,11 @@ +pragma solidity 0.8.0; + +contract Test { + function test_NumberIs42() public {} // should pass + + function testFail_Subtract43() public {} // should pass + + function testFuzz_FuzzyTest() public {} // should pass + + function numberIs42() public {} // should fail +} diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/FoundryFunctionName/findings.csv b/toolchains/solidity/linter/core/solidhunter-lib/testdata/FoundryFunctionName/findings.csv new file mode 100644 index 00000000..b2302769 --- /dev/null +++ b/toolchains/solidity/linter/core/solidhunter-lib/testdata/FoundryFunctionName/findings.csv @@ -0,0 +1 @@ +foundry-func-name:10:13:10:23 \ No newline at end of file diff --git a/toolchains/solidity/linter/core/solidhunter-lib/tests/linter.rs b/toolchains/solidity/linter/core/solidhunter-lib/tests/linter.rs index 1f129cd1..89651365 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/tests/linter.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/tests/linter.rs @@ -167,5 +167,6 @@ test_directories! { GlobalImport, NotRelyOnTime, NamedParametersMapping, - Ordering + Ordering, + FoundryFunctionName } From 9c9e75d13ee71577e1caefc3bdca74ee131dfd34 Mon Sep 17 00:00:00 2001 From: 0xMemoryGrinder <35138272+0xMemoryGrinder@users.noreply.github.com> Date: Sun, 8 Oct 2023 16:16:36 -0400 Subject: [PATCH 216/325] fix(solidity/linter/core): run rule only on files ending by .t.sol --- .../core/solidhunter-lib/src/rules/naming/foundry_func_name.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/foundry_func_name.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/foundry_func_name.rs index 2dbe4c01..7d49b190 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/foundry_func_name.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/foundry_func_name.rs @@ -41,6 +41,9 @@ impl FoundryFuncName { impl RuleType for FoundryFuncName { fn diagnose(&self, file: &SolidFile, _files: &[SolidFile]) -> Vec { + if !file.path.ends_with(".t.sol") { + return vec![]; + } let mut res = Vec::new(); let re = regex::Regex::new(r"^test(Fork)?(Fuzz)?(Fail)?(_)?(Revert(If_|When_){1})?\w{1,}$").unwrap(); let contracts = ast_extractor::retriever::retrieve_contract_nodes(&file.data); From 6b0cf289d1a1c66a379b76419fe45a17343641ac Mon Sep 17 00:00:00 2001 From: 0xMemoryGrinder <35138272+0xMemoryGrinder@users.noreply.github.com> Date: Sun, 8 Oct 2023 16:19:30 -0400 Subject: [PATCH 217/325] chore: delete remove-me --- remove-me-6e6600447ae644d8ace4.txt | 1 - 1 file changed, 1 deletion(-) delete mode 100644 remove-me-6e6600447ae644d8ace4.txt diff --git a/remove-me-6e6600447ae644d8ace4.txt b/remove-me-6e6600447ae644d8ace4.txt deleted file mode 100644 index f63d65d1..00000000 --- a/remove-me-6e6600447ae644d8ace4.txt +++ /dev/null @@ -1 +0,0 @@ -6e6600447ae644d8ace4 From 5f5bbb870698ec7d779309d16c5a26a8d21059dd Mon Sep 17 00:00:00 2001 From: 0xMemoryGrinder <35138272+0xMemoryGrinder@users.noreply.github.com> Date: Mon, 9 Oct 2023 11:43:45 -0400 Subject: [PATCH 218/325] feat(solidity/linter/core): added exclusion data in foundry test func name rule --- .../solidhunter-lib/src/rules/naming/foundry_func_name.rs | 5 +++-- .../testdata/FoundryFunctionName/{file.sol => file.t.sol} | 0 .../solidity/linter/core/solidhunter-lib/tests/linter.rs | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) rename toolchains/solidity/linter/core/solidhunter-lib/testdata/FoundryFunctionName/{file.sol => file.t.sol} (100%) diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/foundry_func_name.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/foundry_func_name.rs index 7d49b190..6414b48b 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/foundry_func_name.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/foundry_func_name.rs @@ -9,6 +9,7 @@ const MESSAGE: &str = "Founfry test function name need to respect the convention pub struct FoundryFuncName { data: RuleEntry, + excluded: Vec, } impl FoundryFuncName { @@ -51,7 +52,7 @@ impl RuleType for FoundryFuncName { for contract in contracts { for function in ast_extractor::retriever::retrieve_functions_nodes(&contract) { if let Some(name) = function.name { - if !re.is_match(name.as_string().as_str()) { + if !re.is_match(&name.as_string()) && !self.excluded.contains(&name.as_string()) { let span = name.span(); res.push(self.create_diag((span.start(), span.end()), file)); } @@ -64,7 +65,7 @@ impl RuleType for FoundryFuncName { impl FoundryFuncName { pub(crate) fn create(data: RuleEntry) -> Box { - let rule = FoundryFuncName { data }; + let rule = FoundryFuncName { excluded: data.data.clone(), data }; Box::new(rule) } diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/FoundryFunctionName/file.sol b/toolchains/solidity/linter/core/solidhunter-lib/testdata/FoundryFunctionName/file.t.sol similarity index 100% rename from toolchains/solidity/linter/core/solidhunter-lib/testdata/FoundryFunctionName/file.sol rename to toolchains/solidity/linter/core/solidhunter-lib/testdata/FoundryFunctionName/file.t.sol diff --git a/toolchains/solidity/linter/core/solidhunter-lib/tests/linter.rs b/toolchains/solidity/linter/core/solidhunter-lib/tests/linter.rs index 89651365..5ee98f90 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/tests/linter.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/tests/linter.rs @@ -23,7 +23,7 @@ fn test_directory(base_name: &str) { let path = path.unwrap().path(); if let Some(filename) = path.file_name().and_then(|name| name.to_str()) { - if filename == "file.sol" { + if filename == "file.sol" || filename == "file.t.sol" { source = path.to_str().unwrap().to_string(); } else if filename == ".solidhunter.json" { config = path.to_str().unwrap().to_string(); From 70fa9b502376416be78e882c334734cab7936078 Mon Sep 17 00:00:00 2001 From: 0xMemoryGrinder <35138272+0xMemoryGrinder@users.noreply.github.com> Date: Mon, 9 Oct 2023 16:09:12 -0400 Subject: [PATCH 219/325] fix(solidity/linter/core): now run foundry naming rule on public and external functions only --- .../src/rules/naming/foundry_func_name.rs | 9 +++++++++ .../testdata/FoundryFunctionName/file.t.sol | 6 ++++++ .../testdata/FoundryFunctionName/findings.csv | 2 +- 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/foundry_func_name.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/foundry_func_name.rs index 6414b48b..dab6458b 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/foundry_func_name.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/foundry_func_name.rs @@ -51,6 +51,15 @@ impl RuleType for FoundryFuncName { for contract in contracts { for function in ast_extractor::retriever::retrieve_functions_nodes(&contract) { + let visibility = function.attributes.iter().find(|attr| matches!(attr, ast_extractor::FunctionAttribute::Visibility(_))); + let visibility = match visibility { + Some(ast_extractor::FunctionAttribute::Visibility(visibility)) => visibility, + _ => continue, + }; + + if !matches!(visibility, ast_extractor::Visibility::Public(_)) && !matches!(visibility, ast_extractor::Visibility::External(_)) { + continue; + } if let Some(name) = function.name { if !re.is_match(&name.as_string()) && !self.excluded.contains(&name.as_string()) { let span = name.span(); diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/FoundryFunctionName/file.t.sol b/toolchains/solidity/linter/core/solidhunter-lib/testdata/FoundryFunctionName/file.t.sol index 564fbef3..e35de6ca 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/testdata/FoundryFunctionName/file.t.sol +++ b/toolchains/solidity/linter/core/solidhunter-lib/testdata/FoundryFunctionName/file.t.sol @@ -1,6 +1,8 @@ pragma solidity 0.8.0; contract Test { + function testFail_Add42() external {} // should pass + function test_NumberIs42() public {} // should pass function testFail_Subtract43() public {} // should pass @@ -8,4 +10,8 @@ contract Test { function testFuzz_FuzzyTest() public {} // should pass function numberIs42() public {} // should fail + + function YoloNamingBecauseSkipped() internal {} // should pass + + function YoloNamingBacausePrivate() private {} // should pass } diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/FoundryFunctionName/findings.csv b/toolchains/solidity/linter/core/solidhunter-lib/testdata/FoundryFunctionName/findings.csv index b2302769..38ccd526 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/testdata/FoundryFunctionName/findings.csv +++ b/toolchains/solidity/linter/core/solidhunter-lib/testdata/FoundryFunctionName/findings.csv @@ -1 +1 @@ -foundry-func-name:10:13:10:23 \ No newline at end of file +foundry-func-name:12:13:12:23 \ No newline at end of file From b4cfa259f4c7d1b3b815702e53ae68c447595205 Mon Sep 17 00:00:00 2001 From: 0xtekgrinder <0xtekgrinder@protonmail.com> Date: Mon, 9 Oct 2023 16:42:05 -0400 Subject: [PATCH 220/325] chore(solidity/linter/core): check for fmt errors --- toolchains/solidity/linter/core/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/toolchains/solidity/linter/core/package.json b/toolchains/solidity/linter/core/package.json index 7567ffa6..9372cfb8 100644 --- a/toolchains/solidity/linter/core/package.json +++ b/toolchains/solidity/linter/core/package.json @@ -5,7 +5,7 @@ "scripts": { "build": "cargo build --release", "lint": "cargo clippy -- -D warnings", - "format": "cargo fmt", + "format": "cargo fmt --check --all", "test": "cargo test --workspace", "publish": "yarn run build && cp target/release/solidhunter ../extension/core" } From c187b33b03be96ec065128b558f0bdb367bb576b Mon Sep 17 00:00:00 2001 From: Astrodevs CI Date: Fri, 29 Sep 2023 18:54:47 +0000 Subject: [PATCH 221/325] chore: create branch feature/50-solidity-linter-rules/112-private-vars-leading-underscore-rule-staging --- remove-me-d4af0ddaab9f436b93b3.txt | 1 + 1 file changed, 1 insertion(+) create mode 100644 remove-me-d4af0ddaab9f436b93b3.txt diff --git a/remove-me-d4af0ddaab9f436b93b3.txt b/remove-me-d4af0ddaab9f436b93b3.txt new file mode 100644 index 00000000..80bf8e65 --- /dev/null +++ b/remove-me-d4af0ddaab9f436b93b3.txt @@ -0,0 +1 @@ +d4af0ddaab9f436b93b3 From 3b10879117442629f8613fc227947be52b745640 Mon Sep 17 00:00:00 2001 From: 0xtekgrinder <0xtekgrinder@protonmail.com> Date: Fri, 29 Sep 2023 20:38:01 -0400 Subject: [PATCH 222/325] feat(solidity/linter/core): store json value in data to have more flexibility --- .../best_practises/function_max_lines.rs | 8 +++---- .../src/rules/best_practises/line_maxlen.rs | 15 ++++++++++--- .../rules/best_practises/max_states_count.rs | 9 ++++---- .../src/rules/best_practises/reason_string.rs | 21 +++++++++++++------ .../core/solidhunter-lib/src/rules/types.rs | 3 ++- 5 files changed, 38 insertions(+), 18 deletions(-) diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/function_max_lines.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/function_max_lines.rs index c40f1e17..09ed48af 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/function_max_lines.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/function_max_lines.rs @@ -106,9 +106,9 @@ impl FunctionMaxLines { let mut max_number_lines = DEFAULT_MAX_LINES; if !data.data.is_empty() { - max_number_lines = match data.data[0].parse::() { - Ok(v) => v, - Err(_) => DEFAULT_MAX_LINES, + max_number_lines = match data.data[0].as_u64() { + Some(v) => v as usize, + None => DEFAULT_MAX_LINES, }; } let rule = FunctionMaxLines { @@ -122,7 +122,7 @@ impl FunctionMaxLines { RuleEntry { id: RULE_ID.to_string(), severity: Severity::WARNING, - data: vec![DEFAULT_MAX_LINES.to_string()], + data: vec![serde_json::Value::String(DEFAULT_MAX_LINES.to_string())], } } } diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/line_maxlen.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/line_maxlen.rs index 4af03e1b..6110e06b 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/line_maxlen.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/line_maxlen.rs @@ -4,7 +4,7 @@ use crate::types::*; pub const RULE_ID: &str = "line-max-len"; -const DEFAULT_LENGTH: u32 = 80; +const DEFAULT_LENGTH: usize = 80; pub struct LineMaxLen { max_len: usize, @@ -52,8 +52,17 @@ impl RuleType for LineMaxLen { impl LineMaxLen { pub(crate) fn create(data: RuleEntry) -> Box { + let mut max_number_lines = DEFAULT_LENGTH; + + if !data.data.is_empty() { + max_number_lines = match data.data[0].as_u64() { + Some(val) => val as usize, + None => DEFAULT_LENGTH, + }; + } + let rule = LineMaxLen { - max_len: data.data[0].parse::().unwrap(), + max_len: max_number_lines, data, }; Box::new(rule) @@ -63,7 +72,7 @@ impl LineMaxLen { RuleEntry { id: RULE_ID.to_string(), severity: Severity::WARNING, - data: vec![DEFAULT_LENGTH.to_string()], + data: vec![serde_json::Value::String(DEFAULT_LENGTH.to_string())], } } } diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/max_states_count.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/max_states_count.rs index c8f615fe..31ff1c3a 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/max_states_count.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/max_states_count.rs @@ -67,10 +67,11 @@ impl RuleType for MaxStatesCount { impl MaxStatesCount { pub(crate) fn create(data: RuleEntry) -> Box { let mut max_states = DEFAULT_MAX_STATES; + if !data.data.is_empty() { - max_states = match data.data[0].parse::() { - Ok(v) => v, - Err(_) => DEFAULT_MAX_STATES, + max_states = match data.data[0].as_u64() { + Some(val) => val as usize, + None => DEFAULT_MAX_STATES, }; } let rule = MaxStatesCount { max_states, data }; @@ -81,7 +82,7 @@ impl MaxStatesCount { RuleEntry { id: RULE_ID.to_string(), severity: Severity::WARNING, - data: vec!["15".to_string()], + data: vec![serde_json::Value::String(DEFAULT_MAX_STATES.to_string())], } } } diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/reason_string.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/reason_string.rs index 13ab1c2b..bd4bd485 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/reason_string.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/reason_string.rs @@ -7,8 +7,11 @@ use crate::types::{LintDiag, Position, Range, Severity}; pub const RULE_ID: &str = "reason-string"; const DEFAULT_SEVERITY: Severity = Severity::WARNING; +// Specific +const DEFAULT_LENGTH: usize = 32; + pub struct ReasonString { - max_length: u32, + max_length: usize, data: RuleEntry, } @@ -103,10 +106,16 @@ impl RuleType for ReasonString { impl ReasonString { pub fn create(data: RuleEntry) -> Box { - let rule = ReasonString { - max_length: data.data[0].parse::().unwrap(), - data, - }; + let mut max_length = DEFAULT_LENGTH; + + if !data.data.is_empty() { + max_length = match data.data[0].as_u64() { + Some(val) => val as usize, + None => DEFAULT_LENGTH, + }; + } + + let rule = ReasonString { max_length, data }; Box::new(rule) } @@ -114,7 +123,7 @@ impl ReasonString { RuleEntry { id: RULE_ID.to_string(), severity: DEFAULT_SEVERITY, - data: vec![], + data: vec![serde_json::Value::String(DEFAULT_LENGTH.to_string())], } } } diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/types.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/types.rs index 08d0c0f9..f94839b9 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/types.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/types.rs @@ -1,13 +1,14 @@ use crate::linter::SolidFile; use crate::types::*; use serde::{Deserialize, Serialize}; +use serde_json::Value; use std::collections::HashMap; #[derive(Serialize, Deserialize, Debug, Clone)] pub struct RuleEntry { pub id: String, pub severity: Severity, - pub data: Vec, + pub data: Vec, } #[derive(Serialize, Deserialize, Debug)] From 0f48df2ddf031972606cb0fdc7801aaad3cac41d Mon Sep 17 00:00:00 2001 From: 0xMemoryGrinder <35138272+0xMemoryGrinder@users.noreply.github.com> Date: Sat, 7 Oct 2023 18:33:00 -0400 Subject: [PATCH 223/325] feat(solidity/linter/core): PrivateVarsLeadingUnderscore rule --- .../solidhunter-lib/src/rules/naming/mod.rs | 6 + .../naming/private_vars_leading_underscore.rs | 128 ++++++++++++++++++ .../.solidhunter.json | 67 +++++++++ .../PrivateVarsLeadingUnderscore/file.sol | 9 ++ .../PrivateVarsLeadingUnderscore/findings.csv | 5 + 5 files changed, 215 insertions(+) create mode 100644 toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/private_vars_leading_underscore.rs create mode 100644 toolchains/solidity/linter/core/solidhunter-lib/testdata/PrivateVarsLeadingUnderscore/.solidhunter.json create mode 100644 toolchains/solidity/linter/core/solidhunter-lib/testdata/PrivateVarsLeadingUnderscore/file.sol create mode 100644 toolchains/solidity/linter/core/solidhunter-lib/testdata/PrivateVarsLeadingUnderscore/findings.csv diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/mod.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/mod.rs index d26fb772..bff6df0b 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/mod.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/mod.rs @@ -12,6 +12,7 @@ use crate::rules::naming::foundry_func_name::FoundryFuncName; use crate::rules::types::{RuleEntry, RulesMap}; use crate::rules::RuleBuilder; use std::collections::HashMap; +use crate::rules::naming::private_vars_leading_underscore::PrivateVarsLeadingUnderscore; #[macro_use] pub(crate) mod func_param_name_camelcase; @@ -37,6 +38,7 @@ pub fn create_default_rules() -> Vec { FuncVisibility::create_default(), EventNameCamelCase::create_default(), ConstNameSnakeCase::create_default(), + PrivateVarsLeadingUnderscore::create_default(), VarNameMixedCase::create_default(), ModifierNameMixedcase::create_default(), NamedParametersMapping::create_default(), @@ -76,6 +78,10 @@ pub fn create_rules() -> RulesMap { const_name_snakecase::RULE_ID.to_string(), ConstNameSnakeCase::create, ); + rules.insert( + private_vars_leading_underscore::RULE_ID.to_string(), + PrivateVarsLeadingUnderscore::create, + ); rules.insert( var_name_mixedcase::RULE_ID.to_string(), VarNameMixedCase::create, diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/private_vars_leading_underscore.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/private_vars_leading_underscore.rs new file mode 100644 index 00000000..7e1fcf9c --- /dev/null +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/private_vars_leading_underscore.rs @@ -0,0 +1,128 @@ +use ast_extractor::{Item, Spanned}; +use ast_extractor::Visibility::{Internal, Private}; + +use crate::linter::SolidFile; +use crate::rules::types::*; +use crate::types::*; + +pub const RULE_ID: &str = "private-vars-leading-underscore"; +const MESSAGE: &str = "Private and internal names must start with a single underscore"; + +const DEFAULT_STRICT: bool = false; + +pub struct PrivateVarsLeadingUnderscore { + data: RuleEntry, + config: serde_json::Value, +} + +impl PrivateVarsLeadingUnderscore { + fn create_diag( + &self, + location: (ast_extractor::LineColumn, ast_extractor::LineColumn), + file: &SolidFile, + ) -> LintDiag { + LintDiag { + id: RULE_ID.to_string(), + range: Range { + start: Position { + line: location.0.line, + character: location.0.column, + }, + end: Position { + line: location.1.line, + character: location.1.column, + }, + }, + message: MESSAGE.to_string(), + severity: Some(self.data.severity), + code: None, + source: None, + uri: file.path.clone(), + source_file_content: file.content.clone(), + } + } +} + +impl RuleType for PrivateVarsLeadingUnderscore { + fn diagnose(&self, file: &SolidFile, _files: &[SolidFile]) -> Vec { + let mut res = Vec::new(); + let contracts = ast_extractor::retriever::retrieve_contract_nodes(&file.data); + + for contract in contracts { + let functions = ast_extractor::retriever::retrieve_functions_nodes(&contract); + + for function in functions { + let is_private = match function.attributes.visibility() { + Some(val) => match val { + Private(_) => true, + Internal(_) => true, + _ => false, + }, + None => true, + }; + + if let Some(name) = function.name { + let leading_underscore = name.as_string().starts_with('_'); + + if !leading_underscore && is_private { + let span = name.span(); + res.push(self.create_diag((span.start(), span.end()), file)); + } + } + } + + for node_var in contract.body.iter() { + if let Item::Variable(var) = node_var { + let is_private = match var.attributes.visibility() { + Some(val) => match val { + Private(_) => true, + Internal(_) => true, + _ => false, + }, + None => true, + }; + + let leading_underscore = var.name.as_string().starts_with('_'); + + if !leading_underscore && is_private { + let span = var.name.span(); + res.push(self.create_diag((span.start(), span.end()), file)); + } + } + } + } + res + } +} + +impl PrivateVarsLeadingUnderscore { + pub(crate) fn create(data: RuleEntry) -> Box { + let mut strict = DEFAULT_STRICT; + + if !data.data.is_empty() { + strict = match data.data[0].as_bool() { + Some(val) => val as bool, + None => DEFAULT_STRICT, + }; + } + let rule = PrivateVarsLeadingUnderscore { + data, + config: serde_json::json!({ + "strict": strict, + }), + }; + Box::new(rule) + } + + pub(crate) fn create_default() -> RuleEntry { + RuleEntry { + id: RULE_ID.to_string(), + severity: Severity::WARNING, + data: vec![ + serde_json::json!({ + "strict": DEFAULT_STRICT, + }), + ], + } + } +} diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/PrivateVarsLeadingUnderscore/.solidhunter.json b/toolchains/solidity/linter/core/solidhunter-lib/testdata/PrivateVarsLeadingUnderscore/.solidhunter.json new file mode 100644 index 00000000..26de0b5d --- /dev/null +++ b/toolchains/solidity/linter/core/solidhunter-lib/testdata/PrivateVarsLeadingUnderscore/.solidhunter.json @@ -0,0 +1,67 @@ +{ + "name": "solidhunter", + "includes": [], + "plugins": [], + "rules": [ + { + "id": "line-max-len", + "severity": "WARNING", + "data": [ + "80" + ] + }, + { + "id": "max-states-count", + "severity": "WARNING", + "data": [ + "15" + ] + }, + { + "id": "function-max-lines", + "severity": "WARNING", + "data": [ + "20" + ] + }, + { + "id": "reason-string", + "severity": "WARNING", + "data": [ + "32" + ] + }, + { + "id": "contract-name-pascalcase", + "severity": "WARNING", + "data": [] + }, + { + "id": "func-name-camelcase", + "severity": "WARNING", + "data": [] + }, + { + "id": "func-param-name-camelcase", + "severity": "WARNING", + "data": [] + }, + { + "id": "use-forbidden-name", + "severity": "WARNING", + "data": [] + }, + { + "id": "import-on-top", + "severity": "WARNING", + "data": [] + }, + { + "id": "private-vars-leading-underscore", + "severity": "WARNING", + "data": [{ + "strict": false + }] + } + ] +} \ No newline at end of file diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/PrivateVarsLeadingUnderscore/file.sol b/toolchains/solidity/linter/core/solidhunter-lib/testdata/PrivateVarsLeadingUnderscore/file.sol new file mode 100644 index 00000000..550843ad --- /dev/null +++ b/toolchains/solidity/linter/core/solidhunter-lib/testdata/PrivateVarsLeadingUnderscore/file.sol @@ -0,0 +1,9 @@ +pragma solidity 0.8.0; + +contract Test { + function thisIsInternal() internal {} + function thisIsPrivate() private {} + function thisIsPrivate() {} + uint256 internal thisIsInternalVariable; + uint256 thisIsInternalVariable; +} \ No newline at end of file diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/PrivateVarsLeadingUnderscore/findings.csv b/toolchains/solidity/linter/core/solidhunter-lib/testdata/PrivateVarsLeadingUnderscore/findings.csv new file mode 100644 index 00000000..0b21c0cb --- /dev/null +++ b/toolchains/solidity/linter/core/solidhunter-lib/testdata/PrivateVarsLeadingUnderscore/findings.csv @@ -0,0 +1,5 @@ +private-vars-leading-underscore:4:13:4:27 +private-vars-leading-underscore:5:13:5:26 +private-vars-leading-underscore:6:13:6:26 +private-vars-leading-underscore:7:21:7:43 +private-vars-leading-underscore:8:12:8:34 \ No newline at end of file From 7d6b287c152b7f73dd832228b904c7d78098938e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A9o=20Maringer?= Date: Fri, 6 Oct 2023 17:00:49 +0100 Subject: [PATCH 224/325] feat(solidity/linter/core): add rule strict mode --- .../src/rules/naming/func_visibility.rs | 10 ++-- .../naming/private_vars_leading_underscore.rs | 55 ++++++++++++++++--- .../.solidhunter.json | 12 +--- .../PrivateVarsLeadingUnderscore/file.sol | 22 ++++++++ .../PrivateVarsLeadingUnderscore/findings.csv | 8 ++- 5 files changed, 83 insertions(+), 24 deletions(-) diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/func_visibility.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/func_visibility.rs index d426368c..60691461 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/func_visibility.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/func_visibility.rs @@ -76,9 +76,9 @@ impl FuncVisibility { let mut ignore_constructors = DEFAULT_IGNORE_CONSTRUCTORS; if !data.data.is_empty() { - ignore_constructors = match data.data[0].parse::() { - Ok(v) => v, - Err(_) => DEFAULT_IGNORE_CONSTRUCTORS, + ignore_constructors = match data.data[0].as_bool() { + Some(val) => val, + None => DEFAULT_IGNORE_CONSTRUCTORS, }; } let rule = FuncVisibility { @@ -92,7 +92,9 @@ impl FuncVisibility { RuleEntry { id: RULE_ID.to_string(), severity: Severity::WARNING, - data: vec![DEFAULT_IGNORE_CONSTRUCTORS.to_string()], + data: vec![serde_json::json!({ + "strict": DEFAULT_IGNORE_CONSTRUCTORS, + }),], } } } diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/private_vars_leading_underscore.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/private_vars_leading_underscore.rs index 7e1fcf9c..3e775247 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/private_vars_leading_underscore.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/private_vars_leading_underscore.rs @@ -6,7 +6,8 @@ use crate::rules::types::*; use crate::types::*; pub const RULE_ID: &str = "private-vars-leading-underscore"; -const MESSAGE: &str = "Private and internal names must start with a single underscore"; +const MESSAGE_PRIVATE: &str = "Private and internal names must start with a single underscore"; +const MESSAGE_PUBLIC: &str = "Only private and internal names must start with a single underscore"; const DEFAULT_STRICT: bool = false; @@ -20,6 +21,7 @@ impl PrivateVarsLeadingUnderscore { &self, location: (ast_extractor::LineColumn, ast_extractor::LineColumn), file: &SolidFile, + message: String, ) -> LintDiag { LintDiag { id: RULE_ID.to_string(), @@ -33,7 +35,7 @@ impl PrivateVarsLeadingUnderscore { character: location.1.column, }, }, - message: MESSAGE.to_string(), + message, severity: Some(self.data.severity), code: None, source: None, @@ -52,6 +54,32 @@ impl RuleType for PrivateVarsLeadingUnderscore { let functions = ast_extractor::retriever::retrieve_functions_nodes(&contract); for function in functions { + if self.config["strict"].as_bool().unwrap_or(DEFAULT_STRICT) { + for argument in function.arguments { + if let Some(name) = argument.name { + let leading_underscore = name.as_string().starts_with('_'); + + if !leading_underscore { + let span = name.span(); + res.push(self.create_diag((span.start(), span.end()), file, MESSAGE_PRIVATE.to_string())); + } + } + } + + if let Some(returns) = function.returns { + for return_arg in returns.returns { + if let Some(name) = return_arg.name { + let leading_underscore = name.as_string().starts_with('_'); + + if !leading_underscore { + let span = name.span(); + res.push(self.create_diag((span.start(), span.end()), file, MESSAGE_PRIVATE.to_string())); + } + } + } + } + } + let is_private = match function.attributes.visibility() { Some(val) => match val { Private(_) => true, @@ -66,7 +94,12 @@ impl RuleType for PrivateVarsLeadingUnderscore { if !leading_underscore && is_private { let span = name.span(); - res.push(self.create_diag((span.start(), span.end()), file)); + res.push(self.create_diag((span.start(), span.end()), file, MESSAGE_PRIVATE.to_string())); + } + + if leading_underscore && !is_private { + let span = name.span(); + res.push(self.create_diag((span.start(), span.end()), file, MESSAGE_PUBLIC.to_string())); } } } @@ -86,7 +119,11 @@ impl RuleType for PrivateVarsLeadingUnderscore { if !leading_underscore && is_private { let span = var.name.span(); - res.push(self.create_diag((span.start(), span.end()), file)); + res.push(self.create_diag((span.start(), span.end()), file, MESSAGE_PRIVATE.to_string())); + } + if leading_underscore && !is_private { + let span = var.name.span(); + res.push(self.create_diag((span.start(), span.end()), file, MESSAGE_PRIVATE.to_string())); } } } @@ -100,11 +137,13 @@ impl PrivateVarsLeadingUnderscore { let mut strict = DEFAULT_STRICT; if !data.data.is_empty() { - strict = match data.data[0].as_bool() { - Some(val) => val as bool, - None => DEFAULT_STRICT, - }; + if let Some(val) = data.data[0].as_object() { + if let Some(val) = val["strict"].as_bool() { + strict = val; + } + } } + let rule = PrivateVarsLeadingUnderscore { data, config: serde_json::json!({ diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/PrivateVarsLeadingUnderscore/.solidhunter.json b/toolchains/solidity/linter/core/solidhunter-lib/testdata/PrivateVarsLeadingUnderscore/.solidhunter.json index 26de0b5d..2acc2f15 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/testdata/PrivateVarsLeadingUnderscore/.solidhunter.json +++ b/toolchains/solidity/linter/core/solidhunter-lib/testdata/PrivateVarsLeadingUnderscore/.solidhunter.json @@ -36,16 +36,6 @@ "severity": "WARNING", "data": [] }, - { - "id": "func-name-camelcase", - "severity": "WARNING", - "data": [] - }, - { - "id": "func-param-name-camelcase", - "severity": "WARNING", - "data": [] - }, { "id": "use-forbidden-name", "severity": "WARNING", @@ -60,7 +50,7 @@ "id": "private-vars-leading-underscore", "severity": "WARNING", "data": [{ - "strict": false + "strict": true }] } ] diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/PrivateVarsLeadingUnderscore/file.sol b/toolchains/solidity/linter/core/solidhunter-lib/testdata/PrivateVarsLeadingUnderscore/file.sol index 550843ad..0b1198a3 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/testdata/PrivateVarsLeadingUnderscore/file.sol +++ b/toolchains/solidity/linter/core/solidhunter-lib/testdata/PrivateVarsLeadingUnderscore/file.sol @@ -6,4 +6,26 @@ contract Test { function thisIsPrivate() {} uint256 internal thisIsInternalVariable; uint256 thisIsInternalVariable; + + function _thisIsInternal() internal {} + function _thisIsPrivate() private {} + function _thisIsPrivate() {} + uint256 internal _thisIsInternalVariable; + uint256 _thisIsInternalVariable; + + function _thisIsInternal(uint test) internal {} + function _thisIsPrivate(uint test) private {} + function _thisIsPrivate(uint test) {} + + function _thisIsInternal(uint _test) internal {} + function _thisIsPrivate(uint _test) private {} + function _thisIsPrivate(uint _test) {} + + function _thisIsInternal() internal returns (uint256 bar) {} + function _thisIsPrivate() private returns (uint256 bar) {} + function _thisIsPrivate() returns (uint256 bar) {} + + function _thisIsInternal() internal returns (uint256 _bar) {} + function _thisIsPrivate() private returns (uint256 _bar) {} + function _thisIsPrivate() returns (uint256 _bar) {} } \ No newline at end of file diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/PrivateVarsLeadingUnderscore/findings.csv b/toolchains/solidity/linter/core/solidhunter-lib/testdata/PrivateVarsLeadingUnderscore/findings.csv index 0b21c0cb..7645d2e4 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/testdata/PrivateVarsLeadingUnderscore/findings.csv +++ b/toolchains/solidity/linter/core/solidhunter-lib/testdata/PrivateVarsLeadingUnderscore/findings.csv @@ -2,4 +2,10 @@ private-vars-leading-underscore:4:13:4:27 private-vars-leading-underscore:5:13:5:26 private-vars-leading-underscore:6:13:6:26 private-vars-leading-underscore:7:21:7:43 -private-vars-leading-underscore:8:12:8:34 \ No newline at end of file +private-vars-leading-underscore:8:12:8:34 +private-vars-leading-underscore:16:34:16:38 +private-vars-leading-underscore:17:33:17:37 +private-vars-leading-underscore:18:33:18:37 +private-vars-leading-underscore:24:57:24:60 +private-vars-leading-underscore:25:55:25:58 +private-vars-leading-underscore:26:47:26:50 \ No newline at end of file From a1ab58588adc9ba25d65bb853f146ae2dd71889a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A9o=20Maringer?= Date: Fri, 6 Oct 2023 17:03:01 +0100 Subject: [PATCH 225/325] feat(solidity/linter/core): delete removeme file --- remove-me-d4af0ddaab9f436b93b3.txt | 1 - 1 file changed, 1 deletion(-) delete mode 100644 remove-me-d4af0ddaab9f436b93b3.txt diff --git a/remove-me-d4af0ddaab9f436b93b3.txt b/remove-me-d4af0ddaab9f436b93b3.txt deleted file mode 100644 index 80bf8e65..00000000 --- a/remove-me-d4af0ddaab9f436b93b3.txt +++ /dev/null @@ -1 +0,0 @@ -d4af0ddaab9f436b93b3 From b4da7b9bea96f726c62ddd39e448bc524673609a Mon Sep 17 00:00:00 2001 From: 0xSwapFeeder Date: Mon, 9 Oct 2023 16:26:39 -0400 Subject: [PATCH 226/325] fix(solidity/linter/core): fixed tests with new config format --- .../src/rules/best_practises/explicit_types.rs | 15 +++++++++++++-- .../core/solidhunter-lib/src/rules/naming/mod.rs | 1 + 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/explicit_types.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/explicit_types.rs index 979f1b18..521e4f3c 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/explicit_types.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/explicit_types.rs @@ -2,6 +2,7 @@ use crate::linter::SolidFile; use crate::rules::types::*; use crate::types::*; use ast_extractor::*; +use serde_json::Value; pub const RULE_ID: &str = "explicit-types"; @@ -100,8 +101,18 @@ impl RuleType for ExplicitTypes { impl ExplicitTypes { pub(crate) fn create(data: RuleEntry) -> Box { + let mut value; + if !data.data.is_empty(){ + value = match &data.data[0] { + Value::String(val) => val.as_str(), + _ => DEFAULT_RULE, + } + } + else { + value = DEFAULT_RULE; + } let rule = ExplicitTypes { - rule: data.data[0].clone(), + rule: value.to_string(), data, }; Box::new(rule) @@ -111,7 +122,7 @@ impl ExplicitTypes { RuleEntry { id: RULE_ID.to_string(), severity: Severity::WARNING, - data: vec![DEFAULT_RULE.to_string()], + data: vec![serde_json::Value::String(DEFAULT_RULE.to_string())], } } } diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/mod.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/mod.rs index bff6df0b..ea7ce3c9 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/mod.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/mod.rs @@ -26,6 +26,7 @@ pub(crate) mod named_parameters_mapping; pub(crate) mod use_forbidden_name; pub(crate) mod var_name_mixedcase; pub(crate) mod foundry_func_name; +pub(crate) mod private_vars_leading_underscore; // List all rules From de513d0a4bcf85684b0f0e23fa298c45d18b01c6 Mon Sep 17 00:00:00 2001 From: 0xSwapFeeder Date: Mon, 9 Oct 2023 17:02:06 -0400 Subject: [PATCH 227/325] fix(solidity/lint/core): fixed lint and compile issues --- libs/ast-extractor/src/extract.rs | 1 - libs/ast-extractor/src/retriever.rs | 2 +- libs/ast-extractor/src/retriever/expr_call.rs | 2 +- libs/ast-extractor/src/retriever/finder.rs | 289 ++++++++++++------ .../src/retriever/finder/find_node.rs | 46 +-- libs/ast-extractor/src/retriever/stmts.rs | 4 +- libs/lsp-server-wrapper/src/client.rs | 92 +++--- libs/lsp-server-wrapper/src/jsonrpc.rs | 2 +- libs/lsp-server-wrapper/src/jsonrpc/error.rs | 6 +- libs/lsp-server-wrapper/src/lib.rs | 28 +- libs/lsp-server-wrapper/src/server.rs | 62 ++-- libs/lsp-server-wrapper/src/service.rs | 181 +++++------ libs/lsp-server-wrapper/src/service/state.rs | 2 +- .../rules/best_practises/explicit_types.rs | 12 +- .../src/rules/best_practises/reason_string.rs | 4 +- .../src/rules/naming/foundry_func_name.rs | 26 +- .../src/rules/naming/func_visibility.rs | 4 +- .../solidhunter-lib/src/rules/naming/mod.rs | 8 +- .../naming/private_vars_leading_underscore.rs | 59 ++-- .../src/rules/order/ordering.rs | 76 ++--- .../core/solidhunter-lib/tests/linter.rs | 2 +- 21 files changed, 542 insertions(+), 366 deletions(-) diff --git a/libs/ast-extractor/src/extract.rs b/libs/ast-extractor/src/extract.rs index e51cd39a..0b88575d 100644 --- a/libs/ast-extractor/src/extract.rs +++ b/libs/ast-extractor/src/extract.rs @@ -13,7 +13,6 @@ pub fn extract_ast_from_content(content: &str) -> Result { - ($pos.line == $start.line && $pos.char >= $start.column && $start.line != $end.line) || - ($pos.line == $end.line && $pos.char <= $end.column && $start.line != $end.line) || - ($pos.line == $start.line && $pos.line == $end.line && $pos.char >= $start.column && $pos.char <= $end.column) || - ($pos.line > $start.line && $pos.line < $end.line) + ($pos.line == $start.line && $pos.char >= $start.column && $start.line != $end.line) + || ($pos.line == $end.line && $pos.char <= $end.column && $start.line != $end.line) + || ($pos.line == $start.line + && $pos.line == $end.line + && $pos.char >= $start.column + && $pos.char <= $end.column) + || ($pos.line > $start.line && $pos.line < $end.line) }; } @@ -29,16 +30,10 @@ pub struct Position { impl Position { pub fn new(line: usize, char: usize) -> Self { - Self { - line, - char, - } + Self { line, char } } - } - - struct FinderVisitor { current_contract: Option, current_function: Option, @@ -54,9 +49,7 @@ struct FinderVisitor { to_find: Position, } - impl FinderVisitor { - pub fn new(pos: Position) -> Self { Self { current_contract: None, @@ -76,10 +69,17 @@ impl FinderVisitor { fn check_inheritance_matching(&mut self, contract: &ItemContract) -> bool { if let Some(inheritance) = &contract.inheritance { - if is_in_range!(inheritance.span().start(), inheritance.span().end(), self.to_find) { + if is_in_range!( + inheritance.span().start(), + inheritance.span().end(), + self.to_find + ) { for inherit in &inheritance.inheritance { if is_in_range!(inherit.span().start(), inherit.span().end(), self.to_find) { - self.found = Some(FoundNode::ContractDefInheritance(contract.clone(), inherit.clone())); + self.found = Some(FoundNode::ContractDefInheritance( + contract.clone(), + inherit.clone(), + )); return true; } } @@ -106,11 +106,18 @@ impl<'ast> Visit<'ast> for FinderVisitor { } } - fn visit_expr_call(&mut self, call: &'ast ExprCall) { if is_in_range!(call.span().start(), call.span().end(), self.to_find) { - if !is_in_range!(call.args.span().start(), call.args.span().end(), self.to_find) { - self.found = Some(FoundNode::IdentUsageCall(self.current_contract.clone(), self.current_function.clone(), call.clone())); + if !is_in_range!( + call.args.span().start(), + call.args.span().end(), + self.to_find + ) { + self.found = Some(FoundNode::IdentUsageCall( + self.current_contract.clone(), + self.current_function.clone(), + call.clone(), + )); } visit::visit_expr_call(self, call); } @@ -120,14 +127,23 @@ impl<'ast> Visit<'ast> for FinderVisitor { // Therefore we can not goto or list_ref any variable used in a new expr fn visit_expr_new(&mut self, new: &'ast ExprNew) { if is_in_range!(new.ty.span().start(), new.ty.span().end(), self.to_find) { - self.found = Some(FoundNode::ContractInstantiation(self.current_contract.clone().unwrap(), self.current_function.clone(), new.clone())); + self.found = Some(FoundNode::ContractInstantiation( + self.current_contract.clone().unwrap(), + self.current_function.clone(), + new.clone(), + )); } } fn visit_type(&mut self, ty: &'ast Type) { println!("type: {:?}", ty); if is_in_range!(ty.span().start(), ty.span().end(), self.to_find) { - self.found = Some(FoundNode::TypeUsage(self.current_contract.clone(), self.current_function.clone(), self.current_expr.clone(), ty.clone())); + self.found = Some(FoundNode::TypeUsage( + self.current_contract.clone(), + self.current_function.clone(), + self.current_expr.clone(), + ty.clone(), + )); visit::visit_type(self, ty); } } @@ -138,16 +154,24 @@ impl<'ast> Visit<'ast> for FinderVisitor { let _s = var.name.span().start(); let _e = var.name.span().end(); if is_in_range!(var.name.span().start(), var.name.span().end(), self.to_find) { - self.found = Some(FoundNode::VariableDefName(self.current_contract.clone(), self.current_function.clone(), var.clone(), var.name.clone())); - return; + self.found = Some(FoundNode::VariableDefName( + self.current_contract.clone(), + self.current_function.clone(), + var.clone(), + var.name.clone(), + )); + return; } visit_variable_declaration(self, var); } - } fn visit_stmt_var_decl(&mut self, stmt_var_decl: &'ast StmtVarDecl) { - if is_in_range!(stmt_var_decl.span().start(), stmt_var_decl.span().end(), self.to_find) { + if is_in_range!( + stmt_var_decl.span().start(), + stmt_var_decl.span().end(), + self.to_find + ) { visit::visit_stmt_var_decl(self, stmt_var_decl); } } @@ -157,9 +181,16 @@ impl<'ast> Visit<'ast> for FinderVisitor { self.current_property = Some(var.clone()); if is_in_range!(var.name.span().start(), var.name.span().end(), self.to_find) { if self.current_contract.is_none() { - self.found = Some(FoundNode::ConstantVariableDefName(var.clone(), var.name.clone())) + self.found = Some(FoundNode::ConstantVariableDefName( + var.clone(), + var.name.clone(), + )) } else { - self.found = Some(FoundNode::PropertyDefName(self.current_contract.clone().unwrap(),var.clone(), var.name.clone())); + self.found = Some(FoundNode::PropertyDefName( + self.current_contract.clone().unwrap(), + var.clone(), + var.name.clone(), + )); } return; } @@ -175,7 +206,11 @@ impl<'ast> Visit<'ast> for FinderVisitor { self.found = Some(FoundNode::ContractDefName(contract.clone())); } self.check_inheritance_matching(contract); - if is_in_range!(contract.brace_token.span().start(), contract.brace_token.span().end(), self.to_find) { + if is_in_range!( + contract.brace_token.span().start(), + contract.brace_token.span().end(), + self.to_find + ) { visit::visit_item_contract(self, contract); } self.current_contract = None; @@ -183,13 +218,30 @@ impl<'ast> Visit<'ast> for FinderVisitor { fn visit_item_enum(&mut self, enumm: &'ast ItemEnum) { self.current_enum = Some(enumm.clone()); - if is_in_range!(enumm.name.span().start(), enumm.name.span().end(), self.to_find) { - self.found = Some(FoundNode::EnumDefName(self.current_contract.clone(),enumm.clone(), enumm.name.clone())); + if is_in_range!( + enumm.name.span().start(), + enumm.name.span().end(), + self.to_find + ) { + self.found = Some(FoundNode::EnumDefName( + self.current_contract.clone(), + enumm.clone(), + enumm.name.clone(), + )); return; } for variant in &enumm.variants { - if is_in_range!(variant.ident.span().start(), variant.ident.span().end(), self.to_find) { - self.found = Some(FoundNode::EnumDefValue(self.current_contract.clone(), enumm.clone(), variant.clone(), variant.ident.clone())); + if is_in_range!( + variant.ident.span().start(), + variant.ident.span().end(), + self.to_find + ) { + self.found = Some(FoundNode::EnumDefValue( + self.current_contract.clone(), + enumm.clone(), + variant.clone(), + variant.ident.clone(), + )); return; } } @@ -199,30 +251,61 @@ impl<'ast> Visit<'ast> for FinderVisitor { fn visit_item_error(&mut self, error: &'ast ItemError) { self.current_error = Some(error.clone()); - if is_in_range!(error.name.span().start(), error.name.span().end(), self.to_find) { - self.found = Some(FoundNode::ErrorDefName(self.current_contract.clone(), error.clone(), error.name.clone())); + if is_in_range!( + error.name.span().start(), + error.name.span().end(), + self.to_find + ) { + self.found = Some(FoundNode::ErrorDefName( + self.current_contract.clone(), + error.clone(), + error.name.clone(), + )); return; } for param in &error.parameters { - if is_in_range!(param.name.span().start(), param.name.span().end(), self.to_find) { - self.found = Some(FoundNode::ErrorDefParameter(self.current_contract.clone(), error.clone(), param.clone())); + if is_in_range!( + param.name.span().start(), + param.name.span().end(), + self.to_find + ) { + self.found = Some(FoundNode::ErrorDefParameter( + self.current_contract.clone(), + error.clone(), + param.clone(), + )); return; } } visit::visit_item_error(self, error); self.current_error = None; - } fn visit_item_event(&mut self, event: &'ast ItemEvent) { self.current_event = Some(event.clone()); - if is_in_range!(event.name.span().start(), event.name.span().end(), self.to_find) { - self.found = Some(FoundNode::EventDefName(self.current_contract.clone().unwrap(), event.clone(), event.name.clone())); + if is_in_range!( + event.name.span().start(), + event.name.span().end(), + self.to_find + ) { + self.found = Some(FoundNode::EventDefName( + self.current_contract.clone().unwrap(), + event.clone(), + event.name.clone(), + )); return; } for param in &event.parameters { - if is_in_range!(param.name.span().start(), param.name.span().end(), self.to_find) { - self.found = Some(FoundNode::EventDefParameter(self.current_contract.clone().unwrap(), event.clone(), param.clone())); + if is_in_range!( + param.name.span().start(), + param.name.span().end(), + self.to_find + ) { + self.found = Some(FoundNode::EventDefParameter( + self.current_contract.clone().unwrap(), + event.clone(), + param.clone(), + )); return; } } @@ -232,15 +315,35 @@ impl<'ast> Visit<'ast> for FinderVisitor { fn visit_item_function(&mut self, function: &'ast ItemFunction) { self.current_function = Some(function.clone()); - if is_in_range!(function.name.span().start(), function.name.span().end(), self.to_find) { - self.found = Some(FoundNode::FunctionDefName(self.current_contract.clone().unwrap(), function.clone())); + if is_in_range!( + function.name.span().start(), + function.name.span().end(), + self.to_find + ) { + self.found = Some(FoundNode::FunctionDefName( + self.current_contract.clone().unwrap(), + function.clone(), + )); return; } - if is_in_range!(function.arguments.span().start(), function.arguments.span().end(), self.to_find) { + if is_in_range!( + function.arguments.span().start(), + function.arguments.span().end(), + self.to_find + ) { for param in &function.arguments { - if is_in_range!(param.name.span().start(), param.name.span().end(), self.to_find) { - self.found = Some(FoundNode::FunctionDefParameterName(self.current_contract.clone().unwrap(), function.clone(), param.clone(), param.name.clone())); + if is_in_range!( + param.name.span().start(), + param.name.span().end(), + self.to_find + ) { + self.found = Some(FoundNode::FunctionDefParameterName( + self.current_contract.clone().unwrap(), + function.clone(), + param.clone(), + param.name.clone(), + )); break; } } @@ -261,20 +364,44 @@ impl<'ast> Visit<'ast> for FinderVisitor { return; } if is_in_range!(ident.span().start(), ident.span().end(), self.to_find) { - self.found = Some(FoundNode::IdentUsageName(self.current_contract.clone(), self.current_function.clone(), self.current_expr.clone(), ident.clone())); + self.found = Some(FoundNode::IdentUsageName( + self.current_contract.clone(), + self.current_function.clone(), + self.current_expr.clone(), + ident.clone(), + )); } } fn visit_item_struct(&mut self, strukt: &'ast ItemStruct) { self.current_struct = Some(strukt.clone()); - if is_in_range!(strukt.name.span().start(), strukt.name.span().end(), self.to_find) { - self.found = Some(FoundNode::StructDefName(self.current_contract.clone(), strukt.name.clone())); + if is_in_range!( + strukt.name.span().start(), + strukt.name.span().end(), + self.to_find + ) { + self.found = Some(FoundNode::StructDefName( + self.current_contract.clone(), + strukt.name.clone(), + )); return; } - if is_in_range!(strukt.brace_token.span().start(), strukt.brace_token.span().end(), self.to_find) { + if is_in_range!( + strukt.brace_token.span().start(), + strukt.brace_token.span().end(), + self.to_find + ) { for field in &strukt.fields { - if is_in_range!(field.name.span().start(), field.name.span().end(), self.to_find) { - self.found = Some(FoundNode::StructDefPropertyName( self.current_contract.clone(), field.clone(), field.name.clone())); + if is_in_range!( + field.name.span().start(), + field.name.span().end(), + self.to_find + ) { + self.found = Some(FoundNode::StructDefPropertyName( + self.current_contract.clone(), + field.clone(), + field.name.clone(), + )); return; } } @@ -282,27 +409,23 @@ impl<'ast> Visit<'ast> for FinderVisitor { } self.current_struct = None; } - } - pub fn retrieve_node_from_position(ast: &File, pos: Position) -> Option { let mut visitor = FinderVisitor::new(pos); visitor.visit_file(ast); visitor.found } - #[cfg(test)] mod tests { + use proc_macro2::TokenStream; use std::fs; use std::path::PathBuf; - use proc_macro2::TokenStream; use super::*; use std::str::FromStr; - #[test] fn test_retrieve_contract_def_name() { let mut path = PathBuf::from(env!("CARGO_MANIFEST_DIR")); @@ -371,7 +494,7 @@ mod tests { let tokens = TokenStream::from_str(source.as_str()).unwrap(); let ast = parse2(tokens).unwrap(); let res = retrieve_node_from_position(&ast, Position::new(15, 22)); - + if let Some(FoundNode::ContractInstantiation(_contract, _func, expr)) = res { if let Type::Custom(sol_path) = &expr.ty { assert_eq!(sol_path.to_string(), "One"); @@ -505,7 +628,6 @@ mod tests { } } - #[test] fn test_retrieve_type_string() { let mut path = PathBuf::from(env!("CARGO_MANIFEST_DIR")); @@ -518,7 +640,7 @@ mod tests { let tokens = TokenStream::from_str(source.as_str()).unwrap(); let ast = parse2(tokens).unwrap(); let res = retrieve_node_from_position(&ast, Position::new(4, 10)); - if let Some(FoundNode::TypeUsage(_,_,_,Type::String(_))) = res { + if let Some(FoundNode::TypeUsage(_, _, _, Type::String(_))) = res { } else { panic!() } @@ -559,7 +681,7 @@ mod tests { let tokens = TokenStream::from_str(source.as_str()).unwrap(); let ast = parse2(tokens).unwrap(); let res = retrieve_node_from_position(&ast, Position::new(13, 12)); - if let Some(FoundNode::TypeUsage(_,_,_expr, Type::Custom(ident))) = res { + if let Some(FoundNode::TypeUsage(_, _, _expr, Type::Custom(ident))) = res { assert_eq!(ident.to_string(), "another_one"); } else { panic!() @@ -578,8 +700,8 @@ mod tests { let tokens = TokenStream::from_str(source.as_str()).unwrap(); let ast = parse2(tokens).unwrap(); let res = retrieve_node_from_position(&ast, Position::new(7, 42)); - - if let Some(FoundNode::TypeUsage(_,_,_expr, Type::Uint(_,_))) = res { + + if let Some(FoundNode::TypeUsage(_, _, _expr, Type::Uint(_, _))) = res { } else { panic!() } @@ -637,7 +759,7 @@ mod tests { let tokens = TokenStream::from_str(source.as_str()).unwrap(); let ast = parse2(tokens).unwrap(); let res = retrieve_node_from_position(&ast, Position::new(8, 18)); - + if let Some(FoundNode::StructDefPropertyName(contract, _var, Some(ident))) = res { assert!(contract.is_some()); assert_eq!(ident.to_string(), "storedData1"); @@ -658,7 +780,7 @@ mod tests { let tokens = TokenStream::from_str(source.as_str()).unwrap(); let ast = parse2(tokens).unwrap(); let res = retrieve_node_from_position(&ast, Position::new(2, 17)); - + if let Some(FoundNode::StructDefPropertyName(contract, _var, Some(ident))) = res { assert!(contract.is_none()); assert_eq!(ident.to_string(), "storedData1"); @@ -679,7 +801,7 @@ mod tests { let tokens = TokenStream::from_str(source.as_str()).unwrap(); let ast = parse2(tokens).unwrap(); let res = retrieve_node_from_position(&ast, Position::new(12, 14)); - + if let Some(FoundNode::EnumDefName(contract, _ennum, ident)) = res { assert!(contract.is_some()); assert_eq!(ident.to_string(), "another_one"); @@ -700,7 +822,7 @@ mod tests { let tokens = TokenStream::from_str(source.as_str()).unwrap(); let ast = parse2(tokens).unwrap(); let res = retrieve_node_from_position(&ast, Position::new(14, 12)); - + if let Some(FoundNode::EnumDefValue(contract, _ennum, _variant, ident)) = res { assert!(contract.is_some()); assert_eq!(ident.to_string(), "Tuesday"); @@ -721,7 +843,7 @@ mod tests { let tokens = TokenStream::from_str(source.as_str()).unwrap(); let ast = parse2(tokens).unwrap(); let res = retrieve_node_from_position(&ast, Position::new(1, 8)); - + if let Some(FoundNode::EnumDefName(contract, _ennum, ident)) = res { assert!(contract.is_none()); assert_eq!(ident.to_string(), "one"); @@ -742,7 +864,7 @@ mod tests { let tokens = TokenStream::from_str(source.as_str()).unwrap(); let ast = parse2(tokens).unwrap(); let res = retrieve_node_from_position(&ast, Position::new(3, 8)); - + if let Some(FoundNode::EnumDefValue(contract, _ennum, _variant, ident)) = res { assert!(contract.is_none()); assert_eq!(ident.to_string(), "Tuesday"); @@ -763,7 +885,7 @@ mod tests { let tokens = TokenStream::from_str(source.as_str()).unwrap(); let ast = parse2(tokens).unwrap(); let res = retrieve_node_from_position(&ast, Position::new(1, 8)); - + if let Some(FoundNode::ErrorDefName(contract, _err, ident)) = res { assert!(contract.is_none()); assert_eq!(ident.to_string(), "one"); @@ -784,7 +906,7 @@ mod tests { let tokens = TokenStream::from_str(source.as_str()).unwrap(); let ast = parse2(tokens).unwrap(); let res = retrieve_node_from_position(&ast, Position::new(4, 16)); - + if let Some(FoundNode::ErrorDefName(contract, _err, ident)) = res { assert!(contract.is_some()); assert_eq!(ident.to_string(), "another_one"); @@ -805,7 +927,7 @@ mod tests { let tokens = TokenStream::from_str(source.as_str()).unwrap(); let ast = parse2(tokens).unwrap(); let res = retrieve_node_from_position(&ast, Position::new(4, 33)); - + if let Some(FoundNode::ErrorDefParameter(contract, _err, ident)) = res { assert!(contract.is_some()); if let Some(name) = &ident.name { @@ -830,13 +952,12 @@ mod tests { let tokens = TokenStream::from_str(source.as_str()).unwrap(); let ast = parse2(tokens).unwrap(); let res = retrieve_node_from_position(&ast, Position::new(1, 21)); - + if let Some(FoundNode::ErrorDefParameter(contract, _err, ident)) = res { assert!(contract.is_none()); if let Some(name) = &ident.name { assert_eq!(name.to_string(), "val1"); - } - else { + } else { panic!() } } else { @@ -856,8 +977,8 @@ mod tests { let tokens = TokenStream::from_str(source.as_str()).unwrap(); let ast = parse2(tokens).unwrap(); let res = retrieve_node_from_position(&ast, Position::new(4, 16)); - - if let Some(FoundNode::EventDefName(_contract, _err, ident) ) = res { + + if let Some(FoundNode::EventDefName(_contract, _err, ident)) = res { assert_eq!(ident.to_string(), "another_one"); } else { panic!() @@ -888,7 +1009,6 @@ mod tests { } } - #[test] fn test_retrieve_prop_usage_on_assign() { let mut path = PathBuf::from(env!("CARGO_MANIFEST_DIR")); @@ -901,7 +1021,7 @@ mod tests { let tokens = TokenStream::from_str(source.as_str()).unwrap(); let ast = parse2(tokens).unwrap(); let res = retrieve_node_from_position(&ast, Position::new(5, 14)); - + if let Some(FoundNode::IdentUsageName(_contract, _func, _expr, ident)) = res { assert_eq!(ident.to_string(), "storedData"); } else { @@ -921,8 +1041,8 @@ mod tests { let tokens = TokenStream::from_str(source.as_str()).unwrap(); let ast = parse2(tokens).unwrap(); let res = retrieve_node_from_position(&ast, Position::new(9, 22)); - - if let Some(FoundNode::IdentUsageName(_contract, _func, _expr, ident) ) = res { + + if let Some(FoundNode::IdentUsageName(_contract, _func, _expr, ident)) = res { assert_eq!(ident.to_string(), "storedData"); } else { panic!() @@ -941,12 +1061,11 @@ mod tests { let tokens = TokenStream::from_str(source.as_str()).unwrap(); let ast = parse2(tokens).unwrap(); let res = retrieve_node_from_position(&ast, Position::new(5, 22)); - + if let Some(FoundNode::IdentUsageName(_contract, _func, _expr, ident)) = res { assert_eq!(ident.to_string(), "x"); } else { panic!() } } - } diff --git a/libs/ast-extractor/src/retriever/finder/find_node.rs b/libs/ast-extractor/src/retriever/finder/find_node.rs index 83878f1e..9a137c41 100644 --- a/libs/ast-extractor/src/retriever/finder/find_node.rs +++ b/libs/ast-extractor/src/retriever/finder/find_node.rs @@ -1,11 +1,12 @@ - /** * find_node.rs * Enum for all possible ast types that can be found * author: 0xMemoryGrinder */ - -use syn_solidity::{ExprNew, ItemContract, ItemEnum, ItemFunction, VariableDeclaration, ExprCall, SolIdent, VariableDefinition, Type, Expr, Variant, ItemEvent, ItemError, Modifier, EventParameter}; +use syn_solidity::{ + EventParameter, Expr, ExprCall, ExprNew, ItemContract, ItemEnum, ItemError, ItemEvent, + ItemFunction, Modifier, SolIdent, Type, VariableDeclaration, VariableDefinition, Variant, +}; #[derive(Debug)] pub enum FoundNode { @@ -14,21 +15,39 @@ pub enum FoundNode { ContractDefInheritance(ItemContract, Modifier), ContractInstantiation(ItemContract, Option, ExprNew), - // Functions FunctionDefName(ItemContract, ItemFunction), - FunctionDefParameterName(ItemContract, ItemFunction, VariableDeclaration, Option), + FunctionDefParameterName( + ItemContract, + ItemFunction, + VariableDeclaration, + Option, + ), // Properties/Variables/Constants PropertyDefName(ItemContract, VariableDefinition, SolIdent), ConstantVariableDefName(VariableDefinition, SolIdent), - VariableDefName(Option, Option, VariableDeclaration, Option), + VariableDefName( + Option, + Option, + VariableDeclaration, + Option, + ), // Types and Identifiers - TypeUsage(Option, Option, Option, Type), + TypeUsage( + Option, + Option, + Option, + Type, + ), IdentUsageCall(Option, Option, ExprCall), - IdentUsageName(Option, Option, Option, SolIdent), - + IdentUsageName( + Option, + Option, + Option, + SolIdent, + ), // Structs StructDefName(Option, SolIdent), @@ -42,13 +61,9 @@ pub enum FoundNode { ErrorDefName(Option, ItemError, SolIdent), ErrorDefParameter(Option, ItemError, VariableDeclaration), - - // Events EventDefName(ItemContract, ItemEvent, SolIdent), EventDefParameter(ItemContract, ItemEvent, EventParameter), - - // Contracts //ContractScope(ItemContract, Option, SolPath), @@ -65,15 +80,12 @@ pub enum FoundNode { //StructUsageName(ItemContract, Option, Expr, Type), //StructUsageProperty(ItemContract, Option, Expr, SolIdent, Type), - // Errors //ErrorUsageName(ItemContract, Option, ExprCall, SolIdent), - // Events //EventUsageName(ItemContract, Option, Expr, SolIdent), - //TODO type cast // TODO super ast node -} \ No newline at end of file +} diff --git a/libs/ast-extractor/src/retriever/stmts.rs b/libs/ast-extractor/src/retriever/stmts.rs index b4310a53..508e4a9a 100644 --- a/libs/ast-extractor/src/retriever/stmts.rs +++ b/libs/ast-extractor/src/retriever/stmts.rs @@ -11,9 +11,7 @@ struct SmtsVisitor { impl SmtsVisitor { pub fn new() -> Self { - Self { - stmts: Vec::new(), - } + Self { stmts: Vec::new() } } } diff --git a/libs/lsp-server-wrapper/src/client.rs b/libs/lsp-server-wrapper/src/client.rs index 4450f384..a593f9ef 100644 --- a/libs/lsp-server-wrapper/src/client.rs +++ b/libs/lsp-server-wrapper/src/client.rs @@ -1,19 +1,19 @@ -use std::cell::RefCell; +use crate::jsonrpc::{self}; +use lsp_server::{Message, RequestId}; use lsp_types::notification::*; use lsp_types::request::*; use lsp_types::*; -use crate::jsonrpc::{self,}; -use std::fmt::Display; -use std::rc::Weak; -use lsp_server::{Message, RequestId}; use serde::Serialize; use serde_json::Value; +use std::cell::RefCell; +use std::fmt::Display; +use std::rc::Weak; use tracing::error; use crate::server::LspServer; #[derive(Clone)] - pub(crate) struct ClientInner { +pub(crate) struct ClientInner { server: Option>, id: RefCell, } @@ -60,10 +60,7 @@ impl Client { /// immediately return `Err` with JSON-RPC error code `-32002` ([read more]). /// /// [read more]: https://microsoft.github.io/language-server-protocol/specification#initialize - pub fn register_capability( - &self, - registrations: Vec, - ) -> jsonrpc::Result<()> { + pub fn register_capability(&self, registrations: Vec) -> jsonrpc::Result<()> { self.send_request::(RegistrationParams { registrations }) } @@ -311,12 +308,7 @@ impl Client { /// # Initialization /// /// This notification will only be sent if the server is initialized. - pub fn publish_diagnostics( - &self, - uri: Url, - diags: Vec, - version: Option, - ) { + pub fn publish_diagnostics(&self, uri: Url, diags: Vec, version: Option) { self.send_notification::(PublishDiagnosticsParams::new( uri, diags, version, )); @@ -345,10 +337,7 @@ impl Client { /// # Compatibility /// /// This request was introduced in specification version 3.6.0. - pub fn configuration( - &self, - items: Vec, - ) -> jsonrpc::Result> { + pub fn configuration(&self, items: Vec) -> jsonrpc::Result> { self.send_request::(ConfigurationParams { items }) } @@ -388,10 +377,7 @@ impl Client { /// immediately return `Err` with JSON-RPC error code `-32002` ([read more]). /// /// [read more]: https://microsoft.github.io/language-server-protocol/specification#initialize - pub fn apply_edit( - &self, - edit: WorkspaceEdit, - ) -> jsonrpc::Result { + pub fn apply_edit(&self, edit: WorkspaceEdit) -> jsonrpc::Result { self.send_request::(ApplyWorkspaceEditParams { edit, label: None }) } @@ -401,31 +387,37 @@ impl Client { /// /// This notification will only be sent if the server is initialized. pub fn send_notification(&self, params: N::Params) - where - N: lsp_types::notification::Notification, + where + N: lsp_types::notification::Notification, { let server_opt = self.inner.server.clone().unwrap().upgrade(); if server_opt.is_none() { eprintln!("Cannot send request, server is not initialized"); return; } - server_opt.unwrap().send(Message::Notification( - lsp_server::Notification::new(N::METHOD.to_string(), params), - )); + server_opt + .unwrap() + .send(Message::Notification(lsp_server::Notification::new( + N::METHOD.to_string(), + params, + ))); } fn send_notification_unchecked(&self, params: N::Params) - where - N: lsp_types::notification::Notification, + where + N: lsp_types::notification::Notification, { let server_opt = self.inner.server.clone().unwrap().upgrade(); if server_opt.is_none() { eprintln!("Cannot send request, server is not initialized"); return; } - server_opt.unwrap().send(Message::Notification( - lsp_server::Notification::new(N::METHOD.to_string(), params), - )); + server_opt + .unwrap() + .send(Message::Notification(lsp_server::Notification::new( + N::METHOD.to_string(), + params, + ))); } /// Sends a custom request to the client. @@ -437,32 +429,41 @@ impl Client { /// /// [read more]: https://microsoft.github.io/language-server-protocol/specification#initialize pub fn send_request(&self, params: R::Params) -> jsonrpc::Result - where - R: lsp_types::request::Request, + where + R: lsp_types::request::Request, { let server_opt = self.inner.server.clone().unwrap().upgrade(); if server_opt.is_none() { eprintln!("Cannot send request, server is not initialized"); return Err(jsonrpc::not_initialized_error()); } - server_opt.as_ref().unwrap().send(Message::Request( - lsp_server::Request::new(RequestId::from(self.next_request_id().to_string()), R::METHOD.to_string(), params), - )); + server_opt + .as_ref() + .unwrap() + .send(Message::Request(lsp_server::Request::new( + RequestId::from(self.next_request_id().to_string()), + R::METHOD.to_string(), + params, + ))); Err(jsonrpc::not_initialized_error()) } fn send_request_unchecked(&self, params: R::Params) -> jsonrpc::Result - where - R: lsp_types::request::Request, + where + R: lsp_types::request::Request, { let server_opt = self.inner.server.clone().unwrap().upgrade(); if server_opt.is_none() { eprintln!("Cannot send request, server is not initialized"); return Err(jsonrpc::not_initialized_error()); } - server_opt.unwrap().send(Message::Request( - lsp_server::Request::new(RequestId::from(self.next_request_id().to_string()), R::METHOD.to_string(), params), - )); + server_opt + .unwrap() + .send(Message::Request(lsp_server::Request::new( + RequestId::from(self.next_request_id().to_string()), + R::METHOD.to_string(), + params, + ))); Err(jsonrpc::not_initialized_error()) } } @@ -477,5 +478,4 @@ impl Client { } id } - -} \ No newline at end of file +} diff --git a/libs/lsp-server-wrapper/src/jsonrpc.rs b/libs/lsp-server-wrapper/src/jsonrpc.rs index a00465f3..664d6868 100644 --- a/libs/lsp-server-wrapper/src/jsonrpc.rs +++ b/libs/lsp-server-wrapper/src/jsonrpc.rs @@ -1,4 +1,4 @@ mod error; pub(crate) use self::error::not_initialized_error; -pub use self::error::{Error, ErrorCode, Result}; \ No newline at end of file +pub use self::error::{Error, ErrorCode, Result}; diff --git a/libs/lsp-server-wrapper/src/jsonrpc/error.rs b/libs/lsp-server-wrapper/src/jsonrpc/error.rs index 80e6eb25..4ce7358e 100644 --- a/libs/lsp-server-wrapper/src/jsonrpc/error.rs +++ b/libs/lsp-server-wrapper/src/jsonrpc/error.rs @@ -139,8 +139,8 @@ impl Error { /// Creates a new "invalid params" error (`-32602`). pub fn invalid_params(message: M) -> Self - where - M: Into>, + where + M: Into>, { Error { code: ErrorCode::InvalidParams, @@ -214,4 +214,4 @@ mod tests { let deserialized: ErrorCode = serde_json::from_str("-12345").unwrap(); assert_eq!(deserialized, ErrorCode::ServerError(-12345)); } -} \ No newline at end of file +} diff --git a/libs/lsp-server-wrapper/src/lib.rs b/libs/lsp-server-wrapper/src/lib.rs index 6d7f3682..493d6b5d 100644 --- a/libs/lsp-server-wrapper/src/lib.rs +++ b/libs/lsp-server-wrapper/src/lib.rs @@ -1,17 +1,17 @@ -mod server; mod client; mod jsonrpc; +mod server; mod service; +pub use crate::jsonrpc::{Error, Result}; +pub use client::Client; pub use lsp_types; -use lsp_types::*; use lsp_types::request::{ GotoDeclarationParams, GotoDeclarationResponse, GotoImplementationParams, GotoImplementationResponse, GotoTypeDefinitionParams, GotoTypeDefinitionResponse, }; -pub use crate::jsonrpc::{Error, Result}; +use lsp_types::*; use serde_json::Value; -pub use client::Client; pub use server::LspStdioServer; pub use service::LspService; @@ -497,10 +497,7 @@ pub trait LanguageServer { /// /// This request was introduced in specification version 3.15.0. - fn selection_range( - &self, - params: SelectionRangeParams, - ) -> Result>> { + fn selection_range(&self, params: SelectionRangeParams) -> Result>> { let _ = params; eprintln!("Got a textDocument/selectionRange request, but it is not implemented"); Err(Error::method_not_found()) @@ -570,7 +567,9 @@ pub trait LanguageServer { params: SemanticTokensDeltaParams, ) -> Result> { let _ = params; - eprintln!("Got a textDocument/semanticTokens/full/delta request, but it is not implemented"); + eprintln!( + "Got a textDocument/semanticTokens/full/delta request, but it is not implemented" + ); Err(Error::method_not_found()) } @@ -1038,10 +1037,7 @@ pub trait LanguageServer { /// Servers can only use this new model if clients advertise support for it via the /// `workspace.symbol.resolve_support` capability. - fn symbol( - &self, - params: WorkspaceSymbolParams, - ) -> Result>> { + fn symbol(&self, params: WorkspaceSymbolParams) -> Result>> { let _ = params; eprintln!("Got a workspace/symbol request, but it is not implemented"); Err(Error::method_not_found()) @@ -1090,7 +1086,9 @@ pub trait LanguageServer { fn did_change_workspace_folders(&self, params: DidChangeWorkspaceFoldersParams) { let _ = params; - eprintln!("Got a workspace/didChangeWorkspaceFolders notification, but it is not implemented"); + eprintln!( + "Got a workspace/didChangeWorkspaceFolders notification, but it is not implemented" + ); } /// The [`workspace/willCreateFiles`] request is sent from the client to the server before @@ -1214,4 +1212,4 @@ pub trait LanguageServer { // TODO: Add `work_done_progress_cancel()` here (since 3.15.0) when supported by `tower-lsp`. // https://github.com/ebkalderon/tower-lsp/issues/176 -} \ No newline at end of file +} diff --git a/libs/lsp-server-wrapper/src/server.rs b/libs/lsp-server-wrapper/src/server.rs index 3e7dcdc4..1a7b118b 100644 --- a/libs/lsp-server-wrapper/src/server.rs +++ b/libs/lsp-server-wrapper/src/server.rs @@ -3,9 +3,9 @@ use std::error::Error; use std::rc::{Rc, Weak}; -use lsp_server::{Connection, IoThreads, Message, Response}; -use crate::{Client, LanguageServer}; use crate::service::LspService; +use crate::{Client, LanguageServer}; +use lsp_server::{Connection, IoThreads, Message, Response}; pub(crate) trait LspServer { fn send(&self, msg: Message); @@ -15,7 +15,7 @@ struct InnerLspStdioServer { connection: Connection, io_threads: IoThreads, client: Rc>, - self_ref: Weak + self_ref: Weak, } pub struct LspStdioServer { @@ -31,14 +31,15 @@ impl<'a> LspStdioServer { connection, io_threads, client, - self_ref: me.clone() - } + self_ref: me.clone(), + }, }) } - - - fn run_initialization(&self, service: &LspService) -> Result<(), Box> { + fn run_initialization( + &self, + service: &LspService, + ) -> Result<(), Box> { let (initialize_id, initialize_params) = self.inner.connection.initialize_start()?; let res = service.call_request("initialize", initialize_params)?; let res = match res { @@ -49,29 +50,39 @@ impl<'a> LspStdioServer { let resp = Response::new_ok(initialize_id, res); self.inner.connection.sender.send(resp.into()).unwrap(); match &self.inner.connection.receiver.recv() { - Ok(Message::Notification(n)) => { - service.call_notification(&n.method, n.params.clone()).map_err(|e| { + Ok(Message::Notification(n)) => service + .call_notification(&n.method, n.params.clone()) + .map_err(|e| { eprintln!("Error: {}", e); e - }) - } + }), Ok(msg) => { - return Err(format!(r#"expected initialized notification, got: {msg:?}"#).to_owned().into()); + return Err( + format!(r#"expected initialized notification, got: {msg:?}"#) + .to_owned() + .into(), + ); } Err(e) => { - return Err(format!("expected initialized notification, got error: {e}",).to_owned().into()) + return Err( + format!("expected initialized notification, got error: {e}",) + .to_owned() + .into(), + ) } }?; Ok(()) - } pub fn serve(this: Rc, init: F) -> Result<(), Box> - where - F: FnOnce(Rc>) -> S + 'a, + where + F: FnOnce(Rc>) -> S + 'a, { - this.inner.client.borrow_mut().set_server(this.inner.self_ref.clone()); + this.inner + .client + .borrow_mut() + .set_server(this.inner.self_ref.clone()); let client = this.inner.client.clone(); let service = LspService::new(client, init); this.run_initialization(&service)?; @@ -90,7 +101,7 @@ impl<'a> LspStdioServer { Ok(is_shutdown) => is_shutdown, Err(e) => { eprintln!("Handle shutdown Error: {}", e); - continue + continue; } }; let result = service.call_request(&req.method, req.params); @@ -98,10 +109,14 @@ impl<'a> LspStdioServer { Ok(result) => result, Err(e) => { eprintln!("Call request Error: {}", e); - continue + continue; } }; - let resp = Response { id, result, error: None }; + let resp = Response { + id, + result, + error: None, + }; if is_shutdown { eprintln!("Shutting down"); return Ok(()); @@ -134,10 +149,5 @@ impl LspServer for LspStdioServer { let _ = self.inner.connection.sender.send(msg).map_err(|e| { eprintln!("Error: {}", e); }); - } } - - - - diff --git a/libs/lsp-server-wrapper/src/service.rs b/libs/lsp-server-wrapper/src/service.rs index 4e300403..10bb8b62 100644 --- a/libs/lsp-server-wrapper/src/service.rs +++ b/libs/lsp-server-wrapper/src/service.rs @@ -1,16 +1,16 @@ mod state; +pub(crate) use self::state::{ServerState, State}; +pub use crate::client::Client; +use crate::{jsonrpc, LanguageServer}; +use lsp_types::request::*; +use lsp_types::*; use std::cell::RefCell; use std::error::Error; use std::rc::Rc; use std::sync::Arc; -use lsp_types::*; -use lsp_types::request::*; -pub use crate::client::Client; -use crate::{jsonrpc, LanguageServer}; -pub(crate) use self::state::{ServerState, State}; - pub(super) struct InnerService { +pub(super) struct InnerService { backend: Arc, //pub(super) client: Arc>, } @@ -22,8 +22,8 @@ pub struct LspService { impl LspService { pub fn new(client: Rc>, init: F) -> Self - where - F: FnOnce(Rc>) -> S, + where + F: FnOnce(Rc>) -> S, { let backend = init(client); LspService { @@ -34,284 +34,295 @@ impl LspService { } } - pub fn call_request(&self, method: &str, params: serde_json::Value) -> Result, Box> { + pub fn call_request( + &self, + method: &str, + params: serde_json::Value, + ) -> Result, Box> { let ret = match method { "initialize" => { self.state.set(State::Initializing); let params: InitializeParams = serde_json::from_value(params).unwrap(); serde_json::to_value(self.inner.backend.initialize(params)?) - }, + } "shutdown" => { self.state.set(State::ShutDown); serde_json::to_value(self.inner.backend.shutdown()?) - }, + } "textDocument/willSaveWaitUntil" => { let params: WillSaveTextDocumentParams = serde_json::from_value(params).unwrap(); serde_json::to_value(self.inner.backend.will_save_wait_until(params)?) - }, + } "textDocument/declaration" => { let params: GotoDeclarationParams = serde_json::from_value(params).unwrap(); serde_json::to_value(self.inner.backend.goto_declaration(params)?) - }, + } "textDocument/definition" => { let params: GotoDefinitionParams = serde_json::from_value(params).unwrap(); serde_json::to_value(self.inner.backend.goto_definition(params)?) - }, + } "textDocument/typeDefinition" => { let params: GotoTypeDefinitionParams = serde_json::from_value(params).unwrap(); serde_json::to_value(self.inner.backend.goto_type_definition(params)?) - }, + } "textDocument/implementation" => { let params: GotoImplementationParams = serde_json::from_value(params).unwrap(); serde_json::to_value(self.inner.backend.goto_implementation(params)?) - }, + } "textDocument/references" => { let params: ReferenceParams = serde_json::from_value(params).unwrap(); serde_json::to_value(self.inner.backend.references(params)?) - }, + } "textDocument/prepareCallHierarchy" => { let params: CallHierarchyPrepareParams = serde_json::from_value(params).unwrap(); serde_json::to_value(self.inner.backend.prepare_call_hierarchy(params)?) - }, + } "textDocument/incomingCalls" => { - let params: CallHierarchyIncomingCallsParams = serde_json::from_value(params).unwrap(); + let params: CallHierarchyIncomingCallsParams = + serde_json::from_value(params).unwrap(); serde_json::to_value(self.inner.backend.incoming_calls(params)?) - }, + } "textDocument/outgoingCalls" => { - let params: CallHierarchyOutgoingCallsParams = serde_json::from_value(params).unwrap(); + let params: CallHierarchyOutgoingCallsParams = + serde_json::from_value(params).unwrap(); serde_json::to_value(self.inner.backend.outgoing_calls(params)?) - }, + } "textDocument/prepareTypeHierarchy" => { let params: TypeHierarchyPrepareParams = serde_json::from_value(params).unwrap(); serde_json::to_value(self.inner.backend.prepare_type_hierarchy(params)?) - }, + } "textDocument/supertypes" => { let params: TypeHierarchySupertypesParams = serde_json::from_value(params).unwrap(); serde_json::to_value(self.inner.backend.supertypes(params)?) - }, + } "textDocument/subtypes" => { let params: TypeHierarchySubtypesParams = serde_json::from_value(params).unwrap(); serde_json::to_value(self.inner.backend.subtypes(params)?) - }, + } "textDocument/documentHighlight" => { let params: DocumentHighlightParams = serde_json::from_value(params).unwrap(); serde_json::to_value(self.inner.backend.document_highlight(params)?) - }, + } "textDocument/documentLink" => { let params: DocumentLinkParams = serde_json::from_value(params).unwrap(); serde_json::to_value(self.inner.backend.document_link(params)?) - }, + } "documentLink/resolve" => { let params: DocumentLink = serde_json::from_value(params).unwrap(); serde_json::to_value(self.inner.backend.document_link_resolve(params)?) - }, + } "textDocument/hover" => { let params: HoverParams = serde_json::from_value(params).unwrap(); serde_json::to_value(self.inner.backend.hover(params)?) - }, + } "textDocument/codeLens" => { let params: CodeLensParams = serde_json::from_value(params).unwrap(); serde_json::to_value(self.inner.backend.code_lens(params)?) - }, + } "codeLens/resolve" => { let params: CodeLens = serde_json::from_value(params).unwrap(); serde_json::to_value(self.inner.backend.code_lens_resolve(params)?) - }, + } "textDocument/foldingRange" => { let params: FoldingRangeParams = serde_json::from_value(params).unwrap(); serde_json::to_value(self.inner.backend.folding_range(params)?) - }, + } "textDocument/selectionRange" => { let params: SelectionRangeParams = serde_json::from_value(params).unwrap(); serde_json::to_value(self.inner.backend.selection_range(params)?) - }, + } "textDocument/documentSymbol" => { let params: DocumentSymbolParams = serde_json::from_value(params).unwrap(); serde_json::to_value(self.inner.backend.document_symbol(params)?) - }, + } "textDocument/sementicTokens/full" => { let params: SemanticTokensParams = serde_json::from_value(params).unwrap(); serde_json::to_value(self.inner.backend.semantic_tokens_full(params)?) - }, + } "textDocument/sementicTokens/full/delta" => { let params: SemanticTokensDeltaParams = serde_json::from_value(params).unwrap(); serde_json::to_value(self.inner.backend.semantic_tokens_full_delta(params)?) - }, + } "textDocument/sementicTokens/range" => { let params: SemanticTokensRangeParams = serde_json::from_value(params).unwrap(); serde_json::to_value(self.inner.backend.semantic_tokens_range(params)?) - }, + } "textDocument/inlineValue" => { let params: InlineValueParams = serde_json::from_value(params).unwrap(); serde_json::to_value(self.inner.backend.inline_value(params)?) - }, + } "textDocument/inlayHint" => { let params: InlayHintParams = serde_json::from_value(params).unwrap(); serde_json::to_value(self.inner.backend.inlay_hint(params)?) - }, + } "inlayHint/resolve" => { let params: InlayHint = serde_json::from_value(params).unwrap(); serde_json::to_value(self.inner.backend.inlay_hint_resolve(params)?) - }, + } "textDocument/moniker" => { let params: MonikerParams = serde_json::from_value(params).unwrap(); serde_json::to_value(self.inner.backend.moniker(params)?) - }, + } "textDocument/completion" => { let params: CompletionParams = serde_json::from_value(params).unwrap(); serde_json::to_value(self.inner.backend.completion(params)?) - }, + } "completionItem/resolve" => { let params: CompletionItem = serde_json::from_value(params).unwrap(); serde_json::to_value(self.inner.backend.completion_resolve(params)?) - }, + } "textDocument/diagnostic" => { let params: DocumentDiagnosticParams = serde_json::from_value(params).unwrap(); serde_json::to_value(self.inner.backend.diagnostic(params)?) - }, + } "workspace/diagnostic" => { let params: WorkspaceDiagnosticParams = serde_json::from_value(params).unwrap(); serde_json::to_value(self.inner.backend.workspace_diagnostic(params)?) - }, + } "textDocument/signatureHelp" => { let params: SignatureHelpParams = serde_json::from_value(params).unwrap(); serde_json::to_value(self.inner.backend.signature_help(params)?) - }, + } "textDocument/codeAction" => { let params: CodeActionParams = serde_json::from_value(params).unwrap(); serde_json::to_value(self.inner.backend.code_action(params)?) - }, + } "codeAction/resolve" => { let params: CodeAction = serde_json::from_value(params).unwrap(); serde_json::to_value(self.inner.backend.code_action_resolve(params)?) - }, + } "textDocument/documentColor" => { let params: DocumentColorParams = serde_json::from_value(params).unwrap(); serde_json::to_value(self.inner.backend.document_color(params)?) - }, + } "textDocument/colorPresentation" => { let params: ColorPresentationParams = serde_json::from_value(params).unwrap(); serde_json::to_value(self.inner.backend.color_presentation(params)?) - }, + } "textDocument/formatting" => { let params: DocumentFormattingParams = serde_json::from_value(params).unwrap(); serde_json::to_value(self.inner.backend.formatting(params)?) - }, + } "textDocument/rangeFormatting" => { let params: DocumentRangeFormattingParams = serde_json::from_value(params).unwrap(); serde_json::to_value(self.inner.backend.range_formatting(params)?) - }, + } "textDocument/onTypeFormatting" => { - let params: DocumentOnTypeFormattingParams = serde_json::from_value(params).unwrap(); + let params: DocumentOnTypeFormattingParams = + serde_json::from_value(params).unwrap(); serde_json::to_value(self.inner.backend.on_type_formatting(params)?) - }, + } "textDocument/rename" => { let params: RenameParams = serde_json::from_value(params).unwrap(); serde_json::to_value(self.inner.backend.rename(params)?) - }, + } "textDocument/prepareRename" => { let params: TextDocumentPositionParams = serde_json::from_value(params).unwrap(); serde_json::to_value(self.inner.backend.prepare_rename(params)?) - }, + } "textDocument/linkedEditingRange" => { let params: LinkedEditingRangeParams = serde_json::from_value(params).unwrap(); serde_json::to_value(self.inner.backend.linked_editing_range(params)?) - }, + } "workspace/symbol" => { let params: WorkspaceSymbolParams = serde_json::from_value(params).unwrap(); serde_json::to_value(self.inner.backend.symbol(params)?) - }, + } "workspaceSymbol/resolve" => { let params: WorkspaceSymbol = serde_json::from_value(params).unwrap(); serde_json::to_value(self.inner.backend.symbol_resolve(params)?) - }, + } "workspace/willCreateFiles" => { let params: CreateFilesParams = serde_json::from_value(params).unwrap(); serde_json::to_value(self.inner.backend.will_create_files(params)?) - }, + } "workspace/willRenameFiles" => { let params: RenameFilesParams = serde_json::from_value(params).unwrap(); serde_json::to_value(self.inner.backend.will_rename_files(params)?) - }, + } "workspace/willDeleteFiles" => { let params: DeleteFilesParams = serde_json::from_value(params).unwrap(); serde_json::to_value(self.inner.backend.will_delete_files(params)?) - }, + } "workspace/executeCommand" => { let params: ExecuteCommandParams = serde_json::from_value(params).unwrap(); serde_json::to_value(self.inner.backend.execute_command(params)?) - }, + } "exit" => { self.state.set(State::Exited); return Ok(None); - }, + } _ => { return Err(Box::new(jsonrpc::Error::method_not_found()).into()); } - }.map_err( - |e| { - eprintln!("Error: {}", e); - Box::new(e) - } - )?; + } + .map_err(|e| { + eprintln!("Error: {}", e); + Box::new(e) + })?; Ok(Some(ret)) } - pub fn call_notification(&self, method: &str, params: serde_json::Value) -> Result<(), Box> { + pub fn call_notification( + &self, + method: &str, + params: serde_json::Value, + ) -> Result<(), Box> { match method { "initialized" => { self.state.set(State::Initialized); let params: InitializedParams = serde_json::from_value(params).unwrap(); self.inner.backend.initialized(params); - }, + } "textDocument/didOpen" => { let params: DidOpenTextDocumentParams = serde_json::from_value(params).unwrap(); self.inner.backend.did_open(params); - }, + } "textDocument/didChange" => { let params: DidChangeTextDocumentParams = serde_json::from_value(params).unwrap(); self.inner.backend.did_change(params); - }, + } "textDocument/willSave" => { let params: WillSaveTextDocumentParams = serde_json::from_value(params).unwrap(); self.inner.backend.will_save(params); - }, + } "textDocument/didSave" => { let params: DidSaveTextDocumentParams = serde_json::from_value(params).unwrap(); self.inner.backend.did_save(params); - }, + } "textDocument/didClose" => { let params: DidCloseTextDocumentParams = serde_json::from_value(params).unwrap(); self.inner.backend.did_close(params); - }, + } "workspace/didChangeConfiguration" => { let params: DidChangeConfigurationParams = serde_json::from_value(params).unwrap(); self.inner.backend.did_change_configuration(params); - }, + } "workspace/didChangeWorkspaceFolders" => { - let params: DidChangeWorkspaceFoldersParams = serde_json::from_value(params).unwrap(); + let params: DidChangeWorkspaceFoldersParams = + serde_json::from_value(params).unwrap(); self.inner.backend.did_change_workspace_folders(params); - }, + } "workspace/didCreateFiles" => { let params: CreateFilesParams = serde_json::from_value(params).unwrap(); self.inner.backend.did_create_files(params) - }, + } "workspace/didRenameFiles" => { let params: RenameFilesParams = serde_json::from_value(params).unwrap(); self.inner.backend.did_rename_files(params) - }, + } "workspace/didDeleteFiles" => { let params: DeleteFilesParams = serde_json::from_value(params).unwrap(); self.inner.backend.did_delete_files(params) - }, + } "workspace/didChangeWatchedFiles" => { let params: DidChangeWatchedFilesParams = serde_json::from_value(params).unwrap(); self.inner.backend.did_change_watched_files(params) - }, + } _ => { return Err("Method not found".to_owned().into()); } } Ok(()) } -} \ No newline at end of file +} diff --git a/libs/lsp-server-wrapper/src/service/state.rs b/libs/lsp-server-wrapper/src/service/state.rs index c4ede1f7..e404e8d5 100644 --- a/libs/lsp-server-wrapper/src/service/state.rs +++ b/libs/lsp-server-wrapper/src/service/state.rs @@ -47,4 +47,4 @@ impl Debug for ServerState { fn fmt(&self, f: &mut Formatter) -> fmt::Result { self.get().fmt(f) } -} \ No newline at end of file +} diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/explicit_types.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/explicit_types.rs index 521e4f3c..4831ffdb 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/explicit_types.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/explicit_types.rs @@ -101,16 +101,14 @@ impl RuleType for ExplicitTypes { impl ExplicitTypes { pub(crate) fn create(data: RuleEntry) -> Box { - let mut value; - if !data.data.is_empty(){ - value = match &data.data[0] { + let value = if !data.data.is_empty() { + match &data.data[0] { Value::String(val) => val.as_str(), _ => DEFAULT_RULE, } - } - else { - value = DEFAULT_RULE; - } + } else { + DEFAULT_RULE + }; let rule = ExplicitTypes { rule: value.to_string(), data, diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/reason_string.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/reason_string.rs index bd4bd485..0277f480 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/reason_string.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/reason_string.rs @@ -70,10 +70,10 @@ impl RuleType for ReasonString { false } }) { - if let Expr::Lit(ast_extractor::Lit::Str(lit_str)) = expr_string { + if let Expr::Lit(Lit::Str(lit_str)) = expr_string { let actual_string = lit_str.values[0].token().to_string(); - if actual_string.len() > self.max_length as usize { + if actual_string.len() > self.max_length { let location = ( lit_str.values[0].span().start(), lit_str.values[0].span().end(), diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/foundry_func_name.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/foundry_func_name.rs index dab6458b..24905d4a 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/foundry_func_name.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/foundry_func_name.rs @@ -1,4 +1,5 @@ use ast_extractor::Spanned; +use serde_json::Value; use crate::linter::SolidFile; use crate::rules::types::*; @@ -46,22 +47,29 @@ impl RuleType for FoundryFuncName { return vec![]; } let mut res = Vec::new(); - let re = regex::Regex::new(r"^test(Fork)?(Fuzz)?(Fail)?(_)?(Revert(If_|When_){1})?\w{1,}$").unwrap(); + let re = regex::Regex::new(r"^test(Fork)?(Fuzz)?(Fail)?(_)?(Revert(If_|When_){1})?\w{1,}$") + .unwrap(); let contracts = ast_extractor::retriever::retrieve_contract_nodes(&file.data); for contract in contracts { for function in ast_extractor::retriever::retrieve_functions_nodes(&contract) { - let visibility = function.attributes.iter().find(|attr| matches!(attr, ast_extractor::FunctionAttribute::Visibility(_))); + let visibility = function + .attributes + .iter() + .find(|attr| matches!(attr, ast_extractor::FunctionAttribute::Visibility(_))); let visibility = match visibility { Some(ast_extractor::FunctionAttribute::Visibility(visibility)) => visibility, _ => continue, }; - if !matches!(visibility, ast_extractor::Visibility::Public(_)) && !matches!(visibility, ast_extractor::Visibility::External(_)) { + if !matches!(visibility, ast_extractor::Visibility::Public(_)) + && !matches!(visibility, ast_extractor::Visibility::External(_)) + { continue; } if let Some(name) = function.name { - if !re.is_match(&name.as_string()) && !self.excluded.contains(&name.as_string()) { + if !re.is_match(&name.as_string()) && !self.excluded.contains(&name.as_string()) + { let span = name.span(); res.push(self.create_diag((span.start(), span.end()), file)); } @@ -74,7 +82,15 @@ impl RuleType for FoundryFuncName { impl FoundryFuncName { pub(crate) fn create(data: RuleEntry) -> Box { - let rule = FoundryFuncName { excluded: data.data.clone(), data }; + let mut excluded: Vec = Vec::new(); + data.data.iter().for_each(|value| { + if let Value::String(val) = value { + excluded.push(val.to_string()); + } else { + eprintln!("Invalid value for rule foundry-func-name: {:?}", value); + } + }); + let rule = FoundryFuncName { excluded, data }; Box::new(rule) } diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/func_visibility.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/func_visibility.rs index 60691461..25ee9491 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/func_visibility.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/func_visibility.rs @@ -93,8 +93,8 @@ impl FuncVisibility { id: RULE_ID.to_string(), severity: Severity::WARNING, data: vec![serde_json::json!({ - "strict": DEFAULT_IGNORE_CONSTRUCTORS, - }),], + "strict": DEFAULT_IGNORE_CONSTRUCTORS, + })], } } } diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/mod.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/mod.rs index ea7ce3c9..fbe1f0e1 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/mod.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/mod.rs @@ -1,32 +1,32 @@ use crate::rules::naming::const_name_snakecase::ConstNameSnakeCase; use crate::rules::naming::contract_name_pascalcase::ContractNamePascalCase; use crate::rules::naming::event_name_camelcase::EventNameCamelCase; +use crate::rules::naming::foundry_func_name::FoundryFuncName; use crate::rules::naming::func_name_camelcase::FuncNameCamelCase; use crate::rules::naming::func_param_name_camelcase::FuncParamNameCamelcase; use crate::rules::naming::func_visibility::FuncVisibility; use crate::rules::naming::modifier_name_mixedcase::ModifierNameMixedcase; use crate::rules::naming::named_parameters_mapping::NamedParametersMapping; +use crate::rules::naming::private_vars_leading_underscore::PrivateVarsLeadingUnderscore; use crate::rules::naming::use_forbidden_name::UseForbiddenName; use crate::rules::naming::var_name_mixedcase::VarNameMixedCase; -use crate::rules::naming::foundry_func_name::FoundryFuncName; use crate::rules::types::{RuleEntry, RulesMap}; use crate::rules::RuleBuilder; use std::collections::HashMap; -use crate::rules::naming::private_vars_leading_underscore::PrivateVarsLeadingUnderscore; #[macro_use] pub(crate) mod func_param_name_camelcase; pub(crate) mod const_name_snakecase; pub(crate) mod contract_name_pascalcase; pub(crate) mod event_name_camelcase; +pub(crate) mod foundry_func_name; pub(crate) mod func_name_camelcase; pub(crate) mod func_visibility; pub(crate) mod modifier_name_mixedcase; pub(crate) mod named_parameters_mapping; +pub(crate) mod private_vars_leading_underscore; pub(crate) mod use_forbidden_name; pub(crate) mod var_name_mixedcase; -pub(crate) mod foundry_func_name; -pub(crate) mod private_vars_leading_underscore; // List all rules diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/private_vars_leading_underscore.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/private_vars_leading_underscore.rs index 3e775247..5e61a67b 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/private_vars_leading_underscore.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/private_vars_leading_underscore.rs @@ -1,5 +1,5 @@ -use ast_extractor::{Item, Spanned}; use ast_extractor::Visibility::{Internal, Private}; +use ast_extractor::{Item, Spanned}; use crate::linter::SolidFile; use crate::rules::types::*; @@ -61,7 +61,11 @@ impl RuleType for PrivateVarsLeadingUnderscore { if !leading_underscore { let span = name.span(); - res.push(self.create_diag((span.start(), span.end()), file, MESSAGE_PRIVATE.to_string())); + res.push(self.create_diag( + (span.start(), span.end()), + file, + MESSAGE_PRIVATE.to_string(), + )); } } } @@ -73,7 +77,11 @@ impl RuleType for PrivateVarsLeadingUnderscore { if !leading_underscore { let span = name.span(); - res.push(self.create_diag((span.start(), span.end()), file, MESSAGE_PRIVATE.to_string())); + res.push(self.create_diag( + (span.start(), span.end()), + file, + MESSAGE_PRIVATE.to_string(), + )); } } } @@ -81,11 +89,7 @@ impl RuleType for PrivateVarsLeadingUnderscore { } let is_private = match function.attributes.visibility() { - Some(val) => match val { - Private(_) => true, - Internal(_) => true, - _ => false, - }, + Some(val) => matches!(val, Private(_) | Internal(_)), None => true, }; @@ -94,12 +98,19 @@ impl RuleType for PrivateVarsLeadingUnderscore { if !leading_underscore && is_private { let span = name.span(); - res.push(self.create_diag((span.start(), span.end()), file, MESSAGE_PRIVATE.to_string())); + res.push(self.create_diag( + (span.start(), span.end()), + file, + MESSAGE_PRIVATE.to_string(), + )); } - if leading_underscore && !is_private { let span = name.span(); - res.push(self.create_diag((span.start(), span.end()), file, MESSAGE_PUBLIC.to_string())); + res.push(self.create_diag( + (span.start(), span.end()), + file, + MESSAGE_PUBLIC.to_string(), + )); } } } @@ -107,11 +118,7 @@ impl RuleType for PrivateVarsLeadingUnderscore { for node_var in contract.body.iter() { if let Item::Variable(var) = node_var { let is_private = match var.attributes.visibility() { - Some(val) => match val { - Private(_) => true, - Internal(_) => true, - _ => false, - }, + Some(val) => matches!(val, Private(_) | Internal(_)), None => true, }; @@ -119,11 +126,19 @@ impl RuleType for PrivateVarsLeadingUnderscore { if !leading_underscore && is_private { let span = var.name.span(); - res.push(self.create_diag((span.start(), span.end()), file, MESSAGE_PRIVATE.to_string())); + res.push(self.create_diag( + (span.start(), span.end()), + file, + MESSAGE_PRIVATE.to_string(), + )); } if leading_underscore && !is_private { let span = var.name.span(); - res.push(self.create_diag((span.start(), span.end()), file, MESSAGE_PRIVATE.to_string())); + res.push(self.create_diag( + (span.start(), span.end()), + file, + MESSAGE_PUBLIC.to_string(), + )); } } } @@ -157,11 +172,9 @@ impl PrivateVarsLeadingUnderscore { RuleEntry { id: RULE_ID.to_string(), severity: Severity::WARNING, - data: vec![ - serde_json::json!({ - "strict": DEFAULT_STRICT, - }), - ], + data: vec![serde_json::json!({ + "strict": DEFAULT_STRICT, + })], } } } diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/order/ordering.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/order/ordering.rs index c4a67c95..4517e381 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/order/ordering.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/order/ordering.rs @@ -1,6 +1,6 @@ use std::collections::HashMap; -use ast_extractor::{Spanned, Visit, visit, FunctionKind, Visibility}; +use ast_extractor::{visit, FunctionKind, Spanned, Visibility, Visit}; use crate::linter::SolidFile; use crate::rules::types::*; @@ -27,11 +27,7 @@ impl OrderingVisitor { (FileItemType::Import, vec![None, Some(FileItemType::Pragma)]), ( FileItemType::Enum, - vec![ - None, - Some(FileItemType::Pragma), - Some(FileItemType::Import), - ], + vec![None, Some(FileItemType::Pragma), Some(FileItemType::Import)], ), ( FileItemType::Struct, @@ -75,9 +71,10 @@ impl OrderingVisitor { Some(FileItemType::ContractLibrary), ], ), - ].iter() - .cloned() - .collect(); + ] + .iter() + .cloned() + .collect(); let authorized_contract_items: HashMap>> = [ (ContractItemType::Udt, vec![None]), @@ -87,7 +84,11 @@ impl OrderingVisitor { ), ( ContractItemType::Enum, - vec![None, Some(ContractItemType::Udt), Some(ContractItemType::Struct)], + vec![ + None, + Some(ContractItemType::Udt), + Some(ContractItemType::Struct), + ], ), ( ContractItemType::Property, @@ -224,9 +225,10 @@ impl OrderingVisitor { Some(ContractItemType::InternalFunction), ], ), - ].iter() - .cloned() - .collect(); + ] + .iter() + .cloned() + .collect(); OrderingVisitor { file, data, @@ -268,7 +270,7 @@ impl OrderingVisitor { fn is_authorized_file_item(&self, item: FileItemType) -> bool { if let Some(authorized_items) = self.authorized_file_items.get(&item) { - let res = authorized_items.contains(&self.file_current_item); + let res = authorized_items.contains(&self.file_current_item); return res; } true @@ -320,9 +322,12 @@ impl<'ast> Visit<'ast> for OrderingVisitor { } fn visit_item_contract(&mut self, contract_def: &'ast ast_extractor::ItemContract) { - if contract_def.is_interface() && !self.is_authorized_file_item(FileItemType::ContractInterface) || - contract_def.is_library() && !self.is_authorized_file_item(FileItemType::ContractLibrary) || - !self.is_authorized_file_item(FileItemType::Contract) { + if contract_def.is_interface() + && !self.is_authorized_file_item(FileItemType::ContractInterface) + || contract_def.is_library() + && !self.is_authorized_file_item(FileItemType::ContractLibrary) + || !self.is_authorized_file_item(FileItemType::Contract) + { let location = (contract_def.span().start(), contract_def.span().end()); self.reports.push(self.create_diag(&self.file, location)); } else { @@ -334,7 +339,7 @@ impl<'ast> Visit<'ast> for OrderingVisitor { self.inside_contract = false; } - fn visit_item_udt(&mut self,udt: &'ast ast_extractor::ItemUdt) { + fn visit_item_udt(&mut self, udt: &'ast ast_extractor::ItemUdt) { if !self.is_authorized_contract_item(ContractItemType::Udt) { let location = (udt.span().start(), udt.span().end()); self.reports.push(self.create_diag(&self.file, location)); @@ -343,7 +348,7 @@ impl<'ast> Visit<'ast> for OrderingVisitor { } } - fn visit_variable_definition(&mut self,var: &'ast ast_extractor::VariableDefinition) { + fn visit_variable_definition(&mut self, var: &'ast ast_extractor::VariableDefinition) { if !self.is_authorized_contract_item(ContractItemType::Property) { let location = (var.span().start(), var.span().end()); self.reports.push(self.create_diag(&self.file, location)); @@ -352,7 +357,7 @@ impl<'ast> Visit<'ast> for OrderingVisitor { } } - fn visit_item_event(&mut self,event: &'ast ast_extractor::ItemEvent) { + fn visit_item_event(&mut self, event: &'ast ast_extractor::ItemEvent) { if !self.is_authorized_contract_item(ContractItemType::Event) { let location = (event.span().start(), event.span().end()); self.reports.push(self.create_diag(&self.file, location)); @@ -361,8 +366,7 @@ impl<'ast> Visit<'ast> for OrderingVisitor { } } - fn visit_item_function(&mut self,function: &'ast ast_extractor::ItemFunction) { - + fn visit_item_function(&mut self, function: &'ast ast_extractor::ItemFunction) { match function.kind { FunctionKind::Modifier(_) => { if !self.is_authorized_contract_item(ContractItemType::Modifier) { @@ -371,7 +375,7 @@ impl<'ast> Visit<'ast> for OrderingVisitor { } else { self.contract_current_item = Some(ContractItemType::Modifier); } - }, + } FunctionKind::Constructor(_) => { if !self.is_authorized_contract_item(ContractItemType::Constructor) { let location = (function.span().start(), function.span().end()); @@ -379,7 +383,7 @@ impl<'ast> Visit<'ast> for OrderingVisitor { } else { self.contract_current_item = Some(ContractItemType::Constructor); } - }, + } FunctionKind::Receive(_) => { if !self.is_authorized_contract_item(ContractItemType::Receive) { let location = (function.span().start(), function.span().end()); @@ -387,17 +391,20 @@ impl<'ast> Visit<'ast> for OrderingVisitor { } else { self.contract_current_item = Some(ContractItemType::Receive); } - }, + } FunctionKind::Fallback(_) => { if !self.is_authorized_contract_item(ContractItemType::FallBack) { let location = (function.span().start(), function.span().end()); self.reports.push(self.create_diag(&self.file, location)); } else { self.contract_current_item = Some(ContractItemType::FallBack); - } - }, + } + } FunctionKind::Function(_) => { - let visibility = function.attributes.iter().find(|attr| matches!(attr, ast_extractor::FunctionAttribute::Visibility(_))); + let visibility = function + .attributes + .iter() + .find(|attr| matches!(attr, ast_extractor::FunctionAttribute::Visibility(_))); let visibility = match visibility { Some(ast_extractor::FunctionAttribute::Visibility(visibility)) => visibility, _ => return, @@ -411,7 +418,7 @@ impl<'ast> Visit<'ast> for OrderingVisitor { } else { self.contract_current_item = Some(ContractItemType::ExternalFunction); } - }, + } Visibility::Public(_) => { if !self.is_authorized_contract_item(ContractItemType::PublicFunction) { let location = (function.span().start(), function.span().end()); @@ -419,7 +426,7 @@ impl<'ast> Visit<'ast> for OrderingVisitor { } else { self.contract_current_item = Some(ContractItemType::PublicFunction); } - }, + } Visibility::Internal(_) => { if !self.is_authorized_contract_item(ContractItemType::InternalFunction) { let location = (function.span().start(), function.span().end()); @@ -427,7 +434,7 @@ impl<'ast> Visit<'ast> for OrderingVisitor { } else { self.contract_current_item = Some(ContractItemType::InternalFunction); } - }, + } Visibility::Private(_) => { if !self.is_authorized_contract_item(ContractItemType::PrivateFunction) { let location = (function.span().start(), function.span().end()); @@ -435,14 +442,11 @@ impl<'ast> Visit<'ast> for OrderingVisitor { } else { self.contract_current_item = Some(ContractItemType::PrivateFunction); } - }, + } } - } } } - - } #[derive(Debug, Clone)] @@ -450,7 +454,6 @@ pub struct Ordering { data: RuleEntry, } - impl RuleType for Ordering { fn diagnose(&self, file: &SolidFile, _files: &[SolidFile]) -> Vec { let mut visitor = OrderingVisitor::new(file.clone(), self.data.clone()); @@ -501,4 +504,3 @@ enum ContractItemType { InternalFunction, PrivateFunction, } - diff --git a/toolchains/solidity/linter/core/solidhunter-lib/tests/linter.rs b/toolchains/solidity/linter/core/solidhunter-lib/tests/linter.rs index 5ee98f90..9eef7543 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/tests/linter.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/tests/linter.rs @@ -168,5 +168,5 @@ test_directories! { NotRelyOnTime, NamedParametersMapping, Ordering, - FoundryFunctionName + PrivateVarsLeadingUnderscore } From 8a3463b44bbff0b00ee6197ce5c5c977659d7454 Mon Sep 17 00:00:00 2001 From: 0xMemoryGrinder <35138272+0xMemoryGrinder@users.noreply.github.com> Date: Mon, 9 Oct 2023 17:23:15 -0400 Subject: [PATCH 228/325] chore: removed forgitten .idea files and added common patterns to .girignore --- .gitignore | 11 ++++++++++- libs/ast-extractor/.idea/.gitignore | 8 -------- libs/ast-extractor/.idea/vcs.xml | 6 ------ 3 files changed, 10 insertions(+), 15 deletions(-) delete mode 100644 libs/ast-extractor/.idea/.gitignore delete mode 100644 libs/ast-extractor/.idea/vcs.xml diff --git a/.gitignore b/.gitignore index 84cfd9fe..2922dac9 100644 --- a/.gitignore +++ b/.gitignore @@ -95,4 +95,13 @@ typings/ !.yarn/releases !.yarn/sdks !.yarn/versions -node_modules \ No newline at end of file +node_modules + +# intellij files +.idea + +# vscode files +.vscode + +# rust output files +target \ No newline at end of file diff --git a/libs/ast-extractor/.idea/.gitignore b/libs/ast-extractor/.idea/.gitignore deleted file mode 100644 index 13566b81..00000000 --- a/libs/ast-extractor/.idea/.gitignore +++ /dev/null @@ -1,8 +0,0 @@ -# Default ignored files -/shelf/ -/workspace.xml -# Editor-based HTTP Client requests -/httpRequests/ -# Datasource local storage ignored files -/dataSources/ -/dataSources.local.xml diff --git a/libs/ast-extractor/.idea/vcs.xml b/libs/ast-extractor/.idea/vcs.xml deleted file mode 100644 index b2bdec2d..00000000 --- a/libs/ast-extractor/.idea/vcs.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file From 1651d9f61c7af2493d25a3742d628ee8d5855190 Mon Sep 17 00:00:00 2001 From: Astrodevs CI Date: Mon, 9 Oct 2023 23:44:12 +0000 Subject: [PATCH 229/325] chore: create branch bug/169-first-release-bugs-staging --- remove-me-86c8b0d1aedf417b9e72.txt | 1 + 1 file changed, 1 insertion(+) create mode 100644 remove-me-86c8b0d1aedf417b9e72.txt diff --git a/remove-me-86c8b0d1aedf417b9e72.txt b/remove-me-86c8b0d1aedf417b9e72.txt new file mode 100644 index 00000000..07ef080c --- /dev/null +++ b/remove-me-86c8b0d1aedf417b9e72.txt @@ -0,0 +1 @@ +86c8b0d1aedf417b9e72 From 10634b8ac3913a3981e76e5cedbd30923676b1b9 Mon Sep 17 00:00:00 2001 From: 0xtekgrinder <0xtekgrinder@protonmail.com> Date: Mon, 9 Oct 2023 19:45:36 -0400 Subject: [PATCH 230/325] refactor(solidity/linter/core): remove println --- .../solidhunter-lib/src/rules/best_practises/global_import.rs | 1 - .../src/rules/best_practises/visibility_modifier_order.rs | 1 - 2 files changed, 2 deletions(-) diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/global_import.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/global_import.rs index 01d0cb52..0884b87a 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/global_import.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/global_import.rs @@ -29,7 +29,6 @@ impl RuleType for GlobalImport { source_file_content: _file.content.clone(), }); } - println!("res: {:?}", res); res } } diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/visibility_modifier_order.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/visibility_modifier_order.rs index 01d1fefb..38283c0d 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/visibility_modifier_order.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/visibility_modifier_order.rs @@ -30,7 +30,6 @@ impl RuleType for VisibilityModiferOrder { source_file_content: _file.content.clone(), }); } - println!("res {:?}", res); res } } From edba343d4c78074253b9501574c2cfa1851806db Mon Sep 17 00:00:00 2001 From: 0xtekgrinder <0xtekgrinder@protonmail.com> Date: Mon, 9 Oct 2023 19:57:54 -0400 Subject: [PATCH 231/325] fix(solidity/linter/core): payable fallback now only diag fallbacks functions --- .../src/rules/best_practises/payable_fallback.rs | 14 +++++++------- .../testdata/PayableFallback/file.sol | 6 ++++++ 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/payable_fallback.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/payable_fallback.rs index d7a157f8..28b08899 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/payable_fallback.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/payable_fallback.rs @@ -1,11 +1,10 @@ use ast_extractor::retriever::{retrieve_contract_nodes, retrieve_functions_nodes}; -use ast_extractor::{FunctionKind, ItemFunction, Mutability, Spanned}; +use ast_extractor::{ItemFunction, Mutability, Spanned}; use crate::linter::SolidFile; use crate::rules::types::*; use crate::types::*; -// const DEFAULT_SEVERITY: &str = "warn"; const DEFAULT_MESSAGE: &str = "Fallback should contains payable attributes"; pub const RULE_ID: &str = "payable-fallback"; @@ -14,9 +13,9 @@ pub struct PayableFallback { } impl RuleType for PayableFallback { - fn diagnose(&self, _file: &SolidFile, _files: &[SolidFile]) -> Vec { + fn diagnose(&self, file: &SolidFile, _files: &[SolidFile]) -> Vec { let mut res = Vec::new(); - let reports = check_fallback_payable(_file); + let reports = check_fallback_payable(file); for report in reports.into_iter().flatten() { res.push(LintDiag { @@ -26,8 +25,8 @@ impl RuleType for PayableFallback { code: None, source: None, message: DEFAULT_MESSAGE.to_string(), - uri: _file.path.clone(), - source_file_content: _file.content.clone(), + uri: file.path.clone(), + source_file_content: file.content.clone(), }); } res @@ -42,13 +41,14 @@ fn check_fallback_payable(file: &SolidFile) -> Vec> { let functions = retrieve_functions_nodes(&contract); for function in functions { - if FunctionKind::is_fallback(function.kind) || function.name.is_none() { + if function.kind.is_fallback() || (function.kind.is_function() && function.name.is_none()) { res = check_attribute(res, function); } } } res } + fn check_attribute(mut res: Vec>, function: ItemFunction) -> Vec> { let mut is_payable = false; for attributes in function.attributes.iter() { diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/PayableFallback/file.sol b/toolchains/solidity/linter/core/solidhunter-lib/testdata/PayableFallback/file.sol index 65db5175..13660a22 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/testdata/PayableFallback/file.sol +++ b/toolchains/solidity/linter/core/solidhunter-lib/testdata/PayableFallback/file.sol @@ -8,4 +8,10 @@ contract Test { function() public {} // Not Valid fallback() external {} // Not Valid + + receive() external payable {} // Valid + + function wow() public {} // Valid + + function wow() public payable {} // Valid } From 77bbaca3d3a2aa264abdbe13193367e033c153f4 Mon Sep 17 00:00:00 2001 From: 0xMemoryGrinder <35138272+0xMemoryGrinder@users.noreply.github.com> Date: Mon, 9 Oct 2023 20:13:20 -0400 Subject: [PATCH 232/325] fix(solidity/linter/core): fixed function-max-lines rule --- .../best_practises/function_max_lines.rs | 99 ++++++------------- .../linter/core/solidhunter-lib/src/types.rs | 2 +- .../FunctionMaxLines/.solidhunter.json | 7 -- .../testdata/FunctionMaxLines/file.sol | 28 ++++++ .../testdata/FunctionMaxLines/findings.csv | 2 +- 5 files changed, 62 insertions(+), 76 deletions(-) diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/function_max_lines.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/function_max_lines.rs index 09ed48af..3e9e7731 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/function_max_lines.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/function_max_lines.rs @@ -1,4 +1,4 @@ -use ast_extractor::Spanned; +use ast_extractor::{Spanned, FunctionBody}; use crate::linter::SolidFile; use crate::rules::types::*; @@ -20,20 +20,21 @@ impl RuleType for FunctionMaxLines { fn diagnose(&self, _file: &SolidFile, _files: &[SolidFile]) -> Vec { let mut res = Vec::new(); - let functions = get_all_functions_from_ast(&_file.data); - for function in functions { - let _report = check_function_lines(_file, &function, self.number_max_lines); - if let Some(report) = _report { - res.push(LintDiag { - id: RULE_ID.to_string(), - range: report, - severity: Some(Severity::WARNING), - code: None, - source: None, - message: DEFAULT_MESSAGE.to_string(), - uri: _file.path.clone(), - source_file_content: _file.content.clone(), - }); + for contract in ast_extractor::retriever::retrieve_contract_nodes(&_file.data) { + for function in ast_extractor::retriever::retrieve_functions_nodes(&contract) { + let report = check_function_lines(&function, self.number_max_lines); + if let Some(report) = report { + res.push(LintDiag { + id: RULE_ID.to_string(), + range: report, + severity: Some(Severity::WARNING), + code: None, + source: None, + message: DEFAULT_MESSAGE.to_string(), + uri: _file.path.clone(), + source_file_content: _file.content.clone(), + }); + } } } res @@ -42,63 +43,27 @@ impl RuleType for FunctionMaxLines { // returns a struct containing the line number of the start and end of the function if it is too long fn check_function_lines( - file: &SolidFile, function: &ast_extractor::ItemFunction, nb_max_line: usize, ) -> Option { - let mut res: Option = None; - let start_span = function.span().start(); - let index = crate::rules::utils::absolute_index_from_location(start_span, &file.content); - let mut function_lines: usize = 0; - let mut left_bracket: usize = 0; - let mut right_bracket: usize = 0; - let mut last_bracket_line: usize = 0; - - for (_, c) in file.content.chars().enumerate().skip(index) { - if c == '{' { - left_bracket += 1; - } - if c == '}' { - right_bracket += 1; - } - if c == '\n' { - function_lines += 1; + if let FunctionBody::Block(block) = &function.body { + let line_diff = block.span().end().line - block.span().start().line; + let start_span = function.name.span().start(); + let end_span = block.span().end(); + if line_diff > nb_max_line { + return Some(Range { + start: Position { + line: start_span.line, + character: start_span.column, + }, + end: Position { + line: end_span.line, + character: end_span.column, + }, + }) } - if right_bracket > 0 && left_bracket == right_bracket { - last_bracket_line = start_span.line + function_lines; - break; - } - } - if function_lines > nb_max_line { - res = Some(Range { - start: Position { - line: start_span.line, - character: start_span.column, - }, - end: Position { - line: last_bracket_line, - character: 1, - }, - }); - } - res -} - -fn get_all_functions_from_ast(ast_nodes: &ast_extractor::File) -> Vec { - let mut res = Vec::new(); - let contract = ast_nodes - .items - .iter() - .filter_map(|item| match item { - ast_extractor::Item::Contract(contract) => Some(contract), - _ => None, - }) - .next(); - - if let Some(contract) = contract { - res = ast_extractor::retriever::retrieve_functions_nodes(contract); } - res + None } impl FunctionMaxLines { diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/types.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/types.rs index 1652ba45..06a75d76 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/types.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/types.rs @@ -84,7 +84,7 @@ impl LintDiag { higlight_length = trimmed_line.len() - (self.range.start.character - offset); } else if line_nb == self.range.end.line { higlight_length = trimmed_line.len() - - (self.range.end.character - min(offset, trimmed_line.len())); + - (self.range.end.character - offset) + 1; } formatted = format!( diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/FunctionMaxLines/.solidhunter.json b/toolchains/solidity/linter/core/solidhunter-lib/testdata/FunctionMaxLines/.solidhunter.json index 6cc3dcc2..1c1b4895 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/testdata/FunctionMaxLines/.solidhunter.json +++ b/toolchains/solidity/linter/core/solidhunter-lib/testdata/FunctionMaxLines/.solidhunter.json @@ -3,13 +3,6 @@ "includes": [], "plugins": [], "rules": [ - { - "id": "line-max-len", - "severity": "WARNING", - "data": [ - "80" - ] - }, { "id": "max-states-count", "severity": "WARNING", diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/FunctionMaxLines/file.sol b/toolchains/solidity/linter/core/solidhunter-lib/testdata/FunctionMaxLines/file.sol index 55db8a98..36dc8b72 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/testdata/FunctionMaxLines/file.sol +++ b/toolchains/solidity/linter/core/solidhunter-lib/testdata/FunctionMaxLines/file.sol @@ -25,4 +25,32 @@ contract Test { uint u = 21; uint v = 22; } + + // Should not be flagged as the body is shorter than the max lines + constructor( + address initialOwner, + address initialStaker, + address initialMinter, + address initialSwapper, + uint256 initialHarvestFee, + address initialFeeRecipient, + address initialFeeToken, + address initialOperator, + address definitiveAsset + ) + Owned2Step(initialOwner) + ERC4626(ERC20(definitiveAsset), "Tholgar Warlord Token", "tWAR") + AFees(initialHarvestFee, initialFeeRecipient, initialFeeToken) + AOperator(initialOperator) + { + if (initialStaker == address(0) || initialMinter == address(0) || initialSwapper == address(0)) { + revert Errors.ZeroAddress(); + } + + staker = initialStaker; + minter = initialMinter; + swapper = initialSwapper; + + ERC20(definitiveAsset).safeApprove(initialStaker, type(uint256).max); + } } \ No newline at end of file diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/FunctionMaxLines/findings.csv b/toolchains/solidity/linter/core/solidhunter-lib/testdata/FunctionMaxLines/findings.csv index 385f59d7..9d454650 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/testdata/FunctionMaxLines/findings.csv +++ b/toolchains/solidity/linter/core/solidhunter-lib/testdata/FunctionMaxLines/findings.csv @@ -1 +1 @@ -function-max-lines:4:13:27:1 \ No newline at end of file +function-max-lines:4:13:27:5 \ No newline at end of file From 3fef02e23113253e3915a87e7d7d887e126b56de Mon Sep 17 00:00:00 2001 From: 0xtekgrinder <0xtekgrinder@protonmail.com> Date: Mon, 9 Oct 2023 20:22:18 -0400 Subject: [PATCH 233/325] fix(solidity/linter/core): naming is now correct for all rules --- .../rules/best_practises/payable_fallback.rs | 4 +- ...scalcase.rs => contract_name_camelcase.rs} | 14 ++--- ...me_camelcase.rs => func_name_mixedcase.rs} | 32 +++++----- ...elcase.rs => func_param_name_mixedcase.rs} | 14 ++--- .../solidhunter-lib/src/rules/naming/mod.rs | 30 +++++----- .../ConstNameSnakeCase/.solidhunter.json | 6 +- .../ContractNameCamelCase/.solidhunter.json | 12 ++++ .../file.sol | 0 .../ContractNameCamelCase/findings.csv | 1 + .../ContractNamePascalCase/.solidhunter.json | 60 ------------------- .../ContractNamePascalCase/findings.csv | 1 - .../testdata/CustomErrors/.solidhunter.json | 6 +- .../testdata/EmptyBlock/.solidhunter.json | 4 +- .../EventNameCamelCase/.solidhunter.json | 6 +- .../FoundryFunctionName/.solidhunter.json | 4 +- .../FunctionMaxLines/.solidhunter.json | 6 +- .../FunctionNameCamelCase/.solidhunter.json | 60 ------------------- .../FunctionNameCamelCase/findings.csv | 1 - .../FunctionNameMixedCase/.solidhunter.json | 12 ++++ .../file.sol | 5 ++ .../FunctionNameMixedCase/findings.csv | 1 + .../.solidhunter.json | 60 ------------------- .../FunctionParamNameCamelCase/findings.csv | 1 - .../.solidhunter.json | 12 ++++ .../file.sol | 0 .../FunctionParamNameMixedCase/findings.csv | 1 + .../FunctionVisibility/.solidhunter.json | 6 +- .../testdata/GlobalImport/.solidhunter.json | 6 +- .../testdata/ImportOnTop/.solidhunter.json | 6 +- .../testdata/LineMaxLen/.solidhunter.json | 6 +- .../testdata/MaxStatesCount/.solidhunter.json | 6 +- .../ModifierNameMixedcase/.solidhunter.json | 53 ---------------- .../NamedParametersMapping/.solidhunter.json | 6 +- .../testdata/NoConsole/.solidhunter.json | 6 +- .../NoInlineAssembly/.solidhunter.json | 6 +- .../OneContractPerFile/.solidhunter.json | 6 +- .../PayableFallback/.solidhunter.json | 6 +- .../.solidhunter.json | 2 +- .../testdata/ReasonString/.solidhunter.json | 6 +- .../StateVisibility/.solidhunter.json | 6 +- .../UseForbiddenName/.solidhunter.json | 6 +- .../VisibilityModifierOrder/.solidhunter.json | 6 +- .../core/solidhunter-lib/tests/linter.rs | 6 +- 43 files changed, 155 insertions(+), 343 deletions(-) rename toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/{contract_name_pascalcase.rs => contract_name_camelcase.rs} (86%) rename toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/{func_name_camelcase.rs => func_name_mixedcase.rs} (65%) rename toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/{func_param_name_camelcase.rs => func_param_name_mixedcase.rs} (87%) create mode 100644 toolchains/solidity/linter/core/solidhunter-lib/testdata/ContractNameCamelCase/.solidhunter.json rename toolchains/solidity/linter/core/solidhunter-lib/testdata/{ContractNamePascalCase => ContractNameCamelCase}/file.sol (100%) create mode 100644 toolchains/solidity/linter/core/solidhunter-lib/testdata/ContractNameCamelCase/findings.csv delete mode 100644 toolchains/solidity/linter/core/solidhunter-lib/testdata/ContractNamePascalCase/.solidhunter.json delete mode 100644 toolchains/solidity/linter/core/solidhunter-lib/testdata/ContractNamePascalCase/findings.csv delete mode 100644 toolchains/solidity/linter/core/solidhunter-lib/testdata/FunctionNameCamelCase/.solidhunter.json delete mode 100644 toolchains/solidity/linter/core/solidhunter-lib/testdata/FunctionNameCamelCase/findings.csv create mode 100644 toolchains/solidity/linter/core/solidhunter-lib/testdata/FunctionNameMixedCase/.solidhunter.json rename toolchains/solidity/linter/core/solidhunter-lib/testdata/{FunctionNameCamelCase => FunctionNameMixedCase}/file.sol (71%) create mode 100644 toolchains/solidity/linter/core/solidhunter-lib/testdata/FunctionNameMixedCase/findings.csv delete mode 100644 toolchains/solidity/linter/core/solidhunter-lib/testdata/FunctionParamNameCamelCase/.solidhunter.json delete mode 100644 toolchains/solidity/linter/core/solidhunter-lib/testdata/FunctionParamNameCamelCase/findings.csv create mode 100644 toolchains/solidity/linter/core/solidhunter-lib/testdata/FunctionParamNameMixedCase/.solidhunter.json rename toolchains/solidity/linter/core/solidhunter-lib/testdata/{FunctionParamNameCamelCase => FunctionParamNameMixedCase}/file.sol (100%) create mode 100644 toolchains/solidity/linter/core/solidhunter-lib/testdata/FunctionParamNameMixedCase/findings.csv diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/payable_fallback.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/payable_fallback.rs index 28b08899..0e9e5983 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/payable_fallback.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/payable_fallback.rs @@ -41,7 +41,9 @@ fn check_fallback_payable(file: &SolidFile) -> Vec> { let functions = retrieve_functions_nodes(&contract); for function in functions { - if function.kind.is_fallback() || (function.kind.is_function() && function.name.is_none()) { + if function.kind.is_fallback() + || (function.kind.is_function() && function.name.is_none()) + { res = check_attribute(res, function); } } diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/contract_name_pascalcase.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/contract_name_camelcase.rs similarity index 86% rename from toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/contract_name_pascalcase.rs rename to toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/contract_name_camelcase.rs index 8497cc7b..9ae780d7 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/contract_name_pascalcase.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/contract_name_camelcase.rs @@ -4,14 +4,14 @@ use crate::linter::SolidFile; use crate::rules::types::*; use crate::types::*; -pub const RULE_ID: &str = "contract-name-pascalcase"; -const MESSAGE: &str = "Contract name need to be in pascal case"; +pub const RULE_ID: &str = "contract-name-camelcase"; +const MESSAGE: &str = "Contract name must be in CamelCase"; -pub struct ContractNamePascalCase { +pub struct ContractNameCamelCase { data: RuleEntry, } -impl ContractNamePascalCase { +impl ContractNameCamelCase { fn create_diag( &self, location: (ast_extractor::LineColumn, ast_extractor::LineColumn), @@ -39,7 +39,7 @@ impl ContractNamePascalCase { } } -impl RuleType for ContractNamePascalCase { +impl RuleType for ContractNameCamelCase { fn diagnose(&self, file: &SolidFile, _files: &[SolidFile]) -> Vec { let mut res = Vec::new(); let contracts = ast_extractor::retriever::retrieve_contract_nodes(&file.data); @@ -58,9 +58,9 @@ impl RuleType for ContractNamePascalCase { } } -impl ContractNamePascalCase { +impl ContractNameCamelCase { pub(crate) fn create(data: RuleEntry) -> Box { - let rule = ContractNamePascalCase { data }; + let rule = ContractNameCamelCase { data }; Box::new(rule) } diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/func_name_camelcase.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/func_name_mixedcase.rs similarity index 65% rename from toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/func_name_camelcase.rs rename to toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/func_name_mixedcase.rs index 9e2655e3..164a11d1 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/func_name_camelcase.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/func_name_mixedcase.rs @@ -4,14 +4,14 @@ use crate::linter::SolidFile; use crate::rules::types::*; use crate::types::*; -pub const RULE_ID: &str = "func-name-camelcase"; -const MESSAGE: &str = "Function name need to be in camel case"; +pub const RULE_ID: &str = "func-name-mixedcase"; +const MESSAGE: &str = "Function name must be in mixedCase"; -pub struct FuncNameCamelCase { +pub struct FuncNameMixedCase { data: RuleEntry, } -impl FuncNameCamelCase { +impl FuncNameMixedCase { fn create_diag( &self, location: (ast_extractor::LineColumn, ast_extractor::LineColumn), @@ -39,21 +39,23 @@ impl FuncNameCamelCase { } } -impl RuleType for FuncNameCamelCase { +impl RuleType for FuncNameMixedCase { fn diagnose(&self, file: &SolidFile, _files: &[SolidFile]) -> Vec { let mut res = Vec::new(); let contracts = ast_extractor::retriever::retrieve_contract_nodes(&file.data); for contract in contracts { for function in ast_extractor::retriever::retrieve_functions_nodes(&contract) { - if let Some(name) = function.name { - if !(name.as_string().chars().next().unwrap_or(' ') >= 'a' - && name.as_string().chars().next().unwrap_or(' ') <= 'z') - || name.as_string().contains('_') - || name.as_string().contains('-') - { - let span = name.span(); - res.push(self.create_diag((span.start(), span.end()), file)); + if function.kind.is_function() { + if let Some(name) = function.name { + if !(name.as_string().chars().next().unwrap_or(' ') >= 'a' + && name.as_string().chars().next().unwrap_or(' ') <= 'z') + || name.as_string().contains('_') + || name.as_string().contains('-') + { + let span = name.span(); + res.push(self.create_diag((span.start(), span.end()), file)); + } } } } @@ -62,9 +64,9 @@ impl RuleType for FuncNameCamelCase { } } -impl FuncNameCamelCase { +impl FuncNameMixedCase { pub(crate) fn create(data: RuleEntry) -> Box { - let rule = FuncNameCamelCase { data }; + let rule = FuncNameMixedCase { data }; Box::new(rule) } diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/func_param_name_camelcase.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/func_param_name_mixedcase.rs similarity index 87% rename from toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/func_param_name_camelcase.rs rename to toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/func_param_name_mixedcase.rs index e1e958e3..03f88007 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/func_param_name_camelcase.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/func_param_name_mixedcase.rs @@ -3,14 +3,14 @@ use crate::rules::types::*; use crate::types::*; use ast_extractor::Spanned; -pub const RULE_ID: &str = "func-param-name-camelcase"; -const MESSAGE: &str = "Parameter name need to be in camel case"; +pub const RULE_ID: &str = "func-param-name-mixedcase"; +const MESSAGE: &str = "Function param name must be in mixedCase"; -pub struct FuncParamNameCamelcase { +pub struct FuncParamNameMixedCase { data: RuleEntry, } -impl FuncParamNameCamelcase { +impl FuncParamNameMixedCase { fn create_diag( &self, location: (ast_extractor::LineColumn, ast_extractor::LineColumn), @@ -38,7 +38,7 @@ impl FuncParamNameCamelcase { } } -impl RuleType for FuncParamNameCamelcase { +impl RuleType for FuncParamNameMixedCase { fn diagnose(&self, file: &SolidFile, _files: &[SolidFile]) -> Vec { let mut res = Vec::new(); let contracts = ast_extractor::retriever::retrieve_contract_nodes(&file.data); @@ -63,9 +63,9 @@ impl RuleType for FuncParamNameCamelcase { } } -impl FuncParamNameCamelcase { +impl FuncParamNameMixedCase { pub(crate) fn create(data: RuleEntry) -> Box { - let rule = FuncParamNameCamelcase { data }; + let rule = FuncParamNameMixedCase { data }; Box::new(rule) } diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/mod.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/mod.rs index fbe1f0e1..7f833c73 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/mod.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/mod.rs @@ -1,9 +1,9 @@ use crate::rules::naming::const_name_snakecase::ConstNameSnakeCase; -use crate::rules::naming::contract_name_pascalcase::ContractNamePascalCase; +use crate::rules::naming::contract_name_camelcase::ContractNameCamelCase; use crate::rules::naming::event_name_camelcase::EventNameCamelCase; use crate::rules::naming::foundry_func_name::FoundryFuncName; -use crate::rules::naming::func_name_camelcase::FuncNameCamelCase; -use crate::rules::naming::func_param_name_camelcase::FuncParamNameCamelcase; +use crate::rules::naming::func_name_mixedcase::FuncNameMixedCase; +use crate::rules::naming::func_param_name_mixedcase::FuncParamNameMixedCase; use crate::rules::naming::func_visibility::FuncVisibility; use crate::rules::naming::modifier_name_mixedcase::ModifierNameMixedcase; use crate::rules::naming::named_parameters_mapping::NamedParametersMapping; @@ -15,12 +15,12 @@ use crate::rules::RuleBuilder; use std::collections::HashMap; #[macro_use] -pub(crate) mod func_param_name_camelcase; +pub(crate) mod func_param_name_mixedcase; pub(crate) mod const_name_snakecase; -pub(crate) mod contract_name_pascalcase; +pub(crate) mod contract_name_camelcase; pub(crate) mod event_name_camelcase; pub(crate) mod foundry_func_name; -pub(crate) mod func_name_camelcase; +pub(crate) mod func_name_mixedcase; pub(crate) mod func_visibility; pub(crate) mod modifier_name_mixedcase; pub(crate) mod named_parameters_mapping; @@ -32,9 +32,9 @@ pub(crate) mod var_name_mixedcase; pub fn create_default_rules() -> Vec { vec![ - ContractNamePascalCase::create_default(), - FuncNameCamelCase::create_default(), - FuncParamNameCamelcase::create_default(), + ContractNameCamelCase::create_default(), + FuncNameMixedCase::create_default(), + FuncParamNameMixedCase::create_default(), UseForbiddenName::create_default(), FuncVisibility::create_default(), EventNameCamelCase::create_default(), @@ -51,20 +51,20 @@ pub fn create_rules() -> RulesMap { let mut rules: HashMap = HashMap::new(); rules.insert( - contract_name_pascalcase::RULE_ID.to_string(), - ContractNamePascalCase::create, + contract_name_camelcase::RULE_ID.to_string(), + ContractNameCamelCase::create, ); rules.insert( named_parameters_mapping::RULE_ID.to_string(), NamedParametersMapping::create, ); rules.insert( - func_name_camelcase::RULE_ID.to_string(), - FuncNameCamelCase::create, + func_name_mixedcase::RULE_ID.to_string(), + FuncNameMixedCase::create, ); rules.insert( - func_param_name_camelcase::RULE_ID.to_string(), - FuncParamNameCamelcase::create, + func_param_name_mixedcase::RULE_ID.to_string(), + FuncParamNameMixedCase::create, ); rules.insert( use_forbidden_name::RULE_ID.to_string(), diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/ConstNameSnakeCase/.solidhunter.json b/toolchains/solidity/linter/core/solidhunter-lib/testdata/ConstNameSnakeCase/.solidhunter.json index b1ce835e..9144f0c7 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/testdata/ConstNameSnakeCase/.solidhunter.json +++ b/toolchains/solidity/linter/core/solidhunter-lib/testdata/ConstNameSnakeCase/.solidhunter.json @@ -32,17 +32,17 @@ ] }, { - "id": "contract-name-pascalcase", + "id": "contract-name-camelcase", "severity": "WARNING", "data": [] }, { - "id": "func-name-camelcase", + "id": "func-name-mixedcase", "severity": "WARNING", "data": [] }, { - "id": "func-param-name-camelcase", + "id": "func-param-name-mixedcase", "severity": "WARNING", "data": [] }, diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/ContractNameCamelCase/.solidhunter.json b/toolchains/solidity/linter/core/solidhunter-lib/testdata/ContractNameCamelCase/.solidhunter.json new file mode 100644 index 00000000..fcb15424 --- /dev/null +++ b/toolchains/solidity/linter/core/solidhunter-lib/testdata/ContractNameCamelCase/.solidhunter.json @@ -0,0 +1,12 @@ +{ + "name": "solidhunter", + "includes": [], + "plugins": [], + "rules": [ + { + "id": "contract-name-camelcase", + "severity": "WARNING", + "data": [] + } + ] +} \ No newline at end of file diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/ContractNamePascalCase/file.sol b/toolchains/solidity/linter/core/solidhunter-lib/testdata/ContractNameCamelCase/file.sol similarity index 100% rename from toolchains/solidity/linter/core/solidhunter-lib/testdata/ContractNamePascalCase/file.sol rename to toolchains/solidity/linter/core/solidhunter-lib/testdata/ContractNameCamelCase/file.sol diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/ContractNameCamelCase/findings.csv b/toolchains/solidity/linter/core/solidhunter-lib/testdata/ContractNameCamelCase/findings.csv new file mode 100644 index 00000000..650943a0 --- /dev/null +++ b/toolchains/solidity/linter/core/solidhunter-lib/testdata/ContractNameCamelCase/findings.csv @@ -0,0 +1 @@ +contract-name-camelcase:3:9:3:13 \ No newline at end of file diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/ContractNamePascalCase/.solidhunter.json b/toolchains/solidity/linter/core/solidhunter-lib/testdata/ContractNamePascalCase/.solidhunter.json deleted file mode 100644 index 6cc3dcc2..00000000 --- a/toolchains/solidity/linter/core/solidhunter-lib/testdata/ContractNamePascalCase/.solidhunter.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "name": "solidhunter", - "includes": [], - "plugins": [], - "rules": [ - { - "id": "line-max-len", - "severity": "WARNING", - "data": [ - "80" - ] - }, - { - "id": "max-states-count", - "severity": "WARNING", - "data": [ - "15" - ] - }, - { - "id": "function-max-lines", - "severity": "WARNING", - "data": [ - "20" - ] - }, - { - "id": "reason-string", - "severity": "WARNING", - "data": [ - "32" - ] - }, - { - "id": "contract-name-pascalcase", - "severity": "WARNING", - "data": [] - }, - { - "id": "func-name-camelcase", - "severity": "WARNING", - "data": [] - }, - { - "id": "func-param-name-camelcase", - "severity": "WARNING", - "data": [] - }, - { - "id": "use-forbidden-name", - "severity": "WARNING", - "data": [] - }, - { - "id": "import-on-top", - "severity": "WARNING", - "data": [] - } - ] -} \ No newline at end of file diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/ContractNamePascalCase/findings.csv b/toolchains/solidity/linter/core/solidhunter-lib/testdata/ContractNamePascalCase/findings.csv deleted file mode 100644 index 7d0c6be6..00000000 --- a/toolchains/solidity/linter/core/solidhunter-lib/testdata/ContractNamePascalCase/findings.csv +++ /dev/null @@ -1 +0,0 @@ -contract-name-pascalcase:3:9:3:13 \ No newline at end of file diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/CustomErrors/.solidhunter.json b/toolchains/solidity/linter/core/solidhunter-lib/testdata/CustomErrors/.solidhunter.json index 22a078db..da432269 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/testdata/CustomErrors/.solidhunter.json +++ b/toolchains/solidity/linter/core/solidhunter-lib/testdata/CustomErrors/.solidhunter.json @@ -32,17 +32,17 @@ ] }, { - "id": "contract-name-pascalcase", + "id": "contract-name-camelcase", "severity": "WARNING", "data": [] }, { - "id": "func-name-camelcase", + "id": "func-name-mixedcase", "severity": "WARNING", "data": [] }, { - "id": "func-param-name-camelcase", + "id": "func-param-name-mixedcase", "severity": "WARNING", "data": [] }, diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/EmptyBlock/.solidhunter.json b/toolchains/solidity/linter/core/solidhunter-lib/testdata/EmptyBlock/.solidhunter.json index ed3fa9fa..ef614b08 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/testdata/EmptyBlock/.solidhunter.json +++ b/toolchains/solidity/linter/core/solidhunter-lib/testdata/EmptyBlock/.solidhunter.json @@ -32,12 +32,12 @@ ] }, { - "id": "func-name-camelcase", + "id": "func-name-mixedcase", "severity": "WARNING", "data": [] }, { - "id": "func-param-name-camelcase", + "id": "func-param-name-mixedcase", "severity": "WARNING", "data": [] }, diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/EventNameCamelCase/.solidhunter.json b/toolchains/solidity/linter/core/solidhunter-lib/testdata/EventNameCamelCase/.solidhunter.json index e4376d47..75a1f82e 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/testdata/EventNameCamelCase/.solidhunter.json +++ b/toolchains/solidity/linter/core/solidhunter-lib/testdata/EventNameCamelCase/.solidhunter.json @@ -32,17 +32,17 @@ ] }, { - "id": "contract-name-pascalcase", + "id": "contract-name-camelcase", "severity": "WARNING", "data": [] }, { - "id": "func-name-camelcase", + "id": "func-name-mixedcase", "severity": "WARNING", "data": [] }, { - "id": "func-param-name-camelcase", + "id": "func-param-name-mixedcase", "severity": "WARNING", "data": [] }, diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/FoundryFunctionName/.solidhunter.json b/toolchains/solidity/linter/core/solidhunter-lib/testdata/FoundryFunctionName/.solidhunter.json index 476e6f03..68a30b75 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/testdata/FoundryFunctionName/.solidhunter.json +++ b/toolchains/solidity/linter/core/solidhunter-lib/testdata/FoundryFunctionName/.solidhunter.json @@ -32,12 +32,12 @@ ] }, { - "id": "contract-name-pascalcase", + "id": "contract-name-camelcase", "severity": "WARNING", "data": [] }, { - "id": "func-param-name-camelcase", + "id": "func-param-name-mixedcase", "severity": "WARNING", "data": [] }, diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/FunctionMaxLines/.solidhunter.json b/toolchains/solidity/linter/core/solidhunter-lib/testdata/FunctionMaxLines/.solidhunter.json index 1c1b4895..21863880 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/testdata/FunctionMaxLines/.solidhunter.json +++ b/toolchains/solidity/linter/core/solidhunter-lib/testdata/FunctionMaxLines/.solidhunter.json @@ -25,17 +25,17 @@ ] }, { - "id": "contract-name-pascalcase", + "id": "contract-name-camelcase", "severity": "WARNING", "data": [] }, { - "id": "func-name-camelcase", + "id": "func-name-mixedcase", "severity": "WARNING", "data": [] }, { - "id": "func-param-name-camelcase", + "id": "func-param-name-mixedcase", "severity": "WARNING", "data": [] }, diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/FunctionNameCamelCase/.solidhunter.json b/toolchains/solidity/linter/core/solidhunter-lib/testdata/FunctionNameCamelCase/.solidhunter.json deleted file mode 100644 index 6cc3dcc2..00000000 --- a/toolchains/solidity/linter/core/solidhunter-lib/testdata/FunctionNameCamelCase/.solidhunter.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "name": "solidhunter", - "includes": [], - "plugins": [], - "rules": [ - { - "id": "line-max-len", - "severity": "WARNING", - "data": [ - "80" - ] - }, - { - "id": "max-states-count", - "severity": "WARNING", - "data": [ - "15" - ] - }, - { - "id": "function-max-lines", - "severity": "WARNING", - "data": [ - "20" - ] - }, - { - "id": "reason-string", - "severity": "WARNING", - "data": [ - "32" - ] - }, - { - "id": "contract-name-pascalcase", - "severity": "WARNING", - "data": [] - }, - { - "id": "func-name-camelcase", - "severity": "WARNING", - "data": [] - }, - { - "id": "func-param-name-camelcase", - "severity": "WARNING", - "data": [] - }, - { - "id": "use-forbidden-name", - "severity": "WARNING", - "data": [] - }, - { - "id": "import-on-top", - "severity": "WARNING", - "data": [] - } - ] -} \ No newline at end of file diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/FunctionNameCamelCase/findings.csv b/toolchains/solidity/linter/core/solidhunter-lib/testdata/FunctionNameCamelCase/findings.csv deleted file mode 100644 index 58982bcd..00000000 --- a/toolchains/solidity/linter/core/solidhunter-lib/testdata/FunctionNameCamelCase/findings.csv +++ /dev/null @@ -1 +0,0 @@ -func-name-camelcase:4:13:4:22 \ No newline at end of file diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/FunctionNameMixedCase/.solidhunter.json b/toolchains/solidity/linter/core/solidhunter-lib/testdata/FunctionNameMixedCase/.solidhunter.json new file mode 100644 index 00000000..ea7d4682 --- /dev/null +++ b/toolchains/solidity/linter/core/solidhunter-lib/testdata/FunctionNameMixedCase/.solidhunter.json @@ -0,0 +1,12 @@ +{ + "name": "solidhunter", + "includes": [], + "plugins": [], + "rules": [ + { + "id": "func-name-mixedcase", + "severity": "WARNING", + "data": [] + } + ] +} \ No newline at end of file diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/FunctionNameCamelCase/file.sol b/toolchains/solidity/linter/core/solidhunter-lib/testdata/FunctionNameMixedCase/file.sol similarity index 71% rename from toolchains/solidity/linter/core/solidhunter-lib/testdata/FunctionNameCamelCase/file.sol rename to toolchains/solidity/linter/core/solidhunter-lib/testdata/FunctionNameMixedCase/file.sol index de8ffdb7..8640448a 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/testdata/FunctionNameCamelCase/file.sol +++ b/toolchains/solidity/linter/core/solidhunter-lib/testdata/FunctionNameMixedCase/file.sol @@ -1,6 +1,11 @@ pragma solidity 0.8.0; contract Test { + + modifier test_suhshus() { + _; + } + function test_shbs() public pure returns (uint) { return 1; } diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/FunctionNameMixedCase/findings.csv b/toolchains/solidity/linter/core/solidhunter-lib/testdata/FunctionNameMixedCase/findings.csv new file mode 100644 index 00000000..802f09fd --- /dev/null +++ b/toolchains/solidity/linter/core/solidhunter-lib/testdata/FunctionNameMixedCase/findings.csv @@ -0,0 +1 @@ +func-name-mixedcase:9:13:9:22 \ No newline at end of file diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/FunctionParamNameCamelCase/.solidhunter.json b/toolchains/solidity/linter/core/solidhunter-lib/testdata/FunctionParamNameCamelCase/.solidhunter.json deleted file mode 100644 index 6cc3dcc2..00000000 --- a/toolchains/solidity/linter/core/solidhunter-lib/testdata/FunctionParamNameCamelCase/.solidhunter.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "name": "solidhunter", - "includes": [], - "plugins": [], - "rules": [ - { - "id": "line-max-len", - "severity": "WARNING", - "data": [ - "80" - ] - }, - { - "id": "max-states-count", - "severity": "WARNING", - "data": [ - "15" - ] - }, - { - "id": "function-max-lines", - "severity": "WARNING", - "data": [ - "20" - ] - }, - { - "id": "reason-string", - "severity": "WARNING", - "data": [ - "32" - ] - }, - { - "id": "contract-name-pascalcase", - "severity": "WARNING", - "data": [] - }, - { - "id": "func-name-camelcase", - "severity": "WARNING", - "data": [] - }, - { - "id": "func-param-name-camelcase", - "severity": "WARNING", - "data": [] - }, - { - "id": "use-forbidden-name", - "severity": "WARNING", - "data": [] - }, - { - "id": "import-on-top", - "severity": "WARNING", - "data": [] - } - ] -} \ No newline at end of file diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/FunctionParamNameCamelCase/findings.csv b/toolchains/solidity/linter/core/solidhunter-lib/testdata/FunctionParamNameCamelCase/findings.csv deleted file mode 100644 index 2011650b..00000000 --- a/toolchains/solidity/linter/core/solidhunter-lib/testdata/FunctionParamNameCamelCase/findings.csv +++ /dev/null @@ -1 +0,0 @@ -func-param-name-camelcase:4:26:4:36 \ No newline at end of file diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/FunctionParamNameMixedCase/.solidhunter.json b/toolchains/solidity/linter/core/solidhunter-lib/testdata/FunctionParamNameMixedCase/.solidhunter.json new file mode 100644 index 00000000..514e0016 --- /dev/null +++ b/toolchains/solidity/linter/core/solidhunter-lib/testdata/FunctionParamNameMixedCase/.solidhunter.json @@ -0,0 +1,12 @@ +{ + "name": "solidhunter", + "includes": [], + "plugins": [], + "rules": [ + { + "id": "func-param-name-mixedcase", + "severity": "WARNING", + "data": [] + } + ] +} \ No newline at end of file diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/FunctionParamNameCamelCase/file.sol b/toolchains/solidity/linter/core/solidhunter-lib/testdata/FunctionParamNameMixedCase/file.sol similarity index 100% rename from toolchains/solidity/linter/core/solidhunter-lib/testdata/FunctionParamNameCamelCase/file.sol rename to toolchains/solidity/linter/core/solidhunter-lib/testdata/FunctionParamNameMixedCase/file.sol diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/FunctionParamNameMixedCase/findings.csv b/toolchains/solidity/linter/core/solidhunter-lib/testdata/FunctionParamNameMixedCase/findings.csv new file mode 100644 index 00000000..f0e3c40a --- /dev/null +++ b/toolchains/solidity/linter/core/solidhunter-lib/testdata/FunctionParamNameMixedCase/findings.csv @@ -0,0 +1 @@ +func-param-name-mixedcase:4:26:4:36 \ No newline at end of file diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/FunctionVisibility/.solidhunter.json b/toolchains/solidity/linter/core/solidhunter-lib/testdata/FunctionVisibility/.solidhunter.json index f0434c83..b85e3750 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/testdata/FunctionVisibility/.solidhunter.json +++ b/toolchains/solidity/linter/core/solidhunter-lib/testdata/FunctionVisibility/.solidhunter.json @@ -32,17 +32,17 @@ ] }, { - "id": "contract-name-pascalcase", + "id": "contract-name-camelcase", "severity": "WARNING", "data": [] }, { - "id": "func-name-camelcase", + "id": "func-name-mixedcase", "severity": "WARNING", "data": [] }, { - "id": "func-param-name-camelcase", + "id": "func-param-name-mixedcase", "severity": "WARNING", "data": [] }, diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/GlobalImport/.solidhunter.json b/toolchains/solidity/linter/core/solidhunter-lib/testdata/GlobalImport/.solidhunter.json index 24cda77c..d5531b1d 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/testdata/GlobalImport/.solidhunter.json +++ b/toolchains/solidity/linter/core/solidhunter-lib/testdata/GlobalImport/.solidhunter.json @@ -32,17 +32,17 @@ ] }, { - "id": "contract-name-pascalcase", + "id": "contract-name-camelcase", "severity": "WARNING", "data": [] }, { - "id": "func-name-camelcase", + "id": "func-name-mixedcase", "severity": "WARNING", "data": [] }, { - "id": "func-param-name-camelcase", + "id": "func-param-name-mixedcase", "severity": "WARNING", "data": [] }, diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/ImportOnTop/.solidhunter.json b/toolchains/solidity/linter/core/solidhunter-lib/testdata/ImportOnTop/.solidhunter.json index 6cc3dcc2..35d30a57 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/testdata/ImportOnTop/.solidhunter.json +++ b/toolchains/solidity/linter/core/solidhunter-lib/testdata/ImportOnTop/.solidhunter.json @@ -32,17 +32,17 @@ ] }, { - "id": "contract-name-pascalcase", + "id": "contract-name-camelcase", "severity": "WARNING", "data": [] }, { - "id": "func-name-camelcase", + "id": "func-name-mixedcase", "severity": "WARNING", "data": [] }, { - "id": "func-param-name-camelcase", + "id": "func-param-name-mixedcase", "severity": "WARNING", "data": [] }, diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/LineMaxLen/.solidhunter.json b/toolchains/solidity/linter/core/solidhunter-lib/testdata/LineMaxLen/.solidhunter.json index 6cc3dcc2..35d30a57 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/testdata/LineMaxLen/.solidhunter.json +++ b/toolchains/solidity/linter/core/solidhunter-lib/testdata/LineMaxLen/.solidhunter.json @@ -32,17 +32,17 @@ ] }, { - "id": "contract-name-pascalcase", + "id": "contract-name-camelcase", "severity": "WARNING", "data": [] }, { - "id": "func-name-camelcase", + "id": "func-name-mixedcase", "severity": "WARNING", "data": [] }, { - "id": "func-param-name-camelcase", + "id": "func-param-name-mixedcase", "severity": "WARNING", "data": [] }, diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/MaxStatesCount/.solidhunter.json b/toolchains/solidity/linter/core/solidhunter-lib/testdata/MaxStatesCount/.solidhunter.json index 6cc3dcc2..35d30a57 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/testdata/MaxStatesCount/.solidhunter.json +++ b/toolchains/solidity/linter/core/solidhunter-lib/testdata/MaxStatesCount/.solidhunter.json @@ -32,17 +32,17 @@ ] }, { - "id": "contract-name-pascalcase", + "id": "contract-name-camelcase", "severity": "WARNING", "data": [] }, { - "id": "func-name-camelcase", + "id": "func-name-mixedcase", "severity": "WARNING", "data": [] }, { - "id": "func-param-name-camelcase", + "id": "func-param-name-mixedcase", "severity": "WARNING", "data": [] }, diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/ModifierNameMixedcase/.solidhunter.json b/toolchains/solidity/linter/core/solidhunter-lib/testdata/ModifierNameMixedcase/.solidhunter.json index 5f12afff..44021895 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/testdata/ModifierNameMixedcase/.solidhunter.json +++ b/toolchains/solidity/linter/core/solidhunter-lib/testdata/ModifierNameMixedcase/.solidhunter.json @@ -3,59 +3,6 @@ "includes": [], "plugins": [], "rules": [ - { - "id": "line-max-len", - "severity": "WARNING", - "data": [ - "80" - ] - }, - { - "id": "max-states-count", - "severity": "WARNING", - "data": [ - "15" - ] - }, - { - "id": "function-max-lines", - "severity": "WARNING", - "data": [ - "20" - ] - }, - { - "id": "reason-string", - "severity": "WARNING", - "data": [ - "32" - ] - }, - { - "id": "contract-name-pascalcase", - "severity": "WARNING", - "data": [] - }, - { - "id": "func-param-name-camelcase", - "severity": "WARNING", - "data": [] - }, - { - "id": "use-forbidden-name", - "severity": "WARNING", - "data": [] - }, - { - "id": "import-on-top", - "severity": "WARNING", - "data": [] - }, - { - "id": "const-name-snakecase", - "severity": "WARNING", - "data": [] - }, { "id": "modifier-name-mixedcase", "severity": "WARNING", diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/NamedParametersMapping/.solidhunter.json b/toolchains/solidity/linter/core/solidhunter-lib/testdata/NamedParametersMapping/.solidhunter.json index 3d9c2ef7..26bcc01c 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/testdata/NamedParametersMapping/.solidhunter.json +++ b/toolchains/solidity/linter/core/solidhunter-lib/testdata/NamedParametersMapping/.solidhunter.json @@ -42,17 +42,17 @@ ] }, { - "id": "contract-name-pascalcase", + "id": "contract-name-camelcase", "severity": "WARNING", "data": [] }, { - "id": "func-name-camelcase", + "id": "func-name-mixedcase", "severity": "WARNING", "data": [] }, { - "id": "func-param-name-camelcase", + "id": "func-param-name-mixedcase", "severity": "WARNING", "data": [] }, diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/NoConsole/.solidhunter.json b/toolchains/solidity/linter/core/solidhunter-lib/testdata/NoConsole/.solidhunter.json index 1e7606ee..35f32814 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/testdata/NoConsole/.solidhunter.json +++ b/toolchains/solidity/linter/core/solidhunter-lib/testdata/NoConsole/.solidhunter.json @@ -32,17 +32,17 @@ ] }, { - "id": "contract-name-pascalcase", + "id": "contract-name-camelcase", "severity": "WARNING", "data": [] }, { - "id": "func-name-camelcase", + "id": "func-name-mixedcase", "severity": "WARNING", "data": [] }, { - "id": "func-param-name-camelcase", + "id": "func-param-name-mixedcase", "severity": "WARNING", "data": [] }, diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/NoInlineAssembly/.solidhunter.json b/toolchains/solidity/linter/core/solidhunter-lib/testdata/NoInlineAssembly/.solidhunter.json index 8e3f092e..619c9c94 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/testdata/NoInlineAssembly/.solidhunter.json +++ b/toolchains/solidity/linter/core/solidhunter-lib/testdata/NoInlineAssembly/.solidhunter.json @@ -37,17 +37,17 @@ ] }, { - "id": "contract-name-pascalcase", + "id": "contract-name-camelcase", "severity": "WARNING", "data": [] }, { - "id": "func-name-camelcase", + "id": "func-name-mixedcase", "severity": "WARNING", "data": [] }, { - "id": "func-param-name-camelcase", + "id": "func-param-name-mixedcase", "severity": "WARNING", "data": [] }, diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/OneContractPerFile/.solidhunter.json b/toolchains/solidity/linter/core/solidhunter-lib/testdata/OneContractPerFile/.solidhunter.json index 8f23b009..cc784faa 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/testdata/OneContractPerFile/.solidhunter.json +++ b/toolchains/solidity/linter/core/solidhunter-lib/testdata/OneContractPerFile/.solidhunter.json @@ -32,17 +32,17 @@ ] }, { - "id": "contract-name-pascalcase", + "id": "contract-name-camelcase", "severity": "WARNING", "data": [] }, { - "id": "func-name-camelcase", + "id": "func-name-mixedcase", "severity": "WARNING", "data": [] }, { - "id": "func-param-name-camelcase", + "id": "func-param-name-mixedcase", "severity": "WARNING", "data": [] }, diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/PayableFallback/.solidhunter.json b/toolchains/solidity/linter/core/solidhunter-lib/testdata/PayableFallback/.solidhunter.json index ee5b30ed..cca0fc11 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/testdata/PayableFallback/.solidhunter.json +++ b/toolchains/solidity/linter/core/solidhunter-lib/testdata/PayableFallback/.solidhunter.json @@ -32,17 +32,17 @@ ] }, { - "id": "contract-name-pascalcase", + "id": "contract-name-camelcase", "severity": "WARNING", "data": [] }, { - "id": "func-name-camelcase", + "id": "func-name-mixedcase", "severity": "WARNING", "data": [] }, { - "id": "func-param-name-camelcase", + "id": "func-param-name-mixedcase", "severity": "WARNING", "data": [] }, diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/PrivateVarsLeadingUnderscore/.solidhunter.json b/toolchains/solidity/linter/core/solidhunter-lib/testdata/PrivateVarsLeadingUnderscore/.solidhunter.json index 2acc2f15..e37baad5 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/testdata/PrivateVarsLeadingUnderscore/.solidhunter.json +++ b/toolchains/solidity/linter/core/solidhunter-lib/testdata/PrivateVarsLeadingUnderscore/.solidhunter.json @@ -32,7 +32,7 @@ ] }, { - "id": "contract-name-pascalcase", + "id": "contract-name-camelcase", "severity": "WARNING", "data": [] }, diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/ReasonString/.solidhunter.json b/toolchains/solidity/linter/core/solidhunter-lib/testdata/ReasonString/.solidhunter.json index 6cc3dcc2..35d30a57 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/testdata/ReasonString/.solidhunter.json +++ b/toolchains/solidity/linter/core/solidhunter-lib/testdata/ReasonString/.solidhunter.json @@ -32,17 +32,17 @@ ] }, { - "id": "contract-name-pascalcase", + "id": "contract-name-camelcase", "severity": "WARNING", "data": [] }, { - "id": "func-name-camelcase", + "id": "func-name-mixedcase", "severity": "WARNING", "data": [] }, { - "id": "func-param-name-camelcase", + "id": "func-param-name-mixedcase", "severity": "WARNING", "data": [] }, diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/StateVisibility/.solidhunter.json b/toolchains/solidity/linter/core/solidhunter-lib/testdata/StateVisibility/.solidhunter.json index eee3b681..2935d324 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/testdata/StateVisibility/.solidhunter.json +++ b/toolchains/solidity/linter/core/solidhunter-lib/testdata/StateVisibility/.solidhunter.json @@ -32,17 +32,17 @@ ] }, { - "id": "contract-name-pascalcase", + "id": "contract-name-camelcase", "severity": "WARNING", "data": [] }, { - "id": "func-name-camelcase", + "id": "func-name-mixedcase", "severity": "WARNING", "data": [] }, { - "id": "func-param-name-camelcase", + "id": "func-param-name-mixedcase", "severity": "WARNING", "data": [] }, diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/UseForbiddenName/.solidhunter.json b/toolchains/solidity/linter/core/solidhunter-lib/testdata/UseForbiddenName/.solidhunter.json index 6cc3dcc2..35d30a57 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/testdata/UseForbiddenName/.solidhunter.json +++ b/toolchains/solidity/linter/core/solidhunter-lib/testdata/UseForbiddenName/.solidhunter.json @@ -32,17 +32,17 @@ ] }, { - "id": "contract-name-pascalcase", + "id": "contract-name-camelcase", "severity": "WARNING", "data": [] }, { - "id": "func-name-camelcase", + "id": "func-name-mixedcase", "severity": "WARNING", "data": [] }, { - "id": "func-param-name-camelcase", + "id": "func-param-name-mixedcase", "severity": "WARNING", "data": [] }, diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/VisibilityModifierOrder/.solidhunter.json b/toolchains/solidity/linter/core/solidhunter-lib/testdata/VisibilityModifierOrder/.solidhunter.json index b7487bae..91510d05 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/testdata/VisibilityModifierOrder/.solidhunter.json +++ b/toolchains/solidity/linter/core/solidhunter-lib/testdata/VisibilityModifierOrder/.solidhunter.json @@ -32,17 +32,17 @@ ] }, { - "id": "contract-name-pascalcase", + "id": "contract-name-camelcase", "severity": "WARNING", "data": [] }, { - "id": "func-name-camelcase", + "id": "func-name-mixedcase", "severity": "WARNING", "data": [] }, { - "id": "func-param-name-camelcase", + "id": "func-param-name-mixedcase", "severity": "WARNING", "data": [] }, diff --git a/toolchains/solidity/linter/core/solidhunter-lib/tests/linter.rs b/toolchains/solidity/linter/core/solidhunter-lib/tests/linter.rs index 9eef7543..05ad148b 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/tests/linter.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/tests/linter.rs @@ -140,13 +140,13 @@ macro_rules! test_directories { } test_directories! { - ContractNamePascalCase, + ContractNameCamelCase, FunctionMaxLines, ImportOnTop, LineMaxLen, MaxStatesCount, - FunctionNameCamelCase, - FunctionParamNameCamelCase, + FunctionNameMixedCase, + FunctionParamNameMixedCase, UseForbiddenName, ReasonString, NoInlineAssembly, From 95e3150c0e56ed8db78ee3e326701a0ffe308f33 Mon Sep 17 00:00:00 2001 From: 0xMemoryGrinder <35138272+0xMemoryGrinder@users.noreply.github.com> Date: Mon, 9 Oct 2023 21:39:07 -0400 Subject: [PATCH 234/325] fix: solidity/linter/core): fixed import on top rule and changed wrong error messgae in ordering rule --- .../core/solidhunter-lib/src/rules/order/import_on_top.rs | 8 ++++++-- .../core/solidhunter-lib/src/rules/order/ordering.rs | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/order/import_on_top.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/order/import_on_top.rs index 0931330f..4f3c7e46 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/order/import_on_top.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/order/import_on_top.rs @@ -45,8 +45,11 @@ impl RuleType for ImportOnTop { let mut res = Vec::new(); let mut last_import_location = 0; - for i in 1..file.data.items.len() { + for i in 0..file.data.items.len() { match &file.data.items[i] { + ast_extractor::Item::Pragma(_) => { + continue; + } ast_extractor::Item::Import(_) => { last_import_location = i; } @@ -56,7 +59,8 @@ impl RuleType for ImportOnTop { } } - for i in 1..file.data.items.len() { + + for i in 0..file.data.items.len() { if let ast_extractor::Item::Import(import) = &file.data.items[i] { if i > last_import_location { let location = (import.span().start(), import.span().end()); diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/order/ordering.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/order/ordering.rs index 4517e381..fe387755 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/order/ordering.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/order/ordering.rs @@ -7,7 +7,7 @@ use crate::rules::types::*; use crate::types::*; pub const RULE_ID: &str = "ordering"; -const MESSAGE: &str = "Import must be on top in the file"; +const MESSAGE: &str = "Invalid ordering of items in the file"; struct OrderingVisitor { file: SolidFile, From 3883ac12913a8ed9ad4024a3628b8924e256dfeb Mon Sep 17 00:00:00 2001 From: 0xMemoryGrinder <35138272+0xMemoryGrinder@users.noreply.github.com> Date: Tue, 10 Oct 2023 21:45:24 -0400 Subject: [PATCH 235/325] fix(solidity/linter/core): avoid crash when passing a wrong config filepath --- .../linter/core/solidhunter-lib/src/linter.rs | 12 +++--- toolchains/solidity/linter/core/src/main.rs | 19 ++++++---- toolchains/solidity/linter/core/src/server.rs | 37 ++++++++++++------- 3 files changed, 41 insertions(+), 27 deletions(-) diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/linter.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/linter.rs index cf831efc..9bafca92 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/linter.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/linter.rs @@ -23,19 +23,17 @@ pub struct SolidLinter { impl Default for SolidLinter { fn default() -> Self { - SolidLinter::new(".solidhunter.json") + SolidLinter::new() } } impl SolidLinter { - pub fn new(rules_config: &str) -> Self { - let mut linter = SolidLinter { + pub fn new() -> Self { + SolidLinter { files: Vec::new(), rule_factory: RuleFactory::default(), rules: vec![], - }; - linter._create_rules(rules_config).unwrap(); - linter + } } pub fn new_fileless() -> Self { @@ -53,7 +51,7 @@ impl SolidLinter { linter } - fn _create_rules(&mut self, rules_config: &str) -> Result<(), SolidHunterError> { + pub fn initialize_rules(&mut self, rules_config: &str) -> Result<(), SolidHunterError> { let res = parse_rules(rules_config)?; for rule in res.rules { self.rules.push(self.rule_factory.create_rule(rule)); diff --git a/toolchains/solidity/linter/core/src/main.rs b/toolchains/solidity/linter/core/src/main.rs index c9290c00..89b05c07 100644 --- a/toolchains/solidity/linter/core/src/main.rs +++ b/toolchains/solidity/linter/core/src/main.rs @@ -1,4 +1,5 @@ use clap::Parser; +use solidhunter_lib::errors::SolidHunterError; use solidhunter_lib::linter::SolidLinter; use solidhunter_lib::rules::rule_impl::create_rules_file; use solidhunter_lib::types::LintResult; @@ -73,8 +74,9 @@ struct Args { lsp: bool, } -fn lint_folder(args: Args) { - let mut linter: SolidLinter = SolidLinter::new(&args.rules_file); +fn lint_folder(args: Args) -> Result<(), SolidHunterError> { + let mut linter: SolidLinter = SolidLinter::new(); + linter.initialize_rules(&args.rules_file)?; let mut result = Vec::new(); for path in args.project_path { result.append(&mut linter.parse_folder(path)); @@ -82,6 +84,7 @@ fn lint_folder(args: Args) { for res in result { print_result(res); } + Ok(()) } fn print_result(result: LintResult) { @@ -97,14 +100,14 @@ fn print_result(result: LintResult) { } } -fn main() { +fn main() -> Result<(), SolidHunterError> { let args = Args::parse(); if args.lsp { eprintln!("Starting language server..."); run_server(args.rules_file.clone()); eprintln!("Done!"); - return; + return Ok(()); } if !args.to_json { @@ -130,13 +133,14 @@ fn main() { println!("Initializing rules file..."); create_rules_file(".solidhunter.json"); println!("Done!"); - return; + return Ok(()); } if !args.to_json && args.file_to_lint.is_empty() { - lint_folder(args); + lint_folder(args)?; } else if !args.file_to_lint.is_empty() { - let mut linter: SolidLinter = SolidLinter::new(&args.rules_file); + let mut linter: SolidLinter = SolidLinter::new(); + linter.initialize_rules(&args.rules_file)?; let result = linter.parse_file(args.file_to_lint); if !args.to_json { @@ -160,4 +164,5 @@ fn main() { } } } + Ok(()) } diff --git a/toolchains/solidity/linter/core/src/server.rs b/toolchains/solidity/linter/core/src/server.rs index ecfee797..3242d6c0 100644 --- a/toolchains/solidity/linter/core/src/server.rs +++ b/toolchains/solidity/linter/core/src/server.rs @@ -40,10 +40,14 @@ impl LanguageServer for Backend { .borrow() .log_message(MessageType::INFO, "Server initialized!"); - let file_res = std::fs::read_to_string(&self.config_file_path); - - if let Ok(file) = file_res { - self.linter.borrow_mut().replace(SolidLinter::new(&file)); + if std::path::Path::new(&self.config_file_path).is_file() { + let mut linter = SolidLinter::new(); + let res = linter.initialize_rules(&self.config_file_path); + if let Err(e) = res { + eprintln!("Error initializing rules: {:?}", e); + return; + } + self.linter.borrow_mut().replace(linter); } else { self.linter .borrow_mut() @@ -73,7 +77,13 @@ impl LanguageServer for Backend { let filepath = filepath_from_uri(¶ms.text_document.uri); let mut linter = self.linter.borrow_mut(); - let linter = linter.as_mut().unwrap(); + let linter = match linter.as_mut() { + Some(l) => l, + None => { + eprintln!("Linter cannot be ran due to previous errors"); + return; + } + }; let diags_res = linter.parse_content(filepath, ¶ms.text_document.text); if let Ok(diags) = diags_res { @@ -81,11 +91,7 @@ impl LanguageServer for Backend { .iter() .map(|d| diagnostic_from_lintdiag(d.clone())) .collect(); - eprintln!("diags: {:?}", diags); - self.client - .as_ref() - .borrow() - .log_message(MessageType::INFO, "diags: "); + eprintln!("diags: {:#?}", diags); self.client.as_ref().borrow().publish_diagnostics( params.text_document.uri.clone(), diags, @@ -108,7 +114,13 @@ impl LanguageServer for Backend { let filepath = filepath_from_uri(¶ms.text_document.uri); let mut linter = self.linter.borrow_mut(); - let linter = linter.as_mut().unwrap(); + let linter = match linter.as_mut() { + Some(l) => l, + None => { + eprintln!("Linter cannot be ran due to previous errors"); + return; + } + }; let diags_res = linter.parse_content(filepath, ¶ms.content_changes[0].text); if let Ok(diags) = diags_res { @@ -116,7 +128,7 @@ impl LanguageServer for Backend { .iter() .map(|d| diagnostic_from_lintdiag(d.clone())) .collect(); - eprintln!("diags: {:?}", diags); + eprintln!("diags: {:#?}", diags); self.client.as_ref().borrow().publish_diagnostics( params.text_document.uri.clone(), diags, @@ -137,7 +149,6 @@ pub fn filepath_from_uri(uri: &Url) -> String { } fn diagnostic_from_lintdiag(diag: LintDiag) -> Diagnostic { - eprintln!("diag: {:?}", diag); Diagnostic { range: Range { start: Position { From 18d7d5b0c5d903c8311c2a8d40483358080dc417 Mon Sep 17 00:00:00 2001 From: 0xMemoryGrinder <35138272+0xMemoryGrinder@users.noreply.github.com> Date: Wed, 11 Oct 2023 11:57:06 -0400 Subject: [PATCH 236/325] fix(solidity/linter/core): fixed ordering rule for two consecutive items of the same type --- .../src/rules/order/ordering.rs | 20 +++++++++++++++---- .../linter/core/solidhunter-lib/src/types.rs | 1 - 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/order/ordering.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/order/ordering.rs index fe387755..111c28e4 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/order/ordering.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/order/ordering.rs @@ -24,10 +24,10 @@ impl OrderingVisitor { fn new(file: SolidFile, data: RuleEntry) -> OrderingVisitor { let authorized_file_items: HashMap>> = [ (FileItemType::Pragma, vec![None]), - (FileItemType::Import, vec![None, Some(FileItemType::Pragma)]), + (FileItemType::Import, vec![None, Some(FileItemType::Pragma), Some(FileItemType::Import)]), ( FileItemType::Enum, - vec![None, Some(FileItemType::Pragma), Some(FileItemType::Import)], + vec![None, Some(FileItemType::Pragma), Some(FileItemType::Import), Some(FileItemType::Enum)], ), ( FileItemType::Struct, @@ -36,6 +36,7 @@ impl OrderingVisitor { Some(FileItemType::Pragma), Some(FileItemType::Import), Some(FileItemType::Enum), + Some(FileItemType::Struct), ], ), ( @@ -46,6 +47,7 @@ impl OrderingVisitor { Some(FileItemType::Import), Some(FileItemType::Enum), Some(FileItemType::Struct), + Some(FileItemType::ContractInterface), ], ), ( @@ -57,6 +59,7 @@ impl OrderingVisitor { Some(FileItemType::Enum), Some(FileItemType::Struct), Some(FileItemType::ContractInterface), + Some(FileItemType::ContractLibrary), ], ), ( @@ -69,6 +72,7 @@ impl OrderingVisitor { Some(FileItemType::Struct), Some(FileItemType::ContractInterface), Some(FileItemType::ContractLibrary), + Some(FileItemType::Contract), ], ), ] @@ -77,10 +81,10 @@ impl OrderingVisitor { .collect(); let authorized_contract_items: HashMap>> = [ - (ContractItemType::Udt, vec![None]), + (ContractItemType::Udt, vec![None, Some(ContractItemType::Udt)]), ( ContractItemType::Struct, - vec![None, Some(ContractItemType::Udt)], + vec![None, Some(ContractItemType::Udt), Some(ContractItemType::Struct)], ), ( ContractItemType::Enum, @@ -88,6 +92,7 @@ impl OrderingVisitor { None, Some(ContractItemType::Udt), Some(ContractItemType::Struct), + Some(ContractItemType::Enum), ], ), ( @@ -97,6 +102,7 @@ impl OrderingVisitor { Some(ContractItemType::Udt), Some(ContractItemType::Struct), Some(ContractItemType::Enum), + Some(ContractItemType::Property), ], ), ( @@ -107,6 +113,7 @@ impl OrderingVisitor { Some(ContractItemType::Struct), Some(ContractItemType::Enum), Some(ContractItemType::Property), + Some(ContractItemType::Event), ], ), ( @@ -118,6 +125,7 @@ impl OrderingVisitor { Some(ContractItemType::Enum), Some(ContractItemType::Property), Some(ContractItemType::Event), + Some(ContractItemType::Modifier), ], ), ( @@ -172,6 +180,7 @@ impl OrderingVisitor { Some(ContractItemType::Constructor), Some(ContractItemType::Receive), Some(ContractItemType::FallBack), + Some(ContractItemType::ExternalFunction) ], ), ( @@ -188,6 +197,7 @@ impl OrderingVisitor { Some(ContractItemType::Receive), Some(ContractItemType::FallBack), Some(ContractItemType::ExternalFunction), + Some(ContractItemType::PublicFunction), ], ), ( @@ -205,6 +215,7 @@ impl OrderingVisitor { Some(ContractItemType::FallBack), Some(ContractItemType::ExternalFunction), Some(ContractItemType::PublicFunction), + Some(ContractItemType::InternalFunction), ], ), ( @@ -223,6 +234,7 @@ impl OrderingVisitor { Some(ContractItemType::ExternalFunction), Some(ContractItemType::PublicFunction), Some(ContractItemType::InternalFunction), + Some(ContractItemType::PrivateFunction), ], ), ] diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/types.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/types.rs index 06a75d76..76336141 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/types.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/types.rs @@ -1,7 +1,6 @@ use crate::errors::SolidHunterError; use colored::Colorize; use serde::{Deserialize, Serialize}; -use std::cmp::min; use std::fmt; pub type LintResult = Result, SolidHunterError>; From 153d94c4e332920ca86f1ece59d560d0af42b63b Mon Sep 17 00:00:00 2001 From: 0xtekgrinder <0xtekgrinder@protonmail.com> Date: Wed, 11 Oct 2023 18:56:56 -0400 Subject: [PATCH 237/325] fix(solidity/linter/core): multiple fix and refactor of all the rules to match solhint --- .../src/rules/best_practises/custom_errors.rs | 10 +- .../rules/best_practises/explicit_types.rs | 125 +++++++++------- .../best_practises/function_max_lines.rs | 44 ++++-- .../{line_maxlen.rs => max_line_length.rs} | 49 ++++--- .../rules/best_practises/max_states_count.rs | 30 ++-- .../src/rules/best_practises/mod.rs | 35 ++--- .../src/rules/best_practises/no_console.rs | 11 +- .../{empty_block.rs => no_empty_block.rs} | 25 ++-- .../{global_import.rs => no_global_import.rs} | 25 ++-- .../best_practises/one_contract_per_file.rs | 34 ++--- .../rules/best_practises/payable_fallback.rs | 16 +- .../src/rules/best_practises/reason_string.rs | 137 +++++++++++------- .../src/rules/naming/const_name_snakecase.rs | 22 +-- .../rules/naming/contract_name_camelcase.rs | 22 +-- .../src/rules/naming/event_name_camelcase.rs | 22 +-- ...func_name.rs => foundry_test_functions.rs} | 59 +++++--- .../src/rules/naming/func_name_mixedcase.rs | 22 +-- .../rules/naming/func_param_name_mixedcase.rs | 22 +-- .../solidhunter-lib/src/rules/naming/mod.rs | 14 +- .../rules/naming/modifier_name_mixedcase.rs | 22 +-- .../rules/naming/named_parameters_mapping.rs | 10 +- .../naming/private_vars_leading_underscore.rs | 44 +++--- .../src/rules/naming/use_forbidden_name.rs | 22 +-- .../src/rules/naming/var_name_mixedcase.rs | 22 +-- .../src/rules/order/import_on_top.rs | 23 ++- .../solidhunter-lib/src/rules/order/mod.rs | 12 +- .../src/rules/order/ordering.rs | 39 +++-- .../visibility_modifier_order.rs | 17 ++- .../solidhunter-lib/src/rules/rule_impl.rs | 2 - .../src/rules/security/avoid_tx_origin.rs | 26 ++-- .../{naming => security}/func_visibility.rs | 37 +++-- .../solidhunter-lib/src/rules/security/mod.rs | 11 +- .../src/rules/security/no_inline_assembly.rs | 14 +- .../src/rules/security/not_rely_on_time.rs | 20 +-- .../src/rules/security/state_visibility.rs | 20 +-- .../core/solidhunter-lib/src/rules/types.rs | 5 +- .../linter/core/solidhunter-lib/src/types.rs | 28 ++-- .../testdata/AvoidTxOrigin/.solidhunter.json | 8 +- .../ConstNameSnakeCase/.solidhunter.json | 61 +------- .../ContractNameCamelCase/.solidhunter.json | 8 +- .../testdata/CustomErrors/.solidhunter.json | 58 +------- .../testdata/CustomErrors/findings.csv | 3 +- .../testdata/EmptyBlock/.solidhunter.json | 60 -------- .../testdata/EmptyBlock/findings.csv | 2 - .../EventNameCamelCase/.solidhunter.json | 58 +------- .../testdata/ExplicitTypes/.solidhunter.json | 6 +- .../FoundryFunctionName/.solidhunter.json | 60 -------- .../testdata/FoundryFunctionName/findings.csv | 1 - .../FoundryTestFunctions/.solidhunter.json | 10 ++ .../file.t.sol | 0 .../FoundryTestFunctions/findings.csv | 1 + .../FunctionMaxLines/.solidhunter.json | 45 +----- .../FunctionNameMixedCase/.solidhunter.json | 5 +- .../.solidhunter.json | 5 +- .../FunctionVisibility/.solidhunter.json | 61 +------- .../testdata/GlobalImport/.solidhunter.json | 65 --------- .../testdata/GlobalImport/findings.csv | 2 - .../testdata/ImplicitTypes/.solidhunter.json | 6 +- .../testdata/ImportOnTop/.solidhunter.json | 53 +------ .../testdata/LineMaxLen/.solidhunter.json | 60 -------- .../testdata/LineMaxLen/findings.csv | 1 - .../testdata/MaxLineLength/.solidhunter.json | 10 ++ .../{LineMaxLen => MaxLineLength}/file.sol | 0 .../testdata/MaxLineLength/findings.csv | 1 + .../testdata/MaxStatesCount/.solidhunter.json | 50 +------ .../ModifierNameMixedcase/.solidhunter.json | 2 - .../NamedParametersMapping/.solidhunter.json | 63 +------- .../testdata/NoConsole/.solidhunter.json | 58 +------- .../testdata/NoEmptyBlock/.solidhunter.json | 9 ++ .../{EmptyBlock => NoEmptyBlock}/file.sol | 0 .../testdata/NoEmptyBlock/findings.csv | 2 + .../testdata/NoGlobalImport/.solidhunter.json | 9 ++ .../{GlobalImport => NoGlobalImport}/add.sol | 0 .../{GlobalImport => NoGlobalImport}/file.sol | 0 .../testdata/NoGlobalImport/findings.csv | 2 + .../NoInlineAssembly/.solidhunter.json | 58 +------- .../testdata/NotRelyOnTime/.solidhunter.json | 5 +- .../OneContractPerFile/.solidhunter.json | 58 +------- .../testdata/Ordering/.solidhunter.json | 5 +- .../PayableFallback/.solidhunter.json | 58 +------- .../.solidhunter.json | 49 +------ .../testdata/ReasonString/.solidhunter.json | 52 +------ .../testdata/ReasonString/file.sol | 9 +- .../testdata/ReasonString/findings.csv | 8 +- .../StateVisibility/.solidhunter.json | 62 -------- .../UseForbiddenName/.solidhunter.json | 53 +------ .../VarNameMixedCase/.solidhunter.json | 8 +- .../VisibilityModifierOrder/.solidhunter.json | 61 +------- .../core/solidhunter-lib/tests/linter.rs | 13 +- 89 files changed, 722 insertions(+), 1720 deletions(-) rename toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/{line_maxlen.rs => max_line_length.rs} (55%) rename toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/{empty_block.rs => no_empty_block.rs} (83%) rename toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/{global_import.rs => no_global_import.rs} (81%) rename toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/{foundry_func_name.rs => foundry_test_functions.rs} (64%) rename toolchains/solidity/linter/core/solidhunter-lib/src/rules/{best_practises => order}/visibility_modifier_order.rs (86%) rename toolchains/solidity/linter/core/solidhunter-lib/src/rules/{naming => security}/func_visibility.rs (76%) delete mode 100644 toolchains/solidity/linter/core/solidhunter-lib/testdata/EmptyBlock/.solidhunter.json delete mode 100644 toolchains/solidity/linter/core/solidhunter-lib/testdata/EmptyBlock/findings.csv delete mode 100644 toolchains/solidity/linter/core/solidhunter-lib/testdata/FoundryFunctionName/.solidhunter.json delete mode 100644 toolchains/solidity/linter/core/solidhunter-lib/testdata/FoundryFunctionName/findings.csv create mode 100644 toolchains/solidity/linter/core/solidhunter-lib/testdata/FoundryTestFunctions/.solidhunter.json rename toolchains/solidity/linter/core/solidhunter-lib/testdata/{FoundryFunctionName => FoundryTestFunctions}/file.t.sol (100%) create mode 100644 toolchains/solidity/linter/core/solidhunter-lib/testdata/FoundryTestFunctions/findings.csv delete mode 100644 toolchains/solidity/linter/core/solidhunter-lib/testdata/GlobalImport/.solidhunter.json delete mode 100644 toolchains/solidity/linter/core/solidhunter-lib/testdata/GlobalImport/findings.csv delete mode 100644 toolchains/solidity/linter/core/solidhunter-lib/testdata/LineMaxLen/.solidhunter.json delete mode 100644 toolchains/solidity/linter/core/solidhunter-lib/testdata/LineMaxLen/findings.csv create mode 100644 toolchains/solidity/linter/core/solidhunter-lib/testdata/MaxLineLength/.solidhunter.json rename toolchains/solidity/linter/core/solidhunter-lib/testdata/{LineMaxLen => MaxLineLength}/file.sol (100%) create mode 100644 toolchains/solidity/linter/core/solidhunter-lib/testdata/MaxLineLength/findings.csv create mode 100644 toolchains/solidity/linter/core/solidhunter-lib/testdata/NoEmptyBlock/.solidhunter.json rename toolchains/solidity/linter/core/solidhunter-lib/testdata/{EmptyBlock => NoEmptyBlock}/file.sol (100%) create mode 100644 toolchains/solidity/linter/core/solidhunter-lib/testdata/NoEmptyBlock/findings.csv create mode 100644 toolchains/solidity/linter/core/solidhunter-lib/testdata/NoGlobalImport/.solidhunter.json rename toolchains/solidity/linter/core/solidhunter-lib/testdata/{GlobalImport => NoGlobalImport}/add.sol (100%) rename toolchains/solidity/linter/core/solidhunter-lib/testdata/{GlobalImport => NoGlobalImport}/file.sol (100%) create mode 100644 toolchains/solidity/linter/core/solidhunter-lib/testdata/NoGlobalImport/findings.csv diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/custom_errors.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/custom_errors.rs index c91e9b0c..1ba81f34 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/custom_errors.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/custom_errors.rs @@ -3,8 +3,12 @@ use crate::rules::types::*; use crate::types::*; use ast_extractor::*; +// global pub const RULE_ID: &str = "custom-errors"; +// specific +const DEFAULT_SEVERITY: Severity = Severity::WARNING; + pub struct CustomErrors { data: RuleEntry, } @@ -29,7 +33,7 @@ impl CustomErrors { }, }, message: format!("Use Custom Errors instead of {} statements", diag_type), - severity: Some(self.data.severity), + severity: self.data.severity, code: None, source: None, uri: file.path.clone(), @@ -75,8 +79,8 @@ impl CustomErrors { pub(crate) fn create_default() -> RuleEntry { RuleEntry { id: RULE_ID.to_string(), - severity: Severity::WARNING, - data: vec![], + severity: DEFAULT_SEVERITY, + data: None, } } } diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/explicit_types.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/explicit_types.rs index 4831ffdb..b141048a 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/explicit_types.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/explicit_types.rs @@ -2,11 +2,17 @@ use crate::linter::SolidFile; use crate::rules::types::*; use crate::types::*; use ast_extractor::*; -use serde_json::Value; +// TODO test output + +// global pub const RULE_ID: &str = "explicit-types"; +// specific const DEFAULT_RULE: &str = "explicit"; +const DEFAULT_SEVERITY: Severity = Severity::WARNING; +const EXPLICIT_TYPES: &[&str] = &["uint256", "int256", "uint8", "int8", "uint16", "int16", "uint32", "int32", "uint64", "int64", "uint128", "int128"]; +const IMPLICIT_TYPES: &[&str] = &["uint", "int"]; pub struct ExplicitTypes { rule: String, @@ -14,38 +20,52 @@ pub struct ExplicitTypes { } pub struct ExplicitTypesVisitor { - type_names: Vec, - type_inits: Vec, + explicit: bool, + defs: Vec, + decls: Vec, + types: Vec } impl<'ast> Visit<'ast> for ExplicitTypesVisitor { - fn visit_type(&mut self, ty: &'ast Type) { - match ty { - Type::Int(_, _) => { - self.type_names.push(ty.clone()); - } - Type::Uint(_, _) => { - self.type_names.push(ty.clone()); - } - _ => visit::visit_type(self, ty), - } - } fn visit_variable_definition(&mut self, var: &'ast VariableDefinition) { if let Some((_, expr)) = &var.initializer { visit::visit_expr(self, expr); } - visit::visit_variable_definition(self, var); + if self.is_type_match(&var.ty) { + self.defs.push(var.clone()) + } + } + + fn visit_variable_declaration(&mut self,var: &'ast VariableDeclaration) { + if self.is_type_match(&var.ty) { + self.decls.push(var.clone()) + } + } + + fn visit_type(&mut self,ty: &'ast Type) { + if self.is_type_match(ty) { + self.types.push(ty.clone()); + } + } +} + +impl ExplicitTypesVisitor { + fn is_type_match(&self, ty: &Type) -> bool { + if self.explicit { + IMPLICIT_TYPES.iter().any(|typ| { + ty.to_string() == *typ + }) + } else { + EXPLICIT_TYPES.iter().any(|typ| { + ty.to_string() == *typ + }) + } } } impl ExplicitTypes { - fn create_diag(&self, file: &SolidFile, ty: Box, line: &str) -> LintDiag { - let rule_formated = match self.rule.as_str() { - "explicit" => "Explicit", - "implicit" => "Implicit", - _ => "Explicit", - }; + fn create_diag(&self, file: &SolidFile, ty: Box, var: Option) -> LintDiag { LintDiag { range: Range { start: Position { @@ -58,42 +78,38 @@ impl ExplicitTypes { }, }, id: RULE_ID.to_string(), - message: format!("{} types are not allowed: {}", rule_formated, line.len()), - severity: Some(self.data.severity), + message: format!("Rule is set with {} type [var/s: {}]", self.rule, var.unwrap_or("\"\"".to_string())), + severity: self.data.severity, code: None, source: None, uri: file.path.clone(), source_file_content: file.content.clone(), } } - - fn _check_type(&self, ty: &str, file: &SolidFile, span: Box) -> Option { - if (self.rule == "explicit" && (ty == "int" || ty == "uint")) - || (self.rule == "implicit" && (ty != "int" && ty != "uint")) - { - return Some(self.create_diag(file, span, ty)); - } - None - } } impl RuleType for ExplicitTypes { fn diagnose(&self, file: &SolidFile, _files: &[SolidFile]) -> Vec { let mut res = Vec::new(); let mut visitor = ExplicitTypesVisitor { - type_names: vec![], - type_inits: vec![], + explicit: self.rule == "explicit", + defs: vec![], + decls: vec![], + types: vec![] }; visitor.visit_file(&file.data); - for ty in visitor.type_names { - if let Some(diag) = self._check_type(&ty.to_string(), file, Box::new(ty.clone())) { - res.push(diag); - } + for def in visitor.defs { + res.push(self.create_diag(file, Box::new(def.ty), Some(def.name.0.to_string()))); } - for ty in visitor.type_inits { - if let Some(diag) = self._check_type(&ty.to_string(), file, Box::new(ty.clone())) { - res.push(diag); - } + for decl in visitor.decls { + let name = match decl.name { + Some(ident) => Some(ident.0.to_string()), + _ => None + }; + res.push(self.create_diag(file, Box::new(decl.ty), name)); + } + for ty in visitor.types { + res.push(self.create_diag(file, Box::new(ty), None)); } res } @@ -101,16 +117,23 @@ impl RuleType for ExplicitTypes { impl ExplicitTypes { pub(crate) fn create(data: RuleEntry) -> Box { - let value = if !data.data.is_empty() { - match &data.data[0] { - Value::String(val) => val.as_str(), - _ => DEFAULT_RULE, + let mut value = DEFAULT_RULE.to_string(); + + if let Some(data) = &data.data { + let parsed: Result = serde_json::from_value(data.clone()); + match parsed { + Ok(val) => { + value = val + }, + Err(_) => { + eprintln!("{} rule : bad config data", RULE_ID); } + } } else { - DEFAULT_RULE - }; + eprintln!("{} rule : bad config data", RULE_ID); + } let rule = ExplicitTypes { - rule: value.to_string(), + rule: value, data, }; Box::new(rule) @@ -119,8 +142,8 @@ impl ExplicitTypes { pub(crate) fn create_default() -> RuleEntry { RuleEntry { id: RULE_ID.to_string(), - severity: Severity::WARNING, - data: vec![serde_json::Value::String(DEFAULT_RULE.to_string())], + severity: DEFAULT_SEVERITY, + data: Some(DEFAULT_RULE.into()), } } } diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/function_max_lines.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/function_max_lines.rs index 3e9e7731..a1da59a6 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/function_max_lines.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/function_max_lines.rs @@ -1,19 +1,19 @@ -use ast_extractor::{Spanned, FunctionBody}; +use ast_extractor::{FunctionBody, Spanned}; use crate::linter::SolidFile; use crate::rules::types::*; use crate::types::*; -// const DEFAULT_SEVERITY: &str = "warn"; -const DEFAULT_MESSAGE: &str = "Function contains too much lines"; +// global pub const RULE_ID: &str = "function-max-lines"; // specific -pub const DEFAULT_MAX_LINES: usize = 20; +const DEFAULT_SEVERITY: Severity = Severity::WARNING; +const DEFAULT_MAX_LINES: usize = 50; pub struct FunctionMaxLines { number_max_lines: usize, - _data: RuleEntry, + data: RuleEntry, } impl RuleType for FunctionMaxLines { @@ -24,13 +24,20 @@ impl RuleType for FunctionMaxLines { for function in ast_extractor::retriever::retrieve_functions_nodes(&contract) { let report = check_function_lines(&function, self.number_max_lines); if let Some(report) = report { + let start = report.start.line; + let end = report.end.line; + res.push(LintDiag { id: RULE_ID.to_string(), range: report, - severity: Some(Severity::WARNING), + severity: self.data.severity, code: None, source: None, - message: DEFAULT_MESSAGE.to_string(), + message: format!( + "Function body contains {} lines but allowed no more than {} lines", + end - start, + self.number_max_lines + ), uri: _file.path.clone(), source_file_content: _file.content.clone(), }); @@ -60,7 +67,7 @@ fn check_function_lines( line: end_span.line, character: end_span.column, }, - }) + }); } } None @@ -70,15 +77,20 @@ impl FunctionMaxLines { pub fn create(data: RuleEntry) -> Box { let mut max_number_lines = DEFAULT_MAX_LINES; - if !data.data.is_empty() { - max_number_lines = match data.data[0].as_u64() { - Some(v) => v as usize, - None => DEFAULT_MAX_LINES, - }; + if let Some(data) = &data.data { + let parsed: Result = serde_json::from_value(data.clone()); + match parsed { + Ok(val) => max_number_lines = val, + Err(_) => { + eprintln!("{} rule : bad config data", RULE_ID); + } + } + } else { + eprintln!("{} rule : bad config data", RULE_ID); } let rule = FunctionMaxLines { number_max_lines: max_number_lines, - _data: data, + data, }; Box::new(rule) } @@ -86,8 +98,8 @@ impl FunctionMaxLines { pub fn create_default() -> RuleEntry { RuleEntry { id: RULE_ID.to_string(), - severity: Severity::WARNING, - data: vec![serde_json::Value::String(DEFAULT_MAX_LINES.to_string())], + severity: DEFAULT_SEVERITY, + data: Some(DEFAULT_MAX_LINES.into()), } } } diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/line_maxlen.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/max_line_length.rs similarity index 55% rename from toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/line_maxlen.rs rename to toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/max_line_length.rs index 6110e06b..f5e629fc 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/line_maxlen.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/max_line_length.rs @@ -2,16 +2,19 @@ use crate::linter::SolidFile; use crate::rules::types::*; use crate::types::*; -pub const RULE_ID: &str = "line-max-len"; +// global +pub const RULE_ID: &str = "max-line-length"; -const DEFAULT_LENGTH: usize = 80; +// specific +const DEFAULT_LENGTH: usize = 120; +const DEFAULT_SEVERITY: Severity = Severity::ERROR; -pub struct LineMaxLen { +pub struct MaxLineLength { max_len: usize, data: RuleEntry, } -impl LineMaxLen { +impl MaxLineLength { fn create_diag(&self, file: &SolidFile, line_idx: usize, line: &str) -> LintDiag { LintDiag { range: Range { @@ -25,8 +28,12 @@ impl LineMaxLen { }, }, id: RULE_ID.to_string(), - message: format!("Line is too long: {}", line.len()), - severity: Some(self.data.severity), + message: format!( + "Line length must be no more than {} but current length is {}", + self.max_len, + line.len() + ), + severity: self.data.severity, code: None, source: None, uri: file.path.clone(), @@ -35,7 +42,7 @@ impl LineMaxLen { } } -impl RuleType for LineMaxLen { +impl RuleType for MaxLineLength { fn diagnose(&self, file: &SolidFile, _files: &[SolidFile]) -> Vec { let mut res = Vec::new(); let mut line_idx = 1; @@ -50,19 +57,23 @@ impl RuleType for LineMaxLen { } } -impl LineMaxLen { +impl MaxLineLength { pub(crate) fn create(data: RuleEntry) -> Box { - let mut max_number_lines = DEFAULT_LENGTH; + let mut max_line_length = DEFAULT_LENGTH; - if !data.data.is_empty() { - max_number_lines = match data.data[0].as_u64() { - Some(val) => val as usize, - None => DEFAULT_LENGTH, - }; + if let Some(data) = &data.data { + let parsed: Result = serde_json::from_value(data.clone()); + match parsed { + Ok(val) => max_line_length = val, + Err(_) => { + eprintln!("{} rule : bad config data", RULE_ID); + } + } + } else { + eprintln!("{} rule : bad config data", RULE_ID); } - - let rule = LineMaxLen { - max_len: max_number_lines, + let rule = MaxLineLength { + max_len: max_line_length, data, }; Box::new(rule) @@ -71,8 +82,8 @@ impl LineMaxLen { pub(crate) fn create_default() -> RuleEntry { RuleEntry { id: RULE_ID.to_string(), - severity: Severity::WARNING, - data: vec![serde_json::Value::String(DEFAULT_LENGTH.to_string())], + severity: DEFAULT_SEVERITY, + data: Some(DEFAULT_LENGTH.into()), } } } diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/max_states_count.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/max_states_count.rs index 31ff1c3a..fbe4c45e 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/max_states_count.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/max_states_count.rs @@ -3,8 +3,12 @@ use crate::rules::types::*; use crate::types::*; use ast_extractor::*; +// global pub const RULE_ID: &str = "max-states-count"; + +// specific const DEFAULT_MAX_STATES: usize = 15; +const DEFAULT_SEVERITY: Severity = Severity::WARNING; pub struct MaxStatesCount { max_states: usize, @@ -30,8 +34,11 @@ impl MaxStatesCount { character: location.1.column, }, }, - message: format!("Too many states: {}", count), - severity: Some(self.data.severity), + message: format!( + "Contract has {} states declarations but allowed no more than {}", + count, self.max_states + ), + severity: self.data.severity, code: None, source: None, uri: file.path.clone(), @@ -68,11 +75,16 @@ impl MaxStatesCount { pub(crate) fn create(data: RuleEntry) -> Box { let mut max_states = DEFAULT_MAX_STATES; - if !data.data.is_empty() { - max_states = match data.data[0].as_u64() { - Some(val) => val as usize, - None => DEFAULT_MAX_STATES, - }; + if let Some(data) = &data.data { + let parsed: Result = serde_json::from_value(data.clone()); + match parsed { + Ok(val) => max_states = val, + Err(_) => { + eprintln!("{} rule : bad config data", RULE_ID); + } + } + } else { + eprintln!("{} rule : bad config data", RULE_ID); } let rule = MaxStatesCount { max_states, data }; Box::new(rule) @@ -81,8 +93,8 @@ impl MaxStatesCount { pub(crate) fn create_default() -> RuleEntry { RuleEntry { id: RULE_ID.to_string(), - severity: Severity::WARNING, - data: vec![serde_json::Value::String(DEFAULT_MAX_STATES.to_string())], + severity: DEFAULT_SEVERITY, + data: Some(DEFAULT_MAX_STATES.into()), } } } diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/mod.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/mod.rs index 2ec7c9e9..820898b9 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/mod.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/mod.rs @@ -2,56 +2,52 @@ use crate::rules::types::{RuleEntry, RulesMap}; use std::collections::HashMap; #[macro_use] -pub mod line_maxlen; +pub mod max_line_length; pub mod custom_errors; -pub mod empty_block; pub mod explicit_types; pub mod function_max_lines; -pub mod global_import; pub mod max_states_count; pub mod no_console; +pub mod no_empty_block; +pub mod no_global_import; pub mod one_contract_per_file; pub mod payable_fallback; pub mod reason_string; -pub mod visibility_modifier_order; // List all rules - use crate::rules::best_practises::custom_errors::CustomErrors; -use crate::rules::best_practises::empty_block::EmptyBlock; use crate::rules::best_practises::explicit_types::ExplicitTypes; use crate::rules::best_practises::function_max_lines::FunctionMaxLines; -use crate::rules::best_practises::global_import::GlobalImport; -use crate::rules::best_practises::line_maxlen::LineMaxLen; +use crate::rules::best_practises::max_line_length::MaxLineLength; use crate::rules::best_practises::max_states_count::MaxStatesCount; use crate::rules::best_practises::no_console::NoConsole; +use crate::rules::best_practises::no_empty_block::NoEmptyBlock; +use crate::rules::best_practises::no_global_import::NoGlobalImport; use crate::rules::best_practises::one_contract_per_file::OneContractPerFile; use crate::rules::best_practises::payable_fallback::PayableFallback; use crate::rules::best_practises::reason_string::ReasonString; -use crate::rules::best_practises::visibility_modifier_order::VisibilityModiferOrder; use crate::rules::RuleBuilder; pub fn create_default_rules() -> Vec { vec![ - LineMaxLen::create_default(), + MaxLineLength::create_default(), MaxStatesCount::create_default(), FunctionMaxLines::create_default(), ReasonString::create_default(), NoConsole::create_default(), OneContractPerFile::create_default(), CustomErrors::create_default(), - GlobalImport::create_default(), - EmptyBlock::create_default(), + NoGlobalImport::create_default(), + NoEmptyBlock::create_default(), ExplicitTypes::create_default(), PayableFallback::create_default(), - VisibilityModiferOrder::create_default(), ] } pub fn create_rules() -> RulesMap { let mut rules: HashMap = HashMap::new(); - rules.insert(line_maxlen::RULE_ID.to_string(), LineMaxLen::create); + rules.insert(max_line_length::RULE_ID.to_string(), MaxLineLength::create); rules.insert( max_states_count::RULE_ID.to_string(), @@ -67,18 +63,17 @@ pub fn create_rules() -> RulesMap { one_contract_per_file::RULE_ID.to_string(), OneContractPerFile::create, ); - rules.insert(global_import::RULE_ID.to_string(), GlobalImport::create); - rules.insert(empty_block::RULE_ID.to_string(), EmptyBlock::create); + rules.insert( + no_global_import::RULE_ID.to_string(), + NoGlobalImport::create, + ); + rules.insert(no_empty_block::RULE_ID.to_string(), NoEmptyBlock::create); rules.insert(explicit_types::RULE_ID.to_string(), ExplicitTypes::create); rules.insert(no_console::RULE_ID.to_string(), NoConsole::create); rules.insert( payable_fallback::RULE_ID.to_string(), PayableFallback::create, ); - rules.insert( - visibility_modifier_order::RULE_ID.to_string(), - VisibilityModiferOrder::create, - ); rules } diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/no_console.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/no_console.rs index 50e8e64c..ebf1088b 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/no_console.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/no_console.rs @@ -4,7 +4,10 @@ use crate::linter::SolidFile; use crate::rules::types::{RuleEntry, RuleType}; use crate::types::{LintDiag, Position, Range, Severity}; +// global pub const RULE_ID: &str = "no-console"; + +// specific const DEFAULT_SEVERITY: Severity = Severity::WARNING; pub struct NoConsole { @@ -31,7 +34,7 @@ impl NoConsole { }, }, message, - severity: Some(self.data.severity), + severity: self.data.severity, code: None, source: None, uri: file.path.clone(), @@ -54,7 +57,7 @@ impl RuleType for NoConsole { let diag = self.create_diag( file, (expr_ident.span().start(), expr_ident.span().end()), - format!("{}: console.log(...) is forbidden", RULE_ID), + "Unexpected console statement".to_string(), ); res.push(diag); } @@ -78,7 +81,7 @@ impl RuleType for NoConsole { let diag = self.create_diag( file, (header.span().start(), header.span().end()), - format!("{}: forbidden usage of console headers", RULE_ID), + "Unexpected import of console file".to_string(), ); res.push(diag); } @@ -101,7 +104,7 @@ impl NoConsole { RuleEntry { id: RULE_ID.to_string(), severity: DEFAULT_SEVERITY, - data: vec![], + data: None, } } } diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/empty_block.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/no_empty_block.rs similarity index 83% rename from toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/empty_block.rs rename to toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/no_empty_block.rs index f62b4ee9..c61be310 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/empty_block.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/no_empty_block.rs @@ -6,22 +6,25 @@ use ast_extractor::{ Spanned, }; -// const DEFAULT_SEVERITY: &str = "warn"; -const DEFAULT_MESSAGE: &str = "should not be an empty block"; -pub const RULE_ID: &str = "empty-block"; +// global +pub const RULE_ID: &str = "no-empty-block"; -pub struct EmptyBlock { - _data: RuleEntry, +// specific +const DEFAULT_SEVERITY: Severity = Severity::WARNING; +const DEFAULT_MESSAGE: &str = "Code contains empty blocks"; + +pub struct NoEmptyBlock { + data: RuleEntry, } -impl RuleType for EmptyBlock { +impl RuleType for NoEmptyBlock { fn diagnose(&self, _file: &SolidFile, _files: &[SolidFile]) -> Vec { let mut res = Vec::new(); let _reports = check_empty_block(_file); for report in _reports.iter().flatten() { res.push(LintDiag { id: RULE_ID.to_string(), - severity: Some(Severity::WARNING), + severity: self.data.severity, range: report.clone(), code: None, source: None, @@ -71,17 +74,17 @@ fn check_empty_block(file: &SolidFile) -> Vec> { res } -impl EmptyBlock { +impl NoEmptyBlock { pub fn create(data: RuleEntry) -> Box { - let rule = EmptyBlock { _data: data }; + let rule = NoEmptyBlock { data }; Box::new(rule) } pub fn create_default() -> RuleEntry { RuleEntry { id: RULE_ID.to_string(), - severity: Severity::WARNING, - data: vec![], + severity: DEFAULT_SEVERITY, + data: None, } } } diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/global_import.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/no_global_import.rs similarity index 81% rename from toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/global_import.rs rename to toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/no_global_import.rs index 0884b87a..3a5a3a70 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/global_import.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/no_global_import.rs @@ -4,15 +4,18 @@ use crate::linter::SolidFile; use crate::rules::types::*; use crate::types::*; -// const DEFAULT_SEVERITY: &str = "warn"; -const DEFAULT_MESSAGE: &str = "Import should not be global"; -pub const RULE_ID: &str = "global-import"; +// global +pub const RULE_ID: &str = "no-global-import"; -pub struct GlobalImport { - _data: RuleEntry, +// specific +const DEFAULT_MESSAGE: &str = "Import should not be global. Specify names to import individually or bind all exports of the module into a name (import \"path\" as Name)"; +const DEFAULT_SEVERITY: Severity = Severity::WARNING; + +pub struct NoGlobalImport { + data: RuleEntry, } -impl RuleType for GlobalImport { +impl RuleType for NoGlobalImport { fn diagnose(&self, _file: &SolidFile, _files: &[SolidFile]) -> Vec { let mut res = Vec::new(); @@ -21,7 +24,7 @@ impl RuleType for GlobalImport { res.push(LintDiag { id: RULE_ID.to_string(), range: report, - severity: Some(Severity::WARNING), + severity: self.data.severity, code: None, source: None, message: DEFAULT_MESSAGE.to_string(), @@ -71,17 +74,17 @@ fn check_global_import(file: &SolidFile) -> Vec> { reports } -impl GlobalImport { +impl NoGlobalImport { pub(crate) fn create(data: RuleEntry) -> Box { - let rule = GlobalImport { _data: data }; + let rule = NoGlobalImport { data }; Box::new(rule) } pub(crate) fn create_default() -> RuleEntry { RuleEntry { id: RULE_ID.to_string(), - severity: Severity::WARNING, - data: vec![], + severity: DEFAULT_SEVERITY, + data: None, } } } diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/one_contract_per_file.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/one_contract_per_file.rs index 9894ba3c..8000a411 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/one_contract_per_file.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/one_contract_per_file.rs @@ -1,22 +1,22 @@ -use ast_extractor::Spanned; +use ast_extractor::{LineColumn, Spanned}; use crate::linter::SolidFile; use crate::rules::types::*; use crate::types::*; +// global pub const RULE_ID: &str = "one-contract-per-file"; -const MESSAGE: &str = "Only one contract per file"; + +// specific +const DEFAULT_SEVERITY: Severity = Severity::WARNING; +const DEFAULT_MESSAGE: &str = "Found more than one contract per file"; pub struct OneContractPerFile { data: RuleEntry, } impl OneContractPerFile { - fn create_diag( - &self, - location: (ast_extractor::LineColumn, ast_extractor::LineColumn), - file: &SolidFile, - ) -> LintDiag { + fn create_diag(&self, location: (LineColumn, LineColumn), file: &SolidFile) -> LintDiag { LintDiag { id: RULE_ID.to_string(), range: Range { @@ -29,8 +29,8 @@ impl OneContractPerFile { character: location.1.column, }, }, - message: MESSAGE.to_string(), - severity: Some(self.data.severity), + message: DEFAULT_MESSAGE.to_string(), + severity: self.data.severity, code: None, source: None, uri: file.path.clone(), @@ -45,13 +45,11 @@ impl RuleType for OneContractPerFile { let contracts = ast_extractor::retriever::retrieve_contract_nodes(&file.data); let contract_count = contracts.len(); - if contract_count <= 1 { - return res; - } - - for contract in &contracts[1..] { - let span = contract.name.span(); - res.push(self.create_diag((span.start(), span.end()), file)); + if contract_count > 1 { + for contract in &contracts[1..] { + let span = contract.name.span(); + res.push(self.create_diag((span.start(), span.end()), file)); + } } res } @@ -66,8 +64,8 @@ impl OneContractPerFile { pub(crate) fn create_default() -> RuleEntry { RuleEntry { id: RULE_ID.to_string(), - severity: Severity::WARNING, - data: vec![], + severity: DEFAULT_SEVERITY, + data: None, } } } diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/payable_fallback.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/payable_fallback.rs index 0e9e5983..433f7e52 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/payable_fallback.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/payable_fallback.rs @@ -5,11 +5,15 @@ use crate::linter::SolidFile; use crate::rules::types::*; use crate::types::*; -const DEFAULT_MESSAGE: &str = "Fallback should contains payable attributes"; +// global pub const RULE_ID: &str = "payable-fallback"; +// specific +const DEFAULT_SEVERITY: Severity = Severity::WARNING; +const DEFAULT_MESSAGE: &str = "When fallback is not payable you will not be able to receive ether"; + pub struct PayableFallback { - _data: RuleEntry, + data: RuleEntry, } impl RuleType for PayableFallback { @@ -20,7 +24,7 @@ impl RuleType for PayableFallback { for report in reports.into_iter().flatten() { res.push(LintDiag { id: RULE_ID.to_string(), - severity: Some(Severity::WARNING), + severity: self.data.severity, range: report, code: None, source: None, @@ -81,15 +85,15 @@ fn create_report(function: ItemFunction) -> Option { impl PayableFallback { pub fn create(data: RuleEntry) -> Box { - let rule = PayableFallback { _data: data }; + let rule = PayableFallback { data }; Box::new(rule) } pub fn create_default() -> RuleEntry { RuleEntry { id: RULE_ID.to_string(), - severity: Severity::WARNING, - data: vec![], + severity: DEFAULT_SEVERITY, + data: None, } } } diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/reason_string.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/reason_string.rs index 0277f480..23c47973 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/reason_string.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/reason_string.rs @@ -4,10 +4,11 @@ use crate::linter::SolidFile; use crate::rules::types::{RuleEntry, RuleType}; use crate::types::{LintDiag, Position, Range, Severity}; +// global pub const RULE_ID: &str = "reason-string"; -const DEFAULT_SEVERITY: Severity = Severity::WARNING; // Specific +const DEFAULT_SEVERITY: Severity = Severity::WARNING; const DEFAULT_LENGTH: usize = 32; pub struct ReasonString { @@ -35,7 +36,7 @@ impl ReasonString { }, }, message, - severity: Some(self.data.severity), + severity: self.data.severity, code: None, source: None, uri: file.path.clone(), @@ -48,58 +49,80 @@ impl RuleType for ReasonString { fn diagnose(&self, file: &SolidFile, _files: &[SolidFile]) -> Vec { let mut res = Vec::new(); - for call_expr in retriever::retrieve_expr_call_nodes(&file.data) { - let expr_require = match *call_expr.expr { - Expr::Ident(require_ident) => require_ident, - _ => continue, - }; - - if expr_require.as_string() != "require" && expr_require.as_string() != "revert" { - continue; - } - - let expr_args = match call_expr.args.list { - ArgListImpl::Named(_) => continue, - ArgListImpl::Unnamed(args) => args, - }; - - if let Some(expr_string) = expr_args.iter().find(|&x| { - if let Expr::Lit(lit) = x { - matches!(lit, ast_extractor::Lit::Str(_)) - } else { - false - } - }) { - if let Expr::Lit(Lit::Str(lit_str)) = expr_string { - let actual_string = lit_str.values[0].token().to_string(); - - if actual_string.len() > self.max_length { - let location = ( - lit_str.values[0].span().start(), - lit_str.values[0].span().end(), - ); - res.push( - self.create_diag( + for contract in retriever::retrieve_contract_nodes(&file.data) { + for stmt in retriever::retrieve_stmts_nodes(&contract) { + if let Stmt::Revert(revert) = &stmt { + if let Expr::Tuple(tuple) = &revert.expr { + if let Some(Expr::Lit(Lit::Str(string))) = tuple.elems.first() { + if string.values.len() == 1 + && string.values[0].value().len() > self.max_length + { + let location = (string.span().start(), string.span().end()); + res.push(self.create_diag(file, location, format!("Error message for revert is too long. Should be less than {} characters", self.max_length))); + } + } else { + let location = ( + revert.revert_token.span().start(), + revert.revert_token.span().end(), + ); + res.push(self.create_diag( file, location, - format!( - "reason-string: A revert statement must have a reason string of length less than {}", - self.max_length - ), - ), - ); + "Provide an error message for revert".to_string(), + )); + } + } + } + if let Stmt::Expr(expr) = &stmt { + if let Expr::Call(call) = &expr.expr { + if let Expr::Ident(ref ident) = *(call.expr) { + if *ident == "require" || *ident == "assert" { + let expr_args = match &call.args.list { + ArgListImpl::Named(_) => continue, + ArgListImpl::Unnamed(args) => args, + }; + + if let Some(expr_string) = expr_args.iter().find(|&x| { + if let Expr::Lit(lit) = x { + matches!(lit, ast_extractor::Lit::Str(_)) + } else { + false + } + }) { + if let Expr::Lit(Lit::Str(lit_str)) = expr_string { + let actual_string = lit_str.values[0].token().to_string(); + + if actual_string.len() > self.max_length { + let location = ( + lit_str.values[0].span().start(), + lit_str.values[0].span().end(), + ); + res.push( + self.create_diag( + file, + location, + format!( + "Error message for revert is too long. Should be less than {} characters", + self.max_length + ), + ), + ); + } + } + } else { + let location = (ident.0.span().start(), ident.0.span().end()); + res.push(self.create_diag( + file, + location, + "Provide an error message for revert".to_string(), + )); + } + } + } } } - } else { - let location = (expr_require.0.span().start(), expr_require.0.span().end()); - res.push(self.create_diag( - file, - location, - "reason-string: A require statement must have a reason string".to_string(), - )); } } - res } } @@ -108,13 +131,17 @@ impl ReasonString { pub fn create(data: RuleEntry) -> Box { let mut max_length = DEFAULT_LENGTH; - if !data.data.is_empty() { - max_length = match data.data[0].as_u64() { - Some(val) => val as usize, - None => DEFAULT_LENGTH, - }; + if let Some(data) = &data.data { + let parsed: Result = serde_json::from_value(data.clone()); + match parsed { + Ok(val) => max_length = val, + Err(_) => { + eprintln!("{} rule : bad config data", RULE_ID); + } + } + } else { + eprintln!("{} rule : bad config data", RULE_ID); } - let rule = ReasonString { max_length, data }; Box::new(rule) } @@ -123,7 +150,7 @@ impl ReasonString { RuleEntry { id: RULE_ID.to_string(), severity: DEFAULT_SEVERITY, - data: vec![serde_json::Value::String(DEFAULT_LENGTH.to_string())], + data: Some(DEFAULT_LENGTH.into()), } } } diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/const_name_snakecase.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/const_name_snakecase.rs index ca1084b2..5daf21a7 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/const_name_snakecase.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/const_name_snakecase.rs @@ -1,22 +1,22 @@ -use ast_extractor::{retriever, Item, Spanned}; +use ast_extractor::{retriever, Item, LineColumn, Spanned}; use crate::linter::SolidFile; use crate::rules::types::*; use crate::types::*; +// global pub const RULE_ID: &str = "const-name-snakecase"; -const MESSAGE: &str = "Constant name must be in capitalized SNAKE_CASE"; + +// specific +const DEFAULT_SEVERITY: Severity = Severity::WARNING; +const DEFAULT_MESSAGE: &str = "Constant name must be in capitalized SNAKE_CASE"; pub struct ConstNameSnakeCase { data: RuleEntry, } impl ConstNameSnakeCase { - fn create_diag( - &self, - location: (ast_extractor::LineColumn, ast_extractor::LineColumn), - file: &SolidFile, - ) -> LintDiag { + fn create_diag(&self, location: (LineColumn, LineColumn), file: &SolidFile) -> LintDiag { LintDiag { id: RULE_ID.to_string(), range: Range { @@ -29,8 +29,8 @@ impl ConstNameSnakeCase { character: location.1.column, }, }, - message: MESSAGE.to_string(), - severity: Some(self.data.severity), + message: DEFAULT_MESSAGE.to_string(), + severity: self.data.severity, code: None, source: None, uri: file.path.clone(), @@ -79,8 +79,8 @@ impl ConstNameSnakeCase { pub(crate) fn create_default() -> RuleEntry { RuleEntry { id: RULE_ID.to_string(), - severity: Severity::WARNING, - data: vec![], + severity: DEFAULT_SEVERITY, + data: None, } } } diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/contract_name_camelcase.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/contract_name_camelcase.rs index 9ae780d7..af56b1a4 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/contract_name_camelcase.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/contract_name_camelcase.rs @@ -1,22 +1,22 @@ -use ast_extractor::Spanned; +use ast_extractor::{LineColumn, Spanned}; use crate::linter::SolidFile; use crate::rules::types::*; use crate::types::*; +// global pub const RULE_ID: &str = "contract-name-camelcase"; -const MESSAGE: &str = "Contract name must be in CamelCase"; + +// specific +const DEFAULT_SEVERITY: Severity = Severity::WARNING; +const DEFAULT_MESSAGE: &str = "Contract name must be in CamelCase"; pub struct ContractNameCamelCase { data: RuleEntry, } impl ContractNameCamelCase { - fn create_diag( - &self, - location: (ast_extractor::LineColumn, ast_extractor::LineColumn), - file: &SolidFile, - ) -> LintDiag { + fn create_diag(&self, location: (LineColumn, LineColumn), file: &SolidFile) -> LintDiag { LintDiag { id: RULE_ID.to_string(), range: Range { @@ -29,8 +29,8 @@ impl ContractNameCamelCase { character: location.1.column, }, }, - message: MESSAGE.to_string(), - severity: Some(self.data.severity), + message: DEFAULT_MESSAGE.to_string(), + severity: self.data.severity, code: None, source: None, uri: file.path.clone(), @@ -67,8 +67,8 @@ impl ContractNameCamelCase { pub(crate) fn create_default() -> RuleEntry { RuleEntry { id: RULE_ID.to_string(), - severity: Severity::WARNING, - data: vec![], + severity: DEFAULT_SEVERITY, + data: None, } } } diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/event_name_camelcase.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/event_name_camelcase.rs index c4cc09b6..dd1d1da6 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/event_name_camelcase.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/event_name_camelcase.rs @@ -1,22 +1,22 @@ -use ast_extractor::Spanned; +use ast_extractor::{LineColumn, Spanned}; use crate::linter::SolidFile; use crate::rules::types::*; use crate::types::*; +// global pub const RULE_ID: &str = "event-name-camelcase"; -const MESSAGE: &str = "Event name must be in CamelCase"; + +// specific +const DEFAULT_SEVERITY: Severity = Severity::WARNING; +const DEFAULT_MESSAGE: &str = "Event name must be in CamelCase"; pub struct EventNameCamelCase { data: RuleEntry, } impl EventNameCamelCase { - fn create_diag( - &self, - location: (ast_extractor::LineColumn, ast_extractor::LineColumn), - file: &SolidFile, - ) -> LintDiag { + fn create_diag(&self, location: (LineColumn, LineColumn), file: &SolidFile) -> LintDiag { LintDiag { id: RULE_ID.to_string(), range: Range { @@ -29,8 +29,8 @@ impl EventNameCamelCase { character: location.1.column, }, }, - message: MESSAGE.to_string(), - severity: Some(self.data.severity), + message: DEFAULT_MESSAGE.to_string(), + severity: self.data.severity, code: None, source: None, uri: file.path.clone(), @@ -82,8 +82,8 @@ impl EventNameCamelCase { pub(crate) fn create_default() -> RuleEntry { RuleEntry { id: RULE_ID.to_string(), - severity: Severity::WARNING, - data: vec![], + severity: DEFAULT_SEVERITY, + data: None, } } } diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/foundry_func_name.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/foundry_test_functions.rs similarity index 64% rename from toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/foundry_func_name.rs rename to toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/foundry_test_functions.rs index 24905d4a..95f7d223 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/foundry_func_name.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/foundry_test_functions.rs @@ -1,23 +1,27 @@ -use ast_extractor::Spanned; -use serde_json::Value; +use ast_extractor::{LineColumn, Spanned}; use crate::linter::SolidFile; use crate::rules::types::*; use crate::types::*; -pub const RULE_ID: &str = "foundry-func-name"; -const MESSAGE: &str = "Founfry test function name need to respect the convention"; +// global +pub const RULE_ID: &str = "foundry-test-functions"; -pub struct FoundryFuncName { +// specific +const DEFAULT_SEVERITY: Severity = Severity::WARNING; +const DEFAULT_SKIP_FUNCTIONS: &[&str] = &["setUp"]; + +pub struct FoundryTestFunctions { data: RuleEntry, excluded: Vec, } -impl FoundryFuncName { +impl FoundryTestFunctions { fn create_diag( &self, - location: (ast_extractor::LineColumn, ast_extractor::LineColumn), + location: (LineColumn, LineColumn), file: &SolidFile, + name: &str, ) -> LintDiag { LintDiag { id: RULE_ID.to_string(), @@ -31,8 +35,11 @@ impl FoundryFuncName { character: location.1.column, }, }, - message: MESSAGE.to_string(), - severity: Some(self.data.severity), + message: format!( + "Function {}() must match Foundry test naming convention", + name + ), + severity: self.data.severity, code: None, source: None, uri: file.path.clone(), @@ -41,7 +48,7 @@ impl FoundryFuncName { } } -impl RuleType for FoundryFuncName { +impl RuleType for FoundryTestFunctions { fn diagnose(&self, file: &SolidFile, _files: &[SolidFile]) -> Vec { if !file.path.ends_with(".t.sol") { return vec![]; @@ -71,7 +78,11 @@ impl RuleType for FoundryFuncName { if !re.is_match(&name.as_string()) && !self.excluded.contains(&name.as_string()) { let span = name.span(); - res.push(self.create_diag((span.start(), span.end()), file)); + res.push(self.create_diag( + (span.start(), span.end()), + file, + &name.as_string(), + )); } } } @@ -80,25 +91,31 @@ impl RuleType for FoundryFuncName { } } -impl FoundryFuncName { +impl FoundryTestFunctions { pub(crate) fn create(data: RuleEntry) -> Box { let mut excluded: Vec = Vec::new(); - data.data.iter().for_each(|value| { - if let Value::String(val) = value { - excluded.push(val.to_string()); - } else { - eprintln!("Invalid value for rule foundry-func-name: {:?}", value); + + if let Some(data) = &data.data { + let parsed: Result, serde_json::Error> = + serde_json::from_value(data.clone()); + match parsed { + Ok(val) => excluded = val, + Err(_) => { + eprintln!("{} rule : bad config data", RULE_ID); + } } - }); - let rule = FoundryFuncName { excluded, data }; + } else { + eprintln!("{} rule : bad config data", RULE_ID); + } + let rule = FoundryTestFunctions { excluded, data }; Box::new(rule) } pub(crate) fn create_default() -> RuleEntry { RuleEntry { id: RULE_ID.to_string(), - severity: Severity::WARNING, - data: vec![], + severity: DEFAULT_SEVERITY, + data: Some(DEFAULT_SKIP_FUNCTIONS.into()), } } } diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/func_name_mixedcase.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/func_name_mixedcase.rs index 164a11d1..7b5d1e94 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/func_name_mixedcase.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/func_name_mixedcase.rs @@ -1,22 +1,22 @@ -use ast_extractor::Spanned; +use ast_extractor::{LineColumn, Spanned}; use crate::linter::SolidFile; use crate::rules::types::*; use crate::types::*; +// global pub const RULE_ID: &str = "func-name-mixedcase"; -const MESSAGE: &str = "Function name must be in mixedCase"; + +// specific +const DEFAULT_SEVERITY: Severity = Severity::WARNING; +const DEFAULT_MESSAGE: &str = "Function name must be in mixedCase"; pub struct FuncNameMixedCase { data: RuleEntry, } impl FuncNameMixedCase { - fn create_diag( - &self, - location: (ast_extractor::LineColumn, ast_extractor::LineColumn), - file: &SolidFile, - ) -> LintDiag { + fn create_diag(&self, location: (LineColumn, LineColumn), file: &SolidFile) -> LintDiag { LintDiag { id: RULE_ID.to_string(), range: Range { @@ -29,8 +29,8 @@ impl FuncNameMixedCase { character: location.1.column, }, }, - message: MESSAGE.to_string(), - severity: Some(self.data.severity), + message: DEFAULT_MESSAGE.to_string(), + severity: self.data.severity, code: None, source: None, uri: file.path.clone(), @@ -73,8 +73,8 @@ impl FuncNameMixedCase { pub(crate) fn create_default() -> RuleEntry { RuleEntry { id: RULE_ID.to_string(), - severity: Severity::WARNING, - data: vec![], + severity: DEFAULT_SEVERITY, + data: None, } } } diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/func_param_name_mixedcase.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/func_param_name_mixedcase.rs index 03f88007..e0150659 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/func_param_name_mixedcase.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/func_param_name_mixedcase.rs @@ -1,21 +1,21 @@ use crate::linter::SolidFile; use crate::rules::types::*; use crate::types::*; -use ast_extractor::Spanned; +use ast_extractor::{LineColumn, Spanned}; +// global pub const RULE_ID: &str = "func-param-name-mixedcase"; -const MESSAGE: &str = "Function param name must be in mixedCase"; + +// specific +const DEFAULT_SEVERITY: Severity = Severity::WARNING; +const DEFAULT_MESSAGE: &str = "Function param name must be in mixedCase"; pub struct FuncParamNameMixedCase { data: RuleEntry, } impl FuncParamNameMixedCase { - fn create_diag( - &self, - location: (ast_extractor::LineColumn, ast_extractor::LineColumn), - file: &SolidFile, - ) -> LintDiag { + fn create_diag(&self, location: (LineColumn, LineColumn), file: &SolidFile) -> LintDiag { LintDiag { id: RULE_ID.to_string(), range: Range { @@ -28,8 +28,8 @@ impl FuncParamNameMixedCase { character: location.1.column, }, }, - message: MESSAGE.to_string(), - severity: Some(self.data.severity), + message: DEFAULT_MESSAGE.to_string(), + severity: self.data.severity, code: None, source: None, uri: file.path.clone(), @@ -72,8 +72,8 @@ impl FuncParamNameMixedCase { pub(crate) fn create_default() -> RuleEntry { RuleEntry { id: RULE_ID.to_string(), - severity: Severity::WARNING, - data: vec![], + severity: DEFAULT_SEVERITY, + data: None, } } } diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/mod.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/mod.rs index 7f833c73..4e0df13b 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/mod.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/mod.rs @@ -1,10 +1,9 @@ use crate::rules::naming::const_name_snakecase::ConstNameSnakeCase; use crate::rules::naming::contract_name_camelcase::ContractNameCamelCase; use crate::rules::naming::event_name_camelcase::EventNameCamelCase; -use crate::rules::naming::foundry_func_name::FoundryFuncName; +use crate::rules::naming::foundry_test_functions::FoundryTestFunctions; use crate::rules::naming::func_name_mixedcase::FuncNameMixedCase; use crate::rules::naming::func_param_name_mixedcase::FuncParamNameMixedCase; -use crate::rules::naming::func_visibility::FuncVisibility; use crate::rules::naming::modifier_name_mixedcase::ModifierNameMixedcase; use crate::rules::naming::named_parameters_mapping::NamedParametersMapping; use crate::rules::naming::private_vars_leading_underscore::PrivateVarsLeadingUnderscore; @@ -19,9 +18,8 @@ pub(crate) mod func_param_name_mixedcase; pub(crate) mod const_name_snakecase; pub(crate) mod contract_name_camelcase; pub(crate) mod event_name_camelcase; -pub(crate) mod foundry_func_name; +pub(crate) mod foundry_test_functions; pub(crate) mod func_name_mixedcase; -pub(crate) mod func_visibility; pub(crate) mod modifier_name_mixedcase; pub(crate) mod named_parameters_mapping; pub(crate) mod private_vars_leading_underscore; @@ -36,14 +34,13 @@ pub fn create_default_rules() -> Vec { FuncNameMixedCase::create_default(), FuncParamNameMixedCase::create_default(), UseForbiddenName::create_default(), - FuncVisibility::create_default(), EventNameCamelCase::create_default(), ConstNameSnakeCase::create_default(), PrivateVarsLeadingUnderscore::create_default(), VarNameMixedCase::create_default(), ModifierNameMixedcase::create_default(), NamedParametersMapping::create_default(), - FoundryFuncName::create_default(), + FoundryTestFunctions::create_default(), ] } @@ -70,7 +67,6 @@ pub fn create_rules() -> RulesMap { use_forbidden_name::RULE_ID.to_string(), UseForbiddenName::create, ); - rules.insert(func_visibility::RULE_ID.to_string(), FuncVisibility::create); rules.insert( event_name_camelcase::RULE_ID.to_string(), EventNameCamelCase::create, @@ -92,8 +88,8 @@ pub fn create_rules() -> RulesMap { ModifierNameMixedcase::create, ); rules.insert( - foundry_func_name::RULE_ID.to_string(), - FoundryFuncName::create, + foundry_test_functions::RULE_ID.to_string(), + FoundryTestFunctions::create, ); rules diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/modifier_name_mixedcase.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/modifier_name_mixedcase.rs index 0e553c53..78b06a21 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/modifier_name_mixedcase.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/modifier_name_mixedcase.rs @@ -1,22 +1,22 @@ -use ast_extractor::{retriever, Spanned}; +use ast_extractor::{retriever, LineColumn, Spanned}; use crate::linter::SolidFile; use crate::rules::types::*; use crate::types::*; +// global pub const RULE_ID: &str = "modifier-name-mixedcase"; -const MESSAGE: &str = "Modifier name must be in mixedCase"; + +// specific +const DEFAULT_MESSAGE: &str = "Modifier name must be in mixedCase"; +const DEFAULT_SEVERITY: Severity = Severity::WARNING; pub struct ModifierNameMixedcase { data: RuleEntry, } impl ModifierNameMixedcase { - fn create_diag( - &self, - location: (ast_extractor::LineColumn, ast_extractor::LineColumn), - file: &SolidFile, - ) -> LintDiag { + fn create_diag(&self, location: (LineColumn, LineColumn), file: &SolidFile) -> LintDiag { LintDiag { id: RULE_ID.to_string(), range: Range { @@ -29,8 +29,8 @@ impl ModifierNameMixedcase { character: location.1.column, }, }, - message: MESSAGE.to_string(), - severity: Some(self.data.severity), + message: DEFAULT_MESSAGE.to_string(), + severity: self.data.severity, code: None, source: None, uri: file.path.clone(), @@ -92,8 +92,8 @@ impl ModifierNameMixedcase { pub(crate) fn create_default() -> RuleEntry { RuleEntry { id: RULE_ID.to_string(), - severity: Severity::WARNING, - data: vec![], + severity: DEFAULT_SEVERITY, + data: None, } } } diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/named_parameters_mapping.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/named_parameters_mapping.rs index a854da3a..36ad16e1 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/named_parameters_mapping.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/named_parameters_mapping.rs @@ -3,8 +3,12 @@ use crate::rules::types::*; use crate::types::*; use ast_extractor::*; +// global pub const RULE_ID: &str = "named-parameters-mapping"; +// specific +const DEFAULT_SEVERITY: Severity = Severity::WARNING; + pub struct NamedParametersMapping { data: RuleEntry, } @@ -50,7 +54,7 @@ impl NamedParametersMapping { }, }, message: message.to_string(), - severity: Some(self.data.severity), + severity: self.data.severity, code: None, source: None, uri: file.path.clone(), @@ -98,8 +102,8 @@ impl NamedParametersMapping { pub(crate) fn create_default() -> RuleEntry { RuleEntry { id: RULE_ID.to_string(), - severity: Severity::WARNING, - data: vec![], + severity: DEFAULT_SEVERITY, + data: None, } } } diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/private_vars_leading_underscore.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/private_vars_leading_underscore.rs index 5e61a67b..c594f099 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/private_vars_leading_underscore.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/private_vars_leading_underscore.rs @@ -1,25 +1,29 @@ use ast_extractor::Visibility::{Internal, Private}; -use ast_extractor::{Item, Spanned}; +use ast_extractor::{Item, LineColumn, Spanned}; use crate::linter::SolidFile; use crate::rules::types::*; use crate::types::*; +// global pub const RULE_ID: &str = "private-vars-leading-underscore"; -const MESSAGE_PRIVATE: &str = "Private and internal names must start with a single underscore"; -const MESSAGE_PUBLIC: &str = "Only private and internal names must start with a single underscore"; +// specific +const MESSAGE_PRIVATE: &str = "Private and internal variables must start with a single underscore"; +const MESSAGE_PUBLIC: &str = + "Only private and internal variables must start with a single underscore"; const DEFAULT_STRICT: bool = false; +const DEFAULT_SEVERITY: Severity = Severity::WARNING; pub struct PrivateVarsLeadingUnderscore { data: RuleEntry, - config: serde_json::Value, + strict: bool, } impl PrivateVarsLeadingUnderscore { fn create_diag( &self, - location: (ast_extractor::LineColumn, ast_extractor::LineColumn), + location: (LineColumn, LineColumn), file: &SolidFile, message: String, ) -> LintDiag { @@ -36,7 +40,7 @@ impl PrivateVarsLeadingUnderscore { }, }, message, - severity: Some(self.data.severity), + severity: self.data.severity, code: None, source: None, uri: file.path.clone(), @@ -54,7 +58,7 @@ impl RuleType for PrivateVarsLeadingUnderscore { let functions = ast_extractor::retriever::retrieve_functions_nodes(&contract); for function in functions { - if self.config["strict"].as_bool().unwrap_or(DEFAULT_STRICT) { + if self.strict { for argument in function.arguments { if let Some(name) = argument.name { let leading_underscore = name.as_string().starts_with('_'); @@ -151,30 +155,26 @@ impl PrivateVarsLeadingUnderscore { pub(crate) fn create(data: RuleEntry) -> Box { let mut strict = DEFAULT_STRICT; - if !data.data.is_empty() { - if let Some(val) = data.data[0].as_object() { - if let Some(val) = val["strict"].as_bool() { - strict = val; - } + if let Some(data) = &data.data { + if !data["strict"].is_null() && data["strict"].as_bool().is_some() { + strict = data["strict"].as_bool().unwrap(); + } else { + eprintln!("{} rule : bad config data", RULE_ID); } + } else { + eprintln!("{} rule : bad config data", RULE_ID); } - - let rule = PrivateVarsLeadingUnderscore { - data, - config: serde_json::json!({ - "strict": strict, - }), - }; + let rule = PrivateVarsLeadingUnderscore { strict, data }; Box::new(rule) } pub(crate) fn create_default() -> RuleEntry { RuleEntry { id: RULE_ID.to_string(), - severity: Severity::WARNING, - data: vec![serde_json::json!({ + severity: DEFAULT_SEVERITY, + data: Some(serde_json::json!({ "strict": DEFAULT_STRICT, - })], + })), } } } diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/use_forbidden_name.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/use_forbidden_name.rs index 260aa857..3e18f565 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/use_forbidden_name.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/use_forbidden_name.rs @@ -3,19 +3,19 @@ use crate::rules::types::*; use crate::types::*; use ast_extractor::*; +// global pub const RULE_ID: &str = "use-forbidden-name"; +// specific +const DEFAULT_SEVERITY: Severity = Severity::WARNING; +const DEFAULT_MESSAGE: &str = "Avoid to use letters 'I', 'l', 'O' as identifiers"; + pub struct UseForbiddenName { data: RuleEntry, } impl UseForbiddenName { - fn create_diag( - &self, - file: &SolidFile, - location: (LineColumn, LineColumn), - name: &String, - ) -> LintDiag { + fn create_diag(&self, file: &SolidFile, location: (LineColumn, LineColumn)) -> LintDiag { LintDiag { id: RULE_ID.to_string(), range: Range { @@ -28,8 +28,8 @@ impl UseForbiddenName { character: location.1.column, }, }, - message: format!("Forbidden variable name: {}", name), - severity: Some(self.data.severity), + message: DEFAULT_MESSAGE.to_string(), + severity: self.data.severity, code: None, source: None, uri: file.path.clone(), @@ -56,7 +56,7 @@ impl RuleType for UseForbiddenName { && blacklist.contains(&var.name.as_string().chars().next().unwrap()) { let location = (var.name.span().start(), var.name.span().end()); - res.push(self.create_diag(file, location, &var.name.as_string())); + res.push(self.create_diag(file, location)); } } } @@ -73,8 +73,8 @@ impl UseForbiddenName { pub(crate) fn create_default() -> RuleEntry { RuleEntry { id: RULE_ID.to_string(), - severity: Severity::WARNING, - data: vec![], + severity: DEFAULT_SEVERITY, + data: None, } } } diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/var_name_mixedcase.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/var_name_mixedcase.rs index e868887f..1c07633f 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/var_name_mixedcase.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/var_name_mixedcase.rs @@ -1,22 +1,22 @@ -use ast_extractor::Spanned; +use ast_extractor::{LineColumn, Spanned}; use crate::linter::SolidFile; use crate::rules::types::*; use crate::types::*; +// global pub const RULE_ID: &str = "var-name-mixedcase"; -const MESSAGE: &str = "variable should be in MixedCase"; + +// specific +const DEFAULT_MESSAGE: &str = "Variable should be in mixedCase"; +const DEFAULT_SEVERITY: Severity = Severity::WARNING; pub struct VarNameMixedCase { data: RuleEntry, } impl VarNameMixedCase { - fn create_diag( - &self, - location: (ast_extractor::LineColumn, ast_extractor::LineColumn), - file: &SolidFile, - ) -> LintDiag { + fn create_diag(&self, location: (LineColumn, LineColumn), file: &SolidFile) -> LintDiag { LintDiag { id: RULE_ID.to_string(), range: Range { @@ -29,8 +29,8 @@ impl VarNameMixedCase { character: location.1.column, }, }, - message: MESSAGE.to_string(), - severity: Some(self.data.severity), + message: DEFAULT_MESSAGE.to_string(), + severity: self.data.severity, code: None, source: None, uri: file.path.clone(), @@ -76,8 +76,8 @@ impl VarNameMixedCase { pub(crate) fn create_default() -> RuleEntry { RuleEntry { id: RULE_ID.to_string(), - severity: Severity::WARNING, - data: vec![], + severity: DEFAULT_SEVERITY, + data: None, } } } diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/order/import_on_top.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/order/import_on_top.rs index 4f3c7e46..e4cd173d 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/order/import_on_top.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/order/import_on_top.rs @@ -1,22 +1,22 @@ -use ast_extractor::Spanned; +use ast_extractor::{LineColumn, Spanned}; use crate::linter::SolidFile; use crate::rules::types::*; use crate::types::*; +// global pub const RULE_ID: &str = "import-on-top"; -const MESSAGE: &str = "Import must be on top in the file"; + +// specific +const DEFAULT_MESSAGE: &str = "Import statements must be on top"; +const DEFAULT_SEVERITY: Severity = Severity::WARNING; pub struct ImportOnTop { data: RuleEntry, } impl ImportOnTop { - fn create_diag( - &self, - file: &SolidFile, - location: (ast_extractor::LineColumn, ast_extractor::LineColumn), - ) -> LintDiag { + fn create_diag(&self, file: &SolidFile, location: (LineColumn, LineColumn)) -> LintDiag { let range = Range { start: Position { line: location.0.line, @@ -30,8 +30,8 @@ impl ImportOnTop { LintDiag { id: RULE_ID.to_string(), range, - message: MESSAGE.to_string(), - severity: Some(self.data.severity), + message: DEFAULT_MESSAGE.to_string(), + severity: self.data.severity, code: None, source: None, uri: file.path.clone(), @@ -59,7 +59,6 @@ impl RuleType for ImportOnTop { } } - for i in 0..file.data.items.len() { if let ast_extractor::Item::Import(import) = &file.data.items[i] { if i > last_import_location { @@ -82,8 +81,8 @@ impl ImportOnTop { pub(crate) fn create_default() -> RuleEntry { RuleEntry { id: RULE_ID.to_string(), - severity: Severity::WARNING, - data: vec![], + severity: DEFAULT_SEVERITY, + data: None, } } } diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/order/mod.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/order/mod.rs index cc0c65c1..4926ac6d 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/order/mod.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/order/mod.rs @@ -4,14 +4,20 @@ use std::collections::HashMap; #[macro_use] pub(crate) mod import_on_top; pub(crate) mod ordering; +pub(crate) mod visibility_modifier_order; // List all rules use crate::rules::order::import_on_top::ImportOnTop; use crate::rules::order::ordering::Ordering; +use crate::rules::order::visibility_modifier_order::VisibilityModiferOrder; use crate::rules::RuleBuilder; pub fn create_default_rules() -> Vec { - vec![ImportOnTop::create_default(), Ordering::create_default()] + vec![ + ImportOnTop::create_default(), + Ordering::create_default(), + VisibilityModiferOrder::create_default(), + ] } pub fn create_rules() -> RulesMap { @@ -19,6 +25,10 @@ pub fn create_rules() -> RulesMap { rules.insert(import_on_top::RULE_ID.to_string(), ImportOnTop::create); rules.insert(ordering::RULE_ID.to_string(), Ordering::create); + rules.insert( + visibility_modifier_order::RULE_ID.to_string(), + VisibilityModiferOrder::create, + ); rules } diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/order/ordering.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/order/ordering.rs index 111c28e4..93041f29 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/order/ordering.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/order/ordering.rs @@ -6,8 +6,12 @@ use crate::linter::SolidFile; use crate::rules::types::*; use crate::types::*; +// global pub const RULE_ID: &str = "ordering"; -const MESSAGE: &str = "Invalid ordering of items in the file"; + +// specific +const DEFAULT_SEVERITY: Severity = Severity::WARNING; +const DEFAULT_MESSAGE: &str = "Invalid ordering of items in the file"; struct OrderingVisitor { file: SolidFile, @@ -24,10 +28,18 @@ impl OrderingVisitor { fn new(file: SolidFile, data: RuleEntry) -> OrderingVisitor { let authorized_file_items: HashMap>> = [ (FileItemType::Pragma, vec![None]), - (FileItemType::Import, vec![None, Some(FileItemType::Pragma), Some(FileItemType::Import)]), + ( + FileItemType::Import, + vec![None, Some(FileItemType::Pragma), Some(FileItemType::Import)], + ), ( FileItemType::Enum, - vec![None, Some(FileItemType::Pragma), Some(FileItemType::Import), Some(FileItemType::Enum)], + vec![ + None, + Some(FileItemType::Pragma), + Some(FileItemType::Import), + Some(FileItemType::Enum), + ], ), ( FileItemType::Struct, @@ -81,10 +93,17 @@ impl OrderingVisitor { .collect(); let authorized_contract_items: HashMap>> = [ - (ContractItemType::Udt, vec![None, Some(ContractItemType::Udt)]), + ( + ContractItemType::Udt, + vec![None, Some(ContractItemType::Udt)], + ), ( ContractItemType::Struct, - vec![None, Some(ContractItemType::Udt), Some(ContractItemType::Struct)], + vec![ + None, + Some(ContractItemType::Udt), + Some(ContractItemType::Struct), + ], ), ( ContractItemType::Enum, @@ -180,7 +199,7 @@ impl OrderingVisitor { Some(ContractItemType::Constructor), Some(ContractItemType::Receive), Some(ContractItemType::FallBack), - Some(ContractItemType::ExternalFunction) + Some(ContractItemType::ExternalFunction), ], ), ( @@ -271,8 +290,8 @@ impl OrderingVisitor { LintDiag { id: RULE_ID.to_string(), range, - message: MESSAGE.to_string(), - severity: Some(self.data.severity), + message: DEFAULT_MESSAGE.to_string(), + severity: self.data.severity, code: None, source: None, uri: file.path.clone(), @@ -483,8 +502,8 @@ impl Ordering { pub(crate) fn create_default() -> RuleEntry { RuleEntry { id: RULE_ID.to_string(), - severity: Severity::WARNING, - data: vec![], + severity: DEFAULT_SEVERITY, + data: None, } } } diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/visibility_modifier_order.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/order/visibility_modifier_order.rs similarity index 86% rename from toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/visibility_modifier_order.rs rename to toolchains/solidity/linter/core/solidhunter-lib/src/rules/order/visibility_modifier_order.rs index 38283c0d..0e2276c5 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/visibility_modifier_order.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/order/visibility_modifier_order.rs @@ -5,12 +5,15 @@ use crate::linter::SolidFile; use crate::rules::types::*; use crate::types::*; -// const DEFAULT_SEVERITY: &str = "warn"; -const DEFAULT_MESSAGE: &str = "Visibility modifier not placed first"; +// global pub const RULE_ID: &str = "visibility-modifier-order"; +// specific +const DEFAULT_SEVERITY: Severity = Severity::WARNING; +const DEFAULT_MESSAGE: &str = "Visibility modifier must be first in list of modifiers"; + pub struct VisibilityModiferOrder { - _data: RuleEntry, + data: RuleEntry, } impl RuleType for VisibilityModiferOrder { @@ -22,7 +25,7 @@ impl RuleType for VisibilityModiferOrder { res.push(LintDiag { id: RULE_ID.to_string(), range: report, - severity: Some(Severity::WARNING), + severity: self.data.severity, code: None, source: None, message: DEFAULT_MESSAGE.to_string(), @@ -66,15 +69,15 @@ fn check_visibility_modifier_order(file: &SolidFile) -> Vec { impl VisibilityModiferOrder { pub fn create(data: RuleEntry) -> Box { - let rule = VisibilityModiferOrder { _data: data }; + let rule = VisibilityModiferOrder { data }; Box::new(rule) } pub fn create_default() -> RuleEntry { RuleEntry { id: RULE_ID.to_string(), - severity: Severity::WARNING, - data: vec![], + severity: DEFAULT_SEVERITY, + data: None, } } } diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/rule_impl.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/rule_impl.rs index bf489450..093433f7 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/rule_impl.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/rule_impl.rs @@ -5,8 +5,6 @@ use crate::rules::types::*; pub fn create_rules_file(path: &str) { let rules = Rules { name: "solidhunter".to_string(), - includes: vec![], - plugins: vec![], rules: create_default_rules(), }; let serialized = serde_json::to_string_pretty(&rules).unwrap(); diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/security/avoid_tx_origin.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/security/avoid_tx_origin.rs index aded88ab..eb84b41f 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/security/avoid_tx_origin.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/security/avoid_tx_origin.rs @@ -3,8 +3,12 @@ use crate::rules::types::*; use crate::types::*; use ast_extractor::*; +// global pub const RULE_ID: &str = "avoid-tx-origin"; -const MESSAGE: &str = "Avoid to use tx.origin"; + +// specific +const DEFAULT_MESSAGE: &str = "Avoid to use tx.origin"; +const DEFAULT_SEVERITY: Severity = Severity::WARNING; struct ExprVisitor { exprs: Vec, @@ -12,14 +16,12 @@ struct ExprVisitor { impl ExprVisitor { pub fn new() -> Self { - Self { - exprs: Vec::new(), - } + Self { exprs: Vec::new() } } } impl<'ast> Visit<'ast> for ExprVisitor { - fn visit_expr_member(&mut self,i: &'ast ExprMember) { + fn visit_expr_member(&mut self, i: &'ast ExprMember) { self.exprs.push(i.clone()); visit::visit_expr_member(self, i); } @@ -30,11 +32,7 @@ pub struct AvoidTxOrigin { } impl AvoidTxOrigin { - fn create_diag( - &self, - location: (LineColumn, LineColumn), - file: &SolidFile, - ) -> LintDiag { + fn create_diag(&self, location: (LineColumn, LineColumn), file: &SolidFile) -> LintDiag { LintDiag { id: RULE_ID.to_string(), range: Range { @@ -47,8 +45,8 @@ impl AvoidTxOrigin { character: location.1.column, }, }, - message: MESSAGE.to_string(), - severity: Some(self.data.severity), + message: DEFAULT_MESSAGE.to_string(), + severity: self.data.severity, code: None, source: None, uri: file.path.clone(), @@ -88,8 +86,8 @@ impl AvoidTxOrigin { pub(crate) fn create_default() -> RuleEntry { RuleEntry { id: RULE_ID.to_string(), - severity: Severity::WARNING, - data: vec![], + severity: DEFAULT_SEVERITY, + data: None, } } } diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/func_visibility.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/security/func_visibility.rs similarity index 76% rename from toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/func_visibility.rs rename to toolchains/solidity/linter/core/solidhunter-lib/src/rules/security/func_visibility.rs index 25ee9491..b38d03d9 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/func_visibility.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/security/func_visibility.rs @@ -3,15 +3,17 @@ use crate::rules::types::*; use crate::types::*; use ast_extractor::Spanned; +// global pub const RULE_ID: &str = "func-visibility"; -const MESSAGE: &str = - "Explicitly mark visibility in function (public, private, internal, external)"; -pub const DEFAULT_IGNORE_CONSTRUCTORS: bool = false; +// specific +const DEFAULT_MESSAGE: &str = + "Explicitly mark visibility in function (public, private, internal, external)"; +pub const DEFAULT_IGNORE_CONSTRUCTORS: bool = true; pub struct FuncVisibility { ignore_constructors: bool, - _data: RuleEntry, + data: RuleEntry, } impl FuncVisibility { @@ -32,8 +34,8 @@ impl FuncVisibility { character: location.1.column, }, }, - message: MESSAGE.to_string(), - severity: Some(self._data.severity), + message: DEFAULT_MESSAGE.to_string(), + severity: self.data.severity, code: None, source: None, uri: file.path.clone(), @@ -75,15 +77,20 @@ impl FuncVisibility { pub(crate) fn create(data: RuleEntry) -> Box { let mut ignore_constructors = DEFAULT_IGNORE_CONSTRUCTORS; - if !data.data.is_empty() { - ignore_constructors = match data.data[0].as_bool() { - Some(val) => val, - None => DEFAULT_IGNORE_CONSTRUCTORS, - }; + if let Some(data) = &data.data { + if !data["ignoreConstructors"].is_null() + && data["ignoreConstructors"].as_bool().is_some() + { + ignore_constructors = data["ignoreConstructors"].as_bool().unwrap(); + } else { + eprintln!("{} rule : bad config data", RULE_ID); + } + } else { + eprintln!("{} rule : bad config data", RULE_ID); } let rule = FuncVisibility { ignore_constructors, - _data: data, + data, }; Box::new(rule) } @@ -92,9 +99,9 @@ impl FuncVisibility { RuleEntry { id: RULE_ID.to_string(), severity: Severity::WARNING, - data: vec![serde_json::json!({ - "strict": DEFAULT_IGNORE_CONSTRUCTORS, - })], + data: Some(serde_json::json!({ + "ignoreConstructors": DEFAULT_IGNORE_CONSTRUCTORS, + })), } } } diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/security/mod.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/security/mod.rs index 8436d37d..9b93a6b7 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/security/mod.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/security/mod.rs @@ -3,13 +3,18 @@ use std::collections::HashMap; #[macro_use] pub(crate) mod no_inline_assembly; +pub(crate) mod avoid_tx_origin; +pub(crate) mod func_visibility; pub(crate) mod not_rely_on_time; pub(crate) mod state_visibility; // List all rules +use crate::rules::security::avoid_tx_origin::AvoidTxOrigin; +use crate::rules::security::func_visibility::FuncVisibility; use crate::rules::security::no_inline_assembly::NoInlineAssembly; use crate::rules::security::not_rely_on_time::NotRelyOnTime; use crate::rules::security::state_visibility::StateVisibility; + use crate::rules::RuleBuilder; pub fn create_default_rules() -> Vec { @@ -17,6 +22,8 @@ pub fn create_default_rules() -> Vec { NoInlineAssembly::create_default(), StateVisibility::create_default(), NotRelyOnTime::create_default(), + FuncVisibility::create_default(), + AvoidTxOrigin::create_default(), ] } @@ -27,12 +34,12 @@ pub fn create_rules() -> RulesMap { no_inline_assembly::RULE_ID.to_string(), NoInlineAssembly::create, ); - + rules.insert(func_visibility::RULE_ID.to_string(), FuncVisibility::create); rules.insert( state_visibility::RULE_ID.to_string(), StateVisibility::create, ); - + rules.insert(avoid_tx_origin::RULE_ID.to_string(), AvoidTxOrigin::create); rules.insert(not_rely_on_time::RULE_ID.to_string(), NotRelyOnTime::create); rules diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/security/no_inline_assembly.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/security/no_inline_assembly.rs index b61f2a1f..29b019ef 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/security/no_inline_assembly.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/security/no_inline_assembly.rs @@ -3,8 +3,12 @@ use crate::rules::types::*; use crate::types::*; use ast_extractor::*; +// global pub const RULE_ID: &str = "no-inline-assembly"; -const MESSAGE: &str = "Avoid to use inline assembly. It is acceptable only in rare cases"; + +// specific +const DEFAULT_SEVERITY: Severity = Severity::WARNING; +const DEFAULT_MESSAGE: &str = "Avoid to use inline assembly. It is acceptable only in rare cases"; pub struct NoInlineAssembly { data: RuleEntry, @@ -24,8 +28,8 @@ impl NoInlineAssembly { character: location.1.column, }, }, - message: MESSAGE.to_string(), - severity: Some(self.data.severity), + message: DEFAULT_MESSAGE.to_string(), + severity: self.data.severity, code: None, source: None, uri: file.path.clone(), @@ -59,8 +63,8 @@ impl NoInlineAssembly { pub(crate) fn create_default() -> RuleEntry { RuleEntry { id: RULE_ID.to_string(), - severity: Severity::WARNING, - data: vec![], + severity: DEFAULT_SEVERITY, + data: None, } } } diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/security/not_rely_on_time.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/security/not_rely_on_time.rs index d50037bd..6d04fa38 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/security/not_rely_on_time.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/security/not_rely_on_time.rs @@ -3,19 +3,19 @@ use crate::rules::types::*; use crate::types::*; use ast_extractor::*; +// global pub const RULE_ID: &str = "not-rely-on-time"; -const MESSAGE: &str = "Avoid making time-based decisions in your business logic"; + +// specific +const DEFAULT_SEVERITY: Severity = Severity::WARNING; +const DEFAULT_MESSAGE: &str = "Avoid making time-based decisions in your business logic"; pub struct NotRelyOnTime { data: RuleEntry, } impl NotRelyOnTime { - fn create_diag( - &self, - location: (ast_extractor::LineColumn, ast_extractor::LineColumn), - file: &SolidFile, - ) -> LintDiag { + fn create_diag(&self, location: (LineColumn, LineColumn), file: &SolidFile) -> LintDiag { LintDiag { id: RULE_ID.to_string(), range: Range { @@ -28,8 +28,8 @@ impl NotRelyOnTime { character: location.1.column, }, }, - message: MESSAGE.to_string(), - severity: Some(self.data.severity), + message: DEFAULT_MESSAGE.to_string(), + severity: self.data.severity, code: None, source: None, uri: file.path.clone(), @@ -89,8 +89,8 @@ impl NotRelyOnTime { pub(crate) fn create_default() -> RuleEntry { RuleEntry { id: RULE_ID.to_string(), - severity: Severity::WARNING, - data: vec![], + severity: DEFAULT_SEVERITY, + data: None, } } } diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/security/state_visibility.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/security/state_visibility.rs index 6abc8294..78ad1ba1 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/security/state_visibility.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/security/state_visibility.rs @@ -3,19 +3,19 @@ use crate::rules::types::*; use crate::types::*; use ast_extractor::*; +// global pub const RULE_ID: &str = "state-visibility"; -const MESSAGE: &str = "Explicitly mark visibility of state"; + +// specific +const DEFAULT_SEVERITY: Severity = Severity::WARNING; +const DEFAULT_MESSAGE: &str = "Explicitly mark visibility of state"; pub struct StateVisibility { data: RuleEntry, } impl StateVisibility { - fn create_diag( - &self, - location: (ast_extractor::LineColumn, ast_extractor::LineColumn), - file: &SolidFile, - ) -> LintDiag { + fn create_diag(&self, location: (LineColumn, LineColumn), file: &SolidFile) -> LintDiag { LintDiag { id: RULE_ID.to_string(), range: Range { @@ -28,8 +28,8 @@ impl StateVisibility { character: location.1.column, }, }, - message: MESSAGE.to_string(), - severity: Some(self.data.severity), + message: DEFAULT_MESSAGE.to_string(), + severity: self.data.severity, code: None, source: None, uri: file.path.clone(), @@ -66,8 +66,8 @@ impl StateVisibility { pub(crate) fn create_default() -> RuleEntry { RuleEntry { id: RULE_ID.to_string(), - severity: Severity::WARNING, - data: vec![], + severity: DEFAULT_SEVERITY, + data: None, } } } diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/types.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/types.rs index f94839b9..09e6030e 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/types.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/types.rs @@ -8,14 +8,13 @@ use std::collections::HashMap; pub struct RuleEntry { pub id: String, pub severity: Severity, - pub data: Vec, + #[serde(skip_serializing_if = "Option::is_none")] + pub data: Option, } #[derive(Serialize, Deserialize, Debug)] pub struct Rules { pub name: String, - pub includes: Vec, - pub plugins: Vec, pub rules: Vec, } diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/types.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/types.rs index 76336141..c6ef6d22 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/types.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/types.rs @@ -10,10 +10,8 @@ pub struct LintDiag { /// The range at which the message applies. pub range: Range, - #[serde(skip_serializing_if = "Option::is_none")] - /// The diagnostic's severity. Can be omitted. If omitted it is up to the - /// client to interpret diagnostics as error, warning, info or hint. - pub severity: Option, + /// The diagnostic's severity. + pub severity: Severity, #[serde(skip_serializing_if = "Option::is_none")] /// The diagnostic's code. Can be omitted. @@ -82,8 +80,7 @@ impl LintDiag { } else if line_nb == self.range.start.line { higlight_length = trimmed_line.len() - (self.range.start.character - offset); } else if line_nb == self.range.end.line { - higlight_length = trimmed_line.len() - - (self.range.end.character - offset) + 1; + higlight_length = trimmed_line.len() - (self.range.end.character - offset) + 1; } formatted = format!( @@ -109,7 +106,7 @@ impl fmt::Display for LintDiag { write!( f, "\n{}: {}\n --> {}:{}:{}\n |\n{}", - severity_to_string(self.severity), + self.severity, self.message, self.uri, self.range.start.line, @@ -123,15 +120,16 @@ impl fmt::Display for LintDiag { /////////////////// RELATED TYPES: ///////////////////////// //////////////////////////////////////////////////////////// -fn severity_to_string(severity: Option) -> String { - match severity { - Some(Severity::ERROR) => "error".to_string().red(), - Some(Severity::WARNING) => "warning".to_string().yellow(), - Some(Severity::INFO) => "info".to_string().blue(), - Some(Severity::HINT) => "hint".to_string().green(), - _ => "error".to_string().red(), +impl fmt::Display for Severity { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + let severity = match self { + Severity::ERROR => "error".to_string().red(), + Severity::WARNING => "warning".to_string().yellow(), + Severity::INFO => "info".to_string().blue(), + Severity::HINT => "hint".to_string().green(), + }; + write!(f, "{}", severity) } - .to_string() } impl PartialEq for Position { diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/AvoidTxOrigin/.solidhunter.json b/toolchains/solidity/linter/core/solidhunter-lib/testdata/AvoidTxOrigin/.solidhunter.json index 0ab201ac..96de8e57 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/testdata/AvoidTxOrigin/.solidhunter.json +++ b/toolchains/solidity/linter/core/solidhunter-lib/testdata/AvoidTxOrigin/.solidhunter.json @@ -1,12 +1,8 @@ { - "name": "solidhunter", - "includes": [], - "plugins": [], - "rules": [ + "name": "solidhunter", "rules": [ { "id": "avoid-tx-origin", - "severity": "WARNING", - "data": [] + "severity": "WARNING" } ] } \ No newline at end of file diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/ConstNameSnakeCase/.solidhunter.json b/toolchains/solidity/linter/core/solidhunter-lib/testdata/ConstNameSnakeCase/.solidhunter.json index 9144f0c7..fa6dabb7 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/testdata/ConstNameSnakeCase/.solidhunter.json +++ b/toolchains/solidity/linter/core/solidhunter-lib/testdata/ConstNameSnakeCase/.solidhunter.json @@ -1,65 +1,8 @@ { - "name": "solidhunter", - "includes": [], - "plugins": [], - "rules": [ - { - "id": "line-max-len", - "severity": "WARNING", - "data": [ - "80" - ] - }, - { - "id": "max-states-count", - "severity": "WARNING", - "data": [ - "15" - ] - }, - { - "id": "function-max-lines", - "severity": "WARNING", - "data": [ - "20" - ] - }, - { - "id": "reason-string", - "severity": "WARNING", - "data": [ - "32" - ] - }, - { - "id": "contract-name-camelcase", - "severity": "WARNING", - "data": [] - }, - { - "id": "func-name-mixedcase", - "severity": "WARNING", - "data": [] - }, - { - "id": "func-param-name-mixedcase", - "severity": "WARNING", - "data": [] - }, - { - "id": "use-forbidden-name", - "severity": "WARNING", - "data": [] - }, - { - "id": "import-on-top", - "severity": "WARNING", - "data": [] - }, + "name": "solidhunter", "rules": [ { "id": "const-name-snakecase", - "severity": "WARNING", - "data": [] + "severity": "WARNING" } ] } \ No newline at end of file diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/ContractNameCamelCase/.solidhunter.json b/toolchains/solidity/linter/core/solidhunter-lib/testdata/ContractNameCamelCase/.solidhunter.json index fcb15424..8542a315 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/testdata/ContractNameCamelCase/.solidhunter.json +++ b/toolchains/solidity/linter/core/solidhunter-lib/testdata/ContractNameCamelCase/.solidhunter.json @@ -1,12 +1,8 @@ { - "name": "solidhunter", - "includes": [], - "plugins": [], - "rules": [ + "name": "solidhunter", "rules": [ { "id": "contract-name-camelcase", - "severity": "WARNING", - "data": [] + "severity": "WARNING" } ] } \ No newline at end of file diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/CustomErrors/.solidhunter.json b/toolchains/solidity/linter/core/solidhunter-lib/testdata/CustomErrors/.solidhunter.json index da432269..f4348785 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/testdata/CustomErrors/.solidhunter.json +++ b/toolchains/solidity/linter/core/solidhunter-lib/testdata/CustomErrors/.solidhunter.json @@ -1,65 +1,9 @@ { "name": "solidhunter", - "includes": [], - "plugins": [], "rules": [ - { - "id": "line-max-len", - "severity": "WARNING", - "data": [ - "80" - ] - }, - { - "id": "max-states-count", - "severity": "WARNING", - "data": [ - "15" - ] - }, - { - "id": "function-max-lines", - "severity": "WARNING", - "data": [ - "20" - ] - }, - { - "id": "reason-string", - "severity": "WARNING", - "data": [ - "32" - ] - }, - { - "id": "contract-name-camelcase", - "severity": "WARNING", - "data": [] - }, - { - "id": "func-name-mixedcase", - "severity": "WARNING", - "data": [] - }, - { - "id": "func-param-name-mixedcase", - "severity": "WARNING", - "data": [] - }, - { - "id": "use-forbidden-name", - "severity": "WARNING", - "data": [] - }, - { - "id": "import-on-top", - "severity": "WARNING", - "data": [] - }, { "id": "custom-errors", - "severity": "WARNING", - "data": [] + "severity": "WARNING" } ] } \ No newline at end of file diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/CustomErrors/findings.csv b/toolchains/solidity/linter/core/solidhunter-lib/testdata/CustomErrors/findings.csv index b9f84178..fe1b37ad 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/testdata/CustomErrors/findings.csv +++ b/toolchains/solidity/linter/core/solidhunter-lib/testdata/CustomErrors/findings.csv @@ -1,7 +1,6 @@ custom-errors:10:8:10:30 -custom-errors:11:8:11:22 custom-errors:12:8:12:29 custom-errors:13:8:13:20 custom-errors:14:8:14:22 custom-errors:15:8:15:16 -reason-string:11:8:11:15 \ No newline at end of file +custom-errors:11:8:11:22 \ No newline at end of file diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/EmptyBlock/.solidhunter.json b/toolchains/solidity/linter/core/solidhunter-lib/testdata/EmptyBlock/.solidhunter.json deleted file mode 100644 index ef614b08..00000000 --- a/toolchains/solidity/linter/core/solidhunter-lib/testdata/EmptyBlock/.solidhunter.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "name": "solidhunter", - "includes": [], - "plugins": [], - "rules": [ - { - "id": "line-max-len", - "severity": "WARNING", - "data": [ - "80" - ] - }, - { - "id": "max-states-count", - "severity": "WARNING", - "data": [ - "15" - ] - }, - { - "id": "function-max-lines", - "severity": "WARNING", - "data": [ - "20" - ] - }, - { - "id": "reason-string", - "severity": "WARNING", - "data": [ - "32" - ] - }, - { - "id": "func-name-mixedcase", - "severity": "WARNING", - "data": [] - }, - { - "id": "func-param-name-mixedcase", - "severity": "WARNING", - "data": [] - }, - { - "id": "use-forbidden-name", - "severity": "WARNING", - "data": [] - }, - { - "id": "import-on-top", - "severity": "WARNING", - "data": [] - }, - { - "id": "empty-block", - "severity": "WARNING", - "data": [] - } - ] -} \ No newline at end of file diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/EmptyBlock/findings.csv b/toolchains/solidity/linter/core/solidhunter-lib/testdata/EmptyBlock/findings.csv deleted file mode 100644 index 9e1b21a3..00000000 --- a/toolchains/solidity/linter/core/solidhunter-lib/testdata/EmptyBlock/findings.csv +++ /dev/null @@ -1,2 +0,0 @@ -empty-block:3:10:3:13 -empty-block:5:10:5:15 \ No newline at end of file diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/EventNameCamelCase/.solidhunter.json b/toolchains/solidity/linter/core/solidhunter-lib/testdata/EventNameCamelCase/.solidhunter.json index 75a1f82e..f07ba88c 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/testdata/EventNameCamelCase/.solidhunter.json +++ b/toolchains/solidity/linter/core/solidhunter-lib/testdata/EventNameCamelCase/.solidhunter.json @@ -1,65 +1,9 @@ { "name": "solidhunter", - "includes": [], - "plugins": [], "rules": [ - { - "id": "line-max-len", - "severity": "WARNING", - "data": [ - "80" - ] - }, - { - "id": "max-states-count", - "severity": "WARNING", - "data": [ - "15" - ] - }, - { - "id": "function-max-lines", - "severity": "WARNING", - "data": [ - "20" - ] - }, - { - "id": "reason-string", - "severity": "WARNING", - "data": [ - "32" - ] - }, - { - "id": "contract-name-camelcase", - "severity": "WARNING", - "data": [] - }, - { - "id": "func-name-mixedcase", - "severity": "WARNING", - "data": [] - }, - { - "id": "func-param-name-mixedcase", - "severity": "WARNING", - "data": [] - }, - { - "id": "use-forbidden-name", - "severity": "WARNING", - "data": [] - }, - { - "id": "import-on-top", - "severity": "WARNING", - "data": [] - }, { "id": "event-name-camelcase", - "severity": "WARNING", - "data": [] + "severity": "WARNING" } ] } \ No newline at end of file diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/ExplicitTypes/.solidhunter.json b/toolchains/solidity/linter/core/solidhunter-lib/testdata/ExplicitTypes/.solidhunter.json index dee9a783..e4d8f6ad 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/testdata/ExplicitTypes/.solidhunter.json +++ b/toolchains/solidity/linter/core/solidhunter-lib/testdata/ExplicitTypes/.solidhunter.json @@ -1,14 +1,10 @@ { "name": "solidhunter", - "includes": [], - "plugins": [], "rules": [ { "id": "explicit-types", "severity": "WARNING", - "data": [ - "explicit" - ] + "data": "explicit" } ] } \ No newline at end of file diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/FoundryFunctionName/.solidhunter.json b/toolchains/solidity/linter/core/solidhunter-lib/testdata/FoundryFunctionName/.solidhunter.json deleted file mode 100644 index 68a30b75..00000000 --- a/toolchains/solidity/linter/core/solidhunter-lib/testdata/FoundryFunctionName/.solidhunter.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "name": "solidhunter", - "includes": [], - "plugins": [], - "rules": [ - { - "id": "line-max-len", - "severity": "WARNING", - "data": [ - "80" - ] - }, - { - "id": "max-states-count", - "severity": "WARNING", - "data": [ - "15" - ] - }, - { - "id": "function-max-lines", - "severity": "WARNING", - "data": [ - "20" - ] - }, - { - "id": "reason-string", - "severity": "WARNING", - "data": [ - "32" - ] - }, - { - "id": "contract-name-camelcase", - "severity": "WARNING", - "data": [] - }, - { - "id": "func-param-name-mixedcase", - "severity": "WARNING", - "data": [] - }, - { - "id": "use-forbidden-name", - "severity": "WARNING", - "data": [] - }, - { - "id": "import-on-top", - "severity": "WARNING", - "data": [] - }, - { - "id": "foundry-func-name", - "severity": "WARNING", - "data": [] - } - ] -} \ No newline at end of file diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/FoundryFunctionName/findings.csv b/toolchains/solidity/linter/core/solidhunter-lib/testdata/FoundryFunctionName/findings.csv deleted file mode 100644 index 38ccd526..00000000 --- a/toolchains/solidity/linter/core/solidhunter-lib/testdata/FoundryFunctionName/findings.csv +++ /dev/null @@ -1 +0,0 @@ -foundry-func-name:12:13:12:23 \ No newline at end of file diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/FoundryTestFunctions/.solidhunter.json b/toolchains/solidity/linter/core/solidhunter-lib/testdata/FoundryTestFunctions/.solidhunter.json new file mode 100644 index 00000000..75c0d128 --- /dev/null +++ b/toolchains/solidity/linter/core/solidhunter-lib/testdata/FoundryTestFunctions/.solidhunter.json @@ -0,0 +1,10 @@ +{ + "name": "solidhunter", + "rules": [ + { + "id": "foundry-test-functions", + "severity": "WARNING", + "data": ["setUp"] + } + ] +} \ No newline at end of file diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/FoundryFunctionName/file.t.sol b/toolchains/solidity/linter/core/solidhunter-lib/testdata/FoundryTestFunctions/file.t.sol similarity index 100% rename from toolchains/solidity/linter/core/solidhunter-lib/testdata/FoundryFunctionName/file.t.sol rename to toolchains/solidity/linter/core/solidhunter-lib/testdata/FoundryTestFunctions/file.t.sol diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/FoundryTestFunctions/findings.csv b/toolchains/solidity/linter/core/solidhunter-lib/testdata/FoundryTestFunctions/findings.csv new file mode 100644 index 00000000..0129714c --- /dev/null +++ b/toolchains/solidity/linter/core/solidhunter-lib/testdata/FoundryTestFunctions/findings.csv @@ -0,0 +1 @@ +foundry-test-functions:12:13:12:23 \ No newline at end of file diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/FunctionMaxLines/.solidhunter.json b/toolchains/solidity/linter/core/solidhunter-lib/testdata/FunctionMaxLines/.solidhunter.json index 21863880..7690d8f8 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/testdata/FunctionMaxLines/.solidhunter.json +++ b/toolchains/solidity/linter/core/solidhunter-lib/testdata/FunctionMaxLines/.solidhunter.json @@ -1,53 +1,10 @@ { "name": "solidhunter", - "includes": [], - "plugins": [], "rules": [ - { - "id": "max-states-count", - "severity": "WARNING", - "data": [ - "15" - ] - }, { "id": "function-max-lines", "severity": "WARNING", - "data": [ - "20" - ] - }, - { - "id": "reason-string", - "severity": "WARNING", - "data": [ - "32" - ] - }, - { - "id": "contract-name-camelcase", - "severity": "WARNING", - "data": [] - }, - { - "id": "func-name-mixedcase", - "severity": "WARNING", - "data": [] - }, - { - "id": "func-param-name-mixedcase", - "severity": "WARNING", - "data": [] - }, - { - "id": "use-forbidden-name", - "severity": "WARNING", - "data": [] - }, - { - "id": "import-on-top", - "severity": "WARNING", - "data": [] + "data": 20 } ] } \ No newline at end of file diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/FunctionNameMixedCase/.solidhunter.json b/toolchains/solidity/linter/core/solidhunter-lib/testdata/FunctionNameMixedCase/.solidhunter.json index ea7d4682..c5fd7926 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/testdata/FunctionNameMixedCase/.solidhunter.json +++ b/toolchains/solidity/linter/core/solidhunter-lib/testdata/FunctionNameMixedCase/.solidhunter.json @@ -1,12 +1,9 @@ { "name": "solidhunter", - "includes": [], - "plugins": [], "rules": [ { "id": "func-name-mixedcase", - "severity": "WARNING", - "data": [] + "severity": "WARNING" } ] } \ No newline at end of file diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/FunctionParamNameMixedCase/.solidhunter.json b/toolchains/solidity/linter/core/solidhunter-lib/testdata/FunctionParamNameMixedCase/.solidhunter.json index 514e0016..f18b76bd 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/testdata/FunctionParamNameMixedCase/.solidhunter.json +++ b/toolchains/solidity/linter/core/solidhunter-lib/testdata/FunctionParamNameMixedCase/.solidhunter.json @@ -1,12 +1,9 @@ { "name": "solidhunter", - "includes": [], - "plugins": [], "rules": [ { "id": "func-param-name-mixedcase", - "severity": "WARNING", - "data": [] + "severity": "WARNING" } ] } \ No newline at end of file diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/FunctionVisibility/.solidhunter.json b/toolchains/solidity/linter/core/solidhunter-lib/testdata/FunctionVisibility/.solidhunter.json index b85e3750..7dbea862 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/testdata/FunctionVisibility/.solidhunter.json +++ b/toolchains/solidity/linter/core/solidhunter-lib/testdata/FunctionVisibility/.solidhunter.json @@ -1,67 +1,12 @@ { "name": "solidhunter", - "includes": [], - "plugins": [], "rules": [ - { - "id": "line-max-len", - "severity": "WARNING", - "data": [ - "80" - ] - }, - { - "id": "max-states-count", - "severity": "WARNING", - "data": [ - "15" - ] - }, - { - "id": "function-max-lines", - "severity": "WARNING", - "data": [ - "20" - ] - }, - { - "id": "reason-string", - "severity": "WARNING", - "data": [ - "32" - ] - }, - { - "id": "contract-name-camelcase", - "severity": "WARNING", - "data": [] - }, - { - "id": "func-name-mixedcase", - "severity": "WARNING", - "data": [] - }, - { - "id": "func-param-name-mixedcase", - "severity": "WARNING", - "data": [] - }, - { - "id": "use-forbidden-name", - "severity": "WARNING", - "data": [] - }, - { - "id": "import-on-top", - "severity": "WARNING", - "data": [] - }, { "id": "func-visibility", "severity": "WARNING", - "data": [ - "false" - ] + "data": { + "ignoreConstructors": false + } } ] } \ No newline at end of file diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/GlobalImport/.solidhunter.json b/toolchains/solidity/linter/core/solidhunter-lib/testdata/GlobalImport/.solidhunter.json deleted file mode 100644 index d5531b1d..00000000 --- a/toolchains/solidity/linter/core/solidhunter-lib/testdata/GlobalImport/.solidhunter.json +++ /dev/null @@ -1,65 +0,0 @@ -{ - "name": "solidhunter", - "includes": [], - "plugins": [], - "rules": [ - { - "id": "line-max-len", - "severity": "WARNING", - "data": [ - "80" - ] - }, - { - "id": "max-states-count", - "severity": "WARNING", - "data": [ - "15" - ] - }, - { - "id": "function-max-lines", - "severity": "WARNING", - "data": [ - "20" - ] - }, - { - "id": "reason-string", - "severity": "WARNING", - "data": [ - "32" - ] - }, - { - "id": "contract-name-camelcase", - "severity": "WARNING", - "data": [] - }, - { - "id": "func-name-mixedcase", - "severity": "WARNING", - "data": [] - }, - { - "id": "func-param-name-mixedcase", - "severity": "WARNING", - "data": [] - }, - { - "id": "use-forbidden-name", - "severity": "WARNING", - "data": [] - }, - { - "id": "import-on-top", - "severity": "WARNING", - "data": [] - }, - { - "id": "global-import", - "severity": "WARNING", - "data": [] - } - ] -} \ No newline at end of file diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/GlobalImport/findings.csv b/toolchains/solidity/linter/core/solidhunter-lib/testdata/GlobalImport/findings.csv deleted file mode 100644 index d553f1be..00000000 --- a/toolchains/solidity/linter/core/solidhunter-lib/testdata/GlobalImport/findings.csv +++ /dev/null @@ -1,2 +0,0 @@ -global-import:9:7:9:21 -global-import:11:7:11:16 \ No newline at end of file diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/ImplicitTypes/.solidhunter.json b/toolchains/solidity/linter/core/solidhunter-lib/testdata/ImplicitTypes/.solidhunter.json index 8deb89c9..b4e40d75 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/testdata/ImplicitTypes/.solidhunter.json +++ b/toolchains/solidity/linter/core/solidhunter-lib/testdata/ImplicitTypes/.solidhunter.json @@ -1,14 +1,10 @@ { "name": "solidhunter", - "includes": [], - "plugins": [], "rules": [ { "id": "explicit-types", "severity": "WARNING", - "data": [ - "implicit" - ] + "data": "implicit" } ] } \ No newline at end of file diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/ImportOnTop/.solidhunter.json b/toolchains/solidity/linter/core/solidhunter-lib/testdata/ImportOnTop/.solidhunter.json index 35d30a57..a9b68ce1 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/testdata/ImportOnTop/.solidhunter.json +++ b/toolchains/solidity/linter/core/solidhunter-lib/testdata/ImportOnTop/.solidhunter.json @@ -1,60 +1,9 @@ { "name": "solidhunter", - "includes": [], - "plugins": [], "rules": [ - { - "id": "line-max-len", - "severity": "WARNING", - "data": [ - "80" - ] - }, - { - "id": "max-states-count", - "severity": "WARNING", - "data": [ - "15" - ] - }, - { - "id": "function-max-lines", - "severity": "WARNING", - "data": [ - "20" - ] - }, - { - "id": "reason-string", - "severity": "WARNING", - "data": [ - "32" - ] - }, - { - "id": "contract-name-camelcase", - "severity": "WARNING", - "data": [] - }, - { - "id": "func-name-mixedcase", - "severity": "WARNING", - "data": [] - }, - { - "id": "func-param-name-mixedcase", - "severity": "WARNING", - "data": [] - }, - { - "id": "use-forbidden-name", - "severity": "WARNING", - "data": [] - }, { "id": "import-on-top", - "severity": "WARNING", - "data": [] + "severity": "WARNING" } ] } \ No newline at end of file diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/LineMaxLen/.solidhunter.json b/toolchains/solidity/linter/core/solidhunter-lib/testdata/LineMaxLen/.solidhunter.json deleted file mode 100644 index 35d30a57..00000000 --- a/toolchains/solidity/linter/core/solidhunter-lib/testdata/LineMaxLen/.solidhunter.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "name": "solidhunter", - "includes": [], - "plugins": [], - "rules": [ - { - "id": "line-max-len", - "severity": "WARNING", - "data": [ - "80" - ] - }, - { - "id": "max-states-count", - "severity": "WARNING", - "data": [ - "15" - ] - }, - { - "id": "function-max-lines", - "severity": "WARNING", - "data": [ - "20" - ] - }, - { - "id": "reason-string", - "severity": "WARNING", - "data": [ - "32" - ] - }, - { - "id": "contract-name-camelcase", - "severity": "WARNING", - "data": [] - }, - { - "id": "func-name-mixedcase", - "severity": "WARNING", - "data": [] - }, - { - "id": "func-param-name-mixedcase", - "severity": "WARNING", - "data": [] - }, - { - "id": "use-forbidden-name", - "severity": "WARNING", - "data": [] - }, - { - "id": "import-on-top", - "severity": "WARNING", - "data": [] - } - ] -} \ No newline at end of file diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/LineMaxLen/findings.csv b/toolchains/solidity/linter/core/solidhunter-lib/testdata/LineMaxLen/findings.csv deleted file mode 100644 index a92c1fc3..00000000 --- a/toolchains/solidity/linter/core/solidhunter-lib/testdata/LineMaxLen/findings.csv +++ /dev/null @@ -1 +0,0 @@ -line-max-len:4:80:4:90 \ No newline at end of file diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/MaxLineLength/.solidhunter.json b/toolchains/solidity/linter/core/solidhunter-lib/testdata/MaxLineLength/.solidhunter.json new file mode 100644 index 00000000..c799a344 --- /dev/null +++ b/toolchains/solidity/linter/core/solidhunter-lib/testdata/MaxLineLength/.solidhunter.json @@ -0,0 +1,10 @@ +{ + "name": "solidhunter", + "rules": [ + { + "id": "max-line-length", + "severity": "WARNING", + "data": 80 + } + ] +} \ No newline at end of file diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/LineMaxLen/file.sol b/toolchains/solidity/linter/core/solidhunter-lib/testdata/MaxLineLength/file.sol similarity index 100% rename from toolchains/solidity/linter/core/solidhunter-lib/testdata/LineMaxLen/file.sol rename to toolchains/solidity/linter/core/solidhunter-lib/testdata/MaxLineLength/file.sol diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/MaxLineLength/findings.csv b/toolchains/solidity/linter/core/solidhunter-lib/testdata/MaxLineLength/findings.csv new file mode 100644 index 00000000..0bf82ce1 --- /dev/null +++ b/toolchains/solidity/linter/core/solidhunter-lib/testdata/MaxLineLength/findings.csv @@ -0,0 +1 @@ +max-line-length:4:80:4:90 \ No newline at end of file diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/MaxStatesCount/.solidhunter.json b/toolchains/solidity/linter/core/solidhunter-lib/testdata/MaxStatesCount/.solidhunter.json index 35d30a57..1e80bc76 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/testdata/MaxStatesCount/.solidhunter.json +++ b/toolchains/solidity/linter/core/solidhunter-lib/testdata/MaxStatesCount/.solidhunter.json @@ -1,60 +1,12 @@ { "name": "solidhunter", - "includes": [], - "plugins": [], "rules": [ - { - "id": "line-max-len", - "severity": "WARNING", - "data": [ - "80" - ] - }, { "id": "max-states-count", "severity": "WARNING", "data": [ - "15" - ] - }, - { - "id": "function-max-lines", - "severity": "WARNING", - "data": [ - "20" - ] - }, - { - "id": "reason-string", - "severity": "WARNING", - "data": [ - "32" + 15 ] - }, - { - "id": "contract-name-camelcase", - "severity": "WARNING", - "data": [] - }, - { - "id": "func-name-mixedcase", - "severity": "WARNING", - "data": [] - }, - { - "id": "func-param-name-mixedcase", - "severity": "WARNING", - "data": [] - }, - { - "id": "use-forbidden-name", - "severity": "WARNING", - "data": [] - }, - { - "id": "import-on-top", - "severity": "WARNING", - "data": [] } ] } \ No newline at end of file diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/ModifierNameMixedcase/.solidhunter.json b/toolchains/solidity/linter/core/solidhunter-lib/testdata/ModifierNameMixedcase/.solidhunter.json index 44021895..27a9d80c 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/testdata/ModifierNameMixedcase/.solidhunter.json +++ b/toolchains/solidity/linter/core/solidhunter-lib/testdata/ModifierNameMixedcase/.solidhunter.json @@ -1,7 +1,5 @@ { "name": "solidhunter", - "includes": [], - "plugins": [], "rules": [ { "id": "modifier-name-mixedcase", diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/NamedParametersMapping/.solidhunter.json b/toolchains/solidity/linter/core/solidhunter-lib/testdata/NamedParametersMapping/.solidhunter.json index 26bcc01c..ba23150d 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/testdata/NamedParametersMapping/.solidhunter.json +++ b/toolchains/solidity/linter/core/solidhunter-lib/testdata/NamedParametersMapping/.solidhunter.json @@ -1,70 +1,9 @@ { "name": "solidhunter", - "includes": [], - "plugins": [], "rules": [ - { - "id": "line-max-len", - "severity": "WARNING", - "data": [ - "80" - ] - }, - { - "id": "no-inline-assembly", - "severity": "WARNING", - "data": [] - }, { "id": "named-parameters-mapping", - "severity": "WARNING", - "data": [] - }, - { - "id": "max-states-count", - "severity": "WARNING", - "data": [ - "15" - ] - }, - { - "id": "function-max-lines", - "severity": "WARNING", - "data": [ - "20" - ] - }, - { - "id": "reason-string", - "severity": "WARNING", - "data": [ - "32" - ] - }, - { - "id": "contract-name-camelcase", - "severity": "WARNING", - "data": [] - }, - { - "id": "func-name-mixedcase", - "severity": "WARNING", - "data": [] - }, - { - "id": "func-param-name-mixedcase", - "severity": "WARNING", - "data": [] - }, - { - "id": "use-forbidden-name", - "severity": "WARNING", - "data": [] - }, - { - "id": "import-on-top", - "severity": "WARNING", - "data": [] + "severity": "WARNING" } ] } \ No newline at end of file diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/NoConsole/.solidhunter.json b/toolchains/solidity/linter/core/solidhunter-lib/testdata/NoConsole/.solidhunter.json index 35f32814..781e0c90 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/testdata/NoConsole/.solidhunter.json +++ b/toolchains/solidity/linter/core/solidhunter-lib/testdata/NoConsole/.solidhunter.json @@ -1,65 +1,9 @@ { "name": "solidhunter", - "includes": [], - "plugins": [], "rules": [ - { - "id": "line-max-len", - "severity": "WARNING", - "data": [ - "80" - ] - }, - { - "id": "max-states-count", - "severity": "WARNING", - "data": [ - "15" - ] - }, - { - "id": "function-max-lines", - "severity": "WARNING", - "data": [ - "20" - ] - }, - { - "id": "reason-string", - "severity": "WARNING", - "data": [ - "32" - ] - }, - { - "id": "contract-name-camelcase", - "severity": "WARNING", - "data": [] - }, - { - "id": "func-name-mixedcase", - "severity": "WARNING", - "data": [] - }, - { - "id": "func-param-name-mixedcase", - "severity": "WARNING", - "data": [] - }, - { - "id": "use-forbidden-name", - "severity": "WARNING", - "data": [] - }, - { - "id": "import-on-top", - "severity": "WARNING", - "data": [] - }, { "id": "no-console", - "severity": "WARNING", - "data": [] + "severity": "WARNING" } ] } \ No newline at end of file diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/NoEmptyBlock/.solidhunter.json b/toolchains/solidity/linter/core/solidhunter-lib/testdata/NoEmptyBlock/.solidhunter.json new file mode 100644 index 00000000..740c857e --- /dev/null +++ b/toolchains/solidity/linter/core/solidhunter-lib/testdata/NoEmptyBlock/.solidhunter.json @@ -0,0 +1,9 @@ +{ + "name": "solidhunter", + "rules": [ + { + "id": "no-empty-block", + "severity": "WARNING" + } + ] +} \ No newline at end of file diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/EmptyBlock/file.sol b/toolchains/solidity/linter/core/solidhunter-lib/testdata/NoEmptyBlock/file.sol similarity index 100% rename from toolchains/solidity/linter/core/solidhunter-lib/testdata/EmptyBlock/file.sol rename to toolchains/solidity/linter/core/solidhunter-lib/testdata/NoEmptyBlock/file.sol diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/NoEmptyBlock/findings.csv b/toolchains/solidity/linter/core/solidhunter-lib/testdata/NoEmptyBlock/findings.csv new file mode 100644 index 00000000..eb3da04a --- /dev/null +++ b/toolchains/solidity/linter/core/solidhunter-lib/testdata/NoEmptyBlock/findings.csv @@ -0,0 +1,2 @@ +no-empty-block:3:10:3:13 +no-empty-block:5:10:5:15 \ No newline at end of file diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/NoGlobalImport/.solidhunter.json b/toolchains/solidity/linter/core/solidhunter-lib/testdata/NoGlobalImport/.solidhunter.json new file mode 100644 index 00000000..d5221439 --- /dev/null +++ b/toolchains/solidity/linter/core/solidhunter-lib/testdata/NoGlobalImport/.solidhunter.json @@ -0,0 +1,9 @@ +{ + "name": "solidhunter", + "rules": [ + { + "id": "no-global-import", + "severity": "WARNING" + } + ] +} \ No newline at end of file diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/GlobalImport/add.sol b/toolchains/solidity/linter/core/solidhunter-lib/testdata/NoGlobalImport/add.sol similarity index 100% rename from toolchains/solidity/linter/core/solidhunter-lib/testdata/GlobalImport/add.sol rename to toolchains/solidity/linter/core/solidhunter-lib/testdata/NoGlobalImport/add.sol diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/GlobalImport/file.sol b/toolchains/solidity/linter/core/solidhunter-lib/testdata/NoGlobalImport/file.sol similarity index 100% rename from toolchains/solidity/linter/core/solidhunter-lib/testdata/GlobalImport/file.sol rename to toolchains/solidity/linter/core/solidhunter-lib/testdata/NoGlobalImport/file.sol diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/NoGlobalImport/findings.csv b/toolchains/solidity/linter/core/solidhunter-lib/testdata/NoGlobalImport/findings.csv new file mode 100644 index 00000000..de6b2279 --- /dev/null +++ b/toolchains/solidity/linter/core/solidhunter-lib/testdata/NoGlobalImport/findings.csv @@ -0,0 +1,2 @@ +no-global-import:9:7:9:21 +no-global-import:11:7:11:16 \ No newline at end of file diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/NoInlineAssembly/.solidhunter.json b/toolchains/solidity/linter/core/solidhunter-lib/testdata/NoInlineAssembly/.solidhunter.json index 619c9c94..4856bb47 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/testdata/NoInlineAssembly/.solidhunter.json +++ b/toolchains/solidity/linter/core/solidhunter-lib/testdata/NoInlineAssembly/.solidhunter.json @@ -1,65 +1,9 @@ { "name": "solidhunter", - "includes": [], - "plugins": [], "rules": [ - { - "id": "line-max-len", - "severity": "WARNING", - "data": [ - "80" - ] - }, { "id": "no-inline-assembly", - "severity": "WARNING", - "data": [] - }, - { - "id": "max-states-count", - "severity": "WARNING", - "data": [ - "15" - ] - }, - { - "id": "function-max-lines", - "severity": "WARNING", - "data": [ - "20" - ] - }, - { - "id": "reason-string", - "severity": "WARNING", - "data": [ - "32" - ] - }, - { - "id": "contract-name-camelcase", - "severity": "WARNING", - "data": [] - }, - { - "id": "func-name-mixedcase", - "severity": "WARNING", - "data": [] - }, - { - "id": "func-param-name-mixedcase", - "severity": "WARNING", - "data": [] - }, - { - "id": "use-forbidden-name", - "severity": "WARNING", - "data": [] - }, - { - "id": "import-on-top", - "severity": "WARNING", - "data": [] + "severity": "WARNING" } ] } \ No newline at end of file diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/NotRelyOnTime/.solidhunter.json b/toolchains/solidity/linter/core/solidhunter-lib/testdata/NotRelyOnTime/.solidhunter.json index 96bcdbc5..48c07876 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/testdata/NotRelyOnTime/.solidhunter.json +++ b/toolchains/solidity/linter/core/solidhunter-lib/testdata/NotRelyOnTime/.solidhunter.json @@ -1,12 +1,9 @@ { "name": "solidhunter", - "includes": [], - "plugins": [], "rules": [ { "id": "not-rely-on-time", - "severity": "WARNING", - "data": [] + "severity": "WARNING" } ] } \ No newline at end of file diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/OneContractPerFile/.solidhunter.json b/toolchains/solidity/linter/core/solidhunter-lib/testdata/OneContractPerFile/.solidhunter.json index cc784faa..ababe57c 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/testdata/OneContractPerFile/.solidhunter.json +++ b/toolchains/solidity/linter/core/solidhunter-lib/testdata/OneContractPerFile/.solidhunter.json @@ -1,65 +1,9 @@ { "name": "solidhunter", - "includes": [], - "plugins": [], "rules": [ - { - "id": "line-max-len", - "severity": "WARNING", - "data": [ - "80" - ] - }, - { - "id": "max-states-count", - "severity": "WARNING", - "data": [ - "15" - ] - }, - { - "id": "function-max-lines", - "severity": "WARNING", - "data": [ - "20" - ] - }, - { - "id": "reason-string", - "severity": "WARNING", - "data": [ - "32" - ] - }, - { - "id": "contract-name-camelcase", - "severity": "WARNING", - "data": [] - }, - { - "id": "func-name-mixedcase", - "severity": "WARNING", - "data": [] - }, - { - "id": "func-param-name-mixedcase", - "severity": "WARNING", - "data": [] - }, - { - "id": "use-forbidden-name", - "severity": "WARNING", - "data": [] - }, - { - "id": "import-on-top", - "severity": "WARNING", - "data": [] - }, { "id": "one-contract-per-file", - "severity": "WARNING", - "data": [] + "severity": "WARNING" } ] } \ No newline at end of file diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/Ordering/.solidhunter.json b/toolchains/solidity/linter/core/solidhunter-lib/testdata/Ordering/.solidhunter.json index 8cd1f7d2..b5e4a907 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/testdata/Ordering/.solidhunter.json +++ b/toolchains/solidity/linter/core/solidhunter-lib/testdata/Ordering/.solidhunter.json @@ -1,12 +1,9 @@ { "name": "solidhunter", - "includes": [], - "plugins": [], "rules": [ { "id": "ordering", - "severity": "WARNING", - "data": [] + "severity": "WARNING" } ] } \ No newline at end of file diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/PayableFallback/.solidhunter.json b/toolchains/solidity/linter/core/solidhunter-lib/testdata/PayableFallback/.solidhunter.json index cca0fc11..c0e718c2 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/testdata/PayableFallback/.solidhunter.json +++ b/toolchains/solidity/linter/core/solidhunter-lib/testdata/PayableFallback/.solidhunter.json @@ -1,65 +1,9 @@ { "name": "solidhunter", - "includes": [], - "plugins": [], "rules": [ - { - "id": "line-max-len", - "severity": "WARNING", - "data": [ - "80" - ] - }, - { - "id": "max-states-count", - "severity": "WARNING", - "data": [ - "15" - ] - }, - { - "id": "function-max-lines", - "severity": "WARNING", - "data": [ - "20" - ] - }, - { - "id": "reason-string", - "severity": "WARNING", - "data": [ - "32" - ] - }, - { - "id": "contract-name-camelcase", - "severity": "WARNING", - "data": [] - }, - { - "id": "func-name-mixedcase", - "severity": "WARNING", - "data": [] - }, - { - "id": "func-param-name-mixedcase", - "severity": "WARNING", - "data": [] - }, - { - "id": "use-forbidden-name", - "severity": "WARNING", - "data": [] - }, - { - "id": "import-on-top", - "severity": "WARNING", - "data": [] - }, { "id": "payable-fallback", - "severity": "WARNING", - "data": [] + "severity": "WARNING" } ] } \ No newline at end of file diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/PrivateVarsLeadingUnderscore/.solidhunter.json b/toolchains/solidity/linter/core/solidhunter-lib/testdata/PrivateVarsLeadingUnderscore/.solidhunter.json index e37baad5..5751c26c 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/testdata/PrivateVarsLeadingUnderscore/.solidhunter.json +++ b/toolchains/solidity/linter/core/solidhunter-lib/testdata/PrivateVarsLeadingUnderscore/.solidhunter.json @@ -1,57 +1,12 @@ { "name": "solidhunter", - "includes": [], - "plugins": [], "rules": [ - { - "id": "line-max-len", - "severity": "WARNING", - "data": [ - "80" - ] - }, - { - "id": "max-states-count", - "severity": "WARNING", - "data": [ - "15" - ] - }, - { - "id": "function-max-lines", - "severity": "WARNING", - "data": [ - "20" - ] - }, - { - "id": "reason-string", - "severity": "WARNING", - "data": [ - "32" - ] - }, - { - "id": "contract-name-camelcase", - "severity": "WARNING", - "data": [] - }, - { - "id": "use-forbidden-name", - "severity": "WARNING", - "data": [] - }, - { - "id": "import-on-top", - "severity": "WARNING", - "data": [] - }, { "id": "private-vars-leading-underscore", "severity": "WARNING", - "data": [{ + "data": { "strict": true - }] + } } ] } \ No newline at end of file diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/ReasonString/.solidhunter.json b/toolchains/solidity/linter/core/solidhunter-lib/testdata/ReasonString/.solidhunter.json index 35d30a57..b2ec50b7 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/testdata/ReasonString/.solidhunter.json +++ b/toolchains/solidity/linter/core/solidhunter-lib/testdata/ReasonString/.solidhunter.json @@ -1,60 +1,10 @@ { "name": "solidhunter", - "includes": [], - "plugins": [], "rules": [ - { - "id": "line-max-len", - "severity": "WARNING", - "data": [ - "80" - ] - }, - { - "id": "max-states-count", - "severity": "WARNING", - "data": [ - "15" - ] - }, - { - "id": "function-max-lines", - "severity": "WARNING", - "data": [ - "20" - ] - }, { "id": "reason-string", "severity": "WARNING", - "data": [ - "32" - ] - }, - { - "id": "contract-name-camelcase", - "severity": "WARNING", - "data": [] - }, - { - "id": "func-name-mixedcase", - "severity": "WARNING", - "data": [] - }, - { - "id": "func-param-name-mixedcase", - "severity": "WARNING", - "data": [] - }, - { - "id": "use-forbidden-name", - "severity": "WARNING", - "data": [] - }, - { - "id": "import-on-top", - "severity": "WARNING", - "data": [] + "data": 20 } ] } \ No newline at end of file diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/ReasonString/file.sol b/toolchains/solidity/linter/core/solidhunter-lib/testdata/ReasonString/file.sol index bc29cc8e..1f4b6f69 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/testdata/ReasonString/file.sol +++ b/toolchains/solidity/linter/core/solidhunter-lib/testdata/ReasonString/file.sol @@ -2,12 +2,11 @@ pragma solidity 0.8.0; contract Test { function awesome() public { - require(!has(role, account), "This is perfect"); - } - function notAwesome() public { require(!has(role, account), "This is not perfect at all because i"); - } - function notAwesomeEither() public { require(!has(role, account)); + assert(!has(role, account)); + assert(!has(role, account), "This is not perfect at all because i"); + revert(); + revert("This is not perfect at all because i"); } } \ No newline at end of file diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/ReasonString/findings.csv b/toolchains/solidity/linter/core/solidhunter-lib/testdata/ReasonString/findings.csv index d0c35af6..779c32f1 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/testdata/ReasonString/findings.csv +++ b/toolchains/solidity/linter/core/solidhunter-lib/testdata/ReasonString/findings.csv @@ -1,2 +1,6 @@ -reason-string:8:37:8:75 -reason-string:11:8:11:15 \ No newline at end of file +reason-string:5:37:5:75 +reason-string:6:8:6:15 +reason-string:7:8:7:14 +reason-string:8:36:8:74 +reason-string:9:8:9:14 +reason-string:10:15:10:53 \ No newline at end of file diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/StateVisibility/.solidhunter.json b/toolchains/solidity/linter/core/solidhunter-lib/testdata/StateVisibility/.solidhunter.json index 2935d324..b28b0a6d 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/testdata/StateVisibility/.solidhunter.json +++ b/toolchains/solidity/linter/core/solidhunter-lib/testdata/StateVisibility/.solidhunter.json @@ -1,68 +1,6 @@ { "name": "solidhunter", - "includes": [], - "plugins": [], "rules": [ - { - "id": "line-max-len", - "severity": "WARNING", - "data": [ - "80" - ] - }, - { - "id": "max-states-count", - "severity": "WARNING", - "data": [ - "15" - ] - }, - { - "id": "function-max-lines", - "severity": "WARNING", - "data": [ - "20" - ] - }, - { - "id": "reason-string", - "severity": "WARNING", - "data": [ - "32" - ] - }, - { - "id": "contract-name-camelcase", - "severity": "WARNING", - "data": [] - }, - { - "id": "func-name-mixedcase", - "severity": "WARNING", - "data": [] - }, - { - "id": "func-param-name-mixedcase", - "severity": "WARNING", - "data": [] - }, - { - "id": "use-forbidden-name", - "severity": "WARNING", - "data": [] - }, - { - "id": "import-on-top", - "severity": "WARNING", - "data": [] - }, - { - "id": "func-visibility", - "severity": "WARNING", - "data": [ - "false" - ] - }, { "id": "state-visibility", "severity": "WARNING", diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/UseForbiddenName/.solidhunter.json b/toolchains/solidity/linter/core/solidhunter-lib/testdata/UseForbiddenName/.solidhunter.json index 35d30a57..8606009f 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/testdata/UseForbiddenName/.solidhunter.json +++ b/toolchains/solidity/linter/core/solidhunter-lib/testdata/UseForbiddenName/.solidhunter.json @@ -1,60 +1,9 @@ { - "name": "solidhunter", - "includes": [], - "plugins": [], - "rules": [ - { - "id": "line-max-len", - "severity": "WARNING", - "data": [ - "80" - ] - }, - { - "id": "max-states-count", - "severity": "WARNING", - "data": [ - "15" - ] - }, - { - "id": "function-max-lines", - "severity": "WARNING", - "data": [ - "20" - ] - }, - { - "id": "reason-string", - "severity": "WARNING", - "data": [ - "32" - ] - }, - { - "id": "contract-name-camelcase", - "severity": "WARNING", - "data": [] - }, - { - "id": "func-name-mixedcase", - "severity": "WARNING", - "data": [] - }, - { - "id": "func-param-name-mixedcase", - "severity": "WARNING", - "data": [] - }, + "name": "solidhunter", "rules": [ { "id": "use-forbidden-name", "severity": "WARNING", "data": [] - }, - { - "id": "import-on-top", - "severity": "WARNING", - "data": [] } ] } \ No newline at end of file diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/VarNameMixedCase/.solidhunter.json b/toolchains/solidity/linter/core/solidhunter-lib/testdata/VarNameMixedCase/.solidhunter.json index 5bc8d8e8..1d2da69c 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/testdata/VarNameMixedCase/.solidhunter.json +++ b/toolchains/solidity/linter/core/solidhunter-lib/testdata/VarNameMixedCase/.solidhunter.json @@ -1,12 +1,8 @@ { - "name": "solidhunter", - "includes": [], - "plugins": [], - "rules": [ + "name": "solidhunter", "rules": [ { "id": "var-name-mixedcase", - "severity": "WARNING", - "data": [] + "severity": "WARNING" } ] } \ No newline at end of file diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/VisibilityModifierOrder/.solidhunter.json b/toolchains/solidity/linter/core/solidhunter-lib/testdata/VisibilityModifierOrder/.solidhunter.json index 91510d05..1dd3998a 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/testdata/VisibilityModifierOrder/.solidhunter.json +++ b/toolchains/solidity/linter/core/solidhunter-lib/testdata/VisibilityModifierOrder/.solidhunter.json @@ -1,65 +1,8 @@ { - "name": "solidhunter", - "includes": [], - "plugins": [], - "rules": [ - { - "id": "line-max-len", - "severity": "WARNING", - "data": [ - "80" - ] - }, - { - "id": "max-states-count", - "severity": "WARNING", - "data": [ - "15" - ] - }, - { - "id": "function-max-lines", - "severity": "WARNING", - "data": [ - "20" - ] - }, - { - "id": "reason-string", - "severity": "WARNING", - "data": [ - "32" - ] - }, - { - "id": "contract-name-camelcase", - "severity": "WARNING", - "data": [] - }, - { - "id": "func-name-mixedcase", - "severity": "WARNING", - "data": [] - }, - { - "id": "func-param-name-mixedcase", - "severity": "WARNING", - "data": [] - }, - { - "id": "use-forbidden-name", - "severity": "WARNING", - "data": [] - }, - { - "id": "import-on-top", - "severity": "WARNING", - "data": [] - }, + "name": "solidhunter", "rules": [ { "id": "visibility-modifier-order", - "severity": "WARNING", - "data": [] + "severity": "WARNING" } ] } \ No newline at end of file diff --git a/toolchains/solidity/linter/core/solidhunter-lib/tests/linter.rs b/toolchains/solidity/linter/core/solidhunter-lib/tests/linter.rs index 05ad148b..e93282d1 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/tests/linter.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/tests/linter.rs @@ -50,7 +50,8 @@ fn test_directory(base_name: &str) { } fn test_linter(config: &str, source: &str, expected_findings: &Vec) { - let mut linter: SolidLinter = SolidLinter::new(&String::from(config)); + let mut linter: SolidLinter = SolidLinter::new(); + let _ = linter.initialize_rules(&String::from(config)); let result = linter.parse_file(String::from(source)); let mut found_findings: Vec<&Finding> = Vec::new(); @@ -143,7 +144,7 @@ test_directories! { ContractNameCamelCase, FunctionMaxLines, ImportOnTop, - LineMaxLen, + MaxLineLength, MaxStatesCount, FunctionNameMixedCase, FunctionParamNameMixedCase, @@ -156,7 +157,7 @@ test_directories! { EventNameCamelCase, ConstNameSnakeCase, StateVisibility, - EmptyBlock, + NoEmptyBlock, NoConsole, ExplicitTypes, ImplicitTypes, @@ -164,9 +165,11 @@ test_directories! { VisibilityModifierOrder, VarNameMixedCase, ModifierNameMixedcase, - GlobalImport, + NoGlobalImport, NotRelyOnTime, NamedParametersMapping, Ordering, - PrivateVarsLeadingUnderscore + PrivateVarsLeadingUnderscore, + FoundryTestFunctions, + AvoidTxOrigin, } From 774251429c44d8fb0a4c06692475a4056d894a44 Mon Sep 17 00:00:00 2001 From: 0xtekgrinder <0xtekgrinder@protonmail.com> Date: Wed, 11 Oct 2023 18:58:40 -0400 Subject: [PATCH 238/325] chore: remove remove-me --- remove-me-86c8b0d1aedf417b9e72.txt | 1 - 1 file changed, 1 deletion(-) delete mode 100644 remove-me-86c8b0d1aedf417b9e72.txt diff --git a/remove-me-86c8b0d1aedf417b9e72.txt b/remove-me-86c8b0d1aedf417b9e72.txt deleted file mode 100644 index 07ef080c..00000000 --- a/remove-me-86c8b0d1aedf417b9e72.txt +++ /dev/null @@ -1 +0,0 @@ -86c8b0d1aedf417b9e72 From 51d162898f14882848fb4525c2eaf2246eabc066 Mon Sep 17 00:00:00 2001 From: 0xtekgrinder <0xtekgrinder@protonmail.com> Date: Wed, 11 Oct 2023 19:01:18 -0400 Subject: [PATCH 239/325] chore(solidity/linter/core): update version to 0.0.2 --- toolchains/solidity/linter/core/Cargo.lock | 2 +- toolchains/solidity/linter/core/Cargo.toml | 2 +- toolchains/solidity/linter/core/package.json | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/toolchains/solidity/linter/core/Cargo.lock b/toolchains/solidity/linter/core/Cargo.lock index 6c1e119c..cd278eea 100644 --- a/toolchains/solidity/linter/core/Cargo.lock +++ b/toolchains/solidity/linter/core/Cargo.lock @@ -620,7 +620,7 @@ dependencies = [ [[package]] name = "solidhunter" -version = "0.0.1" +version = "0.0.2" dependencies = [ "anyhow", "clap", diff --git a/toolchains/solidity/linter/core/Cargo.toml b/toolchains/solidity/linter/core/Cargo.toml index 7d38fad5..314449b7 100644 --- a/toolchains/solidity/linter/core/Cargo.toml +++ b/toolchains/solidity/linter/core/Cargo.toml @@ -5,7 +5,7 @@ members = [ [package] name = "solidhunter" -version = "0.0.1" +version = "0.0.2" edition = "2021" authors = ["Astrodevs Labs"] license = "GPL-3.0-or-later" diff --git a/toolchains/solidity/linter/core/package.json b/toolchains/solidity/linter/core/package.json index 9372cfb8..d8380fdf 100644 --- a/toolchains/solidity/linter/core/package.json +++ b/toolchains/solidity/linter/core/package.json @@ -1,6 +1,6 @@ { "name": "osmium-solidity-linter-core", - "version": "0.0.1", + "version": "0.0.2", "license": "MIT", "scripts": { "build": "cargo build --release", From 485caa7cbaffd20f5afd5bc76066d8b100ace79b Mon Sep 17 00:00:00 2001 From: 0xtekgrinder <0xtekgrinder@protonmail.com> Date: Wed, 11 Oct 2023 19:03:25 -0400 Subject: [PATCH 240/325] style(solidity/linter/core): format explic_types --- .../rules/best_practises/explicit_types.rs | 49 +++++++++---------- 1 file changed, 23 insertions(+), 26 deletions(-) diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/explicit_types.rs b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/explicit_types.rs index b141048a..c89a3330 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/explicit_types.rs +++ b/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/explicit_types.rs @@ -11,7 +11,10 @@ pub const RULE_ID: &str = "explicit-types"; // specific const DEFAULT_RULE: &str = "explicit"; const DEFAULT_SEVERITY: Severity = Severity::WARNING; -const EXPLICIT_TYPES: &[&str] = &["uint256", "int256", "uint8", "int8", "uint16", "int16", "uint32", "int32", "uint64", "int64", "uint128", "int128"]; +const EXPLICIT_TYPES: &[&str] = &[ + "uint256", "int256", "uint8", "int8", "uint16", "int16", "uint32", "int32", "uint64", "int64", + "uint128", "int128", +]; const IMPLICIT_TYPES: &[&str] = &["uint", "int"]; pub struct ExplicitTypes { @@ -23,11 +26,10 @@ pub struct ExplicitTypesVisitor { explicit: bool, defs: Vec, decls: Vec, - types: Vec + types: Vec, } impl<'ast> Visit<'ast> for ExplicitTypesVisitor { - fn visit_variable_definition(&mut self, var: &'ast VariableDefinition) { if let Some((_, expr)) = &var.initializer { visit::visit_expr(self, expr); @@ -37,13 +39,13 @@ impl<'ast> Visit<'ast> for ExplicitTypesVisitor { } } - fn visit_variable_declaration(&mut self,var: &'ast VariableDeclaration) { + fn visit_variable_declaration(&mut self, var: &'ast VariableDeclaration) { if self.is_type_match(&var.ty) { self.decls.push(var.clone()) } } - fn visit_type(&mut self,ty: &'ast Type) { + fn visit_type(&mut self, ty: &'ast Type) { if self.is_type_match(ty) { self.types.push(ty.clone()); } @@ -53,13 +55,9 @@ impl<'ast> Visit<'ast> for ExplicitTypesVisitor { impl ExplicitTypesVisitor { fn is_type_match(&self, ty: &Type) -> bool { if self.explicit { - IMPLICIT_TYPES.iter().any(|typ| { - ty.to_string() == *typ - }) + IMPLICIT_TYPES.iter().any(|typ| ty.to_string() == *typ) } else { - EXPLICIT_TYPES.iter().any(|typ| { - ty.to_string() == *typ - }) + EXPLICIT_TYPES.iter().any(|typ| ty.to_string() == *typ) } } } @@ -78,7 +76,11 @@ impl ExplicitTypes { }, }, id: RULE_ID.to_string(), - message: format!("Rule is set with {} type [var/s: {}]", self.rule, var.unwrap_or("\"\"".to_string())), + message: format!( + "Rule is set with {} type [var/s: {}]", + self.rule, + var.unwrap_or("\"\"".to_string()) + ), severity: self.data.severity, code: None, source: None, @@ -95,7 +97,7 @@ impl RuleType for ExplicitTypes { explicit: self.rule == "explicit", defs: vec![], decls: vec![], - types: vec![] + types: vec![], }; visitor.visit_file(&file.data); for def in visitor.defs { @@ -104,7 +106,7 @@ impl RuleType for ExplicitTypes { for decl in visitor.decls { let name = match decl.name { Some(ident) => Some(ident.0.to_string()), - _ => None + _ => None, }; res.push(self.create_diag(file, Box::new(decl.ty), name)); } @@ -120,22 +122,17 @@ impl ExplicitTypes { let mut value = DEFAULT_RULE.to_string(); if let Some(data) = &data.data { - let parsed: Result = serde_json::from_value(data.clone()); - match parsed { - Ok(val) => { - value = val - }, - Err(_) => { - eprintln!("{} rule : bad config data", RULE_ID); + let parsed: Result = serde_json::from_value(data.clone()); + match parsed { + Ok(val) => value = val, + Err(_) => { + eprintln!("{} rule : bad config data", RULE_ID); + } } - } } else { eprintln!("{} rule : bad config data", RULE_ID); } - let rule = ExplicitTypes { - rule: value, - data, - }; + let rule = ExplicitTypes { rule: value, data }; Box::new(rule) } From e28978696ac9c1cace0b26a1acdaeefdbdb14b8c Mon Sep 17 00:00:00 2001 From: 0xMemoryGrinder <35138272+0xMemoryGrinder@users.noreply.github.com> Date: Wed, 11 Oct 2023 21:38:23 -0400 Subject: [PATCH 241/325] fix(cd): now create and search for correct tag when publihsing --- .github/workflows/cd.yml | 29 +++++++++++++++++++++-------- 1 file changed, 21 insertions(+), 8 deletions(-) diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index 03f80a17..fd559052 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -50,6 +50,21 @@ jobs: yarn -v yarn plugin import workspace-tools + - name: Get workspace path + id: workspace-path + run: | + echo "workspace-path=$(yarn workspaces info ${{ matrix.workspace.name }} --json | jq -r '.data[0].location')" >> $GITHUB_OUTPUT + + - name: Check .unstable + id: check-unstable + run: | + cd ${{ steps.workspace-path.outputs.workspace-path }} + if [ -f ".unstable" ]; then + echo "is-unstable=true" >> $GITHUB_OUTPUT + else + echo "is-unstable=false" >> $GITHUB_OUTPUT + fi + - uses: paulhatch/semantic-version@d43966692519e4a5d4423b3da1b4b903c58c8f6b id: find-new-version with: @@ -62,20 +77,13 @@ jobs: minor_pattern: "/feat\\(?/" # A string to determine the format of the version output version_format: "${major}.${minor}.${patch}" - # Optional path to check for changes. If any changes are detected in the path the - # 'changed' output will true. Enter multiple paths separated by spaces. - #change_path: "src/my-service" - # Named version, will be used as suffix for name version tag - namespace: my-service # If this is set to true, *every* commit will be treated as a new version. bump_each_commit: false # If true, the body of commits will also be searched for major/minor patterns to determine the version type. search_commit_body: false - # The output method used to generate list of users, 'csv' or 'json'. - user_format_type: "csv" # Prevents pre-v1.0.0 version from automatically incrementing the major version. # If enabled, when the major version is 0, major releases will be treated as minor and minor as patch. Note that the version_type output is unchanged. - enable_prerelease_mode: true + enable_prerelease_mode: ${{ steps.check-unstable.outputs.is-unstable }} - name: Normalize version uses: actions/github-script@v6 @@ -91,6 +99,11 @@ jobs: return "${{steps.find-new-version.outputs.major}}.${{steps.find-new-version.outputs.minor}}." + (patch + 1).toString(); } else return "${{steps.find-new-version.outputs.major}}.${{steps.find-new-version.outputs.minor}}.${{steps.find-new-version.outputs.patch}}" + + - name: Set tag + run: | + git tag ${{ steps.tag.outputs.result }} + git push origin ${{ steps.tag.outputs.result }} - name: Install dependencies run: | From d5b7f0fed3173af683ad091109e219bfa7eddbae Mon Sep 17 00:00:00 2001 From: Astrodevs CI Date: Fri, 20 Oct 2023 03:00:30 +0000 Subject: [PATCH 242/325] chore: create branch chore/171-refactor-lsp-and-wasm-handling-staging --- remove-me-031f29e69a154980b2db.txt | 1 + 1 file changed, 1 insertion(+) create mode 100644 remove-me-031f29e69a154980b2db.txt diff --git a/remove-me-031f29e69a154980b2db.txt b/remove-me-031f29e69a154980b2db.txt new file mode 100644 index 00000000..93c704ff --- /dev/null +++ b/remove-me-031f29e69a154980b2db.txt @@ -0,0 +1 @@ +031f29e69a154980b2db From 0d936f5523b61ae3986c8ca8a2a5a9829e2c704c Mon Sep 17 00:00:00 2001 From: 0xMemoryGrinder <35138272+0xMemoryGrinder@users.noreply.github.com> Date: Fri, 20 Oct 2023 14:45:01 -0400 Subject: [PATCH 243/325] feat: reworked file architecture to comply with LSP dispatching and wasm core format wip stonks --- .pnp.cjs | 1395 +++----------- libs/ast-extractor/Cargo.lock | 2 +- libs/ast-extractor/Cargo.toml | 5 +- libs/ast-extractor/package.json | 3 +- libs/lsp-handler/Cargo.lock | 349 ++++ libs/lsp-handler/Cargo.toml | 22 + libs/lsp-handler/package.json | 10 + libs/lsp-handler/src/connection.rs | 422 ++++ libs/lsp-handler/src/dispatcher.rs | 1706 +++++++++++++++++ libs/lsp-handler/src/handler.rs | 1207 ++++++++++++ libs/lsp-handler/src/helpers.rs | 18 + libs/lsp-handler/src/jsonrpc.rs | 4 + libs/lsp-handler/src/jsonrpc/error.rs | 205 ++ libs/lsp-handler/src/lib.rs | 12 + .../solidity/{linter => }/core/Cargo.lock | 497 ++--- toolchains/solidity/core/Cargo.toml | 21 + .../solidity/core/crates/extension/Cargo.toml | 15 + .../solidity/core/crates/extension/Makefile | 2 + .../solidity/core/crates/extension/src/lib.rs | 15 + .../core/crates/linter-cli/Cargo.toml | 16 + .../solidity/core/crates/linter-cli/Makefile | 4 + .../crates/linter-cli}/src/main.rs | 20 +- .../crates/linter-lib}/.gitignore | 0 .../crates/linter-lib}/Cargo.toml | 10 +- .../solidity/core/crates/linter-lib/Makefile | 4 + .../crates/linter-lib}/src/errors.rs | 2 +- .../crates/linter-lib}/src/lib.rs | 0 .../crates/linter-lib}/src/linter.rs | 8 +- .../src/rules/best_practises/custom_errors.rs | 2 +- .../rules/best_practises/explicit_types.rs | 2 +- .../best_practises/function_max_lines.rs | 8 +- .../rules/best_practises/max_line_length.rs | 0 .../rules/best_practises/max_states_count.rs | 2 +- .../src/rules/best_practises/mod.rs | 0 .../src/rules/best_practises/no_console.rs | 2 +- .../rules/best_practises/no_empty_block.rs | 2 +- .../rules/best_practises/no_global_import.rs | 2 +- .../best_practises/one_contract_per_file.rs | 4 +- .../rules/best_practises/payable_fallback.rs | 4 +- .../src/rules/best_practises/reason_string.rs | 4 +- .../crates/linter-lib}/src/rules/factory.rs | 0 .../src/rules/miscellaneous/mod.rs | 0 .../crates/linter-lib}/src/rules/mod.rs | 0 .../src/rules/naming/const_name_snakecase.rs | 2 +- .../rules/naming/contract_name_camelcase.rs | 4 +- .../src/rules/naming/event_name_camelcase.rs | 8 +- .../rules/naming/foundry_test_functions.rs | 14 +- .../src/rules/naming/func_name_mixedcase.rs | 6 +- .../rules/naming/func_param_name_mixedcase.rs | 6 +- .../linter-lib}/src/rules/naming/mod.rs | 0 .../rules/naming/modifier_name_mixedcase.rs | 2 +- .../rules/naming/named_parameters_mapping.rs | 4 +- .../naming/private_vars_leading_underscore.rs | 8 +- .../src/rules/naming/use_forbidden_name.rs | 2 +- .../src/rules/naming/var_name_mixedcase.rs | 6 +- .../src/rules/order/import_on_top.rs | 8 +- .../crates/linter-lib}/src/rules/order/mod.rs | 0 .../linter-lib}/src/rules/order/ordering.rs | 26 +- .../rules/order/visibility_modifier_order.rs | 4 +- .../crates/linter-lib}/src/rules/rule_impl.rs | 0 .../src/rules/security/avoid_tx_origin.rs | 4 +- .../src/rules/security/func_visibility.rs | 8 +- .../linter-lib}/src/rules/security/mod.rs | 0 .../src/rules/security/no_inline_assembly.rs | 2 +- .../src/rules/security/not_rely_on_time.rs | 2 +- .../src/rules/security/state_visibility.rs | 2 +- .../crates/linter-lib}/src/rules/types.rs | 0 .../crates/linter-lib}/src/rules/utils.rs | 2 +- .../crates/linter-lib}/src/types.rs | 0 .../testdata/AvoidTxOrigin/.solidhunter.json | 0 .../testdata/AvoidTxOrigin/file.sol | 0 .../testdata/AvoidTxOrigin/findings.csv | 0 .../ConstNameSnakeCase/.solidhunter.json | 0 .../testdata/ConstNameSnakeCase/file.sol | 0 .../testdata/ConstNameSnakeCase/findings.csv | 0 .../ContractNameCamelCase/.solidhunter.json | 0 .../testdata/ContractNameCamelCase/file.sol | 0 .../ContractNameCamelCase/findings.csv | 0 .../testdata/CustomErrors/.solidhunter.json | 0 .../testdata/CustomErrors/file.sol | 0 .../testdata/CustomErrors/findings.csv | 0 .../EventNameCamelCase/.solidhunter.json | 0 .../testdata/EventNameCamelCase/file.sol | 0 .../testdata/EventNameCamelCase/findings.csv | 0 .../testdata/ExplicitTypes/.solidhunter.json | 0 .../testdata/ExplicitTypes/file.sol | 0 .../testdata/ExplicitTypes/findings.csv | 0 .../FoundryTestFunctions/.solidhunter.json | 0 .../testdata/FoundryTestFunctions/file.t.sol | 0 .../FoundryTestFunctions/findings.csv | 0 .../FunctionMaxLines/.solidhunter.json | 0 .../testdata/FunctionMaxLines/file.sol | 0 .../testdata/FunctionMaxLines/findings.csv | 0 .../FunctionNameMixedCase/.solidhunter.json | 0 .../testdata/FunctionNameMixedCase/file.sol | 0 .../FunctionNameMixedCase/findings.csv | 0 .../.solidhunter.json | 0 .../FunctionParamNameMixedCase/file.sol | 0 .../FunctionParamNameMixedCase/findings.csv | 0 .../FunctionVisibility/.solidhunter.json | 0 .../testdata/FunctionVisibility/file.sol | 0 .../testdata/FunctionVisibility/findings.csv | 0 .../testdata/ImplicitTypes/.solidhunter.json | 0 .../testdata/ImplicitTypes/file.sol | 0 .../testdata/ImplicitTypes/findings.csv | 0 .../testdata/ImportOnTop/.solidhunter.json | 0 .../linter-lib}/testdata/ImportOnTop/file.sol | 0 .../testdata/ImportOnTop/findings.csv | 0 .../testdata/MaxLineLength/.solidhunter.json | 0 .../testdata/MaxLineLength/file.sol | 0 .../testdata/MaxLineLength/findings.csv | 0 .../testdata/MaxStatesCount/.solidhunter.json | 0 .../testdata/MaxStatesCount/file.sol | 0 .../testdata/MaxStatesCount/findings.csv | 0 .../ModifierNameMixedcase/.solidhunter.json | 0 .../testdata/ModifierNameMixedcase/file.sol | 0 .../ModifierNameMixedcase/findings.csv | 0 .../NamedParametersMapping/.solidhunter.json | 0 .../testdata/NamedParametersMapping/file.sol | 0 .../NamedParametersMapping/findings.csv | 0 .../testdata/NoConsole/.solidhunter.json | 0 .../linter-lib}/testdata/NoConsole/file.sol | 0 .../testdata/NoConsole/findings.csv | 0 .../testdata/NoEmptyBlock/.solidhunter.json | 0 .../testdata/NoEmptyBlock/file.sol | 0 .../testdata/NoEmptyBlock/findings.csv | 0 .../testdata/NoGlobalImport/.solidhunter.json | 0 .../testdata/NoGlobalImport/add.sol | 0 .../testdata/NoGlobalImport/file.sol | 0 .../testdata/NoGlobalImport/findings.csv | 0 .../NoInlineAssembly/.solidhunter.json | 0 .../testdata/NoInlineAssembly/file.sol | 0 .../testdata/NoInlineAssembly/findings.csv | 0 .../testdata/NotRelyOnTime/.solidhunter.json | 0 .../testdata/NotRelyOnTime/file.sol | 0 .../testdata/NotRelyOnTime/findings.csv | 0 .../OneContractPerFile/.solidhunter.json | 0 .../testdata/OneContractPerFile/file.sol | 0 .../testdata/OneContractPerFile/findings.csv | 0 .../testdata/Ordering/.solidhunter.json | 0 .../linter-lib}/testdata/Ordering/file.sol | 0 .../testdata/Ordering/findings.csv | 0 .../PayableFallback/.solidhunter.json | 0 .../testdata/PayableFallback/file.sol | 0 .../testdata/PayableFallback/findings.csv | 0 .../.solidhunter.json | 0 .../PrivateVarsLeadingUnderscore/file.sol | 0 .../PrivateVarsLeadingUnderscore/findings.csv | 0 .../testdata/ReasonString/.solidhunter.json | 0 .../testdata/ReasonString/file.sol | 0 .../testdata/ReasonString/findings.csv | 0 .../StateVisibility/.solidhunter.json | 0 .../testdata/StateVisibility/file.sol | 0 .../testdata/StateVisibility/findings.csv | 0 .../UseForbiddenName/.solidhunter.json | 0 .../testdata/UseForbiddenName/file.sol | 0 .../testdata/UseForbiddenName/findings.csv | 0 .../VarNameMixedCase/.solidhunter.json | 0 .../testdata/VarNameMixedCase/file.sol | 0 .../testdata/VarNameMixedCase/findings.csv | 0 .../VisibilityModifierOrder/.solidhunter.json | 0 .../testdata/VisibilityModifierOrder/file.sol | 0 .../VisibilityModifierOrder/findings.csv | 0 .../crates/linter-lib}/tests/linter.rs | 0 .../core/crates/linter-server/Cargo.toml | 14 + .../crates/linter-server/src/lib.rs} | 68 +- .../solidity/{linter => }/core/package.json | 6 +- .../{linter => }/extension/.eslintrc.json | 0 .../{linter => }/extension/.vscodeignore | 1 - .../solidity/{linter => }/extension/.yarnrc | 0 .../{linter => }/extension/CHANGELOG.md | 2 +- toolchains/solidity/extension/README.md | 71 + toolchains/solidity/extension/package.json | 57 + .../solidity/extension/src/extension.ts | 61 + toolchains/solidity/extension/src/server.ts | 56 + .../solidity/extension/src/test/runTest.ts | 23 + .../src/test/suite/extension.test.ts | 15 + .../extension/src/test/suite/index.ts | 38 + .../{linter => }/extension/tsconfig.json | 0 .../extension/vsc-extension-quickstart.md | 0 .../{linter => }/extension/webpack.config.js | 20 +- toolchains/solidity/linter/.unstable | 0 toolchains/solidity/linter/core/.gitignore | 14 - toolchains/solidity/linter/core/Cargo.toml | 24 - .../solidity/linter/extension/.gitignore | 4 - .../linter/extension/.vscode/extensions.json | 5 - .../linter/extension/.vscode/launch.json | 35 - .../linter/extension/.vscode/settings.json | 13 - .../linter/extension/.vscode/tasks.json | 40 - .../solidity/linter/extension/LICENSE.md | 675 ------- .../solidity/linter/extension/README.md | 3 - .../solidity/linter/extension/package.json | 94 - .../linter/extension/src/extension.ts | 59 - toolchains/solidity/linter/package.json | 17 - toolchains/solidity/lsp/.unstable | 0 toolchains/solidity/lsp/package.json | 15 - toolchains/solidity/package.json | 3 +- yarn.lock | 1048 ++-------- 198 files changed, 5079 insertions(+), 3528 deletions(-) mode change 100644 => 100755 .pnp.cjs create mode 100644 libs/lsp-handler/Cargo.lock create mode 100644 libs/lsp-handler/Cargo.toml create mode 100644 libs/lsp-handler/package.json create mode 100644 libs/lsp-handler/src/connection.rs create mode 100644 libs/lsp-handler/src/dispatcher.rs create mode 100644 libs/lsp-handler/src/handler.rs create mode 100644 libs/lsp-handler/src/helpers.rs create mode 100644 libs/lsp-handler/src/jsonrpc.rs create mode 100644 libs/lsp-handler/src/jsonrpc/error.rs create mode 100644 libs/lsp-handler/src/lib.rs rename toolchains/solidity/{linter => }/core/Cargo.lock (64%) create mode 100644 toolchains/solidity/core/Cargo.toml create mode 100644 toolchains/solidity/core/crates/extension/Cargo.toml create mode 100644 toolchains/solidity/core/crates/extension/Makefile create mode 100644 toolchains/solidity/core/crates/extension/src/lib.rs create mode 100644 toolchains/solidity/core/crates/linter-cli/Cargo.toml create mode 100644 toolchains/solidity/core/crates/linter-cli/Makefile rename toolchains/solidity/{linter/core => core/crates/linter-cli}/src/main.rs (90%) rename toolchains/solidity/{linter/core/solidhunter-lib => core/crates/linter-lib}/.gitignore (100%) rename toolchains/solidity/{linter/core/solidhunter-lib => core/crates/linter-lib}/Cargo.toml (54%) create mode 100644 toolchains/solidity/core/crates/linter-lib/Makefile rename toolchains/solidity/{linter/core/solidhunter-lib => core/crates/linter-lib}/src/errors.rs (87%) rename toolchains/solidity/{linter/core/solidhunter-lib => core/crates/linter-lib}/src/lib.rs (100%) rename toolchains/solidity/{linter/core/solidhunter-lib => core/crates/linter-lib}/src/linter.rs (91%) rename toolchains/solidity/{linter/core/solidhunter-lib => core/crates/linter-lib}/src/rules/best_practises/custom_errors.rs (98%) rename toolchains/solidity/{linter/core/solidhunter-lib => core/crates/linter-lib}/src/rules/best_practises/explicit_types.rs (99%) rename toolchains/solidity/{linter/core/solidhunter-lib => core/crates/linter-lib}/src/rules/best_practises/function_max_lines.rs (89%) rename toolchains/solidity/{linter/core/solidhunter-lib => core/crates/linter-lib}/src/rules/best_practises/max_line_length.rs (100%) rename toolchains/solidity/{linter/core/solidhunter-lib => core/crates/linter-lib}/src/rules/best_practises/max_states_count.rs (98%) rename toolchains/solidity/{linter/core/solidhunter-lib => core/crates/linter-lib}/src/rules/best_practises/mod.rs (100%) rename toolchains/solidity/{linter/core/solidhunter-lib => core/crates/linter-lib}/src/rules/best_practises/no_console.rs (98%) rename toolchains/solidity/{linter/core/solidhunter-lib => core/crates/linter-lib}/src/rules/best_practises/no_empty_block.rs (98%) rename toolchains/solidity/{linter/core/solidhunter-lib => core/crates/linter-lib}/src/rules/best_practises/no_global_import.rs (97%) rename toolchains/solidity/{linter/core/solidhunter-lib => core/crates/linter-lib}/src/rules/best_practises/one_contract_per_file.rs (91%) rename toolchains/solidity/{linter/core/solidhunter-lib => core/crates/linter-lib}/src/rules/best_practises/payable_fallback.rs (93%) rename toolchains/solidity/{linter/core/solidhunter-lib => core/crates/linter-lib}/src/rules/best_practises/reason_string.rs (97%) rename toolchains/solidity/{linter/core/solidhunter-lib => core/crates/linter-lib}/src/rules/factory.rs (100%) rename toolchains/solidity/{linter/core/solidhunter-lib => core/crates/linter-lib}/src/rules/miscellaneous/mod.rs (100%) rename toolchains/solidity/{linter/core/solidhunter-lib => core/crates/linter-lib}/src/rules/mod.rs (100%) rename toolchains/solidity/{linter/core/solidhunter-lib => core/crates/linter-lib}/src/rules/naming/const_name_snakecase.rs (96%) rename toolchains/solidity/{linter/core/solidhunter-lib => core/crates/linter-lib}/src/rules/naming/contract_name_camelcase.rs (92%) rename toolchains/solidity/{linter/core/solidhunter-lib => core/crates/linter-lib}/src/rules/naming/event_name_camelcase.rs (85%) rename toolchains/solidity/{linter/core/solidhunter-lib => core/crates/linter-lib}/src/rules/naming/foundry_test_functions.rs (82%) rename toolchains/solidity/{linter/core/solidhunter-lib => core/crates/linter-lib}/src/rules/naming/func_name_mixedcase.rs (89%) rename toolchains/solidity/{linter/core/solidhunter-lib => core/crates/linter-lib}/src/rules/naming/func_param_name_mixedcase.rs (89%) rename toolchains/solidity/{linter/core/solidhunter-lib => core/crates/linter-lib}/src/rules/naming/mod.rs (100%) rename toolchains/solidity/{linter/core/solidhunter-lib => core/crates/linter-lib}/src/rules/naming/modifier_name_mixedcase.rs (97%) rename toolchains/solidity/{linter/core/solidhunter-lib => core/crates/linter-lib}/src/rules/naming/named_parameters_mapping.rs (94%) rename toolchains/solidity/{linter/core/solidhunter-lib => core/crates/linter-lib}/src/rules/naming/private_vars_leading_underscore.rs (94%) rename toolchains/solidity/{linter/core/solidhunter-lib => core/crates/linter-lib}/src/rules/naming/use_forbidden_name.rs (98%) rename toolchains/solidity/{linter/core/solidhunter-lib => core/crates/linter-lib}/src/rules/naming/var_name_mixedcase.rs (89%) rename toolchains/solidity/{linter/core/solidhunter-lib => core/crates/linter-lib}/src/rules/order/import_on_top.rs (87%) rename toolchains/solidity/{linter/core/solidhunter-lib => core/crates/linter-lib}/src/rules/order/mod.rs (100%) rename toolchains/solidity/{linter/core/solidhunter-lib => core/crates/linter-lib}/src/rules/order/ordering.rs (93%) rename toolchains/solidity/{linter/core/solidhunter-lib => core/crates/linter-lib}/src/rules/order/visibility_modifier_order.rs (94%) rename toolchains/solidity/{linter/core/solidhunter-lib => core/crates/linter-lib}/src/rules/rule_impl.rs (100%) rename toolchains/solidity/{linter/core/solidhunter-lib => core/crates/linter-lib}/src/rules/security/avoid_tx_origin.rs (94%) rename toolchains/solidity/{linter/core/solidhunter-lib => core/crates/linter-lib}/src/rules/security/func_visibility.rs (88%) rename toolchains/solidity/{linter/core/solidhunter-lib => core/crates/linter-lib}/src/rules/security/mod.rs (100%) rename toolchains/solidity/{linter/core/solidhunter-lib => core/crates/linter-lib}/src/rules/security/no_inline_assembly.rs (97%) rename toolchains/solidity/{linter/core/solidhunter-lib => core/crates/linter-lib}/src/rules/security/not_rely_on_time.rs (98%) rename toolchains/solidity/{linter/core/solidhunter-lib => core/crates/linter-lib}/src/rules/security/state_visibility.rs (97%) rename toolchains/solidity/{linter/core/solidhunter-lib => core/crates/linter-lib}/src/rules/types.rs (100%) rename toolchains/solidity/{linter/core/solidhunter-lib => core/crates/linter-lib}/src/rules/utils.rs (89%) rename toolchains/solidity/{linter/core/solidhunter-lib => core/crates/linter-lib}/src/types.rs (100%) rename toolchains/solidity/{linter/core/solidhunter-lib => core/crates/linter-lib}/testdata/AvoidTxOrigin/.solidhunter.json (100%) rename toolchains/solidity/{linter/core/solidhunter-lib => core/crates/linter-lib}/testdata/AvoidTxOrigin/file.sol (100%) rename toolchains/solidity/{linter/core/solidhunter-lib => core/crates/linter-lib}/testdata/AvoidTxOrigin/findings.csv (100%) rename toolchains/solidity/{linter/core/solidhunter-lib => core/crates/linter-lib}/testdata/ConstNameSnakeCase/.solidhunter.json (100%) rename toolchains/solidity/{linter/core/solidhunter-lib => core/crates/linter-lib}/testdata/ConstNameSnakeCase/file.sol (100%) rename toolchains/solidity/{linter/core/solidhunter-lib => core/crates/linter-lib}/testdata/ConstNameSnakeCase/findings.csv (100%) rename toolchains/solidity/{linter/core/solidhunter-lib => core/crates/linter-lib}/testdata/ContractNameCamelCase/.solidhunter.json (100%) rename toolchains/solidity/{linter/core/solidhunter-lib => core/crates/linter-lib}/testdata/ContractNameCamelCase/file.sol (100%) rename toolchains/solidity/{linter/core/solidhunter-lib => core/crates/linter-lib}/testdata/ContractNameCamelCase/findings.csv (100%) rename toolchains/solidity/{linter/core/solidhunter-lib => core/crates/linter-lib}/testdata/CustomErrors/.solidhunter.json (100%) rename toolchains/solidity/{linter/core/solidhunter-lib => core/crates/linter-lib}/testdata/CustomErrors/file.sol (100%) rename toolchains/solidity/{linter/core/solidhunter-lib => core/crates/linter-lib}/testdata/CustomErrors/findings.csv (100%) rename toolchains/solidity/{linter/core/solidhunter-lib => core/crates/linter-lib}/testdata/EventNameCamelCase/.solidhunter.json (100%) rename toolchains/solidity/{linter/core/solidhunter-lib => core/crates/linter-lib}/testdata/EventNameCamelCase/file.sol (100%) rename toolchains/solidity/{linter/core/solidhunter-lib => core/crates/linter-lib}/testdata/EventNameCamelCase/findings.csv (100%) rename toolchains/solidity/{linter/core/solidhunter-lib => core/crates/linter-lib}/testdata/ExplicitTypes/.solidhunter.json (100%) rename toolchains/solidity/{linter/core/solidhunter-lib => core/crates/linter-lib}/testdata/ExplicitTypes/file.sol (100%) rename toolchains/solidity/{linter/core/solidhunter-lib => core/crates/linter-lib}/testdata/ExplicitTypes/findings.csv (100%) rename toolchains/solidity/{linter/core/solidhunter-lib => core/crates/linter-lib}/testdata/FoundryTestFunctions/.solidhunter.json (100%) rename toolchains/solidity/{linter/core/solidhunter-lib => core/crates/linter-lib}/testdata/FoundryTestFunctions/file.t.sol (100%) rename toolchains/solidity/{linter/core/solidhunter-lib => core/crates/linter-lib}/testdata/FoundryTestFunctions/findings.csv (100%) rename toolchains/solidity/{linter/core/solidhunter-lib => core/crates/linter-lib}/testdata/FunctionMaxLines/.solidhunter.json (100%) rename toolchains/solidity/{linter/core/solidhunter-lib => core/crates/linter-lib}/testdata/FunctionMaxLines/file.sol (100%) rename toolchains/solidity/{linter/core/solidhunter-lib => core/crates/linter-lib}/testdata/FunctionMaxLines/findings.csv (100%) rename toolchains/solidity/{linter/core/solidhunter-lib => core/crates/linter-lib}/testdata/FunctionNameMixedCase/.solidhunter.json (100%) rename toolchains/solidity/{linter/core/solidhunter-lib => core/crates/linter-lib}/testdata/FunctionNameMixedCase/file.sol (100%) rename toolchains/solidity/{linter/core/solidhunter-lib => core/crates/linter-lib}/testdata/FunctionNameMixedCase/findings.csv (100%) rename toolchains/solidity/{linter/core/solidhunter-lib => core/crates/linter-lib}/testdata/FunctionParamNameMixedCase/.solidhunter.json (100%) rename toolchains/solidity/{linter/core/solidhunter-lib => core/crates/linter-lib}/testdata/FunctionParamNameMixedCase/file.sol (100%) rename toolchains/solidity/{linter/core/solidhunter-lib => core/crates/linter-lib}/testdata/FunctionParamNameMixedCase/findings.csv (100%) rename toolchains/solidity/{linter/core/solidhunter-lib => core/crates/linter-lib}/testdata/FunctionVisibility/.solidhunter.json (100%) rename toolchains/solidity/{linter/core/solidhunter-lib => core/crates/linter-lib}/testdata/FunctionVisibility/file.sol (100%) rename toolchains/solidity/{linter/core/solidhunter-lib => core/crates/linter-lib}/testdata/FunctionVisibility/findings.csv (100%) rename toolchains/solidity/{linter/core/solidhunter-lib => core/crates/linter-lib}/testdata/ImplicitTypes/.solidhunter.json (100%) rename toolchains/solidity/{linter/core/solidhunter-lib => core/crates/linter-lib}/testdata/ImplicitTypes/file.sol (100%) rename toolchains/solidity/{linter/core/solidhunter-lib => core/crates/linter-lib}/testdata/ImplicitTypes/findings.csv (100%) rename toolchains/solidity/{linter/core/solidhunter-lib => core/crates/linter-lib}/testdata/ImportOnTop/.solidhunter.json (100%) rename toolchains/solidity/{linter/core/solidhunter-lib => core/crates/linter-lib}/testdata/ImportOnTop/file.sol (100%) rename toolchains/solidity/{linter/core/solidhunter-lib => core/crates/linter-lib}/testdata/ImportOnTop/findings.csv (100%) rename toolchains/solidity/{linter/core/solidhunter-lib => core/crates/linter-lib}/testdata/MaxLineLength/.solidhunter.json (100%) rename toolchains/solidity/{linter/core/solidhunter-lib => core/crates/linter-lib}/testdata/MaxLineLength/file.sol (100%) rename toolchains/solidity/{linter/core/solidhunter-lib => core/crates/linter-lib}/testdata/MaxLineLength/findings.csv (100%) rename toolchains/solidity/{linter/core/solidhunter-lib => core/crates/linter-lib}/testdata/MaxStatesCount/.solidhunter.json (100%) rename toolchains/solidity/{linter/core/solidhunter-lib => core/crates/linter-lib}/testdata/MaxStatesCount/file.sol (100%) rename toolchains/solidity/{linter/core/solidhunter-lib => core/crates/linter-lib}/testdata/MaxStatesCount/findings.csv (100%) rename toolchains/solidity/{linter/core/solidhunter-lib => core/crates/linter-lib}/testdata/ModifierNameMixedcase/.solidhunter.json (100%) rename toolchains/solidity/{linter/core/solidhunter-lib => core/crates/linter-lib}/testdata/ModifierNameMixedcase/file.sol (100%) rename toolchains/solidity/{linter/core/solidhunter-lib => core/crates/linter-lib}/testdata/ModifierNameMixedcase/findings.csv (100%) rename toolchains/solidity/{linter/core/solidhunter-lib => core/crates/linter-lib}/testdata/NamedParametersMapping/.solidhunter.json (100%) rename toolchains/solidity/{linter/core/solidhunter-lib => core/crates/linter-lib}/testdata/NamedParametersMapping/file.sol (100%) rename toolchains/solidity/{linter/core/solidhunter-lib => core/crates/linter-lib}/testdata/NamedParametersMapping/findings.csv (100%) rename toolchains/solidity/{linter/core/solidhunter-lib => core/crates/linter-lib}/testdata/NoConsole/.solidhunter.json (100%) rename toolchains/solidity/{linter/core/solidhunter-lib => core/crates/linter-lib}/testdata/NoConsole/file.sol (100%) rename toolchains/solidity/{linter/core/solidhunter-lib => core/crates/linter-lib}/testdata/NoConsole/findings.csv (100%) rename toolchains/solidity/{linter/core/solidhunter-lib => core/crates/linter-lib}/testdata/NoEmptyBlock/.solidhunter.json (100%) rename toolchains/solidity/{linter/core/solidhunter-lib => core/crates/linter-lib}/testdata/NoEmptyBlock/file.sol (100%) rename toolchains/solidity/{linter/core/solidhunter-lib => core/crates/linter-lib}/testdata/NoEmptyBlock/findings.csv (100%) rename toolchains/solidity/{linter/core/solidhunter-lib => core/crates/linter-lib}/testdata/NoGlobalImport/.solidhunter.json (100%) rename toolchains/solidity/{linter/core/solidhunter-lib => core/crates/linter-lib}/testdata/NoGlobalImport/add.sol (100%) rename toolchains/solidity/{linter/core/solidhunter-lib => core/crates/linter-lib}/testdata/NoGlobalImport/file.sol (100%) rename toolchains/solidity/{linter/core/solidhunter-lib => core/crates/linter-lib}/testdata/NoGlobalImport/findings.csv (100%) rename toolchains/solidity/{linter/core/solidhunter-lib => core/crates/linter-lib}/testdata/NoInlineAssembly/.solidhunter.json (100%) rename toolchains/solidity/{linter/core/solidhunter-lib => core/crates/linter-lib}/testdata/NoInlineAssembly/file.sol (100%) rename toolchains/solidity/{linter/core/solidhunter-lib => core/crates/linter-lib}/testdata/NoInlineAssembly/findings.csv (100%) rename toolchains/solidity/{linter/core/solidhunter-lib => core/crates/linter-lib}/testdata/NotRelyOnTime/.solidhunter.json (100%) rename toolchains/solidity/{linter/core/solidhunter-lib => core/crates/linter-lib}/testdata/NotRelyOnTime/file.sol (100%) rename toolchains/solidity/{linter/core/solidhunter-lib => core/crates/linter-lib}/testdata/NotRelyOnTime/findings.csv (100%) rename toolchains/solidity/{linter/core/solidhunter-lib => core/crates/linter-lib}/testdata/OneContractPerFile/.solidhunter.json (100%) rename toolchains/solidity/{linter/core/solidhunter-lib => core/crates/linter-lib}/testdata/OneContractPerFile/file.sol (100%) rename toolchains/solidity/{linter/core/solidhunter-lib => core/crates/linter-lib}/testdata/OneContractPerFile/findings.csv (100%) rename toolchains/solidity/{linter/core/solidhunter-lib => core/crates/linter-lib}/testdata/Ordering/.solidhunter.json (100%) rename toolchains/solidity/{linter/core/solidhunter-lib => core/crates/linter-lib}/testdata/Ordering/file.sol (100%) rename toolchains/solidity/{linter/core/solidhunter-lib => core/crates/linter-lib}/testdata/Ordering/findings.csv (100%) rename toolchains/solidity/{linter/core/solidhunter-lib => core/crates/linter-lib}/testdata/PayableFallback/.solidhunter.json (100%) rename toolchains/solidity/{linter/core/solidhunter-lib => core/crates/linter-lib}/testdata/PayableFallback/file.sol (100%) rename toolchains/solidity/{linter/core/solidhunter-lib => core/crates/linter-lib}/testdata/PayableFallback/findings.csv (100%) rename toolchains/solidity/{linter/core/solidhunter-lib => core/crates/linter-lib}/testdata/PrivateVarsLeadingUnderscore/.solidhunter.json (100%) rename toolchains/solidity/{linter/core/solidhunter-lib => core/crates/linter-lib}/testdata/PrivateVarsLeadingUnderscore/file.sol (100%) rename toolchains/solidity/{linter/core/solidhunter-lib => core/crates/linter-lib}/testdata/PrivateVarsLeadingUnderscore/findings.csv (100%) rename toolchains/solidity/{linter/core/solidhunter-lib => core/crates/linter-lib}/testdata/ReasonString/.solidhunter.json (100%) rename toolchains/solidity/{linter/core/solidhunter-lib => core/crates/linter-lib}/testdata/ReasonString/file.sol (100%) rename toolchains/solidity/{linter/core/solidhunter-lib => core/crates/linter-lib}/testdata/ReasonString/findings.csv (100%) rename toolchains/solidity/{linter/core/solidhunter-lib => core/crates/linter-lib}/testdata/StateVisibility/.solidhunter.json (100%) rename toolchains/solidity/{linter/core/solidhunter-lib => core/crates/linter-lib}/testdata/StateVisibility/file.sol (100%) rename toolchains/solidity/{linter/core/solidhunter-lib => core/crates/linter-lib}/testdata/StateVisibility/findings.csv (100%) rename toolchains/solidity/{linter/core/solidhunter-lib => core/crates/linter-lib}/testdata/UseForbiddenName/.solidhunter.json (100%) rename toolchains/solidity/{linter/core/solidhunter-lib => core/crates/linter-lib}/testdata/UseForbiddenName/file.sol (100%) rename toolchains/solidity/{linter/core/solidhunter-lib => core/crates/linter-lib}/testdata/UseForbiddenName/findings.csv (100%) rename toolchains/solidity/{linter/core/solidhunter-lib => core/crates/linter-lib}/testdata/VarNameMixedCase/.solidhunter.json (100%) rename toolchains/solidity/{linter/core/solidhunter-lib => core/crates/linter-lib}/testdata/VarNameMixedCase/file.sol (100%) rename toolchains/solidity/{linter/core/solidhunter-lib => core/crates/linter-lib}/testdata/VarNameMixedCase/findings.csv (100%) rename toolchains/solidity/{linter/core/solidhunter-lib => core/crates/linter-lib}/testdata/VisibilityModifierOrder/.solidhunter.json (100%) rename toolchains/solidity/{linter/core/solidhunter-lib => core/crates/linter-lib}/testdata/VisibilityModifierOrder/file.sol (100%) rename toolchains/solidity/{linter/core/solidhunter-lib => core/crates/linter-lib}/testdata/VisibilityModifierOrder/findings.csv (100%) rename toolchains/solidity/{linter/core/solidhunter-lib => core/crates/linter-lib}/tests/linter.rs (100%) create mode 100644 toolchains/solidity/core/crates/linter-server/Cargo.toml rename toolchains/solidity/{linter/core/src/server.rs => core/crates/linter-server/src/lib.rs} (72%) rename toolchains/solidity/{linter => }/core/package.json (53%) rename toolchains/solidity/{linter => }/extension/.eslintrc.json (100%) rename toolchains/solidity/{linter => }/extension/.vscodeignore (93%) rename toolchains/solidity/{linter => }/extension/.yarnrc (100%) rename toolchains/solidity/{linter => }/extension/CHANGELOG.md (64%) create mode 100644 toolchains/solidity/extension/README.md create mode 100644 toolchains/solidity/extension/package.json create mode 100644 toolchains/solidity/extension/src/extension.ts create mode 100644 toolchains/solidity/extension/src/server.ts create mode 100644 toolchains/solidity/extension/src/test/runTest.ts create mode 100644 toolchains/solidity/extension/src/test/suite/extension.test.ts create mode 100644 toolchains/solidity/extension/src/test/suite/index.ts rename toolchains/solidity/{linter => }/extension/tsconfig.json (100%) rename toolchains/solidity/{linter => }/extension/vsc-extension-quickstart.md (100%) rename toolchains/solidity/{linter => }/extension/webpack.config.js (78%) delete mode 100644 toolchains/solidity/linter/.unstable delete mode 100644 toolchains/solidity/linter/core/.gitignore delete mode 100644 toolchains/solidity/linter/core/Cargo.toml delete mode 100644 toolchains/solidity/linter/extension/.gitignore delete mode 100644 toolchains/solidity/linter/extension/.vscode/extensions.json delete mode 100644 toolchains/solidity/linter/extension/.vscode/launch.json delete mode 100644 toolchains/solidity/linter/extension/.vscode/settings.json delete mode 100644 toolchains/solidity/linter/extension/.vscode/tasks.json delete mode 100644 toolchains/solidity/linter/extension/LICENSE.md delete mode 100644 toolchains/solidity/linter/extension/README.md delete mode 100644 toolchains/solidity/linter/extension/package.json delete mode 100644 toolchains/solidity/linter/extension/src/extension.ts delete mode 100644 toolchains/solidity/linter/package.json delete mode 100644 toolchains/solidity/lsp/.unstable delete mode 100644 toolchains/solidity/lsp/package.json diff --git a/.pnp.cjs b/.pnp.cjs old mode 100644 new mode 100755 index 7b737fb6..84aa724e --- a/.pnp.cjs +++ b/.pnp.cjs @@ -19,6 +19,10 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { "name": "@osmium-libs/ast-extractor",\ "reference": "workspace:libs/ast-extractor"\ },\ + {\ + "name": "@osmium-libs/lsp-handler",\ + "reference": "workspace:libs/lsp-handler"\ + },\ {\ "name": "@osmium-libs/lsp-launcher",\ "reference": "workspace:libs/lsp-launcher"\ @@ -44,26 +48,19 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { "reference": "workspace:toolchains/solidity"\ },\ {\ - "name": "osmium-solidity-linter",\ - "reference": "workspace:toolchains/solidity/linter"\ - },\ - {\ - "name": "osmium-solidity-linter-core",\ - "reference": "workspace:toolchains/solidity/linter/core"\ + "name": "osmium-solidity-core",\ + "reference": "workspace:toolchains/solidity/core"\ },\ {\ - "name": "osmium-solidity-linter-extension",\ - "reference": "workspace:toolchains/solidity/linter/extension"\ - },\ - {\ - "name": "osmium-solidity-lsp",\ - "reference": "workspace:toolchains/solidity/lsp"\ + "name": "osmium-solidity-extension",\ + "reference": "workspace:toolchains/solidity/extension"\ }\ ],\ "enableTopLevelFallback": true,\ "ignorePatternData": "(^(?:\\\\.yarn\\\\/sdks(?:\\\\/(?!\\\\.{1,2}(?:\\\\/|$))(?:(?:(?!(?:^|\\\\/)\\\\.{1,2}(?:\\\\/|$)).)*?)|$))$)",\ "fallbackExclusionList": [\ ["@osmium-libs/ast-extractor", ["workspace:libs/ast-extractor"]],\ + ["@osmium-libs/lsp-handler", ["workspace:libs/lsp-handler"]],\ ["@osmium-libs/lsp-launcher", ["workspace:libs/lsp-launcher"]],\ ["@osmium-libs/lsp-server-wrapper", ["workspace:libs/lsp-server-wrapper"]],\ ["@osmium-packages/eslint-config", ["workspace:packages/eslint-config"]],\ @@ -71,10 +68,8 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { ["osmium", ["workspace:."]],\ ["osmium-manager", ["workspace:manager"]],\ ["osmium-solidity", ["workspace:toolchains/solidity"]],\ - ["osmium-solidity-linter", ["workspace:toolchains/solidity/linter"]],\ - ["osmium-solidity-linter-core", ["workspace:toolchains/solidity/linter/core"]],\ - ["osmium-solidity-linter-extension", ["workspace:toolchains/solidity/linter/extension"]],\ - ["osmium-solidity-lsp", ["workspace:toolchains/solidity/lsp"]]\ + ["osmium-solidity-core", ["workspace:toolchains/solidity/core"]],\ + ["osmium-solidity-extension", ["workspace:toolchains/solidity/extension"]]\ ],\ "fallbackPool": [\ ],\ @@ -114,12 +109,12 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { ],\ "linkType": "SOFT"\ }],\ - ["virtual:1b802e43a1d6cfd4888588e031e9b9539c10922666207f02b37e1572beffa71b5952c5b88bdcc1e2ff0080ea3baa9b39a63225d9ea667488d5ab782bed5718c7#npm:4.4.0", {\ - "packageLocation": "./.yarn/__virtual__/@eslint-community-eslint-utils-virtual-3145c9a18a/0/cache/@eslint-community-eslint-utils-npm-4.4.0-d1791bd5a3-cdfe3ae42b.zip/node_modules/@eslint-community/eslint-utils/",\ + ["virtual:77fce3ec74d55c7e6791631c329cf3adde374e21e618e865127f72e63efeb3376dcf7fc8217de80f5a310e81c791a72e9d099b00fd3252d5653ff68dff50c2fa#npm:4.4.0", {\ + "packageLocation": "./.yarn/__virtual__/@eslint-community-eslint-utils-virtual-3663415ec2/0/cache/@eslint-community-eslint-utils-npm-4.4.0-d1791bd5a3-cdfe3ae42b.zip/node_modules/@eslint-community/eslint-utils/",\ "packageDependencies": [\ - ["@eslint-community/eslint-utils", "virtual:1b802e43a1d6cfd4888588e031e9b9539c10922666207f02b37e1572beffa71b5952c5b88bdcc1e2ff0080ea3baa9b39a63225d9ea667488d5ab782bed5718c7#npm:4.4.0"],\ + ["@eslint-community/eslint-utils", "virtual:77fce3ec74d55c7e6791631c329cf3adde374e21e618e865127f72e63efeb3376dcf7fc8217de80f5a310e81c791a72e9d099b00fd3252d5653ff68dff50c2fa#npm:4.4.0"],\ ["@types/eslint", null],\ - ["eslint", "npm:8.49.0"],\ + ["eslint", "npm:8.51.0"],\ ["eslint-visitor-keys", "npm:3.4.2"]\ ],\ "packagePeers": [\ @@ -151,10 +146,10 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { ],\ "linkType": "HARD"\ }],\ - ["npm:4.8.0", {\ - "packageLocation": "./.yarn/cache/@eslint-community-regexpp-npm-4.8.0-92ece47e3d-601e6d033d.zip/node_modules/@eslint-community/regexpp/",\ + ["npm:4.9.1", {\ + "packageLocation": "./.yarn/cache/@eslint-community-regexpp-npm-4.9.1-7805f77eb5-06fb839e9c.zip/node_modules/@eslint-community/regexpp/",\ "packageDependencies": [\ - ["@eslint-community/regexpp", "npm:4.8.0"]\ + ["@eslint-community/regexpp", "npm:4.9.1"]\ ],\ "linkType": "HARD"\ }]\ @@ -201,10 +196,10 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { ],\ "linkType": "HARD"\ }],\ - ["npm:8.49.0", {\ - "packageLocation": "./.yarn/cache/@eslint-js-npm-8.49.0-e8f6510b47-a6601807c8.zip/node_modules/@eslint/js/",\ + ["npm:8.51.0", {\ + "packageLocation": "./.yarn/cache/@eslint-js-npm-8.51.0-51f088b88b-0228bf1e1e.zip/node_modules/@eslint/js/",\ "packageDependencies": [\ - ["@eslint/js", "npm:8.49.0"]\ + ["@eslint/js", "npm:8.51.0"]\ ],\ "linkType": "HARD"\ }]\ @@ -280,7 +275,7 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { ["@jridgewell/gen-mapping", "npm:0.3.3"],\ ["@jridgewell/set-array", "npm:1.1.2"],\ ["@jridgewell/sourcemap-codec", "npm:1.4.15"],\ - ["@jridgewell/trace-mapping", "npm:0.3.19"]\ + ["@jridgewell/trace-mapping", "npm:0.3.20"]\ ],\ "linkType": "HARD"\ }]\ @@ -309,7 +304,7 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { "packageDependencies": [\ ["@jridgewell/source-map", "npm:0.3.5"],\ ["@jridgewell/gen-mapping", "npm:0.3.3"],\ - ["@jridgewell/trace-mapping", "npm:0.3.19"]\ + ["@jridgewell/trace-mapping", "npm:0.3.20"]\ ],\ "linkType": "HARD"\ }]\ @@ -324,10 +319,10 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { }]\ ]],\ ["@jridgewell/trace-mapping", [\ - ["npm:0.3.19", {\ - "packageLocation": "./.yarn/cache/@jridgewell-trace-mapping-npm-0.3.19-9aa1a7e2fd-956a6f0f6f.zip/node_modules/@jridgewell/trace-mapping/",\ + ["npm:0.3.20", {\ + "packageLocation": "./.yarn/cache/@jridgewell-trace-mapping-npm-0.3.20-d90f282910-cd1a735313.zip/node_modules/@jridgewell/trace-mapping/",\ "packageDependencies": [\ - ["@jridgewell/trace-mapping", "npm:0.3.19"],\ + ["@jridgewell/trace-mapping", "npm:0.3.20"],\ ["@jridgewell/resolve-uri", "npm:3.1.1"],\ ["@jridgewell/sourcemap-codec", "npm:1.4.15"]\ ],\ @@ -384,6 +379,15 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { "linkType": "SOFT"\ }]\ ]],\ + ["@osmium-libs/lsp-handler", [\ + ["workspace:libs/lsp-handler", {\ + "packageLocation": "./libs/lsp-handler/",\ + "packageDependencies": [\ + ["@osmium-libs/lsp-handler", "workspace:libs/lsp-handler"]\ + ],\ + "linkType": "SOFT"\ + }]\ + ]],\ ["@osmium-libs/lsp-launcher", [\ ["workspace:libs/lsp-launcher", {\ "packageLocation": "./libs/lsp-launcher/",\ @@ -448,32 +452,32 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { }]\ ]],\ ["@types/eslint", [\ - ["npm:8.44.2", {\ - "packageLocation": "./.yarn/cache/@types-eslint-npm-8.44.2-6e9a6149b6-25b3ef61ba.zip/node_modules/@types/eslint/",\ + ["npm:8.44.6", {\ + "packageLocation": "./.yarn/cache/@types-eslint-npm-8.44.6-5d79f5da7d-ed8de582ab.zip/node_modules/@types/eslint/",\ "packageDependencies": [\ - ["@types/eslint", "npm:8.44.2"],\ - ["@types/estree", "npm:1.0.1"],\ - ["@types/json-schema", "npm:7.0.12"]\ + ["@types/eslint", "npm:8.44.6"],\ + ["@types/estree", "npm:1.0.3"],\ + ["@types/json-schema", "npm:7.0.14"]\ ],\ "linkType": "HARD"\ }]\ ]],\ ["@types/eslint-scope", [\ - ["npm:3.7.4", {\ - "packageLocation": "./.yarn/cache/@types-eslint-scope-npm-3.7.4-c11d226d71-ea6a9363e9.zip/node_modules/@types/eslint-scope/",\ + ["npm:3.7.6", {\ + "packageLocation": "./.yarn/cache/@types-eslint-scope-npm-3.7.6-21feb9c235-a2339e3129.zip/node_modules/@types/eslint-scope/",\ "packageDependencies": [\ - ["@types/eslint-scope", "npm:3.7.4"],\ - ["@types/eslint", "npm:8.44.2"],\ - ["@types/estree", "npm:1.0.1"]\ + ["@types/eslint-scope", "npm:3.7.6"],\ + ["@types/eslint", "npm:8.44.6"],\ + ["@types/estree", "npm:1.0.3"]\ ],\ "linkType": "HARD"\ }]\ ]],\ ["@types/estree", [\ - ["npm:1.0.1", {\ - "packageLocation": "./.yarn/cache/@types-estree-npm-1.0.1-4c9469c165-e9aa175eac.zip/node_modules/@types/estree/",\ + ["npm:1.0.3", {\ + "packageLocation": "./.yarn/cache/@types-estree-npm-1.0.3-716b9810bd-f21a544899.zip/node_modules/@types/estree/",\ "packageDependencies": [\ - ["@types/estree", "npm:1.0.1"]\ + ["@types/estree", "npm:1.0.3"]\ ],\ "linkType": "HARD"\ }]\ @@ -484,16 +488,16 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { "packageDependencies": [\ ["@types/glob", "npm:8.1.0"],\ ["@types/minimatch", "npm:5.1.2"],\ - ["@types/node", "npm:20.6.0"]\ + ["@types/node", "npm:20.8.7"]\ ],\ "linkType": "HARD"\ }]\ ]],\ ["@types/json-schema", [\ - ["npm:7.0.12", {\ - "packageLocation": "./.yarn/cache/@types-json-schema-npm-7.0.12-f05cfc0e99-00239e9723.zip/node_modules/@types/json-schema/",\ + ["npm:7.0.14", {\ + "packageLocation": "./.yarn/cache/@types-json-schema-npm-7.0.14-7dad9e71b4-4b3dd99616.zip/node_modules/@types/json-schema/",\ "packageDependencies": [\ - ["@types/json-schema", "npm:7.0.12"]\ + ["@types/json-schema", "npm:7.0.14"]\ ],\ "linkType": "HARD"\ }]\ @@ -508,10 +512,10 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { }]\ ]],\ ["@types/mocha", [\ - ["npm:10.0.1", {\ - "packageLocation": "./.yarn/cache/@types-mocha-npm-10.0.1-7c94e9e170-224ea9fce7.zip/node_modules/@types/mocha/",\ + ["npm:10.0.3", {\ + "packageLocation": "./.yarn/cache/@types-mocha-npm-10.0.3-a45fafc70f-52481d72c0.zip/node_modules/@types/mocha/",\ "packageDependencies": [\ - ["@types/mocha", "npm:10.0.1"]\ + ["@types/mocha", "npm:10.0.3"]\ ],\ "linkType": "HARD"\ }]\ @@ -524,28 +528,29 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { ],\ "linkType": "HARD"\ }],\ - ["npm:20.6.0", {\ - "packageLocation": "./.yarn/cache/@types-node-npm-20.6.0-73d5022935-52611801af.zip/node_modules/@types/node/",\ + ["npm:20.8.7", {\ + "packageLocation": "./.yarn/cache/@types-node-npm-20.8.7-a09c56cd33-2173c0c03d.zip/node_modules/@types/node/",\ "packageDependencies": [\ - ["@types/node", "npm:20.6.0"]\ + ["@types/node", "npm:20.8.7"],\ + ["undici-types", "npm:5.25.3"]\ ],\ "linkType": "HARD"\ }]\ ]],\ ["@types/semver", [\ - ["npm:7.5.1", {\ - "packageLocation": "./.yarn/cache/@types-semver-npm-7.5.1-cda240741c-2fffe938c7.zip/node_modules/@types/semver/",\ + ["npm:7.5.4", {\ + "packageLocation": "./.yarn/cache/@types-semver-npm-7.5.4-aa93e70844-120c0189f6.zip/node_modules/@types/semver/",\ "packageDependencies": [\ - ["@types/semver", "npm:7.5.1"]\ + ["@types/semver", "npm:7.5.4"]\ ],\ "linkType": "HARD"\ }]\ ]],\ ["@types/vscode", [\ - ["npm:1.82.0", {\ - "packageLocation": "./.yarn/cache/@types-vscode-npm-1.82.0-73aff2758d-2c546b61a0.zip/node_modules/@types/vscode/",\ + ["npm:1.83.1", {\ + "packageLocation": "./.yarn/cache/@types-vscode-npm-1.83.1-1e622f7668-b421594b61.zip/node_modules/@types/vscode/",\ "packageDependencies": [\ - ["@types/vscode", "npm:1.82.0"]\ + ["@types/vscode", "npm:1.83.1"]\ ],\ "linkType": "HARD"\ }]\ @@ -558,25 +563,25 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { ],\ "linkType": "SOFT"\ }],\ - ["virtual:52255392bc7c855b3a7ca4b9b99f4d75a3b9d689264acbbe839776f76900c0302139aac1239332d2de96876e944fbdfcccf8eb06eedae6162f8c837cb3407ca8#npm:5.62.0", {\ - "packageLocation": "./.yarn/__virtual__/@typescript-eslint-eslint-plugin-virtual-886143a71d/0/cache/@typescript-eslint-eslint-plugin-npm-5.62.0-c48b9a5492-fc104b389c.zip/node_modules/@typescript-eslint/eslint-plugin/",\ + ["virtual:2b9e7e7d573ed38308251d9cfa9bcac1c01394d20ff25d4a07b4a0345be370b65803551137c4363442bf76c7d6f9363387c180207a65457c6616ca7fd9b2a56b#npm:5.62.0", {\ + "packageLocation": "./.yarn/__virtual__/@typescript-eslint-eslint-plugin-virtual-89014fb2f7/0/cache/@typescript-eslint-eslint-plugin-npm-5.62.0-c48b9a5492-fc104b389c.zip/node_modules/@typescript-eslint/eslint-plugin/",\ "packageDependencies": [\ - ["@typescript-eslint/eslint-plugin", "virtual:52255392bc7c855b3a7ca4b9b99f4d75a3b9d689264acbbe839776f76900c0302139aac1239332d2de96876e944fbdfcccf8eb06eedae6162f8c837cb3407ca8#npm:5.62.0"],\ - ["@eslint-community/regexpp", "npm:4.8.0"],\ + ["@typescript-eslint/eslint-plugin", "virtual:2b9e7e7d573ed38308251d9cfa9bcac1c01394d20ff25d4a07b4a0345be370b65803551137c4363442bf76c7d6f9363387c180207a65457c6616ca7fd9b2a56b#npm:5.62.0"],\ + ["@eslint-community/regexpp", "npm:4.9.1"],\ ["@types/eslint", null],\ ["@types/typescript", null],\ ["@types/typescript-eslint__parser", null],\ - ["@typescript-eslint/parser", "virtual:52255392bc7c855b3a7ca4b9b99f4d75a3b9d689264acbbe839776f76900c0302139aac1239332d2de96876e944fbdfcccf8eb06eedae6162f8c837cb3407ca8#npm:5.62.0"],\ + ["@typescript-eslint/parser", "virtual:2b9e7e7d573ed38308251d9cfa9bcac1c01394d20ff25d4a07b4a0345be370b65803551137c4363442bf76c7d6f9363387c180207a65457c6616ca7fd9b2a56b#npm:5.62.0"],\ ["@typescript-eslint/scope-manager", "npm:5.62.0"],\ - ["@typescript-eslint/type-utils", "virtual:886143a71dbd16c7dff857b41f76376562a0e00b73297c242842020b27304f674219cf3e7b9cfd86b31a507d7d2502a83c34027c7ed5757aa6c9457392679a04#npm:5.62.0"],\ - ["@typescript-eslint/utils", "virtual:886143a71dbd16c7dff857b41f76376562a0e00b73297c242842020b27304f674219cf3e7b9cfd86b31a507d7d2502a83c34027c7ed5757aa6c9457392679a04#npm:5.62.0"],\ + ["@typescript-eslint/type-utils", "virtual:89014fb2f72da20eb87d54c80bac37610b57a73485dee5ebf9333bf5c4bce0d972953cbf0f48420b275d3bc40f36aded8d47d2d24281f85e903e5d354ec64e4e#npm:5.62.0"],\ + ["@typescript-eslint/utils", "virtual:89014fb2f72da20eb87d54c80bac37610b57a73485dee5ebf9333bf5c4bce0d972953cbf0f48420b275d3bc40f36aded8d47d2d24281f85e903e5d354ec64e4e#npm:5.62.0"],\ ["debug", "virtual:ced87d94ab05a28b44536eb0cd61a9458e757a0ae7bb35e5ab5d27e03d08b996abd275928b29aad2eb0973d5bb0800e75ba8ca3e26bf62cbe8ea0fae8cca70a8#npm:4.3.4"],\ - ["eslint", "npm:8.49.0"],\ + ["eslint", "npm:8.51.0"],\ ["graphemer", "npm:1.4.0"],\ ["ignore", "npm:5.2.4"],\ ["natural-compare-lite", "npm:1.4.0"],\ ["semver", "npm:7.5.4"],\ - ["tsutils", "virtual:886143a71dbd16c7dff857b41f76376562a0e00b73297c242842020b27304f674219cf3e7b9cfd86b31a507d7d2502a83c34027c7ed5757aa6c9457392679a04#npm:3.21.0"],\ + ["tsutils", "virtual:89014fb2f72da20eb87d54c80bac37610b57a73485dee5ebf9333bf5c4bce0d972953cbf0f48420b275d3bc40f36aded8d47d2d24281f85e903e5d354ec64e4e#npm:3.21.0"],\ ["typescript", "patch:typescript@npm%3A5.2.2#~builtin::version=5.2.2&hash=f3b441"]\ ],\ "packagePeers": [\ @@ -598,17 +603,17 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { ],\ "linkType": "SOFT"\ }],\ - ["virtual:52255392bc7c855b3a7ca4b9b99f4d75a3b9d689264acbbe839776f76900c0302139aac1239332d2de96876e944fbdfcccf8eb06eedae6162f8c837cb3407ca8#npm:5.62.0", {\ - "packageLocation": "./.yarn/__virtual__/@typescript-eslint-parser-virtual-718019f438/0/cache/@typescript-eslint-parser-npm-5.62.0-c6b29fa302-d168f4c7f2.zip/node_modules/@typescript-eslint/parser/",\ + ["virtual:2b9e7e7d573ed38308251d9cfa9bcac1c01394d20ff25d4a07b4a0345be370b65803551137c4363442bf76c7d6f9363387c180207a65457c6616ca7fd9b2a56b#npm:5.62.0", {\ + "packageLocation": "./.yarn/__virtual__/@typescript-eslint-parser-virtual-919dcabc11/0/cache/@typescript-eslint-parser-npm-5.62.0-c6b29fa302-d168f4c7f2.zip/node_modules/@typescript-eslint/parser/",\ "packageDependencies": [\ - ["@typescript-eslint/parser", "virtual:52255392bc7c855b3a7ca4b9b99f4d75a3b9d689264acbbe839776f76900c0302139aac1239332d2de96876e944fbdfcccf8eb06eedae6162f8c837cb3407ca8#npm:5.62.0"],\ + ["@typescript-eslint/parser", "virtual:2b9e7e7d573ed38308251d9cfa9bcac1c01394d20ff25d4a07b4a0345be370b65803551137c4363442bf76c7d6f9363387c180207a65457c6616ca7fd9b2a56b#npm:5.62.0"],\ ["@types/eslint", null],\ ["@types/typescript", null],\ ["@typescript-eslint/scope-manager", "npm:5.62.0"],\ ["@typescript-eslint/types", "npm:5.62.0"],\ - ["@typescript-eslint/typescript-estree", "virtual:e501561d03359d3ad14358bb798a1c3e9b934095fed9debec78c49fa03a035928f77c41a677c9a4e2b1c3dc5b324d140accd38b981f2cb2a9e17165fbc0e0d02#npm:5.62.0"],\ + ["@typescript-eslint/typescript-estree", "virtual:7f3bc25884a68a29ac4d296cb19161080b5427dc732e6412b6c8cd95f25543caace2cc48bfd515b6ed39d97808f3fde9257ccd25f2112571b23f01c85c15a049#npm:5.62.0"],\ ["debug", "virtual:ced87d94ab05a28b44536eb0cd61a9458e757a0ae7bb35e5ab5d27e03d08b996abd275928b29aad2eb0973d5bb0800e75ba8ca3e26bf62cbe8ea0fae8cca70a8#npm:4.3.4"],\ - ["eslint", "npm:8.49.0"],\ + ["eslint", "npm:8.51.0"],\ ["typescript", "patch:typescript@npm%3A5.2.2#~builtin::version=5.2.2&hash=f3b441"]\ ],\ "packagePeers": [\ @@ -639,17 +644,17 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { ],\ "linkType": "SOFT"\ }],\ - ["virtual:886143a71dbd16c7dff857b41f76376562a0e00b73297c242842020b27304f674219cf3e7b9cfd86b31a507d7d2502a83c34027c7ed5757aa6c9457392679a04#npm:5.62.0", {\ - "packageLocation": "./.yarn/__virtual__/@typescript-eslint-type-utils-virtual-e501561d03/0/cache/@typescript-eslint-type-utils-npm-5.62.0-220216d668-fc41eece5f.zip/node_modules/@typescript-eslint/type-utils/",\ + ["virtual:89014fb2f72da20eb87d54c80bac37610b57a73485dee5ebf9333bf5c4bce0d972953cbf0f48420b275d3bc40f36aded8d47d2d24281f85e903e5d354ec64e4e#npm:5.62.0", {\ + "packageLocation": "./.yarn/__virtual__/@typescript-eslint-type-utils-virtual-7f3bc25884/0/cache/@typescript-eslint-type-utils-npm-5.62.0-220216d668-fc41eece5f.zip/node_modules/@typescript-eslint/type-utils/",\ "packageDependencies": [\ - ["@typescript-eslint/type-utils", "virtual:886143a71dbd16c7dff857b41f76376562a0e00b73297c242842020b27304f674219cf3e7b9cfd86b31a507d7d2502a83c34027c7ed5757aa6c9457392679a04#npm:5.62.0"],\ + ["@typescript-eslint/type-utils", "virtual:89014fb2f72da20eb87d54c80bac37610b57a73485dee5ebf9333bf5c4bce0d972953cbf0f48420b275d3bc40f36aded8d47d2d24281f85e903e5d354ec64e4e#npm:5.62.0"],\ ["@types/eslint", null],\ ["@types/typescript", null],\ - ["@typescript-eslint/typescript-estree", "virtual:e501561d03359d3ad14358bb798a1c3e9b934095fed9debec78c49fa03a035928f77c41a677c9a4e2b1c3dc5b324d140accd38b981f2cb2a9e17165fbc0e0d02#npm:5.62.0"],\ - ["@typescript-eslint/utils", "virtual:886143a71dbd16c7dff857b41f76376562a0e00b73297c242842020b27304f674219cf3e7b9cfd86b31a507d7d2502a83c34027c7ed5757aa6c9457392679a04#npm:5.62.0"],\ + ["@typescript-eslint/typescript-estree", "virtual:7f3bc25884a68a29ac4d296cb19161080b5427dc732e6412b6c8cd95f25543caace2cc48bfd515b6ed39d97808f3fde9257ccd25f2112571b23f01c85c15a049#npm:5.62.0"],\ + ["@typescript-eslint/utils", "virtual:89014fb2f72da20eb87d54c80bac37610b57a73485dee5ebf9333bf5c4bce0d972953cbf0f48420b275d3bc40f36aded8d47d2d24281f85e903e5d354ec64e4e#npm:5.62.0"],\ ["debug", "virtual:ced87d94ab05a28b44536eb0cd61a9458e757a0ae7bb35e5ab5d27e03d08b996abd275928b29aad2eb0973d5bb0800e75ba8ca3e26bf62cbe8ea0fae8cca70a8#npm:4.3.4"],\ - ["eslint", "npm:8.49.0"],\ - ["tsutils", "virtual:886143a71dbd16c7dff857b41f76376562a0e00b73297c242842020b27304f674219cf3e7b9cfd86b31a507d7d2502a83c34027c7ed5757aa6c9457392679a04#npm:3.21.0"],\ + ["eslint", "npm:8.51.0"],\ + ["tsutils", "virtual:89014fb2f72da20eb87d54c80bac37610b57a73485dee5ebf9333bf5c4bce0d972953cbf0f48420b275d3bc40f36aded8d47d2d24281f85e903e5d354ec64e4e#npm:3.21.0"],\ ["typescript", "patch:typescript@npm%3A5.2.2#~builtin::version=5.2.2&hash=f3b441"]\ ],\ "packagePeers": [\ @@ -678,10 +683,10 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { ],\ "linkType": "SOFT"\ }],\ - ["virtual:c5c581d9613c51eb3e937c55675dd6f39afb2a6747015ab1a2b5d7daaf0ad1388342b1c235a19f98c480d414c467cb6800bb05ed69c5c50c3af4b64d41b5a2ef#npm:5.62.0", {\ - "packageLocation": "./.yarn/__virtual__/@typescript-eslint-typescript-estree-virtual-1836c4b55e/0/cache/@typescript-eslint-typescript-estree-npm-5.62.0-5d1ea132a9-3624520abb.zip/node_modules/@typescript-eslint/typescript-estree/",\ + ["virtual:7f3bc25884a68a29ac4d296cb19161080b5427dc732e6412b6c8cd95f25543caace2cc48bfd515b6ed39d97808f3fde9257ccd25f2112571b23f01c85c15a049#npm:5.62.0", {\ + "packageLocation": "./.yarn/__virtual__/@typescript-eslint-typescript-estree-virtual-b284e7015c/0/cache/@typescript-eslint-typescript-estree-npm-5.62.0-5d1ea132a9-3624520abb.zip/node_modules/@typescript-eslint/typescript-estree/",\ "packageDependencies": [\ - ["@typescript-eslint/typescript-estree", "virtual:c5c581d9613c51eb3e937c55675dd6f39afb2a6747015ab1a2b5d7daaf0ad1388342b1c235a19f98c480d414c467cb6800bb05ed69c5c50c3af4b64d41b5a2ef#npm:5.62.0"],\ + ["@typescript-eslint/typescript-estree", "virtual:7f3bc25884a68a29ac4d296cb19161080b5427dc732e6412b6c8cd95f25543caace2cc48bfd515b6ed39d97808f3fde9257ccd25f2112571b23f01c85c15a049#npm:5.62.0"],\ ["@types/typescript", null],\ ["@typescript-eslint/types", "npm:5.62.0"],\ ["@typescript-eslint/visitor-keys", "npm:5.62.0"],\ @@ -689,8 +694,8 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { ["globby", "npm:11.1.0"],\ ["is-glob", "npm:4.0.3"],\ ["semver", "npm:7.5.4"],\ - ["tsutils", "virtual:1836c4b55e4791907b99a91792908a4e565ff351d6fe50457374c8344922cbd89593d0c9abd7d0ccd312021e4d197b4bea65df32526c387593eb4df73ba12425#npm:3.21.0"],\ - ["typescript", null]\ + ["tsutils", "virtual:89014fb2f72da20eb87d54c80bac37610b57a73485dee5ebf9333bf5c4bce0d972953cbf0f48420b275d3bc40f36aded8d47d2d24281f85e903e5d354ec64e4e#npm:3.21.0"],\ + ["typescript", "patch:typescript@npm%3A5.2.2#~builtin::version=5.2.2&hash=f3b441"]\ ],\ "packagePeers": [\ "@types/typescript",\ @@ -698,10 +703,10 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { ],\ "linkType": "HARD"\ }],\ - ["virtual:e501561d03359d3ad14358bb798a1c3e9b934095fed9debec78c49fa03a035928f77c41a677c9a4e2b1c3dc5b324d140accd38b981f2cb2a9e17165fbc0e0d02#npm:5.62.0", {\ - "packageLocation": "./.yarn/__virtual__/@typescript-eslint-typescript-estree-virtual-ba38db7306/0/cache/@typescript-eslint-typescript-estree-npm-5.62.0-5d1ea132a9-3624520abb.zip/node_modules/@typescript-eslint/typescript-estree/",\ + ["virtual:b6c32928e3a73473744c61c91597c46acb3aac39cfd0cb6fa763edd86d59abe50465a1795d8d98162d97d00db3b3f55ab682576f5b7c142340f4654751eec0b2#npm:5.62.0", {\ + "packageLocation": "./.yarn/__virtual__/@typescript-eslint-typescript-estree-virtual-1272cbed28/0/cache/@typescript-eslint-typescript-estree-npm-5.62.0-5d1ea132a9-3624520abb.zip/node_modules/@typescript-eslint/typescript-estree/",\ "packageDependencies": [\ - ["@typescript-eslint/typescript-estree", "virtual:e501561d03359d3ad14358bb798a1c3e9b934095fed9debec78c49fa03a035928f77c41a677c9a4e2b1c3dc5b324d140accd38b981f2cb2a9e17165fbc0e0d02#npm:5.62.0"],\ + ["@typescript-eslint/typescript-estree", "virtual:b6c32928e3a73473744c61c91597c46acb3aac39cfd0cb6fa763edd86d59abe50465a1795d8d98162d97d00db3b3f55ab682576f5b7c142340f4654751eec0b2#npm:5.62.0"],\ ["@types/typescript", null],\ ["@typescript-eslint/types", "npm:5.62.0"],\ ["@typescript-eslint/visitor-keys", "npm:5.62.0"],\ @@ -709,8 +714,8 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { ["globby", "npm:11.1.0"],\ ["is-glob", "npm:4.0.3"],\ ["semver", "npm:7.5.4"],\ - ["tsutils", "virtual:886143a71dbd16c7dff857b41f76376562a0e00b73297c242842020b27304f674219cf3e7b9cfd86b31a507d7d2502a83c34027c7ed5757aa6c9457392679a04#npm:3.21.0"],\ - ["typescript", "patch:typescript@npm%3A5.2.2#~builtin::version=5.2.2&hash=f3b441"]\ + ["tsutils", "virtual:1272cbed28ba43154b1f70b1b9ccc5d5d4f0e0ea66cdbcdc34cdd20ac1a5aa8be13d64ab87eae1341f94e5df93a4932087a80587415043f9c7312b1f619267f4#npm:3.21.0"],\ + ["typescript", null]\ ],\ "packagePeers": [\ "@types/typescript",\ @@ -727,18 +732,18 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { ],\ "linkType": "SOFT"\ }],\ - ["virtual:886143a71dbd16c7dff857b41f76376562a0e00b73297c242842020b27304f674219cf3e7b9cfd86b31a507d7d2502a83c34027c7ed5757aa6c9457392679a04#npm:5.62.0", {\ - "packageLocation": "./.yarn/__virtual__/@typescript-eslint-utils-virtual-c5c581d961/0/cache/@typescript-eslint-utils-npm-5.62.0-907f2d579e-ee9398c8c5.zip/node_modules/@typescript-eslint/utils/",\ + ["virtual:89014fb2f72da20eb87d54c80bac37610b57a73485dee5ebf9333bf5c4bce0d972953cbf0f48420b275d3bc40f36aded8d47d2d24281f85e903e5d354ec64e4e#npm:5.62.0", {\ + "packageLocation": "./.yarn/__virtual__/@typescript-eslint-utils-virtual-b6c32928e3/0/cache/@typescript-eslint-utils-npm-5.62.0-907f2d579e-ee9398c8c5.zip/node_modules/@typescript-eslint/utils/",\ "packageDependencies": [\ - ["@typescript-eslint/utils", "virtual:886143a71dbd16c7dff857b41f76376562a0e00b73297c242842020b27304f674219cf3e7b9cfd86b31a507d7d2502a83c34027c7ed5757aa6c9457392679a04#npm:5.62.0"],\ - ["@eslint-community/eslint-utils", "virtual:1b802e43a1d6cfd4888588e031e9b9539c10922666207f02b37e1572beffa71b5952c5b88bdcc1e2ff0080ea3baa9b39a63225d9ea667488d5ab782bed5718c7#npm:4.4.0"],\ + ["@typescript-eslint/utils", "virtual:89014fb2f72da20eb87d54c80bac37610b57a73485dee5ebf9333bf5c4bce0d972953cbf0f48420b275d3bc40f36aded8d47d2d24281f85e903e5d354ec64e4e#npm:5.62.0"],\ + ["@eslint-community/eslint-utils", "virtual:77fce3ec74d55c7e6791631c329cf3adde374e21e618e865127f72e63efeb3376dcf7fc8217de80f5a310e81c791a72e9d099b00fd3252d5653ff68dff50c2fa#npm:4.4.0"],\ ["@types/eslint", null],\ - ["@types/json-schema", "npm:7.0.12"],\ - ["@types/semver", "npm:7.5.1"],\ + ["@types/json-schema", "npm:7.0.14"],\ + ["@types/semver", "npm:7.5.4"],\ ["@typescript-eslint/scope-manager", "npm:5.62.0"],\ ["@typescript-eslint/types", "npm:5.62.0"],\ - ["@typescript-eslint/typescript-estree", "virtual:c5c581d9613c51eb3e937c55675dd6f39afb2a6747015ab1a2b5d7daaf0ad1388342b1c235a19f98c480d414c467cb6800bb05ed69c5c50c3af4b64d41b5a2ef#npm:5.62.0"],\ - ["eslint", "npm:8.49.0"],\ + ["@typescript-eslint/typescript-estree", "virtual:b6c32928e3a73473744c61c91597c46acb3aac39cfd0cb6fa763edd86d59abe50465a1795d8d98162d97d00db3b3f55ab682576f5b7c142340f4654751eec0b2#npm:5.62.0"],\ + ["eslint", "npm:8.51.0"],\ ["eslint-scope", "npm:5.1.1"],\ ["semver", "npm:7.5.4"]\ ],\ @@ -761,10 +766,10 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { }]\ ]],\ ["@vscode/test-electron", [\ - ["npm:2.3.4", {\ - "packageLocation": "./.yarn/cache/@vscode-test-electron-npm-2.3.4-cdb0185d02-78de21d66b.zip/node_modules/@vscode/test-electron/",\ + ["npm:2.3.5", {\ + "packageLocation": "./.yarn/cache/@vscode-test-electron-npm-2.3.5-a094bdf2db-3eaaf6613a.zip/node_modules/@vscode/test-electron/",\ "packageDependencies": [\ - ["@vscode/test-electron", "npm:2.3.4"],\ + ["@vscode/test-electron", "npm:2.3.5"],\ ["http-proxy-agent", "npm:4.0.1"],\ ["https-proxy-agent", "npm:5.0.1"],\ ["jszip", "npm:3.10.1"],\ @@ -773,36 +778,6 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { "linkType": "HARD"\ }]\ ]],\ - ["@vscode/vsce", [\ - ["npm:2.21.1", {\ - "packageLocation": "./.yarn/cache/@vscode-vsce-npm-2.21.1-51e6accf0d-d597d97683.zip/node_modules/@vscode/vsce/",\ - "packageDependencies": [\ - ["@vscode/vsce", "npm:2.21.1"],\ - ["azure-devops-node-api", "npm:11.2.0"],\ - ["chalk", "npm:2.4.2"],\ - ["cheerio", "npm:1.0.0-rc.12"],\ - ["commander", "npm:6.2.1"],\ - ["glob", "npm:7.2.3"],\ - ["hosted-git-info", "npm:4.1.0"],\ - ["jsonc-parser", "npm:3.2.0"],\ - ["keytar", "npm:7.9.0"],\ - ["leven", "npm:3.1.0"],\ - ["markdown-it", "npm:12.3.2"],\ - ["mime", "npm:1.6.0"],\ - ["minimatch", "npm:3.1.2"],\ - ["parse-semver", "npm:1.1.1"],\ - ["read", "npm:1.0.7"],\ - ["semver", "npm:7.5.4"],\ - ["tmp", "npm:0.2.1"],\ - ["typed-rest-client", "npm:1.8.11"],\ - ["url-join", "npm:4.0.1"],\ - ["xml2js", "npm:0.5.0"],\ - ["yauzl", "npm:2.10.0"],\ - ["yazl", "npm:2.5.1"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ ["@webassemblyjs/ast", [\ ["npm:1.11.6", {\ "packageLocation": "./.yarn/cache/@webassemblyjs-ast-npm-1.11.6-d3fd2bb49a-38ef1b526c.zip/node_modules/@webassemblyjs/ast/",\ @@ -982,14 +957,14 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { ],\ "linkType": "SOFT"\ }],\ - ["virtual:ad701b078cc2408c5791666f6d120096fd9f1cd66f63c26aaf307312ac91fee8153bad89ca107dc1f4886c4e5ab34def89b17331043d75175a43c752a58a41c5#npm:2.1.1", {\ - "packageLocation": "./.yarn/__virtual__/@webpack-cli-configtest-virtual-3280ca13e1/0/cache/@webpack-cli-configtest-npm-2.1.1-2aa637b6bc-9f9f9145c2.zip/node_modules/@webpack-cli/configtest/",\ + ["virtual:18451f3d8e5dacbf26b98823a0220f7b3f28daca71aa13b5ae585b8cdfc3a8ac3080a26c1c965a6c95afb7ef7c053188674829161ad475a0246dbc7ad48bc72c#npm:2.1.1", {\ + "packageLocation": "./.yarn/__virtual__/@webpack-cli-configtest-virtual-5a62e799ca/0/cache/@webpack-cli-configtest-npm-2.1.1-2aa637b6bc-9f9f9145c2.zip/node_modules/@webpack-cli/configtest/",\ "packageDependencies": [\ - ["@webpack-cli/configtest", "virtual:ad701b078cc2408c5791666f6d120096fd9f1cd66f63c26aaf307312ac91fee8153bad89ca107dc1f4886c4e5ab34def89b17331043d75175a43c752a58a41c5#npm:2.1.1"],\ + ["@webpack-cli/configtest", "virtual:18451f3d8e5dacbf26b98823a0220f7b3f28daca71aa13b5ae585b8cdfc3a8ac3080a26c1c965a6c95afb7ef7c053188674829161ad475a0246dbc7ad48bc72c#npm:2.1.1"],\ ["@types/webpack", null],\ ["@types/webpack-cli", null],\ - ["webpack", "virtual:52255392bc7c855b3a7ca4b9b99f4d75a3b9d689264acbbe839776f76900c0302139aac1239332d2de96876e944fbdfcccf8eb06eedae6162f8c837cb3407ca8#npm:5.88.2"],\ - ["webpack-cli", "virtual:52255392bc7c855b3a7ca4b9b99f4d75a3b9d689264acbbe839776f76900c0302139aac1239332d2de96876e944fbdfcccf8eb06eedae6162f8c837cb3407ca8#npm:5.1.4"]\ + ["webpack", "virtual:2b9e7e7d573ed38308251d9cfa9bcac1c01394d20ff25d4a07b4a0345be370b65803551137c4363442bf76c7d6f9363387c180207a65457c6616ca7fd9b2a56b#npm:5.89.0"],\ + ["webpack-cli", "virtual:2b9e7e7d573ed38308251d9cfa9bcac1c01394d20ff25d4a07b4a0345be370b65803551137c4363442bf76c7d6f9363387c180207a65457c6616ca7fd9b2a56b#npm:5.1.4"]\ ],\ "packagePeers": [\ "@types/webpack-cli",\ @@ -1008,14 +983,14 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { ],\ "linkType": "SOFT"\ }],\ - ["virtual:ad701b078cc2408c5791666f6d120096fd9f1cd66f63c26aaf307312ac91fee8153bad89ca107dc1f4886c4e5ab34def89b17331043d75175a43c752a58a41c5#npm:2.0.2", {\ - "packageLocation": "./.yarn/__virtual__/@webpack-cli-info-virtual-bb374f0da2/0/cache/@webpack-cli-info-npm-2.0.2-494be2e91a-8f9a178afc.zip/node_modules/@webpack-cli/info/",\ + ["virtual:18451f3d8e5dacbf26b98823a0220f7b3f28daca71aa13b5ae585b8cdfc3a8ac3080a26c1c965a6c95afb7ef7c053188674829161ad475a0246dbc7ad48bc72c#npm:2.0.2", {\ + "packageLocation": "./.yarn/__virtual__/@webpack-cli-info-virtual-77ec15a80f/0/cache/@webpack-cli-info-npm-2.0.2-494be2e91a-8f9a178afc.zip/node_modules/@webpack-cli/info/",\ "packageDependencies": [\ - ["@webpack-cli/info", "virtual:ad701b078cc2408c5791666f6d120096fd9f1cd66f63c26aaf307312ac91fee8153bad89ca107dc1f4886c4e5ab34def89b17331043d75175a43c752a58a41c5#npm:2.0.2"],\ + ["@webpack-cli/info", "virtual:18451f3d8e5dacbf26b98823a0220f7b3f28daca71aa13b5ae585b8cdfc3a8ac3080a26c1c965a6c95afb7ef7c053188674829161ad475a0246dbc7ad48bc72c#npm:2.0.2"],\ ["@types/webpack", null],\ ["@types/webpack-cli", null],\ - ["webpack", "virtual:52255392bc7c855b3a7ca4b9b99f4d75a3b9d689264acbbe839776f76900c0302139aac1239332d2de96876e944fbdfcccf8eb06eedae6162f8c837cb3407ca8#npm:5.88.2"],\ - ["webpack-cli", "virtual:52255392bc7c855b3a7ca4b9b99f4d75a3b9d689264acbbe839776f76900c0302139aac1239332d2de96876e944fbdfcccf8eb06eedae6162f8c837cb3407ca8#npm:5.1.4"]\ + ["webpack", "virtual:2b9e7e7d573ed38308251d9cfa9bcac1c01394d20ff25d4a07b4a0345be370b65803551137c4363442bf76c7d6f9363387c180207a65457c6616ca7fd9b2a56b#npm:5.89.0"],\ + ["webpack-cli", "virtual:2b9e7e7d573ed38308251d9cfa9bcac1c01394d20ff25d4a07b4a0345be370b65803551137c4363442bf76c7d6f9363387c180207a65457c6616ca7fd9b2a56b#npm:5.1.4"]\ ],\ "packagePeers": [\ "@types/webpack-cli",\ @@ -1034,15 +1009,15 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { ],\ "linkType": "SOFT"\ }],\ - ["virtual:ad701b078cc2408c5791666f6d120096fd9f1cd66f63c26aaf307312ac91fee8153bad89ca107dc1f4886c4e5ab34def89b17331043d75175a43c752a58a41c5#npm:2.0.5", {\ - "packageLocation": "./.yarn/__virtual__/@webpack-cli-serve-virtual-3174bf12f6/0/cache/@webpack-cli-serve-npm-2.0.5-5a220c2601-75f0e54681.zip/node_modules/@webpack-cli/serve/",\ + ["virtual:18451f3d8e5dacbf26b98823a0220f7b3f28daca71aa13b5ae585b8cdfc3a8ac3080a26c1c965a6c95afb7ef7c053188674829161ad475a0246dbc7ad48bc72c#npm:2.0.5", {\ + "packageLocation": "./.yarn/__virtual__/@webpack-cli-serve-virtual-b389e525db/0/cache/@webpack-cli-serve-npm-2.0.5-5a220c2601-75f0e54681.zip/node_modules/@webpack-cli/serve/",\ "packageDependencies": [\ - ["@webpack-cli/serve", "virtual:ad701b078cc2408c5791666f6d120096fd9f1cd66f63c26aaf307312ac91fee8153bad89ca107dc1f4886c4e5ab34def89b17331043d75175a43c752a58a41c5#npm:2.0.5"],\ + ["@webpack-cli/serve", "virtual:18451f3d8e5dacbf26b98823a0220f7b3f28daca71aa13b5ae585b8cdfc3a8ac3080a26c1c965a6c95afb7ef7c053188674829161ad475a0246dbc7ad48bc72c#npm:2.0.5"],\ ["@types/webpack", null],\ ["@types/webpack-cli", null],\ ["@types/webpack-dev-server", null],\ - ["webpack", "virtual:52255392bc7c855b3a7ca4b9b99f4d75a3b9d689264acbbe839776f76900c0302139aac1239332d2de96876e944fbdfcccf8eb06eedae6162f8c837cb3407ca8#npm:5.88.2"],\ - ["webpack-cli", "virtual:52255392bc7c855b3a7ca4b9b99f4d75a3b9d689264acbbe839776f76900c0302139aac1239332d2de96876e944fbdfcccf8eb06eedae6162f8c837cb3407ca8#npm:5.1.4"],\ + ["webpack", "virtual:2b9e7e7d573ed38308251d9cfa9bcac1c01394d20ff25d4a07b4a0345be370b65803551137c4363442bf76c7d6f9363387c180207a65457c6616ca7fd9b2a56b#npm:5.89.0"],\ + ["webpack-cli", "virtual:2b9e7e7d573ed38308251d9cfa9bcac1c01394d20ff25d4a07b4a0345be370b65803551137c4363442bf76c7d6f9363387c180207a65457c6616ca7fd9b2a56b#npm:5.1.4"],\ ["webpack-dev-server", null]\ ],\ "packagePeers": [\ @@ -1100,10 +1075,10 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { ],\ "linkType": "SOFT"\ }],\ - ["virtual:d9c05c4f9709e030529533d0ddfe05c0b547bb7476ef97252e4dbbccaae19c175fe286f7789e966bfc4890744043e3ec1e1e7c75b4e24776bd07cbed32cd0806#npm:1.9.0", {\ - "packageLocation": "./.yarn/__virtual__/acorn-import-assertions-virtual-2d1f9d4162/0/cache/acorn-import-assertions-npm-1.9.0-22f56507c7-944fb2659d.zip/node_modules/acorn-import-assertions/",\ + ["virtual:b98590e6182f1e3e809675a880704d2c50533e40386e60683f5d6ae6206f5e5e58cf33b625935351b9a4ef2066acd33ce7f25a0d7055a7a23f1ec398f2c56b3f#npm:1.9.0", {\ + "packageLocation": "./.yarn/__virtual__/acorn-import-assertions-virtual-fbd09c42d2/0/cache/acorn-import-assertions-npm-1.9.0-22f56507c7-944fb2659d.zip/node_modules/acorn-import-assertions/",\ "packageDependencies": [\ - ["acorn-import-assertions", "virtual:d9c05c4f9709e030529533d0ddfe05c0b547bb7476ef97252e4dbbccaae19c175fe286f7789e966bfc4890744043e3ec1e1e7c75b4e24776bd07cbed32cd0806#npm:1.9.0"],\ + ["acorn-import-assertions", "virtual:b98590e6182f1e3e809675a880704d2c50533e40386e60683f5d6ae6206f5e5e58cf33b625935351b9a4ef2066acd33ce7f25a0d7055a7a23f1ec398f2c56b3f#npm:1.9.0"],\ ["@types/acorn", null],\ ["acorn", "npm:8.10.0"]\ ],\ @@ -1228,14 +1203,6 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { }]\ ]],\ ["ansi-styles", [\ - ["npm:3.2.1", {\ - "packageLocation": "./.yarn/cache/ansi-styles-npm-3.2.1-8cb8107983-d85ade01c1.zip/node_modules/ansi-styles/",\ - "packageDependencies": [\ - ["ansi-styles", "npm:3.2.1"],\ - ["color-convert", "npm:1.9.3"]\ - ],\ - "linkType": "HARD"\ - }],\ ["npm:4.3.0", {\ "packageLocation": "./.yarn/cache/ansi-styles-npm-4.3.0-245c7d42c7-513b44c3b2.zip/node_modules/ansi-styles/",\ "packageDependencies": [\ @@ -1301,17 +1268,6 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { "linkType": "HARD"\ }]\ ]],\ - ["azure-devops-node-api", [\ - ["npm:11.2.0", {\ - "packageLocation": "./.yarn/cache/azure-devops-node-api-npm-11.2.0-4f40e3421f-52e84379b4.zip/node_modules/azure-devops-node-api/",\ - "packageDependencies": [\ - ["azure-devops-node-api", "npm:11.2.0"],\ - ["tunnel", "npm:0.0.6"],\ - ["typed-rest-client", "npm:1.8.11"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ ["balanced-match", [\ ["npm:1.0.2", {\ "packageLocation": "./.yarn/cache/balanced-match-npm-1.0.2-a53c126459-9706c088a2.zip/node_modules/balanced-match/",\ @@ -1321,15 +1277,6 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { "linkType": "HARD"\ }]\ ]],\ - ["base64-js", [\ - ["npm:1.5.1", {\ - "packageLocation": "./.yarn/cache/base64-js-npm-1.5.1-b2f7275641-669632eb37.zip/node_modules/base64-js/",\ - "packageDependencies": [\ - ["base64-js", "npm:1.5.1"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ ["binary-extensions", [\ ["npm:2.2.0", {\ "packageLocation": "./.yarn/cache/binary-extensions-npm-2.2.0-180c33fec7-ccd267956c.zip/node_modules/binary-extensions/",\ @@ -1339,27 +1286,6 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { "linkType": "HARD"\ }]\ ]],\ - ["bl", [\ - ["npm:4.1.0", {\ - "packageLocation": "./.yarn/cache/bl-npm-4.1.0-7f94cdcf3f-9e8521fa7e.zip/node_modules/bl/",\ - "packageDependencies": [\ - ["bl", "npm:4.1.0"],\ - ["buffer", "npm:5.7.1"],\ - ["inherits", "npm:2.0.4"],\ - ["readable-stream", "npm:3.6.2"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["boolbase", [\ - ["npm:1.0.0", {\ - "packageLocation": "./.yarn/cache/boolbase-npm-1.0.0-965fe9af6d-3e25c80ef6.zip/node_modules/boolbase/",\ - "packageDependencies": [\ - ["boolbase", "npm:1.0.0"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ ["brace-expansion", [\ ["npm:1.1.11", {\ "packageLocation": "./.yarn/cache/brace-expansion-npm-1.1.11-fb95eb05ad-faf34a7bb0.zip/node_modules/brace-expansion/",\ @@ -1399,34 +1325,14 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { }]\ ]],\ ["browserslist", [\ - ["npm:4.21.10", {\ - "packageLocation": "./.yarn/cache/browserslist-npm-4.21.10-e2170a875b-1e27c0f111.zip/node_modules/browserslist/",\ + ["npm:4.22.1", {\ + "packageLocation": "./.yarn/cache/browserslist-npm-4.22.1-cccae6d74e-7e6b10c53f.zip/node_modules/browserslist/",\ "packageDependencies": [\ - ["browserslist", "npm:4.21.10"],\ - ["caniuse-lite", "npm:1.0.30001532"],\ - ["electron-to-chromium", "npm:1.4.513"],\ + ["browserslist", "npm:4.22.1"],\ + ["caniuse-lite", "npm:1.0.30001551"],\ + ["electron-to-chromium", "npm:1.4.562"],\ ["node-releases", "npm:2.0.13"],\ - ["update-browserslist-db", "virtual:e2170a875bba2f8fa9e93e47c65f2f250097e101a59d95ea6fd852f32965e8cd6cef3b5662aa7295279d5bc60c9a612ddb8515c7dd1b7e8fb9984dee1823e7d6#npm:1.0.11"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["buffer", [\ - ["npm:5.7.1", {\ - "packageLocation": "./.yarn/cache/buffer-npm-5.7.1-513ef8259e-e2cf8429e1.zip/node_modules/buffer/",\ - "packageDependencies": [\ - ["buffer", "npm:5.7.1"],\ - ["base64-js", "npm:1.5.1"],\ - ["ieee754", "npm:1.2.1"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["buffer-crc32", [\ - ["npm:0.2.13", {\ - "packageLocation": "./.yarn/cache/buffer-crc32-npm-0.2.13-c4b6fceac1-06252347ae.zip/node_modules/buffer-crc32/",\ - "packageDependencies": [\ - ["buffer-crc32", "npm:0.2.13"]\ + ["update-browserslist-db", "virtual:cccae6d74e613cbaceb4c608cb01004dea3f5ca235673f5c541d60f516ef320907d258256abf63eac9b8704e23cf5d52eb19f2a57a07471accc943ea645de308#npm:1.0.13"]\ ],\ "linkType": "HARD"\ }]\ @@ -1461,17 +1367,6 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { "linkType": "HARD"\ }]\ ]],\ - ["call-bind", [\ - ["npm:1.0.2", {\ - "packageLocation": "./.yarn/cache/call-bind-npm-1.0.2-c957124861-f8e31de9d1.zip/node_modules/call-bind/",\ - "packageDependencies": [\ - ["call-bind", "npm:1.0.2"],\ - ["function-bind", "npm:1.1.1"],\ - ["get-intrinsic", "npm:1.2.1"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ ["callsites", [\ ["npm:3.1.0", {\ "packageLocation": "./.yarn/cache/callsites-npm-3.1.0-268f989910-072d17b6ab.zip/node_modules/callsites/",\ @@ -1491,25 +1386,15 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { }]\ ]],\ ["caniuse-lite", [\ - ["npm:1.0.30001532", {\ - "packageLocation": "./.yarn/cache/caniuse-lite-npm-1.0.30001532-c9fe7ca084-613abeb15e.zip/node_modules/caniuse-lite/",\ + ["npm:1.0.30001551", {\ + "packageLocation": "./.yarn/cache/caniuse-lite-npm-1.0.30001551-10ef18828c-ffdee85b1c.zip/node_modules/caniuse-lite/",\ "packageDependencies": [\ - ["caniuse-lite", "npm:1.0.30001532"]\ + ["caniuse-lite", "npm:1.0.30001551"]\ ],\ "linkType": "HARD"\ }]\ ]],\ ["chalk", [\ - ["npm:2.4.2", {\ - "packageLocation": "./.yarn/cache/chalk-npm-2.4.2-3ea16dd91e-ec3661d38f.zip/node_modules/chalk/",\ - "packageDependencies": [\ - ["chalk", "npm:2.4.2"],\ - ["ansi-styles", "npm:3.2.1"],\ - ["escape-string-regexp", "npm:1.0.5"],\ - ["supports-color", "npm:5.5.0"]\ - ],\ - "linkType": "HARD"\ - }],\ ["npm:4.1.2", {\ "packageLocation": "./.yarn/cache/chalk-npm-4.1.2-ba8b67ab80-fe75c9d5c7.zip/node_modules/chalk/",\ "packageDependencies": [\ @@ -1520,37 +1405,6 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { "linkType": "HARD"\ }]\ ]],\ - ["cheerio", [\ - ["npm:1.0.0-rc.12", {\ - "packageLocation": "./.yarn/cache/cheerio-npm-1.0.0-rc.12-6785a97c2a-5d4c1b7a53.zip/node_modules/cheerio/",\ - "packageDependencies": [\ - ["cheerio", "npm:1.0.0-rc.12"],\ - ["cheerio-select", "npm:2.1.0"],\ - ["dom-serializer", "npm:2.0.0"],\ - ["domhandler", "npm:5.0.3"],\ - ["domutils", "npm:3.1.0"],\ - ["htmlparser2", "npm:8.0.2"],\ - ["parse5", "npm:7.1.2"],\ - ["parse5-htmlparser2-tree-adapter", "npm:7.0.0"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["cheerio-select", [\ - ["npm:2.1.0", {\ - "packageLocation": "./.yarn/cache/cheerio-select-npm-2.1.0-e92bc2f296-843d6d4799.zip/node_modules/cheerio-select/",\ - "packageDependencies": [\ - ["cheerio-select", "npm:2.1.0"],\ - ["boolbase", "npm:1.0.0"],\ - ["css-select", "npm:5.1.0"],\ - ["css-what", "npm:6.1.0"],\ - ["domelementtype", "npm:2.3.0"],\ - ["domhandler", "npm:5.0.3"],\ - ["domutils", "npm:3.1.0"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ ["chokidar", [\ ["npm:3.5.3", {\ "packageLocation": "./.yarn/cache/chokidar-npm-3.5.3-c5f9b0a56a-b49fcde401.zip/node_modules/chokidar/",\ @@ -1569,13 +1423,6 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { }]\ ]],\ ["chownr", [\ - ["npm:1.1.4", {\ - "packageLocation": "./.yarn/cache/chownr-npm-1.1.4-5bd400ab08-115648f8eb.zip/node_modules/chownr/",\ - "packageDependencies": [\ - ["chownr", "npm:1.1.4"]\ - ],\ - "linkType": "HARD"\ - }],\ ["npm:2.0.0", {\ "packageLocation": "./.yarn/cache/chownr-npm-2.0.0-638f1c9c61-c57cf9dd07.zip/node_modules/chownr/",\ "packageDependencies": [\ @@ -1627,14 +1474,6 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { }]\ ]],\ ["color-convert", [\ - ["npm:1.9.3", {\ - "packageLocation": "./.yarn/cache/color-convert-npm-1.9.3-1fe690075e-fd7a64a17c.zip/node_modules/color-convert/",\ - "packageDependencies": [\ - ["color-convert", "npm:1.9.3"],\ - ["color-name", "npm:1.1.3"]\ - ],\ - "linkType": "HARD"\ - }],\ ["npm:2.0.1", {\ "packageLocation": "./.yarn/cache/color-convert-npm-2.0.1-79730e935b-79e6bdb9fd.zip/node_modules/color-convert/",\ "packageDependencies": [\ @@ -1645,13 +1484,6 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { }]\ ]],\ ["color-name", [\ - ["npm:1.1.3", {\ - "packageLocation": "./.yarn/cache/color-name-npm-1.1.3-728b7b5d39-09c5d3e33d.zip/node_modules/color-name/",\ - "packageDependencies": [\ - ["color-name", "npm:1.1.3"]\ - ],\ - "linkType": "HARD"\ - }],\ ["npm:1.1.4", {\ "packageLocation": "./.yarn/cache/color-name-npm-1.1.4-025792b0ea-b044585952.zip/node_modules/color-name/",\ "packageDependencies": [\ @@ -1692,13 +1524,6 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { ["commander", "npm:2.20.3"]\ ],\ "linkType": "HARD"\ - }],\ - ["npm:6.2.1", {\ - "packageLocation": "./.yarn/cache/commander-npm-6.2.1-d5b635f237-d7090410c0.zip/node_modules/commander/",\ - "packageDependencies": [\ - ["commander", "npm:6.2.1"]\ - ],\ - "linkType": "HARD"\ }]\ ]],\ ["concat-map", [\ @@ -1740,29 +1565,6 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { "linkType": "HARD"\ }]\ ]],\ - ["css-select", [\ - ["npm:5.1.0", {\ - "packageLocation": "./.yarn/cache/css-select-npm-5.1.0-9365a79de5-2772c049b1.zip/node_modules/css-select/",\ - "packageDependencies": [\ - ["css-select", "npm:5.1.0"],\ - ["boolbase", "npm:1.0.0"],\ - ["css-what", "npm:6.1.0"],\ - ["domhandler", "npm:5.0.3"],\ - ["domutils", "npm:3.1.0"],\ - ["nth-check", "npm:2.1.1"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["css-what", [\ - ["npm:6.1.0", {\ - "packageLocation": "./.yarn/cache/css-what-npm-6.1.0-57f751efbb-b975e547e1.zip/node_modules/css-what/",\ - "packageDependencies": [\ - ["css-what", "npm:6.1.0"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ ["debug", [\ ["npm:4.3.4", {\ "packageLocation": "./.yarn/cache/debug-npm-4.3.4-4513954577-3dbad3f94e.zip/node_modules/debug/",\ @@ -1809,25 +1611,6 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { "linkType": "HARD"\ }]\ ]],\ - ["decompress-response", [\ - ["npm:6.0.0", {\ - "packageLocation": "./.yarn/cache/decompress-response-npm-6.0.0-359de2878c-d377cf47e0.zip/node_modules/decompress-response/",\ - "packageDependencies": [\ - ["decompress-response", "npm:6.0.0"],\ - ["mimic-response", "npm:3.1.0"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["deep-extend", [\ - ["npm:0.6.0", {\ - "packageLocation": "./.yarn/cache/deep-extend-npm-0.6.0-e182924219-7be7e5a8d4.zip/node_modules/deep-extend/",\ - "packageDependencies": [\ - ["deep-extend", "npm:0.6.0"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ ["deep-is", [\ ["npm:0.1.4", {\ "packageLocation": "./.yarn/cache/deep-is-npm-0.1.4-88938b5a67-edb65dd0d7.zip/node_modules/deep-is/",\ @@ -1846,15 +1629,6 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { "linkType": "HARD"\ }]\ ]],\ - ["detect-libc", [\ - ["npm:2.0.2", {\ - "packageLocation": "./.yarn/cache/detect-libc-npm-2.0.2-03afa59137-2b2cd3649b.zip/node_modules/detect-libc/",\ - "packageDependencies": [\ - ["detect-libc", "npm:2.0.2"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ ["diff", [\ ["npm:5.0.0", {\ "packageLocation": "./.yarn/cache/diff-npm-5.0.0-ad6900db18-f19fe29284.zip/node_modules/diff/",\ @@ -1884,49 +1658,6 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { "linkType": "HARD"\ }]\ ]],\ - ["dom-serializer", [\ - ["npm:2.0.0", {\ - "packageLocation": "./.yarn/cache/dom-serializer-npm-2.0.0-378ebc7200-cd1810544f.zip/node_modules/dom-serializer/",\ - "packageDependencies": [\ - ["dom-serializer", "npm:2.0.0"],\ - ["domelementtype", "npm:2.3.0"],\ - ["domhandler", "npm:5.0.3"],\ - ["entities", "npm:4.5.0"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["domelementtype", [\ - ["npm:2.3.0", {\ - "packageLocation": "./.yarn/cache/domelementtype-npm-2.3.0-02de7cbfba-ee837a318f.zip/node_modules/domelementtype/",\ - "packageDependencies": [\ - ["domelementtype", "npm:2.3.0"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["domhandler", [\ - ["npm:5.0.3", {\ - "packageLocation": "./.yarn/cache/domhandler-npm-5.0.3-3ede73dc10-0f58f4a6af.zip/node_modules/domhandler/",\ - "packageDependencies": [\ - ["domhandler", "npm:5.0.3"],\ - ["domelementtype", "npm:2.3.0"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["domutils", [\ - ["npm:3.1.0", {\ - "packageLocation": "./.yarn/cache/domutils-npm-3.1.0-66c92ef7eb-e5757456dd.zip/node_modules/domutils/",\ - "packageDependencies": [\ - ["domutils", "npm:3.1.0"],\ - ["dom-serializer", "npm:2.0.0"],\ - ["domelementtype", "npm:2.3.0"],\ - ["domhandler", "npm:5.0.3"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ ["eastasianwidth", [\ ["npm:0.2.0", {\ "packageLocation": "./.yarn/cache/eastasianwidth-npm-0.2.0-c37eb16bd1-7d00d7cd8e.zip/node_modules/eastasianwidth/",\ @@ -1937,10 +1668,10 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { }]\ ]],\ ["electron-to-chromium", [\ - ["npm:1.4.513", {\ - "packageLocation": "./.yarn/cache/electron-to-chromium-npm-1.4.513-bc6fee1f42-613b66da17.zip/node_modules/electron-to-chromium/",\ + ["npm:1.4.562", {\ + "packageLocation": "./.yarn/cache/electron-to-chromium-npm-1.4.562-385fc13106-89e5d5ed3b.zip/node_modules/electron-to-chromium/",\ "packageDependencies": [\ - ["electron-to-chromium", "npm:1.4.513"]\ + ["electron-to-chromium", "npm:1.4.562"]\ ],\ "linkType": "HARD"\ }]\ @@ -1971,16 +1702,6 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { "linkType": "HARD"\ }]\ ]],\ - ["end-of-stream", [\ - ["npm:1.4.4", {\ - "packageLocation": "./.yarn/cache/end-of-stream-npm-1.4.4-497fc6dee1-530a5a5a1e.zip/node_modules/end-of-stream/",\ - "packageDependencies": [\ - ["end-of-stream", "npm:1.4.4"],\ - ["once", "npm:1.4.0"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ ["enhanced-resolve", [\ ["npm:5.15.0", {\ "packageLocation": "./.yarn/cache/enhanced-resolve-npm-5.15.0-16eb7ddef9-fbd8cdc926.zip/node_modules/enhanced-resolve/",\ @@ -1992,22 +1713,6 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { "linkType": "HARD"\ }]\ ]],\ - ["entities", [\ - ["npm:2.1.0", {\ - "packageLocation": "./.yarn/cache/entities-npm-2.1.0-b27b8aebc6-a10a877e48.zip/node_modules/entities/",\ - "packageDependencies": [\ - ["entities", "npm:2.1.0"]\ - ],\ - "linkType": "HARD"\ - }],\ - ["npm:4.5.0", {\ - "packageLocation": "./.yarn/cache/entities-npm-4.5.0-7cdb83b832-853f8ebd5b.zip/node_modules/entities/",\ - "packageDependencies": [\ - ["entities", "npm:4.5.0"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ ["env-paths", [\ ["npm:2.2.1", {\ "packageLocation": "./.yarn/cache/env-paths-npm-2.2.1-7c7577428c-65b5df55a8.zip/node_modules/env-paths/",\ @@ -2036,10 +1741,10 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { }]\ ]],\ ["es-module-lexer", [\ - ["npm:1.3.0", {\ - "packageLocation": "./.yarn/cache/es-module-lexer-npm-1.3.0-9be5e8b1c4-48fd9f504a.zip/node_modules/es-module-lexer/",\ + ["npm:1.3.1", {\ + "packageLocation": "./.yarn/cache/es-module-lexer-npm-1.3.1-9fc669f676-3beafa7e17.zip/node_modules/es-module-lexer/",\ "packageDependencies": [\ - ["es-module-lexer", "npm:1.3.0"]\ + ["es-module-lexer", "npm:1.3.1"]\ ],\ "linkType": "HARD"\ }]\ @@ -2054,13 +1759,6 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { }]\ ]],\ ["escape-string-regexp", [\ - ["npm:1.0.5", {\ - "packageLocation": "./.yarn/cache/escape-string-regexp-npm-1.0.5-3284de402f-6092fda75c.zip/node_modules/escape-string-regexp/",\ - "packageDependencies": [\ - ["escape-string-regexp", "npm:1.0.5"]\ - ],\ - "linkType": "HARD"\ - }],\ ["npm:4.0.0", {\ "packageLocation": "./.yarn/cache/escape-string-regexp-npm-4.0.0-4b531d8d59-98b48897d9.zip/node_modules/escape-string-regexp/",\ "packageDependencies": [\ @@ -2114,14 +1812,14 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { ],\ "linkType": "HARD"\ }],\ - ["npm:8.49.0", {\ - "packageLocation": "./.yarn/cache/eslint-npm-8.49.0-1b802e43a1-4dfe257e1e.zip/node_modules/eslint/",\ + ["npm:8.51.0", {\ + "packageLocation": "./.yarn/cache/eslint-npm-8.51.0-77fce3ec74-214fa5d1fc.zip/node_modules/eslint/",\ "packageDependencies": [\ - ["eslint", "npm:8.49.0"],\ - ["@eslint-community/eslint-utils", "virtual:1b802e43a1d6cfd4888588e031e9b9539c10922666207f02b37e1572beffa71b5952c5b88bdcc1e2ff0080ea3baa9b39a63225d9ea667488d5ab782bed5718c7#npm:4.4.0"],\ + ["eslint", "npm:8.51.0"],\ + ["@eslint-community/eslint-utils", "virtual:77fce3ec74d55c7e6791631c329cf3adde374e21e618e865127f72e63efeb3376dcf7fc8217de80f5a310e81c791a72e9d099b00fd3252d5653ff68dff50c2fa#npm:4.4.0"],\ ["@eslint-community/regexpp", "npm:4.6.2"],\ ["@eslint/eslintrc", "npm:2.1.2"],\ - ["@eslint/js", "npm:8.49.0"],\ + ["@eslint/js", "npm:8.51.0"],\ ["@humanwhocodes/config-array", "npm:0.11.11"],\ ["@humanwhocodes/module-importer", "npm:1.0.1"],\ ["@nodelib/fs.walk", "npm:1.2.8"],\ @@ -2261,15 +1959,6 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { "linkType": "HARD"\ }]\ ]],\ - ["expand-template", [\ - ["npm:2.0.3", {\ - "packageLocation": "./.yarn/cache/expand-template-npm-2.0.3-80de959306-588c198472.zip/node_modules/expand-template/",\ - "packageDependencies": [\ - ["expand-template", "npm:2.0.3"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ ["exponential-backoff", [\ ["npm:3.1.1", {\ "packageLocation": "./.yarn/cache/exponential-backoff-npm-3.1.1-04df458b30-3d21519a4f.zip/node_modules/exponential-backoff/",\ @@ -2339,16 +2028,6 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { "linkType": "HARD"\ }]\ ]],\ - ["fd-slicer", [\ - ["npm:1.1.0", {\ - "packageLocation": "./.yarn/cache/fd-slicer-npm-1.1.0-3cade0050a-c8585fd571.zip/node_modules/fd-slicer/",\ - "packageDependencies": [\ - ["fd-slicer", "npm:1.1.0"],\ - ["pend", "npm:1.2.0"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ ["file-entry-cache", [\ ["npm:6.0.1", {\ "packageLocation": "./.yarn/cache/file-entry-cache-npm-6.0.1-31965cf0af-f49701feaa.zip/node_modules/file-entry-cache/",\ @@ -2429,15 +2108,6 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { "linkType": "HARD"\ }]\ ]],\ - ["fs-constants", [\ - ["npm:1.0.0", {\ - "packageLocation": "./.yarn/cache/fs-constants-npm-1.0.0-59576b2177-18f5b71837.zip/node_modules/fs-constants/",\ - "packageDependencies": [\ - ["fs-constants", "npm:1.0.0"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ ["fs-minipass", [\ ["npm:2.1.0", {\ "packageLocation": "./.yarn/cache/fs-minipass-npm-2.1.0-501ef87306-1b8d128dae.zip/node_modules/fs-minipass/",\ @@ -2475,15 +2145,6 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { "linkType": "HARD"\ }]\ ]],\ - ["function-bind", [\ - ["npm:1.1.1", {\ - "packageLocation": "./.yarn/cache/function-bind-npm-1.1.1-b56b322ae9-b32fbaebb3.zip/node_modules/function-bind/",\ - "packageDependencies": [\ - ["function-bind", "npm:1.1.1"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ ["gauge", [\ ["npm:4.0.4", {\ "packageLocation": "./.yarn/cache/gauge-npm-4.0.4-8f878385e9-788b6bfe52.zip/node_modules/gauge/",\ @@ -2510,28 +2171,6 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { "linkType": "HARD"\ }]\ ]],\ - ["get-intrinsic", [\ - ["npm:1.2.1", {\ - "packageLocation": "./.yarn/cache/get-intrinsic-npm-1.2.1-ae857fd610-5b61d88552.zip/node_modules/get-intrinsic/",\ - "packageDependencies": [\ - ["get-intrinsic", "npm:1.2.1"],\ - ["function-bind", "npm:1.1.1"],\ - ["has", "npm:1.0.3"],\ - ["has-proto", "npm:1.0.1"],\ - ["has-symbols", "npm:1.0.3"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["github-from-package", [\ - ["npm:0.0.0", {\ - "packageLocation": "./.yarn/cache/github-from-package-npm-0.0.0-519f80c9a1-14e448192a.zip/node_modules/github-from-package/",\ - "packageDependencies": [\ - ["github-from-package", "npm:0.0.0"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ ["glob", [\ ["npm:10.3.4", {\ "packageLocation": "./.yarn/cache/glob-npm-10.3.4-f58cd31f55-176b97c124.zip/node_modules/glob/",\ @@ -2655,23 +2294,15 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { }]\ ]],\ ["has", [\ - ["npm:1.0.3", {\ - "packageLocation": "./.yarn/cache/has-npm-1.0.3-b7f00631c1-b9ad53d53b.zip/node_modules/has/",\ + ["npm:1.0.4", {\ + "packageLocation": "./.yarn/cache/has-npm-1.0.4-0dc267d5e0-8a11ba062e.zip/node_modules/has/",\ "packageDependencies": [\ - ["has", "npm:1.0.3"],\ - ["function-bind", "npm:1.1.1"]\ + ["has", "npm:1.0.4"]\ ],\ "linkType": "HARD"\ }]\ ]],\ ["has-flag", [\ - ["npm:3.0.0", {\ - "packageLocation": "./.yarn/cache/has-flag-npm-3.0.0-16ac11fe05-4a15638b45.zip/node_modules/has-flag/",\ - "packageDependencies": [\ - ["has-flag", "npm:3.0.0"]\ - ],\ - "linkType": "HARD"\ - }],\ ["npm:4.0.0", {\ "packageLocation": "./.yarn/cache/has-flag-npm-4.0.0-32af9f0536-261a135703.zip/node_modules/has-flag/",\ "packageDependencies": [\ @@ -2680,24 +2311,6 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { "linkType": "HARD"\ }]\ ]],\ - ["has-proto", [\ - ["npm:1.0.1", {\ - "packageLocation": "./.yarn/cache/has-proto-npm-1.0.1-631ea9d820-febc5b5b53.zip/node_modules/has-proto/",\ - "packageDependencies": [\ - ["has-proto", "npm:1.0.1"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["has-symbols", [\ - ["npm:1.0.3", {\ - "packageLocation": "./.yarn/cache/has-symbols-npm-1.0.3-1986bff2c4-a054c40c63.zip/node_modules/has-symbols/",\ - "packageDependencies": [\ - ["has-symbols", "npm:1.0.3"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ ["has-unicode", [\ ["npm:2.0.1", {\ "packageLocation": "./.yarn/cache/has-unicode-npm-2.0.1-893adb4747-1eab07a743.zip/node_modules/has-unicode/",\ @@ -2716,29 +2329,6 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { "linkType": "HARD"\ }]\ ]],\ - ["hosted-git-info", [\ - ["npm:4.1.0", {\ - "packageLocation": "./.yarn/cache/hosted-git-info-npm-4.1.0-4efcdf8fd3-c3f87b3c2f.zip/node_modules/hosted-git-info/",\ - "packageDependencies": [\ - ["hosted-git-info", "npm:4.1.0"],\ - ["lru-cache", "npm:6.0.0"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["htmlparser2", [\ - ["npm:8.0.2", {\ - "packageLocation": "./.yarn/cache/htmlparser2-npm-8.0.2-5d9f901bb6-29167a0f92.zip/node_modules/htmlparser2/",\ - "packageDependencies": [\ - ["htmlparser2", "npm:8.0.2"],\ - ["domelementtype", "npm:2.3.0"],\ - ["domhandler", "npm:5.0.3"],\ - ["domutils", "npm:3.1.0"],\ - ["entities", "npm:4.5.0"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ ["http-cache-semantics", [\ ["npm:4.1.1", {\ "packageLocation": "./.yarn/cache/http-cache-semantics-npm-4.1.1-1120131375-83ac0bc60b.zip/node_modules/http-cache-semantics/",\ @@ -2810,15 +2400,6 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { "linkType": "HARD"\ }]\ ]],\ - ["ieee754", [\ - ["npm:1.2.1", {\ - "packageLocation": "./.yarn/cache/ieee754-npm-1.2.1-fb63b3caeb-5144c0c981.zip/node_modules/ieee754/",\ - "packageDependencies": [\ - ["ieee754", "npm:1.2.1"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ ["ignore", [\ ["npm:5.2.4", {\ "packageLocation": "./.yarn/cache/ignore-npm-5.2.4-fbe6e989e5-3d4c309c60.zip/node_modules/ignore/",\ @@ -2897,20 +2478,11 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { "linkType": "HARD"\ }]\ ]],\ - ["ini", [\ - ["npm:1.3.8", {\ - "packageLocation": "./.yarn/cache/ini-npm-1.3.8-fb5040b4c0-dfd98b0ca3.zip/node_modules/ini/",\ + ["interpret", [\ + ["npm:3.1.1", {\ + "packageLocation": "./.yarn/cache/interpret-npm-3.1.1-715bac2bd7-35cebcf48c.zip/node_modules/interpret/",\ "packageDependencies": [\ - ["ini", "npm:1.3.8"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["interpret", [\ - ["npm:3.1.1", {\ - "packageLocation": "./.yarn/cache/interpret-npm-3.1.1-715bac2bd7-35cebcf48c.zip/node_modules/interpret/",\ - "packageDependencies": [\ - ["interpret", "npm:3.1.1"]\ + ["interpret", "npm:3.1.1"]\ ],\ "linkType": "HARD"\ }]\ @@ -2939,7 +2511,7 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { "packageLocation": "./.yarn/cache/is-core-module-npm-2.13.0-e444c50225-053ab101fb.zip/node_modules/is-core-module/",\ "packageDependencies": [\ ["is-core-module", "npm:2.13.0"],\ - ["has", "npm:1.0.3"]\ + ["has", "npm:1.0.4"]\ ],\ "linkType": "HARD"\ }]\ @@ -3070,7 +2642,7 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { "packageLocation": "./.yarn/cache/jest-worker-npm-27.5.1-1c110b5894-98cd68b696.zip/node_modules/jest-worker/",\ "packageDependencies": [\ ["jest-worker", "npm:27.5.1"],\ - ["@types/node", "npm:20.6.0"],\ + ["@types/node", "npm:20.8.7"],\ ["merge-stream", "npm:2.0.0"],\ ["supports-color", "npm:8.1.1"]\ ],\ @@ -3114,15 +2686,6 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { "linkType": "HARD"\ }]\ ]],\ - ["jsonc-parser", [\ - ["npm:3.2.0", {\ - "packageLocation": "./.yarn/cache/jsonc-parser-npm-3.2.0-1896ece3b7-946dd9a5f3.zip/node_modules/jsonc-parser/",\ - "packageDependencies": [\ - ["jsonc-parser", "npm:3.2.0"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ ["jszip", [\ ["npm:3.10.1", {\ "packageLocation": "./.yarn/cache/jszip-npm-3.10.1-2862546cfb-abc77bfbe3.zip/node_modules/jszip/",\ @@ -3136,18 +2699,6 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { "linkType": "HARD"\ }]\ ]],\ - ["keytar", [\ - ["npm:7.9.0", {\ - "packageLocation": "./.yarn/unplugged/keytar-npm-7.9.0-682d6e5c1d/node_modules/keytar/",\ - "packageDependencies": [\ - ["keytar", "npm:7.9.0"],\ - ["node-addon-api", "npm:4.3.0"],\ - ["node-gyp", "npm:9.4.0"],\ - ["prebuild-install", "npm:7.1.1"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ ["kind-of", [\ ["npm:6.0.3", {\ "packageLocation": "./.yarn/cache/kind-of-npm-6.0.3-ab15f36220-3ab01e7b1d.zip/node_modules/kind-of/",\ @@ -3157,15 +2708,6 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { "linkType": "HARD"\ }]\ ]],\ - ["leven", [\ - ["npm:3.1.0", {\ - "packageLocation": "./.yarn/cache/leven-npm-3.1.0-b7697736a3-638401d534.zip/node_modules/leven/",\ - "packageDependencies": [\ - ["leven", "npm:3.1.0"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ ["levn", [\ ["npm:0.4.1", {\ "packageLocation": "./.yarn/cache/levn-npm-0.4.1-d183b2d7bb-12c5021c85.zip/node_modules/levn/",\ @@ -3187,16 +2729,6 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { "linkType": "HARD"\ }]\ ]],\ - ["linkify-it", [\ - ["npm:3.0.3", {\ - "packageLocation": "./.yarn/cache/linkify-it-npm-3.0.3-6880fe29c1-31367a4bb7.zip/node_modules/linkify-it/",\ - "packageDependencies": [\ - ["linkify-it", "npm:3.0.3"],\ - ["uc.micro", "npm:1.0.6"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ ["loader-runner", [\ ["npm:4.3.0", {\ "packageLocation": "./.yarn/cache/loader-runner-npm-4.3.0-9ca67df372-a90e00dee9.zip/node_modules/loader-runner/",\ @@ -3292,29 +2824,6 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { "linkType": "HARD"\ }]\ ]],\ - ["markdown-it", [\ - ["npm:12.3.2", {\ - "packageLocation": "./.yarn/cache/markdown-it-npm-12.3.2-6c66b716e8-890555711c.zip/node_modules/markdown-it/",\ - "packageDependencies": [\ - ["markdown-it", "npm:12.3.2"],\ - ["argparse", "npm:2.0.1"],\ - ["entities", "npm:2.1.0"],\ - ["linkify-it", "npm:3.0.3"],\ - ["mdurl", "npm:1.0.1"],\ - ["uc.micro", "npm:1.0.6"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["mdurl", [\ - ["npm:1.0.1", {\ - "packageLocation": "./.yarn/cache/mdurl-npm-1.0.1-054d974269-71731ecba9.zip/node_modules/mdurl/",\ - "packageDependencies": [\ - ["mdurl", "npm:1.0.1"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ ["merge-stream", [\ ["npm:2.0.0", {\ "packageLocation": "./.yarn/cache/merge-stream-npm-2.0.0-2ac83efea5-6fa4dcc8d8.zip/node_modules/merge-stream/",\ @@ -3344,15 +2853,6 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { "linkType": "HARD"\ }]\ ]],\ - ["mime", [\ - ["npm:1.6.0", {\ - "packageLocation": "./.yarn/cache/mime-npm-1.6.0-60ae95038a-fef25e3926.zip/node_modules/mime/",\ - "packageDependencies": [\ - ["mime", "npm:1.6.0"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ ["mime-db", [\ ["npm:1.52.0", {\ "packageLocation": "./.yarn/cache/mime-db-npm-1.52.0-b5371d6fd2-0d99a03585.zip/node_modules/mime-db/",\ @@ -3372,15 +2872,6 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { "linkType": "HARD"\ }]\ ]],\ - ["mimic-response", [\ - ["npm:3.1.0", {\ - "packageLocation": "./.yarn/cache/mimic-response-npm-3.1.0-a4a24b4e96-25739fee32.zip/node_modules/mimic-response/",\ - "packageDependencies": [\ - ["mimic-response", "npm:3.1.0"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ ["minimatch", [\ ["npm:3.1.2", {\ "packageLocation": "./.yarn/cache/minimatch-npm-3.1.2-9405269906-c154e56640.zip/node_modules/minimatch/",\ @@ -3415,15 +2906,6 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { "linkType": "HARD"\ }]\ ]],\ - ["minimist", [\ - ["npm:1.2.8", {\ - "packageLocation": "./.yarn/cache/minimist-npm-1.2.8-d7af7b1dce-75a6d645fb.zip/node_modules/minimist/",\ - "packageDependencies": [\ - ["minimist", "npm:1.2.8"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ ["minipass", [\ ["npm:3.3.6", {\ "packageLocation": "./.yarn/cache/minipass-npm-3.3.6-b8d93a945b-a30d083c80.zip/node_modules/minipass/",\ @@ -3521,15 +3003,6 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { "linkType": "HARD"\ }]\ ]],\ - ["mkdirp-classic", [\ - ["npm:0.5.3", {\ - "packageLocation": "./.yarn/cache/mkdirp-classic-npm-0.5.3-3b5c991910-3f4e088208.zip/node_modules/mkdirp-classic/",\ - "packageDependencies": [\ - ["mkdirp-classic", "npm:0.5.3"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ ["mocha", [\ ["npm:10.2.0", {\ "packageLocation": "./.yarn/cache/mocha-npm-10.2.0-87db25c7c5-406c45eab1.zip/node_modules/mocha/",\ @@ -3576,15 +3049,6 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { "linkType": "HARD"\ }]\ ]],\ - ["mute-stream", [\ - ["npm:0.0.8", {\ - "packageLocation": "./.yarn/cache/mute-stream-npm-0.0.8-489a7d6c2b-ff48d251fc.zip/node_modules/mute-stream/",\ - "packageDependencies": [\ - ["mute-stream", "npm:0.0.8"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ ["nanoid", [\ ["npm:3.3.3", {\ "packageLocation": "./.yarn/cache/nanoid-npm-3.3.3-25d865be84-ada019402a.zip/node_modules/nanoid/",\ @@ -3594,15 +3058,6 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { "linkType": "HARD"\ }]\ ]],\ - ["napi-build-utils", [\ - ["npm:1.0.2", {\ - "packageLocation": "./.yarn/cache/napi-build-utils-npm-1.0.2-892e4bba56-06c14271ee.zip/node_modules/napi-build-utils/",\ - "packageDependencies": [\ - ["napi-build-utils", "npm:1.0.2"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ ["natural-compare", [\ ["npm:1.4.0", {\ "packageLocation": "./.yarn/cache/natural-compare-npm-1.4.0-97b75b362d-23ad088b08.zip/node_modules/natural-compare/",\ @@ -3639,26 +3094,6 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { "linkType": "HARD"\ }]\ ]],\ - ["node-abi", [\ - ["npm:3.47.0", {\ - "packageLocation": "./.yarn/cache/node-abi-npm-3.47.0-9d2a86a633-ff8498dcd4.zip/node_modules/node-abi/",\ - "packageDependencies": [\ - ["node-abi", "npm:3.47.0"],\ - ["semver", "npm:7.5.4"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["node-addon-api", [\ - ["npm:4.3.0", {\ - "packageLocation": "./.yarn/unplugged/node-addon-api-npm-4.3.0-a07a1232df/node_modules/node-addon-api/",\ - "packageDependencies": [\ - ["node-addon-api", "npm:4.3.0"],\ - ["node-gyp", "npm:9.4.0"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ ["node-gyp", [\ ["npm:9.4.0", {\ "packageLocation": "./.yarn/unplugged/node-gyp-npm-9.4.0-ebf5f5573e/node_modules/node-gyp/",\ @@ -3720,25 +3155,6 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { "linkType": "HARD"\ }]\ ]],\ - ["nth-check", [\ - ["npm:2.1.1", {\ - "packageLocation": "./.yarn/cache/nth-check-npm-2.1.1-f97afc8169-5afc3dafcd.zip/node_modules/nth-check/",\ - "packageDependencies": [\ - ["nth-check", "npm:2.1.1"],\ - ["boolbase", "npm:1.0.0"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["object-inspect", [\ - ["npm:1.12.3", {\ - "packageLocation": "./.yarn/cache/object-inspect-npm-1.12.3-1e7d20f5ff-dabfd824d9.zip/node_modules/object-inspect/",\ - "packageDependencies": [\ - ["object-inspect", "npm:1.12.3"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ ["once", [\ ["npm:1.4.0", {\ "packageLocation": "./.yarn/cache/once-npm-1.4.0-ccf03ef07a-cd0a885013.zip/node_modules/once/",\ @@ -3792,54 +3208,37 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { "linkType": "SOFT"\ }]\ ]],\ - ["osmium-solidity-linter", [\ - ["workspace:toolchains/solidity/linter", {\ - "packageLocation": "./toolchains/solidity/linter/",\ + ["osmium-solidity-core", [\ + ["workspace:toolchains/solidity/core", {\ + "packageLocation": "./toolchains/solidity/core/",\ "packageDependencies": [\ - ["osmium-solidity-linter", "workspace:toolchains/solidity/linter"]\ + ["osmium-solidity-core", "workspace:toolchains/solidity/core"]\ ],\ "linkType": "SOFT"\ }]\ ]],\ - ["osmium-solidity-linter-core", [\ - ["workspace:toolchains/solidity/linter/core", {\ - "packageLocation": "./toolchains/solidity/linter/core/",\ + ["osmium-solidity-extension", [\ + ["workspace:toolchains/solidity/extension", {\ + "packageLocation": "./toolchains/solidity/extension/",\ "packageDependencies": [\ - ["osmium-solidity-linter-core", "workspace:toolchains/solidity/linter/core"]\ - ],\ - "linkType": "SOFT"\ - }]\ - ]],\ - ["osmium-solidity-linter-extension", [\ - ["workspace:toolchains/solidity/linter/extension", {\ - "packageLocation": "./toolchains/solidity/linter/extension/",\ - "packageDependencies": [\ - ["osmium-solidity-linter-extension", "workspace:toolchains/solidity/linter/extension"],\ + ["osmium-solidity-extension", "workspace:toolchains/solidity/extension"],\ ["@types/glob", "npm:8.1.0"],\ - ["@types/mocha", "npm:10.0.1"],\ + ["@types/mocha", "npm:10.0.3"],\ ["@types/node", "npm:20.2.5"],\ - ["@types/vscode", "npm:1.82.0"],\ - ["@typescript-eslint/eslint-plugin", "virtual:52255392bc7c855b3a7ca4b9b99f4d75a3b9d689264acbbe839776f76900c0302139aac1239332d2de96876e944fbdfcccf8eb06eedae6162f8c837cb3407ca8#npm:5.62.0"],\ - ["@typescript-eslint/parser", "virtual:52255392bc7c855b3a7ca4b9b99f4d75a3b9d689264acbbe839776f76900c0302139aac1239332d2de96876e944fbdfcccf8eb06eedae6162f8c837cb3407ca8#npm:5.62.0"],\ - ["@vscode/test-electron", "npm:2.3.4"],\ - ["@vscode/vsce", "npm:2.21.1"],\ - ["eslint", "npm:8.49.0"],\ + ["@types/vscode", "npm:1.83.1"],\ + ["@typescript-eslint/eslint-plugin", "virtual:2b9e7e7d573ed38308251d9cfa9bcac1c01394d20ff25d4a07b4a0345be370b65803551137c4363442bf76c7d6f9363387c180207a65457c6616ca7fd9b2a56b#npm:5.62.0"],\ + ["@typescript-eslint/parser", "virtual:2b9e7e7d573ed38308251d9cfa9bcac1c01394d20ff25d4a07b4a0345be370b65803551137c4363442bf76c7d6f9363387c180207a65457c6616ca7fd9b2a56b#npm:5.62.0"],\ + ["@vscode/test-electron", "npm:2.3.5"],\ + ["eslint", "npm:8.51.0"],\ ["glob", "npm:8.1.0"],\ ["mocha", "npm:10.2.0"],\ - ["ts-loader", "virtual:52255392bc7c855b3a7ca4b9b99f4d75a3b9d689264acbbe839776f76900c0302139aac1239332d2de96876e944fbdfcccf8eb06eedae6162f8c837cb3407ca8#npm:9.4.4"],\ + ["ts-loader", "virtual:2b9e7e7d573ed38308251d9cfa9bcac1c01394d20ff25d4a07b4a0345be370b65803551137c4363442bf76c7d6f9363387c180207a65457c6616ca7fd9b2a56b#npm:9.5.0"],\ ["typescript", "patch:typescript@npm%3A5.2.2#~builtin::version=5.2.2&hash=f3b441"],\ ["vscode-languageclient", "npm:8.1.0"],\ - ["webpack", "virtual:52255392bc7c855b3a7ca4b9b99f4d75a3b9d689264acbbe839776f76900c0302139aac1239332d2de96876e944fbdfcccf8eb06eedae6162f8c837cb3407ca8#npm:5.88.2"],\ - ["webpack-cli", "virtual:52255392bc7c855b3a7ca4b9b99f4d75a3b9d689264acbbe839776f76900c0302139aac1239332d2de96876e944fbdfcccf8eb06eedae6162f8c837cb3407ca8#npm:5.1.4"]\ - ],\ - "linkType": "SOFT"\ - }]\ - ]],\ - ["osmium-solidity-lsp", [\ - ["workspace:toolchains/solidity/lsp", {\ - "packageLocation": "./toolchains/solidity/lsp/",\ - "packageDependencies": [\ - ["osmium-solidity-lsp", "workspace:toolchains/solidity/lsp"]\ + ["vscode-languageserver", "npm:8.1.0"],\ + ["vscode-languageserver-textdocument", "npm:1.0.11"],\ + ["webpack", "virtual:2b9e7e7d573ed38308251d9cfa9bcac1c01394d20ff25d4a07b4a0345be370b65803551137c4363442bf76c7d6f9363387c180207a65457c6616ca7fd9b2a56b#npm:5.89.0"],\ + ["webpack-cli", "virtual:2b9e7e7d573ed38308251d9cfa9bcac1c01394d20ff25d4a07b4a0345be370b65803551137c4363442bf76c7d6f9363387c180207a65457c6616ca7fd9b2a56b#npm:5.1.4"]\ ],\ "linkType": "SOFT"\ }]\ @@ -3918,37 +3317,6 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { "linkType": "HARD"\ }]\ ]],\ - ["parse-semver", [\ - ["npm:1.1.1", {\ - "packageLocation": "./.yarn/cache/parse-semver-npm-1.1.1-45d28f8138-0a9abc24b8.zip/node_modules/parse-semver/",\ - "packageDependencies": [\ - ["parse-semver", "npm:1.1.1"],\ - ["semver", "npm:5.7.2"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["parse5", [\ - ["npm:7.1.2", {\ - "packageLocation": "./.yarn/cache/parse5-npm-7.1.2-aa9a92c270-59465dd05e.zip/node_modules/parse5/",\ - "packageDependencies": [\ - ["parse5", "npm:7.1.2"],\ - ["entities", "npm:4.5.0"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["parse5-htmlparser2-tree-adapter", [\ - ["npm:7.0.0", {\ - "packageLocation": "./.yarn/cache/parse5-htmlparser2-tree-adapter-npm-7.0.0-38e1b3a974-fc5d01e077.zip/node_modules/parse5-htmlparser2-tree-adapter/",\ - "packageDependencies": [\ - ["parse5-htmlparser2-tree-adapter", "npm:7.0.0"],\ - ["domhandler", "npm:5.0.3"],\ - ["parse5", "npm:7.1.2"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ ["path-exists", [\ ["npm:4.0.0", {\ "packageLocation": "./.yarn/cache/path-exists-npm-4.0.0-e9e4f63eb0-505807199d.zip/node_modules/path-exists/",\ @@ -4005,15 +3373,6 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { "linkType": "HARD"\ }]\ ]],\ - ["pend", [\ - ["npm:1.2.0", {\ - "packageLocation": "./.yarn/cache/pend-npm-1.2.0-7a13d93266-6c72f52433.zip/node_modules/pend/",\ - "packageDependencies": [\ - ["pend", "npm:1.2.0"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ ["picocolors", [\ ["npm:1.0.0", {\ "packageLocation": "./.yarn/cache/picocolors-npm-1.0.0-d81e0b1927-a2e8092dd8.zip/node_modules/picocolors/",\ @@ -4042,27 +3401,6 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { "linkType": "HARD"\ }]\ ]],\ - ["prebuild-install", [\ - ["npm:7.1.1", {\ - "packageLocation": "./.yarn/cache/prebuild-install-npm-7.1.1-cb9fc9d341-dbf96d0146.zip/node_modules/prebuild-install/",\ - "packageDependencies": [\ - ["prebuild-install", "npm:7.1.1"],\ - ["detect-libc", "npm:2.0.2"],\ - ["expand-template", "npm:2.0.3"],\ - ["github-from-package", "npm:0.0.0"],\ - ["minimist", "npm:1.2.8"],\ - ["mkdirp-classic", "npm:0.5.3"],\ - ["napi-build-utils", "npm:1.0.2"],\ - ["node-abi", "npm:3.47.0"],\ - ["pump", "npm:3.0.0"],\ - ["rc", "npm:1.2.8"],\ - ["simple-get", "npm:4.0.1"],\ - ["tar-fs", "npm:2.1.1"],\ - ["tunnel-agent", "npm:0.6.0"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ ["prelude-ls", [\ ["npm:1.2.1", {\ "packageLocation": "./.yarn/cache/prelude-ls-npm-1.2.1-3e4d272a55-cd192ec0d0.zip/node_modules/prelude-ls/",\ @@ -4101,17 +3439,6 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { "linkType": "HARD"\ }]\ ]],\ - ["pump", [\ - ["npm:3.0.0", {\ - "packageLocation": "./.yarn/cache/pump-npm-3.0.0-0080bf6a7a-e42e9229fb.zip/node_modules/pump/",\ - "packageDependencies": [\ - ["pump", "npm:3.0.0"],\ - ["end-of-stream", "npm:1.4.4"],\ - ["once", "npm:1.4.0"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ ["punycode", [\ ["npm:2.3.0", {\ "packageLocation": "./.yarn/cache/punycode-npm-2.3.0-df4bdce06b-39f760e09a.zip/node_modules/punycode/",\ @@ -4121,16 +3448,6 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { "linkType": "HARD"\ }]\ ]],\ - ["qs", [\ - ["npm:6.11.2", {\ - "packageLocation": "./.yarn/cache/qs-npm-6.11.2-b118bc1c6f-e812f3c590.zip/node_modules/qs/",\ - "packageDependencies": [\ - ["qs", "npm:6.11.2"],\ - ["side-channel", "npm:1.0.4"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ ["queue-microtask", [\ ["npm:1.2.3", {\ "packageLocation": "./.yarn/cache/queue-microtask-npm-1.2.3-fcc98e4e2d-b676f8c040.zip/node_modules/queue-microtask/",\ @@ -4150,29 +3467,6 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { "linkType": "HARD"\ }]\ ]],\ - ["rc", [\ - ["npm:1.2.8", {\ - "packageLocation": "./.yarn/cache/rc-npm-1.2.8-d6768ac936-2e26e052f8.zip/node_modules/rc/",\ - "packageDependencies": [\ - ["rc", "npm:1.2.8"],\ - ["deep-extend", "npm:0.6.0"],\ - ["ini", "npm:1.3.8"],\ - ["minimist", "npm:1.2.8"],\ - ["strip-json-comments", "npm:2.0.1"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["read", [\ - ["npm:1.0.7", {\ - "packageLocation": "./.yarn/cache/read-npm-1.0.7-950ec74ca8-2777c254e5.zip/node_modules/read/",\ - "packageDependencies": [\ - ["read", "npm:1.0.7"],\ - ["mute-stream", "npm:0.0.8"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ ["readable-stream", [\ ["npm:2.3.8", {\ "packageLocation": "./.yarn/cache/readable-stream-npm-2.3.8-67a94c2cb1-6564546703.zip/node_modules/readable-stream/",\ @@ -4214,7 +3508,7 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { "packageLocation": "./.yarn/cache/rechoir-npm-0.8.0-fb660b3bc8-ad3caed8af.zip/node_modules/rechoir/",\ "packageDependencies": [\ ["rechoir", "npm:0.8.0"],\ - ["resolve", "patch:resolve@npm%3A1.22.4#~builtin::version=1.22.4&hash=c3c19d"]\ + ["resolve", "patch:resolve@npm%3A1.22.8#~builtin::version=1.22.8&hash=c3c19d"]\ ],\ "linkType": "HARD"\ }]\ @@ -4229,10 +3523,10 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { }]\ ]],\ ["resolve", [\ - ["patch:resolve@npm%3A1.22.4#~builtin::version=1.22.4&hash=c3c19d", {\ - "packageLocation": "./.yarn/cache/resolve-patch-efbbaf0edd-c45f2545fd.zip/node_modules/resolve/",\ + ["patch:resolve@npm%3A1.22.8#~builtin::version=1.22.8&hash=c3c19d", {\ + "packageLocation": "./.yarn/cache/resolve-patch-6603eace77-5479b7d431.zip/node_modules/resolve/",\ "packageDependencies": [\ - ["resolve", "patch:resolve@npm%3A1.22.4#~builtin::version=1.22.4&hash=c3c19d"],\ + ["resolve", "patch:resolve@npm%3A1.22.8#~builtin::version=1.22.8&hash=c3c19d"],\ ["is-core-module", "npm:2.13.0"],\ ["path-parse", "npm:1.0.7"],\ ["supports-preserve-symlinks-flag", "npm:1.0.0"]\ @@ -4329,21 +3623,12 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { "linkType": "HARD"\ }]\ ]],\ - ["sax", [\ - ["npm:1.3.0", {\ - "packageLocation": "./.yarn/cache/sax-npm-1.3.0-e6c479267f-238ab3a9ba.zip/node_modules/sax/",\ - "packageDependencies": [\ - ["sax", "npm:1.3.0"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ ["schema-utils", [\ ["npm:3.3.0", {\ "packageLocation": "./.yarn/cache/schema-utils-npm-3.3.0-f2b36937f1-ea56971926.zip/node_modules/schema-utils/",\ "packageDependencies": [\ ["schema-utils", "npm:3.3.0"],\ - ["@types/json-schema", "npm:7.0.12"],\ + ["@types/json-schema", "npm:7.0.14"],\ ["ajv", "npm:6.12.6"],\ ["ajv-keywords", "virtual:f2b36937f163b579815d3163513b3330d7a31aaf0599eea66346382b8838395c613f4204e9809cc2ff6bba09c17ab0c34b37deadcb147de7e2f5e535d6ccc245#npm:3.5.2"]\ ],\ @@ -4351,13 +3636,6 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { }]\ ]],\ ["semver", [\ - ["npm:5.7.2", {\ - "packageLocation": "./.yarn/cache/semver-npm-5.7.2-938ee91eaa-fb4ab5e0dd.zip/node_modules/semver/",\ - "packageDependencies": [\ - ["semver", "npm:5.7.2"]\ - ],\ - "linkType": "HARD"\ - }],\ ["npm:7.5.4", {\ "packageLocation": "./.yarn/cache/semver-npm-7.5.4-c4ad957fcd-12d8ad952f.zip/node_modules/semver/",\ "packageDependencies": [\ @@ -4432,18 +3710,6 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { "linkType": "HARD"\ }]\ ]],\ - ["side-channel", [\ - ["npm:1.0.4", {\ - "packageLocation": "./.yarn/cache/side-channel-npm-1.0.4-e1f38b9e06-351e41b947.zip/node_modules/side-channel/",\ - "packageDependencies": [\ - ["side-channel", "npm:1.0.4"],\ - ["call-bind", "npm:1.0.2"],\ - ["get-intrinsic", "npm:1.2.1"],\ - ["object-inspect", "npm:1.12.3"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ ["signal-exit", [\ ["npm:3.0.7", {\ "packageLocation": "./.yarn/cache/signal-exit-npm-3.0.7-bd270458a3-a2f098f247.zip/node_modules/signal-exit/",\ @@ -4460,27 +3726,6 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { "linkType": "HARD"\ }]\ ]],\ - ["simple-concat", [\ - ["npm:1.0.1", {\ - "packageLocation": "./.yarn/cache/simple-concat-npm-1.0.1-48df70de29-4d211042cc.zip/node_modules/simple-concat/",\ - "packageDependencies": [\ - ["simple-concat", "npm:1.0.1"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["simple-get", [\ - ["npm:4.0.1", {\ - "packageLocation": "./.yarn/cache/simple-get-npm-4.0.1-fa2a97645d-e4132fd27c.zip/node_modules/simple-get/",\ - "packageDependencies": [\ - ["simple-get", "npm:4.0.1"],\ - ["decompress-response", "npm:6.0.0"],\ - ["once", "npm:1.4.0"],\ - ["simple-concat", "npm:1.0.1"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ ["slash", [\ ["npm:3.0.0", {\ "packageLocation": "./.yarn/cache/slash-npm-3.0.0-b87de2279a-94a93fff61.zip/node_modules/slash/",\ @@ -4529,6 +3774,13 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { ["source-map", "npm:0.6.1"]\ ],\ "linkType": "HARD"\ + }],\ + ["npm:0.7.4", {\ + "packageLocation": "./.yarn/cache/source-map-npm-0.7.4-bc8d018ab6-01cc5a74b1.zip/node_modules/source-map/",\ + "packageDependencies": [\ + ["source-map", "npm:0.7.4"]\ + ],\ + "linkType": "HARD"\ }]\ ]],\ ["source-map-support", [\ @@ -4611,13 +3863,6 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { }]\ ]],\ ["strip-json-comments", [\ - ["npm:2.0.1", {\ - "packageLocation": "./.yarn/cache/strip-json-comments-npm-2.0.1-e7883b2d04-1074ccb632.zip/node_modules/strip-json-comments/",\ - "packageDependencies": [\ - ["strip-json-comments", "npm:2.0.1"]\ - ],\ - "linkType": "HARD"\ - }],\ ["npm:3.1.1", {\ "packageLocation": "./.yarn/cache/strip-json-comments-npm-3.1.1-dcb2324823-492f73e272.zip/node_modules/strip-json-comments/",\ "packageDependencies": [\ @@ -4627,14 +3872,6 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { }]\ ]],\ ["supports-color", [\ - ["npm:5.5.0", {\ - "packageLocation": "./.yarn/cache/supports-color-npm-5.5.0-183ac537bc-95f6f4ba5a.zip/node_modules/supports-color/",\ - "packageDependencies": [\ - ["supports-color", "npm:5.5.0"],\ - ["has-flag", "npm:3.0.0"]\ - ],\ - "linkType": "HARD"\ - }],\ ["npm:7.2.0", {\ "packageLocation": "./.yarn/cache/supports-color-npm-7.2.0-606bfcf7da-3dda818de0.zip/node_modules/supports-color/",\ "packageDependencies": [\ @@ -4685,38 +3922,11 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { "linkType": "HARD"\ }]\ ]],\ - ["tar-fs", [\ - ["npm:2.1.1", {\ - "packageLocation": "./.yarn/cache/tar-fs-npm-2.1.1-e374d3b7a2-f5b9a70059.zip/node_modules/tar-fs/",\ - "packageDependencies": [\ - ["tar-fs", "npm:2.1.1"],\ - ["chownr", "npm:1.1.4"],\ - ["mkdirp-classic", "npm:0.5.3"],\ - ["pump", "npm:3.0.0"],\ - ["tar-stream", "npm:2.2.0"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["tar-stream", [\ - ["npm:2.2.0", {\ - "packageLocation": "./.yarn/cache/tar-stream-npm-2.2.0-884c79b510-699831a8b9.zip/node_modules/tar-stream/",\ - "packageDependencies": [\ - ["tar-stream", "npm:2.2.0"],\ - ["bl", "npm:4.1.0"],\ - ["end-of-stream", "npm:1.4.4"],\ - ["fs-constants", "npm:1.0.0"],\ - ["inherits", "npm:2.0.4"],\ - ["readable-stream", "npm:3.6.2"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ ["terser", [\ - ["npm:5.19.4", {\ - "packageLocation": "./.yarn/cache/terser-npm-5.19.4-0504dfe160-09273ce7d3.zip/node_modules/terser/",\ + ["npm:5.22.0", {\ + "packageLocation": "./.yarn/cache/terser-npm-5.22.0-e83cb45628-ee95981c54.zip/node_modules/terser/",\ "packageDependencies": [\ - ["terser", "npm:5.19.4"],\ + ["terser", "npm:5.22.0"],\ ["@jridgewell/source-map", "npm:0.3.5"],\ ["acorn", "npm:8.10.0"],\ ["commander", "npm:2.20.3"],\ @@ -4733,11 +3943,11 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { ],\ "linkType": "SOFT"\ }],\ - ["virtual:d9c05c4f9709e030529533d0ddfe05c0b547bb7476ef97252e4dbbccaae19c175fe286f7789e966bfc4890744043e3ec1e1e7c75b4e24776bd07cbed32cd0806#npm:5.3.9", {\ - "packageLocation": "./.yarn/__virtual__/terser-webpack-plugin-virtual-0de9129109/0/cache/terser-webpack-plugin-npm-5.3.9-7ba1eb45f4-41705713d6.zip/node_modules/terser-webpack-plugin/",\ + ["virtual:b98590e6182f1e3e809675a880704d2c50533e40386e60683f5d6ae6206f5e5e58cf33b625935351b9a4ef2066acd33ce7f25a0d7055a7a23f1ec398f2c56b3f#npm:5.3.9", {\ + "packageLocation": "./.yarn/__virtual__/terser-webpack-plugin-virtual-09deebe1a1/0/cache/terser-webpack-plugin-npm-5.3.9-7ba1eb45f4-41705713d6.zip/node_modules/terser-webpack-plugin/",\ "packageDependencies": [\ - ["terser-webpack-plugin", "virtual:d9c05c4f9709e030529533d0ddfe05c0b547bb7476ef97252e4dbbccaae19c175fe286f7789e966bfc4890744043e3ec1e1e7c75b4e24776bd07cbed32cd0806#npm:5.3.9"],\ - ["@jridgewell/trace-mapping", "npm:0.3.19"],\ + ["terser-webpack-plugin", "virtual:b98590e6182f1e3e809675a880704d2c50533e40386e60683f5d6ae6206f5e5e58cf33b625935351b9a4ef2066acd33ce7f25a0d7055a7a23f1ec398f2c56b3f#npm:5.3.9"],\ + ["@jridgewell/trace-mapping", "npm:0.3.20"],\ ["@swc/core", null],\ ["@types/esbuild", null],\ ["@types/swc__core", null],\ @@ -4747,9 +3957,9 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { ["jest-worker", "npm:27.5.1"],\ ["schema-utils", "npm:3.3.0"],\ ["serialize-javascript", "npm:6.0.1"],\ - ["terser", "npm:5.19.4"],\ + ["terser", "npm:5.22.0"],\ ["uglify-js", null],\ - ["webpack", "virtual:52255392bc7c855b3a7ca4b9b99f4d75a3b9d689264acbbe839776f76900c0302139aac1239332d2de96876e944fbdfcccf8eb06eedae6162f8c837cb3407ca8#npm:5.88.2"]\ + ["webpack", "virtual:2b9e7e7d573ed38308251d9cfa9bcac1c01394d20ff25d4a07b4a0345be370b65803551137c4363442bf76c7d6f9363387c180207a65457c6616ca7fd9b2a56b#npm:5.89.0"]\ ],\ "packagePeers": [\ "@swc/core",\ @@ -4773,16 +3983,6 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { "linkType": "HARD"\ }]\ ]],\ - ["tmp", [\ - ["npm:0.2.1", {\ - "packageLocation": "./.yarn/cache/tmp-npm-0.2.1-a9c8d9c0ca-8b12146541.zip/node_modules/tmp/",\ - "packageDependencies": [\ - ["tmp", "npm:0.2.1"],\ - ["rimraf", "npm:3.0.2"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ ["to-regex-range", [\ ["npm:5.0.1", {\ "packageLocation": "./.yarn/cache/to-regex-range-npm-5.0.1-f1e8263b00-f76fa01b3d.zip/node_modules/to-regex-range/",\ @@ -4794,25 +3994,26 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { }]\ ]],\ ["ts-loader", [\ - ["npm:9.4.4", {\ - "packageLocation": "./.yarn/cache/ts-loader-npm-9.4.4-f7a7993559-8e5e6b839b.zip/node_modules/ts-loader/",\ + ["npm:9.5.0", {\ + "packageLocation": "./.yarn/cache/ts-loader-npm-9.5.0-9514617263-a319575faa.zip/node_modules/ts-loader/",\ "packageDependencies": [\ - ["ts-loader", "npm:9.4.4"]\ + ["ts-loader", "npm:9.5.0"]\ ],\ "linkType": "SOFT"\ }],\ - ["virtual:52255392bc7c855b3a7ca4b9b99f4d75a3b9d689264acbbe839776f76900c0302139aac1239332d2de96876e944fbdfcccf8eb06eedae6162f8c837cb3407ca8#npm:9.4.4", {\ - "packageLocation": "./.yarn/__virtual__/ts-loader-virtual-692e2115b3/0/cache/ts-loader-npm-9.4.4-f7a7993559-8e5e6b839b.zip/node_modules/ts-loader/",\ + ["virtual:2b9e7e7d573ed38308251d9cfa9bcac1c01394d20ff25d4a07b4a0345be370b65803551137c4363442bf76c7d6f9363387c180207a65457c6616ca7fd9b2a56b#npm:9.5.0", {\ + "packageLocation": "./.yarn/__virtual__/ts-loader-virtual-08d411a35a/0/cache/ts-loader-npm-9.5.0-9514617263-a319575faa.zip/node_modules/ts-loader/",\ "packageDependencies": [\ - ["ts-loader", "virtual:52255392bc7c855b3a7ca4b9b99f4d75a3b9d689264acbbe839776f76900c0302139aac1239332d2de96876e944fbdfcccf8eb06eedae6162f8c837cb3407ca8#npm:9.4.4"],\ + ["ts-loader", "virtual:2b9e7e7d573ed38308251d9cfa9bcac1c01394d20ff25d4a07b4a0345be370b65803551137c4363442bf76c7d6f9363387c180207a65457c6616ca7fd9b2a56b#npm:9.5.0"],\ ["@types/typescript", null],\ ["@types/webpack", null],\ ["chalk", "npm:4.1.2"],\ ["enhanced-resolve", "npm:5.15.0"],\ ["micromatch", "npm:4.0.5"],\ ["semver", "npm:7.5.4"],\ + ["source-map", "npm:0.7.4"],\ ["typescript", "patch:typescript@npm%3A5.2.2#~builtin::version=5.2.2&hash=f3b441"],\ - ["webpack", "virtual:52255392bc7c855b3a7ca4b9b99f4d75a3b9d689264acbbe839776f76900c0302139aac1239332d2de96876e944fbdfcccf8eb06eedae6162f8c837cb3407ca8#npm:5.88.2"]\ + ["webpack", "virtual:2b9e7e7d573ed38308251d9cfa9bcac1c01394d20ff25d4a07b4a0345be370b65803551137c4363442bf76c7d6f9363387c180207a65457c6616ca7fd9b2a56b#npm:5.89.0"]\ ],\ "packagePeers": [\ "@types/typescript",\ @@ -4840,10 +4041,10 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { ],\ "linkType": "SOFT"\ }],\ - ["virtual:1836c4b55e4791907b99a91792908a4e565ff351d6fe50457374c8344922cbd89593d0c9abd7d0ccd312021e4d197b4bea65df32526c387593eb4df73ba12425#npm:3.21.0", {\ - "packageLocation": "./.yarn/__virtual__/tsutils-virtual-d01ee2c6e7/0/cache/tsutils-npm-3.21.0-347e6636c5-1843f4c1b2.zip/node_modules/tsutils/",\ + ["virtual:1272cbed28ba43154b1f70b1b9ccc5d5d4f0e0ea66cdbcdc34cdd20ac1a5aa8be13d64ab87eae1341f94e5df93a4932087a80587415043f9c7312b1f619267f4#npm:3.21.0", {\ + "packageLocation": "./.yarn/__virtual__/tsutils-virtual-5e32ddb4dd/0/cache/tsutils-npm-3.21.0-347e6636c5-1843f4c1b2.zip/node_modules/tsutils/",\ "packageDependencies": [\ - ["tsutils", "virtual:1836c4b55e4791907b99a91792908a4e565ff351d6fe50457374c8344922cbd89593d0c9abd7d0ccd312021e4d197b4bea65df32526c387593eb4df73ba12425#npm:3.21.0"],\ + ["tsutils", "virtual:1272cbed28ba43154b1f70b1b9ccc5d5d4f0e0ea66cdbcdc34cdd20ac1a5aa8be13d64ab87eae1341f94e5df93a4932087a80587415043f9c7312b1f619267f4#npm:3.21.0"],\ ["@types/typescript", null],\ ["tslib", "npm:1.14.1"],\ ["typescript", null]\ @@ -4854,10 +4055,10 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { ],\ "linkType": "HARD"\ }],\ - ["virtual:886143a71dbd16c7dff857b41f76376562a0e00b73297c242842020b27304f674219cf3e7b9cfd86b31a507d7d2502a83c34027c7ed5757aa6c9457392679a04#npm:3.21.0", {\ - "packageLocation": "./.yarn/__virtual__/tsutils-virtual-6fd84bff07/0/cache/tsutils-npm-3.21.0-347e6636c5-1843f4c1b2.zip/node_modules/tsutils/",\ + ["virtual:89014fb2f72da20eb87d54c80bac37610b57a73485dee5ebf9333bf5c4bce0d972953cbf0f48420b275d3bc40f36aded8d47d2d24281f85e903e5d354ec64e4e#npm:3.21.0", {\ + "packageLocation": "./.yarn/__virtual__/tsutils-virtual-b857208b27/0/cache/tsutils-npm-3.21.0-347e6636c5-1843f4c1b2.zip/node_modules/tsutils/",\ "packageDependencies": [\ - ["tsutils", "virtual:886143a71dbd16c7dff857b41f76376562a0e00b73297c242842020b27304f674219cf3e7b9cfd86b31a507d7d2502a83c34027c7ed5757aa6c9457392679a04#npm:3.21.0"],\ + ["tsutils", "virtual:89014fb2f72da20eb87d54c80bac37610b57a73485dee5ebf9333bf5c4bce0d972953cbf0f48420b275d3bc40f36aded8d47d2d24281f85e903e5d354ec64e4e#npm:3.21.0"],\ ["@types/typescript", null],\ ["tslib", "npm:1.14.1"],\ ["typescript", "patch:typescript@npm%3A5.2.2#~builtin::version=5.2.2&hash=f3b441"]\ @@ -4869,25 +4070,6 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { "linkType": "HARD"\ }]\ ]],\ - ["tunnel", [\ - ["npm:0.0.6", {\ - "packageLocation": "./.yarn/cache/tunnel-npm-0.0.6-b1c0830ea4-c362948df9.zip/node_modules/tunnel/",\ - "packageDependencies": [\ - ["tunnel", "npm:0.0.6"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["tunnel-agent", [\ - ["npm:0.6.0", {\ - "packageLocation": "./.yarn/cache/tunnel-agent-npm-0.6.0-64345ab7eb-05f6510358.zip/node_modules/tunnel-agent/",\ - "packageDependencies": [\ - ["tunnel-agent", "npm:0.6.0"],\ - ["safe-buffer", "npm:5.2.1"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ ["type-check", [\ ["npm:0.4.0", {\ "packageLocation": "./.yarn/cache/type-check-npm-0.4.0-60565800ce-ec688ebfc9.zip/node_modules/type-check/",\ @@ -4907,18 +4089,6 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { "linkType": "HARD"\ }]\ ]],\ - ["typed-rest-client", [\ - ["npm:1.8.11", {\ - "packageLocation": "./.yarn/cache/typed-rest-client-npm-1.8.11-7be28960b2-baba878063.zip/node_modules/typed-rest-client/",\ - "packageDependencies": [\ - ["typed-rest-client", "npm:1.8.11"],\ - ["qs", "npm:6.11.2"],\ - ["tunnel", "npm:0.0.6"],\ - ["underscore", "npm:1.13.6"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ ["typescript", [\ ["patch:typescript@npm%3A5.2.2#~builtin::version=5.2.2&hash=f3b441", {\ "packageLocation": "./.yarn/cache/typescript-patch-2e8dbfb8ab-0f4da2f15e.zip/node_modules/typescript/",\ @@ -4928,20 +4098,11 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { "linkType": "HARD"\ }]\ ]],\ - ["uc.micro", [\ - ["npm:1.0.6", {\ - "packageLocation": "./.yarn/cache/uc.micro-npm-1.0.6-36f3dc2fc4-6898bb5563.zip/node_modules/uc.micro/",\ - "packageDependencies": [\ - ["uc.micro", "npm:1.0.6"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["underscore", [\ - ["npm:1.13.6", {\ - "packageLocation": "./.yarn/cache/underscore-npm-1.13.6-3ebe9d92fb-d5cedd14a9.zip/node_modules/underscore/",\ + ["undici-types", [\ + ["npm:5.25.3", {\ + "packageLocation": "./.yarn/cache/undici-types-npm-5.25.3-2ac9eafc9e-ec9d2cc365.zip/node_modules/undici-types/",\ "packageDependencies": [\ - ["underscore", "npm:1.13.6"]\ + ["undici-types", "npm:5.25.3"]\ ],\ "linkType": "HARD"\ }]\ @@ -4967,19 +4128,19 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { }]\ ]],\ ["update-browserslist-db", [\ - ["npm:1.0.11", {\ - "packageLocation": "./.yarn/cache/update-browserslist-db-npm-1.0.11-2c8e64258f-b98327518f.zip/node_modules/update-browserslist-db/",\ + ["npm:1.0.13", {\ + "packageLocation": "./.yarn/cache/update-browserslist-db-npm-1.0.13-ea7b8ee24d-1e47d80182.zip/node_modules/update-browserslist-db/",\ "packageDependencies": [\ - ["update-browserslist-db", "npm:1.0.11"]\ + ["update-browserslist-db", "npm:1.0.13"]\ ],\ "linkType": "SOFT"\ }],\ - ["virtual:e2170a875bba2f8fa9e93e47c65f2f250097e101a59d95ea6fd852f32965e8cd6cef3b5662aa7295279d5bc60c9a612ddb8515c7dd1b7e8fb9984dee1823e7d6#npm:1.0.11", {\ - "packageLocation": "./.yarn/__virtual__/update-browserslist-db-virtual-e6fb63e03d/0/cache/update-browserslist-db-npm-1.0.11-2c8e64258f-b98327518f.zip/node_modules/update-browserslist-db/",\ + ["virtual:cccae6d74e613cbaceb4c608cb01004dea3f5ca235673f5c541d60f516ef320907d258256abf63eac9b8704e23cf5d52eb19f2a57a07471accc943ea645de308#npm:1.0.13", {\ + "packageLocation": "./.yarn/__virtual__/update-browserslist-db-virtual-1935275eaa/0/cache/update-browserslist-db-npm-1.0.13-ea7b8ee24d-1e47d80182.zip/node_modules/update-browserslist-db/",\ "packageDependencies": [\ - ["update-browserslist-db", "virtual:e2170a875bba2f8fa9e93e47c65f2f250097e101a59d95ea6fd852f32965e8cd6cef3b5662aa7295279d5bc60c9a612ddb8515c7dd1b7e8fb9984dee1823e7d6#npm:1.0.11"],\ + ["update-browserslist-db", "virtual:cccae6d74e613cbaceb4c608cb01004dea3f5ca235673f5c541d60f516ef320907d258256abf63eac9b8704e23cf5d52eb19f2a57a07471accc943ea645de308#npm:1.0.13"],\ ["@types/browserslist", null],\ - ["browserslist", "npm:4.21.10"],\ + ["browserslist", "npm:4.22.1"],\ ["escalade", "npm:3.1.1"],\ ["picocolors", "npm:1.0.0"]\ ],\ @@ -5000,15 +4161,6 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { "linkType": "HARD"\ }]\ ]],\ - ["url-join", [\ - ["npm:4.0.1", {\ - "packageLocation": "./.yarn/cache/url-join-npm-4.0.1-e1f4415722-f74e868bf2.zip/node_modules/url-join/",\ - "packageDependencies": [\ - ["url-join", "npm:4.0.1"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ ["util-deprecate", [\ ["npm:1.0.2", {\ "packageLocation": "./.yarn/cache/util-deprecate-npm-1.0.2-e3fe1a219c-474acf1146.zip/node_modules/util-deprecate/",\ @@ -5039,6 +4191,16 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { "linkType": "HARD"\ }]\ ]],\ + ["vscode-languageserver", [\ + ["npm:8.1.0", {\ + "packageLocation": "./.yarn/cache/vscode-languageserver-npm-8.1.0-baf13ef83a-38810619d0.zip/node_modules/vscode-languageserver/",\ + "packageDependencies": [\ + ["vscode-languageserver", "npm:8.1.0"],\ + ["vscode-languageserver-protocol", "npm:3.17.3"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ ["vscode-languageserver-protocol", [\ ["npm:3.17.3", {\ "packageLocation": "./.yarn/cache/vscode-languageserver-protocol-npm-3.17.3-3c0373c95b-ffea508b2e.zip/node_modules/vscode-languageserver-protocol/",\ @@ -5050,6 +4212,15 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { "linkType": "HARD"\ }]\ ]],\ + ["vscode-languageserver-textdocument", [\ + ["npm:1.0.11", {\ + "packageLocation": "./.yarn/cache/vscode-languageserver-textdocument-npm-1.0.11-6fc94d2b7b-ea7cdc9d4f.zip/node_modules/vscode-languageserver-textdocument/",\ + "packageDependencies": [\ + ["vscode-languageserver-textdocument", "npm:1.0.11"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ ["vscode-languageserver-types", [\ ["npm:3.17.3", {\ "packageLocation": "./.yarn/cache/vscode-languageserver-types-npm-3.17.3-2fde4bb32b-fbc8221297.zip/node_modules/vscode-languageserver-types/",\ @@ -5071,29 +4242,29 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { }]\ ]],\ ["webpack", [\ - ["npm:5.88.2", {\ - "packageLocation": "./.yarn/cache/webpack-npm-5.88.2-38717ace6f-79476a782d.zip/node_modules/webpack/",\ + ["npm:5.89.0", {\ + "packageLocation": "./.yarn/cache/webpack-npm-5.89.0-3800e9efd0-43fe0dbc30.zip/node_modules/webpack/",\ "packageDependencies": [\ - ["webpack", "npm:5.88.2"]\ + ["webpack", "npm:5.89.0"]\ ],\ "linkType": "SOFT"\ }],\ - ["virtual:52255392bc7c855b3a7ca4b9b99f4d75a3b9d689264acbbe839776f76900c0302139aac1239332d2de96876e944fbdfcccf8eb06eedae6162f8c837cb3407ca8#npm:5.88.2", {\ - "packageLocation": "./.yarn/__virtual__/webpack-virtual-d9c05c4f97/0/cache/webpack-npm-5.88.2-38717ace6f-79476a782d.zip/node_modules/webpack/",\ + ["virtual:2b9e7e7d573ed38308251d9cfa9bcac1c01394d20ff25d4a07b4a0345be370b65803551137c4363442bf76c7d6f9363387c180207a65457c6616ca7fd9b2a56b#npm:5.89.0", {\ + "packageLocation": "./.yarn/__virtual__/webpack-virtual-b98590e618/0/cache/webpack-npm-5.89.0-3800e9efd0-43fe0dbc30.zip/node_modules/webpack/",\ "packageDependencies": [\ - ["webpack", "virtual:52255392bc7c855b3a7ca4b9b99f4d75a3b9d689264acbbe839776f76900c0302139aac1239332d2de96876e944fbdfcccf8eb06eedae6162f8c837cb3407ca8#npm:5.88.2"],\ - ["@types/eslint-scope", "npm:3.7.4"],\ - ["@types/estree", "npm:1.0.1"],\ + ["webpack", "virtual:2b9e7e7d573ed38308251d9cfa9bcac1c01394d20ff25d4a07b4a0345be370b65803551137c4363442bf76c7d6f9363387c180207a65457c6616ca7fd9b2a56b#npm:5.89.0"],\ + ["@types/eslint-scope", "npm:3.7.6"],\ + ["@types/estree", "npm:1.0.3"],\ ["@types/webpack-cli", null],\ ["@webassemblyjs/ast", "npm:1.11.6"],\ ["@webassemblyjs/wasm-edit", "npm:1.11.6"],\ ["@webassemblyjs/wasm-parser", "npm:1.11.6"],\ ["acorn", "npm:8.10.0"],\ - ["acorn-import-assertions", "virtual:d9c05c4f9709e030529533d0ddfe05c0b547bb7476ef97252e4dbbccaae19c175fe286f7789e966bfc4890744043e3ec1e1e7c75b4e24776bd07cbed32cd0806#npm:1.9.0"],\ - ["browserslist", "npm:4.21.10"],\ + ["acorn-import-assertions", "virtual:b98590e6182f1e3e809675a880704d2c50533e40386e60683f5d6ae6206f5e5e58cf33b625935351b9a4ef2066acd33ce7f25a0d7055a7a23f1ec398f2c56b3f#npm:1.9.0"],\ + ["browserslist", "npm:4.22.1"],\ ["chrome-trace-event", "npm:1.0.3"],\ ["enhanced-resolve", "npm:5.15.0"],\ - ["es-module-lexer", "npm:1.3.0"],\ + ["es-module-lexer", "npm:1.3.1"],\ ["eslint-scope", "npm:5.1.1"],\ ["events", "npm:3.3.0"],\ ["glob-to-regexp", "npm:0.4.1"],\ @@ -5104,9 +4275,9 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { ["neo-async", "npm:2.6.2"],\ ["schema-utils", "npm:3.3.0"],\ ["tapable", "npm:2.2.1"],\ - ["terser-webpack-plugin", "virtual:d9c05c4f9709e030529533d0ddfe05c0b547bb7476ef97252e4dbbccaae19c175fe286f7789e966bfc4890744043e3ec1e1e7c75b4e24776bd07cbed32cd0806#npm:5.3.9"],\ + ["terser-webpack-plugin", "virtual:b98590e6182f1e3e809675a880704d2c50533e40386e60683f5d6ae6206f5e5e58cf33b625935351b9a4ef2066acd33ce7f25a0d7055a7a23f1ec398f2c56b3f#npm:5.3.9"],\ ["watchpack", "npm:2.4.0"],\ - ["webpack-cli", "virtual:52255392bc7c855b3a7ca4b9b99f4d75a3b9d689264acbbe839776f76900c0302139aac1239332d2de96876e944fbdfcccf8eb06eedae6162f8c837cb3407ca8#npm:5.1.4"],\ + ["webpack-cli", "virtual:2b9e7e7d573ed38308251d9cfa9bcac1c01394d20ff25d4a07b4a0345be370b65803551137c4363442bf76c7d6f9363387c180207a65457c6616ca7fd9b2a56b#npm:5.1.4"],\ ["webpack-sources", "npm:3.2.3"]\ ],\ "packagePeers": [\ @@ -5124,19 +4295,19 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { ],\ "linkType": "SOFT"\ }],\ - ["virtual:52255392bc7c855b3a7ca4b9b99f4d75a3b9d689264acbbe839776f76900c0302139aac1239332d2de96876e944fbdfcccf8eb06eedae6162f8c837cb3407ca8#npm:5.1.4", {\ - "packageLocation": "./.yarn/__virtual__/webpack-cli-virtual-ad701b078c/0/cache/webpack-cli-npm-5.1.4-7be5b53b38-3a4ad0d034.zip/node_modules/webpack-cli/",\ + ["virtual:2b9e7e7d573ed38308251d9cfa9bcac1c01394d20ff25d4a07b4a0345be370b65803551137c4363442bf76c7d6f9363387c180207a65457c6616ca7fd9b2a56b#npm:5.1.4", {\ + "packageLocation": "./.yarn/__virtual__/webpack-cli-virtual-18451f3d8e/0/cache/webpack-cli-npm-5.1.4-7be5b53b38-3a4ad0d034.zip/node_modules/webpack-cli/",\ "packageDependencies": [\ - ["webpack-cli", "virtual:52255392bc7c855b3a7ca4b9b99f4d75a3b9d689264acbbe839776f76900c0302139aac1239332d2de96876e944fbdfcccf8eb06eedae6162f8c837cb3407ca8#npm:5.1.4"],\ + ["webpack-cli", "virtual:2b9e7e7d573ed38308251d9cfa9bcac1c01394d20ff25d4a07b4a0345be370b65803551137c4363442bf76c7d6f9363387c180207a65457c6616ca7fd9b2a56b#npm:5.1.4"],\ ["@discoveryjs/json-ext", "npm:0.5.7"],\ ["@types/webpack", null],\ ["@types/webpack-bundle-analyzer", null],\ ["@types/webpack-cli__generators", null],\ ["@types/webpack-dev-server", null],\ - ["@webpack-cli/configtest", "virtual:ad701b078cc2408c5791666f6d120096fd9f1cd66f63c26aaf307312ac91fee8153bad89ca107dc1f4886c4e5ab34def89b17331043d75175a43c752a58a41c5#npm:2.1.1"],\ + ["@webpack-cli/configtest", "virtual:18451f3d8e5dacbf26b98823a0220f7b3f28daca71aa13b5ae585b8cdfc3a8ac3080a26c1c965a6c95afb7ef7c053188674829161ad475a0246dbc7ad48bc72c#npm:2.1.1"],\ ["@webpack-cli/generators", null],\ - ["@webpack-cli/info", "virtual:ad701b078cc2408c5791666f6d120096fd9f1cd66f63c26aaf307312ac91fee8153bad89ca107dc1f4886c4e5ab34def89b17331043d75175a43c752a58a41c5#npm:2.0.2"],\ - ["@webpack-cli/serve", "virtual:ad701b078cc2408c5791666f6d120096fd9f1cd66f63c26aaf307312ac91fee8153bad89ca107dc1f4886c4e5ab34def89b17331043d75175a43c752a58a41c5#npm:2.0.5"],\ + ["@webpack-cli/info", "virtual:18451f3d8e5dacbf26b98823a0220f7b3f28daca71aa13b5ae585b8cdfc3a8ac3080a26c1c965a6c95afb7ef7c053188674829161ad475a0246dbc7ad48bc72c#npm:2.0.2"],\ + ["@webpack-cli/serve", "virtual:18451f3d8e5dacbf26b98823a0220f7b3f28daca71aa13b5ae585b8cdfc3a8ac3080a26c1c965a6c95afb7ef7c053188674829161ad475a0246dbc7ad48bc72c#npm:2.0.5"],\ ["colorette", "npm:2.0.20"],\ ["commander", "npm:10.0.1"],\ ["cross-spawn", "npm:7.0.3"],\ @@ -5145,10 +4316,10 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { ["import-local", "npm:3.1.0"],\ ["interpret", "npm:3.1.1"],\ ["rechoir", "npm:0.8.0"],\ - ["webpack", "virtual:52255392bc7c855b3a7ca4b9b99f4d75a3b9d689264acbbe839776f76900c0302139aac1239332d2de96876e944fbdfcccf8eb06eedae6162f8c837cb3407ca8#npm:5.88.2"],\ + ["webpack", "virtual:2b9e7e7d573ed38308251d9cfa9bcac1c01394d20ff25d4a07b4a0345be370b65803551137c4363442bf76c7d6f9363387c180207a65457c6616ca7fd9b2a56b#npm:5.89.0"],\ ["webpack-bundle-analyzer", null],\ ["webpack-dev-server", null],\ - ["webpack-merge", "npm:5.9.0"]\ + ["webpack-merge", "npm:5.10.0"]\ ],\ "packagePeers": [\ "@types/webpack-bundle-analyzer",\ @@ -5164,11 +4335,12 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { }]\ ]],\ ["webpack-merge", [\ - ["npm:5.9.0", {\ - "packageLocation": "./.yarn/cache/webpack-merge-npm-5.9.0-9110e650de-64fe2c23aa.zip/node_modules/webpack-merge/",\ + ["npm:5.10.0", {\ + "packageLocation": "./.yarn/cache/webpack-merge-npm-5.10.0-c2d9fd1f83-1fe8bf5309.zip/node_modules/webpack-merge/",\ "packageDependencies": [\ - ["webpack-merge", "npm:5.9.0"],\ + ["webpack-merge", "npm:5.10.0"],\ ["clone-deep", "npm:4.0.1"],\ + ["flat", "npm:5.0.2"],\ ["wildcard", "npm:2.0.1"]\ ],\ "linkType": "HARD"\ @@ -5252,26 +4424,6 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { "linkType": "HARD"\ }]\ ]],\ - ["xml2js", [\ - ["npm:0.5.0", {\ - "packageLocation": "./.yarn/cache/xml2js-npm-0.5.0-06e57a2771-1aa71d62e5.zip/node_modules/xml2js/",\ - "packageDependencies": [\ - ["xml2js", "npm:0.5.0"],\ - ["sax", "npm:1.3.0"],\ - ["xmlbuilder", "npm:11.0.1"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["xmlbuilder", [\ - ["npm:11.0.1", {\ - "packageLocation": "./.yarn/cache/xmlbuilder-npm-11.0.1-b8b04dc929-7152695e16.zip/node_modules/xmlbuilder/",\ - "packageDependencies": [\ - ["xmlbuilder", "npm:11.0.1"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ ["y18n", [\ ["npm:5.0.8", {\ "packageLocation": "./.yarn/cache/y18n-npm-5.0.8-5f3a0a7e62-54f0fb9562.zip/node_modules/y18n/",\ @@ -5335,27 +4487,6 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { "linkType": "HARD"\ }]\ ]],\ - ["yauzl", [\ - ["npm:2.10.0", {\ - "packageLocation": "./.yarn/cache/yauzl-npm-2.10.0-72e70ea021-7f21fe0bba.zip/node_modules/yauzl/",\ - "packageDependencies": [\ - ["yauzl", "npm:2.10.0"],\ - ["buffer-crc32", "npm:0.2.13"],\ - ["fd-slicer", "npm:1.1.0"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["yazl", [\ - ["npm:2.5.1", {\ - "packageLocation": "./.yarn/cache/yazl-npm-2.5.1-07fc697bef-daec5154b5.zip/node_modules/yazl/",\ - "packageDependencies": [\ - ["yazl", "npm:2.5.1"],\ - ["buffer-crc32", "npm:0.2.13"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ ["yocto-queue", [\ ["npm:0.1.0", {\ "packageLocation": "./.yarn/cache/yocto-queue-npm-0.1.0-c6c9a7db29-f77b3d8d00.zip/node_modules/yocto-queue/",\ diff --git a/libs/ast-extractor/Cargo.lock b/libs/ast-extractor/Cargo.lock index 6889f718..4aa7d141 100644 --- a/libs/ast-extractor/Cargo.lock +++ b/libs/ast-extractor/Cargo.lock @@ -3,7 +3,7 @@ version = 3 [[package]] -name = "ast-extractor" +name = "osmium-libs-solidity-ast-extractor" version = "0.1.0" dependencies = [ "proc-macro2", diff --git a/libs/ast-extractor/Cargo.toml b/libs/ast-extractor/Cargo.toml index c7ddac5f..5b58e46c 100644 --- a/libs/ast-extractor/Cargo.toml +++ b/libs/ast-extractor/Cargo.toml @@ -1,5 +1,8 @@ [package] -name = "ast-extractor" +name = "osmium-libs-solidity-ast-extractor" +description = "Extracts the AST from a Solidity file" +license = "GPL-3.0" +repository = "https://github.com/astrodevs-labs/osmium" version = "0.1.0" edition = "2021" diff --git a/libs/ast-extractor/package.json b/libs/ast-extractor/package.json index 5a876afb..8279d2cb 100644 --- a/libs/ast-extractor/package.json +++ b/libs/ast-extractor/package.json @@ -5,6 +5,7 @@ "build": "cargo build --release", "format": "cargo fmt", "test": "cargo test", - "lint": "cargo clippy --all-targets --all-features -- -D warnings" + "lint": "cargo clippy --all-targets --all-features -- -D warnings", + "publish": "cargo package && cargo publish" } } diff --git a/libs/lsp-handler/Cargo.lock b/libs/lsp-handler/Cargo.lock new file mode 100644 index 00000000..9d748164 --- /dev/null +++ b/libs/lsp-handler/Cargo.lock @@ -0,0 +1,349 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "bitflags" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" + +[[package]] +name = "bumpalo" +version = "3.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f30e7476521f6f8af1a1c4c0b8cc94f0bee37d91763d0ca2665f299b6cd8aec" + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "form_urlencoded" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a62bc1cf6f830c2ec14a513a9fb124d0a213a629668a4186f329db21fe045652" +dependencies = [ + "percent-encoding", +] + +[[package]] +name = "idna" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7d20d6b07bfbc108882d88ed8e37d39636dcc260e15e30c45e6ba089610b917c" +dependencies = [ + "unicode-bidi", + "unicode-normalization", +] + +[[package]] +name = "itoa" +version = "1.0.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "af150ab688ff2122fcef229be89cb50dd66af9e01a4ff320cc137eecc9bacc38" + +[[package]] +name = "js-sys" +version = "0.3.64" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c5f195fe497f702db0f318b07fdd68edb16955aed830df8363d837542f8f935a" +dependencies = [ + "wasm-bindgen", +] + +[[package]] +name = "log" +version = "0.4.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" + +[[package]] +name = "lsp-types" +version = "0.94.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c66bfd44a06ae10647fe3f8214762e9369fd4248df1350924b4ef9e770a85ea1" +dependencies = [ + "bitflags", + "serde", + "serde_json", + "serde_repr", + "url", +] + +[[package]] +name = "once_cell" +version = "1.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d" + +[[package]] +name = "osmium-libs-lsp-handler" +version = "0.0.1" +dependencies = [ + "js-sys", + "lsp-types", + "serde", + "serde-wasm-bindgen", + "serde_json", + "tracing", + "wasm-bindgen", + "wasm-bindgen-futures", +] + +[[package]] +name = "percent-encoding" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b2a4787296e9989611394c33f193f676704af1686e70b8f8033ab5ba9a35a94" + +[[package]] +name = "pin-project-lite" +version = "0.2.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8afb450f006bf6385ca15ef45d71d2288452bc3683ce2e2cacc0d18e4be60b58" + +[[package]] +name = "proc-macro2" +version = "1.0.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "134c189feb4956b20f6f547d2cf727d4c0fe06722b20a0eec87ed445a97f92da" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quote" +version = "1.0.33" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "ryu" +version = "1.0.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ad4cc8da4ef723ed60bced201181d83791ad433213d8c24efffda1eec85d741" + +[[package]] +name = "serde" +version = "1.0.189" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e422a44e74ad4001bdc8eede9a4570ab52f71190e9c076d14369f38b9200537" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde-wasm-bindgen" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "30c9933e5689bd420dc6c87b7a1835701810cbc10cd86a26e4da45b73e6b1d78" +dependencies = [ + "js-sys", + "serde", + "wasm-bindgen", +] + +[[package]] +name = "serde_derive" +version = "1.0.189" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e48d1f918009ce3145511378cf68d613e3b3d9137d67272562080d68a2b32d5" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "serde_json" +version = "1.0.107" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6b420ce6e3d8bd882e9b243c6eed35dbc9a6110c9769e74b584e0d68d1f20c65" +dependencies = [ + "itoa", + "ryu", + "serde", +] + +[[package]] +name = "serde_repr" +version = "0.1.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8725e1dfadb3a50f7e5ce0b1a540466f6ed3fe7a0fca2ac2b8b831d31316bd00" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "syn" +version = "2.0.38" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e96b79aaa137db8f61e26363a0c9b47d8b4ec75da28b7d1d614c2303e232408b" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "tinyvec" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" +dependencies = [ + "tinyvec_macros", +] + +[[package]] +name = "tinyvec_macros" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" + +[[package]] +name = "tracing" +version = "0.1.39" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee2ef2af84856a50c1d430afce2fdded0a4ec7eda868db86409b4543df0797f9" +dependencies = [ + "pin-project-lite", + "tracing-attributes", + "tracing-core", +] + +[[package]] +name = "tracing-attributes" +version = "0.1.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "tracing-core" +version = "0.1.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" +dependencies = [ + "once_cell", +] + +[[package]] +name = "unicode-bidi" +version = "0.3.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92888ba5573ff080736b3648696b70cafad7d250551175acbaa4e0385b3e1460" + +[[package]] +name = "unicode-ident" +version = "1.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" + +[[package]] +name = "unicode-normalization" +version = "0.1.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c5713f0fc4b5db668a2ac63cdb7bb4469d8c9fed047b1d0292cc7b0ce2ba921" +dependencies = [ + "tinyvec", +] + +[[package]] +name = "url" +version = "2.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "143b538f18257fac9cad154828a57c6bf5157e1aa604d4816b5995bf6de87ae5" +dependencies = [ + "form_urlencoded", + "idna", + "percent-encoding", + "serde", +] + +[[package]] +name = "wasm-bindgen" +version = "0.2.87" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7706a72ab36d8cb1f80ffbf0e071533974a60d0a308d01a5d0375bf60499a342" +dependencies = [ + "cfg-if", + "wasm-bindgen-macro", +] + +[[package]] +name = "wasm-bindgen-backend" +version = "0.2.87" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5ef2b6d3c510e9625e5fe6f509ab07d66a760f0885d858736483c32ed7809abd" +dependencies = [ + "bumpalo", + "log", + "once_cell", + "proc-macro2", + "quote", + "syn", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-futures" +version = "0.4.37" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c02dbc21516f9f1f04f187958890d7e6026df8d16540b7ad9492bc34a67cea03" +dependencies = [ + "cfg-if", + "js-sys", + "wasm-bindgen", + "web-sys", +] + +[[package]] +name = "wasm-bindgen-macro" +version = "0.2.87" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dee495e55982a3bd48105a7b947fd2a9b4a8ae3010041b9e0faab3f9cd028f1d" +dependencies = [ + "quote", + "wasm-bindgen-macro-support", +] + +[[package]] +name = "wasm-bindgen-macro-support" +version = "0.2.87" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "54681b18a46765f095758388f2d0cf16eb8d4169b639ab575a8f5693af210c7b" +dependencies = [ + "proc-macro2", + "quote", + "syn", + "wasm-bindgen-backend", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-shared" +version = "0.2.87" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca6ad05a4870b2bf5fe995117d3728437bd27d7cd5f06f13c17443ef369775a1" + +[[package]] +name = "web-sys" +version = "0.3.64" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b85cbef8c220a6abc02aefd892dfc0fc23afb1c6a426316ec33253a3877249b" +dependencies = [ + "js-sys", + "wasm-bindgen", +] diff --git a/libs/lsp-handler/Cargo.toml b/libs/lsp-handler/Cargo.toml new file mode 100644 index 00000000..7e0b0c60 --- /dev/null +++ b/libs/lsp-handler/Cargo.toml @@ -0,0 +1,22 @@ +[package] +name = "osmium-libs-lsp-handler" +description = "Dispatch LSP messages to all hooked handlers" +license = "GPL-3.0" +repository = "https://github.com/astrodevs-labs/osmium" +version = "0.0.1" +edition = "2021" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] +lsp-types = "0.94.1" +serde = "1.0.188" +serde_json = "1.0.107" +tracing = { version = "0.1.39", features = [] } +wasm-bindgen = "0.2.87" +serde-wasm-bindgen = "0.6.0" +wasm-bindgen-futures = "0.4.37" +js-sys = "0.3.64" + +[lib] +crate-type = ["cdylib", "rlib"] \ No newline at end of file diff --git a/libs/lsp-handler/package.json b/libs/lsp-handler/package.json new file mode 100644 index 00000000..b2f9b0f8 --- /dev/null +++ b/libs/lsp-handler/package.json @@ -0,0 +1,10 @@ +{ + "name": "@osmium-libs/lsp-handler", + "scripts": { + "build": "cargo build --release", + "format": "cargo fmt", + "test": "cargo test", + "lint": "cargo clippy --all-targets --all-features -- -D warnings", + "publish": "cargo package && cargo publish" + } +} diff --git a/libs/lsp-handler/src/connection.rs b/libs/lsp-handler/src/connection.rs new file mode 100644 index 00000000..43718c38 --- /dev/null +++ b/libs/lsp-handler/src/connection.rs @@ -0,0 +1,422 @@ +use crate::jsonrpc::{self}; +use lsp_types::notification::*; +use lsp_types::request::*; +use lsp_types::*; +use serde::Serialize; +use serde_json::{Value}; +use std::fmt::Display; + + +use serde_wasm_bindgen::{from_value, to_value}; +use tracing::error; +use wasm_bindgen::JsValue; + +#[derive(Clone)] +struct ConnectionInner { + send_request_callback: js_sys::Function, + send_notification_callback: js_sys::Function, +} + +/// Handle for communicating with the language client. +/// +/// This type provides a very cheap implementation of [`Clone`] so API consumers can cheaply clone +/// and pass it around as needed. +/// +/// It also implements [`tower::Service`] in order to remain independent from the underlying +/// transport and to facilitate further abstraction with middleware. +#[derive(Clone)] +pub struct Connection { + inner: ConnectionInner, +} + +impl Connection { + pub fn new(send_request_callback: js_sys::Function, send_notification_callback: js_sys::Function) -> Self { + Self { + inner: ConnectionInner { + send_request_callback, + send_notification_callback + }, + } + } +} + +impl Connection { + // Lifecycle Messages + + /// Registers a new capability with the client. + /// + /// This corresponds to the [`client/registerCapability`] request. + /// + /// [`client/registerCapability`]: https://microsoft.github.io/language-server-protocol/specification#client_registerCapability + /// + /// # Initialization + /// + /// If the request is sent to the client before the server has been initialized, this will + /// immediately return `Err` with JSON-RPC error code `-32002` ([read more]). + /// + /// [read more]: https://microsoft.github.io/language-server-protocol/specification#initialize + pub fn register_capability(&self, registrations: Vec) -> jsonrpc::Result<()> { + self.send_request::(RegistrationParams { registrations }) + } + + /// Unregisters a capability with the client. + /// + /// This corresponds to the [`client/unregisterCapability`] request. + /// + /// [`client/unregisterCapability`]: https://microsoft.github.io/language-server-protocol/specification#client_unregisterCapability + /// + /// # Initialization + /// + /// If the request is sent to the client before the server has been initialized, this will + /// immediately return `Err` with JSON-RPC error code `-32002` ([read more]). + /// + /// [read more]: https://microsoft.github.io/language-server-protocol/specification#initialize + pub fn unregister_capability( + &self, + unregisterations: Vec, + ) -> jsonrpc::Result<()> { + self.send_request::(UnregistrationParams { unregisterations }) + } + + // Window Features + + /// Notifies the client to display a particular message in the user interface. + /// + /// This corresponds to the [`window/showMessage`] notification. + /// + /// [`window/showMessage`]: https://microsoft.github.io/language-server-protocol/specification#window_showMessage + pub fn show_message(&self, typ: MessageType, message: M) { + self.send_notification::(ShowMessageParams { + typ, + message: message.to_string(), + }); + } + + /// Requests the client to display a particular message in the user interface. + /// + /// Unlike the `show_message` notification, this request can also pass a list of actions and + /// wait for an answer from the client. + /// + /// This corresponds to the [`window/showMessageRequest`] request. + /// + /// [`window/showMessageRequest`]: https://microsoft.github.io/language-server-protocol/specification#window_showMessageRequest + /*pub fn show_message_request( + &self, + typ: MessageType, + message: M, + actions: Option>, + ) -> jsonrpc::Result> { + self.send_request_unchecked::(ShowMessageRequestParams { + typ, + message: message.to_string(), + actions, + }) + }*/ + + /// Notifies the client to log a particular message. + /// + /// This corresponds to the [`window/logMessage`] notification. + /// + /// [`window/logMessage`]: https://microsoft.github.io/language-server-protocol/specification#window_logMessage + pub fn log_message(&self, typ: MessageType, message: M) { + self.send_notification::(LogMessageParams { + typ, + message: message.to_string(), + }); + } + + /// Asks the client to display a particular resource referenced by a URI in the user interface. + /// + /// Returns `Ok(true)` if the document was successfully shown, or `Ok(false)` otherwise. + /// + /// This corresponds to the [`window/showDocument`] request. + /// + /// [`window/showDocument`]: https://microsoft.github.io/language-server-protocol/specification#window_showDocument + /// + /// # Initialization + /// + /// If the request is sent to the client before the server has been initialized, this will + /// immediately return `Err` with JSON-RPC error code `-32002` ([read more]). + /// + /// [read more]: https://microsoft.github.io/language-server-protocol/specification#initialize + /// + /// # Compatibility + /// + /// This request was introduced in specification version 3.16.0. + pub fn show_document(&self, params: ShowDocumentParams) -> jsonrpc::Result { + let response = self.send_request::(params)?; + Ok(response.success) + } + + // TODO: Add `work_done_progress_create()` here (since 3.15.0) when supported by `tower-lsp`. + // https://github.com/ebkalderon/tower-lsp/issues/176 + + /// Notifies the client to log a telemetry event. + /// + /// This corresponds to the [`telemetry/event`] notification. + /// + /// [`telemetry/event`]: https://microsoft.github.io/language-server-protocol/specification#telemetry_event + pub fn telemetry_event(&self, data: U) { + match serde_json::to_value(data) { + Err(e) => error!("invalid JSON in `telemetry/event` notification: {}", e), + Ok(mut value) => { + if !value.is_null() && !value.is_array() && !value.is_object() { + value = Value::Array(vec![value]); + } + self.send_notification::(value); + } + } + } + + /// Asks the client to refresh the code lenses currently shown in editors. As a result, the + /// client should ask the server to recompute the code lenses for these editors. + /// + /// This is useful if a server detects a configuration change which requires a re-calculation + /// of all code lenses. + /// + /// Note that the client still has the freedom to delay the re-calculation of the code lenses + /// if for example an editor is currently not visible. + /// + /// This corresponds to the [`workspace/codeLens/refresh`] request. + /// + /// [`workspace/codeLens/refresh`]: https://microsoft.github.io/language-server-protocol/specification#codeLens_refresh + /// + /// # Initialization + /// + /// If the request is sent to the client before the server has been initialized, this will + /// immediately return `Err` with JSON-RPC error code `-32002` ([read more]). + /// + /// [read more]: https://microsoft.github.io/language-server-protocol/specification#initialize + /// + /// # Compatibility + /// + /// This request was introduced in specification version 3.16.0. + pub fn code_lens_refresh(&self) -> jsonrpc::Result<()> { + self.send_request::(()) + } + + /// Asks the client to refresh the editors for which this server provides semantic tokens. As a + /// result, the client should ask the server to recompute the semantic tokens for these + /// editors. + /// + /// This is useful if a server detects a project-wide configuration change which requires a + /// re-calculation of all semantic tokens. Note that the client still has the freedom to delay + /// the re-calculation of the semantic tokens if for example an editor is currently not visible. + /// + /// This corresponds to the [`workspace/semanticTokens/refresh`] request. + /// + /// [`workspace/semanticTokens/refresh`]: https://microsoft.github.io/language-server-protocol/specification#textDocument_semanticTokens + /// + /// # Initialization + /// + /// If the request is sent to the client before the server has been initialized, this will + /// immediately return `Err` with JSON-RPC error code `-32002` ([read more]). + /// + /// [read more]: https://microsoft.github.io/language-server-protocol/specification#initialize + /// + /// # Compatibility + /// + /// This request was introduced in specification version 3.16.0. + pub fn semantic_tokens_refresh(&self) -> jsonrpc::Result<()> { + self.send_request::(()) + } + + /// Asks the client to refresh the inline values currently shown in editors. As a result, the + /// client should ask the server to recompute the inline values for these editors. + /// + /// This is useful if a server detects a configuration change which requires a re-calculation + /// of all inline values. Note that the client still has the freedom to delay the + /// re-calculation of the inline values if for example an editor is currently not visible. + /// + /// This corresponds to the [`workspace/inlineValue/refresh`] request. + /// + /// [`workspace/inlineValue/refresh`]: https://microsoft.github.io/language-server-protocol/specification#workspace_inlineValue_refresh + /// + /// # Initialization + /// + /// If the request is sent to the client before the server has been initialized, this will + /// immediately return `Err` with JSON-RPC error code `-32002` ([read more]). + /// + /// [read more]: https://microsoft.github.io/language-server-protocol/specification#initialize + /// + /// # Compatibility + /// + /// This request was introduced in specification version 3.17.0. + pub fn inline_value_refresh(&self) -> jsonrpc::Result<()> { + self.send_request::(()) + } + + /// Asks the client to refresh the inlay hints currently shown in editors. As a result, the + /// client should ask the server to recompute the inlay hints for these editors. + /// + /// This is useful if a server detects a configuration change which requires a re-calculation + /// of all inlay hints. Note that the client still has the freedom to delay the re-calculation + /// of the inlay hints if for example an editor is currently not visible. + /// + /// This corresponds to the [`workspace/inlayHint/refresh`] request. + /// + /// [`workspace/inlayHint/refresh`]: https://microsoft.github.io/language-server-protocol/specification#workspace_inlayHint_refresh + /// + /// # Initialization + /// + /// If the request is sent to the client before the server has been initialized, this will + /// immediately return `Err` with JSON-RPC error code `-32002` ([read more]). + /// + /// [read more]: https://microsoft.github.io/language-server-protocol/specification#initialize + /// + /// # Compatibility + /// + /// This request was introduced in specification version 3.17.0. + pub fn inlay_hint_refresh(&self) -> jsonrpc::Result<()> { + self.send_request::(()) + } + + /// Asks the client to refresh all needed document and workspace diagnostics. + /// + /// This is useful if a server detects a project wide configuration change which requires a + /// re-calculation of all diagnostics. + /// + /// This corresponds to the [`workspace/diagnostic/refresh`] request. + /// + /// [`workspace/diagnostic/refresh`]: https://microsoft.github.io/language-server-protocol/specification#diagnostic_refresh + /// + /// # Initialization + /// + /// If the request is sent to the client before the server has been initialized, this will + /// immediately return `Err` with JSON-RPC error code `-32002` ([read more]). + /// + /// [read more]: https://microsoft.github.io/language-server-protocol/specification#initialize + /// + /// # Compatibility + /// + /// This request was introduced in specification version 3.17.0. + pub fn workspace_diagnostic_refresh(&self) -> jsonrpc::Result<()> { + self.send_request::(()) + } + + /// Submits validation diagnostics for an open file with the given URI. + /// + /// This corresponds to the [`textDocument/publishDiagnostics`] notification. + /// + /// [`textDocument/publishDiagnostics`]: https://microsoft.github.io/language-server-protocol/specification#textDocument_publishDiagnostics + /// + /// # Initialization + /// + /// This notification will only be sent if the server is initialized. + pub fn publish_diagnostics(&self, uri: Url, diags: Vec, version: Option) { + self.send_notification::(PublishDiagnosticsParams::new( + uri, diags, version, + )); + } + + // Workspace Features + + /// Fetches configuration settings from the client. + /// + /// The request can fetch several configuration settings in one roundtrip. The order of the + /// returned configuration settings correspond to the order of the passed + /// [`ConfigurationItem`]s (e.g. the first item in the response is the result for the first + /// configuration item in the params). + /// + /// This corresponds to the [`workspace/configuration`] request. + /// + /// [`workspace/configuration`]: https://microsoft.github.io/language-server-protocol/specification#workspace_configuration + /// + /// # Initialization + /// + /// If the request is sent to the client before the server has been initialized, this will + /// immediately return `Err` with JSON-RPC error code `-32002` ([read more]). + /// + /// [read more]: https://microsoft.github.io/language-server-protocol/specification#initialize + /// + /// # Compatibility + /// + /// This request was introduced in specification version 3.6.0. + pub fn configuration(&self, items: Vec) -> jsonrpc::Result> { + self.send_request::(ConfigurationParams { items }) + } + + /// Fetches the current open list of workspace folders. + /// + /// Returns `None` if only a single file is open in the tool. Returns an empty `Vec` if a + /// workspace is open but no folders are configured. + /// + /// This corresponds to the [`workspace/workspaceFolders`] request. + /// + /// [`workspace/workspaceFolders`]: https://microsoft.github.io/language-server-protocol/specification#workspace_workspaceFolders + /// + /// # Initialization + /// + /// If the request is sent to the client before the server has been initialized, this will + /// immediately return `Err` with JSON-RPC error code `-32002` ([read more]). + /// + /// [read more]: https://microsoft.github.io/language-server-protocol/specification#initialize + /// + /// # Compatibility + /// + /// This request was introduced in specification version 3.6.0. + pub fn workspace_folders(&self) -> jsonrpc::Result>> { + self.send_request::(()) + } + + /// Requests a workspace resource be edited on the client side and returns whether the edit was + /// applied. + /// + /// This corresponds to the [`workspace/applyEdit`] request. + /// + /// [`workspace/applyEdit`]: https://microsoft.github.io/language-server-protocol/specification#workspace_applyEdit + /// + /// # Initialization + /// + /// If the request is sent to the client before the server has been initialized, this will + /// immediately return `Err` with JSON-RPC error code `-32002` ([read more]). + /// + /// [read more]: https://microsoft.github.io/language-server-protocol/specification#initialize + pub fn apply_edit(&self, edit: WorkspaceEdit) -> jsonrpc::Result { + self.send_request::(ApplyWorkspaceEditParams { edit, label: None }) + } + + /// Sends a custom notification to the client. + /// + /// # Initialization + /// + /// This notification will only be sent if the server is initialized. + pub fn send_notification(&self, params: N::Params) + where + N: lsp_types::notification::Notification, + { + let inner = self.inner.clone(); + let notification = to_value(&N::METHOD.to_string()).unwrap(); + let param = to_value(¶ms).unwrap(); + let _ = inner.send_notification_callback.call2(&JsValue::NULL, ¬ification, ¶m); + } + + /// Sends a custom request to the client. + /// + /// # Initialization + /// + /// If the request is sent to the client before the server has been initialized, this will + /// immediately return `Err` with JSON-RPC error code `-32002` ([read more]). + /// + /// [read more]: https://microsoft.github.io/language-server-protocol/specification#initialize + pub fn send_request(&self, params: R::Params) -> jsonrpc::Result + where + R: lsp_types::request::Request, + { + let inner = self.inner.clone(); + let request = to_value(&R::METHOD.to_string()).unwrap(); + let param = to_value(¶ms).unwrap(); + let res = inner.send_request_callback.call2(&JsValue::NULL, &request, ¶m); + + let res = match res { + Ok(res) => from_value::(res).unwrap(), + Err(_e) => { + return Err(jsonrpc::Error::internal_error()); + } + }; + + Ok(res) + + + } +} diff --git a/libs/lsp-handler/src/dispatcher.rs b/libs/lsp-handler/src/dispatcher.rs new file mode 100644 index 00000000..59fad2c1 --- /dev/null +++ b/libs/lsp-handler/src/dispatcher.rs @@ -0,0 +1,1706 @@ +use lsp_types::{CallHierarchyIncomingCall, CallHierarchyIncomingCallsParams, CallHierarchyItem, CallHierarchyOutgoingCall, CallHierarchyOutgoingCallsParams, CallHierarchyPrepareParams, CodeAction, CodeActionParams, CodeActionResponse, CodeLens, CodeLensParams, ColorInformation, ColorPresentation, ColorPresentationParams, CompletionItem, CompletionParams, CompletionResponse, CreateFilesParams, DeleteFilesParams, DidChangeConfigurationParams, DidChangeTextDocumentParams, DidChangeWatchedFilesParams, DidChangeWorkspaceFoldersParams, DidCloseTextDocumentParams, DidOpenTextDocumentParams, DidSaveTextDocumentParams, DocumentColorParams, DocumentDiagnosticParams, DocumentDiagnosticReportResult, DocumentFormattingParams, DocumentHighlight, DocumentHighlightParams, DocumentLink, DocumentLinkParams, DocumentOnTypeFormattingParams, DocumentRangeFormattingParams, DocumentSymbolParams, DocumentSymbolResponse, ExecuteCommandParams, FoldingRange, FoldingRangeParams, GotoDefinitionParams, GotoDefinitionResponse, Hover, HoverParams, InitializedParams, InitializeParams, InitializeResult, InlayHint, InlayHintParams, InlineValue, InlineValueParams, LinkedEditingRangeParams, LinkedEditingRanges, Location, Moniker, MonikerParams, PrepareRenameResponse, ReferenceParams, RenameFilesParams, RenameParams, SelectionRange, SelectionRangeParams, SemanticTokensDeltaParams, SemanticTokensFullDeltaResult, SemanticTokensParams, SemanticTokensRangeParams, SemanticTokensRangeResult, SemanticTokensResult, SignatureHelp, SignatureHelpParams, SymbolInformation, TextDocumentPositionParams, TextEdit, TypeHierarchyItem, TypeHierarchyPrepareParams, TypeHierarchySubtypesParams, TypeHierarchySupertypesParams, WillSaveTextDocumentParams, WorkspaceDiagnosticParams, WorkspaceDiagnosticReportResult, WorkspaceEdit, WorkspaceSymbol, WorkspaceSymbolParams, MessageType}; +use lsp_types::notification::*; +use lsp_types::request::*; +use serde_json::Value; +use wasm_bindgen::prelude::*; +use crate::connection::Connection; +use crate::handler::Handler; +use crate::helpers::log; +use serde_wasm_bindgen::{from_value, to_value}; +use crate::jsonrpc::{Error, ErrorCode, Result}; + +#[wasm_bindgen] +pub struct Dispatcher { + handlers: Vec>, + connection: Connection, +} + +impl Dispatcher { + pub fn new(connection: Connection) -> Self { + Dispatcher { + handlers: Vec::new(), + connection, + } + } + + pub fn setup(&mut self, creators: Vec) where F: FnOnce(Connection) -> Box { + for creator in creators { + self.handlers.push(creator(self.connection.clone())); + } + } +} + +#[wasm_bindgen] +impl Dispatcher { + #[allow(unused_variables)] + #[wasm_bindgen(js_class = Dispatcher, js_name = onRequest)] + pub async fn on_request(&mut self, method: &str, params: JsValue) -> std::result::Result { + log(method); + + match method { + Initialize::METHOD => { + let params: InitializeParams = from_value(params).unwrap(); + let res = self.initialize(params); + let result = match res { + Ok(init) => { + let js = to_value(&init).unwrap(); + js_sys::Promise::resolve(&js) + }, + Err(err) => { + let js = to_value(&err).unwrap(); + js_sys::Promise::reject(&js) + }, + }; + let result = wasm_bindgen_futures::JsFuture::from(result).await?; + Ok(result) + }, + Shutdown::METHOD => { + let params: InitializeParams = from_value(params).unwrap(); + let res = self.initialize(params); + let result = match res { + Ok(init) => { + let js = to_value(&init).unwrap(); + js_sys::Promise::resolve(&js) + }, + Err(err) => { + let js = to_value(&err).unwrap(); + js_sys::Promise::reject(&js) + }, + }; + let result = wasm_bindgen_futures::JsFuture::from(result).await?; + Ok(result) + }, + WillSaveWaitUntil::METHOD => { + let params: WillSaveTextDocumentParams = from_value(params).unwrap(); + let res = self.will_save_wait_until(params); + let result = match res { + Ok(init) => { + let js = to_value(&init).unwrap(); + js_sys::Promise::resolve(&js) + }, + Err(err) => { + let js = to_value(&err).unwrap(); + js_sys::Promise::reject(&js) + }, + }; + let result = wasm_bindgen_futures::JsFuture::from(result).await?; + Ok(result) + }, + GotoDeclaration::METHOD => { + let params: GotoDeclarationParams = from_value(params).unwrap(); + let res = self.goto_declaration(params); + let result = match res { + Ok(init) => { + let js = to_value(&init).unwrap(); + js_sys::Promise::resolve(&js) + }, + Err(err) => { + let js = to_value(&err).unwrap(); + js_sys::Promise::reject(&js) + }, + }; + let result = wasm_bindgen_futures::JsFuture::from(result).await?; + Ok(result) + }, + GotoDefinition::METHOD => { + let params: GotoDefinitionParams = from_value(params).unwrap(); + let res = self.goto_definition(params); + let result = match res { + Ok(init) => { + let js = to_value(&init).unwrap(); + js_sys::Promise::resolve(&js) + }, + Err(err) => { + let js = to_value(&err).unwrap(); + js_sys::Promise::reject(&js) + }, + }; + let result = wasm_bindgen_futures::JsFuture::from(result).await?; + Ok(result) + }, + GotoTypeDefinition::METHOD => { + let params: GotoTypeDefinitionParams = from_value(params).unwrap(); + let res = self.goto_type_definition(params); + let result = match res { + Ok(init) => { + let js = to_value(&init).unwrap(); + js_sys::Promise::resolve(&js) + }, + Err(err) => { + let js = to_value(&err).unwrap(); + js_sys::Promise::reject(&js) + }, + }; + let result = wasm_bindgen_futures::JsFuture::from(result).await?; + Ok(result) + }, + GotoImplementation::METHOD => { + let params: GotoImplementationParams = from_value(params).unwrap(); + let res = self.goto_implementation(params); + let result = match res { + Ok(init) => { + let js = to_value(&init).unwrap(); + js_sys::Promise::resolve(&js) + }, + Err(err) => { + let js = to_value(&err).unwrap(); + js_sys::Promise::reject(&js) + }, + }; + let result = wasm_bindgen_futures::JsFuture::from(result).await?; + Ok(result) + }, + References::METHOD => { + let params: ReferenceParams = from_value(params).unwrap(); + let res = self.references(params); + let result = match res { + Ok(init) => { + let js = to_value(&init).unwrap(); + js_sys::Promise::resolve(&js) + }, + Err(err) => { + let js = to_value(&err).unwrap(); + js_sys::Promise::reject(&js) + }, + }; + let result = wasm_bindgen_futures::JsFuture::from(result).await?; + Ok(result) + }, + CallHierarchyPrepare::METHOD => { + let params: CallHierarchyPrepareParams = from_value(params).unwrap(); + let res = self.prepare_call_hierarchy(params); + let result = match res { + Ok(init) => { + let js = to_value(&init).unwrap(); + js_sys::Promise::resolve(&js) + }, + Err(err) => { + let js = to_value(&err).unwrap(); + + js_sys::Promise::reject(&js) + }, + }; + let result = wasm_bindgen_futures::JsFuture::from(result).await?; + Ok(result) + }, + CallHierarchyIncomingCalls::METHOD => { + let params: CallHierarchyIncomingCallsParams = from_value(params).unwrap(); + let res = self.incoming_calls(params); + let result = match res { + Ok(init) => { + let js = to_value(&init).unwrap(); + js_sys::Promise::resolve(&js) + }, + Err(err) => { + let js = to_value(&err).unwrap(); + js_sys::Promise::reject(&js) + }, + }; + let result = wasm_bindgen_futures::JsFuture::from(result).await?; + + + Ok(result) + }, + CallHierarchyOutgoingCalls::METHOD => { + let params: CallHierarchyOutgoingCallsParams = from_value(params).unwrap(); + let res = self.outgoing_calls(params); + let result = match res { + Ok(init) => { + let js = to_value(&init).unwrap(); + js_sys::Promise::resolve(&js) + }, + Err(err) => { + let js = to_value(&err).unwrap(); + js_sys::Promise::reject(&js) + }, + }; + let result = wasm_bindgen_futures::JsFuture::from(result).await?; + + Ok(result) + }, + TypeHierarchyPrepare::METHOD => { + let params: TypeHierarchyPrepareParams = from_value(params).unwrap(); + let res = self.prepare_type_hierarchy(params); + let result = match res { + Ok(init) => { + let js = to_value(&init).unwrap(); + js_sys::Promise::resolve(&js) + }, + Err(err) => { + let js = to_value(&err).unwrap(); + js_sys::Promise::reject(&js) + }, + }; + let result = wasm_bindgen_futures::JsFuture::from(result).await?; + + Ok(result) + }, + TypeHierarchySupertypes::METHOD => { + let params: TypeHierarchySupertypesParams = from_value(params).unwrap(); + let res = self.supertypes(params); + let result = match res { + Ok(init) => { + let js = to_value(&init).unwrap(); + js_sys::Promise::resolve(&js) + }, + Err(err) => { + let js = to_value(&err).unwrap(); + js_sys::Promise::reject(&js) + }, + }; + let result = wasm_bindgen_futures::JsFuture::from(result).await?; + + Ok(result) + }, + TypeHierarchySubtypes::METHOD => { + let params: TypeHierarchySubtypesParams = from_value(params).unwrap(); + let res = self.subtypes(params); + let result = match res { + Ok(init) => { + let js = to_value(&init).unwrap(); + js_sys::Promise::resolve(&js) + }, + Err(err) => { + let js = to_value(&err).unwrap(); + js_sys::Promise::reject(&js) + }, + }; + let result = wasm_bindgen_futures::JsFuture::from(result).await?; + + Ok(result) + }, + DocumentHighlightRequest::METHOD => { + let params: DocumentHighlightParams = from_value(params).unwrap(); + let res = self.document_highlight(params); + let result = match res { + Ok(init) => { + let js = to_value(&init).unwrap(); + js_sys::Promise::resolve(&js) + }, + Err(err) => { + let js = to_value(&err).unwrap(); + js_sys::Promise::reject(&js) + }, + }; + let result = wasm_bindgen_futures::JsFuture::from(result).await?; + + Ok(result) + }, + DocumentLinkRequest::METHOD => { + let params: DocumentLinkParams = from_value(params).unwrap(); + let res = self.document_link(params); + let result = match res { + Ok(init) => { + let js = to_value(&init).unwrap(); + js_sys::Promise::resolve(&js) + }, + Err(err) => { + let js = to_value(&err).unwrap(); + js_sys::Promise::reject(&js) + }, + }; + let result = wasm_bindgen_futures::JsFuture::from(result).await?; + + Ok(result) + }, + DocumentLinkResolve::METHOD => { + let params: DocumentLink = from_value(params).unwrap(); + let res = self.document_link_resolve(params); + let result = match res { + Ok(init) => { + let js = to_value(&init).unwrap(); + js_sys::Promise::resolve(&js) + }, + Err(err) => { + let js = to_value(&err).unwrap(); + js_sys::Promise::reject(&js) + }, + }; + let result = wasm_bindgen_futures::JsFuture::from(result).await?; + + Ok(result) + }, + HoverRequest::METHOD => { + let params: HoverParams = from_value(params).unwrap(); + let res = self.hover(params); + let result = match res { + Ok(init) => { + let js = to_value(&init).unwrap(); + js_sys::Promise::resolve(&js) + }, + Err(err) => { + let js = to_value(&err).unwrap(); + js_sys::Promise::reject(&js) + }, + }; + let result = wasm_bindgen_futures::JsFuture::from(result).await?; + + + Ok(result) + }, + CodeLensRequest::METHOD => { + let params: CodeLensParams = from_value(params).unwrap(); + let res = self.code_lens(params); + let result = match res { + Ok(init) => { + let js = to_value(&init).unwrap(); + js_sys::Promise::resolve(&js) + }, + Err(err) => { + let js = to_value(&err).unwrap(); + js_sys::Promise::reject(&js) + }, + }; + let result = wasm_bindgen_futures::JsFuture::from(result).await?; + + + Ok(result) + }, + CodeLensResolve::METHOD => { + let params: CodeLens = from_value(params).unwrap(); + let res = self.code_lens_resolve(params); + let result = match res { + Ok(init) => { + let js = to_value(&init).unwrap(); + js_sys::Promise::resolve(&js) + }, + Err(err) => { + let js = to_value(&err).unwrap(); + js_sys::Promise::reject(&js) + }, + }; + let result = wasm_bindgen_futures::JsFuture::from(result).await?; + + + Ok(result) + }, + FoldingRangeRequest::METHOD => { + let params: FoldingRangeParams = from_value(params).unwrap(); + let res = self.folding_range(params); + let result = match res { + Ok(init) => { + let js = to_value(&init).unwrap(); + js_sys::Promise::resolve(&js) + }, + Err(err) => { + let js = to_value(&err).unwrap(); + js_sys::Promise::reject(&js) + }, + }; + let result = wasm_bindgen_futures::JsFuture::from(result).await?; + + + Ok(result) + }, + SelectionRangeRequest::METHOD => { + let params: SelectionRangeParams = from_value(params).unwrap(); + let res = self.selection_range(params); + let result = match res { + Ok(init) => { + let js = to_value(&init).unwrap(); + js_sys::Promise::resolve(&js) + }, + Err(err) => { + let js = to_value(&err).unwrap(); + js_sys::Promise::reject(&js) + }, + }; + + let result = wasm_bindgen_futures::JsFuture::from(result).await?; + + + Ok(result) + }, + DocumentSymbolRequest::METHOD => { + let params: DocumentSymbolParams = from_value(params).unwrap(); + let res = self.document_symbol(params); + let result = match res { + Ok(init) => { + let js = to_value(&init).unwrap(); + js_sys::Promise::resolve(&js) + }, + Err(err) => { + let js = to_value(&err).unwrap(); + js_sys::Promise::reject(&js) + }, + }; + let result = wasm_bindgen_futures::JsFuture::from(result).await?; + + + Ok(result) + }, + SemanticTokensFullRequest::METHOD => { + let params: SemanticTokensParams = from_value(params).unwrap(); + let res = self.semantic_tokens_full(params); + let result = match res { + Ok(init) => { + let js = to_value(&init).unwrap(); + js_sys::Promise::resolve(&js) + }, + Err(err) => { + let js = to_value(&err).unwrap(); + js_sys::Promise::reject(&js) + }, + }; + let result = wasm_bindgen_futures::JsFuture::from(result).await?; + + + Ok(result) + }, + SemanticTokensFullDeltaRequest::METHOD => { + let params: SemanticTokensDeltaParams = from_value(params).unwrap(); + let res = self.semantic_tokens_full_delta(params); + let result = match res { + Ok(init) => { + let js = to_value(&init).unwrap(); + js_sys::Promise::resolve(&js) + }, + Err(err) => { + let js = to_value(&err).unwrap(); + js_sys::Promise::reject(&js) + }, + }; + let result = wasm_bindgen_futures::JsFuture::from(result).await?; + + + Ok(result) + }, + SemanticTokensRangeRequest::METHOD => { + let params: SemanticTokensRangeParams = from_value(params).unwrap(); + let res = self.semantic_tokens_range(params); + let result = match res { + Ok(init) => { + let js = to_value(&init).unwrap(); + js_sys::Promise::resolve(&js) + }, + Err(err) => { + let js = to_value(&err).unwrap(); + js_sys::Promise::reject(&js) + }, + }; + let result = wasm_bindgen_futures::JsFuture::from(result).await?; + + + Ok(result) + }, + InlineValueRequest::METHOD => { + let params: InlineValueParams = from_value(params).unwrap(); + let res = self.inline_value(params); + let result = match res { + Ok(init) => { + let js = to_value(&init).unwrap(); + js_sys::Promise::resolve(&js) + }, + Err(err) => { + let js = to_value(&err).unwrap(); + js_sys::Promise::reject(&js) + }, + }; + let result = wasm_bindgen_futures::JsFuture::from(result).await?; + + Ok(result) + }, + InlayHintRequest::METHOD => { + let params: InlayHintParams = from_value(params).unwrap(); + let res = self.inlay_hint(params); + let result = match res { + Ok(init) => { + let js = to_value(&init).unwrap(); + js_sys::Promise::resolve(&js) + }, + Err(err) => { + let js = to_value(&err).unwrap(); + js_sys::Promise::reject(&js) + }, + }; + let result = wasm_bindgen_futures::JsFuture::from(result).await?; + + Ok(result) + }, + InlayHintResolveRequest::METHOD => { + let params: InlayHint = from_value(params).unwrap(); + let res = self.inlay_hint_resolve(params); + let result = match res { + Ok(init) => { + let js = to_value(&init).unwrap(); + js_sys::Promise::resolve(&js) + }, + Err(err) => { + let js = to_value(&err).unwrap(); + js_sys::Promise::reject(&js) + }, + }; + let result = wasm_bindgen_futures::JsFuture::from(result).await?; + + Ok(result) + }, + MonikerRequest::METHOD => { + let params: MonikerParams = from_value(params).unwrap(); + let res = self.moniker(params); + let result = match res { + Ok(init) => { + let js = to_value(&init).unwrap(); + js_sys::Promise::resolve(&js) + }, + Err(err) => { + let js = to_value(&err).unwrap(); + js_sys::Promise::reject(&js) + }, + }; + let result = wasm_bindgen_futures::JsFuture::from(result).await?; + + Ok(result) + }, + Completion::METHOD => { + let params: CompletionParams = from_value(params).unwrap(); + let res = self.completion(params); + let result = match res { + Ok(init) => { + let js = to_value(&init).unwrap(); + js_sys::Promise::resolve(&js) + }, + Err(err) => { + let js = to_value(&err).unwrap(); + js_sys::Promise::reject(&js) + }, + }; + let result = wasm_bindgen_futures::JsFuture::from(result).await?; + + Ok(result) + }, + DocumentDiagnosticRequest::METHOD => { + let params: DocumentDiagnosticParams = from_value(params).unwrap(); + let res = self.diagnostic(params); + let result = match res { + Ok(init) => { + let js = to_value(&init).unwrap(); + js_sys::Promise::resolve(&js) + }, + Err(err) => { + let js = to_value(&err).unwrap(); + js_sys::Promise::reject(&js) + }, + }; + let result = wasm_bindgen_futures::JsFuture::from(result).await?; + + Ok(result) + }, + WorkspaceDiagnosticRequest::METHOD => { + let params: WorkspaceDiagnosticParams = from_value(params).unwrap(); + let res = self.workspace_diagnostic(params); + let result = match res { + Ok(init) => { + let js = to_value(&init).unwrap(); + js_sys::Promise::resolve(&js) + }, + Err(err) => { + let js = to_value(&err).unwrap(); + js_sys::Promise::reject(&js) + }, + }; + let result = wasm_bindgen_futures::JsFuture::from(result).await?; + + + Ok(result) + }, + SignatureHelpRequest::METHOD => { + let params: SignatureHelpParams = from_value(params).unwrap(); + let res = self.signature_help(params); + let result = match res { + Ok(init) => { + let js = to_value(&init).unwrap(); + js_sys::Promise::resolve(&js) + }, + Err(err) => { + let js = to_value(&err).unwrap(); + js_sys::Promise::reject(&js) + }, + }; + let result = wasm_bindgen_futures::JsFuture::from(result).await?; + + + Ok(result) + }, + CodeActionRequest::METHOD => { + let params: CodeActionParams = from_value(params).unwrap(); + let res = self.code_action(params); + let result = match res { + Ok(init) => { + let js = to_value(&init).unwrap(); + js_sys::Promise::resolve(&js) + }, + Err(err) => { + let js = to_value(&err).unwrap(); + js_sys::Promise::reject(&js) + }, + }; + let result = wasm_bindgen_futures::JsFuture::from(result).await?; + + + Ok(result) + }, + CodeActionResolveRequest::METHOD => { + let params: CodeAction = from_value(params).unwrap(); + let res = self.code_action_resolve(params); + let result = match res { + Ok(init) => { + let js = to_value(&init).unwrap(); + js_sys::Promise::resolve(&js) + }, + Err(err) => { + let js = to_value(&err).unwrap(); + js_sys::Promise::reject(&js) + }, + }; + let result = wasm_bindgen_futures::JsFuture::from(result).await?; + + + Ok(result) + }, + DocumentColor::METHOD => { + let params: DocumentColorParams = from_value(params).unwrap(); + let res = self.document_color(params); + let result = match res { + Ok(init) => { + let js = to_value(&init).unwrap(); + js_sys::Promise::resolve(&js) + }, + Err(err) => { + let js = to_value(&err).unwrap(); + js_sys::Promise::reject(&js) + }, + }; + let result = wasm_bindgen_futures::JsFuture::from(result).await?; + + Ok(result) + }, + ColorPresentationRequest::METHOD => { + let params: ColorPresentationParams = from_value(params).unwrap(); + let res = self.color_presentation(params); + let result = match res { + Ok(init) => { + let js = to_value(&init).unwrap(); + js_sys::Promise::resolve(&js) + }, + Err(err) => { + let js = to_value(&err).unwrap(); + js_sys::Promise::reject(&js) + }, + }; + let result = wasm_bindgen_futures::JsFuture::from(result).await?; + + Ok(result) + }, + Formatting::METHOD => { + let params: DocumentFormattingParams = from_value(params).unwrap(); + let res = self.formatting(params); + let result = match res { + Ok(init) => { + let js = to_value(&init).unwrap(); + js_sys::Promise::resolve(&js) + }, + Err(err) => { + let js = to_value(&err).unwrap(); + js_sys::Promise::reject(&js) + }, + }; + let result = wasm_bindgen_futures::JsFuture::from(result).await?; + + Ok(result) + }, + RangeFormatting::METHOD => { + let params: DocumentRangeFormattingParams = from_value(params).unwrap(); + let res = self.range_formatting(params); + let result = match res { + Ok(init) => { + let js = to_value(&init).unwrap(); + js_sys::Promise::resolve(&js) + }, + Err(err) => { + let js = to_value(&err).unwrap(); + js_sys::Promise::reject(&js) + }, + }; + let result = wasm_bindgen_futures::JsFuture::from(result).await?; + + Ok(result) + }, + OnTypeFormatting::METHOD => { + let params: DocumentOnTypeFormattingParams = from_value(params).unwrap(); + let res = self.on_type_formatting(params); + let result = match res { + Ok(init) => { + let js = to_value(&init).unwrap(); + js_sys::Promise::resolve(&js) + }, + Err(err) => { + let js = to_value(&err).unwrap(); + js_sys::Promise::reject(&js) + }, + }; + let result = wasm_bindgen_futures::JsFuture::from(result).await?; + + Ok(result) + }, + Rename::METHOD => { + let params: RenameParams = from_value(params).unwrap(); + let res = self.rename(params); + let result = match res { + Ok(init) => { + let js = to_value(&init).unwrap(); + js_sys::Promise::resolve(&js) + }, + Err(err) => { + let js = to_value(&err).unwrap(); + js_sys::Promise::reject(&js) + }, + }; + let result = wasm_bindgen_futures::JsFuture::from(result).await?; + + Ok(result) + }, + PrepareRenameRequest::METHOD => { + let params: TextDocumentPositionParams = from_value(params).unwrap(); + let res = self.prepare_rename(params); + let result = match res { + Ok(init) => { + let js = to_value(&init).unwrap(); + js_sys::Promise::resolve(&js) + }, + Err(err) => { + let js = to_value(&err).unwrap(); + js_sys::Promise::reject(&js) + }, + }; + let result = wasm_bindgen_futures::JsFuture::from(result).await?; + + Ok(result) + }, + LinkedEditingRange::METHOD => { + let params: LinkedEditingRangeParams = from_value(params).unwrap(); + let res = self.linked_editing_range(params); + let result = match res { + Ok(init) => { + let js = to_value(&init).unwrap(); + js_sys::Promise::resolve(&js) + }, + Err(err) => { + let js = to_value(&err).unwrap(); + js_sys::Promise::reject(&js) + }, + }; + let result = wasm_bindgen_futures::JsFuture::from(result).await?; + + Ok(result) + }, + WorkspaceSymbolRequest::METHOD => { + let params: WorkspaceSymbolParams = from_value(params).unwrap(); + let res = self.symbol(params); + let result = match res { + Ok(init) => { + let js = to_value(&init).unwrap(); + js_sys::Promise::resolve(&js) + }, + Err(err) => { + let js = to_value(&err).unwrap(); + js_sys::Promise::reject(&js) + }, + }; + let result = wasm_bindgen_futures::JsFuture::from(result).await?; + + Ok(result) + }, + WorkspaceSymbolResolve::METHOD => { + let params: WorkspaceSymbol = from_value(params).unwrap(); + let res = self.symbol_resolve(params); + let result = match res { + Ok(init) => { + let js = to_value(&init).unwrap(); + js_sys::Promise::resolve(&js) + }, + Err(err) => { + let js = to_value(&err).unwrap(); + js_sys::Promise::reject(&js) + }, + }; + let result = wasm_bindgen_futures::JsFuture::from(result).await?; + + Ok(result) + }, + WillDeleteFiles::METHOD => { + let params: DeleteFilesParams = from_value(params).unwrap(); + let res = self.will_delete_files(params); + let result = match res { + Ok(init) => { + let js = to_value(&init).unwrap(); + js_sys::Promise::resolve(&js) + }, + Err(err) => { + let js = to_value(&err).unwrap(); + js_sys::Promise::reject(&js) + }, + }; + let result = wasm_bindgen_futures::JsFuture::from(result).await?; + Ok(result) + }, + WillCreateFiles::METHOD => { + let params: CreateFilesParams = from_value(params).unwrap(); + let res = self.will_create_files(params); + let result = match res { + Ok(init) => { + let js = to_value(&init).unwrap(); + js_sys::Promise::resolve(&js) + }, + Err(err) => { + let js = to_value(&err).unwrap(); + js_sys::Promise::reject(&js) + }, + }; + let result = wasm_bindgen_futures::JsFuture::from(result).await?; + Ok(result) + }, + WillRenameFiles::METHOD => { + let params: RenameFilesParams = from_value(params).unwrap(); + let res = self.will_rename_files(params); + let result = match res { + Ok(init) => { + let js = to_value(&init).unwrap(); + js_sys::Promise::resolve(&js) + }, + Err(err) => { + let js = to_value(&err).unwrap(); + js_sys::Promise::reject(&js) + }, + }; + let result = wasm_bindgen_futures::JsFuture::from(result).await?; + Ok(result) + } + ExecuteCommand::METHOD => { + let params: ExecuteCommandParams = from_value(params).unwrap(); + let res = self.execute_command(params); + let result = match res { + Ok(init) => { + let js = to_value(&init).unwrap(); + js_sys::Promise::resolve(&js) + }, + Err(err) => { + let js = to_value(&err).unwrap(); + js_sys::Promise::reject(&js) + }, + }; + let result = wasm_bindgen_futures::JsFuture::from(result).await?; + Ok(result) + }, + _ => { + Err(JsValue::from_str("Method not dispatched")) + } + + } + } + + #[allow(unused_variables)] + #[wasm_bindgen(js_class = Dispatcher, js_name = onNotification)] + pub async fn on_notification(&mut self, method: &str, params: JsValue) -> std::result::Result<(), JsValue> { + log(method); + + match method { + Initialized::METHOD => { + let params: InitializedParams = from_value(params).unwrap(); + self.initialized(params); + Ok(()) + }, + DidOpenTextDocument::METHOD => { + let params: DidOpenTextDocumentParams = from_value(params).unwrap(); + self.did_open(params); + Ok(()) + }, + DidChangeTextDocument::METHOD => { + let params: DidChangeTextDocumentParams = from_value(params).unwrap(); + self.did_change(params); + Ok(()) + }, + WillSaveTextDocument::METHOD => { + let params: WillSaveTextDocumentParams = from_value(params).unwrap(); + self.will_save(params); + Ok(()) + }, + DidSaveTextDocument::METHOD => { + let params: DidSaveTextDocumentParams = from_value(params).unwrap(); + self.did_save(params); + Ok(()) + }, + DidCloseTextDocument::METHOD => { + let params: DidCloseTextDocumentParams = from_value(params).unwrap(); + self.did_close(params); + Ok(()) + }, + DidChangeConfiguration::METHOD => { + let params: DidChangeConfigurationParams = from_value(params).unwrap(); + self.did_change_configuration(params); + Ok(()) + }, + DidChangeWatchedFiles::METHOD => { + let params: DidChangeWatchedFilesParams = from_value(params).unwrap(); + self.did_change_watched_files(params); + Ok(()) + }, + DidChangeWorkspaceFolders::METHOD => { + let params: DidChangeWorkspaceFoldersParams = from_value(params).unwrap(); + self.did_change_workspace_folders(params); + Ok(()) + }, + DidRenameFiles::METHOD => { + let params: RenameFilesParams = from_value(params).unwrap(); + self.did_rename_files(params); + Ok(()) + }, + DidCreateFiles::METHOD => { + let params: CreateFilesParams = from_value(params).unwrap(); + self.did_create_files(params); + Ok(()) + }, + DidDeleteFiles::METHOD => { + let params: DeleteFilesParams = from_value(params).unwrap(); + self.did_delete_files(params); + Ok(()) + }, + + _ => { + Err(JsValue::from_str("Method not dispatched")) + } + } + } +} + + + +impl Handler for Dispatcher { + fn initialize(&self, params: InitializeParams) -> Result { + let mut res = vec![]; + self.connection.log_message(MessageType::INFO, "Dispatcher initializing"); + for handler in &self.handlers { + res.push(handler.initialize(params.clone())); + } + let res: Vec = res.iter().filter_map(|i| i.clone().ok()).collect(); + let mut result = InitializeResult::default(); + + let tmp_cap = res.iter().filter(|i| i.capabilities.position_encoding.is_some()).collect::>(); + if !tmp_cap.is_empty() { + result.capabilities.position_encoding = tmp_cap[0].capabilities.position_encoding.clone(); + } + let tmp_cap = res.iter().filter(|i| i.capabilities.text_document_sync.is_some()).collect::>(); + if !tmp_cap.is_empty() { + result.capabilities.text_document_sync = tmp_cap[0].capabilities.text_document_sync.clone(); + } + let tmp_cap = res.iter().filter(|i| i.capabilities.selection_range_provider.is_some()).collect::>(); + if !tmp_cap.is_empty() { + result.capabilities.selection_range_provider = tmp_cap[0].capabilities.selection_range_provider.clone(); + } + let tmp_cap = res.iter().filter(|i| i.capabilities.hover_provider.is_some()).collect::>(); + if !tmp_cap.is_empty() { + result.capabilities.hover_provider = tmp_cap[0].capabilities.hover_provider.clone(); + } + let tmp_cap = res.iter().filter(|i| i.capabilities.completion_provider.is_some()).collect::>(); + if !tmp_cap.is_empty() { + result.capabilities.completion_provider = tmp_cap[0].capabilities.completion_provider.clone(); + } + let tmp_cap = res.iter().filter(|i| i.capabilities.signature_help_provider.is_some()).collect::>(); + if !tmp_cap.is_empty() { + result.capabilities.signature_help_provider = tmp_cap[0].capabilities.signature_help_provider.clone(); + } + let tmp_cap = res.iter().filter(|i| i.capabilities.definition_provider.is_some()).collect::>(); + if !tmp_cap.is_empty() { + result.capabilities.definition_provider = tmp_cap[0].capabilities.definition_provider.clone(); + } + let tmp_cap = res.iter().filter(|i| i.capabilities.type_definition_provider.is_some()).collect::>(); + if !tmp_cap.is_empty() { + result.capabilities.type_definition_provider = tmp_cap[0].capabilities.type_definition_provider.clone(); + } + let tmp_cap = res.iter().filter(|i| i.capabilities.implementation_provider.is_some()).collect::>(); + if !tmp_cap.is_empty() { + result.capabilities.implementation_provider = tmp_cap[0].capabilities.implementation_provider.clone(); + } + let tmp_cap = res.iter().filter(|i| i.capabilities.references_provider.is_some()).collect::>(); + if !tmp_cap.is_empty() { + result.capabilities.references_provider = tmp_cap[0].capabilities.references_provider.clone(); + } + let tmp_cap = res.iter().filter(|i| i.capabilities.document_highlight_provider.is_some()).collect::>(); + if !tmp_cap.is_empty() { + result.capabilities.document_highlight_provider = tmp_cap[0].capabilities.document_highlight_provider.clone(); + } + let tmp_cap = res.iter().filter(|i| i.capabilities.document_symbol_provider.is_some()).collect::>(); + if !tmp_cap.is_empty() { + result.capabilities.document_symbol_provider = tmp_cap[0].capabilities.document_symbol_provider.clone(); + } + let tmp_cap = res.iter().filter(|i| i.capabilities.workspace_symbol_provider.is_some()).collect::>(); + if !tmp_cap.is_empty() { + result.capabilities.workspace_symbol_provider = tmp_cap[0].capabilities.workspace_symbol_provider.clone(); + } + let tmp_cap = res.iter().filter(|i| i.capabilities.code_action_provider.is_some()).collect::>(); + if !tmp_cap.is_empty() { + result.capabilities.code_action_provider = tmp_cap[0].capabilities.code_action_provider.clone(); + } + let tmp_cap = res.iter().filter(|i| i.capabilities.code_lens_provider.is_some()).collect::>(); + if !tmp_cap.is_empty() { + result.capabilities.code_lens_provider = tmp_cap[0].capabilities.code_lens_provider; + } + let tmp_cap = res.iter().filter(|i| i.capabilities.document_formatting_provider.is_some()).collect::>(); + if !tmp_cap.is_empty() { + result.capabilities.document_formatting_provider = tmp_cap[0].capabilities.document_formatting_provider.clone(); + } + let tmp_cap = res.iter().filter(|i| i.capabilities.document_range_formatting_provider.is_some()).collect::>(); + if !tmp_cap.is_empty() { + result.capabilities.document_range_formatting_provider = tmp_cap[0].capabilities.document_range_formatting_provider.clone(); + } + let tmp_cap = res.iter().filter(|i| i.capabilities.document_on_type_formatting_provider.is_some()).collect::>(); + if !tmp_cap.is_empty() { + result.capabilities.document_on_type_formatting_provider = tmp_cap[0].capabilities.document_on_type_formatting_provider.clone(); + } + let tmp_cap = res.iter().filter(|i| i.capabilities.rename_provider.is_some()).collect::>(); + if !tmp_cap.is_empty() { + result.capabilities.rename_provider = tmp_cap[0].capabilities.rename_provider.clone(); + } + let tmp_cap = res.iter().filter(|i| i.capabilities.document_link_provider.is_some()).collect::>(); + if !tmp_cap.is_empty() { + result.capabilities.document_link_provider = tmp_cap[0].capabilities.document_link_provider.clone(); + } + let tmp_cap = res.iter().filter(|i| i.capabilities.color_provider.is_some()).collect::>(); + if !tmp_cap.is_empty() { + result.capabilities.color_provider = tmp_cap[0].capabilities.color_provider.clone(); + } + let tmp_cap = res.iter().filter(|i| i.capabilities.folding_range_provider.is_some()).collect::>(); + if !tmp_cap.is_empty() { + result.capabilities.folding_range_provider = tmp_cap[0].capabilities.folding_range_provider.clone(); + } + let tmp_cap = res.iter().filter(|i| i.capabilities.declaration_provider.is_some()).collect::>(); + if !tmp_cap.is_empty() { + result.capabilities.declaration_provider = tmp_cap[0].capabilities.declaration_provider.clone(); + } + let tmp_cap = res.iter().filter(|i| i.capabilities.workspace.is_some()).collect::>(); + if !tmp_cap.is_empty() { + result.capabilities.workspace = tmp_cap[0].capabilities.workspace.clone(); + } + let tmp_cap = res.iter().filter(|i| i.capabilities.call_hierarchy_provider.is_some()).collect::>(); + if !tmp_cap.is_empty() { + result.capabilities.call_hierarchy_provider = tmp_cap[0].capabilities.call_hierarchy_provider; + } + let tmp_cap = res.iter().filter(|i| i.capabilities.semantic_tokens_provider.is_some()).collect::>(); + if !tmp_cap.is_empty() { + result.capabilities.semantic_tokens_provider = tmp_cap[0].capabilities.semantic_tokens_provider.clone(); + } + let tmp_cap = res.iter().filter(|i| i.capabilities.moniker_provider.is_some()).collect::>(); + if !tmp_cap.is_empty() { + result.capabilities.moniker_provider = tmp_cap[0].capabilities.moniker_provider.clone(); + } + let tmp_cap = res.iter().filter(|i| i.capabilities.linked_editing_range_provider.is_some()).collect::>(); + if !tmp_cap.is_empty() { + result.capabilities.linked_editing_range_provider = tmp_cap[0].capabilities.linked_editing_range_provider.clone(); + } + let tmp_cap = res.iter().filter(|i| i.capabilities.inline_value_provider.is_some()).collect::>(); + if !tmp_cap.is_empty() { + result.capabilities.inline_value_provider = tmp_cap[0].capabilities.inline_value_provider.clone(); + } + let tmp_cap = res.iter().filter(|i| i.capabilities.inlay_hint_provider.is_some()).collect::>(); + if !tmp_cap.is_empty() { + result.capabilities.inlay_hint_provider = tmp_cap[0].capabilities.inlay_hint_provider.clone(); + } + let tmp_cap = res.iter().filter(|i| i.capabilities.experimental.is_some()).collect::>(); + if !tmp_cap.is_empty() { + result.capabilities.experimental = tmp_cap[0].capabilities.experimental.clone(); + } + Ok(result) + } + + fn initialized(&self, params: InitializedParams) { + self.connection.log_message(MessageType::INFO, "Dispatcher initialized"); + for handler in &self.handlers { + handler.initialized(params); + } + } + + fn shutdown(&self) -> Result<()> { + for handler in &self.handlers { + let _ =handler.shutdown(); + } + Ok(()) + } + + fn did_open(&self, params: DidOpenTextDocumentParams) { + for handler in &self.handlers { + handler.did_open(params.clone()); + } + } + + fn did_change(&self, params: DidChangeTextDocumentParams) { + for handler in &self.handlers { + handler.did_change(params.clone()); + } + } + + fn will_save(&self, params: WillSaveTextDocumentParams) { + for handler in &self.handlers { + handler.will_save(params.clone()); + } + } + + fn will_save_wait_until(&self, params: WillSaveTextDocumentParams) -> Result>> { + let mut text_edit: Vec = vec![]; + for handler in &self.handlers { + let res = handler.will_save_wait_until(params.clone()); + if let Ok(Some(val)) = res { + text_edit.extend(val); + } + } + Ok(Some(text_edit)) + } + + fn did_save(&self, params: DidSaveTextDocumentParams) { + for handler in &self.handlers { + handler.did_save(params.clone()); + } + } + + fn did_close(&self, params: DidCloseTextDocumentParams) { + for handler in &self.handlers { + handler.did_close(params.clone()); + } + } + + fn goto_declaration(&self, params: GotoDeclarationParams) -> Result> { + for handler in &self.handlers { + let res = handler.goto_declaration(params.clone()); + if let Ok(Some(_)) = res { + return res; + } + } + Ok(None) + } + + fn goto_definition(&self, params: GotoDefinitionParams) -> Result> { + for handler in &self.handlers { + let res = handler.goto_definition(params.clone()); + if let Ok(Some(_)) = res { + return res; + } + } + Ok(None) + } + + fn goto_type_definition(&self, params: GotoTypeDefinitionParams) -> Result> { + for handler in &self.handlers { + let res = handler.goto_type_definition(params.clone()); + if let Ok(Some(_)) = res { + return res; + } + } + Ok(None) + } + + fn goto_implementation(&self, params: GotoImplementationParams) -> Result> { + for handler in &self.handlers { + let res = handler.goto_implementation(params.clone()); + if let Ok(Some(_)) = res { + return res; + } + } + Ok(None) + } + + fn references(&self, params: ReferenceParams) -> Result>> { + let mut text_edit: Vec = vec![]; + for handler in &self.handlers { + let res = handler.references(params.clone()); + if let Ok(Some(val)) = res { + text_edit.extend(val); + } + } + Ok(Some(text_edit)) + } + + fn prepare_call_hierarchy(&self, params: CallHierarchyPrepareParams) -> Result>> { + let mut text_edit: Vec = vec![]; + for handler in &self.handlers { + let res = handler.prepare_call_hierarchy(params.clone()); + if let Ok(Some(val)) = res { + text_edit.extend(val); + } + } + Ok(Some(text_edit)) + } + + fn incoming_calls(&self, params: CallHierarchyIncomingCallsParams) -> Result>> { + let mut text_edit: Vec = vec![]; + for handler in &self.handlers { + let res = handler.incoming_calls(params.clone()); + if let Ok(Some(val)) = res { + text_edit.extend(val); + } + } + Ok(Some(text_edit)) + } + + fn outgoing_calls(&self, params: CallHierarchyOutgoingCallsParams) -> Result>> { + let mut text_edit: Vec = vec![]; + for handler in &self.handlers { + let res = handler.outgoing_calls(params.clone()); + if let Ok(Some(val)) = res { + text_edit.extend(val); + } + } + Ok(Some(text_edit)) + } + + fn prepare_type_hierarchy(&self, params: TypeHierarchyPrepareParams) -> Result>> { + let mut text_edit: Vec = vec![]; + for handler in &self.handlers { + let res = handler.prepare_type_hierarchy(params.clone()); + if let Ok(Some(val)) = res { + text_edit.extend(val); + } + } + Ok(Some(text_edit)) + } + + fn supertypes(&self, params: TypeHierarchySupertypesParams) -> Result>> { + let mut text_edit: Vec = vec![]; + for handler in &self.handlers { + let res = handler.supertypes(params.clone()); + if let Ok(Some(val)) = res { + text_edit.extend(val); + } + } + Ok(Some(text_edit)) + } + + fn subtypes(&self, params: TypeHierarchySubtypesParams) -> Result>> { + let mut text_edit: Vec = vec![]; + for handler in &self.handlers { + let res = handler.subtypes(params.clone()); + if let Ok(Some(val)) = res { + text_edit.extend(val); + } + } + Ok(Some(text_edit)) + } + + fn document_highlight(&self, params: DocumentHighlightParams) -> Result>> { + let mut text_edit: Vec = vec![]; + for handler in &self.handlers { + let res = handler.document_highlight(params.clone()); + if let Ok(Some(val)) = res { + text_edit.extend(val); + } + } + Ok(Some(text_edit)) + } + + fn document_link(&self, params: DocumentLinkParams) -> Result>> { + let mut text_edit: Vec = vec![]; + for handler in &self.handlers { + let res = handler.document_link(params.clone()); + if let Ok(Some(val)) = res { + text_edit.extend(val); + } + } + Ok(Some(text_edit)) + } + + fn document_link_resolve(&self, params: DocumentLink) -> Result { + for handler in &self.handlers { + let res = handler.document_link_resolve(params.clone()); + if res.is_ok() { + return res; + } + } + Err(Error::new(ErrorCode::MethodNotFound)) + + } + + fn hover(&self, params: HoverParams) -> Result> { + for handler in &self.handlers { + let res = handler.hover(params.clone()); + if let Ok(Some(_)) = res { + return res; + } + } + Ok(None) + } + + fn code_lens(&self, params: CodeLensParams) -> Result>> { + let mut text_edit: Vec = vec![]; + for handler in &self.handlers { + let res = handler.code_lens(params.clone()); + if let Ok(Some(val)) = res { + text_edit.extend(val); + } + } + Ok(Some(text_edit)) + } + + fn code_lens_resolve(&self, params: CodeLens) -> Result { + for handler in &self.handlers { + let res = handler.code_lens_resolve(params.clone()); + if res.is_ok() { + return res; + } + } + Err(Error::new(ErrorCode::MethodNotFound)) + } + + fn folding_range(&self, params: FoldingRangeParams) -> Result>> { + let mut text_edit: Vec = vec![]; + for handler in &self.handlers { + let res = handler.folding_range(params.clone()); + if let Ok(Some(val)) = res { + text_edit.extend(val); + } + } + Ok(Some(text_edit)) + } + + fn selection_range(&self, params: SelectionRangeParams) -> Result>> { + let mut text_edit: Vec = vec![]; + for handler in &self.handlers { + let res = handler.selection_range(params.clone()); + if let Ok(Some(val)) = res { + text_edit.extend(val); + } + } + Ok(Some(text_edit)) + } + + fn document_symbol(&self, params: DocumentSymbolParams) -> Result> { + for handler in &self.handlers { + let res = handler.document_symbol(params.clone()); + if let Ok(Some(_)) = res { + return res; + } + } + Ok(None) + } + + fn semantic_tokens_full(&self, params: SemanticTokensParams) -> Result> { + for handler in &self.handlers { + let res = handler.semantic_tokens_full(params.clone()); + if let Ok(Some(_)) = res { + return res; + } + } + Ok(None) + } + + fn semantic_tokens_full_delta(&self, params: SemanticTokensDeltaParams) -> Result> { + for handler in &self.handlers { + let res = handler.semantic_tokens_full_delta(params.clone()); + if let Ok(Some(_)) = res { + return res; + } + } + Ok(None) + } + + fn semantic_tokens_range(&self, params: SemanticTokensRangeParams) -> Result> { + for handler in &self.handlers { + let res = handler.semantic_tokens_range(params.clone()); + if let Ok(Some(_)) = res { + return res; + } + } + Ok(None) + } + + fn inline_value(&self, params: InlineValueParams) -> Result>> { + let mut text_edit: Vec = vec![]; + for handler in &self.handlers { + let res = handler.inline_value(params.clone()); + if let Ok(Some(val)) = res { + text_edit.extend(val); + } + } + Ok(Some(text_edit)) + } + + fn inlay_hint(&self, params: InlayHintParams) -> Result>> { + let mut text_edit: Vec = vec![]; + for handler in &self.handlers { + let res = handler.inlay_hint(params.clone()); + if let Ok(Some(val)) = res { + text_edit.extend(val); + } + } + Ok(Some(text_edit)) + } + + fn inlay_hint_resolve(&self, params: InlayHint) -> Result { + for handler in &self.handlers { + let res = handler.inlay_hint_resolve(params.clone()); + if res.is_ok() { + return res; + } + } + Err(Error::new(ErrorCode::MethodNotFound)) + } + + fn moniker(&self, params: MonikerParams) -> Result>> { + let mut text_edit: Vec = vec![]; + for handler in &self.handlers { + let res = handler.moniker(params.clone()); + if let Ok(Some(val)) = res { + text_edit.extend(val); + } + } + Ok(Some(text_edit)) + } + + fn completion(&self, params: CompletionParams) -> Result> { + for handler in &self.handlers { + let res = handler.completion(params.clone()); + if let Ok(Some(_)) = res { + return res; + } + } + Ok(None) + } + + fn completion_resolve(&self, params: CompletionItem) -> Result { + for handler in &self.handlers { + let res = handler.completion_resolve(params.clone()); + if res.is_ok() { + return res; + } + } + Err(Error::new(ErrorCode::MethodNotFound)) + } + + fn diagnostic(&self, params: DocumentDiagnosticParams) -> Result { + for handler in &self.handlers { + let res = handler.diagnostic(params.clone()); + if res.is_ok() { + return res; + } + } + Err(Error::new(ErrorCode::MethodNotFound)) + } + + fn workspace_diagnostic(&self, params: WorkspaceDiagnosticParams) -> Result { + for handler in &self.handlers { + let res = handler.workspace_diagnostic(params.clone()); + if res.is_ok() { + return res; + } + } + Err(Error::new(ErrorCode::MethodNotFound)) + } + + fn signature_help(&self, params: SignatureHelpParams) -> Result> { + for handler in &self.handlers { + let res = handler.signature_help(params.clone()); + if let Ok(Some(_)) = res { + return res; + } + } + Ok(None) + } + + fn code_action(&self, params: CodeActionParams) -> Result> { + for handler in &self.handlers { + let res = handler.code_action(params.clone()); + if let Ok(Some(_)) = res { + return res; + } + } + Ok(None) + } + + fn code_action_resolve(&self, params: CodeAction) -> Result { + for handler in &self.handlers { + let res = handler.code_action_resolve(params.clone()); + if res.is_ok() { + return res; + } + } + Err(Error::new(ErrorCode::MethodNotFound)) + } + + fn document_color(&self, params: DocumentColorParams) -> Result> { + let mut text_edit: Vec = vec![]; + for handler in &self.handlers { + let res = handler.document_color(params.clone()); + if let Ok(val) = res { + text_edit.extend(val); + } + } + Ok(text_edit) + } + + fn color_presentation(&self, params: ColorPresentationParams) -> Result> { + let mut text_edit: Vec = vec![]; + for handler in &self.handlers { + let res = handler.color_presentation(params.clone()); + if let Ok(val) = res { + text_edit.extend(val); + } + } + Ok(text_edit) + } + + fn formatting(&self, params: DocumentFormattingParams) -> Result>> { + let mut text_edit: Vec = vec![]; + for handler in &self.handlers { + let res = handler.formatting(params.clone()); + if let Ok(Some(val)) = res { + text_edit.extend(val); + } + } + Ok(Some(text_edit)) + } + + fn range_formatting(&self, params: DocumentRangeFormattingParams) -> Result>> { + let mut text_edit: Vec = vec![]; + for handler in &self.handlers { + let res = handler.range_formatting(params.clone()); + if let Ok(Some(val)) = res { + text_edit.extend(val); + } + } + Ok(Some(text_edit)) + } + + fn on_type_formatting(&self, params: DocumentOnTypeFormattingParams) -> Result>> { + let mut text_edit: Vec = vec![]; + for handler in &self.handlers { + let res = handler.on_type_formatting(params.clone()); + if let Ok(Some(val)) = res { + text_edit.extend(val); + } + } + Ok(Some(text_edit)) + } + + fn rename(&self, params: RenameParams) -> Result> { + for handler in &self.handlers { + let res = handler.rename(params.clone()); + if let Ok(Some(_)) = res { + return res; + } + } + Ok(None) + } + + fn prepare_rename(&self, params: TextDocumentPositionParams) -> Result> { + for handler in &self.handlers { + let res = handler.prepare_rename(params.clone()); + if let Ok(Some(_)) = res { + return res; + } + } + Ok(None) + } + + fn linked_editing_range(&self, params: LinkedEditingRangeParams) -> Result> { + for handler in &self.handlers { + let res = handler.linked_editing_range(params.clone()); + if let Ok(Some(_)) = res { + return res; + } + } + Ok(None) + } + + fn symbol(&self, params: WorkspaceSymbolParams) -> Result>> { + let mut text_edit: Vec = vec![]; + for handler in &self.handlers { + let res = handler.symbol(params.clone()); + if let Ok(Some(val)) = res { + text_edit.extend(val); + } + } + Ok(Some(text_edit)) + } + + fn symbol_resolve(&self, params: WorkspaceSymbol) -> Result { + for handler in &self.handlers { + let res = handler.symbol_resolve(params.clone()); + if res.is_ok() { + return res; + } + } + Err(Error::new(ErrorCode::MethodNotFound)) + } + + fn did_change_configuration(&self, params: DidChangeConfigurationParams) { + for handler in &self.handlers { + handler.did_change_configuration(params.clone()); + } + } + + fn did_change_workspace_folders(&self, params: DidChangeWorkspaceFoldersParams) { + for handler in &self.handlers { + handler.did_change_workspace_folders(params.clone()); + } + } + + fn will_create_files(&self, params: CreateFilesParams) -> Result> { + for handler in &self.handlers { + let res = handler.will_create_files(params.clone()); + if let Ok(Some(_)) = res { + return res; + } + } + Ok(None) + } + + fn did_create_files(&self, params: CreateFilesParams) { + for handler in &self.handlers { + handler.did_create_files(params.clone()); + } + } + + fn will_rename_files(&self, params: RenameFilesParams) -> Result> { + for handler in &self.handlers { + let res = handler.will_rename_files(params.clone()); + if let Ok(Some(_)) = res { + return res; + } + } + Ok(None) + } + + fn did_rename_files(&self, params: RenameFilesParams) { + for handler in &self.handlers { + handler.did_rename_files(params.clone()); + } + } + + fn will_delete_files(&self, params: DeleteFilesParams) -> Result> { + for handler in &self.handlers { + let res = handler.will_delete_files(params.clone()); + if let Ok(Some(_)) = res { + return res; + } + } + Ok(None) + } + + fn did_delete_files(&self, params: DeleteFilesParams) { + for handler in &self.handlers { + handler.did_delete_files(params.clone()); + } + } + + fn did_change_watched_files(&self, params: DidChangeWatchedFilesParams) { + for handler in &self.handlers { + handler.did_change_watched_files(params.clone()); + } + } + + fn execute_command(&self, params: ExecuteCommandParams) -> Result> { + for handler in &self.handlers { + let res = handler.execute_command(params.clone()); + if let Ok(Some(_)) = res { + return res; + } + } + Ok(None) + } +} \ No newline at end of file diff --git a/libs/lsp-handler/src/handler.rs b/libs/lsp-handler/src/handler.rs new file mode 100644 index 00000000..394081c3 --- /dev/null +++ b/libs/lsp-handler/src/handler.rs @@ -0,0 +1,1207 @@ +use crate::jsonrpc::{Error, Result}; + +use lsp_types::request::{ + GotoDeclarationParams, GotoDeclarationResponse, GotoImplementationParams, + GotoImplementationResponse, GotoTypeDefinitionParams, GotoTypeDefinitionResponse, +}; +use lsp_types::*; +use serde_json::Value; + +/// Trait implemented by language server backends. +/// +/// This interface allows servers adhering to the [Language Server Protocol] to be implemented in a +/// safe and easily testable way without exposing the low-level implementation details. +/// +/// [Language Server Protocol]: https://microsoft.github.io/language-server-protocol/ +pub trait Handler { + /// The [`initialize`] request is the first request sent from the client to the server. + /// + /// [`initialize`]: https://microsoft.github.io/language-server-protocol/specification#initialize + /// + /// This method is guaranteed to only execute once. If the client sends this request to the + /// server again, the server will respond with JSON-RPC error code `-32600` (invalid request). + fn initialize(&self, params: InitializeParams) -> Result; + + /// The [`initialized`] notification is sent from the client to the server after the client + /// received the result of the initialize request but before the client sends anything else. + /// + /// [`initialized`]: https://microsoft.github.io/language-server-protocol/specification#initialized + /// + /// The server can use the `initialized` notification, for example, to dynamically register + /// capabilities with the client. + fn initialized(&self, params: InitializedParams) { + let _ = params; + } + + /// The [`shutdown`] request asks the server to gracefully shut down, but to not exit. + /// + /// [`shutdown`]: https://microsoft.github.io/language-server-protocol/specification#shutdown + /// + /// This request is often later followed by an [`exit`] notification, which will cause the + /// server to exit immediately. + /// + /// [`exit`]: https://microsoft.github.io/language-server-protocol/specification#exit + /// + /// This method is guaranteed to only execute once. If the client sends this request to the + /// server again, the server will respond with JSON-RPC error code `-32600` (invalid request). + fn shutdown(&self) -> Result<()>; + + // Document Synchronization + + /// The [`textDocument/didOpen`] notification is sent from the client to the server to signal + /// that a new text document has been opened by the client. + /// + /// [`textDocument/didOpen`]: https://microsoft.github.io/language-server-protocol/specification#textDocument_didOpen + /// + /// The document's truth is now managed by the client and the server must not try to read the + /// document’s truth using the document's URI. "Open" in this sense means it is managed by the + /// client. It doesn't necessarily mean that its content is presented in an editor. + fn did_open(&self, params: DidOpenTextDocumentParams) { + let _ = params; + eprintln!("Got a textDocument/didOpen notification, but it is not implemented"); + } + + /// The [`textDocument/didChange`] notification is sent from the client to the server to signal + /// changes to a text document. + /// + /// [`textDocument/didChange`]: https://microsoft.github.io/language-server-protocol/specification#textDocument_didChange + /// + /// This notification will contain a distinct version tag and a list of edits made to the + /// document for the server to interpret. + fn did_change(&self, params: DidChangeTextDocumentParams) { + let _ = params; + eprintln!("Got a textDocument/didChange notification, but it is not implemented"); + } + + /// The [`textDocument/willSave`] notification is sent from the client to the server before the + /// document is actually saved. + /// + /// [`textDocument/willSave`]: https://microsoft.github.io/language-server-protocol/specification#textDocument_willSave + fn will_save(&self, params: WillSaveTextDocumentParams) { + let _ = params; + eprintln!("Got a textDocument/willSave notification, but it is not implemented"); + } + + /// The [`textDocument/willSaveWaitUntil`] request is sent from the client to the server before + /// the document is actually saved. + /// + /// [`textDocument/willSaveWaitUntil`]: https://microsoft.github.io/language-server-protocol/specification#textDocument_willSaveWaitUntil + /// + /// The request can return an array of `TextEdit`s which will be applied to the text document + /// before it is saved. + /// + /// Please note that clients might drop results if computing the text edits took too long or if + /// a server constantly fails on this request. This is done to keep the save fast and reliable. + fn will_save_wait_until( + &self, + params: WillSaveTextDocumentParams, + ) -> Result>> { + let _ = params; + eprintln!("Got a textDocument/willSaveWaitUntil request, but it is not implemented"); + Err(Error::method_not_found()) + } + + /// The [`textDocument/didSave`] notification is sent from the client to the server when the + /// document was saved in the client. + /// + /// [`textDocument/didSave`]: https://microsoft.github.io/language-server-protocol/specification#textDocument_didSave + fn did_save(&self, params: DidSaveTextDocumentParams) { + let _ = params; + eprintln!("Got a textDocument/didSave notification, but it is not implemented"); + } + + /// The [`textDocument/didClose`] notification is sent from the client to the server when the + /// document got closed in the client. + /// + /// [`textDocument/didClose`]: https://microsoft.github.io/language-server-protocol/specification#textDocument_didClose + /// + /// The document's truth now exists where the document's URI points to (e.g. if the document's + /// URI is a file URI, the truth now exists on disk). + fn did_close(&self, params: DidCloseTextDocumentParams) { + let _ = params; + eprintln!("Got a textDocument/didClose notification, but it is not implemented"); + } + + // Language Features + + /// The [`textDocument/declaration`] request asks the server for the declaration location of a + /// symbol at a given text document position. + /// + /// [`textDocument/declaration`]: https://microsoft.github.io/language-server-protocol/specification#textDocument_declaration + /// + /// # Compatibility + /// + /// This request was introduced in specification version 3.14.0. + /// + /// The [`GotoDeclarationResponse::Link`](lsp_types::GotoDefinitionResponse::Link) return value + /// was introduced in specification version 3.14.0 and requires client-side support in order to + /// be used. It can be returned if the client set the following field to `true` in the + /// [`initialize`](Self::initialize) method: + /// + /// ```text + /// InitializeParams::capabilities::text_document::declaration::link_support + /// ``` + fn goto_declaration( + &self, + params: GotoDeclarationParams, + ) -> Result> { + let _ = params; + eprintln!("Got a textDocument/declaration request, but it is not implemented"); + Err(Error::method_not_found()) + } + + /// The [`textDocument/definition`] request asks the server for the definition location of a + /// symbol at a given text document position. + /// + /// [`textDocument/definition`]: https://microsoft.github.io/language-server-protocol/specification#textDocument_definition + /// + /// # Compatibility + /// + /// The [`GotoDefinitionResponse::Link`](lsp_types::GotoDefinitionResponse::Link) return value + /// was introduced in specification version 3.14.0 and requires client-side support in order to + /// be used. It can be returned if the client set the following field to `true` in the + /// [`initialize`](Self::initialize) method: + /// + /// ```text + /// InitializeParams::capabilities::text_document::definition::link_support + /// ``` + fn goto_definition( + &self, + params: GotoDefinitionParams, + ) -> Result> { + let _ = params; + eprintln!("Got a textDocument/definition request, but it is not implemented"); + Err(Error::method_not_found()) + } + + /// The [`textDocument/typeDefinition`] request asks the server for the type definition location of + /// a symbol at a given text document position. + /// + /// [`textDocument/typeDefinition`]: https://microsoft.github.io/language-server-protocol/specification#textDocument_typeDefinition + /// + /// # Compatibility + /// + /// This request was introduced in specification version 3.6.0. + /// + /// The [`GotoTypeDefinitionResponse::Link`](lsp_types::GotoDefinitionResponse::Link) return + /// value was introduced in specification version 3.14.0 and requires client-side support in + /// order to be used. It can be returned if the client set the following field to `true` in the + /// [`initialize`](Self::initialize) method: + /// + /// ```text + /// InitializeParams::capabilities::text_document::type_definition::link_support + /// ``` + fn goto_type_definition( + &self, + params: GotoTypeDefinitionParams, + ) -> Result> { + let _ = params; + eprintln!("Got a textDocument/typeDefinition request, but it is not implemented"); + Err(Error::method_not_found()) + } + + /// The [`textDocument/implementation`] request is sent from the client to the server to resolve + /// the implementation location of a symbol at a given text document position. + /// + /// [`textDocument/implementation`]: https://microsoft.github.io/language-server-protocol/specification#textDocument_implementation + /// + /// # Compatibility + /// + /// This request was introduced in specification version 3.6.0. + /// + /// The [`GotoImplementationResponse::Link`](lsp_types::GotoDefinitionResponse::Link) + /// return value was introduced in specification version 3.14.0 and requires client-side + /// support in order to be used. It can be returned if the client set the following field to + /// `true` in the [`initialize`](Self::initialize) method: + /// + /// ```text + /// InitializeParams::capabilities::text_document::implementation::link_support + /// ``` + fn goto_implementation( + &self, + params: GotoImplementationParams, + ) -> Result> { + let _ = params; + eprintln!("Got a textDocument/implementation request, but it is not implemented"); + Err(Error::method_not_found()) + } + + /// The [`textDocument/references`] request is sent from the client to the server to resolve + /// project-wide references for the symbol denoted by the given text document position. + /// + /// [`textDocument/references`]: https://microsoft.github.io/language-server-protocol/specification#textDocument_references + + fn references(&self, params: ReferenceParams) -> Result>> { + let _ = params; + eprintln!("Got a textDocument/references request, but it is not implemented"); + Err(Error::method_not_found()) + } + + /// The [`textDocument/prepareCallHierarchy`] request is sent from the client to the server to + /// return a call hierarchy for the language element of given text document positions. + /// + /// [`textDocument/prepareCallHierarchy`]: https://microsoft.github.io/language-server-protocol/specification#textDocument_prepareCallHierarchy + /// + /// The call hierarchy requests are executed in two steps: + /// + /// 1. First, a call hierarchy item is resolved for the given text document position (this + /// method). + /// 2. For a call hierarchy item, the incoming or outgoing call hierarchy items are resolved + /// inside [`incoming_calls`] and [`outgoing_calls`], respectively. + /// + /// [`incoming_calls`]: Self::incoming_calls + /// [`outgoing_calls`]: Self::outgoing_calls + /// + /// # Compatibility + /// + /// This request was introduced in specification version 3.16.0. + fn prepare_call_hierarchy( + &self, + params: CallHierarchyPrepareParams, + ) -> Result>> { + let _ = params; + eprintln!("Got a textDocument/prepareCallHierarchy request, but it is not implemented"); + Err(Error::method_not_found()) + } + + /// The [`callHierarchy/incomingCalls`] request is sent from the client to the server to + /// resolve **incoming** calls for a given call hierarchy item. + /// + /// The request doesn't define its own client and server capabilities. It is only issued if a + /// server registers for the [`textDocument/prepareCallHierarchy`] request. + /// + /// [`callHierarchy/incomingCalls`]: https://microsoft.github.io/language-server-protocol/specification#callHierarchy_incomingCalls + /// [`textDocument/prepareCallHierarchy`]: Self::prepare_call_hierarchy + /// + /// # Compatibility + /// + /// This request was introduced in specification version 3.16.0. + fn incoming_calls( + &self, + params: CallHierarchyIncomingCallsParams, + ) -> Result>> { + let _ = params; + eprintln!("Got a callHierarchy/incomingCalls request, but it is not implemented"); + Err(Error::method_not_found()) + } + + /// The [`callHierarchy/outgoingCalls`] request is sent from the client to the server to + /// resolve **outgoing** calls for a given call hierarchy item. + /// + /// The request doesn't define its own client and server capabilities. It is only issued if a + /// server registers for the [`textDocument/prepareCallHierarchy`] request. + /// + /// [`callHierarchy/outgoingCalls`]: https://microsoft.github.io/language-server-protocol/specification#callHierarchy_outgoingCalls + /// [`textDocument/prepareCallHierarchy`]: Self::prepare_call_hierarchy + /// + /// # Compatibility + /// + /// This request was introduced in specification version 3.16.0. + fn outgoing_calls( + &self, + params: CallHierarchyOutgoingCallsParams, + ) -> Result>> { + let _ = params; + eprintln!("Got a callHierarchy/outgoingCalls request, but it is not implemented"); + Err(Error::method_not_found()) + } + + /// The [`textDocument/prepareTypeHierarchy`] request is sent from the client to the server to + /// return a type hierarchy for the language element of given text document positions. + /// + /// [`textDocument/prepareTypeHierarchy`]: https://microsoft.github.io/language-server-protocol/specification#textDocument_prepareTypeHierarchy + /// + /// Returns `Ok(None)` if the server couldn’t infer a valid type from the position. + /// + /// The type hierarchy requests are executed in two steps: + /// + /// 1. First, a type hierarchy item is prepared for the given text document position. + /// 2. For a type hierarchy item, the supertype or subtype type hierarchy items are resolved in + /// [`supertypes`](Self::supertypes) and [`subtypes`](Self::subtypes), respectively. + /// + /// # Compatibility + /// + /// This request was introduced in specification version 3.17.0. + fn prepare_type_hierarchy( + &self, + params: TypeHierarchyPrepareParams, + ) -> Result>> { + let _ = params; + eprintln!("Got a textDocument/prepareTypeHierarchy request, but it is not implemented"); + Err(Error::method_not_found()) + } + + /// The [`typeHierarchy/supertypes`] request is sent from the client to the server to resolve + /// the **supertypes** for a given type hierarchy item. + /// + /// Returns `Ok(None)` if the server couldn’t infer a valid type from item in `params`. + /// + /// The request doesn’t define its own client and server capabilities. It is only issued if a + /// server registers for the `textDocument/prepareTypeHierarchy` request. + /// + /// # Compatibility + /// + /// This request was introduced in specification version 3.17.0. + fn supertypes( + &self, + params: TypeHierarchySupertypesParams, + ) -> Result>> { + let _ = params; + eprintln!("Got a typeHierarchy/supertypes request, but it is not implemented"); + Err(Error::method_not_found()) + } + + /// The [`typeHierarchy/subtypes`] request is sent from the client to the server to resolve + /// the **subtypes** for a given type hierarchy item. + /// + /// Returns `Ok(None)` if the server couldn’t infer a valid type from item in `params`. + /// + /// The request doesn’t define its own client and server capabilities. It is only issued if a + /// server registers for the `textDocument/prepareTypeHierarchy` request. + /// + /// # Compatibility + /// + /// This request was introduced in specification version 3.17.0. + fn subtypes( + &self, + params: TypeHierarchySubtypesParams, + ) -> Result>> { + let _ = params; + eprintln!("Got a typeHierarchy/subtypes request, but it is not implemented"); + Err(Error::method_not_found()) + } + + /// The [`textDocument/documentHighlight`] request is sent from the client to the server to + /// resolve appropriate highlights for a given text document position. + /// + /// [`textDocument/documentHighlight`]: https://microsoft.github.io/language-server-protocol/specification#textDocument_documentHighlight + /// + /// For programming languages, this usually highlights all textual references to the symbol + /// scoped to this file. + /// + /// This request differs slightly from `textDocument/references` in that this one is allowed to + /// be more fuzzy. + fn document_highlight( + &self, + params: DocumentHighlightParams, + ) -> Result>> { + let _ = params; + eprintln!("Got a textDocument/documentHighlight request, but it is not implemented"); + Err(Error::method_not_found()) + } + + /// The [`textDocument/documentLink`] request is sent from the client to the server to request + /// the location of links in a document. + /// + /// A document link is a range in a text document that links to an internal or external + /// resource, like another text document or a web site. + /// + /// [`textDocument/documentLink`]: https://microsoft.github.io/language-server-protocol/specification#textDocument_documentLink + /// + /// # Compatibility + /// + /// The [`DocumentLink::tooltip`] field was introduced in specification version 3.15.0 and + /// requires client-side support in order to be used. It can be returned if the client set the + /// following field to `true` in the [`initialize`](Self::initialize) method: + /// + /// ```text + /// InitializeParams::capabilities::text_document::document_link::tooltip_support + /// ``` + fn document_link(&self, params: DocumentLinkParams) -> Result>> { + let _ = params; + eprintln!("Got a textDocument/documentLink request, but it is not implemented"); + Err(Error::method_not_found()) + } + + /// The [`documentLink/resolve`] request is sent from the client to the server to resolve the + /// target of a given document link. + /// + /// [`documentLink/resolve`]: https://microsoft.github.io/language-server-protocol/specification#documentLink_resolve + /// + /// A document link is a range in a text document that links to an internal or external + /// resource, like another text document or a web site. + fn document_link_resolve(&self, params: DocumentLink) -> Result { + let _ = params; + eprintln!("Got a documentLink/resolve request, but it is not implemented"); + Err(Error::method_not_found()) + } + + /// The [`textDocument/hover`] request asks the server for hover information at a given text + /// document position. + /// + /// [`textDocument/hover`]: https://microsoft.github.io/language-server-protocol/specification#textDocument_hover + /// + /// Such hover information typically includes type signature information and inline + /// documentation for the symbol at the given text document position. + fn hover(&self, params: HoverParams) -> Result> { + let _ = params; + eprintln!("Got a textDocument/hover request, but it is not implemented"); + Err(Error::method_not_found()) + } + + /// The [`textDocument/codeLens`] request is sent from the client to the server to compute code + /// lenses for a given text document. + /// + /// [`textDocument/codeLens`]: https://microsoft.github.io/language-server-protocol/specification#textDocument_codeLens + + fn code_lens(&self, params: CodeLensParams) -> Result>> { + let _ = params; + eprintln!("Got a textDocument/codeLens request, but it is not implemented"); + Err(Error::method_not_found()) + } + + /// The [`codeLens/resolve`] request is sent from the client to the server to resolve the + /// command for a given code lens item. + /// + /// [`codeLens/resolve`]: https://microsoft.github.io/language-server-protocol/specification#codeLens_resolve + + fn code_lens_resolve(&self, params: CodeLens) -> Result { + let _ = params; + eprintln!("Got a codeLens/resolve request, but it is not implemented"); + Err(Error::method_not_found()) + } + + /// The [`textDocument/foldingRange`] request is sent from the client to the server to return + /// all folding ranges found in a given text document. + /// + /// [`textDocument/foldingRange`]: https://microsoft.github.io/language-server-protocol/specification#textDocument_foldingRange + /// + /// # Compatibility + /// + /// This request was introduced in specification version 3.10.0. + + fn folding_range(&self, params: FoldingRangeParams) -> Result>> { + let _ = params; + eprintln!("Got a textDocument/foldingRange request, but it is not implemented"); + Err(Error::method_not_found()) + } + + /// The [`textDocument/selectionRange`] request is sent from the client to the server to return + /// suggested selection ranges at an array of given positions. A selection range is a range + /// around the cursor position which the user might be interested in selecting. + /// + /// [`textDocument/selectionRange`]: https://microsoft.github.io/language-server-protocol/specification#textDocument_selectionRange + /// + /// A selection range in the return array is for the position in the provided parameters at the + /// same index. Therefore `params.positions[i]` must be contained in `result[i].range`. + /// + /// # Compatibility + /// + /// This request was introduced in specification version 3.15.0. + + fn selection_range(&self, params: SelectionRangeParams) -> Result>> { + let _ = params; + eprintln!("Got a textDocument/selectionRange request, but it is not implemented"); + Err(Error::method_not_found()) + } + + /// The [`textDocument/documentSymbol`] request is sent from the client to the server to + /// retrieve all symbols found in a given text document. + /// + /// [`textDocument/documentSymbol`]: https://microsoft.github.io/language-server-protocol/specification#textDocument_documentSymbol + /// + /// The returned result is either: + /// + /// * [`DocumentSymbolResponse::Flat`] which is a flat list of all symbols found in a given + /// text document. Then neither the symbol’s location range nor the symbol’s container name + /// should be used to infer a hierarchy. + /// * [`DocumentSymbolResponse::Nested`] which is a hierarchy of symbols found in a given text + /// document. + + fn document_symbol( + &self, + params: DocumentSymbolParams, + ) -> Result> { + let _ = params; + eprintln!("Got a textDocument/documentSymbol request, but it is not implemented"); + Err(Error::method_not_found()) + } + + /// The [`textDocument/semanticTokens/full`] request is sent from the client to the server to + /// resolve the semantic tokens of a given file. + /// + /// [`textDocument/semanticTokens/full`]: https://microsoft.github.io/language-server-protocol/specification#textDocument_semanticTokens + /// + /// Semantic tokens are used to add additional color information to a file that depends on + /// language specific symbol information. A semantic token request usually produces a large + /// result. The protocol therefore supports encoding tokens with numbers. In addition, optional + /// support for deltas is available, i.e. [`semantic_tokens_full_delta`]. + /// + /// [`semantic_tokens_full_delta`]: Self::semantic_tokens_full_delta + /// + /// # Compatibility + /// + /// This request was introduced in specification version 3.16.0. + + fn semantic_tokens_full( + &self, + params: SemanticTokensParams, + ) -> Result> { + let _ = params; + eprintln!("Got a textDocument/semanticTokens/full request, but it is not implemented"); + Err(Error::method_not_found()) + } + + /// The [`textDocument/semanticTokens/full/delta`] request is sent from the client to the server to + /// resolve the semantic tokens of a given file, **returning only the delta**. + /// + /// [`textDocument/semanticTokens/full/delta`]: https://microsoft.github.io/language-server-protocol/specification#textDocument_semanticTokens + /// + /// Similar to [`semantic_tokens_full`](Self::semantic_tokens_full), except it returns a + /// sequence of [`SemanticTokensEdit`] to transform a previous result into a new result. + /// + /// # Compatibility + /// + /// This request was introduced in specification version 3.16.0. + + fn semantic_tokens_full_delta( + &self, + params: SemanticTokensDeltaParams, + ) -> Result> { + let _ = params; + eprintln!( + "Got a textDocument/semanticTokens/full/delta request, but it is not implemented" + ); + Err(Error::method_not_found()) + } + + /// The [`textDocument/semanticTokens/range`] request is sent from the client to the server to + /// resolve the semantic tokens **for the visible range** of a given file. + /// + /// [`textDocument/semanticTokens/range`]: https://microsoft.github.io/language-server-protocol/specification#textDocument_semanticTokens + /// + /// When a user opens a file, it can be beneficial to only compute the semantic tokens for the + /// visible range (faster rendering of the tokens in the user interface). If a server can + /// compute these tokens faster than for the whole file, it can implement this method to handle + /// this special case. + /// + /// See the [`semantic_tokens_full`](Self::semantic_tokens_full) documentation for more + /// details. + /// + /// # Compatibility + /// + /// This request was introduced in specification version 3.16.0. + + fn semantic_tokens_range( + &self, + params: SemanticTokensRangeParams, + ) -> Result> { + let _ = params; + eprintln!("Got a textDocument/semanticTokens/range request, but it is not implemented"); + Err(Error::method_not_found()) + } + + /// The [`textDocument/inlineValue`] request is sent from the client to the server to compute + /// inline values for a given text document that may be rendered in the editor at the end of + /// lines. + /// + /// [`textDocument/inlineValue`]: https://microsoft.github.io/language-server-protocol/specification#textDocument_inlineValue + /// + /// # Compatibility + /// + /// This request was introduced in specification version 3.17.0. + + fn inline_value(&self, params: InlineValueParams) -> Result>> { + let _ = params; + eprintln!("Got a textDocument/inlineValue request, but it is not implemented"); + Err(Error::method_not_found()) + } + + /// The [`textDocument/inlayHint`] request is sent from the client to the server to compute + /// inlay hints for a given `(text document, range)` tuple that may be rendered in the editor + /// in place with other text. + /// + /// [`textDocument/inlayHint`]: https://microsoft.github.io/language-server-protocol/specification#textDocument_inlayHint + /// + /// # Compatibility + /// + /// This request was introduced in specification version 3.17.0 + + fn inlay_hint(&self, params: InlayHintParams) -> Result>> { + let _ = params; + eprintln!("Got a textDocument/inlayHint request, but it is not implemented"); + Err(Error::method_not_found()) + } + + /// The [`inlayHint/resolve`] request is sent from the client to the server to resolve + /// additional information for a given inlay hint. + /// + /// [`inlayHint/resolve`]: https://microsoft.github.io/language-server-protocol/specification#inlayHint_resolve + /// + /// This is usually used to compute the tooltip, location or command properties of an inlay + /// hint’s label part to avoid its unnecessary computation during the `textDocument/inlayHint` + /// request. + /// + /// Consider a client announces the `label.location` property as a property that can be + /// resolved lazily using the client capability: + /// + /// ```js + /// textDocument.inlayHint.resolveSupport = { properties: ['label.location'] }; + /// ``` + /// + /// then an inlay hint with a label part, but without a location, must be resolved using the + /// `inlayHint/resolve` request before it can be used. + /// + /// # Compatibility + /// + /// This request was introduced in specification version 3.17.0 + + fn inlay_hint_resolve(&self, params: InlayHint) -> Result { + let _ = params; + eprintln!("Got a inlayHint/resolve request, but it is not implemented"); + Err(Error::method_not_found()) + } + + /// The [`textDocument/moniker`] request is sent from the client to the server to get the + /// symbol monikers for a given text document position. + /// + /// [`textDocument/moniker`]: https://microsoft.github.io/language-server-protocol/specification#textDocument_moniker + /// + /// An array of `Moniker` types is returned as response to indicate possible monikers at the + /// given location. If no monikers can be calculated, `Some(vec![])` or `None` should be + /// returned. + /// + /// # Concept + /// + /// The Language Server Index Format (LSIF) introduced the concept of _symbol monikers_ to help + /// associate symbols across different indexes. This request adds capability for LSP server + /// implementations to provide the same symbol moniker information given a text document + /// position. + /// + /// Clients can utilize this method to get the moniker at the current location in a file the + /// user is editing and do further code navigation queries in other services that rely on LSIF + /// indexes and link symbols together. + /// + /// # Compatibility + /// + /// This request was introduced in specification version 3.16.0. + + fn moniker(&self, params: MonikerParams) -> Result>> { + let _ = params; + eprintln!("Got a textDocument/moniker request, but it is not implemented"); + Err(Error::method_not_found()) + } + + /// The [`textDocument/completion`] request is sent from the client to the server to compute + /// completion items at a given cursor position. + /// + /// If computing full completion items is expensive, servers can additionally provide a handler + /// for the completion item resolve request (`completionItem/resolve`). This request is sent + /// when a completion item is selected in the user interface. + /// + /// [`textDocument/completion`]: https://microsoft.github.io/language-server-protocol/specification#textDocument_completion + /// + /// # Compatibility + /// + /// Since 3.16.0, the client can signal that it can resolve more properties lazily. This is + /// done using the `completion_item.resolve_support` client capability which lists all + /// properties that can be filled in during a `completionItem/resolve` request. + /// + /// All other properties (usually `sort_text`, `filter_text`, `insert_text`, and `text_edit`) + /// must be provided in the `textDocument/completion` response and must not be changed during + /// resolve. + + fn completion(&self, params: CompletionParams) -> Result> { + let _ = params; + eprintln!("Got a textDocument/completion request, but it is not implemented"); + Err(Error::method_not_found()) + } + + /// The [`completionItem/resolve`] request is sent from the client to the server to resolve + /// additional information for a given completion item. + /// + /// [`completionItem/resolve`]: https://microsoft.github.io/language-server-protocol/specification#completionItem_resolve + + fn completion_resolve(&self, params: CompletionItem) -> Result { + let _ = params; + eprintln!("Got a completionItem/resolve request, but it is not implemented"); + Err(Error::method_not_found()) + } + + /// The [`textDocument/diagnostic`] request is sent from the client to the server to ask the + /// server to compute the diagnostics for a given document. + /// + /// As with other pull requests, the server is asked to compute the diagnostics for the + /// currently synced version of the document. + /// + /// The request doesn't define its own client and server capabilities. It is only issued if a + /// server registers for the [`textDocument/diagnostic`] request. + /// + /// [`textDocument/diagnostic`]: https://microsoft.github.io/language-server-protocol/specification#textDocument_diagnostic + /// + /// # Compatibility + /// + /// This request was introduced in specification version 3.17.0. + + fn diagnostic( + &self, + params: DocumentDiagnosticParams, + ) -> Result { + let _ = params; + eprintln!("Got a textDocument/diagnostic request, but it is not implemented"); + Err(Error::method_not_found()) + } + + /// The [`workspace/diagnostic`] request is sent from the client to the server to ask the + /// server to compute workspace wide diagnostics which previously where pushed from the server + /// to the client. + /// + /// In contrast to the [`textDocument/diagnostic`] request, the workspace request can be + /// long-running and is not bound to a specific workspace or document state. If the client + /// supports streaming for the workspace diagnostic pull, it is legal to provide a + /// `textDocument/diagnostic` report multiple times for the same document URI. The last one + /// reported will win over previous reports. + /// + /// [`textDocument/diagnostic`]: https://microsoft.github.io/language-server-protocol/specification#textDocument_diagnostic + /// + /// If a client receives a diagnostic report for a document in a workspace diagnostic request + /// for which the client also issues individual document diagnostic pull requests, the client + /// needs to decide which diagnostics win and should be presented. In general: + /// + /// * Diagnostics for a higher document version should win over those from a lower document + /// version (e.g. note that document versions are steadily increasing). + /// * Diagnostics from a document pull should win over diagnostics from a workspace pull. + /// + /// The request doesn't define its own client and server capabilities. It is only issued if a + /// server registers for the [`workspace/diagnostic`] request. + /// + /// [`workspace/diagnostic`]: https://microsoft.github.io/language-server-protocol/specification#workspace_diagnostic + /// + /// # Compatibility + /// + /// This request was introduced in specification version 3.17.0. + + fn workspace_diagnostic( + &self, + params: WorkspaceDiagnosticParams, + ) -> Result { + let _ = params; + eprintln!("Got a workspace/diagnostic request, but it is not implemented"); + Err(Error::method_not_found()) + } + + /// The [`textDocument/signatureHelp`] request is sent from the client to the server to request + /// signature information at a given cursor position. + /// + /// [`textDocument/signatureHelp`]: https://microsoft.github.io/language-server-protocol/specification#textDocument_signatureHelp + + fn signature_help(&self, params: SignatureHelpParams) -> Result> { + let _ = params; + eprintln!("Got a textDocument/signatureHelp request, but it is not implemented"); + Err(Error::method_not_found()) + } + + /// The [`textDocument/codeAction`] request is sent from the client to the server to compute + /// commands for a given text document and range. These commands are typically code fixes to + /// either fix problems or to beautify/refactor code. + /// + /// The result of a [`textDocument/codeAction`] request is an array of `Command` literals which + /// are typically presented in the user interface. + /// + /// [`textDocument/codeAction`]: https://microsoft.github.io/language-server-protocol/specification#textDocument_codeAction + /// + /// To ensure that a server is useful in many clients, the commands specified in a code actions + /// should be handled by the server and not by the client (see [`workspace/executeCommand`] and + /// `ServerCapabilities::execute_command_provider`). If the client supports providing edits + /// with a code action, then the mode should be used. + /// + /// When the command is selected the server should be contacted again (via the + /// [`workspace/executeCommand`] request) to execute the command. + /// + /// [`workspace/executeCommand`]: https://microsoft.github.io/language-server-protocol/specification#workspace_executeCommand + /// + /// # Compatibility + /// + /// ## Since version 3.16.0 + /// + /// A client can offer a server to delay the computation of code action properties during a + /// `textDocument/codeAction` request. This is useful for cases where it is expensive to + /// compute the value of a property (for example, the `edit` property). + /// + /// Clients signal this through the `code_action.resolve_support` client capability which lists + /// all properties a client can resolve lazily. The server capability + /// `code_action_provider.resolve_provider` signals that a server will offer a + /// `codeAction/resolve` route. + /// + /// To help servers uniquely identify a code action in the resolve request, a code action + /// literal may optionally carry a `data` property. This is also guarded by an additional + /// client capability `code_action.data_support`. In general, a client should offer data + /// support if it offers resolve support. + /// + /// It should also be noted that servers shouldn’t alter existing attributes of a code action + /// in a `codeAction/resolve` request. + /// + /// ## Since version 3.8.0 + /// + /// Support for [`CodeAction`] literals to enable the following scenarios: + /// + /// * The ability to directly return a workspace edit from the code action request. + /// This avoids having another server roundtrip to execute an actual code action. + /// However server providers should be aware that if the code action is expensive to compute + /// or the edits are huge it might still be beneficial if the result is simply a command and + /// the actual edit is only computed when needed. + /// + /// * The ability to group code actions using a kind. Clients are allowed to ignore that + /// information. However it allows them to better group code action, for example, into + /// corresponding menus (e.g. all refactor code actions into a refactor menu). + + fn code_action(&self, params: CodeActionParams) -> Result> { + let _ = params; + eprintln!("Got a textDocument/codeAction request, but it is not implemented"); + Err(Error::method_not_found()) + } + + /// The [`codeAction/resolve`] request is sent from the client to the server to resolve + /// additional information for a given code action. + /// + /// [`codeAction/resolve`]: https://microsoft.github.io/language-server-protocol/specification#codeAction_resolve + /// + /// This is usually used to compute the edit property of a [`CodeAction`] to avoid its + /// unnecessary computation during the [`textDocument/codeAction`](Self::code_action) request. + /// + /// # Compatibility + /// + /// This request was introduced in specification version 3.16.0. + + fn code_action_resolve(&self, params: CodeAction) -> Result { + let _ = params; + eprintln!("Got a codeAction/resolve request, but it is not implemented"); + Err(Error::method_not_found()) + } + + /// The [`textDocument/documentColor`] request is sent from the client to the server to list + /// all color references found in a given text document. Along with the range, a color value in + /// RGB is returned. + /// + /// [`textDocument/documentColor`]: https://microsoft.github.io/language-server-protocol/specification#textDocument_documentColor + /// + /// Clients can use the result to decorate color references in an editor. For example: + /// + /// * Color boxes showing the actual color next to the reference + /// * Show a color picker when a color reference is edited + /// + /// # Compatibility + /// + /// This request was introduced in specification version 3.6.0. + + fn document_color(&self, params: DocumentColorParams) -> Result> { + let _ = params; + eprintln!("Got a textDocument/documentColor request, but it is not implemented"); + Err(Error::method_not_found()) + } + + /// The [`textDocument/colorPresentation`] request is sent from the client to the server to + /// obtain a list of presentations for a color value at a given location. + /// + /// [`textDocument/colorPresentation`]: https://microsoft.github.io/language-server-protocol/specification#textDocument_colorPresentation + /// + /// Clients can use the result to: + /// + /// * Modify a color reference + /// * Show in a color picker and let users pick one of the presentations + /// + /// # Compatibility + /// + /// This request was introduced in specification version 3.6.0. + /// + /// This request has no special capabilities and registration options since it is sent as a + /// resolve request for the [`textDocument/documentColor`](Self::document_color) request. + + fn color_presentation( + &self, + params: ColorPresentationParams, + ) -> Result> { + let _ = params; + eprintln!("Got a textDocument/colorPresentation request, but it is not implemented"); + Err(Error::method_not_found()) + } + + /// The [`textDocument/formatting`] request is sent from the client to the server to format a + /// whole document. + /// + /// [`textDocument/formatting`]: https://microsoft.github.io/language-server-protocol/specification#textDocument_formatting + + fn formatting(&self, params: DocumentFormattingParams) -> Result>> { + let _ = params; + eprintln!("Got a textDocument/formatting request, but it is not implemented"); + Err(Error::method_not_found()) + } + + /// The [`textDocument/rangeFormatting`] request is sent from the client to the server to + /// format a given range in a document. + /// + /// [`textDocument/rangeFormatting`]: https://microsoft.github.io/language-server-protocol/specification#textDocument_rangeFormatting + + fn range_formatting( + &self, + params: DocumentRangeFormattingParams, + ) -> Result>> { + let _ = params; + eprintln!("Got a textDocument/rangeFormatting request, but it is not implemented"); + Err(Error::method_not_found()) + } + + /// The [`textDocument/onTypeFormatting`] request is sent from the client to the server to + /// format parts of the document during typing. + /// + /// [`textDocument/onTypeFormatting`]: https://microsoft.github.io/language-server-protocol/specification#textDocument_onTypeFormatting + + fn on_type_formatting( + &self, + params: DocumentOnTypeFormattingParams, + ) -> Result>> { + let _ = params; + eprintln!("Got a textDocument/onTypeFormatting request, but it is not implemented"); + Err(Error::method_not_found()) + } + + /// The [`textDocument/rename`] request is sent from the client to the server to ask the server + /// to compute a workspace change so that the client can perform a workspace-wide rename of a + /// symbol. + /// + /// [`textDocument/rename`]: https://microsoft.github.io/language-server-protocol/specification#textDocument_rename + + fn rename(&self, params: RenameParams) -> Result> { + let _ = params; + eprintln!("Got a textDocument/rename request, but it is not implemented"); + Err(Error::method_not_found()) + } + + /// The [`textDocument/prepareRename`] request is sent from the client to the server to setup + /// and test the validity of a rename operation at a given location. + /// + /// [`textDocument/prepareRename`]: https://microsoft.github.io/language-server-protocol/specification#textDocument_prepareRename + /// + /// # Compatibility + /// + /// This request was introduced in specification version 3.12.0. + + fn prepare_rename( + &self, + params: TextDocumentPositionParams, + ) -> Result> { + let _ = params; + eprintln!("Got a textDocument/prepareRename request, but it is not implemented"); + Err(Error::method_not_found()) + } + + /// The [`textDocument/linkedEditingRange`] request is sent from the client to the server to + /// return for a given position in a document the range of the symbol at the position and all + /// ranges that have the same content. + /// + /// [`textDocument/linkedEditingRange`]: https://microsoft.github.io/language-server-protocol/specification#textDocument_linkedEditingRange + /// + /// Optionally a word pattern can be returned to describe valid contents. + /// + /// A rename to one of the ranges can be applied to all other ranges if the new content is + /// valid. If no result-specific word pattern is provided, the word pattern from the client's + /// language configuration is used. + /// + /// # Compatibility + /// + /// This request was introduced in specification version 3.16.0. + + fn linked_editing_range( + &self, + params: LinkedEditingRangeParams, + ) -> Result> { + let _ = params; + eprintln!("Got a textDocument/linkedEditingRange request, but it is not implemented"); + Err(Error::method_not_found()) + } + + // Workspace Features + + /// The [`workspace/symbol`] request is sent from the client to the server to list project-wide + /// symbols matching the given query string. + /// + /// [`workspace/symbol`]: https://microsoft.github.io/language-server-protocol/specification#workspace_symbol + /// + /// # Compatibility + /// + /// Since 3.17.0, servers can also provider a handler for [`workspaceSymbol/resolve`] requests. + /// This allows servers to return workspace symbols without a range for a `workspace/symbol` + /// request. Clients then need to resolve the range when necessary using the + /// `workspaceSymbol/resolve` request. + /// + /// [`workspaceSymbol/resolve`]: Self::symbol_resolve + /// + /// Servers can only use this new model if clients advertise support for it via the + /// `workspace.symbol.resolve_support` capability. + + fn symbol(&self, params: WorkspaceSymbolParams) -> Result>> { + let _ = params; + eprintln!("Got a workspace/symbol request, but it is not implemented"); + Err(Error::method_not_found()) + } + + /// The [`workspaceSymbol/resolve`] request is sent from the client to the server to resolve + /// additional information for a given workspace symbol. + /// + /// [`workspaceSymbol/resolve`]: https://microsoft.github.io/language-server-protocol/specification#workspace_symbolResolve + /// + /// See the [`symbol`](Self::symbol) documentation for more details. + /// + /// # Compatibility + /// + /// This request was introduced in specification version 3.17.0. + + fn symbol_resolve(&self, params: WorkspaceSymbol) -> Result { + let _ = params; + eprintln!("Got a workspaceSymbol/resolve request, but it is not implemented"); + Err(Error::method_not_found()) + } + + /// The [`workspace/didChangeConfiguration`] notification is sent from the client to the server + /// to signal the change of configuration settings. + /// + /// [`workspace/didChangeConfiguration`]: https://microsoft.github.io/language-server-protocol/specification#workspace_didChangeConfiguration + + fn did_change_configuration(&self, params: DidChangeConfigurationParams) { + let _ = params; + eprintln!("Got a workspace/didChangeConfiguration notification, but it is not implemented"); + } + + /// The [`workspace/didChangeWorkspaceFolders`] notification is sent from the client to the + /// server to inform about workspace folder configuration changes. + /// + /// [`workspace/didChangeWorkspaceFolders`]: https://microsoft.github.io/language-server-protocol/specification#workspace_didChangeWorkspaceFolders + /// + /// The notification is sent by default if both of these boolean fields were set to `true` in + /// the [`initialize`](Self::initialize) method: + /// + /// * `InitializeParams::capabilities::workspace::workspace_folders` + /// * `InitializeResult::capabilities::workspace::workspace_folders::supported` + /// + /// This notification is also sent if the server has registered itself to receive this + /// notification. + + fn did_change_workspace_folders(&self, params: DidChangeWorkspaceFoldersParams) { + let _ = params; + eprintln!( + "Got a workspace/didChangeWorkspaceFolders notification, but it is not implemented" + ); + } + + /// The [`workspace/willCreateFiles`] request is sent from the client to the server before + /// files are actually created as long as the creation is triggered from within the client. + /// + /// [`workspace/willCreateFiles`]: https://microsoft.github.io/language-server-protocol/specification#workspace_willCreateFiles + /// + /// The request can return a [`WorkspaceEdit`] which will be applied to workspace before the + /// files are created. Please note that clients might drop results if computing the edit took + /// too long or if a server constantly fails on this request. This is done to keep creates fast + /// and reliable. + /// + /// # Compatibility + /// + /// This request was introduced in specification version 3.16.0. + + fn will_create_files(&self, params: CreateFilesParams) -> Result> { + let _ = params; + eprintln!("Got a workspace/willCreateFiles request, but it is not implemented"); + Err(Error::method_not_found()) + } + + /// The [`workspace/didCreateFiles`] request is sent from the client to the server when files + /// were created from within the client. + /// + /// [`workspace/didCreateFiles`]: https://microsoft.github.io/language-server-protocol/specification#workspace_didCreateFiles + + fn did_create_files(&self, params: CreateFilesParams) { + let _ = params; + eprintln!("Got a workspace/didCreateFiles notification, but it is not implemented"); + } + + /// The [`workspace/willRenameFiles`] request is sent from the client to the server before + /// files are actually renamed as long as the rename is triggered from within the client. + /// + /// [`workspace/willRenameFiles`]: https://microsoft.github.io/language-server-protocol/specification#workspace_willRenameFiles + /// + /// The request can return a [`WorkspaceEdit`] which will be applied to workspace before the + /// files are renamed. Please note that clients might drop results if computing the edit took + /// too long or if a server constantly fails on this request. This is done to keep creates fast + /// and reliable. + /// + /// # Compatibility + /// + /// This request was introduced in specification version 3.16.0. + + fn will_rename_files(&self, params: RenameFilesParams) -> Result> { + let _ = params; + eprintln!("Got a workspace/willRenameFiles request, but it is not implemented"); + Err(Error::method_not_found()) + } + + /// The [`workspace/didRenameFiles`] notification is sent from the client to the server when + /// files were renamed from within the client. + /// + /// [`workspace/didRenameFiles`]: https://microsoft.github.io/language-server-protocol/specification#workspace_didRenameFiles + + fn did_rename_files(&self, params: RenameFilesParams) { + let _ = params; + eprintln!("Got a workspace/didRenameFiles notification, but it is not implemented"); + } + + /// The [`workspace/willDeleteFiles`] request is sent from the client to the server before + /// files are actually deleted as long as the deletion is triggered from within the client + /// either by a user action or by applying a workspace edit. + /// + /// [`workspace/willDeleteFiles`]: https://microsoft.github.io/language-server-protocol/specification#workspace_willDeleteFiles + /// + /// The request can return a [`WorkspaceEdit`] which will be applied to workspace before the + /// files are deleted. Please note that clients might drop results if computing the edit took + /// too long or if a server constantly fails on this request. This is done to keep deletions + /// fast and reliable. + /// + /// # Compatibility + /// + /// This request was introduced in specification version 3.16.0. + + fn will_delete_files(&self, params: DeleteFilesParams) -> Result> { + let _ = params; + eprintln!("Got a workspace/willDeleteFiles request, but it is not implemented"); + Err(Error::method_not_found()) + } + + /// The [`workspace/didDeleteFiles`] notification is sent from the client to the server when + /// files were deleted from within the client. + /// + /// [`workspace/didDeleteFiles`]: https://microsoft.github.io/language-server-protocol/specification#workspace_didDeleteFiles + + fn did_delete_files(&self, params: DeleteFilesParams) { + let _ = params; + eprintln!("Got a workspace/didDeleteFiles notification, but it is not implemented"); + } + + /// The [`workspace/didChangeWatchedFiles`] notification is sent from the client to the server + /// when the client detects changes to files watched by the language client. + /// + /// [`workspace/didChangeWatchedFiles`]: https://microsoft.github.io/language-server-protocol/specification#workspace_didChangeWatchedFiles + /// + /// It is recommended that servers register for these file events using the registration + /// mechanism. This can be done here or in the [`initialized`](Self::initialized) method using + /// [`Client::register_capability`](crate::Client::register_capability). + + fn did_change_watched_files(&self, params: DidChangeWatchedFilesParams) { + let _ = params; + eprintln!("Got a workspace/didChangeWatchedFiles notification, but it is not implemented"); + } + + /// The [`workspace/executeCommand`] request is sent from the client to the server to trigger + /// command execution on the server. + /// + /// [`workspace/executeCommand`]: https://microsoft.github.io/language-server-protocol/specification#workspace_executeCommand + /// + /// In most cases, the server creates a [`WorkspaceEdit`] structure and applies the changes to + /// the workspace using `Client::apply_edit()` before returning from this function. + + fn execute_command(&self, params: ExecuteCommandParams) -> Result> { + let _ = params; + eprintln!("Got a workspace/executeCommand request, but it is not implemented"); + Err(Error::method_not_found()) + } + + // TODO: Add `work_done_progress_cancel()` here (since 3.15.0) when supported by `tower-lsp`. + // https://github.com/ebkalderon/tower-lsp/issues/176 +} \ No newline at end of file diff --git a/libs/lsp-handler/src/helpers.rs b/libs/lsp-handler/src/helpers.rs new file mode 100644 index 00000000..dc3bf7e3 --- /dev/null +++ b/libs/lsp-handler/src/helpers.rs @@ -0,0 +1,18 @@ +use wasm_bindgen::prelude::*; + +#[wasm_bindgen] +extern "C" { + #[wasm_bindgen(js_namespace = console, js_name = log)] + fn console_log(s: &str); +} + +#[cfg(not(test))] +pub(crate) fn log(s: &str) { + #[allow(unused_unsafe)] + unsafe { + console_log(&("[osmium] ".to_owned() + s)) + } +} + +#[cfg(test)] +pub(crate) fn log(_: &str) {} diff --git a/libs/lsp-handler/src/jsonrpc.rs b/libs/lsp-handler/src/jsonrpc.rs new file mode 100644 index 00000000..e8dbf6f0 --- /dev/null +++ b/libs/lsp-handler/src/jsonrpc.rs @@ -0,0 +1,4 @@ +mod error; + + +pub use self::error::{Error, ErrorCode, Result}; diff --git a/libs/lsp-handler/src/jsonrpc/error.rs b/libs/lsp-handler/src/jsonrpc/error.rs new file mode 100644 index 00000000..19ce45b1 --- /dev/null +++ b/libs/lsp-handler/src/jsonrpc/error.rs @@ -0,0 +1,205 @@ +//! Error types defined by the JSON-RPC specification. + +use std::borrow::Cow; +use std::fmt::{self, Display, Formatter}; + +use serde::{Deserialize, Serialize}; +use serde_json::Value; + +/// A specialized [`Result`] error type for JSON-RPC handlers. +/// +/// [`Result`]: enum@std::result::Result +pub type Result = std::result::Result; + +/// A list of numeric error codes used in JSON-RPC responses. +#[derive(Clone, Copy, Debug, Eq, PartialEq, Serialize, Deserialize)] +#[serde(into = "i64", from = "i64")] +pub enum ErrorCode { + /// Invalid JSON was received by the server. + ParseError, + /// The JSON sent is not a valid Request object. + InvalidRequest, + /// The method does not exist / is not available. + MethodNotFound, + /// Invalid method parameter(s). + InvalidParams, + /// Internal JSON-RPC error. + InternalError, + /// Reserved for implementation-defined server errors. + ServerError(i64), + + /// The request was cancelled by the client. + /// + /// # Compatibility + /// + /// This error code is defined by the Language Server Protocol. + RequestCancelled, + /// The request was invalidated by another incoming request. + /// + /// # Compatibility + /// + /// This error code is specific to the Language Server Protocol. + ContentModified, +} + +impl ErrorCode { + /// Returns the integer error code value. + pub const fn code(&self) -> i64 { + match *self { + ErrorCode::ParseError => -32700, + ErrorCode::InvalidRequest => -32600, + ErrorCode::MethodNotFound => -32601, + ErrorCode::InvalidParams => -32602, + ErrorCode::InternalError => -32603, + ErrorCode::RequestCancelled => -32800, + ErrorCode::ContentModified => -32801, + ErrorCode::ServerError(code) => code, + } + } + + /// Returns a human-readable description of the error. + pub const fn description(&self) -> &'static str { + match *self { + ErrorCode::ParseError => "Parse error", + ErrorCode::InvalidRequest => "Invalid request", + ErrorCode::MethodNotFound => "Method not found", + ErrorCode::InvalidParams => "Invalid params", + ErrorCode::InternalError => "Internal error", + ErrorCode::RequestCancelled => "Canceled", + ErrorCode::ContentModified => "Content modified", + ErrorCode::ServerError(_) => "Server error", + } + } +} + +impl From for ErrorCode { + fn from(code: i64) -> Self { + match code { + -32700 => ErrorCode::ParseError, + -32600 => ErrorCode::InvalidRequest, + -32601 => ErrorCode::MethodNotFound, + -32602 => ErrorCode::InvalidParams, + -32603 => ErrorCode::InternalError, + -32800 => ErrorCode::RequestCancelled, + -32801 => ErrorCode::ContentModified, + code => ErrorCode::ServerError(code), + } + } +} + +impl From for i64 { + fn from(code: ErrorCode) -> Self { + code.code() + } +} + +impl Display for ErrorCode { + fn fmt(&self, f: &mut Formatter) -> fmt::Result { + Display::fmt(&self.code(), f) + } +} + +/// A JSON-RPC error object. +#[derive(Clone, Debug, Eq, PartialEq, Deserialize, Serialize)] +#[serde(deny_unknown_fields)] +pub struct Error { + /// A number indicating the error type that occurred. + pub code: ErrorCode, + /// A short description of the error. + pub message: Cow<'static, str>, + /// Additional information about the error, if any. + #[serde(skip_serializing_if = "Option::is_none")] + pub data: Option, +} + +impl Error { + /// Creates a new error from the given `ErrorCode`. + pub const fn new(code: ErrorCode) -> Self { + Error { + code, + message: Cow::Borrowed(code.description()), + data: None, + } + } + + /// Creates a new parse error (`-32700`). + pub const fn parse_error() -> Self { + Error::new(ErrorCode::ParseError) + } + + /// Creates a new "invalid request" error (`-32600`). + pub const fn invalid_request() -> Self { + Error::new(ErrorCode::InvalidRequest) + } + + /// Creates a new "method not found" error (`-32601`). + pub const fn method_not_found() -> Self { + Error::new(ErrorCode::MethodNotFound) + } + + /// Creates a new "invalid params" error (`-32602`). + pub fn invalid_params(message: M) -> Self + where + M: Into>, + { + Error { + code: ErrorCode::InvalidParams, + message: message.into(), + data: None, + } + } + + /// Creates a new internal error (`-32603`). + pub const fn internal_error() -> Self { + Error::new(ErrorCode::InternalError) + } + + /// Creates a new "request cancelled" error (`-32800`). + /// + /// # Compatibility + /// + /// This error code is defined by the Language Server Protocol. + pub const fn request_cancelled() -> Self { + Error::new(ErrorCode::RequestCancelled) + } + + /// Creates a new "content modified" error (`-32801`). + /// + /// # Compatibility + /// + /// This error code is defined by the Language Server Protocol. + pub const fn content_modified() -> Self { + Error::new(ErrorCode::ContentModified) + } +} + +impl Display for Error { + fn fmt(&self, f: &mut Formatter) -> fmt::Result { + write!(f, "{}: {}", self.code.description(), self.message) + } +} + +impl std::error::Error for Error {} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn error_code_serializes_as_i64() { + let serialized = serde_json::to_string(&ErrorCode::ParseError).unwrap(); + assert_eq!(serialized, "-32700"); + + let serialized = serde_json::to_string(&ErrorCode::ServerError(-12345)).unwrap(); + assert_eq!(serialized, "-12345"); + } + + #[test] + fn error_code_deserializes_from_i64() { + let deserialized: ErrorCode = serde_json::from_str("-32700").unwrap(); + assert_eq!(deserialized, ErrorCode::ParseError); + + let deserialized: ErrorCode = serde_json::from_str("-12345").unwrap(); + assert_eq!(deserialized, ErrorCode::ServerError(-12345)); + } +} diff --git a/libs/lsp-handler/src/lib.rs b/libs/lsp-handler/src/lib.rs new file mode 100644 index 00000000..b541dedd --- /dev/null +++ b/libs/lsp-handler/src/lib.rs @@ -0,0 +1,12 @@ +mod handler; +mod dispatcher; +mod connection; +mod jsonrpc; + +mod helpers; + +pub use handler::Handler; +pub use dispatcher::Dispatcher; +pub use connection::Connection; +pub use jsonrpc::{Error, ErrorCode, Result}; +pub use lsp_types; \ No newline at end of file diff --git a/toolchains/solidity/linter/core/Cargo.lock b/toolchains/solidity/core/Cargo.lock similarity index 64% rename from toolchains/solidity/linter/core/Cargo.lock rename to toolchains/solidity/core/Cargo.lock index cd278eea..b958fc4c 100644 --- a/toolchains/solidity/linter/core/Cargo.lock +++ b/toolchains/solidity/core/Cargo.lock @@ -2,35 +2,20 @@ # It is not intended for manual editing. version = 3 -[[package]] -name = "addr2line" -version = "0.21.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a30b2e23b9e17a9f90641c7ab1549cd9b44f296d3ccbf309d2863cfe398a0cb" -dependencies = [ - "gimli", -] - -[[package]] -name = "adler" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" - [[package]] name = "aho-corasick" -version = "1.1.1" +version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea5d730647d4fadd988536d06fecce94b7b4f2a7efdae548f1cf4b63205518ab" +checksum = "b2969dcb958b36655471fc61f7e416fa76033bdd4bfed0678d8fee1e2d07a1f0" dependencies = [ "memchr", ] [[package]] name = "anstream" -version = "0.5.0" +version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1f58811cfac344940f1a400b6e6231ce35171f614f26439e80f8c1465c5cc0c" +checksum = "2ab91ebe16eb252986481c5b62f6098f3b698a45e34b5b98200cf20dd2484a44" dependencies = [ "anstyle", "anstyle-parse", @@ -42,15 +27,15 @@ dependencies = [ [[package]] name = "anstyle" -version = "1.0.3" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b84bf0a05bbb2a83e5eb6fa36bb6e87baa08193c35ff52bbf6b38d8af2890e46" +checksum = "7079075b41f533b8c61d2a4d073c4676e1f8b249ff94a393b0595db304e0dd87" [[package]] name = "anstyle-parse" -version = "0.2.1" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "938874ff5980b03a87c5524b3ae5b59cf99b1d6bc836848df7bc5ada9643c333" +checksum = "317b9a89c1868f5ea6ff1d9539a69f45dffc21ce321ac1fd1160dfa48c8e2140" dependencies = [ "utf8parse", ] @@ -66,9 +51,9 @@ dependencies = [ [[package]] name = "anstyle-wincon" -version = "2.1.0" +version = "3.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "58f54d10c6dfa51283a066ceab3ec1ab78d13fae00aa49243a45e4571fb79dfd" +checksum = "f0699d10d2f4d628a98ee7b57b289abbc98ff3bad977cb3152709d4bf2330628" dependencies = [ "anstyle", "windows-sys", @@ -80,38 +65,6 @@ version = "1.0.75" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a4668cab20f66d8d020e1fbc0ebe47217433c1b6c8f2040faf858554e394ace6" -[[package]] -name = "ast-extractor" -version = "0.1.0" -dependencies = [ - "proc-macro2", - "quote", - "syn", - "syn-solidity", - "thiserror", -] - -[[package]] -name = "autocfg" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" - -[[package]] -name = "backtrace" -version = "0.3.69" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2089b7e3f35b9dd2d0ed921ead4f6d318c27680d4a5bd167b3ee120edb105837" -dependencies = [ - "addr2line", - "cc", - "cfg-if", - "libc", - "miniz_oxide", - "object", - "rustc-demangle", -] - [[package]] name = "bitflags" version = "1.3.2" @@ -120,24 +73,15 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4682ae6287fcf752ecaabbfcc7b6f9b72aa33933dc23a554d853aea8eea8635" - -[[package]] -name = "bytes" -version = "1.5.0" +version = "2.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2bd12c1caf447e69cd4528f47f94d203fd2582878ecb9e9465484c4148a8223" +checksum = "327762f6e5a765692301e5bb513e0d9fef63be86bbc14528052b1cd3e6f03e07" [[package]] -name = "cc" -version = "1.0.83" +name = "bumpalo" +version = "3.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1174fb0b6ec23863f8b971027804a42614e347eafb0a95bf0b12cdae21fc4d0" -dependencies = [ - "libc", -] +checksum = "7f30e7476521f6f8af1a1c4c0b8cc94f0bee37d91763d0ca2665f299b6cd8aec" [[package]] name = "cfg-if" @@ -147,9 +91,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "clap" -version = "4.4.4" +version = "4.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1d7b8d5ec32af0fadc644bf1fd509a688c2103b185644bb1e29d164e0703136" +checksum = "d04704f56c2cde07f43e8e2c154b43f216dc5c92fc98ada720177362f953b956" dependencies = [ "clap_builder", "clap_derive", @@ -157,9 +101,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.4.4" +version = "4.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5179bb514e4d7c2051749d8fcefa2ed6d06a9f4e6d69faf3805f5d80b8cf8d56" +checksum = "0e231faeaca65ebd1ea3c737966bf858971cd38c3849107aa3ea7de90a804e45" dependencies = [ "anstream", "anstyle", @@ -202,44 +146,24 @@ dependencies = [ "windows-sys", ] -[[package]] -name = "crossbeam-channel" -version = "0.5.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a33c2bf77f2df06183c3aa30d1e96c0695a313d4f9c453cc3762a6db39f99200" -dependencies = [ - "cfg-if", - "crossbeam-utils", -] - -[[package]] -name = "crossbeam-utils" -version = "0.8.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a22b2d63d4d1dc0b7f1b6b2747dd0088008a9be28b6ddf0b1e7d335e3037294" -dependencies = [ - "cfg-if", -] - [[package]] name = "errno" -version = "0.3.3" +version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "136526188508e25c6fef639d7927dfb3e0e3084488bf202267829cf7fc23dbdd" +checksum = "ac3e13f66a2f95e32a39eaa81f6b95d42878ca0e1db0c7543723dfe12557e860" dependencies = [ - "errno-dragonfly", "libc", "windows-sys", ] [[package]] -name = "errno-dragonfly" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa68f1b12764fab894d2755d2518754e71b4fd80ecfb822714a1206c2aab39bf" +name = "extension" +version = "0.1.0" dependencies = [ - "cc", - "libc", + "js-sys", + "linter-server", + "osmium-libs-lsp-handler", + "wasm-bindgen", ] [[package]] @@ -251,12 +175,6 @@ dependencies = [ "percent-encoding", ] -[[package]] -name = "gimli" -version = "0.28.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6fb8d784f27acf97159b40fc4db5ecd8aa23b9ad5ef69cdd136d3bc80665f0c0" - [[package]] name = "glob" version = "0.3.1" @@ -302,6 +220,15 @@ version = "1.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "af150ab688ff2122fcef229be89cb50dd66af9e01a4ff320cc137eecc9bacc38" +[[package]] +name = "js-sys" +version = "0.3.64" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c5f195fe497f702db0f318b07fdd68edb16955aed830df8363d837542f8f935a" +dependencies = [ + "wasm-bindgen", +] + [[package]] name = "lazy_static" version = "1.4.0" @@ -310,25 +237,24 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" [[package]] name = "libc" -version = "0.2.148" +version = "0.2.149" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9cdc71e17332e86d2e1d38c1f99edcb6288ee11b815fb1a4b049eaa2114d369b" +checksum = "a08173bc88b7955d1b3145aa561539096c421ac8debde8cbc3612ec635fee29b" [[package]] -name = "linux-raw-sys" -version = "0.4.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a9bad9f94746442c783ca431b22403b519cd7fbeed0533fdd6328b2f2212128" +name = "linter-server" +version = "0.0.2" +dependencies = [ + "js-sys", + "osmium-libs-lsp-handler", + "solidhunter-lib", +] [[package]] -name = "lock_api" +name = "linux-raw-sys" version = "0.4.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1cc9717a20b1bb222f333e6a92fd32f7d8a18ddc5a3191a11af45dcbf4dcd16" -dependencies = [ - "autocfg", - "scopeguard", -] +checksum = "da2479e8c062e40bf0066ffa0bc823de0a9368974af99c9f6df941d2c231e03f" [[package]] name = "log" @@ -336,29 +262,6 @@ version = "0.4.20" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" -[[package]] -name = "lsp-server" -version = "0.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b52dccdf3302eefab8c8a1273047f0a3c3dca4b527c8458d00c09484c8371928" -dependencies = [ - "crossbeam-channel", - "log", - "serde", - "serde_json", -] - -[[package]] -name = "lsp-server-wrapper" -version = "0.1.0" -dependencies = [ - "lsp-server", - "lsp-types", - "serde", - "serde_json", - "tracing", -] - [[package]] name = "lsp-types" version = "0.94.1" @@ -374,48 +277,9 @@ dependencies = [ [[package]] name = "memchr" -version = "2.6.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f232d6ef707e1956a43342693d2a31e72989554d58299d7a88738cc95b0d35c" - -[[package]] -name = "miniz_oxide" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7810e0be55b428ada41041c41f32c9f1a42817901b4ccf45fa3d4b6561e74c7" -dependencies = [ - "adler", -] - -[[package]] -name = "mio" -version = "0.8.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "927a765cd3fc26206e66b296465fa9d3e5ab003e651c1b3c060e7956d96b19d2" -dependencies = [ - "libc", - "wasi", - "windows-sys", -] - -[[package]] -name = "num_cpus" -version = "1.16.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" -dependencies = [ - "hermit-abi", - "libc", -] - -[[package]] -name = "object" -version = "0.32.1" +version = "2.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9cf5f9dd3933bd50a9e1f149ec995f39ae2c496d31fd772c1fd45ebc27e902b0" -dependencies = [ - "memchr", -] +checksum = "f665ee40bc4a3c5590afb1e9677db74a508659dfd71e126420da8274909a0167" [[package]] name = "once_cell" @@ -424,26 +288,28 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d" [[package]] -name = "parking_lot" -version = "0.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" +name = "osmium-libs-lsp-handler" +version = "0.0.1" dependencies = [ - "lock_api", - "parking_lot_core", + "js-sys", + "lsp-types", + "serde", + "serde-wasm-bindgen", + "serde_json", + "tracing", + "wasm-bindgen", + "wasm-bindgen-futures", ] [[package]] -name = "parking_lot_core" -version = "0.9.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93f00c865fe7cabf650081affecd3871070f26767e7b2070a3ffae14c654b447" +name = "osmium-libs-solidity-ast-extractor" +version = "0.1.0" dependencies = [ - "cfg-if", - "libc", - "redox_syscall", - "smallvec", - "windows-targets", + "proc-macro2", + "quote", + "syn", + "syn-solidity", + "thiserror", ] [[package]] @@ -466,9 +332,9 @@ checksum = "8afb450f006bf6385ca15ef45d71d2288452bc3683ce2e2cacc0d18e4be60b58" [[package]] name = "proc-macro2" -version = "1.0.67" +version = "1.0.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d433d9f1a3e8c1263d9456598b16fec66f4acc9a74dacffd35c7bb09b3a1328" +checksum = "134c189feb4956b20f6f547d2cf727d4c0fe06722b20a0eec87ed445a97f92da" dependencies = [ "unicode-ident", ] @@ -482,20 +348,11 @@ dependencies = [ "proc-macro2", ] -[[package]] -name = "redox_syscall" -version = "0.3.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "567664f262709473930a4bf9e51bf2ebf3348f2e748ccc50dea20646858f8f29" -dependencies = [ - "bitflags 1.3.2", -] - [[package]] name = "regex" -version = "1.9.6" +version = "1.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ebee201405406dbf528b8b672104ae6d6d63e6d118cb10e4d51abbc7b58044ff" +checksum = "380b951a9c5e80ddfd6136919eef32310721aa4aacd4889a8d39124b026ab343" dependencies = [ "aho-corasick", "memchr", @@ -505,9 +362,9 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.3.9" +version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59b23e92ee4318893fa3fe3e6fb365258efbfe6ac6ab30f090cdcbb7aa37efa9" +checksum = "5f804c7828047e88b2d32e2d7fe5a105da8ee3264f01902f796c8e067dc2483f" dependencies = [ "aho-corasick", "memchr", @@ -516,23 +373,17 @@ dependencies = [ [[package]] name = "regex-syntax" -version = "0.7.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbb5fb1acd8a1a18b3dd5be62d25485eb770e05afb408a9627d14d451bae12da" - -[[package]] -name = "rustc-demangle" -version = "0.1.23" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" +checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" [[package]] name = "rustix" -version = "0.38.14" +version = "0.38.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "747c788e9ce8e92b12cd485c49ddf90723550b654b32508f979b71a7b1ecda4f" +checksum = "67ce50cb2e16c2903e30d1cbccfd8387a74b9d4c938b6a4c5ec6cc7556f7a8a0" dependencies = [ - "bitflags 2.4.0", + "bitflags 2.4.1", "errno", "libc", "linux-raw-sys", @@ -546,25 +397,30 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1ad4cc8da4ef723ed60bced201181d83791ad433213d8c24efffda1eec85d741" [[package]] -name = "scopeguard" -version = "1.2.0" +name = "serde" +version = "1.0.189" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" +checksum = "8e422a44e74ad4001bdc8eede9a4570ab52f71190e9c076d14369f38b9200537" +dependencies = [ + "serde_derive", +] [[package]] -name = "serde" -version = "1.0.188" +name = "serde-wasm-bindgen" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf9e0fcba69a370eed61bcf2b728575f726b50b55cba78064753d708ddc7549e" +checksum = "30c9933e5689bd420dc6c87b7a1835701810cbc10cd86a26e4da45b73e6b1d78" dependencies = [ - "serde_derive", + "js-sys", + "serde", + "wasm-bindgen", ] [[package]] name = "serde_derive" -version = "1.0.188" +version = "1.0.189" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4eca7ac642d82aa35b60049a6eccb4be6be75e599bd2e9adb5f875a737654af2" +checksum = "1e48d1f918009ce3145511378cf68d613e3b3d9137d67272562080d68a2b32d5" dependencies = [ "proc-macro2", "quote", @@ -593,62 +449,30 @@ dependencies = [ "syn", ] -[[package]] -name = "signal-hook-registry" -version = "1.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8229b473baa5980ac72ef434c4415e70c4b5e71b423043adb4ba059f89c99a1" -dependencies = [ - "libc", -] - -[[package]] -name = "smallvec" -version = "1.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "942b4a808e05215192e39f4ab80813e599068285906cc91aa64f923db842bd5a" - -[[package]] -name = "socket2" -version = "0.5.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4031e820eb552adee9295814c0ced9e5cf38ddf1e8b7d566d6de8e2538ea989e" -dependencies = [ - "libc", - "windows-sys", -] - [[package]] name = "solidhunter" version = "0.0.2" dependencies = [ - "anyhow", "clap", "colored", - "glob", - "lsp-server", - "lsp-server-wrapper", - "lsp-types", "serde", "serde_json", "solidhunter-lib", - "thiserror", ] [[package]] name = "solidhunter-lib" -version = "0.0.1" +version = "0.0.2" dependencies = [ "anyhow", - "ast-extractor", "clap", "colored", "glob", + "osmium-libs-solidity-ast-extractor", "regex", "serde", "serde_json", "thiserror", - "tokio", ] [[package]] @@ -659,9 +483,9 @@ checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" [[package]] name = "syn" -version = "2.0.37" +version = "2.0.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7303ef2c05cd654186cb250d29049a24840ca25d2747c25c0381c8d9e2f582e8" +checksum = "e96b79aaa137db8f61e26363a0c9b47d8b4ec75da28b7d1d614c2303e232408b" dependencies = [ "proc-macro2", "quote", @@ -670,9 +494,9 @@ dependencies = [ [[package]] name = "syn-solidity" -version = "0.4.0" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b8a5a633f1172a0c80b1516a988e7e8efa7ce9cededf56590f54e593e4513b3" +checksum = "86b837ef12ab88835251726eb12237655e61ec8dc8a280085d1961cdc3dfd047" dependencies = [ "paste", "proc-macro2", @@ -682,18 +506,18 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.48" +version = "1.0.50" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d6d7a740b8a666a7e828dd00da9c0dc290dff53154ea77ac109281de90589b7" +checksum = "f9a7210f5c9a7156bb50aa36aed4c95afb51df0df00713949448cf9e97d382d2" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.48" +version = "1.0.50" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49922ecae66cc8a249b77e68d1d0623c1b2c514f0060c27cdc68bd62a1219d35" +checksum = "266b2e40bc00e5a6c09c3584011e08b06f123c00362c92b975ba9843aaaa14b8" dependencies = [ "proc-macro2", "quote", @@ -715,43 +539,12 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" -[[package]] -name = "tokio" -version = "1.32.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17ed6077ed6cd6c74735e21f37eb16dc3935f96878b1fe961074089cc80893f9" -dependencies = [ - "backtrace", - "bytes", - "libc", - "mio", - "num_cpus", - "parking_lot", - "pin-project-lite", - "signal-hook-registry", - "socket2", - "tokio-macros", - "windows-sys", -] - -[[package]] -name = "tokio-macros" -version = "2.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "630bdcf245f78637c13ec01ffae6187cca34625e8c63150d424b59e55af2675e" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - [[package]] name = "tracing" -version = "0.1.37" +version = "0.1.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ce8c33a8d48bd45d624a6e523445fd21ec13d3653cd51f681abf67418f54eb8" +checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" dependencies = [ - "cfg-if", "pin-project-lite", "tracing-attributes", "tracing-core", @@ -759,9 +552,9 @@ dependencies = [ [[package]] name = "tracing-attributes" -version = "0.1.26" +version = "0.1.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f4f31f56159e98206da9efd823404b79b6ef3143b4a7ab76e67b1751b25a4ab" +checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", @@ -770,9 +563,9 @@ dependencies = [ [[package]] name = "tracing-core" -version = "0.1.31" +version = "0.1.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0955b8137a1df6f1a2e9a37d8a6656291ff0297c1a97c24e0d8425fe2312f79a" +checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" dependencies = [ "once_cell", ] @@ -817,10 +610,80 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a" [[package]] -name = "wasi" -version = "0.11.0+wasi-snapshot-preview1" +name = "wasm-bindgen" +version = "0.2.87" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7706a72ab36d8cb1f80ffbf0e071533974a60d0a308d01a5d0375bf60499a342" +dependencies = [ + "cfg-if", + "wasm-bindgen-macro", +] + +[[package]] +name = "wasm-bindgen-backend" +version = "0.2.87" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5ef2b6d3c510e9625e5fe6f509ab07d66a760f0885d858736483c32ed7809abd" +dependencies = [ + "bumpalo", + "log", + "once_cell", + "proc-macro2", + "quote", + "syn", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-futures" +version = "0.4.37" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c02dbc21516f9f1f04f187958890d7e6026df8d16540b7ad9492bc34a67cea03" +dependencies = [ + "cfg-if", + "js-sys", + "wasm-bindgen", + "web-sys", +] + +[[package]] +name = "wasm-bindgen-macro" +version = "0.2.87" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dee495e55982a3bd48105a7b947fd2a9b4a8ae3010041b9e0faab3f9cd028f1d" +dependencies = [ + "quote", + "wasm-bindgen-macro-support", +] + +[[package]] +name = "wasm-bindgen-macro-support" +version = "0.2.87" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "54681b18a46765f095758388f2d0cf16eb8d4169b639ab575a8f5693af210c7b" +dependencies = [ + "proc-macro2", + "quote", + "syn", + "wasm-bindgen-backend", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-shared" +version = "0.2.87" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" +checksum = "ca6ad05a4870b2bf5fe995117d3728437bd27d7cd5f06f13c17443ef369775a1" + +[[package]] +name = "web-sys" +version = "0.3.64" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b85cbef8c220a6abc02aefd892dfc0fc23afb1c6a426316ec33253a3877249b" +dependencies = [ + "js-sys", + "wasm-bindgen", +] [[package]] name = "windows-sys" diff --git a/toolchains/solidity/core/Cargo.toml b/toolchains/solidity/core/Cargo.toml new file mode 100644 index 00000000..6455b152 --- /dev/null +++ b/toolchains/solidity/core/Cargo.toml @@ -0,0 +1,21 @@ +[workspace] +members = ["crates/*"] +resolver = "2" + +[workspace.package] +version = "0.3.0" +edition = "2021" +authors = ["Osmium Solidity Contributors"] +license = "MIT OR Apache-2.0" +exclude = ["benches/", "tests/"] + +[workspace.metadata.docs.rs] +all-features = true +rustdoc-args = ["--cfg", "docsrs"] + +[workspace.dependencies] +# workspace crates +extension = { version = "0.1.0", path = "crates/extension", default-features = false } +solidhunter = { version = "0.1.0", path = "crates/solidhunter", default-features = false } +linter-cli = { version = "0.1.0", path = "crates/linter-cli", default-features = false } +linter-server = { version = "0.1.0", path = "crates/linter-server", default-features = false } \ No newline at end of file diff --git a/toolchains/solidity/core/crates/extension/Cargo.toml b/toolchains/solidity/core/crates/extension/Cargo.toml new file mode 100644 index 00000000..92cd5110 --- /dev/null +++ b/toolchains/solidity/core/crates/extension/Cargo.toml @@ -0,0 +1,15 @@ +[package] +name = "extension" +version = "0.1.0" +edition = "2021" + +[lib] +crate-type = ["cdylib", "rlib"] + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] +wasm-bindgen = "0.2.87" +osmium-libs-lsp-handler = { path = "../../../../../libs/lsp-handler", version = "0.0.1" } +linter-server = { path= "../linter-server"} +js-sys = "0.3.64" \ No newline at end of file diff --git a/toolchains/solidity/core/crates/extension/Makefile b/toolchains/solidity/core/crates/extension/Makefile new file mode 100644 index 00000000..2d6c7ff0 --- /dev/null +++ b/toolchains/solidity/core/crates/extension/Makefile @@ -0,0 +1,2 @@ +build: + wasm-pack build --target nodejs --dev --out-dir ../../../extension/dist \ No newline at end of file diff --git a/toolchains/solidity/core/crates/extension/src/lib.rs b/toolchains/solidity/core/crates/extension/src/lib.rs new file mode 100644 index 00000000..5a8f23db --- /dev/null +++ b/toolchains/solidity/core/crates/extension/src/lib.rs @@ -0,0 +1,15 @@ +use osmium_libs_lsp_handler::{Dispatcher, Connection}; +use wasm_bindgen::prelude::*; +use linter_server::create_linter; + +#[wasm_bindgen] +pub fn create_extension(send_request: js_sys::Function, send_notification: js_sys::Function) -> Dispatcher { + let creators = vec![ + create_linter + ]; + + let connection = Connection::new(send_request, send_notification); + let mut dispatcher = Dispatcher::new(connection); + dispatcher.setup(creators); + dispatcher +} \ No newline at end of file diff --git a/toolchains/solidity/core/crates/linter-cli/Cargo.toml b/toolchains/solidity/core/crates/linter-cli/Cargo.toml new file mode 100644 index 00000000..4d02432c --- /dev/null +++ b/toolchains/solidity/core/crates/linter-cli/Cargo.toml @@ -0,0 +1,16 @@ +[package] +name = "solidhunter" +description = "Fast solidity linter cli" +repository = "https://github.com/astrodevs-labs/osmium" +version = "0.0.2" +edition = "2021" +license = "GPL-3.0-or-later" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] +solidhunter-lib = { path = "../linter-lib", version = "0.0.2" } +clap = { version = "4.0.29", features = ["derive"] } +colored = "2" +serde = { version = "1.0.149", features = ["derive"] } +serde_json = "1.0.89" \ No newline at end of file diff --git a/toolchains/solidity/core/crates/linter-cli/Makefile b/toolchains/solidity/core/crates/linter-cli/Makefile new file mode 100644 index 00000000..756e8818 --- /dev/null +++ b/toolchains/solidity/core/crates/linter-cli/Makefile @@ -0,0 +1,4 @@ +publish: + @echo "Publishing linter-cli" + cargo package --allow-dirty + cargo publish --allow-dirty --no-verify \ No newline at end of file diff --git a/toolchains/solidity/linter/core/src/main.rs b/toolchains/solidity/core/crates/linter-cli/src/main.rs similarity index 90% rename from toolchains/solidity/linter/core/src/main.rs rename to toolchains/solidity/core/crates/linter-cli/src/main.rs index 89b05c07..4bb4f06c 100644 --- a/toolchains/solidity/linter/core/src/main.rs +++ b/toolchains/solidity/core/crates/linter-cli/src/main.rs @@ -4,9 +4,6 @@ use solidhunter_lib::linter::SolidLinter; use solidhunter_lib::rules::rule_impl::create_rules_file; use solidhunter_lib::types::LintResult; -mod server; -use server::run_server; - #[derive(Parser, Debug)] #[command(author, version, about, long_about = None)] struct Args { @@ -64,14 +61,6 @@ struct Args { help = "Initialize rules file" )] init: bool, - - #[arg( - short = 's', - long = "stdio", - default_value = "false", - help = "Starts the language server instead of linting" - )] - lsp: bool, } fn lint_folder(args: Args) -> Result<(), SolidHunterError> { @@ -103,13 +92,6 @@ fn print_result(result: LintResult) { fn main() -> Result<(), SolidHunterError> { let args = Args::parse(); - if args.lsp { - eprintln!("Starting language server..."); - run_server(args.rules_file.clone()); - eprintln!("Done!"); - return Ok(()); - } - if !args.to_json { println!(); println!("SolidHunter: Fast and efficient Solidity linter"); @@ -165,4 +147,4 @@ fn main() -> Result<(), SolidHunterError> { } } Ok(()) -} +} \ No newline at end of file diff --git a/toolchains/solidity/linter/core/solidhunter-lib/.gitignore b/toolchains/solidity/core/crates/linter-lib/.gitignore similarity index 100% rename from toolchains/solidity/linter/core/solidhunter-lib/.gitignore rename to toolchains/solidity/core/crates/linter-lib/.gitignore diff --git a/toolchains/solidity/linter/core/solidhunter-lib/Cargo.toml b/toolchains/solidity/core/crates/linter-lib/Cargo.toml similarity index 54% rename from toolchains/solidity/linter/core/solidhunter-lib/Cargo.toml rename to toolchains/solidity/core/crates/linter-lib/Cargo.toml index 58cb7c42..e3bccc85 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/Cargo.toml +++ b/toolchains/solidity/core/crates/linter-lib/Cargo.toml @@ -1,10 +1,15 @@ [package] name = "solidhunter-lib" -version = "0.0.1" +description = "Solidhunter/Osmium solidity linter library" +repository = "https://github.com/astrodevs-labs/osmium" +version = "0.0.2" edition = "2021" authors = ["Astrodevs Labs"] license = "GPL-3.0-or-later" +[lib] +crate-type = ["cdylib", "rlib"] + [dependencies] clap = { version = "4.0.29", features = ["derive"] } colored = "2" @@ -13,6 +18,5 @@ serde_json = "1.0.89" anyhow = "1.0" glob = "0.3.0" thiserror = "1.0" -ast-extractor = { path = "../../../../../libs/ast-extractor" } -tokio = { version = "1.17.0", features = ["full"] } +osmium-libs-solidity-ast-extractor = { path = "../../../../../libs/ast-extractor", version = "0.1.0" } regex = "1.9.6" diff --git a/toolchains/solidity/core/crates/linter-lib/Makefile b/toolchains/solidity/core/crates/linter-lib/Makefile new file mode 100644 index 00000000..756e8818 --- /dev/null +++ b/toolchains/solidity/core/crates/linter-lib/Makefile @@ -0,0 +1,4 @@ +publish: + @echo "Publishing linter-cli" + cargo package --allow-dirty + cargo publish --allow-dirty --no-verify \ No newline at end of file diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/errors.rs b/toolchains/solidity/core/crates/linter-lib/src/errors.rs similarity index 87% rename from toolchains/solidity/linter/core/solidhunter-lib/src/errors.rs rename to toolchains/solidity/core/crates/linter-lib/src/errors.rs index b7489377..b327c1aa 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/errors.rs +++ b/toolchains/solidity/core/crates/linter-lib/src/errors.rs @@ -4,7 +4,7 @@ use thiserror::Error; pub enum SolidHunterError { // Linter errors #[error("SolidHunterError: Ast Extractor error occured")] - AstError(#[from] ast_extractor::errors::ExtractError), + AstError(#[from] osmium_libs_solidity_ast_extractor::errors::ExtractError), #[error("SolidHunterError: Something went wrong with the file during parsing")] ParsingError(#[from] std::io::Error), #[error("SolidHunterError: Serde error occured")] diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/lib.rs b/toolchains/solidity/core/crates/linter-lib/src/lib.rs similarity index 100% rename from toolchains/solidity/linter/core/solidhunter-lib/src/lib.rs rename to toolchains/solidity/core/crates/linter-lib/src/lib.rs diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/linter.rs b/toolchains/solidity/core/crates/linter-lib/src/linter.rs similarity index 91% rename from toolchains/solidity/linter/core/solidhunter-lib/src/linter.rs rename to toolchains/solidity/core/crates/linter-lib/src/linter.rs index 9bafca92..13f060f2 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/linter.rs +++ b/toolchains/solidity/core/crates/linter-lib/src/linter.rs @@ -10,7 +10,7 @@ use glob::glob; #[derive(Debug, Clone)] pub struct SolidFile { - pub data: ast_extractor::File, + pub data: osmium_libs_solidity_ast_extractor::File, pub path: String, pub content: String, } @@ -68,7 +68,7 @@ impl SolidLinter { false } - fn _add_file(&mut self, path: &str, ast: ast_extractor::File, content: &str) { + fn _add_file(&mut self, path: &str, ast: osmium_libs_solidity_ast_extractor::File, content: &str) { if self._file_exists(path) { for file in &mut self.files { if file.path == path { @@ -88,7 +88,7 @@ impl SolidLinter { pub fn parse_file(&mut self, filepath: String) -> LintResult { let content = fs::read_to_string(filepath.clone())?; - let res = ast_extractor::extract::extract_ast_from_content(&content)?; + let res = osmium_libs_solidity_ast_extractor::extract::extract_ast_from_content(&content)?; self._add_file(filepath.as_str(), res, content.as_str()); let mut res: Vec = Vec::new(); @@ -101,7 +101,7 @@ impl SolidLinter { } pub fn parse_content(&mut self, filepath: String, content: &str) -> LintResult { - let res = ast_extractor::extract::extract_ast_from_content(content)?; + let res = osmium_libs_solidity_ast_extractor::extract::extract_ast_from_content(content)?; self._add_file(filepath.as_str(), res, content); let mut res: Vec = Vec::new(); diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/custom_errors.rs b/toolchains/solidity/core/crates/linter-lib/src/rules/best_practises/custom_errors.rs similarity index 98% rename from toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/custom_errors.rs rename to toolchains/solidity/core/crates/linter-lib/src/rules/best_practises/custom_errors.rs index 1ba81f34..6d7d377d 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/custom_errors.rs +++ b/toolchains/solidity/core/crates/linter-lib/src/rules/best_practises/custom_errors.rs @@ -1,7 +1,7 @@ use crate::linter::SolidFile; use crate::rules::types::*; use crate::types::*; -use ast_extractor::*; +use osmium_libs_solidity_ast_extractor::*; // global pub const RULE_ID: &str = "custom-errors"; diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/explicit_types.rs b/toolchains/solidity/core/crates/linter-lib/src/rules/best_practises/explicit_types.rs similarity index 99% rename from toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/explicit_types.rs rename to toolchains/solidity/core/crates/linter-lib/src/rules/best_practises/explicit_types.rs index c89a3330..0e0005b9 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/explicit_types.rs +++ b/toolchains/solidity/core/crates/linter-lib/src/rules/best_practises/explicit_types.rs @@ -1,7 +1,7 @@ use crate::linter::SolidFile; use crate::rules::types::*; use crate::types::*; -use ast_extractor::*; +use osmium_libs_solidity_ast_extractor::*; // TODO test output diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/function_max_lines.rs b/toolchains/solidity/core/crates/linter-lib/src/rules/best_practises/function_max_lines.rs similarity index 89% rename from toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/function_max_lines.rs rename to toolchains/solidity/core/crates/linter-lib/src/rules/best_practises/function_max_lines.rs index a1da59a6..b2df7b2d 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/function_max_lines.rs +++ b/toolchains/solidity/core/crates/linter-lib/src/rules/best_practises/function_max_lines.rs @@ -1,4 +1,4 @@ -use ast_extractor::{FunctionBody, Spanned}; +use osmium_libs_solidity_ast_extractor::{FunctionBody, Spanned}; use crate::linter::SolidFile; use crate::rules::types::*; @@ -20,8 +20,8 @@ impl RuleType for FunctionMaxLines { fn diagnose(&self, _file: &SolidFile, _files: &[SolidFile]) -> Vec { let mut res = Vec::new(); - for contract in ast_extractor::retriever::retrieve_contract_nodes(&_file.data) { - for function in ast_extractor::retriever::retrieve_functions_nodes(&contract) { + for contract in osmium_libs_solidity_ast_extractor::retriever::retrieve_contract_nodes(&_file.data) { + for function in osmium_libs_solidity_ast_extractor::retriever::retrieve_functions_nodes(&contract) { let report = check_function_lines(&function, self.number_max_lines); if let Some(report) = report { let start = report.start.line; @@ -50,7 +50,7 @@ impl RuleType for FunctionMaxLines { // returns a struct containing the line number of the start and end of the function if it is too long fn check_function_lines( - function: &ast_extractor::ItemFunction, + function: &osmium_libs_solidity_ast_extractor::ItemFunction, nb_max_line: usize, ) -> Option { if let FunctionBody::Block(block) = &function.body { diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/max_line_length.rs b/toolchains/solidity/core/crates/linter-lib/src/rules/best_practises/max_line_length.rs similarity index 100% rename from toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/max_line_length.rs rename to toolchains/solidity/core/crates/linter-lib/src/rules/best_practises/max_line_length.rs diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/max_states_count.rs b/toolchains/solidity/core/crates/linter-lib/src/rules/best_practises/max_states_count.rs similarity index 98% rename from toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/max_states_count.rs rename to toolchains/solidity/core/crates/linter-lib/src/rules/best_practises/max_states_count.rs index fbe4c45e..7060008b 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/max_states_count.rs +++ b/toolchains/solidity/core/crates/linter-lib/src/rules/best_practises/max_states_count.rs @@ -1,7 +1,7 @@ use crate::linter::SolidFile; use crate::rules::types::*; use crate::types::*; -use ast_extractor::*; +use osmium_libs_solidity_ast_extractor::*; // global pub const RULE_ID: &str = "max-states-count"; diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/mod.rs b/toolchains/solidity/core/crates/linter-lib/src/rules/best_practises/mod.rs similarity index 100% rename from toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/mod.rs rename to toolchains/solidity/core/crates/linter-lib/src/rules/best_practises/mod.rs diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/no_console.rs b/toolchains/solidity/core/crates/linter-lib/src/rules/best_practises/no_console.rs similarity index 98% rename from toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/no_console.rs rename to toolchains/solidity/core/crates/linter-lib/src/rules/best_practises/no_console.rs index ebf1088b..b612f028 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/no_console.rs +++ b/toolchains/solidity/core/crates/linter-lib/src/rules/best_practises/no_console.rs @@ -1,4 +1,4 @@ -use ast_extractor::*; +use osmium_libs_solidity_ast_extractor::*; use crate::linter::SolidFile; use crate::rules::types::{RuleEntry, RuleType}; diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/no_empty_block.rs b/toolchains/solidity/core/crates/linter-lib/src/rules/best_practises/no_empty_block.rs similarity index 98% rename from toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/no_empty_block.rs rename to toolchains/solidity/core/crates/linter-lib/src/rules/best_practises/no_empty_block.rs index c61be310..5705691d 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/no_empty_block.rs +++ b/toolchains/solidity/core/crates/linter-lib/src/rules/best_practises/no_empty_block.rs @@ -1,7 +1,7 @@ use crate::linter::SolidFile; use crate::rules::types::*; use crate::types::*; -use ast_extractor::{ +use osmium_libs_solidity_ast_extractor::{ retriever::{retrieve_block_nodes, retrieve_contract_nodes}, Spanned, }; diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/no_global_import.rs b/toolchains/solidity/core/crates/linter-lib/src/rules/best_practises/no_global_import.rs similarity index 97% rename from toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/no_global_import.rs rename to toolchains/solidity/core/crates/linter-lib/src/rules/best_practises/no_global_import.rs index 3a5a3a70..5c4165d2 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/no_global_import.rs +++ b/toolchains/solidity/core/crates/linter-lib/src/rules/best_practises/no_global_import.rs @@ -1,4 +1,4 @@ -use ast_extractor::{ImportPath, Item, Spanned}; +use osmium_libs_solidity_ast_extractor::{ImportPath, Item, Spanned}; use crate::linter::SolidFile; use crate::rules::types::*; diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/one_contract_per_file.rs b/toolchains/solidity/core/crates/linter-lib/src/rules/best_practises/one_contract_per_file.rs similarity index 91% rename from toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/one_contract_per_file.rs rename to toolchains/solidity/core/crates/linter-lib/src/rules/best_practises/one_contract_per_file.rs index 8000a411..25350ccb 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/one_contract_per_file.rs +++ b/toolchains/solidity/core/crates/linter-lib/src/rules/best_practises/one_contract_per_file.rs @@ -1,4 +1,4 @@ -use ast_extractor::{LineColumn, Spanned}; +use osmium_libs_solidity_ast_extractor::{LineColumn, Spanned}; use crate::linter::SolidFile; use crate::rules::types::*; @@ -42,7 +42,7 @@ impl OneContractPerFile { impl RuleType for OneContractPerFile { fn diagnose(&self, file: &SolidFile, _files: &[SolidFile]) -> Vec { let mut res = Vec::new(); - let contracts = ast_extractor::retriever::retrieve_contract_nodes(&file.data); + let contracts = osmium_libs_solidity_ast_extractor::retriever::retrieve_contract_nodes(&file.data); let contract_count = contracts.len(); if contract_count > 1 { diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/payable_fallback.rs b/toolchains/solidity/core/crates/linter-lib/src/rules/best_practises/payable_fallback.rs similarity index 93% rename from toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/payable_fallback.rs rename to toolchains/solidity/core/crates/linter-lib/src/rules/best_practises/payable_fallback.rs index 433f7e52..f8f0362d 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/payable_fallback.rs +++ b/toolchains/solidity/core/crates/linter-lib/src/rules/best_practises/payable_fallback.rs @@ -1,5 +1,5 @@ -use ast_extractor::retriever::{retrieve_contract_nodes, retrieve_functions_nodes}; -use ast_extractor::{ItemFunction, Mutability, Spanned}; +use osmium_libs_solidity_ast_extractor::retriever::{retrieve_contract_nodes, retrieve_functions_nodes}; +use osmium_libs_solidity_ast_extractor::{ItemFunction, Mutability, Spanned}; use crate::linter::SolidFile; use crate::rules::types::*; diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/reason_string.rs b/toolchains/solidity/core/crates/linter-lib/src/rules/best_practises/reason_string.rs similarity index 97% rename from toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/reason_string.rs rename to toolchains/solidity/core/crates/linter-lib/src/rules/best_practises/reason_string.rs index 23c47973..53897725 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/best_practises/reason_string.rs +++ b/toolchains/solidity/core/crates/linter-lib/src/rules/best_practises/reason_string.rs @@ -1,4 +1,4 @@ -use ast_extractor::*; +use osmium_libs_solidity_ast_extractor::*; use crate::linter::SolidFile; use crate::rules::types::{RuleEntry, RuleType}; @@ -84,7 +84,7 @@ impl RuleType for ReasonString { if let Some(expr_string) = expr_args.iter().find(|&x| { if let Expr::Lit(lit) = x { - matches!(lit, ast_extractor::Lit::Str(_)) + matches!(lit, osmium_libs_solidity_ast_extractor::Lit::Str(_)) } else { false } diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/factory.rs b/toolchains/solidity/core/crates/linter-lib/src/rules/factory.rs similarity index 100% rename from toolchains/solidity/linter/core/solidhunter-lib/src/rules/factory.rs rename to toolchains/solidity/core/crates/linter-lib/src/rules/factory.rs diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/miscellaneous/mod.rs b/toolchains/solidity/core/crates/linter-lib/src/rules/miscellaneous/mod.rs similarity index 100% rename from toolchains/solidity/linter/core/solidhunter-lib/src/rules/miscellaneous/mod.rs rename to toolchains/solidity/core/crates/linter-lib/src/rules/miscellaneous/mod.rs diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/mod.rs b/toolchains/solidity/core/crates/linter-lib/src/rules/mod.rs similarity index 100% rename from toolchains/solidity/linter/core/solidhunter-lib/src/rules/mod.rs rename to toolchains/solidity/core/crates/linter-lib/src/rules/mod.rs diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/const_name_snakecase.rs b/toolchains/solidity/core/crates/linter-lib/src/rules/naming/const_name_snakecase.rs similarity index 96% rename from toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/const_name_snakecase.rs rename to toolchains/solidity/core/crates/linter-lib/src/rules/naming/const_name_snakecase.rs index 5daf21a7..503fb296 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/const_name_snakecase.rs +++ b/toolchains/solidity/core/crates/linter-lib/src/rules/naming/const_name_snakecase.rs @@ -1,4 +1,4 @@ -use ast_extractor::{retriever, Item, LineColumn, Spanned}; +use osmium_libs_solidity_ast_extractor::{retriever, Item, LineColumn, Spanned}; use crate::linter::SolidFile; use crate::rules::types::*; diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/contract_name_camelcase.rs b/toolchains/solidity/core/crates/linter-lib/src/rules/naming/contract_name_camelcase.rs similarity index 92% rename from toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/contract_name_camelcase.rs rename to toolchains/solidity/core/crates/linter-lib/src/rules/naming/contract_name_camelcase.rs index af56b1a4..b2a6ac2d 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/contract_name_camelcase.rs +++ b/toolchains/solidity/core/crates/linter-lib/src/rules/naming/contract_name_camelcase.rs @@ -1,4 +1,4 @@ -use ast_extractor::{LineColumn, Spanned}; +use osmium_libs_solidity_ast_extractor::{LineColumn, Spanned}; use crate::linter::SolidFile; use crate::rules::types::*; @@ -42,7 +42,7 @@ impl ContractNameCamelCase { impl RuleType for ContractNameCamelCase { fn diagnose(&self, file: &SolidFile, _files: &[SolidFile]) -> Vec { let mut res = Vec::new(); - let contracts = ast_extractor::retriever::retrieve_contract_nodes(&file.data); + let contracts = osmium_libs_solidity_ast_extractor::retriever::retrieve_contract_nodes(&file.data); for contract in contracts { if (contract.name.as_string().chars().next().unwrap() >= 'a' diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/event_name_camelcase.rs b/toolchains/solidity/core/crates/linter-lib/src/rules/naming/event_name_camelcase.rs similarity index 85% rename from toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/event_name_camelcase.rs rename to toolchains/solidity/core/crates/linter-lib/src/rules/naming/event_name_camelcase.rs index dd1d1da6..8e078013 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/event_name_camelcase.rs +++ b/toolchains/solidity/core/crates/linter-lib/src/rules/naming/event_name_camelcase.rs @@ -1,4 +1,4 @@ -use ast_extractor::{LineColumn, Spanned}; +use osmium_libs_solidity_ast_extractor::{LineColumn, Spanned}; use crate::linter::SolidFile; use crate::rules::types::*; @@ -52,9 +52,9 @@ fn is_camel_case(name: &str) -> bool { impl RuleType for EventNameCamelCase { fn diagnose(&self, file: &SolidFile, _files: &[SolidFile]) -> Vec { let mut res = Vec::new(); - let contracts = ast_extractor::retriever::retrieve_contract_nodes(&file.data); + let contracts = osmium_libs_solidity_ast_extractor::retriever::retrieve_contract_nodes(&file.data); - for event in ast_extractor::retriever::retrieve_events_file_nodes(&file.data) { + for event in osmium_libs_solidity_ast_extractor::retriever::retrieve_events_file_nodes(&file.data) { if !is_camel_case(&event.name.to_string()) { let span = event.name.span(); res.push(self.create_diag((span.start(), span.end()), file)); @@ -62,7 +62,7 @@ impl RuleType for EventNameCamelCase { } for contract in contracts { - for event in ast_extractor::retriever::retrieve_events_contract_nodes(&contract) { + for event in osmium_libs_solidity_ast_extractor::retriever::retrieve_events_contract_nodes(&contract) { if !is_camel_case(&event.name.to_string()) { let span = event.name.span(); res.push(self.create_diag((span.start(), span.end()), file)); diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/foundry_test_functions.rs b/toolchains/solidity/core/crates/linter-lib/src/rules/naming/foundry_test_functions.rs similarity index 82% rename from toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/foundry_test_functions.rs rename to toolchains/solidity/core/crates/linter-lib/src/rules/naming/foundry_test_functions.rs index 95f7d223..edf4bb0a 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/foundry_test_functions.rs +++ b/toolchains/solidity/core/crates/linter-lib/src/rules/naming/foundry_test_functions.rs @@ -1,4 +1,4 @@ -use ast_extractor::{LineColumn, Spanned}; +use osmium_libs_solidity_ast_extractor::{LineColumn, Spanned}; use crate::linter::SolidFile; use crate::rules::types::*; @@ -56,21 +56,21 @@ impl RuleType for FoundryTestFunctions { let mut res = Vec::new(); let re = regex::Regex::new(r"^test(Fork)?(Fuzz)?(Fail)?(_)?(Revert(If_|When_){1})?\w{1,}$") .unwrap(); - let contracts = ast_extractor::retriever::retrieve_contract_nodes(&file.data); + let contracts = osmium_libs_solidity_ast_extractor::retriever::retrieve_contract_nodes(&file.data); for contract in contracts { - for function in ast_extractor::retriever::retrieve_functions_nodes(&contract) { + for function in osmium_libs_solidity_ast_extractor::retriever::retrieve_functions_nodes(&contract) { let visibility = function .attributes .iter() - .find(|attr| matches!(attr, ast_extractor::FunctionAttribute::Visibility(_))); + .find(|attr| matches!(attr, osmium_libs_solidity_ast_extractor::FunctionAttribute::Visibility(_))); let visibility = match visibility { - Some(ast_extractor::FunctionAttribute::Visibility(visibility)) => visibility, + Some(osmium_libs_solidity_ast_extractor::FunctionAttribute::Visibility(visibility)) => visibility, _ => continue, }; - if !matches!(visibility, ast_extractor::Visibility::Public(_)) - && !matches!(visibility, ast_extractor::Visibility::External(_)) + if !matches!(visibility, osmium_libs_solidity_ast_extractor::Visibility::Public(_)) + && !matches!(visibility, osmium_libs_solidity_ast_extractor::Visibility::External(_)) { continue; } diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/func_name_mixedcase.rs b/toolchains/solidity/core/crates/linter-lib/src/rules/naming/func_name_mixedcase.rs similarity index 89% rename from toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/func_name_mixedcase.rs rename to toolchains/solidity/core/crates/linter-lib/src/rules/naming/func_name_mixedcase.rs index 7b5d1e94..2bcedd28 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/func_name_mixedcase.rs +++ b/toolchains/solidity/core/crates/linter-lib/src/rules/naming/func_name_mixedcase.rs @@ -1,4 +1,4 @@ -use ast_extractor::{LineColumn, Spanned}; +use osmium_libs_solidity_ast_extractor::{LineColumn, Spanned}; use crate::linter::SolidFile; use crate::rules::types::*; @@ -42,10 +42,10 @@ impl FuncNameMixedCase { impl RuleType for FuncNameMixedCase { fn diagnose(&self, file: &SolidFile, _files: &[SolidFile]) -> Vec { let mut res = Vec::new(); - let contracts = ast_extractor::retriever::retrieve_contract_nodes(&file.data); + let contracts = osmium_libs_solidity_ast_extractor::retriever::retrieve_contract_nodes(&file.data); for contract in contracts { - for function in ast_extractor::retriever::retrieve_functions_nodes(&contract) { + for function in osmium_libs_solidity_ast_extractor::retriever::retrieve_functions_nodes(&contract) { if function.kind.is_function() { if let Some(name) = function.name { if !(name.as_string().chars().next().unwrap_or(' ') >= 'a' diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/func_param_name_mixedcase.rs b/toolchains/solidity/core/crates/linter-lib/src/rules/naming/func_param_name_mixedcase.rs similarity index 89% rename from toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/func_param_name_mixedcase.rs rename to toolchains/solidity/core/crates/linter-lib/src/rules/naming/func_param_name_mixedcase.rs index e0150659..9ae15cc4 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/func_param_name_mixedcase.rs +++ b/toolchains/solidity/core/crates/linter-lib/src/rules/naming/func_param_name_mixedcase.rs @@ -1,7 +1,7 @@ use crate::linter::SolidFile; use crate::rules::types::*; use crate::types::*; -use ast_extractor::{LineColumn, Spanned}; +use osmium_libs_solidity_ast_extractor::{LineColumn, Spanned}; // global pub const RULE_ID: &str = "func-param-name-mixedcase"; @@ -41,10 +41,10 @@ impl FuncParamNameMixedCase { impl RuleType for FuncParamNameMixedCase { fn diagnose(&self, file: &SolidFile, _files: &[SolidFile]) -> Vec { let mut res = Vec::new(); - let contracts = ast_extractor::retriever::retrieve_contract_nodes(&file.data); + let contracts = osmium_libs_solidity_ast_extractor::retriever::retrieve_contract_nodes(&file.data); for contract in contracts { - for function in ast_extractor::retriever::retrieve_functions_nodes(&contract) { + for function in osmium_libs_solidity_ast_extractor::retriever::retrieve_functions_nodes(&contract) { for arg in function.arguments.iter() { if let Some(name) = &arg.name { if !(name.as_string().chars().next().unwrap() >= 'a' diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/mod.rs b/toolchains/solidity/core/crates/linter-lib/src/rules/naming/mod.rs similarity index 100% rename from toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/mod.rs rename to toolchains/solidity/core/crates/linter-lib/src/rules/naming/mod.rs diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/modifier_name_mixedcase.rs b/toolchains/solidity/core/crates/linter-lib/src/rules/naming/modifier_name_mixedcase.rs similarity index 97% rename from toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/modifier_name_mixedcase.rs rename to toolchains/solidity/core/crates/linter-lib/src/rules/naming/modifier_name_mixedcase.rs index 78b06a21..7cb8ae70 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/modifier_name_mixedcase.rs +++ b/toolchains/solidity/core/crates/linter-lib/src/rules/naming/modifier_name_mixedcase.rs @@ -1,4 +1,4 @@ -use ast_extractor::{retriever, LineColumn, Spanned}; +use osmium_libs_solidity_ast_extractor::{retriever, LineColumn, Spanned}; use crate::linter::SolidFile; use crate::rules::types::*; diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/named_parameters_mapping.rs b/toolchains/solidity/core/crates/linter-lib/src/rules/naming/named_parameters_mapping.rs similarity index 94% rename from toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/named_parameters_mapping.rs rename to toolchains/solidity/core/crates/linter-lib/src/rules/naming/named_parameters_mapping.rs index 36ad16e1..ab6405a4 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/named_parameters_mapping.rs +++ b/toolchains/solidity/core/crates/linter-lib/src/rules/naming/named_parameters_mapping.rs @@ -1,7 +1,7 @@ use crate::linter::SolidFile; use crate::rules::types::*; use crate::types::*; -use ast_extractor::*; +use osmium_libs_solidity_ast_extractor::*; // global pub const RULE_ID: &str = "named-parameters-mapping"; @@ -67,7 +67,7 @@ impl RuleType for NamedParametersMapping { fn diagnose(&self, file: &SolidFile, _files: &[SolidFile]) -> Vec { let mut res = Vec::new(); let mut visitor = MappingsVisitor::new(); - for contract in ast_extractor::retriever::retrieve_contract_nodes(&file.data) { + for contract in osmium_libs_solidity_ast_extractor::retriever::retrieve_contract_nodes(&file.data) { visitor.visit_item_contract(&contract); } diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/private_vars_leading_underscore.rs b/toolchains/solidity/core/crates/linter-lib/src/rules/naming/private_vars_leading_underscore.rs similarity index 94% rename from toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/private_vars_leading_underscore.rs rename to toolchains/solidity/core/crates/linter-lib/src/rules/naming/private_vars_leading_underscore.rs index c594f099..c66c4bf5 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/private_vars_leading_underscore.rs +++ b/toolchains/solidity/core/crates/linter-lib/src/rules/naming/private_vars_leading_underscore.rs @@ -1,5 +1,5 @@ -use ast_extractor::Visibility::{Internal, Private}; -use ast_extractor::{Item, LineColumn, Spanned}; +use osmium_libs_solidity_ast_extractor::Visibility::{Internal, Private}; +use osmium_libs_solidity_ast_extractor::{Item, LineColumn, Spanned}; use crate::linter::SolidFile; use crate::rules::types::*; @@ -52,10 +52,10 @@ impl PrivateVarsLeadingUnderscore { impl RuleType for PrivateVarsLeadingUnderscore { fn diagnose(&self, file: &SolidFile, _files: &[SolidFile]) -> Vec { let mut res = Vec::new(); - let contracts = ast_extractor::retriever::retrieve_contract_nodes(&file.data); + let contracts = osmium_libs_solidity_ast_extractor::retriever::retrieve_contract_nodes(&file.data); for contract in contracts { - let functions = ast_extractor::retriever::retrieve_functions_nodes(&contract); + let functions = osmium_libs_solidity_ast_extractor::retriever::retrieve_functions_nodes(&contract); for function in functions { if self.strict { diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/use_forbidden_name.rs b/toolchains/solidity/core/crates/linter-lib/src/rules/naming/use_forbidden_name.rs similarity index 98% rename from toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/use_forbidden_name.rs rename to toolchains/solidity/core/crates/linter-lib/src/rules/naming/use_forbidden_name.rs index 3e18f565..06c68165 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/use_forbidden_name.rs +++ b/toolchains/solidity/core/crates/linter-lib/src/rules/naming/use_forbidden_name.rs @@ -1,7 +1,7 @@ use crate::linter::SolidFile; use crate::rules::types::*; use crate::types::*; -use ast_extractor::*; +use osmium_libs_solidity_ast_extractor::*; // global pub const RULE_ID: &str = "use-forbidden-name"; diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/var_name_mixedcase.rs b/toolchains/solidity/core/crates/linter-lib/src/rules/naming/var_name_mixedcase.rs similarity index 89% rename from toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/var_name_mixedcase.rs rename to toolchains/solidity/core/crates/linter-lib/src/rules/naming/var_name_mixedcase.rs index 1c07633f..05c7fbed 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/naming/var_name_mixedcase.rs +++ b/toolchains/solidity/core/crates/linter-lib/src/rules/naming/var_name_mixedcase.rs @@ -1,4 +1,4 @@ -use ast_extractor::{LineColumn, Spanned}; +use osmium_libs_solidity_ast_extractor::{LineColumn, Spanned}; use crate::linter::SolidFile; use crate::rules::types::*; @@ -44,7 +44,7 @@ impl RuleType for VarNameMixedCase { let mut res = Vec::new(); let variables_definition = - ast_extractor::retriever::retrieve_variable_definition_nodes(&file.data); + osmium_libs_solidity_ast_extractor::retriever::retrieve_variable_definition_nodes(&file.data); for variable in variables_definition { if variable.name.to_string()[1..].find('_').is_some() { let span = variable.name.span(); @@ -53,7 +53,7 @@ impl RuleType for VarNameMixedCase { } let variables_declaration = - ast_extractor::retriever::retrieve_variable_declaration_nodes(&file.data); + osmium_libs_solidity_ast_extractor::retriever::retrieve_variable_declaration_nodes(&file.data); for variable in variables_declaration { if variable.name.is_some() { let name = variable.name.unwrap(); diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/order/import_on_top.rs b/toolchains/solidity/core/crates/linter-lib/src/rules/order/import_on_top.rs similarity index 87% rename from toolchains/solidity/linter/core/solidhunter-lib/src/rules/order/import_on_top.rs rename to toolchains/solidity/core/crates/linter-lib/src/rules/order/import_on_top.rs index e4cd173d..a390243d 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/order/import_on_top.rs +++ b/toolchains/solidity/core/crates/linter-lib/src/rules/order/import_on_top.rs @@ -1,4 +1,4 @@ -use ast_extractor::{LineColumn, Spanned}; +use osmium_libs_solidity_ast_extractor::{LineColumn, Spanned}; use crate::linter::SolidFile; use crate::rules::types::*; @@ -47,10 +47,10 @@ impl RuleType for ImportOnTop { for i in 0..file.data.items.len() { match &file.data.items[i] { - ast_extractor::Item::Pragma(_) => { + osmium_libs_solidity_ast_extractor::Item::Pragma(_) => { continue; } - ast_extractor::Item::Import(_) => { + osmium_libs_solidity_ast_extractor::Item::Import(_) => { last_import_location = i; } _ => { @@ -60,7 +60,7 @@ impl RuleType for ImportOnTop { } for i in 0..file.data.items.len() { - if let ast_extractor::Item::Import(import) = &file.data.items[i] { + if let osmium_libs_solidity_ast_extractor::Item::Import(import) = &file.data.items[i] { if i > last_import_location { let location = (import.span().start(), import.span().end()); res.push(self.create_diag(file, location)); diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/order/mod.rs b/toolchains/solidity/core/crates/linter-lib/src/rules/order/mod.rs similarity index 100% rename from toolchains/solidity/linter/core/solidhunter-lib/src/rules/order/mod.rs rename to toolchains/solidity/core/crates/linter-lib/src/rules/order/mod.rs diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/order/ordering.rs b/toolchains/solidity/core/crates/linter-lib/src/rules/order/ordering.rs similarity index 93% rename from toolchains/solidity/linter/core/solidhunter-lib/src/rules/order/ordering.rs rename to toolchains/solidity/core/crates/linter-lib/src/rules/order/ordering.rs index 93041f29..b156414d 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/order/ordering.rs +++ b/toolchains/solidity/core/crates/linter-lib/src/rules/order/ordering.rs @@ -1,6 +1,6 @@ use std::collections::HashMap; -use ast_extractor::{visit, FunctionKind, Spanned, Visibility, Visit}; +use osmium_libs_solidity_ast_extractor::{visit, FunctionKind, Spanned, Visibility, Visit}; use crate::linter::SolidFile; use crate::rules::types::*; @@ -275,7 +275,7 @@ impl OrderingVisitor { fn create_diag( &self, file: &SolidFile, - location: (ast_extractor::LineColumn, ast_extractor::LineColumn), + location: (osmium_libs_solidity_ast_extractor::LineColumn, osmium_libs_solidity_ast_extractor::LineColumn), ) -> LintDiag { let range = Range { start: Position { @@ -316,7 +316,7 @@ impl OrderingVisitor { } impl<'ast> Visit<'ast> for OrderingVisitor { - fn visit_pragma_directive(&mut self, pragma: &'ast ast_extractor::PragmaDirective) { + fn visit_pragma_directive(&mut self, pragma: &'ast osmium_libs_solidity_ast_extractor::PragmaDirective) { if !self.is_authorized_file_item(FileItemType::Pragma) { let location = (pragma.span().start(), pragma.span().end()); self.reports.push(self.create_diag(&self.file, location)); @@ -325,7 +325,7 @@ impl<'ast> Visit<'ast> for OrderingVisitor { } } - fn visit_import_directive(&mut self, import: &'ast ast_extractor::ImportDirective) { + fn visit_import_directive(&mut self, import: &'ast osmium_libs_solidity_ast_extractor::ImportDirective) { if !self.is_authorized_file_item(FileItemType::Import) { let location = (import.span().start(), import.span().end()); self.reports.push(self.create_diag(&self.file, location)); @@ -334,7 +334,7 @@ impl<'ast> Visit<'ast> for OrderingVisitor { } } - fn visit_item_enum(&mut self, enum_def: &'ast ast_extractor::ItemEnum) { + fn visit_item_enum(&mut self, enum_def: &'ast osmium_libs_solidity_ast_extractor::ItemEnum) { if !self.is_authorized_file_item(FileItemType::Enum) { let location = (enum_def.span().start(), enum_def.span().end()); self.reports.push(self.create_diag(&self.file, location)); @@ -343,7 +343,7 @@ impl<'ast> Visit<'ast> for OrderingVisitor { } } - fn visit_item_struct(&mut self, struct_def: &'ast ast_extractor::ItemStruct) { + fn visit_item_struct(&mut self, struct_def: &'ast osmium_libs_solidity_ast_extractor::ItemStruct) { if !self.is_authorized_file_item(FileItemType::Struct) { let location = (struct_def.span().start(), struct_def.span().end()); self.reports.push(self.create_diag(&self.file, location)); @@ -352,7 +352,7 @@ impl<'ast> Visit<'ast> for OrderingVisitor { } } - fn visit_item_contract(&mut self, contract_def: &'ast ast_extractor::ItemContract) { + fn visit_item_contract(&mut self, contract_def: &'ast osmium_libs_solidity_ast_extractor::ItemContract) { if contract_def.is_interface() && !self.is_authorized_file_item(FileItemType::ContractInterface) || contract_def.is_library() @@ -370,7 +370,7 @@ impl<'ast> Visit<'ast> for OrderingVisitor { self.inside_contract = false; } - fn visit_item_udt(&mut self, udt: &'ast ast_extractor::ItemUdt) { + fn visit_item_udt(&mut self, udt: &'ast osmium_libs_solidity_ast_extractor::ItemUdt) { if !self.is_authorized_contract_item(ContractItemType::Udt) { let location = (udt.span().start(), udt.span().end()); self.reports.push(self.create_diag(&self.file, location)); @@ -379,7 +379,7 @@ impl<'ast> Visit<'ast> for OrderingVisitor { } } - fn visit_variable_definition(&mut self, var: &'ast ast_extractor::VariableDefinition) { + fn visit_variable_definition(&mut self, var: &'ast osmium_libs_solidity_ast_extractor::VariableDefinition) { if !self.is_authorized_contract_item(ContractItemType::Property) { let location = (var.span().start(), var.span().end()); self.reports.push(self.create_diag(&self.file, location)); @@ -388,7 +388,7 @@ impl<'ast> Visit<'ast> for OrderingVisitor { } } - fn visit_item_event(&mut self, event: &'ast ast_extractor::ItemEvent) { + fn visit_item_event(&mut self, event: &'ast osmium_libs_solidity_ast_extractor::ItemEvent) { if !self.is_authorized_contract_item(ContractItemType::Event) { let location = (event.span().start(), event.span().end()); self.reports.push(self.create_diag(&self.file, location)); @@ -397,7 +397,7 @@ impl<'ast> Visit<'ast> for OrderingVisitor { } } - fn visit_item_function(&mut self, function: &'ast ast_extractor::ItemFunction) { + fn visit_item_function(&mut self, function: &'ast osmium_libs_solidity_ast_extractor::ItemFunction) { match function.kind { FunctionKind::Modifier(_) => { if !self.is_authorized_contract_item(ContractItemType::Modifier) { @@ -435,9 +435,9 @@ impl<'ast> Visit<'ast> for OrderingVisitor { let visibility = function .attributes .iter() - .find(|attr| matches!(attr, ast_extractor::FunctionAttribute::Visibility(_))); + .find(|attr| matches!(attr, osmium_libs_solidity_ast_extractor::FunctionAttribute::Visibility(_))); let visibility = match visibility { - Some(ast_extractor::FunctionAttribute::Visibility(visibility)) => visibility, + Some(osmium_libs_solidity_ast_extractor::FunctionAttribute::Visibility(visibility)) => visibility, _ => return, }; diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/order/visibility_modifier_order.rs b/toolchains/solidity/core/crates/linter-lib/src/rules/order/visibility_modifier_order.rs similarity index 94% rename from toolchains/solidity/linter/core/solidhunter-lib/src/rules/order/visibility_modifier_order.rs rename to toolchains/solidity/core/crates/linter-lib/src/rules/order/visibility_modifier_order.rs index 0e2276c5..58ff0e19 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/order/visibility_modifier_order.rs +++ b/toolchains/solidity/core/crates/linter-lib/src/rules/order/visibility_modifier_order.rs @@ -1,5 +1,5 @@ -use ast_extractor::retriever::{retrieve_contract_nodes, retrieve_functions_nodes}; -use ast_extractor::Spanned; +use osmium_libs_solidity_ast_extractor::retriever::{retrieve_contract_nodes, retrieve_functions_nodes}; +use osmium_libs_solidity_ast_extractor::Spanned; use crate::linter::SolidFile; use crate::rules::types::*; diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/rule_impl.rs b/toolchains/solidity/core/crates/linter-lib/src/rules/rule_impl.rs similarity index 100% rename from toolchains/solidity/linter/core/solidhunter-lib/src/rules/rule_impl.rs rename to toolchains/solidity/core/crates/linter-lib/src/rules/rule_impl.rs diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/security/avoid_tx_origin.rs b/toolchains/solidity/core/crates/linter-lib/src/rules/security/avoid_tx_origin.rs similarity index 94% rename from toolchains/solidity/linter/core/solidhunter-lib/src/rules/security/avoid_tx_origin.rs rename to toolchains/solidity/core/crates/linter-lib/src/rules/security/avoid_tx_origin.rs index eb84b41f..9846580f 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/security/avoid_tx_origin.rs +++ b/toolchains/solidity/core/crates/linter-lib/src/rules/security/avoid_tx_origin.rs @@ -1,7 +1,7 @@ use crate::linter::SolidFile; use crate::rules::types::*; use crate::types::*; -use ast_extractor::*; +use osmium_libs_solidity_ast_extractor::*; // global pub const RULE_ID: &str = "avoid-tx-origin"; @@ -59,7 +59,7 @@ impl RuleType for AvoidTxOrigin { fn diagnose(&self, file: &SolidFile, _files: &[SolidFile]) -> Vec { let mut res = Vec::new(); let mut visitor = ExprVisitor::new(); - for contract in ast_extractor::retriever::retrieve_contract_nodes(&file.data) { + for contract in osmium_libs_solidity_ast_extractor::retriever::retrieve_contract_nodes(&file.data) { visitor.visit_item_contract(&contract); } diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/security/func_visibility.rs b/toolchains/solidity/core/crates/linter-lib/src/rules/security/func_visibility.rs similarity index 88% rename from toolchains/solidity/linter/core/solidhunter-lib/src/rules/security/func_visibility.rs rename to toolchains/solidity/core/crates/linter-lib/src/rules/security/func_visibility.rs index b38d03d9..45ee8ed8 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/security/func_visibility.rs +++ b/toolchains/solidity/core/crates/linter-lib/src/rules/security/func_visibility.rs @@ -1,7 +1,7 @@ use crate::linter::SolidFile; use crate::rules::types::*; use crate::types::*; -use ast_extractor::Spanned; +use osmium_libs_solidity_ast_extractor::Spanned; // global pub const RULE_ID: &str = "func-visibility"; @@ -19,7 +19,7 @@ pub struct FuncVisibility { impl FuncVisibility { fn create_diag( &self, - location: (ast_extractor::LineColumn, ast_extractor::LineColumn), + location: (osmium_libs_solidity_ast_extractor::LineColumn, osmium_libs_solidity_ast_extractor::LineColumn), file: &SolidFile, ) -> LintDiag { LintDiag { @@ -47,10 +47,10 @@ impl FuncVisibility { impl RuleType for FuncVisibility { fn diagnose(&self, file: &SolidFile, _files: &[SolidFile]) -> Vec { let mut res = Vec::new(); - let contracts = ast_extractor::retriever::retrieve_contract_nodes(&file.data); + let contracts = osmium_libs_solidity_ast_extractor::retriever::retrieve_contract_nodes(&file.data); for contract in contracts { - for function in ast_extractor::retriever::retrieve_functions_nodes(&contract) { + for function in osmium_libs_solidity_ast_extractor::retriever::retrieve_functions_nodes(&contract) { if function.attributes.visibility().is_some() || (function.kind.is_constructor() && self.ignore_constructors) { diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/security/mod.rs b/toolchains/solidity/core/crates/linter-lib/src/rules/security/mod.rs similarity index 100% rename from toolchains/solidity/linter/core/solidhunter-lib/src/rules/security/mod.rs rename to toolchains/solidity/core/crates/linter-lib/src/rules/security/mod.rs diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/security/no_inline_assembly.rs b/toolchains/solidity/core/crates/linter-lib/src/rules/security/no_inline_assembly.rs similarity index 97% rename from toolchains/solidity/linter/core/solidhunter-lib/src/rules/security/no_inline_assembly.rs rename to toolchains/solidity/core/crates/linter-lib/src/rules/security/no_inline_assembly.rs index 29b019ef..7f444957 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/security/no_inline_assembly.rs +++ b/toolchains/solidity/core/crates/linter-lib/src/rules/security/no_inline_assembly.rs @@ -1,7 +1,7 @@ use crate::linter::SolidFile; use crate::rules::types::*; use crate::types::*; -use ast_extractor::*; +use osmium_libs_solidity_ast_extractor::*; // global pub const RULE_ID: &str = "no-inline-assembly"; diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/security/not_rely_on_time.rs b/toolchains/solidity/core/crates/linter-lib/src/rules/security/not_rely_on_time.rs similarity index 98% rename from toolchains/solidity/linter/core/solidhunter-lib/src/rules/security/not_rely_on_time.rs rename to toolchains/solidity/core/crates/linter-lib/src/rules/security/not_rely_on_time.rs index 6d04fa38..9fb0990a 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/security/not_rely_on_time.rs +++ b/toolchains/solidity/core/crates/linter-lib/src/rules/security/not_rely_on_time.rs @@ -1,7 +1,7 @@ use crate::linter::SolidFile; use crate::rules::types::*; use crate::types::*; -use ast_extractor::*; +use osmium_libs_solidity_ast_extractor::*; // global pub const RULE_ID: &str = "not-rely-on-time"; diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/security/state_visibility.rs b/toolchains/solidity/core/crates/linter-lib/src/rules/security/state_visibility.rs similarity index 97% rename from toolchains/solidity/linter/core/solidhunter-lib/src/rules/security/state_visibility.rs rename to toolchains/solidity/core/crates/linter-lib/src/rules/security/state_visibility.rs index 78ad1ba1..69cf402e 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/security/state_visibility.rs +++ b/toolchains/solidity/core/crates/linter-lib/src/rules/security/state_visibility.rs @@ -1,7 +1,7 @@ use crate::linter::SolidFile; use crate::rules::types::*; use crate::types::*; -use ast_extractor::*; +use osmium_libs_solidity_ast_extractor::*; // global pub const RULE_ID: &str = "state-visibility"; diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/types.rs b/toolchains/solidity/core/crates/linter-lib/src/rules/types.rs similarity index 100% rename from toolchains/solidity/linter/core/solidhunter-lib/src/rules/types.rs rename to toolchains/solidity/core/crates/linter-lib/src/rules/types.rs diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/utils.rs b/toolchains/solidity/core/crates/linter-lib/src/rules/utils.rs similarity index 89% rename from toolchains/solidity/linter/core/solidhunter-lib/src/rules/utils.rs rename to toolchains/solidity/core/crates/linter-lib/src/rules/utils.rs index 5377471d..4ee92f61 100644 --- a/toolchains/solidity/linter/core/solidhunter-lib/src/rules/utils.rs +++ b/toolchains/solidity/core/crates/linter-lib/src/rules/utils.rs @@ -1,4 +1,4 @@ -use ast_extractor::LineColumn; +use osmium_libs_solidity_ast_extractor::LineColumn; pub fn absolute_index_from_location(location: LineColumn, content: &str) -> usize { let mut index = 0; diff --git a/toolchains/solidity/linter/core/solidhunter-lib/src/types.rs b/toolchains/solidity/core/crates/linter-lib/src/types.rs similarity index 100% rename from toolchains/solidity/linter/core/solidhunter-lib/src/types.rs rename to toolchains/solidity/core/crates/linter-lib/src/types.rs diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/AvoidTxOrigin/.solidhunter.json b/toolchains/solidity/core/crates/linter-lib/testdata/AvoidTxOrigin/.solidhunter.json similarity index 100% rename from toolchains/solidity/linter/core/solidhunter-lib/testdata/AvoidTxOrigin/.solidhunter.json rename to toolchains/solidity/core/crates/linter-lib/testdata/AvoidTxOrigin/.solidhunter.json diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/AvoidTxOrigin/file.sol b/toolchains/solidity/core/crates/linter-lib/testdata/AvoidTxOrigin/file.sol similarity index 100% rename from toolchains/solidity/linter/core/solidhunter-lib/testdata/AvoidTxOrigin/file.sol rename to toolchains/solidity/core/crates/linter-lib/testdata/AvoidTxOrigin/file.sol diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/AvoidTxOrigin/findings.csv b/toolchains/solidity/core/crates/linter-lib/testdata/AvoidTxOrigin/findings.csv similarity index 100% rename from toolchains/solidity/linter/core/solidhunter-lib/testdata/AvoidTxOrigin/findings.csv rename to toolchains/solidity/core/crates/linter-lib/testdata/AvoidTxOrigin/findings.csv diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/ConstNameSnakeCase/.solidhunter.json b/toolchains/solidity/core/crates/linter-lib/testdata/ConstNameSnakeCase/.solidhunter.json similarity index 100% rename from toolchains/solidity/linter/core/solidhunter-lib/testdata/ConstNameSnakeCase/.solidhunter.json rename to toolchains/solidity/core/crates/linter-lib/testdata/ConstNameSnakeCase/.solidhunter.json diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/ConstNameSnakeCase/file.sol b/toolchains/solidity/core/crates/linter-lib/testdata/ConstNameSnakeCase/file.sol similarity index 100% rename from toolchains/solidity/linter/core/solidhunter-lib/testdata/ConstNameSnakeCase/file.sol rename to toolchains/solidity/core/crates/linter-lib/testdata/ConstNameSnakeCase/file.sol diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/ConstNameSnakeCase/findings.csv b/toolchains/solidity/core/crates/linter-lib/testdata/ConstNameSnakeCase/findings.csv similarity index 100% rename from toolchains/solidity/linter/core/solidhunter-lib/testdata/ConstNameSnakeCase/findings.csv rename to toolchains/solidity/core/crates/linter-lib/testdata/ConstNameSnakeCase/findings.csv diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/ContractNameCamelCase/.solidhunter.json b/toolchains/solidity/core/crates/linter-lib/testdata/ContractNameCamelCase/.solidhunter.json similarity index 100% rename from toolchains/solidity/linter/core/solidhunter-lib/testdata/ContractNameCamelCase/.solidhunter.json rename to toolchains/solidity/core/crates/linter-lib/testdata/ContractNameCamelCase/.solidhunter.json diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/ContractNameCamelCase/file.sol b/toolchains/solidity/core/crates/linter-lib/testdata/ContractNameCamelCase/file.sol similarity index 100% rename from toolchains/solidity/linter/core/solidhunter-lib/testdata/ContractNameCamelCase/file.sol rename to toolchains/solidity/core/crates/linter-lib/testdata/ContractNameCamelCase/file.sol diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/ContractNameCamelCase/findings.csv b/toolchains/solidity/core/crates/linter-lib/testdata/ContractNameCamelCase/findings.csv similarity index 100% rename from toolchains/solidity/linter/core/solidhunter-lib/testdata/ContractNameCamelCase/findings.csv rename to toolchains/solidity/core/crates/linter-lib/testdata/ContractNameCamelCase/findings.csv diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/CustomErrors/.solidhunter.json b/toolchains/solidity/core/crates/linter-lib/testdata/CustomErrors/.solidhunter.json similarity index 100% rename from toolchains/solidity/linter/core/solidhunter-lib/testdata/CustomErrors/.solidhunter.json rename to toolchains/solidity/core/crates/linter-lib/testdata/CustomErrors/.solidhunter.json diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/CustomErrors/file.sol b/toolchains/solidity/core/crates/linter-lib/testdata/CustomErrors/file.sol similarity index 100% rename from toolchains/solidity/linter/core/solidhunter-lib/testdata/CustomErrors/file.sol rename to toolchains/solidity/core/crates/linter-lib/testdata/CustomErrors/file.sol diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/CustomErrors/findings.csv b/toolchains/solidity/core/crates/linter-lib/testdata/CustomErrors/findings.csv similarity index 100% rename from toolchains/solidity/linter/core/solidhunter-lib/testdata/CustomErrors/findings.csv rename to toolchains/solidity/core/crates/linter-lib/testdata/CustomErrors/findings.csv diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/EventNameCamelCase/.solidhunter.json b/toolchains/solidity/core/crates/linter-lib/testdata/EventNameCamelCase/.solidhunter.json similarity index 100% rename from toolchains/solidity/linter/core/solidhunter-lib/testdata/EventNameCamelCase/.solidhunter.json rename to toolchains/solidity/core/crates/linter-lib/testdata/EventNameCamelCase/.solidhunter.json diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/EventNameCamelCase/file.sol b/toolchains/solidity/core/crates/linter-lib/testdata/EventNameCamelCase/file.sol similarity index 100% rename from toolchains/solidity/linter/core/solidhunter-lib/testdata/EventNameCamelCase/file.sol rename to toolchains/solidity/core/crates/linter-lib/testdata/EventNameCamelCase/file.sol diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/EventNameCamelCase/findings.csv b/toolchains/solidity/core/crates/linter-lib/testdata/EventNameCamelCase/findings.csv similarity index 100% rename from toolchains/solidity/linter/core/solidhunter-lib/testdata/EventNameCamelCase/findings.csv rename to toolchains/solidity/core/crates/linter-lib/testdata/EventNameCamelCase/findings.csv diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/ExplicitTypes/.solidhunter.json b/toolchains/solidity/core/crates/linter-lib/testdata/ExplicitTypes/.solidhunter.json similarity index 100% rename from toolchains/solidity/linter/core/solidhunter-lib/testdata/ExplicitTypes/.solidhunter.json rename to toolchains/solidity/core/crates/linter-lib/testdata/ExplicitTypes/.solidhunter.json diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/ExplicitTypes/file.sol b/toolchains/solidity/core/crates/linter-lib/testdata/ExplicitTypes/file.sol similarity index 100% rename from toolchains/solidity/linter/core/solidhunter-lib/testdata/ExplicitTypes/file.sol rename to toolchains/solidity/core/crates/linter-lib/testdata/ExplicitTypes/file.sol diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/ExplicitTypes/findings.csv b/toolchains/solidity/core/crates/linter-lib/testdata/ExplicitTypes/findings.csv similarity index 100% rename from toolchains/solidity/linter/core/solidhunter-lib/testdata/ExplicitTypes/findings.csv rename to toolchains/solidity/core/crates/linter-lib/testdata/ExplicitTypes/findings.csv diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/FoundryTestFunctions/.solidhunter.json b/toolchains/solidity/core/crates/linter-lib/testdata/FoundryTestFunctions/.solidhunter.json similarity index 100% rename from toolchains/solidity/linter/core/solidhunter-lib/testdata/FoundryTestFunctions/.solidhunter.json rename to toolchains/solidity/core/crates/linter-lib/testdata/FoundryTestFunctions/.solidhunter.json diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/FoundryTestFunctions/file.t.sol b/toolchains/solidity/core/crates/linter-lib/testdata/FoundryTestFunctions/file.t.sol similarity index 100% rename from toolchains/solidity/linter/core/solidhunter-lib/testdata/FoundryTestFunctions/file.t.sol rename to toolchains/solidity/core/crates/linter-lib/testdata/FoundryTestFunctions/file.t.sol diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/FoundryTestFunctions/findings.csv b/toolchains/solidity/core/crates/linter-lib/testdata/FoundryTestFunctions/findings.csv similarity index 100% rename from toolchains/solidity/linter/core/solidhunter-lib/testdata/FoundryTestFunctions/findings.csv rename to toolchains/solidity/core/crates/linter-lib/testdata/FoundryTestFunctions/findings.csv diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/FunctionMaxLines/.solidhunter.json b/toolchains/solidity/core/crates/linter-lib/testdata/FunctionMaxLines/.solidhunter.json similarity index 100% rename from toolchains/solidity/linter/core/solidhunter-lib/testdata/FunctionMaxLines/.solidhunter.json rename to toolchains/solidity/core/crates/linter-lib/testdata/FunctionMaxLines/.solidhunter.json diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/FunctionMaxLines/file.sol b/toolchains/solidity/core/crates/linter-lib/testdata/FunctionMaxLines/file.sol similarity index 100% rename from toolchains/solidity/linter/core/solidhunter-lib/testdata/FunctionMaxLines/file.sol rename to toolchains/solidity/core/crates/linter-lib/testdata/FunctionMaxLines/file.sol diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/FunctionMaxLines/findings.csv b/toolchains/solidity/core/crates/linter-lib/testdata/FunctionMaxLines/findings.csv similarity index 100% rename from toolchains/solidity/linter/core/solidhunter-lib/testdata/FunctionMaxLines/findings.csv rename to toolchains/solidity/core/crates/linter-lib/testdata/FunctionMaxLines/findings.csv diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/FunctionNameMixedCase/.solidhunter.json b/toolchains/solidity/core/crates/linter-lib/testdata/FunctionNameMixedCase/.solidhunter.json similarity index 100% rename from toolchains/solidity/linter/core/solidhunter-lib/testdata/FunctionNameMixedCase/.solidhunter.json rename to toolchains/solidity/core/crates/linter-lib/testdata/FunctionNameMixedCase/.solidhunter.json diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/FunctionNameMixedCase/file.sol b/toolchains/solidity/core/crates/linter-lib/testdata/FunctionNameMixedCase/file.sol similarity index 100% rename from toolchains/solidity/linter/core/solidhunter-lib/testdata/FunctionNameMixedCase/file.sol rename to toolchains/solidity/core/crates/linter-lib/testdata/FunctionNameMixedCase/file.sol diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/FunctionNameMixedCase/findings.csv b/toolchains/solidity/core/crates/linter-lib/testdata/FunctionNameMixedCase/findings.csv similarity index 100% rename from toolchains/solidity/linter/core/solidhunter-lib/testdata/FunctionNameMixedCase/findings.csv rename to toolchains/solidity/core/crates/linter-lib/testdata/FunctionNameMixedCase/findings.csv diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/FunctionParamNameMixedCase/.solidhunter.json b/toolchains/solidity/core/crates/linter-lib/testdata/FunctionParamNameMixedCase/.solidhunter.json similarity index 100% rename from toolchains/solidity/linter/core/solidhunter-lib/testdata/FunctionParamNameMixedCase/.solidhunter.json rename to toolchains/solidity/core/crates/linter-lib/testdata/FunctionParamNameMixedCase/.solidhunter.json diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/FunctionParamNameMixedCase/file.sol b/toolchains/solidity/core/crates/linter-lib/testdata/FunctionParamNameMixedCase/file.sol similarity index 100% rename from toolchains/solidity/linter/core/solidhunter-lib/testdata/FunctionParamNameMixedCase/file.sol rename to toolchains/solidity/core/crates/linter-lib/testdata/FunctionParamNameMixedCase/file.sol diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/FunctionParamNameMixedCase/findings.csv b/toolchains/solidity/core/crates/linter-lib/testdata/FunctionParamNameMixedCase/findings.csv similarity index 100% rename from toolchains/solidity/linter/core/solidhunter-lib/testdata/FunctionParamNameMixedCase/findings.csv rename to toolchains/solidity/core/crates/linter-lib/testdata/FunctionParamNameMixedCase/findings.csv diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/FunctionVisibility/.solidhunter.json b/toolchains/solidity/core/crates/linter-lib/testdata/FunctionVisibility/.solidhunter.json similarity index 100% rename from toolchains/solidity/linter/core/solidhunter-lib/testdata/FunctionVisibility/.solidhunter.json rename to toolchains/solidity/core/crates/linter-lib/testdata/FunctionVisibility/.solidhunter.json diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/FunctionVisibility/file.sol b/toolchains/solidity/core/crates/linter-lib/testdata/FunctionVisibility/file.sol similarity index 100% rename from toolchains/solidity/linter/core/solidhunter-lib/testdata/FunctionVisibility/file.sol rename to toolchains/solidity/core/crates/linter-lib/testdata/FunctionVisibility/file.sol diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/FunctionVisibility/findings.csv b/toolchains/solidity/core/crates/linter-lib/testdata/FunctionVisibility/findings.csv similarity index 100% rename from toolchains/solidity/linter/core/solidhunter-lib/testdata/FunctionVisibility/findings.csv rename to toolchains/solidity/core/crates/linter-lib/testdata/FunctionVisibility/findings.csv diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/ImplicitTypes/.solidhunter.json b/toolchains/solidity/core/crates/linter-lib/testdata/ImplicitTypes/.solidhunter.json similarity index 100% rename from toolchains/solidity/linter/core/solidhunter-lib/testdata/ImplicitTypes/.solidhunter.json rename to toolchains/solidity/core/crates/linter-lib/testdata/ImplicitTypes/.solidhunter.json diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/ImplicitTypes/file.sol b/toolchains/solidity/core/crates/linter-lib/testdata/ImplicitTypes/file.sol similarity index 100% rename from toolchains/solidity/linter/core/solidhunter-lib/testdata/ImplicitTypes/file.sol rename to toolchains/solidity/core/crates/linter-lib/testdata/ImplicitTypes/file.sol diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/ImplicitTypes/findings.csv b/toolchains/solidity/core/crates/linter-lib/testdata/ImplicitTypes/findings.csv similarity index 100% rename from toolchains/solidity/linter/core/solidhunter-lib/testdata/ImplicitTypes/findings.csv rename to toolchains/solidity/core/crates/linter-lib/testdata/ImplicitTypes/findings.csv diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/ImportOnTop/.solidhunter.json b/toolchains/solidity/core/crates/linter-lib/testdata/ImportOnTop/.solidhunter.json similarity index 100% rename from toolchains/solidity/linter/core/solidhunter-lib/testdata/ImportOnTop/.solidhunter.json rename to toolchains/solidity/core/crates/linter-lib/testdata/ImportOnTop/.solidhunter.json diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/ImportOnTop/file.sol b/toolchains/solidity/core/crates/linter-lib/testdata/ImportOnTop/file.sol similarity index 100% rename from toolchains/solidity/linter/core/solidhunter-lib/testdata/ImportOnTop/file.sol rename to toolchains/solidity/core/crates/linter-lib/testdata/ImportOnTop/file.sol diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/ImportOnTop/findings.csv b/toolchains/solidity/core/crates/linter-lib/testdata/ImportOnTop/findings.csv similarity index 100% rename from toolchains/solidity/linter/core/solidhunter-lib/testdata/ImportOnTop/findings.csv rename to toolchains/solidity/core/crates/linter-lib/testdata/ImportOnTop/findings.csv diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/MaxLineLength/.solidhunter.json b/toolchains/solidity/core/crates/linter-lib/testdata/MaxLineLength/.solidhunter.json similarity index 100% rename from toolchains/solidity/linter/core/solidhunter-lib/testdata/MaxLineLength/.solidhunter.json rename to toolchains/solidity/core/crates/linter-lib/testdata/MaxLineLength/.solidhunter.json diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/MaxLineLength/file.sol b/toolchains/solidity/core/crates/linter-lib/testdata/MaxLineLength/file.sol similarity index 100% rename from toolchains/solidity/linter/core/solidhunter-lib/testdata/MaxLineLength/file.sol rename to toolchains/solidity/core/crates/linter-lib/testdata/MaxLineLength/file.sol diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/MaxLineLength/findings.csv b/toolchains/solidity/core/crates/linter-lib/testdata/MaxLineLength/findings.csv similarity index 100% rename from toolchains/solidity/linter/core/solidhunter-lib/testdata/MaxLineLength/findings.csv rename to toolchains/solidity/core/crates/linter-lib/testdata/MaxLineLength/findings.csv diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/MaxStatesCount/.solidhunter.json b/toolchains/solidity/core/crates/linter-lib/testdata/MaxStatesCount/.solidhunter.json similarity index 100% rename from toolchains/solidity/linter/core/solidhunter-lib/testdata/MaxStatesCount/.solidhunter.json rename to toolchains/solidity/core/crates/linter-lib/testdata/MaxStatesCount/.solidhunter.json diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/MaxStatesCount/file.sol b/toolchains/solidity/core/crates/linter-lib/testdata/MaxStatesCount/file.sol similarity index 100% rename from toolchains/solidity/linter/core/solidhunter-lib/testdata/MaxStatesCount/file.sol rename to toolchains/solidity/core/crates/linter-lib/testdata/MaxStatesCount/file.sol diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/MaxStatesCount/findings.csv b/toolchains/solidity/core/crates/linter-lib/testdata/MaxStatesCount/findings.csv similarity index 100% rename from toolchains/solidity/linter/core/solidhunter-lib/testdata/MaxStatesCount/findings.csv rename to toolchains/solidity/core/crates/linter-lib/testdata/MaxStatesCount/findings.csv diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/ModifierNameMixedcase/.solidhunter.json b/toolchains/solidity/core/crates/linter-lib/testdata/ModifierNameMixedcase/.solidhunter.json similarity index 100% rename from toolchains/solidity/linter/core/solidhunter-lib/testdata/ModifierNameMixedcase/.solidhunter.json rename to toolchains/solidity/core/crates/linter-lib/testdata/ModifierNameMixedcase/.solidhunter.json diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/ModifierNameMixedcase/file.sol b/toolchains/solidity/core/crates/linter-lib/testdata/ModifierNameMixedcase/file.sol similarity index 100% rename from toolchains/solidity/linter/core/solidhunter-lib/testdata/ModifierNameMixedcase/file.sol rename to toolchains/solidity/core/crates/linter-lib/testdata/ModifierNameMixedcase/file.sol diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/ModifierNameMixedcase/findings.csv b/toolchains/solidity/core/crates/linter-lib/testdata/ModifierNameMixedcase/findings.csv similarity index 100% rename from toolchains/solidity/linter/core/solidhunter-lib/testdata/ModifierNameMixedcase/findings.csv rename to toolchains/solidity/core/crates/linter-lib/testdata/ModifierNameMixedcase/findings.csv diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/NamedParametersMapping/.solidhunter.json b/toolchains/solidity/core/crates/linter-lib/testdata/NamedParametersMapping/.solidhunter.json similarity index 100% rename from toolchains/solidity/linter/core/solidhunter-lib/testdata/NamedParametersMapping/.solidhunter.json rename to toolchains/solidity/core/crates/linter-lib/testdata/NamedParametersMapping/.solidhunter.json diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/NamedParametersMapping/file.sol b/toolchains/solidity/core/crates/linter-lib/testdata/NamedParametersMapping/file.sol similarity index 100% rename from toolchains/solidity/linter/core/solidhunter-lib/testdata/NamedParametersMapping/file.sol rename to toolchains/solidity/core/crates/linter-lib/testdata/NamedParametersMapping/file.sol diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/NamedParametersMapping/findings.csv b/toolchains/solidity/core/crates/linter-lib/testdata/NamedParametersMapping/findings.csv similarity index 100% rename from toolchains/solidity/linter/core/solidhunter-lib/testdata/NamedParametersMapping/findings.csv rename to toolchains/solidity/core/crates/linter-lib/testdata/NamedParametersMapping/findings.csv diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/NoConsole/.solidhunter.json b/toolchains/solidity/core/crates/linter-lib/testdata/NoConsole/.solidhunter.json similarity index 100% rename from toolchains/solidity/linter/core/solidhunter-lib/testdata/NoConsole/.solidhunter.json rename to toolchains/solidity/core/crates/linter-lib/testdata/NoConsole/.solidhunter.json diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/NoConsole/file.sol b/toolchains/solidity/core/crates/linter-lib/testdata/NoConsole/file.sol similarity index 100% rename from toolchains/solidity/linter/core/solidhunter-lib/testdata/NoConsole/file.sol rename to toolchains/solidity/core/crates/linter-lib/testdata/NoConsole/file.sol diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/NoConsole/findings.csv b/toolchains/solidity/core/crates/linter-lib/testdata/NoConsole/findings.csv similarity index 100% rename from toolchains/solidity/linter/core/solidhunter-lib/testdata/NoConsole/findings.csv rename to toolchains/solidity/core/crates/linter-lib/testdata/NoConsole/findings.csv diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/NoEmptyBlock/.solidhunter.json b/toolchains/solidity/core/crates/linter-lib/testdata/NoEmptyBlock/.solidhunter.json similarity index 100% rename from toolchains/solidity/linter/core/solidhunter-lib/testdata/NoEmptyBlock/.solidhunter.json rename to toolchains/solidity/core/crates/linter-lib/testdata/NoEmptyBlock/.solidhunter.json diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/NoEmptyBlock/file.sol b/toolchains/solidity/core/crates/linter-lib/testdata/NoEmptyBlock/file.sol similarity index 100% rename from toolchains/solidity/linter/core/solidhunter-lib/testdata/NoEmptyBlock/file.sol rename to toolchains/solidity/core/crates/linter-lib/testdata/NoEmptyBlock/file.sol diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/NoEmptyBlock/findings.csv b/toolchains/solidity/core/crates/linter-lib/testdata/NoEmptyBlock/findings.csv similarity index 100% rename from toolchains/solidity/linter/core/solidhunter-lib/testdata/NoEmptyBlock/findings.csv rename to toolchains/solidity/core/crates/linter-lib/testdata/NoEmptyBlock/findings.csv diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/NoGlobalImport/.solidhunter.json b/toolchains/solidity/core/crates/linter-lib/testdata/NoGlobalImport/.solidhunter.json similarity index 100% rename from toolchains/solidity/linter/core/solidhunter-lib/testdata/NoGlobalImport/.solidhunter.json rename to toolchains/solidity/core/crates/linter-lib/testdata/NoGlobalImport/.solidhunter.json diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/NoGlobalImport/add.sol b/toolchains/solidity/core/crates/linter-lib/testdata/NoGlobalImport/add.sol similarity index 100% rename from toolchains/solidity/linter/core/solidhunter-lib/testdata/NoGlobalImport/add.sol rename to toolchains/solidity/core/crates/linter-lib/testdata/NoGlobalImport/add.sol diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/NoGlobalImport/file.sol b/toolchains/solidity/core/crates/linter-lib/testdata/NoGlobalImport/file.sol similarity index 100% rename from toolchains/solidity/linter/core/solidhunter-lib/testdata/NoGlobalImport/file.sol rename to toolchains/solidity/core/crates/linter-lib/testdata/NoGlobalImport/file.sol diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/NoGlobalImport/findings.csv b/toolchains/solidity/core/crates/linter-lib/testdata/NoGlobalImport/findings.csv similarity index 100% rename from toolchains/solidity/linter/core/solidhunter-lib/testdata/NoGlobalImport/findings.csv rename to toolchains/solidity/core/crates/linter-lib/testdata/NoGlobalImport/findings.csv diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/NoInlineAssembly/.solidhunter.json b/toolchains/solidity/core/crates/linter-lib/testdata/NoInlineAssembly/.solidhunter.json similarity index 100% rename from toolchains/solidity/linter/core/solidhunter-lib/testdata/NoInlineAssembly/.solidhunter.json rename to toolchains/solidity/core/crates/linter-lib/testdata/NoInlineAssembly/.solidhunter.json diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/NoInlineAssembly/file.sol b/toolchains/solidity/core/crates/linter-lib/testdata/NoInlineAssembly/file.sol similarity index 100% rename from toolchains/solidity/linter/core/solidhunter-lib/testdata/NoInlineAssembly/file.sol rename to toolchains/solidity/core/crates/linter-lib/testdata/NoInlineAssembly/file.sol diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/NoInlineAssembly/findings.csv b/toolchains/solidity/core/crates/linter-lib/testdata/NoInlineAssembly/findings.csv similarity index 100% rename from toolchains/solidity/linter/core/solidhunter-lib/testdata/NoInlineAssembly/findings.csv rename to toolchains/solidity/core/crates/linter-lib/testdata/NoInlineAssembly/findings.csv diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/NotRelyOnTime/.solidhunter.json b/toolchains/solidity/core/crates/linter-lib/testdata/NotRelyOnTime/.solidhunter.json similarity index 100% rename from toolchains/solidity/linter/core/solidhunter-lib/testdata/NotRelyOnTime/.solidhunter.json rename to toolchains/solidity/core/crates/linter-lib/testdata/NotRelyOnTime/.solidhunter.json diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/NotRelyOnTime/file.sol b/toolchains/solidity/core/crates/linter-lib/testdata/NotRelyOnTime/file.sol similarity index 100% rename from toolchains/solidity/linter/core/solidhunter-lib/testdata/NotRelyOnTime/file.sol rename to toolchains/solidity/core/crates/linter-lib/testdata/NotRelyOnTime/file.sol diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/NotRelyOnTime/findings.csv b/toolchains/solidity/core/crates/linter-lib/testdata/NotRelyOnTime/findings.csv similarity index 100% rename from toolchains/solidity/linter/core/solidhunter-lib/testdata/NotRelyOnTime/findings.csv rename to toolchains/solidity/core/crates/linter-lib/testdata/NotRelyOnTime/findings.csv diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/OneContractPerFile/.solidhunter.json b/toolchains/solidity/core/crates/linter-lib/testdata/OneContractPerFile/.solidhunter.json similarity index 100% rename from toolchains/solidity/linter/core/solidhunter-lib/testdata/OneContractPerFile/.solidhunter.json rename to toolchains/solidity/core/crates/linter-lib/testdata/OneContractPerFile/.solidhunter.json diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/OneContractPerFile/file.sol b/toolchains/solidity/core/crates/linter-lib/testdata/OneContractPerFile/file.sol similarity index 100% rename from toolchains/solidity/linter/core/solidhunter-lib/testdata/OneContractPerFile/file.sol rename to toolchains/solidity/core/crates/linter-lib/testdata/OneContractPerFile/file.sol diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/OneContractPerFile/findings.csv b/toolchains/solidity/core/crates/linter-lib/testdata/OneContractPerFile/findings.csv similarity index 100% rename from toolchains/solidity/linter/core/solidhunter-lib/testdata/OneContractPerFile/findings.csv rename to toolchains/solidity/core/crates/linter-lib/testdata/OneContractPerFile/findings.csv diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/Ordering/.solidhunter.json b/toolchains/solidity/core/crates/linter-lib/testdata/Ordering/.solidhunter.json similarity index 100% rename from toolchains/solidity/linter/core/solidhunter-lib/testdata/Ordering/.solidhunter.json rename to toolchains/solidity/core/crates/linter-lib/testdata/Ordering/.solidhunter.json diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/Ordering/file.sol b/toolchains/solidity/core/crates/linter-lib/testdata/Ordering/file.sol similarity index 100% rename from toolchains/solidity/linter/core/solidhunter-lib/testdata/Ordering/file.sol rename to toolchains/solidity/core/crates/linter-lib/testdata/Ordering/file.sol diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/Ordering/findings.csv b/toolchains/solidity/core/crates/linter-lib/testdata/Ordering/findings.csv similarity index 100% rename from toolchains/solidity/linter/core/solidhunter-lib/testdata/Ordering/findings.csv rename to toolchains/solidity/core/crates/linter-lib/testdata/Ordering/findings.csv diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/PayableFallback/.solidhunter.json b/toolchains/solidity/core/crates/linter-lib/testdata/PayableFallback/.solidhunter.json similarity index 100% rename from toolchains/solidity/linter/core/solidhunter-lib/testdata/PayableFallback/.solidhunter.json rename to toolchains/solidity/core/crates/linter-lib/testdata/PayableFallback/.solidhunter.json diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/PayableFallback/file.sol b/toolchains/solidity/core/crates/linter-lib/testdata/PayableFallback/file.sol similarity index 100% rename from toolchains/solidity/linter/core/solidhunter-lib/testdata/PayableFallback/file.sol rename to toolchains/solidity/core/crates/linter-lib/testdata/PayableFallback/file.sol diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/PayableFallback/findings.csv b/toolchains/solidity/core/crates/linter-lib/testdata/PayableFallback/findings.csv similarity index 100% rename from toolchains/solidity/linter/core/solidhunter-lib/testdata/PayableFallback/findings.csv rename to toolchains/solidity/core/crates/linter-lib/testdata/PayableFallback/findings.csv diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/PrivateVarsLeadingUnderscore/.solidhunter.json b/toolchains/solidity/core/crates/linter-lib/testdata/PrivateVarsLeadingUnderscore/.solidhunter.json similarity index 100% rename from toolchains/solidity/linter/core/solidhunter-lib/testdata/PrivateVarsLeadingUnderscore/.solidhunter.json rename to toolchains/solidity/core/crates/linter-lib/testdata/PrivateVarsLeadingUnderscore/.solidhunter.json diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/PrivateVarsLeadingUnderscore/file.sol b/toolchains/solidity/core/crates/linter-lib/testdata/PrivateVarsLeadingUnderscore/file.sol similarity index 100% rename from toolchains/solidity/linter/core/solidhunter-lib/testdata/PrivateVarsLeadingUnderscore/file.sol rename to toolchains/solidity/core/crates/linter-lib/testdata/PrivateVarsLeadingUnderscore/file.sol diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/PrivateVarsLeadingUnderscore/findings.csv b/toolchains/solidity/core/crates/linter-lib/testdata/PrivateVarsLeadingUnderscore/findings.csv similarity index 100% rename from toolchains/solidity/linter/core/solidhunter-lib/testdata/PrivateVarsLeadingUnderscore/findings.csv rename to toolchains/solidity/core/crates/linter-lib/testdata/PrivateVarsLeadingUnderscore/findings.csv diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/ReasonString/.solidhunter.json b/toolchains/solidity/core/crates/linter-lib/testdata/ReasonString/.solidhunter.json similarity index 100% rename from toolchains/solidity/linter/core/solidhunter-lib/testdata/ReasonString/.solidhunter.json rename to toolchains/solidity/core/crates/linter-lib/testdata/ReasonString/.solidhunter.json diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/ReasonString/file.sol b/toolchains/solidity/core/crates/linter-lib/testdata/ReasonString/file.sol similarity index 100% rename from toolchains/solidity/linter/core/solidhunter-lib/testdata/ReasonString/file.sol rename to toolchains/solidity/core/crates/linter-lib/testdata/ReasonString/file.sol diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/ReasonString/findings.csv b/toolchains/solidity/core/crates/linter-lib/testdata/ReasonString/findings.csv similarity index 100% rename from toolchains/solidity/linter/core/solidhunter-lib/testdata/ReasonString/findings.csv rename to toolchains/solidity/core/crates/linter-lib/testdata/ReasonString/findings.csv diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/StateVisibility/.solidhunter.json b/toolchains/solidity/core/crates/linter-lib/testdata/StateVisibility/.solidhunter.json similarity index 100% rename from toolchains/solidity/linter/core/solidhunter-lib/testdata/StateVisibility/.solidhunter.json rename to toolchains/solidity/core/crates/linter-lib/testdata/StateVisibility/.solidhunter.json diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/StateVisibility/file.sol b/toolchains/solidity/core/crates/linter-lib/testdata/StateVisibility/file.sol similarity index 100% rename from toolchains/solidity/linter/core/solidhunter-lib/testdata/StateVisibility/file.sol rename to toolchains/solidity/core/crates/linter-lib/testdata/StateVisibility/file.sol diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/StateVisibility/findings.csv b/toolchains/solidity/core/crates/linter-lib/testdata/StateVisibility/findings.csv similarity index 100% rename from toolchains/solidity/linter/core/solidhunter-lib/testdata/StateVisibility/findings.csv rename to toolchains/solidity/core/crates/linter-lib/testdata/StateVisibility/findings.csv diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/UseForbiddenName/.solidhunter.json b/toolchains/solidity/core/crates/linter-lib/testdata/UseForbiddenName/.solidhunter.json similarity index 100% rename from toolchains/solidity/linter/core/solidhunter-lib/testdata/UseForbiddenName/.solidhunter.json rename to toolchains/solidity/core/crates/linter-lib/testdata/UseForbiddenName/.solidhunter.json diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/UseForbiddenName/file.sol b/toolchains/solidity/core/crates/linter-lib/testdata/UseForbiddenName/file.sol similarity index 100% rename from toolchains/solidity/linter/core/solidhunter-lib/testdata/UseForbiddenName/file.sol rename to toolchains/solidity/core/crates/linter-lib/testdata/UseForbiddenName/file.sol diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/UseForbiddenName/findings.csv b/toolchains/solidity/core/crates/linter-lib/testdata/UseForbiddenName/findings.csv similarity index 100% rename from toolchains/solidity/linter/core/solidhunter-lib/testdata/UseForbiddenName/findings.csv rename to toolchains/solidity/core/crates/linter-lib/testdata/UseForbiddenName/findings.csv diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/VarNameMixedCase/.solidhunter.json b/toolchains/solidity/core/crates/linter-lib/testdata/VarNameMixedCase/.solidhunter.json similarity index 100% rename from toolchains/solidity/linter/core/solidhunter-lib/testdata/VarNameMixedCase/.solidhunter.json rename to toolchains/solidity/core/crates/linter-lib/testdata/VarNameMixedCase/.solidhunter.json diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/VarNameMixedCase/file.sol b/toolchains/solidity/core/crates/linter-lib/testdata/VarNameMixedCase/file.sol similarity index 100% rename from toolchains/solidity/linter/core/solidhunter-lib/testdata/VarNameMixedCase/file.sol rename to toolchains/solidity/core/crates/linter-lib/testdata/VarNameMixedCase/file.sol diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/VarNameMixedCase/findings.csv b/toolchains/solidity/core/crates/linter-lib/testdata/VarNameMixedCase/findings.csv similarity index 100% rename from toolchains/solidity/linter/core/solidhunter-lib/testdata/VarNameMixedCase/findings.csv rename to toolchains/solidity/core/crates/linter-lib/testdata/VarNameMixedCase/findings.csv diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/VisibilityModifierOrder/.solidhunter.json b/toolchains/solidity/core/crates/linter-lib/testdata/VisibilityModifierOrder/.solidhunter.json similarity index 100% rename from toolchains/solidity/linter/core/solidhunter-lib/testdata/VisibilityModifierOrder/.solidhunter.json rename to toolchains/solidity/core/crates/linter-lib/testdata/VisibilityModifierOrder/.solidhunter.json diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/VisibilityModifierOrder/file.sol b/toolchains/solidity/core/crates/linter-lib/testdata/VisibilityModifierOrder/file.sol similarity index 100% rename from toolchains/solidity/linter/core/solidhunter-lib/testdata/VisibilityModifierOrder/file.sol rename to toolchains/solidity/core/crates/linter-lib/testdata/VisibilityModifierOrder/file.sol diff --git a/toolchains/solidity/linter/core/solidhunter-lib/testdata/VisibilityModifierOrder/findings.csv b/toolchains/solidity/core/crates/linter-lib/testdata/VisibilityModifierOrder/findings.csv similarity index 100% rename from toolchains/solidity/linter/core/solidhunter-lib/testdata/VisibilityModifierOrder/findings.csv rename to toolchains/solidity/core/crates/linter-lib/testdata/VisibilityModifierOrder/findings.csv diff --git a/toolchains/solidity/linter/core/solidhunter-lib/tests/linter.rs b/toolchains/solidity/core/crates/linter-lib/tests/linter.rs similarity index 100% rename from toolchains/solidity/linter/core/solidhunter-lib/tests/linter.rs rename to toolchains/solidity/core/crates/linter-lib/tests/linter.rs diff --git a/toolchains/solidity/core/crates/linter-server/Cargo.toml b/toolchains/solidity/core/crates/linter-server/Cargo.toml new file mode 100644 index 00000000..97cd81d1 --- /dev/null +++ b/toolchains/solidity/core/crates/linter-server/Cargo.toml @@ -0,0 +1,14 @@ +[package] +name = "linter-server" +version = "0.0.2" +edition = "2021" + +[lib] +crate-type = ["cdylib", "rlib"] + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] +osmium-libs-lsp-handler = { path = "../../../../../libs/lsp-handler", version = "0.0.1" } +solidhunter-lib = { path = "../linter-lib", version = "0.0.2" } +js-sys = "0.3.64" \ No newline at end of file diff --git a/toolchains/solidity/linter/core/src/server.rs b/toolchains/solidity/core/crates/linter-server/src/lib.rs similarity index 72% rename from toolchains/solidity/linter/core/src/server.rs rename to toolchains/solidity/core/crates/linter-server/src/lib.rs index 3242d6c0..61a9b771 100644 --- a/toolchains/solidity/linter/core/src/server.rs +++ b/toolchains/solidity/core/crates/linter-server/src/lib.rs @@ -1,22 +1,24 @@ -use std::{cell::RefCell, rc::Rc}; +use std::cell::RefCell; -use lsp_server_wrapper::{ +use osmium_libs_lsp_handler::{ lsp_types::{ Diagnostic, DiagnosticSeverity, DidChangeTextDocumentParams, DidOpenTextDocumentParams, InitializeParams, InitializeResult, InitializedParams, MessageType, Position, Range, ServerCapabilities, TextDocumentSyncCapability, TextDocumentSyncKind, Url, }, - Client, LanguageServer, LspStdioServer, Result, + Result, + Handler, + Connection }; use solidhunter_lib::{linter::SolidLinter, types::LintDiag}; struct Backend { - client: Rc>, + connection: Connection, config_file_path: String, linter: RefCell>, } -impl LanguageServer for Backend { +impl Handler for Backend { fn initialize(&self, _: InitializeParams) -> Result { eprintln!("starting example main loop"); Ok(InitializeResult { @@ -35,10 +37,7 @@ impl LanguageServer for Backend { "Initializing server with config file: {:?}", self.config_file_path ); - self.client - .as_ref() - .borrow() - .log_message(MessageType::INFO, "Server initialized!"); + self.connection.log_message(MessageType::INFO, "Server initialized!"); if std::path::Path::new(&self.config_file_path).is_file() { let mut linter = SolidLinter::new(); @@ -54,26 +53,16 @@ impl LanguageServer for Backend { .replace(SolidLinter::new_fileless()); } - self.client - .as_ref() - .borrow() - .log_message(MessageType::INFO, "Linter initialized!"); + self.connection.log_message(MessageType::INFO, "Linter initialized!"); } fn shutdown(&self) -> Result<()> { - self.client - .as_ref() - .borrow() - .log_message(MessageType::INFO, "Server shutdown!"); + self.connection.log_message(MessageType::INFO, "Server shutdown!"); Ok(()) } fn did_open(&self, params: DidOpenTextDocumentParams) { - eprintln!("file opened!"); - self.client - .as_ref() - .borrow() - .log_message(MessageType::INFO, "file opened!"); + self.connection.log_message(MessageType::INFO, "file opened!"); let filepath = filepath_from_uri(¶ms.text_document.uri); let mut linter = self.linter.borrow_mut(); @@ -92,25 +81,18 @@ impl LanguageServer for Backend { .map(|d| diagnostic_from_lintdiag(d.clone())) .collect(); eprintln!("diags: {:#?}", diags); - self.client.as_ref().borrow().publish_diagnostics( + self.connection.publish_diagnostics( params.text_document.uri.clone(), diags, None, ); } else if let Err(e) = diags_res { - self.client - .as_ref() - .borrow() - .log_message(MessageType::ERROR, e.to_string()); + self.connection.log_message(MessageType::ERROR, e.to_string()); } } fn did_change(&self, params: DidChangeTextDocumentParams) { - eprintln!("file changed!"); - self.client - .as_ref() - .borrow() - .log_message(MessageType::INFO, "file changed!"); + self.connection.log_message(MessageType::INFO, "file changed!"); let filepath = filepath_from_uri(¶ms.text_document.uri); let mut linter = self.linter.borrow_mut(); @@ -129,16 +111,13 @@ impl LanguageServer for Backend { .map(|d| diagnostic_from_lintdiag(d.clone())) .collect(); eprintln!("diags: {:#?}", diags); - self.client.as_ref().borrow().publish_diagnostics( + self.connection.publish_diagnostics( params.text_document.uri.clone(), diags, None, ); } else if let Err(e) = diags_res { - self.client - .as_ref() - .borrow() - .log_message(MessageType::ERROR, e.to_string()); + self.connection.log_message(MessageType::ERROR, e.to_string()); } } } @@ -148,6 +127,7 @@ pub fn filepath_from_uri(uri: &Url) -> String { path.to_string() } + fn diagnostic_from_lintdiag(diag: LintDiag) -> Diagnostic { Diagnostic { range: Range { @@ -163,7 +143,7 @@ fn diagnostic_from_lintdiag(diag: LintDiag) -> Diagnostic { severity: Some(DiagnosticSeverity::WARNING), code: None, code_description: None, - source: Some("solidity-linter".to_string()), + source: Some("osmium-solidity-linter".to_string()), message: diag.message, related_information: None, tags: None, @@ -171,12 +151,10 @@ fn diagnostic_from_lintdiag(diag: LintDiag) -> Diagnostic { } } -pub fn run_server(config_file_path: String) { - eprintln!("starting LSP server"); - let server = LspStdioServer::new(); - let _ = LspStdioServer::serve(server, |client| Backend { - client, - config_file_path, +pub fn create_linter(connection: Connection) -> Box { + Box::new(Backend { + connection, + config_file_path: ".solidhunter.json".to_string(), linter: RefCell::new(None), - }); + }) } diff --git a/toolchains/solidity/linter/core/package.json b/toolchains/solidity/core/package.json similarity index 53% rename from toolchains/solidity/linter/core/package.json rename to toolchains/solidity/core/package.json index d8380fdf..7b3c3865 100644 --- a/toolchains/solidity/linter/core/package.json +++ b/toolchains/solidity/core/package.json @@ -1,12 +1,12 @@ { - "name": "osmium-solidity-linter-core", + "name": "osmium-solidity-core", "version": "0.0.2", "license": "MIT", "scripts": { - "build": "cargo build --release", + "build": "cd crates/extension && make && cd ../..", "lint": "cargo clippy -- -D warnings", "format": "cargo fmt --check --all", "test": "cargo test --workspace", - "publish": "yarn run build && cp target/release/solidhunter ../extension/core" + "publish": "cd crates/linter-lib && make publish && cd ../.." } } diff --git a/toolchains/solidity/linter/extension/.eslintrc.json b/toolchains/solidity/extension/.eslintrc.json similarity index 100% rename from toolchains/solidity/linter/extension/.eslintrc.json rename to toolchains/solidity/extension/.eslintrc.json diff --git a/toolchains/solidity/linter/extension/.vscodeignore b/toolchains/solidity/extension/.vscodeignore similarity index 93% rename from toolchains/solidity/linter/extension/.vscodeignore rename to toolchains/solidity/extension/.vscodeignore index cf4a2f50..c6136798 100644 --- a/toolchains/solidity/linter/extension/.vscodeignore +++ b/toolchains/solidity/extension/.vscodeignore @@ -11,4 +11,3 @@ vsc-extension-quickstart.md **/.eslintrc.json **/*.map **/*.ts -../.unstable \ No newline at end of file diff --git a/toolchains/solidity/linter/extension/.yarnrc b/toolchains/solidity/extension/.yarnrc similarity index 100% rename from toolchains/solidity/linter/extension/.yarnrc rename to toolchains/solidity/extension/.yarnrc diff --git a/toolchains/solidity/linter/extension/CHANGELOG.md b/toolchains/solidity/extension/CHANGELOG.md similarity index 64% rename from toolchains/solidity/linter/extension/CHANGELOG.md rename to toolchains/solidity/extension/CHANGELOG.md index a4ddaf4a..5e74a4f9 100644 --- a/toolchains/solidity/linter/extension/CHANGELOG.md +++ b/toolchains/solidity/extension/CHANGELOG.md @@ -1,6 +1,6 @@ # Change Log -All notable changes to the "solidhunter" extension will be documented in this file. +All notable changes to the "extension" extension will be documented in this file. Check [Keep a Changelog](http://keepachangelog.com/) for recommendations on how to structure this file. diff --git a/toolchains/solidity/extension/README.md b/toolchains/solidity/extension/README.md new file mode 100644 index 00000000..dacb82d5 --- /dev/null +++ b/toolchains/solidity/extension/README.md @@ -0,0 +1,71 @@ +# extension README + +This is the README for your extension "extension". After writing up a brief description, we recommend including the following sections. + +## Features + +Describe specific features of your extension including screenshots of your extension in action. Image paths are relative to this README file. + +For example if there is an image subfolder under your extension project workspace: + +\!\[feature X\]\(images/feature-x.png\) + +> Tip: Many popular extensions utilize animations. This is an excellent way to show off your extension! We recommend short, focused animations that are easy to follow. + +## Requirements + +If you have any requirements or dependencies, add a section describing those and how to install and configure them. + +## Extension Settings + +Include if your extension adds any VS Code settings through the `contributes.configuration` extension point. + +For example: + +This extension contributes the following settings: + +* `myExtension.enable`: Enable/disable this extension. +* `myExtension.thing`: Set to `blah` to do something. + +## Known Issues + +Calling out known issues can help limit users opening duplicate issues against your extension. + +## Release Notes + +Users appreciate release notes as you update your extension. + +### 1.0.0 + +Initial release of ... + +### 1.0.1 + +Fixed issue #. + +### 1.1.0 + +Added features X, Y, and Z. + +--- + +## Following extension guidelines + +Ensure that you've read through the extensions guidelines and follow the best practices for creating your extension. + +* [Extension Guidelines](https://code.visualstudio.com/api/references/extension-guidelines) + +## Working with Markdown + +You can author your README using Visual Studio Code. Here are some useful editor keyboard shortcuts: + +* Split the editor (`Cmd+\` on macOS or `Ctrl+\` on Windows and Linux). +* Toggle preview (`Shift+Cmd+V` on macOS or `Shift+Ctrl+V` on Windows and Linux). +* Press `Ctrl+Space` (Windows, Linux, macOS) to see a list of Markdown snippets. + +## For more information + +* [Visual Studio Code's Markdown Support](http://code.visualstudio.com/docs/languages/markdown) +* [Markdown Syntax Reference](https://help.github.com/articles/markdown-basics/) + +**Enjoy!** diff --git a/toolchains/solidity/extension/package.json b/toolchains/solidity/extension/package.json new file mode 100644 index 00000000..cdfeb688 --- /dev/null +++ b/toolchains/solidity/extension/package.json @@ -0,0 +1,57 @@ +{ + "name": "osmium-solidity-extension", + "displayName": "Osmium solidity", + "description": "", + "version": "0.0.1", + "engines": { + "vscode": "^1.75.0" + }, + "categories": [ + "Other" + ], + "activationEvents": [ + "onLanguage:solidity" + ], + "main": "./dist/extension.js", + "contributes": { + "commands": [ + { + "command": "extension.helloWorld", + "title": "Hello World" + } + ] + }, + "scripts": { + "build": "yarn run compile", + "vscode:prepublish": "yarn run package", + "compile": "webpack", + "watch": "webpack --watch", + "package": "webpack --mode production --devtool hidden-source-map", + "compile-tests": "tsc -p . --outDir out", + "watch-tests": "tsc -p . -w --outDir out", + "pretest": "yarn run compile-tests && yarn run compile && yarn run lint", + "lint": "eslint src --ext ts", + "test": "node ./out/test/runTest.js" + }, + "dependencies": { + "vscode-languageclient": "^8.1.0", + "vscode-languageserver": "^8.1.0", + "vscode-languageserver-textdocument": "^1.0.8" + }, + "devDependencies": { + "@types/glob": "^8.1.0", + "@types/mocha": "^10.0.1", + "@types/node": "20.2.5", + "@types/vscode": "^1.83.0", + "@typescript-eslint/eslint-plugin": "^5.59.8", + "@typescript-eslint/parser": "^5.59.8", + "@vscode/test-electron": "^2.3.2", + "eslint": "^8.41.0", + "glob": "^8.1.0", + "mocha": "^10.2.0", + "ts-loader": "^9.4.3", + "typescript": "^5.1.3", + "webpack": "^5.85.0", + "webpack-cli": "^5.1.1" + } +} diff --git a/toolchains/solidity/extension/src/extension.ts b/toolchains/solidity/extension/src/extension.ts new file mode 100644 index 00000000..8650ba50 --- /dev/null +++ b/toolchains/solidity/extension/src/extension.ts @@ -0,0 +1,61 @@ +/* -------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + * ------------------------------------------------------------------------------------------ */ + +import * as path from 'path'; +import { workspace, ExtensionContext } from 'vscode'; + +import { + LanguageClient, + LanguageClientOptions, + ServerOptions, + TransportKind +} from 'vscode-languageclient/node'; + +let client: LanguageClient; + +export function activate(context: ExtensionContext) { + // The server is implemented in node + const serverModule = context.asAbsolutePath( + path.join('dist', 'server.js') + ); + + // If the extension is launched in debug mode then the debug server options are used + // Otherwise the run options are used + const serverOptions: ServerOptions = { + run: { module: serverModule, transport: TransportKind.ipc }, + debug: { + module: serverModule, + transport: TransportKind.ipc, + } + }; + + // Options to control the language client + const clientOptions: LanguageClientOptions = { + // Register the server for plain text documents + documentSelector: [{ scheme: 'file', language: 'solidity' }], + synchronize: { + // Notify the server about file changes to '.clientrc files contained in the workspace + fileEvents: workspace.createFileSystemWatcher('**/.clientrc') + } + }; + + // Create the language client and start the client. + client = new LanguageClient( + 'osmium-solidity', + 'Osmium Solidity Language Server', + serverOptions, + clientOptions + ); + + // Start the client. This will also launch the server + client.start(); +} + +export function deactivate(): Thenable | undefined { + if (!client) { + return undefined; + } + return client.stop(); +} diff --git a/toolchains/solidity/extension/src/server.ts b/toolchains/solidity/extension/src/server.ts new file mode 100644 index 00000000..089410ea --- /dev/null +++ b/toolchains/solidity/extension/src/server.ts @@ -0,0 +1,56 @@ +/* -------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + * ------------------------------------------------------------------------------------------ */ +import { + createConnection, + TextDocuments, + Diagnostic, + DiagnosticSeverity, + ProposedFeatures, + InitializeParams, + DidChangeConfigurationNotification, + CompletionItem, + CompletionItemKind, + TextDocumentPositionParams, + TextDocumentSyncKind, + InitializeResult +} from 'vscode-languageserver/node'; +import {create_extension} from '../../out'; + +// Create a connection for the server, using Node's IPC as a transport. +// Also include all preview / proposed LSP features. +const connection = createConnection(ProposedFeatures.all); + + + + +const sendRequest = (method: string, params: any) => { + return connection.sendRequest(method, params); +}; + +const sendNotification = (method: string, params: any) => { + connection.sendNotification(method, params); +}; + +const extension = create_extension(sendRequest, sendNotification); + +connection.onInitialize((params: InitializeParams) => { + console.log(`onInitialize: ${params.rootUri}`); + return extension.onRequest('initialize', params); +}); + +connection.onRequest((method: string, params: any) => { + console.log(`onRequest: ${method}`); + connection.console.log(`onRequest: ${method}`); + + return extension.onRequest(method, params); +}); + +connection.onNotification((method: string, params: any) => { + console.log(`onNotification: ${method}`); + connection.console.log(`onNotification: ${method}`); + extension.onNotification(method, params); +}); + +connection.listen(); diff --git a/toolchains/solidity/extension/src/test/runTest.ts b/toolchains/solidity/extension/src/test/runTest.ts new file mode 100644 index 00000000..93a4441d --- /dev/null +++ b/toolchains/solidity/extension/src/test/runTest.ts @@ -0,0 +1,23 @@ +import * as path from 'path'; + +import { runTests } from '@vscode/test-electron'; + +async function main() { + try { + // The folder containing the Extension Manifest package.json + // Passed to `--extensionDevelopmentPath` + const extensionDevelopmentPath = path.resolve(__dirname, '../../'); + + // The path to test runner + // Passed to --extensionTestsPath + const extensionTestsPath = path.resolve(__dirname, './suite/index'); + + // Download VS Code, unzip it and run the integration test + await runTests({ extensionDevelopmentPath, extensionTestsPath }); + } catch (err) { + console.error('Failed to run tests', err); + process.exit(1); + } +} + +main(); diff --git a/toolchains/solidity/extension/src/test/suite/extension.test.ts b/toolchains/solidity/extension/src/test/suite/extension.test.ts new file mode 100644 index 00000000..4ca0ab41 --- /dev/null +++ b/toolchains/solidity/extension/src/test/suite/extension.test.ts @@ -0,0 +1,15 @@ +import * as assert from 'assert'; + +// You can import and use all API from the 'vscode' module +// as well as import your extension to test it +import * as vscode from 'vscode'; +// import * as myExtension from '../../extension'; + +suite('Extension Test Suite', () => { + vscode.window.showInformationMessage('Start all tests.'); + + test('Sample test', () => { + assert.strictEqual(-1, [1, 2, 3].indexOf(5)); + assert.strictEqual(-1, [1, 2, 3].indexOf(0)); + }); +}); diff --git a/toolchains/solidity/extension/src/test/suite/index.ts b/toolchains/solidity/extension/src/test/suite/index.ts new file mode 100644 index 00000000..7029e38e --- /dev/null +++ b/toolchains/solidity/extension/src/test/suite/index.ts @@ -0,0 +1,38 @@ +import * as path from 'path'; +import * as Mocha from 'mocha'; +import * as glob from 'glob'; + +export function run(): Promise { + // Create the mocha test + const mocha = new Mocha({ + ui: 'tdd', + color: true + }); + + const testsRoot = path.resolve(__dirname, '..'); + + return new Promise((c, e) => { + glob('**/**.test.js', { cwd: testsRoot }, (err, files) => { + if (err) { + return e(err); + } + + // Add files to the test suite + files.forEach(f => mocha.addFile(path.resolve(testsRoot, f))); + + try { + // Run the mocha test + mocha.run(failures => { + if (failures > 0) { + e(new Error(`${failures} tests failed.`)); + } else { + c(); + } + }); + } catch (err) { + console.error(err); + e(err); + } + }); + }); +} diff --git a/toolchains/solidity/linter/extension/tsconfig.json b/toolchains/solidity/extension/tsconfig.json similarity index 100% rename from toolchains/solidity/linter/extension/tsconfig.json rename to toolchains/solidity/extension/tsconfig.json diff --git a/toolchains/solidity/linter/extension/vsc-extension-quickstart.md b/toolchains/solidity/extension/vsc-extension-quickstart.md similarity index 100% rename from toolchains/solidity/linter/extension/vsc-extension-quickstart.md rename to toolchains/solidity/extension/vsc-extension-quickstart.md diff --git a/toolchains/solidity/linter/extension/webpack.config.js b/toolchains/solidity/extension/webpack.config.js similarity index 78% rename from toolchains/solidity/linter/extension/webpack.config.js rename to toolchains/solidity/extension/webpack.config.js index 7b84959c..6d1fa198 100644 --- a/toolchains/solidity/linter/extension/webpack.config.js +++ b/toolchains/solidity/extension/webpack.config.js @@ -12,11 +12,14 @@ const extensionConfig = { target: 'node', // VS Code extensions run in a Node.js-context 📖 -> https://webpack.js.org/configuration/node/ mode: 'none', // this leaves the source code as close as possible to the original (when packaging we set this to 'production') - entry: './src/extension.ts', // the entry point of this extension, 📖 -> https://webpack.js.org/configuration/entry-context/ + entry: { + extension: './src/extension.ts', // the entry point of this extension, 📖 -> https://webpack.js.org/configuration/entry-context/ + server: './src/server.ts', + }, output: { // the bundle is stored in the 'dist' folder (check package.json), 📖 -> https://webpack.js.org/configuration/output/ path: path.resolve(__dirname, 'dist'), - filename: 'extension.js', + filename: '[name].js', libraryTarget: 'commonjs2' }, externals: { @@ -39,17 +42,8 @@ const extensionConfig = { ] }, { - // Solidhunter binary - test: /solidhunter/, - use: [ - { - loader: 'file-loader', - options: { - name: '[name]', - outputPath: 'dist' - } - }, - ] + test: /\.wasm$/, + type: "asset/inline", }, ] }, diff --git a/toolchains/solidity/linter/.unstable b/toolchains/solidity/linter/.unstable deleted file mode 100644 index e69de29b..00000000 diff --git a/toolchains/solidity/linter/core/.gitignore b/toolchains/solidity/linter/core/.gitignore deleted file mode 100644 index 9f672f43..00000000 --- a/toolchains/solidity/linter/core/.gitignore +++ /dev/null @@ -1,14 +0,0 @@ -# Jetbrain -.idea/ - -# Generated by Cargo -# will have compiled files and executables -target - -# Remove Cargo.lock from gitignore if creating an executable, leave it for libraries -# More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html - -# These are backup files generated by rustfmt -**/*.rs.bk -.solidhunter.json -!/solidhunter-lib/**/**/.solidhunter.json diff --git a/toolchains/solidity/linter/core/Cargo.toml b/toolchains/solidity/linter/core/Cargo.toml deleted file mode 100644 index 314449b7..00000000 --- a/toolchains/solidity/linter/core/Cargo.toml +++ /dev/null @@ -1,24 +0,0 @@ -[workspace] -members = [ - "solidhunter-lib" -] - -[package] -name = "solidhunter" -version = "0.0.2" -edition = "2021" -authors = ["Astrodevs Labs"] -license = "GPL-3.0-or-later" - -[dependencies] -clap = { version = "4.0.29", features = ["derive"] } -colored = "2" -serde = { version = "1.0.149", features = ["derive"] } -serde_json = "1.0.89" -solidhunter-lib = { path = "./solidhunter-lib" } -anyhow = "1.0" -glob = "0.3.0" -thiserror = "1.0" -lsp-types = "0.94.1" -lsp-server = "0.7.4" -lsp-server-wrapper = { path = "../../../../libs/lsp-server-wrapper" } \ No newline at end of file diff --git a/toolchains/solidity/linter/extension/.gitignore b/toolchains/solidity/linter/extension/.gitignore deleted file mode 100644 index ca4172ac..00000000 --- a/toolchains/solidity/linter/extension/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -dist -node_modules -out -core \ No newline at end of file diff --git a/toolchains/solidity/linter/extension/.vscode/extensions.json b/toolchains/solidity/linter/extension/.vscode/extensions.json deleted file mode 100644 index 57dbdae4..00000000 --- a/toolchains/solidity/linter/extension/.vscode/extensions.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - // See http://go.microsoft.com/fwlink/?LinkId=827846 - // for the documentation about the extensions.json format - "recommendations": ["dbaeumer.vscode-eslint", "amodio.tsl-problem-matcher"] -} diff --git a/toolchains/solidity/linter/extension/.vscode/launch.json b/toolchains/solidity/linter/extension/.vscode/launch.json deleted file mode 100644 index d4df9e96..00000000 --- a/toolchains/solidity/linter/extension/.vscode/launch.json +++ /dev/null @@ -1,35 +0,0 @@ -// A launch configuration that compiles the extension and then opens it inside a new window -// Use IntelliSense to learn about possible attributes. -// Hover to view descriptions of existing attributes. -// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 -{ - "version": "0.2.0", - "configurations": [ - { - "name": "Run Extension", - "type": "extensionHost", - "request": "launch", - "args": [ - "--extensionDevelopmentPath=${workspaceFolder}" - ], - "outFiles": [ - "${workspaceFolder}/dist/**/*.js" - ], - "preLaunchTask": "${defaultBuildTask}" - }, - { - "name": "Extension Tests", - "type": "extensionHost", - "request": "launch", - "args": [ - "--extensionDevelopmentPath=${workspaceFolder}", - "--extensionTestsPath=${workspaceFolder}/out/test/suite/index" - ], - "outFiles": [ - "${workspaceFolder}/out/**/*.js", - "${workspaceFolder}/dist/**/*.js" - ], - "preLaunchTask": "tasks: watch-tests" - } - ] -} diff --git a/toolchains/solidity/linter/extension/.vscode/settings.json b/toolchains/solidity/linter/extension/.vscode/settings.json deleted file mode 100644 index 5c5ac48c..00000000 --- a/toolchains/solidity/linter/extension/.vscode/settings.json +++ /dev/null @@ -1,13 +0,0 @@ -// Place your settings in this file to overwrite default and user settings. -{ - "files.exclude": { - "out": false, // set this to true to hide the "out" folder with the compiled JS files - "dist": false // set this to true to hide the "dist" folder with the compiled JS files - }, - "search.exclude": { - "out": true, // set this to false to include "out" folder in search results - "dist": true // set this to false to include "dist" folder in search results - }, - // Turn off tsc task auto detection since we have the necessary tasks as npm scripts - "typescript.tsc.autoDetect": "off" -} \ No newline at end of file diff --git a/toolchains/solidity/linter/extension/.vscode/tasks.json b/toolchains/solidity/linter/extension/.vscode/tasks.json deleted file mode 100644 index c2ab68ae..00000000 --- a/toolchains/solidity/linter/extension/.vscode/tasks.json +++ /dev/null @@ -1,40 +0,0 @@ -// See https://go.microsoft.com/fwlink/?LinkId=733558 -// for the documentation about the tasks.json format -{ - "version": "2.0.0", - "tasks": [ - { - "type": "npm", - "script": "watch", - "problemMatcher": "$ts-webpack-watch", - "isBackground": true, - "presentation": { - "reveal": "never", - "group": "watchers" - }, - "group": { - "kind": "build", - "isDefault": true - } - }, - { - "type": "npm", - "script": "watch-tests", - "problemMatcher": "$tsc-watch", - "isBackground": true, - "presentation": { - "reveal": "never", - "group": "watchers" - }, - "group": "build" - }, - { - "label": "tasks: watch-tests", - "dependsOn": [ - "npm: watch", - "npm: watch-tests" - ], - "problemMatcher": [] - } - ] -} diff --git a/toolchains/solidity/linter/extension/LICENSE.md b/toolchains/solidity/linter/extension/LICENSE.md deleted file mode 100644 index 5dc6b429..00000000 --- a/toolchains/solidity/linter/extension/LICENSE.md +++ /dev/null @@ -1,675 +0,0 @@ - - GNU GENERAL PUBLIC LICENSE - Version 3, 29 June 2007 - - Copyright (C) 2007 Free Software Foundation, Inc. - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The GNU General Public License is a free, copyleft license for -software and other kinds of works. - - The licenses for most software and other practical works are designed -to take away your freedom to share and change the works. By contrast, -the GNU General Public License is intended to guarantee your freedom to -share and change all versions of a program--to make sure it remains free -software for all its users. We, the Free Software Foundation, use the -GNU General Public License for most of our software; it applies also to -any other work released this way by its authors. You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -them if you wish), that you receive source code or can get it if you -want it, that you can change the software or use pieces of it in new -free programs, and that you know you can do these things. - - To protect your rights, we need to prevent others from denying you -these rights or asking you to surrender the rights. Therefore, you have -certain responsibilities if you distribute copies of the software, or if -you modify it: responsibilities to respect the freedom of others. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must pass on to the recipients the same -freedoms that you received. You must make sure that they, too, receive -or can get the source code. And you must show them these terms so they -know their rights. - - Developers that use the GNU GPL protect your rights with two steps: -(1) assert copyright on the software, and (2) offer you this License -giving you legal permission to copy, distribute and/or modify it. - - For the developers' and authors' protection, the GPL clearly explains -that there is no warranty for this free software. For both users' and -authors' sake, the GPL requires that modified versions be marked as -changed, so that their problems will not be attributed erroneously to -authors of previous versions. - - Some devices are designed to deny users access to install or run -modified versions of the software inside them, although the manufacturer -can do so. This is fundamentally incompatible with the aim of -protecting users' freedom to change the software. The systematic -pattern of such abuse occurs in the area of products for individuals to -use, which is precisely where it is most unacceptable. Therefore, we -have designed this version of the GPL to prohibit the practice for those -products. If such problems arise substantially in other domains, we -stand ready to extend this provision to those domains in future versions -of the GPL, as needed to protect the freedom of users. - - Finally, every program is threatened constantly by software patents. -States should not allow patents to restrict development and use of -software on general-purpose computers, but in those that do, we wish to -avoid the special danger that patents applied to a free program could -make it effectively proprietary. To prevent this, the GPL assures that -patents cannot be used to render the program non-free. - - The precise terms and conditions for copying, distribution and -modification follow. - - TERMS AND CONDITIONS - - 0. Definitions. - - "This License" refers to version 3 of the GNU General Public License. - - "Copyright" also means copyright-like laws that apply to other kinds of -works, such as semiconductor masks. - - "The Program" refers to any copyrightable work licensed under this -License. Each licensee is addressed as "you". "Licensees" and -"recipients" may be individuals or organizations. - - To "modify" a work means to copy from or adapt all or part of the work -in a fashion requiring copyright permission, other than the making of an -exact copy. The resulting work is called a "modified version" of the -earlier work or a work "based on" the earlier work. - - A "covered work" means either the unmodified Program or a work based -on the Program. - - To "propagate" a work means to do anything with it that, without -permission, would make you directly or secondarily liable for -infringement under applicable copyright law, except executing it on a -computer or modifying a private copy. Propagation includes copying, -distribution (with or without modification), making available to the -public, and in some countries other activities as well. - - To "convey" a work means any kind of propagation that enables other -parties to make or receive copies. Mere interaction with a user through -a computer network, with no transfer of a copy, is not conveying. - - An interactive user interface displays "Appropriate Legal Notices" -to the extent that it includes a convenient and prominently visible -feature that (1) displays an appropriate copyright notice, and (2) -tells the user that there is no warranty for the work (except to the -extent that warranties are provided), that licensees may convey the -work under this License, and how to view a copy of this License. If -the interface presents a list of user commands or options, such as a -menu, a prominent item in the list meets this criterion. - - 1. Source Code. - - The "source code" for a work means the preferred form of the work -for making modifications to it. "Object code" means any non-source -form of a work. - - A "Standard Interface" means an interface that either is an official -standard defined by a recognized standards body, or, in the case of -interfaces specified for a particular programming language, one that -is widely used among developers working in that language. - - The "System Libraries" of an executable work include anything, other -than the work as a whole, that (a) is included in the normal form of -packaging a Major Component, but which is not part of that Major -Component, and (b) serves only to enable use of the work with that -Major Component, or to implement a Standard Interface for which an -implementation is available to the public in source code form. A -"Major Component", in this context, means a major essential component -(kernel, window system, and so on) of the specific operating system -(if any) on which the executable work runs, or a compiler used to -produce the work, or an object code interpreter used to run it. - - The "Corresponding Source" for a work in object code form means all -the source code needed to generate, install, and (for an executable -work) run the object code and to modify the work, including scripts to -control those activities. However, it does not include the work's -System Libraries, or general-purpose tools or generally available free -programs which are used unmodified in performing those activities but -which are not part of the work. For example, Corresponding Source -includes interface definition files associated with source files for -the work, and the source code for shared libraries and dynamically -linked subprograms that the work is specifically designed to require, -such as by intimate data communication or control flow between those -subprograms and other parts of the work. - - The Corresponding Source need not include anything that users -can regenerate automatically from other parts of the Corresponding -Source. - - The Corresponding Source for a work in source code form is that -same work. - - 2. Basic Permissions. - - All rights granted under this License are granted for the term of -copyright on the Program, and are irrevocable provided the stated -conditions are met. This License explicitly affirms your unlimited -permission to run the unmodified Program. The output from running a -covered work is covered by this License only if the output, given its -content, constitutes a covered work. This License acknowledges your -rights of fair use or other equivalent, as provided by copyright law. - - You may make, run and propagate covered works that you do not -convey, without conditions so long as your license otherwise remains -in force. You may convey covered works to others for the sole purpose -of having them make modifications exclusively for you, or provide you -with facilities for running those works, provided that you comply with -the terms of this License in conveying all material for which you do -not control copyright. Those thus making or running the covered works -for you must do so exclusively on your behalf, under your direction -and control, on terms that prohibit them from making any copies of -your copyrighted material outside their relationship with you. - - Conveying under any other circumstances is permitted solely under -the conditions stated below. Sublicensing is not allowed; section 10 -makes it unnecessary. - - 3. Protecting Users' Legal Rights From Anti-Circumvention Law. - - No covered work shall be deemed part of an effective technological -measure under any applicable law fulfilling obligations under article -11 of the WIPO copyright treaty adopted on 20 December 1996, or -similar laws prohibiting or restricting circumvention of such -measures. - - When you convey a covered work, you waive any legal power to forbid -circumvention of technological measures to the extent such circumvention -is effected by exercising rights under this License with respect to -the covered work, and you disclaim any intention to limit operation or -modification of the work as a means of enforcing, against the work's -users, your or third parties' legal rights to forbid circumvention of -technological measures. - - 4. Conveying Verbatim Copies. - - You may convey verbatim copies of the Program's source code as you -receive it, in any medium, provided that you conspicuously and -appropriately publish on each copy an appropriate copyright notice; -keep intact all notices stating that this License and any -non-permissive terms added in accord with section 7 apply to the code; -keep intact all notices of the absence of any warranty; and give all -recipients a copy of this License along with the Program. - - You may charge any price or no price for each copy that you convey, -and you may offer support or warranty protection for a fee. - - 5. Conveying Modified Source Versions. - - You may convey a work based on the Program, or the modifications to -produce it from the Program, in the form of source code under the -terms of section 4, provided that you also meet all of these conditions: - - a) The work must carry prominent notices stating that you modified - it, and giving a relevant date. - - b) The work must carry prominent notices stating that it is - released under this License and any conditions added under section - 7. This requirement modifies the requirement in section 4 to - "keep intact all notices". - - c) You must license the entire work, as a whole, under this - License to anyone who comes into possession of a copy. This - License will therefore apply, along with any applicable section 7 - additional terms, to the whole of the work, and all its parts, - regardless of how they are packaged. This License gives no - permission to license the work in any other way, but it does not - invalidate such permission if you have separately received it. - - d) If the work has interactive user interfaces, each must display - Appropriate Legal Notices; however, if the Program has interactive - interfaces that do not display Appropriate Legal Notices, your - work need not make them do so. - - A compilation of a covered work with other separate and independent -works, which are not by their nature extensions of the covered work, -and which are not combined with it such as to form a larger program, -in or on a volume of a storage or distribution medium, is called an -"aggregate" if the compilation and its resulting copyright are not -used to limit the access or legal rights of the compilation's users -beyond what the individual works permit. Inclusion of a covered work -in an aggregate does not cause this License to apply to the other -parts of the aggregate. - - 6. Conveying Non-Source Forms. - - You may convey a covered work in object code form under the terms -of sections 4 and 5, provided that you also convey the -machine-readable Corresponding Source under the terms of this License, -in one of these ways: - - a) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by the - Corresponding Source fixed on a durable physical medium - customarily used for software interchange. - - b) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by a - written offer, valid for at least three years and valid for as - long as you offer spare parts or customer support for that product - model, to give anyone who possesses the object code either (1) a - copy of the Corresponding Source for all the software in the - product that is covered by this License, on a durable physical - medium customarily used for software interchange, for a price no - more than your reasonable cost of physically performing this - conveying of source, or (2) access to copy the - Corresponding Source from a network server at no charge. - - c) Convey individual copies of the object code with a copy of the - written offer to provide the Corresponding Source. This - alternative is allowed only occasionally and noncommercially, and - only if you received the object code with such an offer, in accord - with subsection 6b. - - d) Convey the object code by offering access from a designated - place (gratis or for a charge), and offer equivalent access to the - Corresponding Source in the same way through the same place at no - further charge. You need not require recipients to copy the - Corresponding Source along with the object code. If the place to - copy the object code is a network server, the Corresponding Source - may be on a different server (operated by you or a third party) - that supports equivalent copying facilities, provided you maintain - clear directions next to the object code saying where to find the - Corresponding Source. Regardless of what server hosts the - Corresponding Source, you remain obligated to ensure that it is - available for as long as needed to satisfy these requirements. - - e) Convey the object code using peer-to-peer transmission, provided - you inform other peers where the object code and Corresponding - Source of the work are being offered to the general public at no - charge under subsection 6d. - - A separable portion of the object code, whose source code is excluded -from the Corresponding Source as a System Library, need not be -included in conveying the object code work. - - A "User Product" is either (1) a "consumer product", which means any -tangible personal property which is normally used for personal, family, -or household purposes, or (2) anything designed or sold for incorporation -into a dwelling. In determining whether a product is a consumer product, -doubtful cases shall be resolved in favor of coverage. For a particular -product received by a particular user, "normally used" refers to a -typical or common use of that class of product, regardless of the status -of the particular user or of the way in which the particular user -actually uses, or expects or is expected to use, the product. A product -is a consumer product regardless of whether the product has substantial -commercial, industrial or non-consumer uses, unless such uses represent -the only significant mode of use of the product. - - "Installation Information" for a User Product means any methods, -procedures, authorization keys, or other information required to install -and execute modified versions of a covered work in that User Product from -a modified version of its Corresponding Source. The information must -suffice to ensure that the continued functioning of the modified object -code is in no case prevented or interfered with solely because -modification has been made. - - If you convey an object code work under this section in, or with, or -specifically for use in, a User Product, and the conveying occurs as -part of a transaction in which the right of possession and use of the -User Product is transferred to the recipient in perpetuity or for a -fixed term (regardless of how the transaction is characterized), the -Corresponding Source conveyed under this section must be accompanied -by the Installation Information. But this requirement does not apply -if neither you nor any third party retains the ability to install -modified object code on the User Product (for example, the work has -been installed in ROM). - - The requirement to provide Installation Information does not include a -requirement to continue to provide support service, warranty, or updates -for a work that has been modified or installed by the recipient, or for -the User Product in which it has been modified or installed. Access to a -network may be denied when the modification itself materially and -adversely affects the operation of the network or violates the rules and -protocols for communication across the network. - - Corresponding Source conveyed, and Installation Information provided, -in accord with this section must be in a format that is publicly -documented (and with an implementation available to the public in -source code form), and must require no special password or key for -unpacking, reading or copying. - - 7. Additional Terms. - - "Additional permissions" are terms that supplement the terms of this -License by making exceptions from one or more of its conditions. -Additional permissions that are applicable to the entire Program shall -be treated as though they were included in this License, to the extent -that they are valid under applicable law. If additional permissions -apply only to part of the Program, that part may be used separately -under those permissions, but the entire Program remains governed by -this License without regard to the additional permissions. - - When you convey a copy of a covered work, you may at your option -remove any additional permissions from that copy, or from any part of -it. (Additional permissions may be written to require their own -removal in certain cases when you modify the work.) You may place -additional permissions on material, added by you to a covered work, -for which you have or can give appropriate copyright permission. - - Notwithstanding any other provision of this License, for material you -add to a covered work, you may (if authorized by the copyright holders of -that material) supplement the terms of this License with terms: - - a) Disclaiming warranty or limiting liability differently from the - terms of sections 15 and 16 of this License; or - - b) Requiring preservation of specified reasonable legal notices or - author attributions in that material or in the Appropriate Legal - Notices displayed by works containing it; or - - c) Prohibiting misrepresentation of the origin of that material, or - requiring that modified versions of such material be marked in - reasonable ways as different from the original version; or - - d) Limiting the use for publicity purposes of names of licensors or - authors of the material; or - - e) Declining to grant rights under trademark law for use of some - trade names, trademarks, or service marks; or - - f) Requiring indemnification of licensors and authors of that - material by anyone who conveys the material (or modified versions of - it) with contractual assumptions of liability to the recipient, for - any liability that these contractual assumptions directly impose on - those licensors and authors. - - All other non-permissive additional terms are considered "further -restrictions" within the meaning of section 10. If the Program as you -received it, or any part of it, contains a notice stating that it is -governed by this License along with a term that is a further -restriction, you may remove that term. If a license document contains -a further restriction but permits relicensing or conveying under this -License, you may add to a covered work material governed by the terms -of that license document, provided that the further restriction does -not survive such relicensing or conveying. - - If you add terms to a covered work in accord with this section, you -must place, in the relevant source files, a statement of the -additional terms that apply to those files, or a notice indicating -where to find the applicable terms. - - Additional terms, permissive or non-permissive, may be stated in the -form of a separately written license, or stated as exceptions; -the above requirements apply either way. - - 8. Termination. - - You may not propagate or modify a covered work except as expressly -provided under this License. Any attempt otherwise to propagate or -modify it is void, and will automatically terminate your rights under -this License (including any patent licenses granted under the third -paragraph of section 11). - - However, if you cease all violation of this License, then your -license from a particular copyright holder is reinstated (a) -provisionally, unless and until the copyright holder explicitly and -finally terminates your license, and (b) permanently, if the copyright -holder fails to notify you of the violation by some reasonable means -prior to 60 days after the cessation. - - Moreover, your license from a particular copyright holder is -reinstated permanently if the copyright holder notifies you of the -violation by some reasonable means, this is the first time you have -received notice of violation of this License (for any work) from that -copyright holder, and you cure the violation prior to 30 days after -your receipt of the notice. - - Termination of your rights under this section does not terminate the -licenses of parties who have received copies or rights from you under -this License. If your rights have been terminated and not permanently -reinstated, you do not qualify to receive new licenses for the same -material under section 10. - - 9. Acceptance Not Required for Having Copies. - - You are not required to accept this License in order to receive or -run a copy of the Program. Ancillary propagation of a covered work -occurring solely as a consequence of using peer-to-peer transmission -to receive a copy likewise does not require acceptance. However, -nothing other than this License grants you permission to propagate or -modify any covered work. These actions infringe copyright if you do -not accept this License. Therefore, by modifying or propagating a -covered work, you indicate your acceptance of this License to do so. - - 10. Automatic Licensing of Downstream Recipients. - - Each time you convey a covered work, the recipient automatically -receives a license from the original licensors, to run, modify and -propagate that work, subject to this License. You are not responsible -for enforcing compliance by third parties with this License. - - An "entity transaction" is a transaction transferring control of an -organization, or substantially all assets of one, or subdividing an -organization, or merging organizations. If propagation of a covered -work results from an entity transaction, each party to that -transaction who receives a copy of the work also receives whatever -licenses to the work the party's predecessor in interest had or could -give under the previous paragraph, plus a right to possession of the -Corresponding Source of the work from the predecessor in interest, if -the predecessor has it or can get it with reasonable efforts. - - You may not impose any further restrictions on the exercise of the -rights granted or affirmed under this License. For example, you may -not impose a license fee, royalty, or other charge for exercise of -rights granted under this License, and you may not initiate litigation -(including a cross-claim or counterclaim in a lawsuit) alleging that -any patent claim is infringed by making, using, selling, offering for -sale, or importing the Program or any portion of it. - - 11. Patents. - - A "contributor" is a copyright holder who authorizes use under this -License of the Program or a work on which the Program is based. The -work thus licensed is called the contributor's "contributor version". - - A contributor's "essential patent claims" are all patent claims -owned or controlled by the contributor, whether already acquired or -hereafter acquired, that would be infringed by some manner, permitted -by this License, of making, using, or selling its contributor version, -but do not include claims that would be infringed only as a -consequence of further modification of the contributor version. For -purposes of this definition, "control" includes the right to grant -patent sublicenses in a manner consistent with the requirements of -this License. - - Each contributor grants you a non-exclusive, worldwide, royalty-free -patent license under the contributor's essential patent claims, to -make, use, sell, offer for sale, import and otherwise run, modify and -propagate the contents of its contributor version. - - In the following three paragraphs, a "patent license" is any express -agreement or commitment, however denominated, not to enforce a patent -(such as an express permission to practice a patent or covenant not to -sue for patent infringement). To "grant" such a patent license to a -party means to make such an agreement or commitment not to enforce a -patent against the party. - - If you convey a covered work, knowingly relying on a patent license, -and the Corresponding Source of the work is not available for anyone -to copy, free of charge and under the terms of this License, through a -publicly available network server or other readily accessible means, -then you must either (1) cause the Corresponding Source to be so -available, or (2) arrange to deprive yourself of the benefit of the -patent license for this particular work, or (3) arrange, in a manner -consistent with the requirements of this License, to extend the patent -license to downstream recipients. "Knowingly relying" means you have -actual knowledge that, but for the patent license, your conveying the -covered work in a country, or your recipient's use of the covered work -in a country, would infringe one or more identifiable patents in that -country that you have reason to believe are valid. - - If, pursuant to or in connection with a single transaction or -arrangement, you convey, or propagate by procuring conveyance of, a -covered work, and grant a patent license to some of the parties -receiving the covered work authorizing them to use, propagate, modify -or convey a specific copy of the covered work, then the patent license -you grant is automatically extended to all recipients of the covered -work and works based on it. - - A patent license is "discriminatory" if it does not include within -the scope of its coverage, prohibits the exercise of, or is -conditioned on the non-exercise of one or more of the rights that are -specifically granted under this License. You may not convey a covered -work if you are a party to an arrangement with a third party that is -in the business of distributing software, under which you make payment -to the third party based on the extent of your activity of conveying -the work, and under which the third party grants, to any of the -parties who would receive the covered work from you, a discriminatory -patent license (a) in connection with copies of the covered work -conveyed by you (or copies made from those copies), or (b) primarily -for and in connection with specific products or compilations that -contain the covered work, unless you entered into that arrangement, -or that patent license was granted, prior to 28 March 2007. - - Nothing in this License shall be construed as excluding or limiting -any implied license or other defenses to infringement that may -otherwise be available to you under applicable patent law. - - 12. No Surrender of Others' Freedom. - - If conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot convey a -covered work so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you may -not convey it at all. For example, if you agree to terms that obligate you -to collect a royalty for further conveying from those to whom you convey -the Program, the only way you could satisfy both those terms and this -License would be to refrain entirely from conveying the Program. - - 13. Use with the GNU Affero General Public License. - - Notwithstanding any other provision of this License, you have -permission to link or combine any covered work with a work licensed -under version 3 of the GNU Affero General Public License into a single -combined work, and to convey the resulting work. The terms of this -License will continue to apply to the part which is the covered work, -but the special requirements of the GNU Affero General Public License, -section 13, concerning interaction through a network will apply to the -combination as such. - - 14. Revised Versions of this License. - - The Free Software Foundation may publish revised and/or new versions of -the GNU General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - - Each version is given a distinguishing version number. If the -Program specifies that a certain numbered version of the GNU General -Public License "or any later version" applies to it, you have the -option of following the terms and conditions either of that numbered -version or of any later version published by the Free Software -Foundation. If the Program does not specify a version number of the -GNU General Public License, you may choose any version ever published -by the Free Software Foundation. - - If the Program specifies that a proxy can decide which future -versions of the GNU General Public License can be used, that proxy's -public statement of acceptance of a version permanently authorizes you -to choose that version for the Program. - - Later license versions may give you additional or different -permissions. However, no additional obligations are imposed on any -author or copyright holder as a result of your choosing to follow a -later version. - - 15. Disclaimer of Warranty. - - THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY -APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT -HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY -OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM -IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF -ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - - 16. Limitation of Liability. - - IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS -THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY -GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE -USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF -DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD -PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), -EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF -SUCH DAMAGES. - - 17. Interpretation of Sections 15 and 16. - - If the disclaimer of warranty and limitation of liability provided -above cannot be given local legal effect according to their terms, -reviewing courts shall apply local law that most closely approximates -an absolute waiver of all civil liability in connection with the -Program, unless a warranty or assumption of liability accompanies a -copy of the Program in return for a fee. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -state the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . - -Also add information on how to contact you by electronic and paper mail. - - If the program does terminal interaction, make it output a short -notice like this when it starts in an interactive mode: - - {project} Copyright (C) {year} {fullname} - This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, your program's commands -might be different; for a GUI interface, you would use an "about box". - - You should also get your employer (if you work as a programmer) or school, -if any, to sign a "copyright disclaimer" for the program, if necessary. -For more information on this, and how to apply and follow the GNU GPL, see -. - - The GNU General Public License does not permit incorporating your program -into proprietary programs. If your program is a subroutine library, you -may consider it more useful to permit linking proprietary applications with -the library. If this is what you want to do, use the GNU Lesser General -Public License instead of this License. But first, please read -. diff --git a/toolchains/solidity/linter/extension/README.md b/toolchains/solidity/linter/extension/README.md deleted file mode 100644 index cbf2fdf7..00000000 --- a/toolchains/solidity/linter/extension/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# Osmium solidity linter README - -Solidhunter is a linter for the smart-contract language solidity. It allows the developpers to enforce coding standards accross projects diff --git a/toolchains/solidity/linter/extension/package.json b/toolchains/solidity/linter/extension/package.json deleted file mode 100644 index 68a536ec..00000000 --- a/toolchains/solidity/linter/extension/package.json +++ /dev/null @@ -1,94 +0,0 @@ -{ - "name": "osmium-solidity-linter-extension", - "displayName": "solidhunter", - "description": "", - "publisher": "OsmiumToolchains", - "repository": "https://github.com/astrodevs-labs/osmium/toolchains/solidity", - "version": "0.0.1", - "engines": { - "vscode": "^1.82.0" - }, - "categories": [ - "Other" - ], - "activationEvents": [ - "onLanguage:sol", - "onLanguage:solidity", - "workspaceContains:**/.solidhunter.json", - "workspaceContains:**/*.sol" - ], - "main": "./dist/extension.js", - "contributes": { - "commands": [ - { - "command": "solidhunter.helloWorld", - "title": "Hello World" - } - ], - "languages": [ - { - "id": "sol", - "aliases": [ - "Solidity" - ], - "extensions": [ - ".sol" - ] - } - ] - }, - "configuration": { - "type": "object", - "title": "solidity-language-server", - "properties": { - "solidhunter.trace.server": { - "type": "string", - "scope": "window", - "enum": [ - "off", - "messages", - "verbose" - ], - "enumDescriptions": [ - "No traces", - "Error only", - "Full log" - ], - "default": "verbose", - "description": "Traces the communication between VS Code and the language server." - } - } - }, - "scripts": { - "vscode:prepublish": "yarn run package", - "compile": "webpack", - "watch": "webpack --watch", - "package": "webpack --mode production --devtool hidden-source-map", - "compile-tests": "tsc -p . --outDir out", - "watch-tests": "tsc -p . -w --outDir out", - "pretest": "yarn run compile-tests && yarn run compile && yarn run lint", - "lint": "yarn install && eslint src --ext ts", - "test": "echo \"no tests\"", - "publish": "yarn run package && vsce publish --no-dependencies" - }, - "devDependencies": { - "@types/glob": "^8.1.0", - "@types/mocha": "^10.0.1", - "@types/node": "20.2.5", - "@types/vscode": "^1.82.0", - "@typescript-eslint/eslint-plugin": "^5.59.8", - "@typescript-eslint/parser": "^5.59.8", - "@vscode/test-electron": "^2.3.2", - "@vscode/vsce": "^2.21.1", - "eslint": "^8.41.0", - "glob": "^8.1.0", - "mocha": "^10.2.0", - "ts-loader": "^9.4.3", - "typescript": "^5.1.3", - "webpack": "^5.85.0", - "webpack-cli": "^5.1.1" - }, - "dependencies": { - "vscode-languageclient": "^8.1.0" - } -} diff --git a/toolchains/solidity/linter/extension/src/extension.ts b/toolchains/solidity/linter/extension/src/extension.ts deleted file mode 100644 index 16b53d90..00000000 --- a/toolchains/solidity/linter/extension/src/extension.ts +++ /dev/null @@ -1,59 +0,0 @@ -// The module 'vscode' contains the VS Code extensibility API -// Import the module and reference it with the alias vscode in your code below -import { workspace, ExtensionContext, window, commands } from 'vscode'; -import { LanguageClient, LanguageClientOptions, ServerOptions, TransportKind } from 'vscode-languageclient/node'; -import * as path from 'path'; - -let client: LanguageClient; - -// This method is called when your extension is activated -// Your extension is activated the very first time the command is executed -export async function activate(context: ExtensionContext) { - const binaryPath = path.join(context.extensionPath, 'core'); - console.log(binaryPath); - - const workspacePath = workspace.workspaceFolders?.[0].uri.fsPath!; - const configPath = path.join(workspacePath, '.solidhunter.json'); - - if (!workspacePath) { - return; - } - - const serverOptions: ServerOptions = { - run: { command: binaryPath, args: ['-p', workspacePath, '-r', configPath], transport: TransportKind.stdio }, - debug: { command: binaryPath, args: ['-p', workspacePath, '-r', configPath], transport: TransportKind.stdio } - }; - - const traceOutputChannel = window.createOutputChannel("Osmium Solidity Linter Trace"); - // Options to control the language client - const clientOptions: LanguageClientOptions = { - // Register the server for plain text documents - documentSelector: [ - {scheme: "file", language:'sol'} - ], - synchronize: { - // Notify the server about file changes to '.clientrc files contained in the workspace - fileEvents: workspace.createFileSystemWatcher('**/.clientrc') - }, - traceOutputChannel - }; - - // Create the language client and start the client. - client = new LanguageClient( - 'osmium-solidity-linter', - 'Osmium Solidity Linter', - serverOptions, - clientOptions - ); - - // Start the client. This will also launch the server - await client.start(); -} - -// This method is called when your extension is deactivated -export function deactivate() { - if (!client) { - return undefined; - } - return client.stop(); -} \ No newline at end of file diff --git a/toolchains/solidity/linter/package.json b/toolchains/solidity/linter/package.json deleted file mode 100644 index 314777e2..00000000 --- a/toolchains/solidity/linter/package.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "name": "osmium-solidity-linter", - "version": "0.0.1", - "license": "MIT", - "private": true, - "workspaces": [ - "core", - "extension" - ], - "scripts": { - "build": "yarn workspaces foreach run build", - "lint": "yarn workspaces foreach run lint", - "format": "yarn workspaces foreach run format", - "test": "yarn workspaces foreach run test", - "publish": "yarn workspace osmium-solidity-linter-core run publish && yarn workspace osmium-solidity-linter-extension run publish" - } -} diff --git a/toolchains/solidity/lsp/.unstable b/toolchains/solidity/lsp/.unstable deleted file mode 100644 index e69de29b..00000000 diff --git a/toolchains/solidity/lsp/package.json b/toolchains/solidity/lsp/package.json deleted file mode 100644 index 016ed563..00000000 --- a/toolchains/solidity/lsp/package.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "name": "osmium-solidity-lsp", - "version": "0.0.1", - "license": "MIT", - "workspaces": [ - "*" - ], - "scripts": { - "build": "echo 'building solidity lsp...'", - "lint": "echo 'linting solidity lsp...'", - "format": "echo 'formatting solidity lsp...'", - "test": "echo 'testing solidity lsp...'", - "publish": "echo 'publishing solidity lsp...'" - } -} diff --git a/toolchains/solidity/package.json b/toolchains/solidity/package.json index 48297a97..9de4cac1 100644 --- a/toolchains/solidity/package.json +++ b/toolchains/solidity/package.json @@ -2,7 +2,8 @@ "name": "osmium-solidity", "version": "0.0.1", "workspaces": [ - "*" + "core", + "extension" ], "license": "MIT", "scripts": { diff --git a/yarn.lock b/yarn.lock index 3b0e5ebe..ea514665 100644 --- a/yarn.lock +++ b/yarn.lock @@ -31,9 +31,9 @@ __metadata: linkType: hard "@eslint-community/regexpp@npm:^4.4.0": - version: 4.8.0 - resolution: "@eslint-community/regexpp@npm:4.8.0" - checksum: 601e6d033d556e98e8c929905bef335f20d7389762812df4d0f709d9b4d2631610dda975fb272e23b5b68e24a163b3851b114c8080a0a19fb4c141a1eff6305b + version: 4.9.1 + resolution: "@eslint-community/regexpp@npm:4.9.1" + checksum: 06fb839e9c756f6375cc545c2f2e05a0a64576bd6370e8e3c07983fd29a3d6e164ef4aa48a361f7d27e6713ab79c83053ff6a2ccb78748bc955e344279c4a3b6 languageName: node linkType: hard @@ -78,10 +78,10 @@ __metadata: languageName: node linkType: hard -"@eslint/js@npm:8.49.0": - version: 8.49.0 - resolution: "@eslint/js@npm:8.49.0" - checksum: a6601807c8aeeefe866926ad92ed98007c034a735af20ff709009e39ad1337474243d47908500a3bde04e37bfba16bcf1d3452417f962e1345bc8756edd6b830 +"@eslint/js@npm:8.51.0": + version: 8.51.0 + resolution: "@eslint/js@npm:8.51.0" + checksum: 0228bf1e1e0414843e56d9ff362a2a72d579c078f93174666f29315690e9e30a8633ad72c923297f7fd7182381b5a476805ff04dac8debe638953eb1ded3ac73 languageName: node linkType: hard @@ -185,12 +185,12 @@ __metadata: linkType: hard "@jridgewell/trace-mapping@npm:^0.3.17, @jridgewell/trace-mapping@npm:^0.3.9": - version: 0.3.19 - resolution: "@jridgewell/trace-mapping@npm:0.3.19" + version: 0.3.20 + resolution: "@jridgewell/trace-mapping@npm:0.3.20" dependencies: "@jridgewell/resolve-uri": ^3.1.0 "@jridgewell/sourcemap-codec": ^1.4.14 - checksum: 956a6f0f6fec060fb48c6bf1f5ec2064e13cd38c8be3873877d4b92b4a27ba58289a34071752671262a3e3c202abcc3fa2aac64d8447b4b0fa1ba3c9047f1c20 + checksum: cd1a7353135f385909468ff0cf20bdd37e59f2ee49a13a966dedf921943e222082c583ade2b579ff6cd0d8faafcb5461f253e1bf2a9f48fec439211fdbe788f5 languageName: node linkType: hard @@ -236,6 +236,12 @@ __metadata: languageName: unknown linkType: soft +"@osmium-libs/lsp-handler@workspace:libs/lsp-handler": + version: 0.0.0-use.local + resolution: "@osmium-libs/lsp-handler@workspace:libs/lsp-handler" + languageName: unknown + linkType: soft + "@osmium-libs/lsp-launcher@workspace:libs/lsp-launcher": version: 0.0.0-use.local resolution: "@osmium-libs/lsp-launcher@workspace:libs/lsp-launcher" @@ -286,29 +292,29 @@ __metadata: linkType: hard "@types/eslint-scope@npm:^3.7.3": - version: 3.7.4 - resolution: "@types/eslint-scope@npm:3.7.4" + version: 3.7.6 + resolution: "@types/eslint-scope@npm:3.7.6" dependencies: "@types/eslint": "*" "@types/estree": "*" - checksum: ea6a9363e92f301cd3888194469f9ec9d0021fe0a397a97a6dd689e7545c75de0bd2153dfb13d3ab532853a278b6572c6f678ce846980669e41029d205653460 + checksum: a2339e312949ae7f96bca52cde89a3d2218d4505746a78a0ba1aa56573e43b3d52ce9662b86ab785663a62fa8f2bd2fb61b990398785b40f2efc91be3fd246f8 languageName: node linkType: hard "@types/eslint@npm:*": - version: 8.44.2 - resolution: "@types/eslint@npm:8.44.2" + version: 8.44.6 + resolution: "@types/eslint@npm:8.44.6" dependencies: "@types/estree": "*" "@types/json-schema": "*" - checksum: 25b3ef61bae96350026593c9914c8a61ee02fde48ab8d568a73ee45032f13c0028c62e47a5ff78715af488dfe8e8bba913f7d30f859f60c7f9e639d328e80482 + checksum: ed8de582ab3dbd7ec0bf97d41f4f3de28dd8a37fc48bc423e1c406bbb70d1fd8c4175ba17ad6495ef9ef99a43df71421277b7a2a0355097489c4c4cf6bb266ff languageName: node linkType: hard "@types/estree@npm:*, @types/estree@npm:^1.0.0": - version: 1.0.1 - resolution: "@types/estree@npm:1.0.1" - checksum: e9aa175eacb797216fafce4d41e8202c7a75555bc55232dee0f9903d7171f8f19f0ae7d5191bb1a88cb90e65468be508c0df850a9fb81b4433b293a5a749899d + version: 1.0.3 + resolution: "@types/estree@npm:1.0.3" + checksum: f21a5448995f8aa61ab2248d10590d275666b11d26c27fe75b3c23420b07b469d5ce820deefcf7399671faa09d56eb7ce012322948e484d94686fda154be5221 languageName: node linkType: hard @@ -323,9 +329,9 @@ __metadata: linkType: hard "@types/json-schema@npm:*, @types/json-schema@npm:^7.0.8, @types/json-schema@npm:^7.0.9": - version: 7.0.12 - resolution: "@types/json-schema@npm:7.0.12" - checksum: 00239e97234eeb5ceefb0c1875d98ade6e922bfec39dd365ec6bd360b5c2f825e612ac4f6e5f1d13601b8b30f378f15e6faa805a3a732f4a1bbe61915163d293 + version: 7.0.14 + resolution: "@types/json-schema@npm:7.0.14" + checksum: 4b3dd99616c7c808201c56f6c7f6552eb67b5c0c753ab3fa03a6cb549aae950da537e9558e53fa65fba23d1be624a1e4e8d20c15027efbe41e03ca56f2b04fb0 languageName: node linkType: hard @@ -337,16 +343,18 @@ __metadata: linkType: hard "@types/mocha@npm:^10.0.1": - version: 10.0.1 - resolution: "@types/mocha@npm:10.0.1" - checksum: 224ea9fce7b1734ccdb9aa99a622d902a538ce1847bca7fd22c5fb38adcf3ed536f50f48f587085db988a4bb3c2eb68f4b98e1cd6a38bc5547bd3bbbedc54495 + version: 10.0.3 + resolution: "@types/mocha@npm:10.0.3" + checksum: 52481d72c0f2eb6afcf9a43f851f81d78211880f765b5922a1aa322ed6d557bddc60786a3ae7b6c5e388e2f0cddc09d9ead3c9b80e66102eb41b58acae1e4894 languageName: node linkType: hard "@types/node@npm:*": - version: 20.6.0 - resolution: "@types/node@npm:20.6.0" - checksum: 52611801af5cf151c6fac1963aa4a8a8ca2e388a9e9ed82b01b70bca762088ded5b32cc789c5564220d5d7dccba2b8dd34446a3d4fc74736805e1f2cf262e29d + version: 20.8.7 + resolution: "@types/node@npm:20.8.7" + dependencies: + undici-types: ~5.25.1 + checksum: 2173c0c03daefcb60c03a61b1371b28c8fe412e7a40dc6646458b809d14a85fbc7aeb369d957d57f0aaaafd99964e77436f29b3b579232d8f2b20c58abbd1d25 languageName: node linkType: hard @@ -358,16 +366,16 @@ __metadata: linkType: hard "@types/semver@npm:^7.3.12": - version: 7.5.1 - resolution: "@types/semver@npm:7.5.1" - checksum: 2fffe938c7ac168711f245a16e1856a3578d77161ca17e29a05c3e02c7be3e9c5beefa29a3350f6c1bd982fb70aa28cc52e4845eb7d36246bcdc0377170d584d + version: 7.5.4 + resolution: "@types/semver@npm:7.5.4" + checksum: 120c0189f6fec5f2d12d0d71ac8a4cfa952dc17fa3d842e8afddb82bba8828a4052f8799c1653e2b47ae1977435f38e8985658fde971905ce5afb8e23ee97ecf languageName: node linkType: hard -"@types/vscode@npm:^1.82.0": - version: 1.82.0 - resolution: "@types/vscode@npm:1.82.0" - checksum: 2c546b61a0f52c8153bf52645e230e192609a77cd482c96a8eaa5f7008763b25bab684c688a77713dcb087464f99ff979a232bf145038f9cb91a395feb6a09d9 +"@types/vscode@npm:^1.83.0": + version: 1.83.1 + resolution: "@types/vscode@npm:1.83.1" + checksum: b421594b61529d38120effff3b7358efcdbc6a0786936d0dec6251c264c08793c802f1973c6408238a01b29e08fb40279f6d4d7c3194fdb7d5f50b044a4e9c8a languageName: node linkType: hard @@ -493,48 +501,14 @@ __metadata: linkType: hard "@vscode/test-electron@npm:^2.3.2": - version: 2.3.4 - resolution: "@vscode/test-electron@npm:2.3.4" + version: 2.3.5 + resolution: "@vscode/test-electron@npm:2.3.5" dependencies: http-proxy-agent: ^4.0.1 https-proxy-agent: ^5.0.0 jszip: ^3.10.1 semver: ^7.5.2 - checksum: 78de21d66be5affa26789e41a3f645bd07978a993ef026219136e55e4b7025e5e13f03bd9a1a1696690f802fed3e2e363828d1933e5bd581cadee94655272f00 - languageName: node - linkType: hard - -"@vscode/vsce@npm:^2.21.1": - version: 2.21.1 - resolution: "@vscode/vsce@npm:2.21.1" - dependencies: - azure-devops-node-api: ^11.0.1 - chalk: ^2.4.2 - cheerio: ^1.0.0-rc.9 - commander: ^6.2.1 - glob: ^7.0.6 - hosted-git-info: ^4.0.2 - jsonc-parser: ^3.2.0 - keytar: ^7.7.0 - leven: ^3.1.0 - markdown-it: ^12.3.2 - mime: ^1.3.4 - minimatch: ^3.0.3 - parse-semver: ^1.1.1 - read: ^1.0.7 - semver: ^7.5.2 - tmp: ^0.2.1 - typed-rest-client: ^1.8.4 - url-join: ^4.0.1 - xml2js: ^0.5.0 - yauzl: ^2.3.1 - yazl: ^2.2.2 - dependenciesMeta: - keytar: - optional: true - bin: - vsce: vsce - checksum: d597d97683ef9e592383a33906313534fc40ca2a030fc63c226451e3754baa013845f93b93e7648396a8d79106626ad65b60733fa03c47e4964ee98c6b7b6734 + checksum: 3eaaf6613ab14b36da45a69f114ec0e60012c1ca9a33576990fefa3276cfa0b0e45aacb26b577883804ae864ff55364bb1e48e4ef3bb6ebf89af55a7e732ba31 languageName: node linkType: hard @@ -840,15 +814,6 @@ __metadata: languageName: node linkType: hard -"ansi-styles@npm:^3.2.1": - version: 3.2.1 - resolution: "ansi-styles@npm:3.2.1" - dependencies: - color-convert: ^1.9.0 - checksum: d85ade01c10e5dd77b6c89f34ed7531da5830d2cb5882c645f330079975b716438cd7ebb81d0d6e6b4f9c577f19ae41ab55f07f19786b02f9dfd9e0377395665 - languageName: node - linkType: hard - "ansi-styles@npm:^4.0.0, ansi-styles@npm:^4.1.0": version: 4.3.0 resolution: "ansi-styles@npm:4.3.0" @@ -906,16 +871,6 @@ __metadata: languageName: node linkType: hard -"azure-devops-node-api@npm:^11.0.1": - version: 11.2.0 - resolution: "azure-devops-node-api@npm:11.2.0" - dependencies: - tunnel: 0.0.6 - typed-rest-client: ^1.8.4 - checksum: 52e84379b4ce71ad8a79470ba89e1d1217b28ee3670c7e484e1b1d9c210acf406ab09132c241cb481f78354df701dae7752ba3c4e3d28b2b6c0b0ff2d9eb7199 - languageName: node - linkType: hard - "balanced-match@npm:^1.0.0": version: 1.0.2 resolution: "balanced-match@npm:1.0.2" @@ -923,13 +878,6 @@ __metadata: languageName: node linkType: hard -"base64-js@npm:^1.3.1": - version: 1.5.1 - resolution: "base64-js@npm:1.5.1" - checksum: 669632eb3745404c2f822a18fc3a0122d2f9a7a13f7fb8b5823ee19d1d2ff9ee5b52c53367176ea4ad093c332fd5ab4bd0ebae5a8e27917a4105a4cfc86b1005 - languageName: node - linkType: hard - "binary-extensions@npm:^2.0.0": version: 2.2.0 resolution: "binary-extensions@npm:2.2.0" @@ -937,24 +885,6 @@ __metadata: languageName: node linkType: hard -"bl@npm:^4.0.3": - version: 4.1.0 - resolution: "bl@npm:4.1.0" - dependencies: - buffer: ^5.5.0 - inherits: ^2.0.4 - readable-stream: ^3.4.0 - checksum: 9e8521fa7e83aa9427c6f8ccdcba6e8167ef30cc9a22df26effcc5ab682ef91d2cbc23a239f945d099289e4bbcfae7a192e9c28c84c6202e710a0dfec3722662 - languageName: node - linkType: hard - -"boolbase@npm:^1.0.0": - version: 1.0.0 - resolution: "boolbase@npm:1.0.0" - checksum: 3e25c80ef626c3a3487c73dbfc70ac322ec830666c9ad915d11b701142fab25ec1e63eff2c450c74347acfd2de854ccde865cd79ef4db1683f7c7b046ea43bb0 - languageName: node - linkType: hard - "brace-expansion@npm:^1.1.7": version: 1.1.11 resolution: "brace-expansion@npm:1.1.11" @@ -991,23 +921,16 @@ __metadata: linkType: hard "browserslist@npm:^4.14.5": - version: 4.21.10 - resolution: "browserslist@npm:4.21.10" + version: 4.22.1 + resolution: "browserslist@npm:4.22.1" dependencies: - caniuse-lite: ^1.0.30001517 - electron-to-chromium: ^1.4.477 + caniuse-lite: ^1.0.30001541 + electron-to-chromium: ^1.4.535 node-releases: ^2.0.13 - update-browserslist-db: ^1.0.11 + update-browserslist-db: ^1.0.13 bin: browserslist: cli.js - checksum: 1e27c0f111a35d1dd0e8fc2c61781b0daefabc2c9471b0b10537ce54843014bceb2a1ce4571af1a82b2bf1e6e6e05d38865916689a158f03bc2c7a4ec2577db8 - languageName: node - linkType: hard - -"buffer-crc32@npm:~0.2.3": - version: 0.2.13 - resolution: "buffer-crc32@npm:0.2.13" - checksum: 06252347ae6daca3453b94e4b2f1d3754a3b146a111d81c68924c22d91889a40623264e95e67955b1cb4a68cbedf317abeabb5140a9766ed248973096db5ce1c + checksum: 7e6b10c53f7dd5d83fd2b95b00518889096382539fed6403829d447e05df4744088de46a571071afb447046abc3c66ad06fbc790e70234ec2517452e32ffd862 languageName: node linkType: hard @@ -1018,16 +941,6 @@ __metadata: languageName: node linkType: hard -"buffer@npm:^5.5.0": - version: 5.7.1 - resolution: "buffer@npm:5.7.1" - dependencies: - base64-js: ^1.3.1 - ieee754: ^1.1.13 - checksum: e2cf8429e1c4c7b8cbd30834ac09bd61da46ce35f5c22a78e6c2f04497d6d25541b16881e30a019c6fd3154150650ccee27a308eff3e26229d788bbdeb08ab84 - languageName: node - linkType: hard - "cacache@npm:^17.0.0": version: 17.1.4 resolution: "cacache@npm:17.1.4" @@ -1048,16 +961,6 @@ __metadata: languageName: node linkType: hard -"call-bind@npm:^1.0.0": - version: 1.0.2 - resolution: "call-bind@npm:1.0.2" - dependencies: - function-bind: ^1.1.1 - get-intrinsic: ^1.0.2 - checksum: f8e31de9d19988a4b80f3e704788c4a2d6b6f3d17cfec4f57dc29ced450c53a49270dc66bf0fbd693329ee948dd33e6c90a329519aef17474a4d961e8d6426b0 - languageName: node - linkType: hard - "callsites@npm:^3.0.0": version: 3.1.0 resolution: "callsites@npm:3.1.0" @@ -1072,21 +975,10 @@ __metadata: languageName: node linkType: hard -"caniuse-lite@npm:^1.0.30001517": - version: 1.0.30001532 - resolution: "caniuse-lite@npm:1.0.30001532" - checksum: 613abeb15e03dde307d543195a7860f7ba7450c9c9262d45642b2c8fbe097914fa060d68c8647f9d443947b1f62b09d891858bde7d2cac94fae8133a0b518b28 - languageName: node - linkType: hard - -"chalk@npm:^2.4.2": - version: 2.4.2 - resolution: "chalk@npm:2.4.2" - dependencies: - ansi-styles: ^3.2.1 - escape-string-regexp: ^1.0.5 - supports-color: ^5.3.0 - checksum: ec3661d38fe77f681200f878edbd9448821924e0f93a9cefc0e26a33b145f1027a2084bf19967160d11e1f03bfe4eaffcabf5493b89098b2782c3fe0b03d80c2 +"caniuse-lite@npm:^1.0.30001541": + version: 1.0.30001551 + resolution: "caniuse-lite@npm:1.0.30001551" + checksum: ffdee85b1c130cbebf0aa978ba839f3525f8e304855ba9bf0fbefaac8dd8c40051a7e19ac84a7cf4ba026410abcbe6f8b45560b22ee417c52daecaf955108e65 languageName: node linkType: hard @@ -1100,35 +992,6 @@ __metadata: languageName: node linkType: hard -"cheerio-select@npm:^2.1.0": - version: 2.1.0 - resolution: "cheerio-select@npm:2.1.0" - dependencies: - boolbase: ^1.0.0 - css-select: ^5.1.0 - css-what: ^6.1.0 - domelementtype: ^2.3.0 - domhandler: ^5.0.3 - domutils: ^3.0.1 - checksum: 843d6d479922f28a6c5342c935aff1347491156814de63c585a6eb73baf7bb4185c1b4383a1195dca0f12e3946d737c7763bcef0b9544c515d905c5c44c5308b - languageName: node - linkType: hard - -"cheerio@npm:^1.0.0-rc.9": - version: 1.0.0-rc.12 - resolution: "cheerio@npm:1.0.0-rc.12" - dependencies: - cheerio-select: ^2.1.0 - dom-serializer: ^2.0.0 - domhandler: ^5.0.3 - domutils: ^3.0.1 - htmlparser2: ^8.0.1 - parse5: ^7.0.0 - parse5-htmlparser2-tree-adapter: ^7.0.0 - checksum: 5d4c1b7a53cf22d3a2eddc0aff70cf23cbb30d01a4c79013e703a012475c02461aa1fcd99127e8d83a02216386ed6942b2c8103845fd0812300dd199e6e7e054 - languageName: node - linkType: hard - "chokidar@npm:3.5.3": version: 3.5.3 resolution: "chokidar@npm:3.5.3" @@ -1148,13 +1011,6 @@ __metadata: languageName: node linkType: hard -"chownr@npm:^1.1.1": - version: 1.1.4 - resolution: "chownr@npm:1.1.4" - checksum: 115648f8eb38bac5e41c3857f3e663f9c39ed6480d1349977c4d96c95a47266fcacc5a5aabf3cb6c481e22d72f41992827db47301851766c4fd77ac21a4f081d - languageName: node - linkType: hard - "chownr@npm:^2.0.0": version: 2.0.0 resolution: "chownr@npm:2.0.0" @@ -1198,15 +1054,6 @@ __metadata: languageName: node linkType: hard -"color-convert@npm:^1.9.0": - version: 1.9.3 - resolution: "color-convert@npm:1.9.3" - dependencies: - color-name: 1.1.3 - checksum: fd7a64a17cde98fb923b1dd05c5f2e6f7aefda1b60d67e8d449f9328b4e53b228a428fd38bfeaeb2db2ff6b6503a776a996150b80cdf224062af08a5c8a3a203 - languageName: node - linkType: hard - "color-convert@npm:^2.0.1": version: 2.0.1 resolution: "color-convert@npm:2.0.1" @@ -1216,13 +1063,6 @@ __metadata: languageName: node linkType: hard -"color-name@npm:1.1.3": - version: 1.1.3 - resolution: "color-name@npm:1.1.3" - checksum: 09c5d3e33d2105850153b14466501f2bfb30324a2f76568a408763a3b7433b0e50e5b4ab1947868e65cb101bb7cb75029553f2c333b6d4b8138a73fcc133d69d - languageName: node - linkType: hard - "color-name@npm:~1.1.4": version: 1.1.4 resolution: "color-name@npm:1.1.4" @@ -1260,13 +1100,6 @@ __metadata: languageName: node linkType: hard -"commander@npm:^6.2.1": - version: 6.2.1 - resolution: "commander@npm:6.2.1" - checksum: d7090410c0de6bc5c67d3ca41c41760d6d268f3c799e530aafb73b7437d1826bbf0d2a3edac33f8b57cc9887b4a986dce307fa5557e109be40eadb7c43b21742 - languageName: node - linkType: hard - "concat-map@npm:0.0.1": version: 0.0.1 resolution: "concat-map@npm:0.0.1" @@ -1299,26 +1132,6 @@ __metadata: languageName: node linkType: hard -"css-select@npm:^5.1.0": - version: 5.1.0 - resolution: "css-select@npm:5.1.0" - dependencies: - boolbase: ^1.0.0 - css-what: ^6.1.0 - domhandler: ^5.0.2 - domutils: ^3.0.1 - nth-check: ^2.0.1 - checksum: 2772c049b188d3b8a8159907192e926e11824aea525b8282981f72ba3f349cf9ecd523fdf7734875ee2cb772246c22117fc062da105b6d59afe8dcd5c99c9bda - languageName: node - linkType: hard - -"css-what@npm:^6.1.0": - version: 6.1.0 - resolution: "css-what@npm:6.1.0" - checksum: b975e547e1e90b79625918f84e67db5d33d896e6de846c9b584094e529f0c63e2ab85ee33b9daffd05bff3a146a1916bec664e18bb76dd5f66cbff9fc13b2bbe - languageName: node - linkType: hard - "debug@npm:4, debug@npm:4.3.4, debug@npm:^4.1.1, debug@npm:^4.3.2, debug@npm:^4.3.3, debug@npm:^4.3.4": version: 4.3.4 resolution: "debug@npm:4.3.4" @@ -1338,22 +1151,6 @@ __metadata: languageName: node linkType: hard -"decompress-response@npm:^6.0.0": - version: 6.0.0 - resolution: "decompress-response@npm:6.0.0" - dependencies: - mimic-response: ^3.1.0 - checksum: d377cf47e02d805e283866c3f50d3d21578b779731e8c5072d6ce8c13cc31493db1c2f6784da9d1d5250822120cefa44f1deab112d5981015f2e17444b763812 - languageName: node - linkType: hard - -"deep-extend@npm:^0.6.0": - version: 0.6.0 - resolution: "deep-extend@npm:0.6.0" - checksum: 7be7e5a8d468d6b10e6a67c3de828f55001b6eb515d014f7aeb9066ce36bd5717161eb47d6a0f7bed8a9083935b465bc163ee2581c8b128d29bf61092fdf57a7 - languageName: node - linkType: hard - "deep-is@npm:^0.1.3": version: 0.1.4 resolution: "deep-is@npm:0.1.4" @@ -1368,13 +1165,6 @@ __metadata: languageName: node linkType: hard -"detect-libc@npm:^2.0.0": - version: 2.0.2 - resolution: "detect-libc@npm:2.0.2" - checksum: 2b2cd3649b83d576f4be7cc37eb3b1815c79969c8b1a03a40a4d55d83bc74d010753485753448eacb98784abf22f7dbd3911fd3b60e29fda28fed2d1a997944d - languageName: node - linkType: hard - "diff@npm:5.0.0": version: 5.0.0 resolution: "diff@npm:5.0.0" @@ -1400,44 +1190,6 @@ __metadata: languageName: node linkType: hard -"dom-serializer@npm:^2.0.0": - version: 2.0.0 - resolution: "dom-serializer@npm:2.0.0" - dependencies: - domelementtype: ^2.3.0 - domhandler: ^5.0.2 - entities: ^4.2.0 - checksum: cd1810544fd8cdfbd51fa2c0c1128ec3a13ba92f14e61b7650b5de421b88205fd2e3f0cc6ace82f13334114addb90ed1c2f23074a51770a8e9c1273acbc7f3e6 - languageName: node - linkType: hard - -"domelementtype@npm:^2.3.0": - version: 2.3.0 - resolution: "domelementtype@npm:2.3.0" - checksum: ee837a318ff702622f383409d1f5b25dd1024b692ef64d3096ff702e26339f8e345820f29a68bcdcea8cfee3531776b3382651232fbeae95612d6f0a75efb4f6 - languageName: node - linkType: hard - -"domhandler@npm:^5.0.2, domhandler@npm:^5.0.3": - version: 5.0.3 - resolution: "domhandler@npm:5.0.3" - dependencies: - domelementtype: ^2.3.0 - checksum: 0f58f4a6af63e6f3a4320aa446d28b5790a009018707bce2859dcb1d21144c7876482b5188395a188dfa974238c019e0a1e610d2fc269a12b2c192ea2b0b131c - languageName: node - linkType: hard - -"domutils@npm:^3.0.1": - version: 3.1.0 - resolution: "domutils@npm:3.1.0" - dependencies: - dom-serializer: ^2.0.0 - domelementtype: ^2.3.0 - domhandler: ^5.0.3 - checksum: e5757456ddd173caa411cfc02c2bb64133c65546d2c4081381a3bafc8a57411a41eed70494551aa58030be9e58574fcc489828bebd673863d39924fb4878f416 - languageName: node - linkType: hard - "eastasianwidth@npm:^0.2.0": version: 0.2.0 resolution: "eastasianwidth@npm:0.2.0" @@ -1445,10 +1197,10 @@ __metadata: languageName: node linkType: hard -"electron-to-chromium@npm:^1.4.477": - version: 1.4.513 - resolution: "electron-to-chromium@npm:1.4.513" - checksum: 613b66da177dcf5abca2441c502cde4b4fb247665dc049c54d1fe3b79fc3a5a3ecae92faf97d3147af0fec9c50bf90db09e8ca3f0953a5ec2fdb472d6d6253c2 +"electron-to-chromium@npm:^1.4.535": + version: 1.4.562 + resolution: "electron-to-chromium@npm:1.4.562" + checksum: 89e5d5ed3bb6de36c860bc1f7f5873f12bdc58f1ebb56af84a860d892ab38ff2ef3e92974a96f823dda6d229e3b7a72e61420f51fd67d42c317c6127e35b6327 languageName: node linkType: hard @@ -1475,15 +1227,6 @@ __metadata: languageName: node linkType: hard -"end-of-stream@npm:^1.1.0, end-of-stream@npm:^1.4.1": - version: 1.4.4 - resolution: "end-of-stream@npm:1.4.4" - dependencies: - once: ^1.4.0 - checksum: 530a5a5a1e517e962854a31693dbb5c0b2fc40b46dad2a56a2deec656ca040631124f4795823acc68238147805f8b021abbe221f4afed5ef3c8e8efc2024908b - languageName: node - linkType: hard - "enhanced-resolve@npm:^5.0.0, enhanced-resolve@npm:^5.15.0": version: 5.15.0 resolution: "enhanced-resolve@npm:5.15.0" @@ -1494,20 +1237,6 @@ __metadata: languageName: node linkType: hard -"entities@npm:^4.2.0, entities@npm:^4.4.0": - version: 4.5.0 - resolution: "entities@npm:4.5.0" - checksum: 853f8ebd5b425d350bffa97dd6958143179a5938352ccae092c62d1267c4e392a039be1bae7d51b6e4ffad25f51f9617531fedf5237f15df302ccfb452cbf2d7 - languageName: node - linkType: hard - -"entities@npm:~2.1.0": - version: 2.1.0 - resolution: "entities@npm:2.1.0" - checksum: a10a877e489586a3f6a691fe49bf3fc4e58f06c8e80522f08214a5150ba457e7017b447d4913a3fa041bda06ee4c92517baa4d8d75373eaa79369e9639225ffd - languageName: node - linkType: hard - "env-paths@npm:^2.2.0": version: 2.2.1 resolution: "env-paths@npm:2.2.1" @@ -1532,9 +1261,9 @@ __metadata: linkType: hard "es-module-lexer@npm:^1.2.1": - version: 1.3.0 - resolution: "es-module-lexer@npm:1.3.0" - checksum: 48fd9f504a9d2a894126f75c8b7ccc6273a289983e9b67255f165bfd9ae765d50100218251e94e702ca567826905ea2f7b3b4a0c4d74d3ce99cce3a2a606a238 + version: 1.3.1 + resolution: "es-module-lexer@npm:1.3.1" + checksum: 3beafa7e171eb1e8cc45695edf8d51638488dddf65294d7911f8d6a96249da6a9838c87529262cc6ea53988d8272cec0f4bff93f476ed031a54ba3afb51a0ed3 languageName: node linkType: hard @@ -1552,13 +1281,6 @@ __metadata: languageName: node linkType: hard -"escape-string-regexp@npm:^1.0.5": - version: 1.0.5 - resolution: "escape-string-regexp@npm:1.0.5" - checksum: 6092fda75c63b110c706b6a9bfde8a612ad595b628f0bd2147eea1d3406723020810e591effc7db1da91d80a71a737a313567c5abb3813e8d9c71f4aa595b410 - languageName: node - linkType: hard - "eslint-scope@npm:5.1.1, eslint-scope@npm:^5.1.1": version: 5.1.1 resolution: "eslint-scope@npm:5.1.1" @@ -1594,13 +1316,13 @@ __metadata: linkType: hard "eslint@npm:^8.41.0": - version: 8.49.0 - resolution: "eslint@npm:8.49.0" + version: 8.51.0 + resolution: "eslint@npm:8.51.0" dependencies: "@eslint-community/eslint-utils": ^4.2.0 "@eslint-community/regexpp": ^4.6.1 "@eslint/eslintrc": ^2.1.2 - "@eslint/js": 8.49.0 + "@eslint/js": 8.51.0 "@humanwhocodes/config-array": ^0.11.11 "@humanwhocodes/module-importer": ^1.0.1 "@nodelib/fs.walk": ^1.2.8 @@ -1636,7 +1358,7 @@ __metadata: text-table: ^0.2.0 bin: eslint: bin/eslint.js - checksum: 4dfe257e1e42da2f9da872b05aaaf99b0f5aa022c1a91eee8f2af1ab72651b596366320c575ccd4e0469f7b4c97aff5bb85ae3323ebd6a293c3faef4028b0d81 + checksum: 214fa5d1fcb67af1b8992ce9584ccd85e1aa7a482f8b8ea5b96edc28fa838a18a3b69456db45fc1ed3ef95f1e9efa9714f737292dc681e572d471d02fda9649c languageName: node linkType: hard @@ -1744,13 +1466,6 @@ __metadata: languageName: node linkType: hard -"expand-template@npm:^2.0.3": - version: 2.0.3 - resolution: "expand-template@npm:2.0.3" - checksum: 588c19847216421ed92befb521767b7018dc88f88b0576df98cb242f20961425e96a92cbece525ef28cc5becceae5d544ae0f5b9b5e2aa05acb13716ca5b3099 - languageName: node - linkType: hard - "exponential-backoff@npm:^3.1.1": version: 3.1.1 resolution: "exponential-backoff@npm:3.1.1" @@ -1808,15 +1523,6 @@ __metadata: languageName: node linkType: hard -"fd-slicer@npm:~1.1.0": - version: 1.1.0 - resolution: "fd-slicer@npm:1.1.0" - dependencies: - pend: ~1.2.0 - checksum: c8585fd5713f4476eb8261150900d2cb7f6ff2d87f8feb306ccc8a1122efd152f1783bdb2b8dc891395744583436bfd8081d8e63ece0ec8687eeefea394d4ff2 - languageName: node - linkType: hard - "file-entry-cache@npm:^6.0.1": version: 6.0.1 resolution: "file-entry-cache@npm:6.0.1" @@ -1891,13 +1597,6 @@ __metadata: languageName: node linkType: hard -"fs-constants@npm:^1.0.0": - version: 1.0.0 - resolution: "fs-constants@npm:1.0.0" - checksum: 18f5b718371816155849475ac36c7d0b24d39a11d91348cfcb308b4494824413e03572c403c86d3a260e049465518c4f0d5bd00f0371cdfcad6d4f30a85b350d - languageName: node - linkType: hard - "fs-minipass@npm:^2.0.0": version: 2.1.0 resolution: "fs-minipass@npm:2.1.0" @@ -1942,13 +1641,6 @@ __metadata: languageName: node linkType: hard -"function-bind@npm:^1.1.1": - version: 1.1.1 - resolution: "function-bind@npm:1.1.1" - checksum: b32fbaebb3f8ec4969f033073b43f5c8befbb58f1a79e12f1d7490358150359ebd92f49e72ff0144f65f2c48ea2a605bff2d07965f548f6474fd8efd95bf361a - languageName: node - linkType: hard - "gauge@npm:^4.0.3": version: 4.0.4 resolution: "gauge@npm:4.0.4" @@ -1972,25 +1664,6 @@ __metadata: languageName: node linkType: hard -"get-intrinsic@npm:^1.0.2": - version: 1.2.1 - resolution: "get-intrinsic@npm:1.2.1" - dependencies: - function-bind: ^1.1.1 - has: ^1.0.3 - has-proto: ^1.0.1 - has-symbols: ^1.0.3 - checksum: 5b61d88552c24b0cf6fa2d1b3bc5459d7306f699de060d76442cce49a4721f52b8c560a33ab392cf5575b7810277d54ded9d4d39a1ea61855619ebc005aa7e5f - languageName: node - linkType: hard - -"github-from-package@npm:0.0.0": - version: 0.0.0 - resolution: "github-from-package@npm:0.0.0" - checksum: 14e448192a35c1e42efee94c9d01a10f42fe790375891a24b25261246ce9336ab9df5d274585aedd4568f7922246c2a78b8a8cd2571bfe99c693a9718e7dd0e3 - languageName: node - linkType: hard - "glob-parent@npm:^5.1.2, glob-parent@npm:~5.1.2": version: 5.1.2 resolution: "glob-parent@npm:5.1.2" @@ -2045,7 +1718,7 @@ __metadata: languageName: node linkType: hard -"glob@npm:^7.0.6, glob@npm:^7.1.3, glob@npm:^7.1.4": +"glob@npm:^7.1.3, glob@npm:^7.1.4": version: 7.2.3 resolution: "glob@npm:7.2.3" dependencies: @@ -2109,13 +1782,6 @@ __metadata: languageName: node linkType: hard -"has-flag@npm:^3.0.0": - version: 3.0.0 - resolution: "has-flag@npm:3.0.0" - checksum: 4a15638b454bf086c8148979aae044dd6e39d63904cd452d970374fa6a87623423da485dfb814e7be882e05c096a7ccf1ebd48e7e7501d0208d8384ff4dea73b - languageName: node - linkType: hard - "has-flag@npm:^4.0.0": version: 4.0.0 resolution: "has-flag@npm:4.0.0" @@ -2123,20 +1789,6 @@ __metadata: languageName: node linkType: hard -"has-proto@npm:^1.0.1": - version: 1.0.1 - resolution: "has-proto@npm:1.0.1" - checksum: febc5b5b531de8022806ad7407935e2135f1cc9e64636c3916c6842bd7995994ca3b29871ecd7954bd35f9e2986c17b3b227880484d22259e2f8e6ce63fd383e - languageName: node - linkType: hard - -"has-symbols@npm:^1.0.3": - version: 1.0.3 - resolution: "has-symbols@npm:1.0.3" - checksum: a054c40c631c0d5741a8285010a0777ea0c068f99ed43e5d6eb12972da223f8af553a455132fdb0801bdcfa0e0f443c0c03a68d8555aa529b3144b446c3f2410 - languageName: node - linkType: hard - "has-unicode@npm:^2.0.1": version: 2.0.1 resolution: "has-unicode@npm:2.0.1" @@ -2145,11 +1797,9 @@ __metadata: linkType: hard "has@npm:^1.0.3": - version: 1.0.3 - resolution: "has@npm:1.0.3" - dependencies: - function-bind: ^1.1.1 - checksum: b9ad53d53be4af90ce5d1c38331e712522417d017d5ef1ebd0507e07c2fbad8686fffb8e12ddecd4c39ca9b9b47431afbb975b8abf7f3c3b82c98e9aad052792 + version: 1.0.4 + resolution: "has@npm:1.0.4" + checksum: 8a11ba062e0627c9578a1d08285401e39f1d071a9692ddf793199070edb5648b21c774dd733e2a181edd635bf6862731885f476f4ccf67c998d7a5ff7cef2550 languageName: node linkType: hard @@ -2162,27 +1812,6 @@ __metadata: languageName: node linkType: hard -"hosted-git-info@npm:^4.0.2": - version: 4.1.0 - resolution: "hosted-git-info@npm:4.1.0" - dependencies: - lru-cache: ^6.0.0 - checksum: c3f87b3c2f7eb8c2748c8f49c0c2517c9a95f35d26f4bf54b2a8cba05d2e668f3753548b6ea366b18ec8dadb4e12066e19fa382a01496b0ffa0497eb23cbe461 - languageName: node - linkType: hard - -"htmlparser2@npm:^8.0.1": - version: 8.0.2 - resolution: "htmlparser2@npm:8.0.2" - dependencies: - domelementtype: ^2.3.0 - domhandler: ^5.0.3 - domutils: ^3.0.1 - entities: ^4.4.0 - checksum: 29167a0f9282f181da8a6d0311b76820c8a59bc9e3c87009e21968264c2987d2723d6fde5a964d4b7b6cba663fca96ffb373c06d8223a85f52a6089ced942700 - languageName: node - linkType: hard - "http-cache-semantics@npm:^4.1.1": version: 4.1.1 resolution: "http-cache-semantics@npm:4.1.1" @@ -2249,13 +1878,6 @@ __metadata: languageName: node linkType: hard -"ieee754@npm:^1.1.13": - version: 1.2.1 - resolution: "ieee754@npm:1.2.1" - checksum: 5144c0c9815e54ada181d80a0b810221a253562422e7c6c3a60b1901154184f49326ec239d618c416c1c5945a2e197107aee8d986a3dd836b53dffefd99b5e7e - languageName: node - linkType: hard - "ignore@npm:^5.2.0": version: 5.2.4 resolution: "ignore@npm:5.2.4" @@ -2316,20 +1938,13 @@ __metadata: languageName: node linkType: hard -"inherits@npm:2, inherits@npm:^2.0.3, inherits@npm:^2.0.4, inherits@npm:~2.0.3": +"inherits@npm:2, inherits@npm:^2.0.3, inherits@npm:~2.0.3": version: 2.0.4 resolution: "inherits@npm:2.0.4" checksum: 4a48a733847879d6cf6691860a6b1e3f0f4754176e4d71494c41f3475553768b10f84b5ce1d40fbd0e34e6bfbb864ee35858ad4dd2cf31e02fc4a154b724d7f1 languageName: node linkType: hard -"ini@npm:~1.3.0": - version: 1.3.8 - resolution: "ini@npm:1.3.8" - checksum: dfd98b0ca3a4fc1e323e38a6c8eb8936e31a97a918d3b377649ea15bdb15d481207a0dda1021efbd86b464cae29a0d33c1d7dcaf6c5672bee17fa849bc50a1b3 - languageName: node - linkType: hard - "interpret@npm:^3.1.1": version: 3.1.1 resolution: "interpret@npm:3.1.1" @@ -2506,13 +2121,6 @@ __metadata: languageName: node linkType: hard -"jsonc-parser@npm:^3.2.0": - version: 3.2.0 - resolution: "jsonc-parser@npm:3.2.0" - checksum: 946dd9a5f326b745aa326d48a7257e3f4a4b62c5e98ec8e49fa2bdd8d96cef7e6febf1399f5c7016114fd1f68a1c62c6138826d5d90bc650448e3cf0951c53c7 - languageName: node - linkType: hard - "jszip@npm:^3.10.1": version: 3.10.1 resolution: "jszip@npm:3.10.1" @@ -2525,17 +2133,6 @@ __metadata: languageName: node linkType: hard -"keytar@npm:^7.7.0": - version: 7.9.0 - resolution: "keytar@npm:7.9.0" - dependencies: - node-addon-api: ^4.3.0 - node-gyp: latest - prebuild-install: ^7.0.1 - checksum: 4dbdd21f69e21a53032cbc949847f57338e42df763c5eec04e1b5d7142a689f95d8c3d74fb3b7dc321b5d678271d8d8d1a0dcaa919673ebc50ef8ce76f354e21 - languageName: node - linkType: hard - "kind-of@npm:^6.0.2": version: 6.0.3 resolution: "kind-of@npm:6.0.3" @@ -2543,13 +2140,6 @@ __metadata: languageName: node linkType: hard -"leven@npm:^3.1.0": - version: 3.1.0 - resolution: "leven@npm:3.1.0" - checksum: 638401d534585261b6003db9d99afd244dfe82d75ddb6db5c0df412842d5ab30b2ef18de471aaec70fe69a46f17b4ae3c7f01d8a4e6580ef7adb9f4273ad1e55 - languageName: node - linkType: hard - "levn@npm:^0.4.1": version: 0.4.1 resolution: "levn@npm:0.4.1" @@ -2569,15 +2159,6 @@ __metadata: languageName: node linkType: hard -"linkify-it@npm:^3.0.1": - version: 3.0.3 - resolution: "linkify-it@npm:3.0.3" - dependencies: - uc.micro: ^1.0.1 - checksum: 31367a4bb70c5bbc9703246236b504b0a8e049bcd4e0de4291fa50f0ebdebf235b5eb54db6493cb0b1319357c6eeafc4324c9f4aa34b0b943d9f2e11a1268fbc - languageName: node - linkType: hard - "loader-runner@npm:^4.2.0": version: 4.3.0 resolution: "loader-runner@npm:4.3.0" @@ -2666,28 +2247,6 @@ __metadata: languageName: node linkType: hard -"markdown-it@npm:^12.3.2": - version: 12.3.2 - resolution: "markdown-it@npm:12.3.2" - dependencies: - argparse: ^2.0.1 - entities: ~2.1.0 - linkify-it: ^3.0.1 - mdurl: ^1.0.1 - uc.micro: ^1.0.5 - bin: - markdown-it: bin/markdown-it.js - checksum: 890555711c1c00fa03b936ca2b213001a3b9b37dea140d8445ae4130ce16628392aad24b12e2a0a9935336ca5951f2957a38f4e5309a2e38eab44e25ff32a41e - languageName: node - linkType: hard - -"mdurl@npm:^1.0.1": - version: 1.0.1 - resolution: "mdurl@npm:1.0.1" - checksum: 71731ecba943926bfbf9f9b51e28b5945f9411c4eda80894221b47cc105afa43ba2da820732b436f0798fd3edbbffcd1fc1415843c41a87fea08a41cc1e3d02b - languageName: node - linkType: hard - "merge-stream@npm:^2.0.0": version: 2.0.0 resolution: "merge-stream@npm:2.0.0" @@ -2728,22 +2287,6 @@ __metadata: languageName: node linkType: hard -"mime@npm:^1.3.4": - version: 1.6.0 - resolution: "mime@npm:1.6.0" - bin: - mime: cli.js - checksum: fef25e39263e6d207580bdc629f8872a3f9772c923c7f8c7e793175cee22777bbe8bba95e5d509a40aaa292d8974514ce634ae35769faa45f22d17edda5e8557 - languageName: node - linkType: hard - -"mimic-response@npm:^3.1.0": - version: 3.1.0 - resolution: "mimic-response@npm:3.1.0" - checksum: 25739fee32c17f433626bf19f016df9036b75b3d84a3046c7d156e72ec963dd29d7fc8a302f55a3d6c5a4ff24259676b15d915aad6480815a969ff2ec0836867 - languageName: node - linkType: hard - "minimatch@npm:5.0.1": version: 5.0.1 resolution: "minimatch@npm:5.0.1" @@ -2753,7 +2296,7 @@ __metadata: languageName: node linkType: hard -"minimatch@npm:^3.0.3, minimatch@npm:^3.0.4, minimatch@npm:^3.0.5, minimatch@npm:^3.1.1, minimatch@npm:^3.1.2": +"minimatch@npm:^3.0.4, minimatch@npm:^3.0.5, minimatch@npm:^3.1.1, minimatch@npm:^3.1.2": version: 3.1.2 resolution: "minimatch@npm:3.1.2" dependencies: @@ -2780,13 +2323,6 @@ __metadata: languageName: node linkType: hard -"minimist@npm:^1.2.0, minimist@npm:^1.2.3": - version: 1.2.8 - resolution: "minimist@npm:1.2.8" - checksum: 75a6d645fb122dad29c06a7597bddea977258957ed88d7a6df59b5cd3fe4a527e253e9bbf2e783e4b73657f9098b96a5fe96ab8a113655d4109108577ecf85b0 - languageName: node - linkType: hard - "minipass-collect@npm:^1.0.2": version: 1.0.2 resolution: "minipass-collect@npm:1.0.2" @@ -2871,13 +2407,6 @@ __metadata: languageName: node linkType: hard -"mkdirp-classic@npm:^0.5.2, mkdirp-classic@npm:^0.5.3": - version: 0.5.3 - resolution: "mkdirp-classic@npm:0.5.3" - checksum: 3f4e088208270bbcc148d53b73e9a5bd9eef05ad2cbf3b3d0ff8795278d50dd1d11a8ef1875ff5aea3fa888931f95bfcb2ad5b7c1061cfefd6284d199e6776ac - languageName: node - linkType: hard - "mkdirp@npm:^1.0.3": version: 1.0.4 resolution: "mkdirp@npm:1.0.4" @@ -2933,13 +2462,6 @@ __metadata: languageName: node linkType: hard -"mute-stream@npm:~0.0.4": - version: 0.0.8 - resolution: "mute-stream@npm:0.0.8" - checksum: ff48d251fc3f827e5b1206cda0ffdaec885e56057ee86a3155e1951bc940fd5f33531774b1cc8414d7668c10a8907f863f6561875ee6e8768931a62121a531a1 - languageName: node - linkType: hard - "nanoid@npm:3.3.3": version: 3.3.3 resolution: "nanoid@npm:3.3.3" @@ -2949,13 +2471,6 @@ __metadata: languageName: node linkType: hard -"napi-build-utils@npm:^1.0.1": - version: 1.0.2 - resolution: "napi-build-utils@npm:1.0.2" - checksum: 06c14271ee966e108d55ae109f340976a9556c8603e888037145d6522726aebe89dd0c861b4b83947feaf6d39e79e08817559e8693deedc2c94e82c5cbd090c7 - languageName: node - linkType: hard - "natural-compare-lite@npm:^1.4.0": version: 1.4.0 resolution: "natural-compare-lite@npm:1.4.0" @@ -2984,24 +2499,6 @@ __metadata: languageName: node linkType: hard -"node-abi@npm:^3.3.0": - version: 3.47.0 - resolution: "node-abi@npm:3.47.0" - dependencies: - semver: ^7.3.5 - checksum: ff8498dcd4a805ebf0af27162023bb17e56cb973c955d6c411ebce0938b0827e34323ede846b635daff516d5cd2ea8d64f9d99f2d63f61d1d7469415323fa9a6 - languageName: node - linkType: hard - -"node-addon-api@npm:^4.3.0": - version: 4.3.0 - resolution: "node-addon-api@npm:4.3.0" - dependencies: - node-gyp: latest - checksum: 3de396e23cc209f539c704583e8e99c148850226f6e389a641b92e8967953713228109f919765abc1f4355e801e8f41842f96210b8d61c7dcc10a477002dcf00 - languageName: node - linkType: hard - "node-gyp@npm:latest": version: 9.4.0 resolution: "node-gyp@npm:9.4.0" @@ -3060,23 +2557,7 @@ __metadata: languageName: node linkType: hard -"nth-check@npm:^2.0.1": - version: 2.1.1 - resolution: "nth-check@npm:2.1.1" - dependencies: - boolbase: ^1.0.0 - checksum: 5afc3dafcd1573b08877ca8e6148c52abd565f1d06b1eb08caf982e3fa289a82f2cae697ffb55b5021e146d60443f1590a5d6b944844e944714a5b549675bcd3 - languageName: node - linkType: hard - -"object-inspect@npm:^1.9.0": - version: 1.12.3 - resolution: "object-inspect@npm:1.12.3" - checksum: dabfd824d97a5f407e6d5d24810d888859f6be394d8b733a77442b277e0808860555176719c5905e765e3743a7cada6b8b0a3b85e5331c530fd418cc8ae991db - languageName: node - linkType: hard - -"once@npm:^1.3.0, once@npm:^1.3.1, once@npm:^1.4.0": +"once@npm:^1.3.0": version: 1.4.0 resolution: "once@npm:1.4.0" dependencies: @@ -3105,47 +2586,36 @@ __metadata: languageName: unknown linkType: soft -"osmium-solidity-linter-core@workspace:toolchains/solidity/linter/core": +"osmium-solidity-core@workspace:toolchains/solidity/core": version: 0.0.0-use.local - resolution: "osmium-solidity-linter-core@workspace:toolchains/solidity/linter/core" + resolution: "osmium-solidity-core@workspace:toolchains/solidity/core" languageName: unknown linkType: soft -"osmium-solidity-linter-extension@workspace:toolchains/solidity/linter/extension": +"osmium-solidity-extension@workspace:toolchains/solidity/extension": version: 0.0.0-use.local - resolution: "osmium-solidity-linter-extension@workspace:toolchains/solidity/linter/extension" + resolution: "osmium-solidity-extension@workspace:toolchains/solidity/extension" dependencies: "@types/glob": ^8.1.0 "@types/mocha": ^10.0.1 "@types/node": 20.2.5 - "@types/vscode": ^1.82.0 + "@types/vscode": ^1.83.0 "@typescript-eslint/eslint-plugin": ^5.59.8 "@typescript-eslint/parser": ^5.59.8 "@vscode/test-electron": ^2.3.2 - "@vscode/vsce": ^2.21.1 eslint: ^8.41.0 glob: ^8.1.0 mocha: ^10.2.0 ts-loader: ^9.4.3 typescript: ^5.1.3 vscode-languageclient: ^8.1.0 + vscode-languageserver: ^8.1.0 + vscode-languageserver-textdocument: ^1.0.8 webpack: ^5.85.0 webpack-cli: ^5.1.1 languageName: unknown linkType: soft -"osmium-solidity-linter@workspace:toolchains/solidity/linter": - version: 0.0.0-use.local - resolution: "osmium-solidity-linter@workspace:toolchains/solidity/linter" - languageName: unknown - linkType: soft - -"osmium-solidity-lsp@workspace:toolchains/solidity/lsp": - version: 0.0.0-use.local - resolution: "osmium-solidity-lsp@workspace:toolchains/solidity/lsp" - languageName: unknown - linkType: soft - "osmium-solidity@workspace:toolchains/solidity": version: 0.0.0-use.local resolution: "osmium-solidity@workspace:toolchains/solidity" @@ -3228,34 +2698,6 @@ __metadata: languageName: node linkType: hard -"parse-semver@npm:^1.1.1": - version: 1.1.1 - resolution: "parse-semver@npm:1.1.1" - dependencies: - semver: ^5.1.0 - checksum: 0a9abc24b829b4db6dfd733727c2dd15b085c388b7c0bcc03e801412c1ebfe53a087613240f90af0dbed3a3283057bd320014b0df4b9222e01b4e3757b5c6e6a - languageName: node - linkType: hard - -"parse5-htmlparser2-tree-adapter@npm:^7.0.0": - version: 7.0.0 - resolution: "parse5-htmlparser2-tree-adapter@npm:7.0.0" - dependencies: - domhandler: ^5.0.2 - parse5: ^7.0.0 - checksum: fc5d01e07733142a1baf81de5c2a9c41426c04b7ab29dd218acb80cd34a63177c90aff4a4aee66cf9f1d0aeecff1389adb7452ad6f8af0a5888e3e9ad6ef733d - languageName: node - linkType: hard - -"parse5@npm:^7.0.0": - version: 7.1.2 - resolution: "parse5@npm:7.1.2" - dependencies: - entities: ^4.4.0 - checksum: 59465dd05eb4c5ec87b76173d1c596e152a10e290b7abcda1aecf0f33be49646ea74840c69af975d7887543ea45564801736356c568d6b5e71792fd0f4055713 - languageName: node - linkType: hard - "path-exists@npm:^4.0.0": version: 4.0.0 resolution: "path-exists@npm:4.0.0" @@ -3301,13 +2743,6 @@ __metadata: languageName: node linkType: hard -"pend@npm:~1.2.0": - version: 1.2.0 - resolution: "pend@npm:1.2.0" - checksum: 6c72f5243303d9c60bd98e6446ba7d30ae29e3d56fdb6fae8767e8ba6386f33ee284c97efe3230a0d0217e2b1723b8ab490b1bbf34fcbb2180dbc8a9de47850d - languageName: node - linkType: hard - "picocolors@npm:^1.0.0": version: 1.0.0 resolution: "picocolors@npm:1.0.0" @@ -3331,28 +2766,6 @@ __metadata: languageName: node linkType: hard -"prebuild-install@npm:^7.0.1": - version: 7.1.1 - resolution: "prebuild-install@npm:7.1.1" - dependencies: - detect-libc: ^2.0.0 - expand-template: ^2.0.3 - github-from-package: 0.0.0 - minimist: ^1.2.3 - mkdirp-classic: ^0.5.3 - napi-build-utils: ^1.0.1 - node-abi: ^3.3.0 - pump: ^3.0.0 - rc: ^1.2.7 - simple-get: ^4.0.0 - tar-fs: ^2.0.0 - tunnel-agent: ^0.6.0 - bin: - prebuild-install: bin.js - checksum: dbf96d0146b6b5827fc8f67f72074d2e19c69628b9a7a0a17d0fad1bf37e9f06922896972e074197fc00a52eae912993e6ef5a0d471652f561df5cb516f3f467 - languageName: node - linkType: hard - "prelude-ls@npm:^1.2.1": version: 1.2.1 resolution: "prelude-ls@npm:1.2.1" @@ -3386,16 +2799,6 @@ __metadata: languageName: node linkType: hard -"pump@npm:^3.0.0": - version: 3.0.0 - resolution: "pump@npm:3.0.0" - dependencies: - end-of-stream: ^1.1.0 - once: ^1.3.1 - checksum: e42e9229fba14732593a718b04cb5e1cfef8254544870997e0ecd9732b189a48e1256e4e5478148ecb47c8511dca2b09eae56b4d0aad8009e6fac8072923cfc9 - languageName: node - linkType: hard - "punycode@npm:^2.1.0": version: 2.3.0 resolution: "punycode@npm:2.3.0" @@ -3403,15 +2806,6 @@ __metadata: languageName: node linkType: hard -"qs@npm:^6.9.1": - version: 6.11.2 - resolution: "qs@npm:6.11.2" - dependencies: - side-channel: ^1.0.4 - checksum: e812f3c590b2262548647d62f1637b6989cc56656dc960b893fe2098d96e1bd633f36576f4cd7564dfbff9db42e17775884db96d846bebe4f37420d073ecdc0b - languageName: node - linkType: hard - "queue-microtask@npm:^1.2.2": version: 1.2.3 resolution: "queue-microtask@npm:1.2.3" @@ -3428,30 +2822,7 @@ __metadata: languageName: node linkType: hard -"rc@npm:^1.2.7": - version: 1.2.8 - resolution: "rc@npm:1.2.8" - dependencies: - deep-extend: ^0.6.0 - ini: ~1.3.0 - minimist: ^1.2.0 - strip-json-comments: ~2.0.1 - bin: - rc: ./cli.js - checksum: 2e26e052f8be2abd64e6d1dabfbd7be03f80ec18ccbc49562d31f617d0015fbdbcf0f9eed30346ea6ab789e0fdfe4337f033f8016efdbee0df5354751842080e - languageName: node - linkType: hard - -"read@npm:^1.0.7": - version: 1.0.7 - resolution: "read@npm:1.0.7" - dependencies: - mute-stream: ~0.0.4 - checksum: 2777c254e5732cac96f5d0a1c0f6b836c89ae23d8febd405b206f6f24d5de1873420f1a0795e0e3721066650d19adf802c7882c4027143ee0acf942a4f34f97b - languageName: node - linkType: hard - -"readable-stream@npm:^3.1.1, readable-stream@npm:^3.4.0, readable-stream@npm:^3.6.0": +"readable-stream@npm:^3.6.0": version: 3.6.2 resolution: "readable-stream@npm:3.6.2" dependencies: @@ -3526,28 +2897,28 @@ __metadata: linkType: hard "resolve@npm:^1.20.0": - version: 1.22.4 - resolution: "resolve@npm:1.22.4" + version: 1.22.8 + resolution: "resolve@npm:1.22.8" dependencies: is-core-module: ^2.13.0 path-parse: ^1.0.7 supports-preserve-symlinks-flag: ^1.0.0 bin: resolve: bin/resolve - checksum: 23f25174c2736ce24c6d918910e0d1f89b6b38fefa07a995dff864acd7863d59a7f049e691f93b4b2ee29696303390d921552b6d1b841ed4a8101f517e1d0124 + checksum: f8a26958aa572c9b064562750b52131a37c29d072478ea32e129063e2da7f83e31f7f11e7087a18225a8561cfe8d2f0df9dbea7c9d331a897571c0a2527dbb4c languageName: node linkType: hard "resolve@patch:resolve@^1.20.0#~builtin": - version: 1.22.4 - resolution: "resolve@patch:resolve@npm%3A1.22.4#~builtin::version=1.22.4&hash=c3c19d" + version: 1.22.8 + resolution: "resolve@patch:resolve@npm%3A1.22.8#~builtin::version=1.22.8&hash=c3c19d" dependencies: is-core-module: ^2.13.0 path-parse: ^1.0.7 supports-preserve-symlinks-flag: ^1.0.0 bin: resolve: bin/resolve - checksum: c45f2545fdc4d21883861b032789e20aa67a2f2692f68da320cc84d5724cd02f2923766c5354b3210897e88f1a7b3d6d2c7c22faeead8eed7078e4c783a444bc + checksum: 5479b7d431cacd5185f8db64bfcb7286ae5e31eb299f4c4f404ad8aa6098b77599563ac4257cb2c37a42f59dfc06a1bec2bcf283bb448f319e37f0feb9a09847 languageName: node linkType: hard @@ -3565,7 +2936,7 @@ __metadata: languageName: node linkType: hard -"rimraf@npm:^3.0.0, rimraf@npm:^3.0.2": +"rimraf@npm:^3.0.2": version: 3.0.2 resolution: "rimraf@npm:3.0.2" dependencies: @@ -3585,7 +2956,7 @@ __metadata: languageName: node linkType: hard -"safe-buffer@npm:^5.0.1, safe-buffer@npm:^5.1.0, safe-buffer@npm:~5.2.0": +"safe-buffer@npm:^5.1.0, safe-buffer@npm:~5.2.0": version: 5.2.1 resolution: "safe-buffer@npm:5.2.1" checksum: b99c4b41fdd67a6aaf280fcd05e9ffb0813654894223afb78a31f14a19ad220bba8aba1cb14eddce1fcfb037155fe6de4e861784eb434f7d11ed58d1e70dd491 @@ -3606,13 +2977,6 @@ __metadata: languageName: node linkType: hard -"sax@npm:>=0.6.0": - version: 1.3.0 - resolution: "sax@npm:1.3.0" - checksum: 238ab3a9ba8c8f8aaf1c5ea9120386391f6ee0af52f1a6a40bbb6df78241dd05d782f2359d614ac6aae08c4c4125208b456548a6cf68625aa4fe178486e63ecd - languageName: node - linkType: hard - "schema-utils@npm:^3.1.1, schema-utils@npm:^3.2.0": version: 3.3.0 resolution: "schema-utils@npm:3.3.0" @@ -3624,15 +2988,6 @@ __metadata: languageName: node linkType: hard -"semver@npm:^5.1.0": - version: 5.7.2 - resolution: "semver@npm:5.7.2" - bin: - semver: bin/semver - checksum: fb4ab5e0dd1c22ce0c937ea390b4a822147a9c53dbd2a9a0132f12fe382902beef4fbf12cf51bb955248d8d15874ce8cd89532569756384f994309825f10b686 - languageName: node - linkType: hard - "semver@npm:^7.3.4, semver@npm:^7.3.5, semver@npm:^7.3.7, semver@npm:^7.5.2": version: 7.5.4 resolution: "semver@npm:7.5.4" @@ -3701,17 +3056,6 @@ __metadata: languageName: node linkType: hard -"side-channel@npm:^1.0.4": - version: 1.0.4 - resolution: "side-channel@npm:1.0.4" - dependencies: - call-bind: ^1.0.0 - get-intrinsic: ^1.0.2 - object-inspect: ^1.9.0 - checksum: 351e41b947079c10bd0858364f32bb3a7379514c399edb64ab3dce683933483fc63fb5e4efe0a15a2e8a7e3c436b6a91736ddb8d8c6591b0460a24bb4a1ee245 - languageName: node - linkType: hard - "signal-exit@npm:^3.0.7": version: 3.0.7 resolution: "signal-exit@npm:3.0.7" @@ -3726,24 +3070,6 @@ __metadata: languageName: node linkType: hard -"simple-concat@npm:^1.0.0": - version: 1.0.1 - resolution: "simple-concat@npm:1.0.1" - checksum: 4d211042cc3d73a718c21ac6c4e7d7a0363e184be6a5ad25c8a1502e49df6d0a0253979e3d50dbdd3f60ef6c6c58d756b5d66ac1e05cda9cacd2e9fc59e3876a - languageName: node - linkType: hard - -"simple-get@npm:^4.0.0": - version: 4.0.1 - resolution: "simple-get@npm:4.0.1" - dependencies: - decompress-response: ^6.0.0 - once: ^1.3.1 - simple-concat: ^1.0.0 - checksum: e4132fd27cf7af230d853fa45c1b8ce900cb430dd0a3c6d3829649fe4f2b26574c803698076c4006450efb0fad2ba8c5455fbb5755d4b0a5ec42d4f12b31d27e - languageName: node - linkType: hard - "slash@npm:^3.0.0": version: 3.0.0 resolution: "slash@npm:3.0.0" @@ -3796,6 +3122,13 @@ __metadata: languageName: node linkType: hard +"source-map@npm:^0.7.4": + version: 0.7.4 + resolution: "source-map@npm:0.7.4" + checksum: 01cc5a74b1f0e1d626a58d36ad6898ea820567e87f18dfc9d24a9843a351aaa2ec09b87422589906d6ff1deed29693e176194dc88bcae7c9a852dc74b311dbf5 + languageName: node + linkType: hard + "ssri@npm:^10.0.0": version: 10.0.5 resolution: "ssri@npm:10.0.5" @@ -3870,13 +3203,6 @@ __metadata: languageName: node linkType: hard -"strip-json-comments@npm:~2.0.1": - version: 2.0.1 - resolution: "strip-json-comments@npm:2.0.1" - checksum: 1074ccb63270d32ca28edfb0a281c96b94dc679077828135141f27d52a5a398ef5e78bcf22809d23cadc2b81dfbe345eb5fd8699b385c8b1128907dec4a7d1e1 - languageName: node - linkType: hard - "supports-color@npm:8.1.1, supports-color@npm:^8.0.0": version: 8.1.1 resolution: "supports-color@npm:8.1.1" @@ -3886,15 +3212,6 @@ __metadata: languageName: node linkType: hard -"supports-color@npm:^5.3.0": - version: 5.5.0 - resolution: "supports-color@npm:5.5.0" - dependencies: - has-flag: ^3.0.0 - checksum: 95f6f4ba5afdf92f495b5a912d4abee8dcba766ae719b975c56c084f5004845f6f5a5f7769f52d53f40e21952a6d87411bafe34af4a01e65f9926002e38e1dac - languageName: node - linkType: hard - "supports-color@npm:^7.1.0": version: 7.2.0 resolution: "supports-color@npm:7.2.0" @@ -3918,31 +3235,6 @@ __metadata: languageName: node linkType: hard -"tar-fs@npm:^2.0.0": - version: 2.1.1 - resolution: "tar-fs@npm:2.1.1" - dependencies: - chownr: ^1.1.1 - mkdirp-classic: ^0.5.2 - pump: ^3.0.0 - tar-stream: ^2.1.4 - checksum: f5b9a70059f5b2969e65f037b4e4da2daf0fa762d3d232ffd96e819e3f94665dbbbe62f76f084f1acb4dbdcce16c6e4dac08d12ffc6d24b8d76720f4d9cf032d - languageName: node - linkType: hard - -"tar-stream@npm:^2.1.4": - version: 2.2.0 - resolution: "tar-stream@npm:2.2.0" - dependencies: - bl: ^4.0.3 - end-of-stream: ^1.4.1 - fs-constants: ^1.0.0 - inherits: ^2.0.3 - readable-stream: ^3.1.1 - checksum: 699831a8b97666ef50021c767f84924cfee21c142c2eb0e79c63254e140e6408d6d55a065a2992548e72b06de39237ef2b802b99e3ece93ca3904a37622a66f3 - languageName: node - linkType: hard - "tar@npm:^6.1.11, tar@npm:^6.1.2": version: 6.2.0 resolution: "tar@npm:6.2.0" @@ -3980,8 +3272,8 @@ __metadata: linkType: hard "terser@npm:^5.16.8": - version: 5.19.4 - resolution: "terser@npm:5.19.4" + version: 5.22.0 + resolution: "terser@npm:5.22.0" dependencies: "@jridgewell/source-map": ^0.3.3 acorn: ^8.8.2 @@ -3989,7 +3281,7 @@ __metadata: source-map-support: ~0.5.20 bin: terser: bin/terser - checksum: 09273ce7d3fbe8fea0ec2603ad1c06cc304838bdac42bbfe77835b0b0b6c4a894054575ca518fe16c95d5c401574a8c703f4fde97da45f1c972ea568e6ecafda + checksum: ee95981c54ebd381e0b7f5872c646e7a05543e53960f8e0c2f240863c368989d43a3ca80b7e9f691683c92ba199eb4b91d61785fef0b9ca4a887eb55866001f4 languageName: node linkType: hard @@ -4000,15 +3292,6 @@ __metadata: languageName: node linkType: hard -"tmp@npm:^0.2.1": - version: 0.2.1 - resolution: "tmp@npm:0.2.1" - dependencies: - rimraf: ^3.0.0 - checksum: 8b1214654182575124498c87ca986ac53dc76ff36e8f0e0b67139a8d221eaecfdec108c0e6ec54d76f49f1f72ab9325500b246f562b926f85bcdfca8bf35df9e - languageName: node - linkType: hard - "to-regex-range@npm:^5.0.1": version: 5.0.1 resolution: "to-regex-range@npm:5.0.1" @@ -4019,17 +3302,18 @@ __metadata: linkType: hard "ts-loader@npm:^9.4.3": - version: 9.4.4 - resolution: "ts-loader@npm:9.4.4" + version: 9.5.0 + resolution: "ts-loader@npm:9.5.0" dependencies: chalk: ^4.1.0 enhanced-resolve: ^5.0.0 micromatch: ^4.0.0 semver: ^7.3.4 + source-map: ^0.7.4 peerDependencies: typescript: "*" webpack: ^5.0.0 - checksum: 8e5e6b839b0edfa40d2156c880d88ccab58226894ea5978221bc48c7db3215e2e856bfd0093f148e925a2befc42d6c94cafa9a994a7da274541efaa916012b63 + checksum: a319575faa07145917a7050ac6be7e7f8d97745c6b6ecf8097ac51cebd2d459e8f8b2519d0c39066a065f4d73ae331d2aba9de3d62ea38bc59fd84395794d428 languageName: node linkType: hard @@ -4051,22 +3335,6 @@ __metadata: languageName: node linkType: hard -"tunnel-agent@npm:^0.6.0": - version: 0.6.0 - resolution: "tunnel-agent@npm:0.6.0" - dependencies: - safe-buffer: ^5.0.1 - checksum: 05f6510358f8afc62a057b8b692f05d70c1782b70db86d6a1e0d5e28a32389e52fa6e7707b6c5ecccacc031462e4bc35af85ecfe4bbc341767917b7cf6965711 - languageName: node - linkType: hard - -"tunnel@npm:0.0.6": - version: 0.0.6 - resolution: "tunnel@npm:0.0.6" - checksum: c362948df9ad34b649b5585e54ce2838fa583aa3037091aaed66793c65b423a264e5229f0d7e9a95513a795ac2bd4cb72cda7e89a74313f182c1e9ae0b0994fa - languageName: node - linkType: hard - "type-check@npm:^0.4.0, type-check@npm:~0.4.0": version: 0.4.0 resolution: "type-check@npm:0.4.0" @@ -4083,17 +3351,6 @@ __metadata: languageName: node linkType: hard -"typed-rest-client@npm:^1.8.4": - version: 1.8.11 - resolution: "typed-rest-client@npm:1.8.11" - dependencies: - qs: ^6.9.1 - tunnel: 0.0.6 - underscore: ^1.12.1 - checksum: baba87806381cb8e686e07dc0907bbc4a7588410f13f73f5a9fe662274d1961b84d0037bf2cb3966cb288ed6146b3350edcd896c42422f7dbc06625c347f3035 - languageName: node - linkType: hard - "typescript@npm:^5.1.3": version: 5.2.2 resolution: "typescript@npm:5.2.2" @@ -4114,17 +3371,10 @@ __metadata: languageName: node linkType: hard -"uc.micro@npm:^1.0.1, uc.micro@npm:^1.0.5": - version: 1.0.6 - resolution: "uc.micro@npm:1.0.6" - checksum: 6898bb556319a38e9cf175e3628689347bd26fec15fc6b29fa38e0045af63075ff3fea4cf1fdba9db46c9f0cbf07f2348cd8844889dd31ebd288c29fe0d27e7a - languageName: node - linkType: hard - -"underscore@npm:^1.12.1": - version: 1.13.6 - resolution: "underscore@npm:1.13.6" - checksum: d5cedd14a9d0d91dd38c1ce6169e4455bb931f0aaf354108e47bd46d3f2da7464d49b2171a5cf786d61963204a42d01ea1332a903b7342ad428deaafaf70ec36 +"undici-types@npm:~5.25.1": + version: 5.25.3 + resolution: "undici-types@npm:5.25.3" + checksum: ec9d2cc36520cbd9fbe3b3b6c682a87fe5be214699e1f57d1e3d9a2cb5be422e62735f06e0067dc325fd3dd7404c697e4d479f9147dc8a804e049e29f357f2ff languageName: node linkType: hard @@ -4146,9 +3396,9 @@ __metadata: languageName: node linkType: hard -"update-browserslist-db@npm:^1.0.11": - version: 1.0.11 - resolution: "update-browserslist-db@npm:1.0.11" +"update-browserslist-db@npm:^1.0.13": + version: 1.0.13 + resolution: "update-browserslist-db@npm:1.0.13" dependencies: escalade: ^3.1.1 picocolors: ^1.0.0 @@ -4156,7 +3406,7 @@ __metadata: browserslist: ">= 4.21.0" bin: update-browserslist-db: cli.js - checksum: b98327518f9a345c7cad5437afae4d2ae7d865f9779554baf2a200fdf4bac4969076b679b1115434bd6557376bdd37ca7583d0f9b8f8e302d7d4cc1e91b5f231 + checksum: 1e47d80182ab6e4ad35396ad8b61008ae2a1330221175d0abd37689658bdb61af9b705bfc41057fd16682474d79944fb2d86767c5ed5ae34b6276b9bed353322 languageName: node linkType: hard @@ -4169,13 +3419,6 @@ __metadata: languageName: node linkType: hard -"url-join@npm:^4.0.1": - version: 4.0.1 - resolution: "url-join@npm:4.0.1" - checksum: f74e868bf25dbc8be6a8d7237d4c36bb5b6c62c72e594d5ab1347fe91d6af7ccd9eb5d621e30152e4da45c2e9a26bec21390e911ab54a62d4d82e76028374ee5 - languageName: node - linkType: hard - "util-deprecate@npm:^1.0.1, util-deprecate@npm:~1.0.1": version: 1.0.2 resolution: "util-deprecate@npm:1.0.2" @@ -4211,6 +3454,13 @@ __metadata: languageName: node linkType: hard +"vscode-languageserver-textdocument@npm:^1.0.8": + version: 1.0.11 + resolution: "vscode-languageserver-textdocument@npm:1.0.11" + checksum: ea7cdc9d4ffaae5952071fa11d17d714215a76444e6936c9359f94b9ba3222a52a55edb5bd5928bd3e9712b900a9f175bb3565ec1c8923234fe3bd327584bafb + languageName: node + linkType: hard + "vscode-languageserver-types@npm:3.17.3": version: 3.17.3 resolution: "vscode-languageserver-types@npm:3.17.3" @@ -4218,6 +3468,17 @@ __metadata: languageName: node linkType: hard +"vscode-languageserver@npm:^8.1.0": + version: 8.1.0 + resolution: "vscode-languageserver@npm:8.1.0" + dependencies: + vscode-languageserver-protocol: 3.17.3 + bin: + installServerIntoExtension: bin/installServerIntoExtension + checksum: 38810619d0a7c587e7e84fc55d9897a0ac235b80a0a8c0ab1faf4283ec6ca1c25f80c0116bcc54aa99d0d9f202f69119fd8cb1264ffb5825eabf45af9bd6793d + languageName: node + linkType: hard + "watchpack@npm:^2.4.0": version: 2.4.0 resolution: "watchpack@npm:2.4.0" @@ -4261,12 +3522,13 @@ __metadata: linkType: hard "webpack-merge@npm:^5.7.3": - version: 5.9.0 - resolution: "webpack-merge@npm:5.9.0" + version: 5.10.0 + resolution: "webpack-merge@npm:5.10.0" dependencies: clone-deep: ^4.0.1 + flat: ^5.0.2 wildcard: ^2.0.0 - checksum: 64fe2c23aacc5f19684452a0e84ec02c46b990423aee6fcc5c18d7d471155bd14e9a6adb02bd3656eb3e0ac2532c8e97d69412ad14c97eeafe32fa6d10050872 + checksum: 1fe8bf5309add7298e1ac72fb3f2090e1dfa80c48c7e79fa48aa60b5961332c7d0d61efa8851acb805e6b91a4584537a347bc106e05e9aec87fa4f7088c62f2f languageName: node linkType: hard @@ -4278,8 +3540,8 @@ __metadata: linkType: hard "webpack@npm:^5.85.0": - version: 5.88.2 - resolution: "webpack@npm:5.88.2" + version: 5.89.0 + resolution: "webpack@npm:5.89.0" dependencies: "@types/eslint-scope": ^3.7.3 "@types/estree": ^1.0.0 @@ -4310,7 +3572,7 @@ __metadata: optional: true bin: webpack: bin/webpack.js - checksum: 79476a782da31a21f6dd38fbbd06b68da93baf6a62f0d08ca99222367f3b8668f5a1f2086b7bb78e23172e31fa6df6fa7ab09b25e827866c4fc4dc2b30443ce2 + checksum: 43fe0dbc30e168a685ef5a86759d5016a705f6563b39a240aa00826a80637d4a3deeb8062e709d6a4b05c63e796278244c84b04174704dc4a37bedb0f565c5ed languageName: node linkType: hard @@ -4377,23 +3639,6 @@ __metadata: languageName: node linkType: hard -"xml2js@npm:^0.5.0": - version: 0.5.0 - resolution: "xml2js@npm:0.5.0" - dependencies: - sax: ">=0.6.0" - xmlbuilder: ~11.0.0 - checksum: 1aa71d62e5bc2d89138e3929b9ea46459157727759cbc62ef99484b778641c0cd21fb637696c052d901a22f82d092a3e740a16b4ce218e81ac59b933535124ea - languageName: node - linkType: hard - -"xmlbuilder@npm:~11.0.0": - version: 11.0.1 - resolution: "xmlbuilder@npm:11.0.1" - checksum: 7152695e16f1a9976658215abab27e55d08b1b97bca901d58b048d2b6e106b5af31efccbdecf9b07af37c8377d8e7e821b494af10b3a68b0ff4ae60331b415b0 - languageName: node - linkType: hard - "y18n@npm:^5.0.5": version: 5.0.8 resolution: "y18n@npm:5.0.8" @@ -4449,25 +3694,6 @@ __metadata: languageName: node linkType: hard -"yauzl@npm:^2.3.1": - version: 2.10.0 - resolution: "yauzl@npm:2.10.0" - dependencies: - buffer-crc32: ~0.2.3 - fd-slicer: ~1.1.0 - checksum: 7f21fe0bbad6e2cb130044a5d1d0d5a0e5bf3d8d4f8c4e6ee12163ce798fee3de7388d22a7a0907f563ac5f9d40f8699a223d3d5c1718da90b0156da6904022b - languageName: node - linkType: hard - -"yazl@npm:^2.2.2": - version: 2.5.1 - resolution: "yazl@npm:2.5.1" - dependencies: - buffer-crc32: ~0.2.3 - checksum: daec5154b5485d8621bfea359e905ddca0b2f068430a4aa0a802bf5d67391157a383e0c2767acccbf5964264851da643bc740155a9458e2d8dce55b94c1cc2ed - languageName: node - linkType: hard - "yocto-queue@npm:^0.1.0": version: 0.1.0 resolution: "yocto-queue@npm:0.1.0" From 092d6eab86dccdf513a238149a1e71789c5d9e52 Mon Sep 17 00:00:00 2001 From: 0xMemoryGrinder <35138272+0xMemoryGrinder@users.noreply.github.com> Date: Fri, 20 Oct 2023 15:05:01 -0400 Subject: [PATCH 244/325] fix: reworked cd and renamed package.json scripts --- .github/workflows/cd.yml | 42 ++++++++++++++++++- .../workflows/detect-workspace-changes.yml | 14 ++----- toolchains/solidity/core/package.json | 10 ++--- toolchains/solidity/extension/package.json | 6 +-- toolchains/solidity/extension/src/server.ts | 2 +- toolchains/solidity/package.json | 8 ++-- 6 files changed, 56 insertions(+), 26 deletions(-) diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index fd559052..1ba4bd6e 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -26,14 +26,50 @@ jobs: with: from: ${{ github.sha }} since: ${{ needs.find-last-commit.outputs.commit }} + + publish-libraries: + runs-on: ubuntu-latest + needs: setup + strategy: + matrix: + workspace: ${{ fromJson(needs.setup.outputs.extensions)}} + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + - uses: actions/setup-node@v3 + with: + node-version: '18.16.1' + - id: setup-yarn + # Install yarn 3 & workspace-tools + run: | + corepack enable + corepack prepare yarn@stable --activate + yarn -v + yarn plugin import workspace-tools + + - name: Install dependencies + run: | + yarn install --immutable + + - name: Build + run: | + yarn workspace ${{ matrix.workspace.name }} build + + - name: Publish + run: yarn workspace ${{ matrix.workspace.name }} run publish + env: + CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} publish: runs-on: ubuntu-latest - needs: setup + needs: + - setup + - publish-libraries strategy: matrix: - workspace: ${{ fromJson(needs.setup.outputs.extensions)}} + workspace: ${{ fromJson(needs.setup.outputs.libraries)}} steps: - uses: actions/checkout@v3 with: @@ -117,6 +153,8 @@ jobs: run: yarn workspace ${{ matrix.workspace.name }} run publish ${{ github.ref_name == 'dev' && '--pre-release' || '' }} ${{ steps.tag.outputs.result }} env: VSCE_PAT: ${{ secrets.VSCE_PAT }} + CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} + #- name: Run latest-tag # uses: EndBug/latest-tag@latest diff --git a/.github/workflows/detect-workspace-changes.yml b/.github/workflows/detect-workspace-changes.yml index baab67a0..3b1c0381 100644 --- a/.github/workflows/detect-workspace-changes.yml +++ b/.github/workflows/detect-workspace-changes.yml @@ -81,11 +81,6 @@ jobs: } }) console.log(affectedWorkspaces) - const toolchainsWorkspaces = affectedWorkspaces.filter(workspace => { - return workspace.name.match(/^osmium-(?!manager)[^-\s]+$/) - }).map(workspace => ({ - name: workspace.name - })) const librariesWorkspaces = affectedWorkspaces.filter(workspace => { return workspace.name.startsWith('@osmium-libs/') }).map(workspace => ({ @@ -97,18 +92,18 @@ jobs: name: workspace.name })) const extensionsWorkspaces = affectedWorkspaces.filter(workspace => { - return workspace.name.match(/^osmium-(?:manager|(?!\w+-\w+-\w+)(?:\w+-\w+))$/) + return workspace.name.match(/^osmium-(?:manager|(?!\w+-\w+)(?:\w+))$/) }).map(workspace => ({ name: workspace.name })) const extensionsFoldersWorkspaces = affectedWorkspaces.filter(workspace => { - return workspace.name.match(/^osmium-\w+-\w+-\w+$/) + return workspace.name.match(/^osmium-\w+-\w+$/) }).map(workspace => ({ name: workspace.name })) const missingExtensionsWorkspaces = extensionsFoldersWorkspaces.map(workspaceFolder => { - const extensionName = workspaceFolder.name.split('-').slice(0, 3).join('-') + const extensionName = workspaceFolder.name.split('-').slice(0, 2).join('-') const extensionWorkspace = extensionsWorkspaces.find(workspace => { return workspace.name === extensionName }) @@ -129,7 +124,6 @@ jobs: return { affectedWorkspaces, - toolchainsWorkspaces, extensionsWorkspaces: completeExtensionsWorkspaces, librariesWorkspaces, packagesWorkspaces @@ -139,8 +133,6 @@ jobs: run: | echo "Affected workspaces: ${{ toJson(fromJson(steps.build-array.outputs.result).affectedWorkspaces) }}" echo "------------------------------------" - echo "Toolchains workspaces: ${{ toJson(fromJson(steps.build-array.outputs.result).toolchainsWorkspaces) }}" - echo "------------------------------------" echo "Extensions workspaces: ${{ toJson(fromJson(steps.build-array.outputs.result).extensionsWorkspaces) }}" echo "------------------------------------" echo "Libraries workspaces: ${{ toJson(fromJson(steps.build-array.outputs.result).librariesWorkspaces) }}" diff --git a/toolchains/solidity/core/package.json b/toolchains/solidity/core/package.json index 7b3c3865..8f4c0931 100644 --- a/toolchains/solidity/core/package.json +++ b/toolchains/solidity/core/package.json @@ -3,10 +3,10 @@ "version": "0.0.2", "license": "MIT", "scripts": { - "build": "cd crates/extension && make && cd ../..", - "lint": "cargo clippy -- -D warnings", - "format": "cargo fmt --check --all", - "test": "cargo test --workspace", - "publish": "cd crates/linter-lib && make publish && cd ../.." + "core:build": "cd crates/extension && make && cd ../..", + "core:lint": "cargo clippy -- -D warnings", + "core:format": "cargo fmt --check --all", + "core:test": "cargo test --workspace", + "core:publish": "cd crates/linter-lib && make publish && cd ../linter-cli && make publish && cd ../.." } } diff --git a/toolchains/solidity/extension/package.json b/toolchains/solidity/extension/package.json index cdfeb688..af5ca481 100644 --- a/toolchains/solidity/extension/package.json +++ b/toolchains/solidity/extension/package.json @@ -22,15 +22,15 @@ ] }, "scripts": { - "build": "yarn run compile", + "extension:build": "yarn run compile", "vscode:prepublish": "yarn run package", "compile": "webpack", "watch": "webpack --watch", "package": "webpack --mode production --devtool hidden-source-map", "compile-tests": "tsc -p . --outDir out", "watch-tests": "tsc -p . -w --outDir out", - "pretest": "yarn run compile-tests && yarn run compile && yarn run lint", - "lint": "eslint src --ext ts", + "pretest": "yarn run compile-tests && yarn run compile && yarn run extension:lint", + "extension:lint": "eslint src --ext ts", "test": "node ./out/test/runTest.js" }, "dependencies": { diff --git a/toolchains/solidity/extension/src/server.ts b/toolchains/solidity/extension/src/server.ts index 089410ea..2036bca3 100644 --- a/toolchains/solidity/extension/src/server.ts +++ b/toolchains/solidity/extension/src/server.ts @@ -16,7 +16,7 @@ import { TextDocumentSyncKind, InitializeResult } from 'vscode-languageserver/node'; -import {create_extension} from '../../out'; +import {create_extension} from '../dist'; // Create a connection for the server, using Node's IPC as a transport. // Also include all preview / proposed LSP features. diff --git a/toolchains/solidity/package.json b/toolchains/solidity/package.json index 9de4cac1..25d426f8 100644 --- a/toolchains/solidity/package.json +++ b/toolchains/solidity/package.json @@ -7,9 +7,9 @@ ], "license": "MIT", "scripts": { - "toolchain:build": "yarn workspaces foreach -p run build", - "toolchain:lint": "yarn workspaces foreach -p run lint", - "toolchain:test": "yarn workspaces foreach -p run test", - "toolchain:format": "yarn workspaces foreach -p run format" + "build": "cd core && yarn core:build && cd ../extension && yarn extension:build", + "lint": "cd core && yarn core:lint && cd ../extension && yarn extension:lint", + "test": "cd core && yarn core:test && cd ../extension && yarn extension:test", + "format": "cd core && yarn core:format && cd ../extension && yarn extension:format" } } From 1e2fcafb676e89358a7aa28e73f75d3190c587b9 Mon Sep 17 00:00:00 2001 From: 0xSwapFeeder Date: Fri, 20 Oct 2023 15:17:41 -0400 Subject: [PATCH 245/325] fix: tests call in extension package.json --- toolchains/solidity/extension/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/toolchains/solidity/extension/package.json b/toolchains/solidity/extension/package.json index af5ca481..1ab19dd7 100644 --- a/toolchains/solidity/extension/package.json +++ b/toolchains/solidity/extension/package.json @@ -31,7 +31,7 @@ "watch-tests": "tsc -p . -w --outDir out", "pretest": "yarn run compile-tests && yarn run compile && yarn run extension:lint", "extension:lint": "eslint src --ext ts", - "test": "node ./out/test/runTest.js" + "extension:test": "node ./out/test/runTest.js" }, "dependencies": { "vscode-languageclient": "^8.1.0", From 45e43d9ec8f09fffbbf878cc20dcdb12a3388375 Mon Sep 17 00:00:00 2001 From: 0xMemoryGrinder <35138272+0xMemoryGrinder@users.noreply.github.com> Date: Fri, 20 Oct 2023 15:20:04 -0400 Subject: [PATCH 246/325] fix: formated lib and install dependency in ci/cd pipelines --- .github/workflows/cd.yml | 1 + .github/workflows/ci.yml | 3 + libs/lsp-handler/src/connection.rs | 28 +- libs/lsp-handler/src/dispatcher.rs | 990 +++++++++++++++++------------ libs/lsp-handler/src/handler.rs | 2 +- libs/lsp-handler/src/jsonrpc.rs | 1 - libs/lsp-handler/src/lib.rs | 10 +- 7 files changed, 626 insertions(+), 409 deletions(-) diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index 1ba4bd6e..68b9ad79 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -144,6 +144,7 @@ jobs: - name: Install dependencies run: | yarn install --immutable + cargo install wasm-pack - name: Build run: | diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index af9d713b..bc1788b2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -122,6 +122,9 @@ jobs: corepack prepare yarn@stable --activate yarn plugin import workspace-tools + - name: install + run: cargo install wasm-pack + - name: Get yarn cache directory path id: yarn-cache-dir-path run: echo "dir=$(yarn config get cacheFolder)" >> $GITHUB_OUTPUT diff --git a/libs/lsp-handler/src/connection.rs b/libs/lsp-handler/src/connection.rs index 43718c38..15cea2de 100644 --- a/libs/lsp-handler/src/connection.rs +++ b/libs/lsp-handler/src/connection.rs @@ -3,10 +3,9 @@ use lsp_types::notification::*; use lsp_types::request::*; use lsp_types::*; use serde::Serialize; -use serde_json::{Value}; +use serde_json::Value; use std::fmt::Display; - use serde_wasm_bindgen::{from_value, to_value}; use tracing::error; use wasm_bindgen::JsValue; @@ -30,11 +29,14 @@ pub struct Connection { } impl Connection { - pub fn new(send_request_callback: js_sys::Function, send_notification_callback: js_sys::Function) -> Self { + pub fn new( + send_request_callback: js_sys::Function, + send_notification_callback: js_sys::Function, + ) -> Self { Self { inner: ConnectionInner { send_request_callback, - send_notification_callback + send_notification_callback, }, } } @@ -382,13 +384,15 @@ impl Connection { /// /// This notification will only be sent if the server is initialized. pub fn send_notification(&self, params: N::Params) - where - N: lsp_types::notification::Notification, + where + N: lsp_types::notification::Notification, { let inner = self.inner.clone(); let notification = to_value(&N::METHOD.to_string()).unwrap(); let param = to_value(¶ms).unwrap(); - let _ = inner.send_notification_callback.call2(&JsValue::NULL, ¬ification, ¶m); + let _ = inner + .send_notification_callback + .call2(&JsValue::NULL, ¬ification, ¶m); } /// Sends a custom request to the client. @@ -400,13 +404,15 @@ impl Connection { /// /// [read more]: https://microsoft.github.io/language-server-protocol/specification#initialize pub fn send_request(&self, params: R::Params) -> jsonrpc::Result - where - R: lsp_types::request::Request, + where + R: lsp_types::request::Request, { let inner = self.inner.clone(); let request = to_value(&R::METHOD.to_string()).unwrap(); let param = to_value(¶ms).unwrap(); - let res = inner.send_request_callback.call2(&JsValue::NULL, &request, ¶m); + let res = inner + .send_request_callback + .call2(&JsValue::NULL, &request, ¶m); let res = match res { Ok(res) => from_value::(res).unwrap(), @@ -416,7 +422,5 @@ impl Connection { }; Ok(res) - - } } diff --git a/libs/lsp-handler/src/dispatcher.rs b/libs/lsp-handler/src/dispatcher.rs index 59fad2c1..e1826e93 100644 --- a/libs/lsp-handler/src/dispatcher.rs +++ b/libs/lsp-handler/src/dispatcher.rs @@ -1,13 +1,36 @@ -use lsp_types::{CallHierarchyIncomingCall, CallHierarchyIncomingCallsParams, CallHierarchyItem, CallHierarchyOutgoingCall, CallHierarchyOutgoingCallsParams, CallHierarchyPrepareParams, CodeAction, CodeActionParams, CodeActionResponse, CodeLens, CodeLensParams, ColorInformation, ColorPresentation, ColorPresentationParams, CompletionItem, CompletionParams, CompletionResponse, CreateFilesParams, DeleteFilesParams, DidChangeConfigurationParams, DidChangeTextDocumentParams, DidChangeWatchedFilesParams, DidChangeWorkspaceFoldersParams, DidCloseTextDocumentParams, DidOpenTextDocumentParams, DidSaveTextDocumentParams, DocumentColorParams, DocumentDiagnosticParams, DocumentDiagnosticReportResult, DocumentFormattingParams, DocumentHighlight, DocumentHighlightParams, DocumentLink, DocumentLinkParams, DocumentOnTypeFormattingParams, DocumentRangeFormattingParams, DocumentSymbolParams, DocumentSymbolResponse, ExecuteCommandParams, FoldingRange, FoldingRangeParams, GotoDefinitionParams, GotoDefinitionResponse, Hover, HoverParams, InitializedParams, InitializeParams, InitializeResult, InlayHint, InlayHintParams, InlineValue, InlineValueParams, LinkedEditingRangeParams, LinkedEditingRanges, Location, Moniker, MonikerParams, PrepareRenameResponse, ReferenceParams, RenameFilesParams, RenameParams, SelectionRange, SelectionRangeParams, SemanticTokensDeltaParams, SemanticTokensFullDeltaResult, SemanticTokensParams, SemanticTokensRangeParams, SemanticTokensRangeResult, SemanticTokensResult, SignatureHelp, SignatureHelpParams, SymbolInformation, TextDocumentPositionParams, TextEdit, TypeHierarchyItem, TypeHierarchyPrepareParams, TypeHierarchySubtypesParams, TypeHierarchySupertypesParams, WillSaveTextDocumentParams, WorkspaceDiagnosticParams, WorkspaceDiagnosticReportResult, WorkspaceEdit, WorkspaceSymbol, WorkspaceSymbolParams, MessageType}; -use lsp_types::notification::*; -use lsp_types::request::*; -use serde_json::Value; -use wasm_bindgen::prelude::*; use crate::connection::Connection; use crate::handler::Handler; use crate::helpers::log; -use serde_wasm_bindgen::{from_value, to_value}; use crate::jsonrpc::{Error, ErrorCode, Result}; +use lsp_types::notification::*; +use lsp_types::request::*; +use lsp_types::{ + CallHierarchyIncomingCall, CallHierarchyIncomingCallsParams, CallHierarchyItem, + CallHierarchyOutgoingCall, CallHierarchyOutgoingCallsParams, CallHierarchyPrepareParams, + CodeAction, CodeActionParams, CodeActionResponse, CodeLens, CodeLensParams, ColorInformation, + ColorPresentation, ColorPresentationParams, CompletionItem, CompletionParams, + CompletionResponse, CreateFilesParams, DeleteFilesParams, DidChangeConfigurationParams, + DidChangeTextDocumentParams, DidChangeWatchedFilesParams, DidChangeWorkspaceFoldersParams, + DidCloseTextDocumentParams, DidOpenTextDocumentParams, DidSaveTextDocumentParams, + DocumentColorParams, DocumentDiagnosticParams, DocumentDiagnosticReportResult, + DocumentFormattingParams, DocumentHighlight, DocumentHighlightParams, DocumentLink, + DocumentLinkParams, DocumentOnTypeFormattingParams, DocumentRangeFormattingParams, + DocumentSymbolParams, DocumentSymbolResponse, ExecuteCommandParams, FoldingRange, + FoldingRangeParams, GotoDefinitionParams, GotoDefinitionResponse, Hover, HoverParams, + InitializeParams, InitializeResult, InitializedParams, InlayHint, InlayHintParams, InlineValue, + InlineValueParams, LinkedEditingRangeParams, LinkedEditingRanges, Location, MessageType, + Moniker, MonikerParams, PrepareRenameResponse, ReferenceParams, RenameFilesParams, + RenameParams, SelectionRange, SelectionRangeParams, SemanticTokensDeltaParams, + SemanticTokensFullDeltaResult, SemanticTokensParams, SemanticTokensRangeParams, + SemanticTokensRangeResult, SemanticTokensResult, SignatureHelp, SignatureHelpParams, + SymbolInformation, TextDocumentPositionParams, TextEdit, TypeHierarchyItem, + TypeHierarchyPrepareParams, TypeHierarchySubtypesParams, TypeHierarchySupertypesParams, + WillSaveTextDocumentParams, WorkspaceDiagnosticParams, WorkspaceDiagnosticReportResult, + WorkspaceEdit, WorkspaceSymbol, WorkspaceSymbolParams, +}; +use serde_json::Value; +use serde_wasm_bindgen::{from_value, to_value}; +use wasm_bindgen::prelude::*; #[wasm_bindgen] pub struct Dispatcher { @@ -23,7 +46,10 @@ impl Dispatcher { } } - pub fn setup(&mut self, creators: Vec) where F: FnOnce(Connection) -> Box { + pub fn setup(&mut self, creators: Vec) + where + F: FnOnce(Connection) -> Box, + { for creator in creators { self.handlers.push(creator(self.connection.clone())); } @@ -34,7 +60,11 @@ impl Dispatcher { impl Dispatcher { #[allow(unused_variables)] #[wasm_bindgen(js_class = Dispatcher, js_name = onRequest)] - pub async fn on_request(&mut self, method: &str, params: JsValue) -> std::result::Result { + pub async fn on_request( + &mut self, + method: &str, + params: JsValue, + ) -> std::result::Result { log(method); match method { @@ -42,835 +72,821 @@ impl Dispatcher { let params: InitializeParams = from_value(params).unwrap(); let res = self.initialize(params); let result = match res { - Ok(init) => { + Ok(init) => { let js = to_value(&init).unwrap(); js_sys::Promise::resolve(&js) - }, - Err(err) => { + } + Err(err) => { let js = to_value(&err).unwrap(); js_sys::Promise::reject(&js) - }, + } }; let result = wasm_bindgen_futures::JsFuture::from(result).await?; Ok(result) - }, + } Shutdown::METHOD => { let params: InitializeParams = from_value(params).unwrap(); let res = self.initialize(params); let result = match res { - Ok(init) => { + Ok(init) => { let js = to_value(&init).unwrap(); js_sys::Promise::resolve(&js) - }, - Err(err) => { + } + Err(err) => { let js = to_value(&err).unwrap(); js_sys::Promise::reject(&js) - }, + } }; let result = wasm_bindgen_futures::JsFuture::from(result).await?; Ok(result) - }, + } WillSaveWaitUntil::METHOD => { let params: WillSaveTextDocumentParams = from_value(params).unwrap(); let res = self.will_save_wait_until(params); let result = match res { - Ok(init) => { + Ok(init) => { let js = to_value(&init).unwrap(); js_sys::Promise::resolve(&js) - }, - Err(err) => { + } + Err(err) => { let js = to_value(&err).unwrap(); js_sys::Promise::reject(&js) - }, + } }; let result = wasm_bindgen_futures::JsFuture::from(result).await?; Ok(result) - }, + } GotoDeclaration::METHOD => { let params: GotoDeclarationParams = from_value(params).unwrap(); let res = self.goto_declaration(params); let result = match res { - Ok(init) => { + Ok(init) => { let js = to_value(&init).unwrap(); js_sys::Promise::resolve(&js) - }, - Err(err) => { + } + Err(err) => { let js = to_value(&err).unwrap(); js_sys::Promise::reject(&js) - }, + } }; let result = wasm_bindgen_futures::JsFuture::from(result).await?; Ok(result) - }, + } GotoDefinition::METHOD => { let params: GotoDefinitionParams = from_value(params).unwrap(); let res = self.goto_definition(params); let result = match res { - Ok(init) => { + Ok(init) => { let js = to_value(&init).unwrap(); js_sys::Promise::resolve(&js) - }, - Err(err) => { + } + Err(err) => { let js = to_value(&err).unwrap(); js_sys::Promise::reject(&js) - }, + } }; let result = wasm_bindgen_futures::JsFuture::from(result).await?; Ok(result) - }, + } GotoTypeDefinition::METHOD => { let params: GotoTypeDefinitionParams = from_value(params).unwrap(); let res = self.goto_type_definition(params); let result = match res { - Ok(init) => { + Ok(init) => { let js = to_value(&init).unwrap(); js_sys::Promise::resolve(&js) - }, - Err(err) => { + } + Err(err) => { let js = to_value(&err).unwrap(); js_sys::Promise::reject(&js) - }, + } }; let result = wasm_bindgen_futures::JsFuture::from(result).await?; Ok(result) - }, + } GotoImplementation::METHOD => { let params: GotoImplementationParams = from_value(params).unwrap(); let res = self.goto_implementation(params); let result = match res { - Ok(init) => { + Ok(init) => { let js = to_value(&init).unwrap(); js_sys::Promise::resolve(&js) - }, - Err(err) => { + } + Err(err) => { let js = to_value(&err).unwrap(); js_sys::Promise::reject(&js) - }, + } }; let result = wasm_bindgen_futures::JsFuture::from(result).await?; Ok(result) - }, + } References::METHOD => { let params: ReferenceParams = from_value(params).unwrap(); let res = self.references(params); let result = match res { - Ok(init) => { + Ok(init) => { let js = to_value(&init).unwrap(); js_sys::Promise::resolve(&js) - }, - Err(err) => { + } + Err(err) => { let js = to_value(&err).unwrap(); js_sys::Promise::reject(&js) - }, + } }; let result = wasm_bindgen_futures::JsFuture::from(result).await?; Ok(result) - }, + } CallHierarchyPrepare::METHOD => { let params: CallHierarchyPrepareParams = from_value(params).unwrap(); let res = self.prepare_call_hierarchy(params); let result = match res { - Ok(init) => { + Ok(init) => { let js = to_value(&init).unwrap(); js_sys::Promise::resolve(&js) - }, - Err(err) => { + } + Err(err) => { let js = to_value(&err).unwrap(); js_sys::Promise::reject(&js) - }, + } }; let result = wasm_bindgen_futures::JsFuture::from(result).await?; Ok(result) - }, + } CallHierarchyIncomingCalls::METHOD => { let params: CallHierarchyIncomingCallsParams = from_value(params).unwrap(); let res = self.incoming_calls(params); let result = match res { - Ok(init) => { + Ok(init) => { let js = to_value(&init).unwrap(); js_sys::Promise::resolve(&js) - }, - Err(err) => { + } + Err(err) => { let js = to_value(&err).unwrap(); js_sys::Promise::reject(&js) - }, + } }; let result = wasm_bindgen_futures::JsFuture::from(result).await?; - Ok(result) - }, + } CallHierarchyOutgoingCalls::METHOD => { let params: CallHierarchyOutgoingCallsParams = from_value(params).unwrap(); let res = self.outgoing_calls(params); let result = match res { - Ok(init) => { + Ok(init) => { let js = to_value(&init).unwrap(); js_sys::Promise::resolve(&js) - }, - Err(err) => { + } + Err(err) => { let js = to_value(&err).unwrap(); js_sys::Promise::reject(&js) - }, + } }; let result = wasm_bindgen_futures::JsFuture::from(result).await?; Ok(result) - }, + } TypeHierarchyPrepare::METHOD => { let params: TypeHierarchyPrepareParams = from_value(params).unwrap(); let res = self.prepare_type_hierarchy(params); let result = match res { - Ok(init) => { + Ok(init) => { let js = to_value(&init).unwrap(); js_sys::Promise::resolve(&js) - }, - Err(err) => { + } + Err(err) => { let js = to_value(&err).unwrap(); js_sys::Promise::reject(&js) - }, + } }; let result = wasm_bindgen_futures::JsFuture::from(result).await?; Ok(result) - }, + } TypeHierarchySupertypes::METHOD => { let params: TypeHierarchySupertypesParams = from_value(params).unwrap(); let res = self.supertypes(params); let result = match res { - Ok(init) => { + Ok(init) => { let js = to_value(&init).unwrap(); js_sys::Promise::resolve(&js) - }, - Err(err) => { + } + Err(err) => { let js = to_value(&err).unwrap(); js_sys::Promise::reject(&js) - }, + } }; let result = wasm_bindgen_futures::JsFuture::from(result).await?; Ok(result) - }, + } TypeHierarchySubtypes::METHOD => { let params: TypeHierarchySubtypesParams = from_value(params).unwrap(); let res = self.subtypes(params); let result = match res { - Ok(init) => { + Ok(init) => { let js = to_value(&init).unwrap(); js_sys::Promise::resolve(&js) - }, - Err(err) => { + } + Err(err) => { let js = to_value(&err).unwrap(); js_sys::Promise::reject(&js) - }, + } }; let result = wasm_bindgen_futures::JsFuture::from(result).await?; Ok(result) - }, + } DocumentHighlightRequest::METHOD => { let params: DocumentHighlightParams = from_value(params).unwrap(); let res = self.document_highlight(params); let result = match res { - Ok(init) => { + Ok(init) => { let js = to_value(&init).unwrap(); js_sys::Promise::resolve(&js) - }, - Err(err) => { + } + Err(err) => { let js = to_value(&err).unwrap(); js_sys::Promise::reject(&js) - }, + } }; let result = wasm_bindgen_futures::JsFuture::from(result).await?; Ok(result) - }, + } DocumentLinkRequest::METHOD => { let params: DocumentLinkParams = from_value(params).unwrap(); let res = self.document_link(params); let result = match res { - Ok(init) => { + Ok(init) => { let js = to_value(&init).unwrap(); js_sys::Promise::resolve(&js) - }, - Err(err) => { + } + Err(err) => { let js = to_value(&err).unwrap(); js_sys::Promise::reject(&js) - }, + } }; let result = wasm_bindgen_futures::JsFuture::from(result).await?; Ok(result) - }, + } DocumentLinkResolve::METHOD => { let params: DocumentLink = from_value(params).unwrap(); let res = self.document_link_resolve(params); let result = match res { - Ok(init) => { + Ok(init) => { let js = to_value(&init).unwrap(); js_sys::Promise::resolve(&js) - }, - Err(err) => { + } + Err(err) => { let js = to_value(&err).unwrap(); js_sys::Promise::reject(&js) - }, + } }; let result = wasm_bindgen_futures::JsFuture::from(result).await?; Ok(result) - }, + } HoverRequest::METHOD => { let params: HoverParams = from_value(params).unwrap(); let res = self.hover(params); let result = match res { - Ok(init) => { + Ok(init) => { let js = to_value(&init).unwrap(); js_sys::Promise::resolve(&js) - }, - Err(err) => { + } + Err(err) => { let js = to_value(&err).unwrap(); js_sys::Promise::reject(&js) - }, + } }; let result = wasm_bindgen_futures::JsFuture::from(result).await?; - Ok(result) - }, + } CodeLensRequest::METHOD => { let params: CodeLensParams = from_value(params).unwrap(); let res = self.code_lens(params); let result = match res { - Ok(init) => { + Ok(init) => { let js = to_value(&init).unwrap(); js_sys::Promise::resolve(&js) - }, - Err(err) => { + } + Err(err) => { let js = to_value(&err).unwrap(); js_sys::Promise::reject(&js) - }, + } }; let result = wasm_bindgen_futures::JsFuture::from(result).await?; - Ok(result) - }, + } CodeLensResolve::METHOD => { let params: CodeLens = from_value(params).unwrap(); let res = self.code_lens_resolve(params); let result = match res { - Ok(init) => { + Ok(init) => { let js = to_value(&init).unwrap(); js_sys::Promise::resolve(&js) - }, - Err(err) => { + } + Err(err) => { let js = to_value(&err).unwrap(); js_sys::Promise::reject(&js) - }, + } }; let result = wasm_bindgen_futures::JsFuture::from(result).await?; - Ok(result) - }, + } FoldingRangeRequest::METHOD => { let params: FoldingRangeParams = from_value(params).unwrap(); let res = self.folding_range(params); let result = match res { - Ok(init) => { + Ok(init) => { let js = to_value(&init).unwrap(); js_sys::Promise::resolve(&js) - }, - Err(err) => { + } + Err(err) => { let js = to_value(&err).unwrap(); js_sys::Promise::reject(&js) - }, + } }; let result = wasm_bindgen_futures::JsFuture::from(result).await?; - Ok(result) - }, + } SelectionRangeRequest::METHOD => { let params: SelectionRangeParams = from_value(params).unwrap(); let res = self.selection_range(params); let result = match res { - Ok(init) => { + Ok(init) => { let js = to_value(&init).unwrap(); js_sys::Promise::resolve(&js) - }, - Err(err) => { + } + Err(err) => { let js = to_value(&err).unwrap(); js_sys::Promise::reject(&js) - }, + } }; let result = wasm_bindgen_futures::JsFuture::from(result).await?; - Ok(result) - }, + } DocumentSymbolRequest::METHOD => { let params: DocumentSymbolParams = from_value(params).unwrap(); let res = self.document_symbol(params); let result = match res { - Ok(init) => { + Ok(init) => { let js = to_value(&init).unwrap(); js_sys::Promise::resolve(&js) - }, - Err(err) => { + } + Err(err) => { let js = to_value(&err).unwrap(); js_sys::Promise::reject(&js) - }, + } }; let result = wasm_bindgen_futures::JsFuture::from(result).await?; - Ok(result) - }, + } SemanticTokensFullRequest::METHOD => { let params: SemanticTokensParams = from_value(params).unwrap(); let res = self.semantic_tokens_full(params); let result = match res { - Ok(init) => { + Ok(init) => { let js = to_value(&init).unwrap(); js_sys::Promise::resolve(&js) - }, - Err(err) => { + } + Err(err) => { let js = to_value(&err).unwrap(); js_sys::Promise::reject(&js) - }, + } }; let result = wasm_bindgen_futures::JsFuture::from(result).await?; - Ok(result) - }, + } SemanticTokensFullDeltaRequest::METHOD => { let params: SemanticTokensDeltaParams = from_value(params).unwrap(); let res = self.semantic_tokens_full_delta(params); let result = match res { - Ok(init) => { + Ok(init) => { let js = to_value(&init).unwrap(); js_sys::Promise::resolve(&js) - }, - Err(err) => { + } + Err(err) => { let js = to_value(&err).unwrap(); js_sys::Promise::reject(&js) - }, + } }; let result = wasm_bindgen_futures::JsFuture::from(result).await?; - Ok(result) - }, + } SemanticTokensRangeRequest::METHOD => { let params: SemanticTokensRangeParams = from_value(params).unwrap(); let res = self.semantic_tokens_range(params); let result = match res { - Ok(init) => { + Ok(init) => { let js = to_value(&init).unwrap(); js_sys::Promise::resolve(&js) - }, - Err(err) => { + } + Err(err) => { let js = to_value(&err).unwrap(); js_sys::Promise::reject(&js) - }, + } }; let result = wasm_bindgen_futures::JsFuture::from(result).await?; - Ok(result) - }, + } InlineValueRequest::METHOD => { let params: InlineValueParams = from_value(params).unwrap(); let res = self.inline_value(params); let result = match res { - Ok(init) => { + Ok(init) => { let js = to_value(&init).unwrap(); js_sys::Promise::resolve(&js) - }, - Err(err) => { + } + Err(err) => { let js = to_value(&err).unwrap(); js_sys::Promise::reject(&js) - }, + } }; let result = wasm_bindgen_futures::JsFuture::from(result).await?; - + Ok(result) - }, + } InlayHintRequest::METHOD => { let params: InlayHintParams = from_value(params).unwrap(); let res = self.inlay_hint(params); let result = match res { - Ok(init) => { + Ok(init) => { let js = to_value(&init).unwrap(); js_sys::Promise::resolve(&js) - }, - Err(err) => { + } + Err(err) => { let js = to_value(&err).unwrap(); js_sys::Promise::reject(&js) - }, + } }; let result = wasm_bindgen_futures::JsFuture::from(result).await?; - + Ok(result) - }, + } InlayHintResolveRequest::METHOD => { let params: InlayHint = from_value(params).unwrap(); let res = self.inlay_hint_resolve(params); let result = match res { - Ok(init) => { + Ok(init) => { let js = to_value(&init).unwrap(); js_sys::Promise::resolve(&js) - }, - Err(err) => { + } + Err(err) => { let js = to_value(&err).unwrap(); js_sys::Promise::reject(&js) - }, + } }; let result = wasm_bindgen_futures::JsFuture::from(result).await?; - + Ok(result) - }, + } MonikerRequest::METHOD => { let params: MonikerParams = from_value(params).unwrap(); let res = self.moniker(params); let result = match res { - Ok(init) => { + Ok(init) => { let js = to_value(&init).unwrap(); js_sys::Promise::resolve(&js) - }, - Err(err) => { + } + Err(err) => { let js = to_value(&err).unwrap(); js_sys::Promise::reject(&js) - }, + } }; let result = wasm_bindgen_futures::JsFuture::from(result).await?; - + Ok(result) - }, + } Completion::METHOD => { let params: CompletionParams = from_value(params).unwrap(); let res = self.completion(params); let result = match res { - Ok(init) => { + Ok(init) => { let js = to_value(&init).unwrap(); js_sys::Promise::resolve(&js) - }, - Err(err) => { + } + Err(err) => { let js = to_value(&err).unwrap(); js_sys::Promise::reject(&js) - }, + } }; let result = wasm_bindgen_futures::JsFuture::from(result).await?; - + Ok(result) - }, + } DocumentDiagnosticRequest::METHOD => { let params: DocumentDiagnosticParams = from_value(params).unwrap(); let res = self.diagnostic(params); let result = match res { - Ok(init) => { + Ok(init) => { let js = to_value(&init).unwrap(); js_sys::Promise::resolve(&js) - }, - Err(err) => { + } + Err(err) => { let js = to_value(&err).unwrap(); js_sys::Promise::reject(&js) - }, + } }; let result = wasm_bindgen_futures::JsFuture::from(result).await?; - + Ok(result) - }, + } WorkspaceDiagnosticRequest::METHOD => { let params: WorkspaceDiagnosticParams = from_value(params).unwrap(); let res = self.workspace_diagnostic(params); let result = match res { - Ok(init) => { + Ok(init) => { let js = to_value(&init).unwrap(); js_sys::Promise::resolve(&js) - }, - Err(err) => { + } + Err(err) => { let js = to_value(&err).unwrap(); js_sys::Promise::reject(&js) - }, + } }; let result = wasm_bindgen_futures::JsFuture::from(result).await?; - Ok(result) - }, + } SignatureHelpRequest::METHOD => { let params: SignatureHelpParams = from_value(params).unwrap(); let res = self.signature_help(params); let result = match res { - Ok(init) => { + Ok(init) => { let js = to_value(&init).unwrap(); js_sys::Promise::resolve(&js) - }, - Err(err) => { + } + Err(err) => { let js = to_value(&err).unwrap(); js_sys::Promise::reject(&js) - }, + } }; let result = wasm_bindgen_futures::JsFuture::from(result).await?; - Ok(result) - }, + } CodeActionRequest::METHOD => { let params: CodeActionParams = from_value(params).unwrap(); let res = self.code_action(params); let result = match res { - Ok(init) => { + Ok(init) => { let js = to_value(&init).unwrap(); js_sys::Promise::resolve(&js) - }, - Err(err) => { + } + Err(err) => { let js = to_value(&err).unwrap(); js_sys::Promise::reject(&js) - }, + } }; let result = wasm_bindgen_futures::JsFuture::from(result).await?; - Ok(result) - }, + } CodeActionResolveRequest::METHOD => { let params: CodeAction = from_value(params).unwrap(); let res = self.code_action_resolve(params); let result = match res { - Ok(init) => { + Ok(init) => { let js = to_value(&init).unwrap(); js_sys::Promise::resolve(&js) - }, - Err(err) => { + } + Err(err) => { let js = to_value(&err).unwrap(); js_sys::Promise::reject(&js) - }, + } }; let result = wasm_bindgen_futures::JsFuture::from(result).await?; - Ok(result) - }, + } DocumentColor::METHOD => { let params: DocumentColorParams = from_value(params).unwrap(); let res = self.document_color(params); let result = match res { - Ok(init) => { + Ok(init) => { let js = to_value(&init).unwrap(); js_sys::Promise::resolve(&js) - }, - Err(err) => { + } + Err(err) => { let js = to_value(&err).unwrap(); js_sys::Promise::reject(&js) - }, + } }; let result = wasm_bindgen_futures::JsFuture::from(result).await?; Ok(result) - }, + } ColorPresentationRequest::METHOD => { let params: ColorPresentationParams = from_value(params).unwrap(); let res = self.color_presentation(params); let result = match res { - Ok(init) => { + Ok(init) => { let js = to_value(&init).unwrap(); js_sys::Promise::resolve(&js) - }, - Err(err) => { + } + Err(err) => { let js = to_value(&err).unwrap(); js_sys::Promise::reject(&js) - }, + } }; let result = wasm_bindgen_futures::JsFuture::from(result).await?; Ok(result) - }, + } Formatting::METHOD => { let params: DocumentFormattingParams = from_value(params).unwrap(); let res = self.formatting(params); let result = match res { - Ok(init) => { + Ok(init) => { let js = to_value(&init).unwrap(); js_sys::Promise::resolve(&js) - }, - Err(err) => { + } + Err(err) => { let js = to_value(&err).unwrap(); js_sys::Promise::reject(&js) - }, + } }; let result = wasm_bindgen_futures::JsFuture::from(result).await?; - + Ok(result) - }, + } RangeFormatting::METHOD => { let params: DocumentRangeFormattingParams = from_value(params).unwrap(); let res = self.range_formatting(params); let result = match res { - Ok(init) => { + Ok(init) => { let js = to_value(&init).unwrap(); js_sys::Promise::resolve(&js) - }, - Err(err) => { + } + Err(err) => { let js = to_value(&err).unwrap(); js_sys::Promise::reject(&js) - }, + } }; let result = wasm_bindgen_futures::JsFuture::from(result).await?; - + Ok(result) - }, + } OnTypeFormatting::METHOD => { let params: DocumentOnTypeFormattingParams = from_value(params).unwrap(); let res = self.on_type_formatting(params); let result = match res { - Ok(init) => { + Ok(init) => { let js = to_value(&init).unwrap(); js_sys::Promise::resolve(&js) - }, - Err(err) => { + } + Err(err) => { let js = to_value(&err).unwrap(); js_sys::Promise::reject(&js) - }, + } }; let result = wasm_bindgen_futures::JsFuture::from(result).await?; - + Ok(result) - }, + } Rename::METHOD => { let params: RenameParams = from_value(params).unwrap(); let res = self.rename(params); let result = match res { - Ok(init) => { + Ok(init) => { let js = to_value(&init).unwrap(); js_sys::Promise::resolve(&js) - }, - Err(err) => { + } + Err(err) => { let js = to_value(&err).unwrap(); js_sys::Promise::reject(&js) - }, + } }; let result = wasm_bindgen_futures::JsFuture::from(result).await?; - + Ok(result) - }, + } PrepareRenameRequest::METHOD => { let params: TextDocumentPositionParams = from_value(params).unwrap(); let res = self.prepare_rename(params); let result = match res { - Ok(init) => { + Ok(init) => { let js = to_value(&init).unwrap(); js_sys::Promise::resolve(&js) - }, - Err(err) => { + } + Err(err) => { let js = to_value(&err).unwrap(); js_sys::Promise::reject(&js) - }, + } }; let result = wasm_bindgen_futures::JsFuture::from(result).await?; - + Ok(result) - }, + } LinkedEditingRange::METHOD => { let params: LinkedEditingRangeParams = from_value(params).unwrap(); let res = self.linked_editing_range(params); let result = match res { - Ok(init) => { + Ok(init) => { let js = to_value(&init).unwrap(); js_sys::Promise::resolve(&js) - }, - Err(err) => { + } + Err(err) => { let js = to_value(&err).unwrap(); js_sys::Promise::reject(&js) - }, + } }; let result = wasm_bindgen_futures::JsFuture::from(result).await?; - + Ok(result) - }, + } WorkspaceSymbolRequest::METHOD => { let params: WorkspaceSymbolParams = from_value(params).unwrap(); let res = self.symbol(params); let result = match res { - Ok(init) => { + Ok(init) => { let js = to_value(&init).unwrap(); js_sys::Promise::resolve(&js) - }, - Err(err) => { + } + Err(err) => { let js = to_value(&err).unwrap(); js_sys::Promise::reject(&js) - }, + } }; let result = wasm_bindgen_futures::JsFuture::from(result).await?; Ok(result) - }, + } WorkspaceSymbolResolve::METHOD => { let params: WorkspaceSymbol = from_value(params).unwrap(); let res = self.symbol_resolve(params); let result = match res { - Ok(init) => { + Ok(init) => { let js = to_value(&init).unwrap(); js_sys::Promise::resolve(&js) - }, - Err(err) => { + } + Err(err) => { let js = to_value(&err).unwrap(); js_sys::Promise::reject(&js) - }, + } }; let result = wasm_bindgen_futures::JsFuture::from(result).await?; Ok(result) - }, + } WillDeleteFiles::METHOD => { let params: DeleteFilesParams = from_value(params).unwrap(); let res = self.will_delete_files(params); let result = match res { - Ok(init) => { + Ok(init) => { let js = to_value(&init).unwrap(); js_sys::Promise::resolve(&js) - }, - Err(err) => { + } + Err(err) => { let js = to_value(&err).unwrap(); js_sys::Promise::reject(&js) - }, + } }; let result = wasm_bindgen_futures::JsFuture::from(result).await?; Ok(result) - }, + } WillCreateFiles::METHOD => { let params: CreateFilesParams = from_value(params).unwrap(); let res = self.will_create_files(params); let result = match res { - Ok(init) => { + Ok(init) => { let js = to_value(&init).unwrap(); js_sys::Promise::resolve(&js) - }, - Err(err) => { + } + Err(err) => { let js = to_value(&err).unwrap(); js_sys::Promise::reject(&js) - }, + } }; let result = wasm_bindgen_futures::JsFuture::from(result).await?; Ok(result) - }, + } WillRenameFiles::METHOD => { let params: RenameFilesParams = from_value(params).unwrap(); let res = self.will_rename_files(params); let result = match res { - Ok(init) => { + Ok(init) => { let js = to_value(&init).unwrap(); js_sys::Promise::resolve(&js) - }, - Err(err) => { + } + Err(err) => { let js = to_value(&err).unwrap(); js_sys::Promise::reject(&js) - }, + } }; let result = wasm_bindgen_futures::JsFuture::from(result).await?; Ok(result) @@ -879,28 +895,29 @@ impl Dispatcher { let params: ExecuteCommandParams = from_value(params).unwrap(); let res = self.execute_command(params); let result = match res { - Ok(init) => { + Ok(init) => { let js = to_value(&init).unwrap(); js_sys::Promise::resolve(&js) - }, - Err(err) => { + } + Err(err) => { let js = to_value(&err).unwrap(); js_sys::Promise::reject(&js) - }, + } }; let result = wasm_bindgen_futures::JsFuture::from(result).await?; Ok(result) - }, - _ => { - Err(JsValue::from_str("Method not dispatched")) } - + _ => Err(JsValue::from_str("Method not dispatched")), } } #[allow(unused_variables)] #[wasm_bindgen(js_class = Dispatcher, js_name = onNotification)] - pub async fn on_notification(&mut self, method: &str, params: JsValue) -> std::result::Result<(), JsValue> { + pub async fn on_notification( + &mut self, + method: &str, + params: JsValue, + ) -> std::result::Result<(), JsValue> { log(method); match method { @@ -908,203 +925,327 @@ impl Dispatcher { let params: InitializedParams = from_value(params).unwrap(); self.initialized(params); Ok(()) - }, + } DidOpenTextDocument::METHOD => { let params: DidOpenTextDocumentParams = from_value(params).unwrap(); self.did_open(params); Ok(()) - }, + } DidChangeTextDocument::METHOD => { let params: DidChangeTextDocumentParams = from_value(params).unwrap(); self.did_change(params); Ok(()) - }, + } WillSaveTextDocument::METHOD => { let params: WillSaveTextDocumentParams = from_value(params).unwrap(); self.will_save(params); Ok(()) - }, + } DidSaveTextDocument::METHOD => { let params: DidSaveTextDocumentParams = from_value(params).unwrap(); self.did_save(params); Ok(()) - }, + } DidCloseTextDocument::METHOD => { let params: DidCloseTextDocumentParams = from_value(params).unwrap(); self.did_close(params); Ok(()) - }, + } DidChangeConfiguration::METHOD => { let params: DidChangeConfigurationParams = from_value(params).unwrap(); self.did_change_configuration(params); Ok(()) - }, + } DidChangeWatchedFiles::METHOD => { let params: DidChangeWatchedFilesParams = from_value(params).unwrap(); self.did_change_watched_files(params); Ok(()) - }, + } DidChangeWorkspaceFolders::METHOD => { let params: DidChangeWorkspaceFoldersParams = from_value(params).unwrap(); self.did_change_workspace_folders(params); Ok(()) - }, + } DidRenameFiles::METHOD => { let params: RenameFilesParams = from_value(params).unwrap(); self.did_rename_files(params); Ok(()) - }, + } DidCreateFiles::METHOD => { let params: CreateFilesParams = from_value(params).unwrap(); self.did_create_files(params); Ok(()) - }, + } DidDeleteFiles::METHOD => { let params: DeleteFilesParams = from_value(params).unwrap(); self.did_delete_files(params); Ok(()) - }, - - _ => { - Err(JsValue::from_str("Method not dispatched")) } + + _ => Err(JsValue::from_str("Method not dispatched")), } } } - - impl Handler for Dispatcher { fn initialize(&self, params: InitializeParams) -> Result { let mut res = vec![]; - self.connection.log_message(MessageType::INFO, "Dispatcher initializing"); + self.connection + .log_message(MessageType::INFO, "Dispatcher initializing"); for handler in &self.handlers { res.push(handler.initialize(params.clone())); } let res: Vec = res.iter().filter_map(|i| i.clone().ok()).collect(); let mut result = InitializeResult::default(); - let tmp_cap = res.iter().filter(|i| i.capabilities.position_encoding.is_some()).collect::>(); + let tmp_cap = res + .iter() + .filter(|i| i.capabilities.position_encoding.is_some()) + .collect::>(); if !tmp_cap.is_empty() { - result.capabilities.position_encoding = tmp_cap[0].capabilities.position_encoding.clone(); + result.capabilities.position_encoding = + tmp_cap[0].capabilities.position_encoding.clone(); } - let tmp_cap = res.iter().filter(|i| i.capabilities.text_document_sync.is_some()).collect::>(); + let tmp_cap = res + .iter() + .filter(|i| i.capabilities.text_document_sync.is_some()) + .collect::>(); if !tmp_cap.is_empty() { - result.capabilities.text_document_sync = tmp_cap[0].capabilities.text_document_sync.clone(); + result.capabilities.text_document_sync = + tmp_cap[0].capabilities.text_document_sync.clone(); } - let tmp_cap = res.iter().filter(|i| i.capabilities.selection_range_provider.is_some()).collect::>(); + let tmp_cap = res + .iter() + .filter(|i| i.capabilities.selection_range_provider.is_some()) + .collect::>(); if !tmp_cap.is_empty() { - result.capabilities.selection_range_provider = tmp_cap[0].capabilities.selection_range_provider.clone(); + result.capabilities.selection_range_provider = + tmp_cap[0].capabilities.selection_range_provider.clone(); } - let tmp_cap = res.iter().filter(|i| i.capabilities.hover_provider.is_some()).collect::>(); + let tmp_cap = res + .iter() + .filter(|i| i.capabilities.hover_provider.is_some()) + .collect::>(); if !tmp_cap.is_empty() { result.capabilities.hover_provider = tmp_cap[0].capabilities.hover_provider.clone(); } - let tmp_cap = res.iter().filter(|i| i.capabilities.completion_provider.is_some()).collect::>(); + let tmp_cap = res + .iter() + .filter(|i| i.capabilities.completion_provider.is_some()) + .collect::>(); if !tmp_cap.is_empty() { - result.capabilities.completion_provider = tmp_cap[0].capabilities.completion_provider.clone(); + result.capabilities.completion_provider = + tmp_cap[0].capabilities.completion_provider.clone(); } - let tmp_cap = res.iter().filter(|i| i.capabilities.signature_help_provider.is_some()).collect::>(); + let tmp_cap = res + .iter() + .filter(|i| i.capabilities.signature_help_provider.is_some()) + .collect::>(); if !tmp_cap.is_empty() { - result.capabilities.signature_help_provider = tmp_cap[0].capabilities.signature_help_provider.clone(); + result.capabilities.signature_help_provider = + tmp_cap[0].capabilities.signature_help_provider.clone(); } - let tmp_cap = res.iter().filter(|i| i.capabilities.definition_provider.is_some()).collect::>(); + let tmp_cap = res + .iter() + .filter(|i| i.capabilities.definition_provider.is_some()) + .collect::>(); if !tmp_cap.is_empty() { - result.capabilities.definition_provider = tmp_cap[0].capabilities.definition_provider.clone(); + result.capabilities.definition_provider = + tmp_cap[0].capabilities.definition_provider.clone(); } - let tmp_cap = res.iter().filter(|i| i.capabilities.type_definition_provider.is_some()).collect::>(); + let tmp_cap = res + .iter() + .filter(|i| i.capabilities.type_definition_provider.is_some()) + .collect::>(); if !tmp_cap.is_empty() { - result.capabilities.type_definition_provider = tmp_cap[0].capabilities.type_definition_provider.clone(); + result.capabilities.type_definition_provider = + tmp_cap[0].capabilities.type_definition_provider.clone(); } - let tmp_cap = res.iter().filter(|i| i.capabilities.implementation_provider.is_some()).collect::>(); + let tmp_cap = res + .iter() + .filter(|i| i.capabilities.implementation_provider.is_some()) + .collect::>(); if !tmp_cap.is_empty() { - result.capabilities.implementation_provider = tmp_cap[0].capabilities.implementation_provider.clone(); + result.capabilities.implementation_provider = + tmp_cap[0].capabilities.implementation_provider.clone(); } - let tmp_cap = res.iter().filter(|i| i.capabilities.references_provider.is_some()).collect::>(); + let tmp_cap = res + .iter() + .filter(|i| i.capabilities.references_provider.is_some()) + .collect::>(); if !tmp_cap.is_empty() { - result.capabilities.references_provider = tmp_cap[0].capabilities.references_provider.clone(); + result.capabilities.references_provider = + tmp_cap[0].capabilities.references_provider.clone(); } - let tmp_cap = res.iter().filter(|i| i.capabilities.document_highlight_provider.is_some()).collect::>(); + let tmp_cap = res + .iter() + .filter(|i| i.capabilities.document_highlight_provider.is_some()) + .collect::>(); if !tmp_cap.is_empty() { - result.capabilities.document_highlight_provider = tmp_cap[0].capabilities.document_highlight_provider.clone(); + result.capabilities.document_highlight_provider = + tmp_cap[0].capabilities.document_highlight_provider.clone(); } - let tmp_cap = res.iter().filter(|i| i.capabilities.document_symbol_provider.is_some()).collect::>(); + let tmp_cap = res + .iter() + .filter(|i| i.capabilities.document_symbol_provider.is_some()) + .collect::>(); if !tmp_cap.is_empty() { - result.capabilities.document_symbol_provider = tmp_cap[0].capabilities.document_symbol_provider.clone(); + result.capabilities.document_symbol_provider = + tmp_cap[0].capabilities.document_symbol_provider.clone(); } - let tmp_cap = res.iter().filter(|i| i.capabilities.workspace_symbol_provider.is_some()).collect::>(); + let tmp_cap = res + .iter() + .filter(|i| i.capabilities.workspace_symbol_provider.is_some()) + .collect::>(); if !tmp_cap.is_empty() { - result.capabilities.workspace_symbol_provider = tmp_cap[0].capabilities.workspace_symbol_provider.clone(); + result.capabilities.workspace_symbol_provider = + tmp_cap[0].capabilities.workspace_symbol_provider.clone(); } - let tmp_cap = res.iter().filter(|i| i.capabilities.code_action_provider.is_some()).collect::>(); + let tmp_cap = res + .iter() + .filter(|i| i.capabilities.code_action_provider.is_some()) + .collect::>(); if !tmp_cap.is_empty() { - result.capabilities.code_action_provider = tmp_cap[0].capabilities.code_action_provider.clone(); + result.capabilities.code_action_provider = + tmp_cap[0].capabilities.code_action_provider.clone(); } - let tmp_cap = res.iter().filter(|i| i.capabilities.code_lens_provider.is_some()).collect::>(); + let tmp_cap = res + .iter() + .filter(|i| i.capabilities.code_lens_provider.is_some()) + .collect::>(); if !tmp_cap.is_empty() { result.capabilities.code_lens_provider = tmp_cap[0].capabilities.code_lens_provider; } - let tmp_cap = res.iter().filter(|i| i.capabilities.document_formatting_provider.is_some()).collect::>(); + let tmp_cap = res + .iter() + .filter(|i| i.capabilities.document_formatting_provider.is_some()) + .collect::>(); if !tmp_cap.is_empty() { - result.capabilities.document_formatting_provider = tmp_cap[0].capabilities.document_formatting_provider.clone(); + result.capabilities.document_formatting_provider = + tmp_cap[0].capabilities.document_formatting_provider.clone(); } - let tmp_cap = res.iter().filter(|i| i.capabilities.document_range_formatting_provider.is_some()).collect::>(); + let tmp_cap = res + .iter() + .filter(|i| i.capabilities.document_range_formatting_provider.is_some()) + .collect::>(); if !tmp_cap.is_empty() { - result.capabilities.document_range_formatting_provider = tmp_cap[0].capabilities.document_range_formatting_provider.clone(); - } - let tmp_cap = res.iter().filter(|i| i.capabilities.document_on_type_formatting_provider.is_some()).collect::>(); + result.capabilities.document_range_formatting_provider = tmp_cap[0] + .capabilities + .document_range_formatting_provider + .clone(); + } + let tmp_cap = res + .iter() + .filter(|i| { + i.capabilities + .document_on_type_formatting_provider + .is_some() + }) + .collect::>(); if !tmp_cap.is_empty() { - result.capabilities.document_on_type_formatting_provider = tmp_cap[0].capabilities.document_on_type_formatting_provider.clone(); - } - let tmp_cap = res.iter().filter(|i| i.capabilities.rename_provider.is_some()).collect::>(); + result.capabilities.document_on_type_formatting_provider = tmp_cap[0] + .capabilities + .document_on_type_formatting_provider + .clone(); + } + let tmp_cap = res + .iter() + .filter(|i| i.capabilities.rename_provider.is_some()) + .collect::>(); if !tmp_cap.is_empty() { result.capabilities.rename_provider = tmp_cap[0].capabilities.rename_provider.clone(); } - let tmp_cap = res.iter().filter(|i| i.capabilities.document_link_provider.is_some()).collect::>(); + let tmp_cap = res + .iter() + .filter(|i| i.capabilities.document_link_provider.is_some()) + .collect::>(); if !tmp_cap.is_empty() { - result.capabilities.document_link_provider = tmp_cap[0].capabilities.document_link_provider.clone(); + result.capabilities.document_link_provider = + tmp_cap[0].capabilities.document_link_provider.clone(); } - let tmp_cap = res.iter().filter(|i| i.capabilities.color_provider.is_some()).collect::>(); + let tmp_cap = res + .iter() + .filter(|i| i.capabilities.color_provider.is_some()) + .collect::>(); if !tmp_cap.is_empty() { result.capabilities.color_provider = tmp_cap[0].capabilities.color_provider.clone(); } - let tmp_cap = res.iter().filter(|i| i.capabilities.folding_range_provider.is_some()).collect::>(); + let tmp_cap = res + .iter() + .filter(|i| i.capabilities.folding_range_provider.is_some()) + .collect::>(); if !tmp_cap.is_empty() { - result.capabilities.folding_range_provider = tmp_cap[0].capabilities.folding_range_provider.clone(); + result.capabilities.folding_range_provider = + tmp_cap[0].capabilities.folding_range_provider.clone(); } - let tmp_cap = res.iter().filter(|i| i.capabilities.declaration_provider.is_some()).collect::>(); + let tmp_cap = res + .iter() + .filter(|i| i.capabilities.declaration_provider.is_some()) + .collect::>(); if !tmp_cap.is_empty() { - result.capabilities.declaration_provider = tmp_cap[0].capabilities.declaration_provider.clone(); + result.capabilities.declaration_provider = + tmp_cap[0].capabilities.declaration_provider.clone(); } - let tmp_cap = res.iter().filter(|i| i.capabilities.workspace.is_some()).collect::>(); + let tmp_cap = res + .iter() + .filter(|i| i.capabilities.workspace.is_some()) + .collect::>(); if !tmp_cap.is_empty() { result.capabilities.workspace = tmp_cap[0].capabilities.workspace.clone(); } - let tmp_cap = res.iter().filter(|i| i.capabilities.call_hierarchy_provider.is_some()).collect::>(); + let tmp_cap = res + .iter() + .filter(|i| i.capabilities.call_hierarchy_provider.is_some()) + .collect::>(); if !tmp_cap.is_empty() { - result.capabilities.call_hierarchy_provider = tmp_cap[0].capabilities.call_hierarchy_provider; + result.capabilities.call_hierarchy_provider = + tmp_cap[0].capabilities.call_hierarchy_provider; } - let tmp_cap = res.iter().filter(|i| i.capabilities.semantic_tokens_provider.is_some()).collect::>(); + let tmp_cap = res + .iter() + .filter(|i| i.capabilities.semantic_tokens_provider.is_some()) + .collect::>(); if !tmp_cap.is_empty() { - result.capabilities.semantic_tokens_provider = tmp_cap[0].capabilities.semantic_tokens_provider.clone(); + result.capabilities.semantic_tokens_provider = + tmp_cap[0].capabilities.semantic_tokens_provider.clone(); } - let tmp_cap = res.iter().filter(|i| i.capabilities.moniker_provider.is_some()).collect::>(); + let tmp_cap = res + .iter() + .filter(|i| i.capabilities.moniker_provider.is_some()) + .collect::>(); if !tmp_cap.is_empty() { result.capabilities.moniker_provider = tmp_cap[0].capabilities.moniker_provider.clone(); } - let tmp_cap = res.iter().filter(|i| i.capabilities.linked_editing_range_provider.is_some()).collect::>(); + let tmp_cap = res + .iter() + .filter(|i| i.capabilities.linked_editing_range_provider.is_some()) + .collect::>(); if !tmp_cap.is_empty() { - result.capabilities.linked_editing_range_provider = tmp_cap[0].capabilities.linked_editing_range_provider.clone(); - } - let tmp_cap = res.iter().filter(|i| i.capabilities.inline_value_provider.is_some()).collect::>(); + result.capabilities.linked_editing_range_provider = tmp_cap[0] + .capabilities + .linked_editing_range_provider + .clone(); + } + let tmp_cap = res + .iter() + .filter(|i| i.capabilities.inline_value_provider.is_some()) + .collect::>(); if !tmp_cap.is_empty() { - result.capabilities.inline_value_provider = tmp_cap[0].capabilities.inline_value_provider.clone(); + result.capabilities.inline_value_provider = + tmp_cap[0].capabilities.inline_value_provider.clone(); } - let tmp_cap = res.iter().filter(|i| i.capabilities.inlay_hint_provider.is_some()).collect::>(); + let tmp_cap = res + .iter() + .filter(|i| i.capabilities.inlay_hint_provider.is_some()) + .collect::>(); if !tmp_cap.is_empty() { - result.capabilities.inlay_hint_provider = tmp_cap[0].capabilities.inlay_hint_provider.clone(); + result.capabilities.inlay_hint_provider = + tmp_cap[0].capabilities.inlay_hint_provider.clone(); } - let tmp_cap = res.iter().filter(|i| i.capabilities.experimental.is_some()).collect::>(); + let tmp_cap = res + .iter() + .filter(|i| i.capabilities.experimental.is_some()) + .collect::>(); if !tmp_cap.is_empty() { result.capabilities.experimental = tmp_cap[0].capabilities.experimental.clone(); } @@ -1112,7 +1253,8 @@ impl Handler for Dispatcher { } fn initialized(&self, params: InitializedParams) { - self.connection.log_message(MessageType::INFO, "Dispatcher initialized"); + self.connection + .log_message(MessageType::INFO, "Dispatcher initialized"); for handler in &self.handlers { handler.initialized(params); } @@ -1120,7 +1262,7 @@ impl Handler for Dispatcher { fn shutdown(&self) -> Result<()> { for handler in &self.handlers { - let _ =handler.shutdown(); + let _ = handler.shutdown(); } Ok(()) } @@ -1143,7 +1285,10 @@ impl Handler for Dispatcher { } } - fn will_save_wait_until(&self, params: WillSaveTextDocumentParams) -> Result>> { + fn will_save_wait_until( + &self, + params: WillSaveTextDocumentParams, + ) -> Result>> { let mut text_edit: Vec = vec![]; for handler in &self.handlers { let res = handler.will_save_wait_until(params.clone()); @@ -1166,7 +1311,10 @@ impl Handler for Dispatcher { } } - fn goto_declaration(&self, params: GotoDeclarationParams) -> Result> { + fn goto_declaration( + &self, + params: GotoDeclarationParams, + ) -> Result> { for handler in &self.handlers { let res = handler.goto_declaration(params.clone()); if let Ok(Some(_)) = res { @@ -1176,7 +1324,10 @@ impl Handler for Dispatcher { Ok(None) } - fn goto_definition(&self, params: GotoDefinitionParams) -> Result> { + fn goto_definition( + &self, + params: GotoDefinitionParams, + ) -> Result> { for handler in &self.handlers { let res = handler.goto_definition(params.clone()); if let Ok(Some(_)) = res { @@ -1186,7 +1337,10 @@ impl Handler for Dispatcher { Ok(None) } - fn goto_type_definition(&self, params: GotoTypeDefinitionParams) -> Result> { + fn goto_type_definition( + &self, + params: GotoTypeDefinitionParams, + ) -> Result> { for handler in &self.handlers { let res = handler.goto_type_definition(params.clone()); if let Ok(Some(_)) = res { @@ -1196,7 +1350,10 @@ impl Handler for Dispatcher { Ok(None) } - fn goto_implementation(&self, params: GotoImplementationParams) -> Result> { + fn goto_implementation( + &self, + params: GotoImplementationParams, + ) -> Result> { for handler in &self.handlers { let res = handler.goto_implementation(params.clone()); if let Ok(Some(_)) = res { @@ -1217,7 +1374,10 @@ impl Handler for Dispatcher { Ok(Some(text_edit)) } - fn prepare_call_hierarchy(&self, params: CallHierarchyPrepareParams) -> Result>> { + fn prepare_call_hierarchy( + &self, + params: CallHierarchyPrepareParams, + ) -> Result>> { let mut text_edit: Vec = vec![]; for handler in &self.handlers { let res = handler.prepare_call_hierarchy(params.clone()); @@ -1228,7 +1388,10 @@ impl Handler for Dispatcher { Ok(Some(text_edit)) } - fn incoming_calls(&self, params: CallHierarchyIncomingCallsParams) -> Result>> { + fn incoming_calls( + &self, + params: CallHierarchyIncomingCallsParams, + ) -> Result>> { let mut text_edit: Vec = vec![]; for handler in &self.handlers { let res = handler.incoming_calls(params.clone()); @@ -1239,7 +1402,10 @@ impl Handler for Dispatcher { Ok(Some(text_edit)) } - fn outgoing_calls(&self, params: CallHierarchyOutgoingCallsParams) -> Result>> { + fn outgoing_calls( + &self, + params: CallHierarchyOutgoingCallsParams, + ) -> Result>> { let mut text_edit: Vec = vec![]; for handler in &self.handlers { let res = handler.outgoing_calls(params.clone()); @@ -1250,7 +1416,10 @@ impl Handler for Dispatcher { Ok(Some(text_edit)) } - fn prepare_type_hierarchy(&self, params: TypeHierarchyPrepareParams) -> Result>> { + fn prepare_type_hierarchy( + &self, + params: TypeHierarchyPrepareParams, + ) -> Result>> { let mut text_edit: Vec = vec![]; for handler in &self.handlers { let res = handler.prepare_type_hierarchy(params.clone()); @@ -1261,7 +1430,10 @@ impl Handler for Dispatcher { Ok(Some(text_edit)) } - fn supertypes(&self, params: TypeHierarchySupertypesParams) -> Result>> { + fn supertypes( + &self, + params: TypeHierarchySupertypesParams, + ) -> Result>> { let mut text_edit: Vec = vec![]; for handler in &self.handlers { let res = handler.supertypes(params.clone()); @@ -1272,7 +1444,10 @@ impl Handler for Dispatcher { Ok(Some(text_edit)) } - fn subtypes(&self, params: TypeHierarchySubtypesParams) -> Result>> { + fn subtypes( + &self, + params: TypeHierarchySubtypesParams, + ) -> Result>> { let mut text_edit: Vec = vec![]; for handler in &self.handlers { let res = handler.subtypes(params.clone()); @@ -1283,7 +1458,10 @@ impl Handler for Dispatcher { Ok(Some(text_edit)) } - fn document_highlight(&self, params: DocumentHighlightParams) -> Result>> { + fn document_highlight( + &self, + params: DocumentHighlightParams, + ) -> Result>> { let mut text_edit: Vec = vec![]; for handler in &self.handlers { let res = handler.document_highlight(params.clone()); @@ -1313,7 +1491,6 @@ impl Handler for Dispatcher { } } Err(Error::new(ErrorCode::MethodNotFound)) - } fn hover(&self, params: HoverParams) -> Result> { @@ -1369,7 +1546,10 @@ impl Handler for Dispatcher { Ok(Some(text_edit)) } - fn document_symbol(&self, params: DocumentSymbolParams) -> Result> { + fn document_symbol( + &self, + params: DocumentSymbolParams, + ) -> Result> { for handler in &self.handlers { let res = handler.document_symbol(params.clone()); if let Ok(Some(_)) = res { @@ -1379,7 +1559,10 @@ impl Handler for Dispatcher { Ok(None) } - fn semantic_tokens_full(&self, params: SemanticTokensParams) -> Result> { + fn semantic_tokens_full( + &self, + params: SemanticTokensParams, + ) -> Result> { for handler in &self.handlers { let res = handler.semantic_tokens_full(params.clone()); if let Ok(Some(_)) = res { @@ -1389,7 +1572,10 @@ impl Handler for Dispatcher { Ok(None) } - fn semantic_tokens_full_delta(&self, params: SemanticTokensDeltaParams) -> Result> { + fn semantic_tokens_full_delta( + &self, + params: SemanticTokensDeltaParams, + ) -> Result> { for handler in &self.handlers { let res = handler.semantic_tokens_full_delta(params.clone()); if let Ok(Some(_)) = res { @@ -1399,7 +1585,10 @@ impl Handler for Dispatcher { Ok(None) } - fn semantic_tokens_range(&self, params: SemanticTokensRangeParams) -> Result> { + fn semantic_tokens_range( + &self, + params: SemanticTokensRangeParams, + ) -> Result> { for handler in &self.handlers { let res = handler.semantic_tokens_range(params.clone()); if let Ok(Some(_)) = res { @@ -1472,7 +1661,10 @@ impl Handler for Dispatcher { Err(Error::new(ErrorCode::MethodNotFound)) } - fn diagnostic(&self, params: DocumentDiagnosticParams) -> Result { + fn diagnostic( + &self, + params: DocumentDiagnosticParams, + ) -> Result { for handler in &self.handlers { let res = handler.diagnostic(params.clone()); if res.is_ok() { @@ -1482,7 +1674,10 @@ impl Handler for Dispatcher { Err(Error::new(ErrorCode::MethodNotFound)) } - fn workspace_diagnostic(&self, params: WorkspaceDiagnosticParams) -> Result { + fn workspace_diagnostic( + &self, + params: WorkspaceDiagnosticParams, + ) -> Result { for handler in &self.handlers { let res = handler.workspace_diagnostic(params.clone()); if res.is_ok() { @@ -1533,7 +1728,10 @@ impl Handler for Dispatcher { Ok(text_edit) } - fn color_presentation(&self, params: ColorPresentationParams) -> Result> { + fn color_presentation( + &self, + params: ColorPresentationParams, + ) -> Result> { let mut text_edit: Vec = vec![]; for handler in &self.handlers { let res = handler.color_presentation(params.clone()); @@ -1555,7 +1753,10 @@ impl Handler for Dispatcher { Ok(Some(text_edit)) } - fn range_formatting(&self, params: DocumentRangeFormattingParams) -> Result>> { + fn range_formatting( + &self, + params: DocumentRangeFormattingParams, + ) -> Result>> { let mut text_edit: Vec = vec![]; for handler in &self.handlers { let res = handler.range_formatting(params.clone()); @@ -1566,7 +1767,10 @@ impl Handler for Dispatcher { Ok(Some(text_edit)) } - fn on_type_formatting(&self, params: DocumentOnTypeFormattingParams) -> Result>> { + fn on_type_formatting( + &self, + params: DocumentOnTypeFormattingParams, + ) -> Result>> { let mut text_edit: Vec = vec![]; for handler in &self.handlers { let res = handler.on_type_formatting(params.clone()); @@ -1587,7 +1791,10 @@ impl Handler for Dispatcher { Ok(None) } - fn prepare_rename(&self, params: TextDocumentPositionParams) -> Result> { + fn prepare_rename( + &self, + params: TextDocumentPositionParams, + ) -> Result> { for handler in &self.handlers { let res = handler.prepare_rename(params.clone()); if let Ok(Some(_)) = res { @@ -1597,7 +1804,10 @@ impl Handler for Dispatcher { Ok(None) } - fn linked_editing_range(&self, params: LinkedEditingRangeParams) -> Result> { + fn linked_editing_range( + &self, + params: LinkedEditingRangeParams, + ) -> Result> { for handler in &self.handlers { let res = handler.linked_editing_range(params.clone()); if let Ok(Some(_)) = res { @@ -1703,4 +1913,4 @@ impl Handler for Dispatcher { } Ok(None) } -} \ No newline at end of file +} diff --git a/libs/lsp-handler/src/handler.rs b/libs/lsp-handler/src/handler.rs index 394081c3..5f879336 100644 --- a/libs/lsp-handler/src/handler.rs +++ b/libs/lsp-handler/src/handler.rs @@ -1204,4 +1204,4 @@ pub trait Handler { // TODO: Add `work_done_progress_cancel()` here (since 3.15.0) when supported by `tower-lsp`. // https://github.com/ebkalderon/tower-lsp/issues/176 -} \ No newline at end of file +} diff --git a/libs/lsp-handler/src/jsonrpc.rs b/libs/lsp-handler/src/jsonrpc.rs index e8dbf6f0..c75d84bd 100644 --- a/libs/lsp-handler/src/jsonrpc.rs +++ b/libs/lsp-handler/src/jsonrpc.rs @@ -1,4 +1,3 @@ mod error; - pub use self::error::{Error, ErrorCode, Result}; diff --git a/libs/lsp-handler/src/lib.rs b/libs/lsp-handler/src/lib.rs index b541dedd..bf672cd9 100644 --- a/libs/lsp-handler/src/lib.rs +++ b/libs/lsp-handler/src/lib.rs @@ -1,12 +1,12 @@ -mod handler; -mod dispatcher; mod connection; +mod dispatcher; +mod handler; mod jsonrpc; mod helpers; -pub use handler::Handler; -pub use dispatcher::Dispatcher; pub use connection::Connection; +pub use dispatcher::Dispatcher; +pub use handler::Handler; pub use jsonrpc::{Error, ErrorCode, Result}; -pub use lsp_types; \ No newline at end of file +pub use lsp_types; From f15ac52e2c1abcf7f44148636427ea3abe122a16 Mon Sep 17 00:00:00 2001 From: 0xMemoryGrinder <35138272+0xMemoryGrinder@users.noreply.github.com> Date: Fri, 20 Oct 2023 15:22:46 -0400 Subject: [PATCH 247/325] chore(solidity/core): ran format --- .../solidity/core/crates/extension/src/lib.rs | 15 +++--- .../core/crates/linter-cli/src/main.rs | 2 +- .../core/crates/linter-lib/src/linter.rs | 7 ++- .../best_practises/function_max_lines.rs | 8 ++- .../best_practises/one_contract_per_file.rs | 3 +- .../rules/best_practises/payable_fallback.rs | 4 +- .../src/rules/best_practises/reason_string.rs | 5 +- .../rules/naming/contract_name_camelcase.rs | 3 +- .../src/rules/naming/event_name_camelcase.rs | 13 +++-- .../rules/naming/foundry_test_functions.rs | 31 ++++++++---- .../src/rules/naming/func_name_mixedcase.rs | 7 ++- .../rules/naming/func_param_name_mixedcase.rs | 7 ++- .../rules/naming/named_parameters_mapping.rs | 4 +- .../naming/private_vars_leading_underscore.rs | 6 ++- .../src/rules/naming/var_name_mixedcase.rs | 8 ++- .../linter-lib/src/rules/order/ordering.rs | 49 ++++++++++++++----- .../rules/order/visibility_modifier_order.rs | 4 +- .../src/rules/security/avoid_tx_origin.rs | 4 +- .../src/rules/security/func_visibility.rs | 12 +++-- .../core/crates/linter-server/src/lib.rs | 40 +++++++-------- 20 files changed, 157 insertions(+), 75 deletions(-) diff --git a/toolchains/solidity/core/crates/extension/src/lib.rs b/toolchains/solidity/core/crates/extension/src/lib.rs index 5a8f23db..f41ca686 100644 --- a/toolchains/solidity/core/crates/extension/src/lib.rs +++ b/toolchains/solidity/core/crates/extension/src/lib.rs @@ -1,15 +1,16 @@ -use osmium_libs_lsp_handler::{Dispatcher, Connection}; -use wasm_bindgen::prelude::*; use linter_server::create_linter; +use osmium_libs_lsp_handler::{Connection, Dispatcher}; +use wasm_bindgen::prelude::*; #[wasm_bindgen] -pub fn create_extension(send_request: js_sys::Function, send_notification: js_sys::Function) -> Dispatcher { - let creators = vec![ - create_linter - ]; +pub fn create_extension( + send_request: js_sys::Function, + send_notification: js_sys::Function, +) -> Dispatcher { + let creators = vec![create_linter]; let connection = Connection::new(send_request, send_notification); let mut dispatcher = Dispatcher::new(connection); dispatcher.setup(creators); dispatcher -} \ No newline at end of file +} diff --git a/toolchains/solidity/core/crates/linter-cli/src/main.rs b/toolchains/solidity/core/crates/linter-cli/src/main.rs index 4bb4f06c..2aba0631 100644 --- a/toolchains/solidity/core/crates/linter-cli/src/main.rs +++ b/toolchains/solidity/core/crates/linter-cli/src/main.rs @@ -147,4 +147,4 @@ fn main() -> Result<(), SolidHunterError> { } } Ok(()) -} \ No newline at end of file +} diff --git a/toolchains/solidity/core/crates/linter-lib/src/linter.rs b/toolchains/solidity/core/crates/linter-lib/src/linter.rs index 13f060f2..8e18632a 100644 --- a/toolchains/solidity/core/crates/linter-lib/src/linter.rs +++ b/toolchains/solidity/core/crates/linter-lib/src/linter.rs @@ -68,7 +68,12 @@ impl SolidLinter { false } - fn _add_file(&mut self, path: &str, ast: osmium_libs_solidity_ast_extractor::File, content: &str) { + fn _add_file( + &mut self, + path: &str, + ast: osmium_libs_solidity_ast_extractor::File, + content: &str, + ) { if self._file_exists(path) { for file in &mut self.files { if file.path == path { diff --git a/toolchains/solidity/core/crates/linter-lib/src/rules/best_practises/function_max_lines.rs b/toolchains/solidity/core/crates/linter-lib/src/rules/best_practises/function_max_lines.rs index b2df7b2d..52465efd 100644 --- a/toolchains/solidity/core/crates/linter-lib/src/rules/best_practises/function_max_lines.rs +++ b/toolchains/solidity/core/crates/linter-lib/src/rules/best_practises/function_max_lines.rs @@ -20,8 +20,12 @@ impl RuleType for FunctionMaxLines { fn diagnose(&self, _file: &SolidFile, _files: &[SolidFile]) -> Vec { let mut res = Vec::new(); - for contract in osmium_libs_solidity_ast_extractor::retriever::retrieve_contract_nodes(&_file.data) { - for function in osmium_libs_solidity_ast_extractor::retriever::retrieve_functions_nodes(&contract) { + for contract in + osmium_libs_solidity_ast_extractor::retriever::retrieve_contract_nodes(&_file.data) + { + for function in + osmium_libs_solidity_ast_extractor::retriever::retrieve_functions_nodes(&contract) + { let report = check_function_lines(&function, self.number_max_lines); if let Some(report) = report { let start = report.start.line; diff --git a/toolchains/solidity/core/crates/linter-lib/src/rules/best_practises/one_contract_per_file.rs b/toolchains/solidity/core/crates/linter-lib/src/rules/best_practises/one_contract_per_file.rs index 25350ccb..abe46474 100644 --- a/toolchains/solidity/core/crates/linter-lib/src/rules/best_practises/one_contract_per_file.rs +++ b/toolchains/solidity/core/crates/linter-lib/src/rules/best_practises/one_contract_per_file.rs @@ -42,7 +42,8 @@ impl OneContractPerFile { impl RuleType for OneContractPerFile { fn diagnose(&self, file: &SolidFile, _files: &[SolidFile]) -> Vec { let mut res = Vec::new(); - let contracts = osmium_libs_solidity_ast_extractor::retriever::retrieve_contract_nodes(&file.data); + let contracts = + osmium_libs_solidity_ast_extractor::retriever::retrieve_contract_nodes(&file.data); let contract_count = contracts.len(); if contract_count > 1 { diff --git a/toolchains/solidity/core/crates/linter-lib/src/rules/best_practises/payable_fallback.rs b/toolchains/solidity/core/crates/linter-lib/src/rules/best_practises/payable_fallback.rs index f8f0362d..0f64fa5b 100644 --- a/toolchains/solidity/core/crates/linter-lib/src/rules/best_practises/payable_fallback.rs +++ b/toolchains/solidity/core/crates/linter-lib/src/rules/best_practises/payable_fallback.rs @@ -1,4 +1,6 @@ -use osmium_libs_solidity_ast_extractor::retriever::{retrieve_contract_nodes, retrieve_functions_nodes}; +use osmium_libs_solidity_ast_extractor::retriever::{ + retrieve_contract_nodes, retrieve_functions_nodes, +}; use osmium_libs_solidity_ast_extractor::{ItemFunction, Mutability, Spanned}; use crate::linter::SolidFile; diff --git a/toolchains/solidity/core/crates/linter-lib/src/rules/best_practises/reason_string.rs b/toolchains/solidity/core/crates/linter-lib/src/rules/best_practises/reason_string.rs index 53897725..813b5b45 100644 --- a/toolchains/solidity/core/crates/linter-lib/src/rules/best_practises/reason_string.rs +++ b/toolchains/solidity/core/crates/linter-lib/src/rules/best_practises/reason_string.rs @@ -84,7 +84,10 @@ impl RuleType for ReasonString { if let Some(expr_string) = expr_args.iter().find(|&x| { if let Expr::Lit(lit) = x { - matches!(lit, osmium_libs_solidity_ast_extractor::Lit::Str(_)) + matches!( + lit, + osmium_libs_solidity_ast_extractor::Lit::Str(_) + ) } else { false } diff --git a/toolchains/solidity/core/crates/linter-lib/src/rules/naming/contract_name_camelcase.rs b/toolchains/solidity/core/crates/linter-lib/src/rules/naming/contract_name_camelcase.rs index b2a6ac2d..a282f6ef 100644 --- a/toolchains/solidity/core/crates/linter-lib/src/rules/naming/contract_name_camelcase.rs +++ b/toolchains/solidity/core/crates/linter-lib/src/rules/naming/contract_name_camelcase.rs @@ -42,7 +42,8 @@ impl ContractNameCamelCase { impl RuleType for ContractNameCamelCase { fn diagnose(&self, file: &SolidFile, _files: &[SolidFile]) -> Vec { let mut res = Vec::new(); - let contracts = osmium_libs_solidity_ast_extractor::retriever::retrieve_contract_nodes(&file.data); + let contracts = + osmium_libs_solidity_ast_extractor::retriever::retrieve_contract_nodes(&file.data); for contract in contracts { if (contract.name.as_string().chars().next().unwrap() >= 'a' diff --git a/toolchains/solidity/core/crates/linter-lib/src/rules/naming/event_name_camelcase.rs b/toolchains/solidity/core/crates/linter-lib/src/rules/naming/event_name_camelcase.rs index 8e078013..3470f83a 100644 --- a/toolchains/solidity/core/crates/linter-lib/src/rules/naming/event_name_camelcase.rs +++ b/toolchains/solidity/core/crates/linter-lib/src/rules/naming/event_name_camelcase.rs @@ -52,9 +52,12 @@ fn is_camel_case(name: &str) -> bool { impl RuleType for EventNameCamelCase { fn diagnose(&self, file: &SolidFile, _files: &[SolidFile]) -> Vec { let mut res = Vec::new(); - let contracts = osmium_libs_solidity_ast_extractor::retriever::retrieve_contract_nodes(&file.data); + let contracts = + osmium_libs_solidity_ast_extractor::retriever::retrieve_contract_nodes(&file.data); - for event in osmium_libs_solidity_ast_extractor::retriever::retrieve_events_file_nodes(&file.data) { + for event in + osmium_libs_solidity_ast_extractor::retriever::retrieve_events_file_nodes(&file.data) + { if !is_camel_case(&event.name.to_string()) { let span = event.name.span(); res.push(self.create_diag((span.start(), span.end()), file)); @@ -62,7 +65,11 @@ impl RuleType for EventNameCamelCase { } for contract in contracts { - for event in osmium_libs_solidity_ast_extractor::retriever::retrieve_events_contract_nodes(&contract) { + for event in + osmium_libs_solidity_ast_extractor::retriever::retrieve_events_contract_nodes( + &contract, + ) + { if !is_camel_case(&event.name.to_string()) { let span = event.name.span(); res.push(self.create_diag((span.start(), span.end()), file)); diff --git a/toolchains/solidity/core/crates/linter-lib/src/rules/naming/foundry_test_functions.rs b/toolchains/solidity/core/crates/linter-lib/src/rules/naming/foundry_test_functions.rs index edf4bb0a..fbf2e3ef 100644 --- a/toolchains/solidity/core/crates/linter-lib/src/rules/naming/foundry_test_functions.rs +++ b/toolchains/solidity/core/crates/linter-lib/src/rules/naming/foundry_test_functions.rs @@ -56,22 +56,33 @@ impl RuleType for FoundryTestFunctions { let mut res = Vec::new(); let re = regex::Regex::new(r"^test(Fork)?(Fuzz)?(Fail)?(_)?(Revert(If_|When_){1})?\w{1,}$") .unwrap(); - let contracts = osmium_libs_solidity_ast_extractor::retriever::retrieve_contract_nodes(&file.data); + let contracts = + osmium_libs_solidity_ast_extractor::retriever::retrieve_contract_nodes(&file.data); for contract in contracts { - for function in osmium_libs_solidity_ast_extractor::retriever::retrieve_functions_nodes(&contract) { - let visibility = function - .attributes - .iter() - .find(|attr| matches!(attr, osmium_libs_solidity_ast_extractor::FunctionAttribute::Visibility(_))); + for function in + osmium_libs_solidity_ast_extractor::retriever::retrieve_functions_nodes(&contract) + { + let visibility = function.attributes.iter().find(|attr| { + matches!( + attr, + osmium_libs_solidity_ast_extractor::FunctionAttribute::Visibility(_) + ) + }); let visibility = match visibility { - Some(osmium_libs_solidity_ast_extractor::FunctionAttribute::Visibility(visibility)) => visibility, + Some(osmium_libs_solidity_ast_extractor::FunctionAttribute::Visibility( + visibility, + )) => visibility, _ => continue, }; - if !matches!(visibility, osmium_libs_solidity_ast_extractor::Visibility::Public(_)) - && !matches!(visibility, osmium_libs_solidity_ast_extractor::Visibility::External(_)) - { + if !matches!( + visibility, + osmium_libs_solidity_ast_extractor::Visibility::Public(_) + ) && !matches!( + visibility, + osmium_libs_solidity_ast_extractor::Visibility::External(_) + ) { continue; } if let Some(name) = function.name { diff --git a/toolchains/solidity/core/crates/linter-lib/src/rules/naming/func_name_mixedcase.rs b/toolchains/solidity/core/crates/linter-lib/src/rules/naming/func_name_mixedcase.rs index 2bcedd28..c6dc7f06 100644 --- a/toolchains/solidity/core/crates/linter-lib/src/rules/naming/func_name_mixedcase.rs +++ b/toolchains/solidity/core/crates/linter-lib/src/rules/naming/func_name_mixedcase.rs @@ -42,10 +42,13 @@ impl FuncNameMixedCase { impl RuleType for FuncNameMixedCase { fn diagnose(&self, file: &SolidFile, _files: &[SolidFile]) -> Vec { let mut res = Vec::new(); - let contracts = osmium_libs_solidity_ast_extractor::retriever::retrieve_contract_nodes(&file.data); + let contracts = + osmium_libs_solidity_ast_extractor::retriever::retrieve_contract_nodes(&file.data); for contract in contracts { - for function in osmium_libs_solidity_ast_extractor::retriever::retrieve_functions_nodes(&contract) { + for function in + osmium_libs_solidity_ast_extractor::retriever::retrieve_functions_nodes(&contract) + { if function.kind.is_function() { if let Some(name) = function.name { if !(name.as_string().chars().next().unwrap_or(' ') >= 'a' diff --git a/toolchains/solidity/core/crates/linter-lib/src/rules/naming/func_param_name_mixedcase.rs b/toolchains/solidity/core/crates/linter-lib/src/rules/naming/func_param_name_mixedcase.rs index 9ae15cc4..89007395 100644 --- a/toolchains/solidity/core/crates/linter-lib/src/rules/naming/func_param_name_mixedcase.rs +++ b/toolchains/solidity/core/crates/linter-lib/src/rules/naming/func_param_name_mixedcase.rs @@ -41,10 +41,13 @@ impl FuncParamNameMixedCase { impl RuleType for FuncParamNameMixedCase { fn diagnose(&self, file: &SolidFile, _files: &[SolidFile]) -> Vec { let mut res = Vec::new(); - let contracts = osmium_libs_solidity_ast_extractor::retriever::retrieve_contract_nodes(&file.data); + let contracts = + osmium_libs_solidity_ast_extractor::retriever::retrieve_contract_nodes(&file.data); for contract in contracts { - for function in osmium_libs_solidity_ast_extractor::retriever::retrieve_functions_nodes(&contract) { + for function in + osmium_libs_solidity_ast_extractor::retriever::retrieve_functions_nodes(&contract) + { for arg in function.arguments.iter() { if let Some(name) = &arg.name { if !(name.as_string().chars().next().unwrap() >= 'a' diff --git a/toolchains/solidity/core/crates/linter-lib/src/rules/naming/named_parameters_mapping.rs b/toolchains/solidity/core/crates/linter-lib/src/rules/naming/named_parameters_mapping.rs index ab6405a4..ffedfac3 100644 --- a/toolchains/solidity/core/crates/linter-lib/src/rules/naming/named_parameters_mapping.rs +++ b/toolchains/solidity/core/crates/linter-lib/src/rules/naming/named_parameters_mapping.rs @@ -67,7 +67,9 @@ impl RuleType for NamedParametersMapping { fn diagnose(&self, file: &SolidFile, _files: &[SolidFile]) -> Vec { let mut res = Vec::new(); let mut visitor = MappingsVisitor::new(); - for contract in osmium_libs_solidity_ast_extractor::retriever::retrieve_contract_nodes(&file.data) { + for contract in + osmium_libs_solidity_ast_extractor::retriever::retrieve_contract_nodes(&file.data) + { visitor.visit_item_contract(&contract); } diff --git a/toolchains/solidity/core/crates/linter-lib/src/rules/naming/private_vars_leading_underscore.rs b/toolchains/solidity/core/crates/linter-lib/src/rules/naming/private_vars_leading_underscore.rs index c66c4bf5..00214de8 100644 --- a/toolchains/solidity/core/crates/linter-lib/src/rules/naming/private_vars_leading_underscore.rs +++ b/toolchains/solidity/core/crates/linter-lib/src/rules/naming/private_vars_leading_underscore.rs @@ -52,10 +52,12 @@ impl PrivateVarsLeadingUnderscore { impl RuleType for PrivateVarsLeadingUnderscore { fn diagnose(&self, file: &SolidFile, _files: &[SolidFile]) -> Vec { let mut res = Vec::new(); - let contracts = osmium_libs_solidity_ast_extractor::retriever::retrieve_contract_nodes(&file.data); + let contracts = + osmium_libs_solidity_ast_extractor::retriever::retrieve_contract_nodes(&file.data); for contract in contracts { - let functions = osmium_libs_solidity_ast_extractor::retriever::retrieve_functions_nodes(&contract); + let functions = + osmium_libs_solidity_ast_extractor::retriever::retrieve_functions_nodes(&contract); for function in functions { if self.strict { diff --git a/toolchains/solidity/core/crates/linter-lib/src/rules/naming/var_name_mixedcase.rs b/toolchains/solidity/core/crates/linter-lib/src/rules/naming/var_name_mixedcase.rs index 05c7fbed..83370e0f 100644 --- a/toolchains/solidity/core/crates/linter-lib/src/rules/naming/var_name_mixedcase.rs +++ b/toolchains/solidity/core/crates/linter-lib/src/rules/naming/var_name_mixedcase.rs @@ -44,7 +44,9 @@ impl RuleType for VarNameMixedCase { let mut res = Vec::new(); let variables_definition = - osmium_libs_solidity_ast_extractor::retriever::retrieve_variable_definition_nodes(&file.data); + osmium_libs_solidity_ast_extractor::retriever::retrieve_variable_definition_nodes( + &file.data, + ); for variable in variables_definition { if variable.name.to_string()[1..].find('_').is_some() { let span = variable.name.span(); @@ -53,7 +55,9 @@ impl RuleType for VarNameMixedCase { } let variables_declaration = - osmium_libs_solidity_ast_extractor::retriever::retrieve_variable_declaration_nodes(&file.data); + osmium_libs_solidity_ast_extractor::retriever::retrieve_variable_declaration_nodes( + &file.data, + ); for variable in variables_declaration { if variable.name.is_some() { let name = variable.name.unwrap(); diff --git a/toolchains/solidity/core/crates/linter-lib/src/rules/order/ordering.rs b/toolchains/solidity/core/crates/linter-lib/src/rules/order/ordering.rs index b156414d..ff2f1a87 100644 --- a/toolchains/solidity/core/crates/linter-lib/src/rules/order/ordering.rs +++ b/toolchains/solidity/core/crates/linter-lib/src/rules/order/ordering.rs @@ -275,7 +275,10 @@ impl OrderingVisitor { fn create_diag( &self, file: &SolidFile, - location: (osmium_libs_solidity_ast_extractor::LineColumn, osmium_libs_solidity_ast_extractor::LineColumn), + location: ( + osmium_libs_solidity_ast_extractor::LineColumn, + osmium_libs_solidity_ast_extractor::LineColumn, + ), ) -> LintDiag { let range = Range { start: Position { @@ -316,7 +319,10 @@ impl OrderingVisitor { } impl<'ast> Visit<'ast> for OrderingVisitor { - fn visit_pragma_directive(&mut self, pragma: &'ast osmium_libs_solidity_ast_extractor::PragmaDirective) { + fn visit_pragma_directive( + &mut self, + pragma: &'ast osmium_libs_solidity_ast_extractor::PragmaDirective, + ) { if !self.is_authorized_file_item(FileItemType::Pragma) { let location = (pragma.span().start(), pragma.span().end()); self.reports.push(self.create_diag(&self.file, location)); @@ -325,7 +331,10 @@ impl<'ast> Visit<'ast> for OrderingVisitor { } } - fn visit_import_directive(&mut self, import: &'ast osmium_libs_solidity_ast_extractor::ImportDirective) { + fn visit_import_directive( + &mut self, + import: &'ast osmium_libs_solidity_ast_extractor::ImportDirective, + ) { if !self.is_authorized_file_item(FileItemType::Import) { let location = (import.span().start(), import.span().end()); self.reports.push(self.create_diag(&self.file, location)); @@ -343,7 +352,10 @@ impl<'ast> Visit<'ast> for OrderingVisitor { } } - fn visit_item_struct(&mut self, struct_def: &'ast osmium_libs_solidity_ast_extractor::ItemStruct) { + fn visit_item_struct( + &mut self, + struct_def: &'ast osmium_libs_solidity_ast_extractor::ItemStruct, + ) { if !self.is_authorized_file_item(FileItemType::Struct) { let location = (struct_def.span().start(), struct_def.span().end()); self.reports.push(self.create_diag(&self.file, location)); @@ -352,7 +364,10 @@ impl<'ast> Visit<'ast> for OrderingVisitor { } } - fn visit_item_contract(&mut self, contract_def: &'ast osmium_libs_solidity_ast_extractor::ItemContract) { + fn visit_item_contract( + &mut self, + contract_def: &'ast osmium_libs_solidity_ast_extractor::ItemContract, + ) { if contract_def.is_interface() && !self.is_authorized_file_item(FileItemType::ContractInterface) || contract_def.is_library() @@ -379,7 +394,10 @@ impl<'ast> Visit<'ast> for OrderingVisitor { } } - fn visit_variable_definition(&mut self, var: &'ast osmium_libs_solidity_ast_extractor::VariableDefinition) { + fn visit_variable_definition( + &mut self, + var: &'ast osmium_libs_solidity_ast_extractor::VariableDefinition, + ) { if !self.is_authorized_contract_item(ContractItemType::Property) { let location = (var.span().start(), var.span().end()); self.reports.push(self.create_diag(&self.file, location)); @@ -397,7 +415,10 @@ impl<'ast> Visit<'ast> for OrderingVisitor { } } - fn visit_item_function(&mut self, function: &'ast osmium_libs_solidity_ast_extractor::ItemFunction) { + fn visit_item_function( + &mut self, + function: &'ast osmium_libs_solidity_ast_extractor::ItemFunction, + ) { match function.kind { FunctionKind::Modifier(_) => { if !self.is_authorized_contract_item(ContractItemType::Modifier) { @@ -432,12 +453,16 @@ impl<'ast> Visit<'ast> for OrderingVisitor { } } FunctionKind::Function(_) => { - let visibility = function - .attributes - .iter() - .find(|attr| matches!(attr, osmium_libs_solidity_ast_extractor::FunctionAttribute::Visibility(_))); + let visibility = function.attributes.iter().find(|attr| { + matches!( + attr, + osmium_libs_solidity_ast_extractor::FunctionAttribute::Visibility(_) + ) + }); let visibility = match visibility { - Some(osmium_libs_solidity_ast_extractor::FunctionAttribute::Visibility(visibility)) => visibility, + Some(osmium_libs_solidity_ast_extractor::FunctionAttribute::Visibility( + visibility, + )) => visibility, _ => return, }; diff --git a/toolchains/solidity/core/crates/linter-lib/src/rules/order/visibility_modifier_order.rs b/toolchains/solidity/core/crates/linter-lib/src/rules/order/visibility_modifier_order.rs index 58ff0e19..3f8bcea0 100644 --- a/toolchains/solidity/core/crates/linter-lib/src/rules/order/visibility_modifier_order.rs +++ b/toolchains/solidity/core/crates/linter-lib/src/rules/order/visibility_modifier_order.rs @@ -1,4 +1,6 @@ -use osmium_libs_solidity_ast_extractor::retriever::{retrieve_contract_nodes, retrieve_functions_nodes}; +use osmium_libs_solidity_ast_extractor::retriever::{ + retrieve_contract_nodes, retrieve_functions_nodes, +}; use osmium_libs_solidity_ast_extractor::Spanned; use crate::linter::SolidFile; diff --git a/toolchains/solidity/core/crates/linter-lib/src/rules/security/avoid_tx_origin.rs b/toolchains/solidity/core/crates/linter-lib/src/rules/security/avoid_tx_origin.rs index 9846580f..7387b89a 100644 --- a/toolchains/solidity/core/crates/linter-lib/src/rules/security/avoid_tx_origin.rs +++ b/toolchains/solidity/core/crates/linter-lib/src/rules/security/avoid_tx_origin.rs @@ -59,7 +59,9 @@ impl RuleType for AvoidTxOrigin { fn diagnose(&self, file: &SolidFile, _files: &[SolidFile]) -> Vec { let mut res = Vec::new(); let mut visitor = ExprVisitor::new(); - for contract in osmium_libs_solidity_ast_extractor::retriever::retrieve_contract_nodes(&file.data) { + for contract in + osmium_libs_solidity_ast_extractor::retriever::retrieve_contract_nodes(&file.data) + { visitor.visit_item_contract(&contract); } diff --git a/toolchains/solidity/core/crates/linter-lib/src/rules/security/func_visibility.rs b/toolchains/solidity/core/crates/linter-lib/src/rules/security/func_visibility.rs index 45ee8ed8..5f1f8a93 100644 --- a/toolchains/solidity/core/crates/linter-lib/src/rules/security/func_visibility.rs +++ b/toolchains/solidity/core/crates/linter-lib/src/rules/security/func_visibility.rs @@ -19,7 +19,10 @@ pub struct FuncVisibility { impl FuncVisibility { fn create_diag( &self, - location: (osmium_libs_solidity_ast_extractor::LineColumn, osmium_libs_solidity_ast_extractor::LineColumn), + location: ( + osmium_libs_solidity_ast_extractor::LineColumn, + osmium_libs_solidity_ast_extractor::LineColumn, + ), file: &SolidFile, ) -> LintDiag { LintDiag { @@ -47,10 +50,13 @@ impl FuncVisibility { impl RuleType for FuncVisibility { fn diagnose(&self, file: &SolidFile, _files: &[SolidFile]) -> Vec { let mut res = Vec::new(); - let contracts = osmium_libs_solidity_ast_extractor::retriever::retrieve_contract_nodes(&file.data); + let contracts = + osmium_libs_solidity_ast_extractor::retriever::retrieve_contract_nodes(&file.data); for contract in contracts { - for function in osmium_libs_solidity_ast_extractor::retriever::retrieve_functions_nodes(&contract) { + for function in + osmium_libs_solidity_ast_extractor::retriever::retrieve_functions_nodes(&contract) + { if function.attributes.visibility().is_some() || (function.kind.is_constructor() && self.ignore_constructors) { diff --git a/toolchains/solidity/core/crates/linter-server/src/lib.rs b/toolchains/solidity/core/crates/linter-server/src/lib.rs index 61a9b771..3aa32e27 100644 --- a/toolchains/solidity/core/crates/linter-server/src/lib.rs +++ b/toolchains/solidity/core/crates/linter-server/src/lib.rs @@ -6,9 +6,7 @@ use osmium_libs_lsp_handler::{ InitializeParams, InitializeResult, InitializedParams, MessageType, Position, Range, ServerCapabilities, TextDocumentSyncCapability, TextDocumentSyncKind, Url, }, - Result, - Handler, - Connection + Connection, Handler, Result, }; use solidhunter_lib::{linter::SolidLinter, types::LintDiag}; @@ -37,7 +35,8 @@ impl Handler for Backend { "Initializing server with config file: {:?}", self.config_file_path ); - self.connection.log_message(MessageType::INFO, "Server initialized!"); + self.connection + .log_message(MessageType::INFO, "Server initialized!"); if std::path::Path::new(&self.config_file_path).is_file() { let mut linter = SolidLinter::new(); @@ -53,16 +52,19 @@ impl Handler for Backend { .replace(SolidLinter::new_fileless()); } - self.connection.log_message(MessageType::INFO, "Linter initialized!"); + self.connection + .log_message(MessageType::INFO, "Linter initialized!"); } fn shutdown(&self) -> Result<()> { - self.connection.log_message(MessageType::INFO, "Server shutdown!"); + self.connection + .log_message(MessageType::INFO, "Server shutdown!"); Ok(()) } fn did_open(&self, params: DidOpenTextDocumentParams) { - self.connection.log_message(MessageType::INFO, "file opened!"); + self.connection + .log_message(MessageType::INFO, "file opened!"); let filepath = filepath_from_uri(¶ms.text_document.uri); let mut linter = self.linter.borrow_mut(); @@ -81,18 +83,17 @@ impl Handler for Backend { .map(|d| diagnostic_from_lintdiag(d.clone())) .collect(); eprintln!("diags: {:#?}", diags); - self.connection.publish_diagnostics( - params.text_document.uri.clone(), - diags, - None, - ); + self.connection + .publish_diagnostics(params.text_document.uri.clone(), diags, None); } else if let Err(e) = diags_res { - self.connection.log_message(MessageType::ERROR, e.to_string()); + self.connection + .log_message(MessageType::ERROR, e.to_string()); } } fn did_change(&self, params: DidChangeTextDocumentParams) { - self.connection.log_message(MessageType::INFO, "file changed!"); + self.connection + .log_message(MessageType::INFO, "file changed!"); let filepath = filepath_from_uri(¶ms.text_document.uri); let mut linter = self.linter.borrow_mut(); @@ -111,13 +112,11 @@ impl Handler for Backend { .map(|d| diagnostic_from_lintdiag(d.clone())) .collect(); eprintln!("diags: {:#?}", diags); - self.connection.publish_diagnostics( - params.text_document.uri.clone(), - diags, - None, - ); + self.connection + .publish_diagnostics(params.text_document.uri.clone(), diags, None); } else if let Err(e) = diags_res { - self.connection.log_message(MessageType::ERROR, e.to_string()); + self.connection + .log_message(MessageType::ERROR, e.to_string()); } } } @@ -127,7 +126,6 @@ pub fn filepath_from_uri(uri: &Url) -> String { path.to_string() } - fn diagnostic_from_lintdiag(diag: LintDiag) -> Diagnostic { Diagnostic { range: Range { From fb5fec89278c175c92d3b575b4b0a17c02058bdf Mon Sep 17 00:00:00 2001 From: 0xMemoryGrinder <35138272+0xMemoryGrinder@users.noreply.github.com> Date: Fri, 20 Oct 2023 15:27:31 -0400 Subject: [PATCH 248/325] chore(solidity/extension): removed placeholder tests in extension --- toolchains/solidity/extension/package.json | 6 +-- .../solidity/extension/src/test/runTest.ts | 23 ----------- .../src/test/suite/extension.test.ts | 15 -------- .../extension/src/test/suite/index.ts | 38 ------------------- 4 files changed, 2 insertions(+), 80 deletions(-) delete mode 100644 toolchains/solidity/extension/src/test/runTest.ts delete mode 100644 toolchains/solidity/extension/src/test/suite/extension.test.ts delete mode 100644 toolchains/solidity/extension/src/test/suite/index.ts diff --git a/toolchains/solidity/extension/package.json b/toolchains/solidity/extension/package.json index 1ab19dd7..4255a650 100644 --- a/toolchains/solidity/extension/package.json +++ b/toolchains/solidity/extension/package.json @@ -27,11 +27,9 @@ "compile": "webpack", "watch": "webpack --watch", "package": "webpack --mode production --devtool hidden-source-map", - "compile-tests": "tsc -p . --outDir out", - "watch-tests": "tsc -p . -w --outDir out", - "pretest": "yarn run compile-tests && yarn run compile && yarn run extension:lint", + "pretest": "yarn run compile && yarn run extension:lint", "extension:lint": "eslint src --ext ts", - "extension:test": "node ./out/test/runTest.js" + "extension:test": "echo 'not tests'" }, "dependencies": { "vscode-languageclient": "^8.1.0", diff --git a/toolchains/solidity/extension/src/test/runTest.ts b/toolchains/solidity/extension/src/test/runTest.ts deleted file mode 100644 index 93a4441d..00000000 --- a/toolchains/solidity/extension/src/test/runTest.ts +++ /dev/null @@ -1,23 +0,0 @@ -import * as path from 'path'; - -import { runTests } from '@vscode/test-electron'; - -async function main() { - try { - // The folder containing the Extension Manifest package.json - // Passed to `--extensionDevelopmentPath` - const extensionDevelopmentPath = path.resolve(__dirname, '../../'); - - // The path to test runner - // Passed to --extensionTestsPath - const extensionTestsPath = path.resolve(__dirname, './suite/index'); - - // Download VS Code, unzip it and run the integration test - await runTests({ extensionDevelopmentPath, extensionTestsPath }); - } catch (err) { - console.error('Failed to run tests', err); - process.exit(1); - } -} - -main(); diff --git a/toolchains/solidity/extension/src/test/suite/extension.test.ts b/toolchains/solidity/extension/src/test/suite/extension.test.ts deleted file mode 100644 index 4ca0ab41..00000000 --- a/toolchains/solidity/extension/src/test/suite/extension.test.ts +++ /dev/null @@ -1,15 +0,0 @@ -import * as assert from 'assert'; - -// You can import and use all API from the 'vscode' module -// as well as import your extension to test it -import * as vscode from 'vscode'; -// import * as myExtension from '../../extension'; - -suite('Extension Test Suite', () => { - vscode.window.showInformationMessage('Start all tests.'); - - test('Sample test', () => { - assert.strictEqual(-1, [1, 2, 3].indexOf(5)); - assert.strictEqual(-1, [1, 2, 3].indexOf(0)); - }); -}); diff --git a/toolchains/solidity/extension/src/test/suite/index.ts b/toolchains/solidity/extension/src/test/suite/index.ts deleted file mode 100644 index 7029e38e..00000000 --- a/toolchains/solidity/extension/src/test/suite/index.ts +++ /dev/null @@ -1,38 +0,0 @@ -import * as path from 'path'; -import * as Mocha from 'mocha'; -import * as glob from 'glob'; - -export function run(): Promise { - // Create the mocha test - const mocha = new Mocha({ - ui: 'tdd', - color: true - }); - - const testsRoot = path.resolve(__dirname, '..'); - - return new Promise((c, e) => { - glob('**/**.test.js', { cwd: testsRoot }, (err, files) => { - if (err) { - return e(err); - } - - // Add files to the test suite - files.forEach(f => mocha.addFile(path.resolve(testsRoot, f))); - - try { - // Run the mocha test - mocha.run(failures => { - if (failures > 0) { - e(new Error(`${failures} tests failed.`)); - } else { - c(); - } - }); - } catch (err) { - console.error(err); - e(err); - } - }); - }); -} From 78e99b8e9284873fca0d296e5498d30f7e7b53a5 Mon Sep 17 00:00:00 2001 From: 0xMemoryGrinder <35138272+0xMemoryGrinder@users.noreply.github.com> Date: Fri, 20 Oct 2023 15:30:22 -0400 Subject: [PATCH 249/325] chore(solidity): deleted remove-me and added missing script --- remove-me-031f29e69a154980b2db.txt | 1 - remove-me-a91421aa214c4eed9a31.txt.txt | 1 - toolchains/solidity/extension/package.json | 3 ++- 3 files changed, 2 insertions(+), 3 deletions(-) delete mode 100644 remove-me-031f29e69a154980b2db.txt delete mode 100644 remove-me-a91421aa214c4eed9a31.txt.txt diff --git a/remove-me-031f29e69a154980b2db.txt b/remove-me-031f29e69a154980b2db.txt deleted file mode 100644 index 93c704ff..00000000 --- a/remove-me-031f29e69a154980b2db.txt +++ /dev/null @@ -1 +0,0 @@ -031f29e69a154980b2db diff --git a/remove-me-a91421aa214c4eed9a31.txt.txt b/remove-me-a91421aa214c4eed9a31.txt.txt deleted file mode 100644 index 89fa57d5..00000000 --- a/remove-me-a91421aa214c4eed9a31.txt.txt +++ /dev/null @@ -1 +0,0 @@ -a91421aa214c4eed9a31 \ No newline at end of file diff --git a/toolchains/solidity/extension/package.json b/toolchains/solidity/extension/package.json index 4255a650..d3ac974e 100644 --- a/toolchains/solidity/extension/package.json +++ b/toolchains/solidity/extension/package.json @@ -29,7 +29,8 @@ "package": "webpack --mode production --devtool hidden-source-map", "pretest": "yarn run compile && yarn run extension:lint", "extension:lint": "eslint src --ext ts", - "extension:test": "echo 'not tests'" + "extension:test": "echo 'not tests'", + "extension:format": "echo 'no formatter'" }, "dependencies": { "vscode-languageclient": "^8.1.0", From 7a2adf95b35bdb4e80c8820a7e5573bca9f73013 Mon Sep 17 00:00:00 2001 From: 0xMemoryGrinder <35138272+0xMemoryGrinder@users.noreply.github.com> Date: Sat, 21 Oct 2023 13:16:07 -0400 Subject: [PATCH 250/325] refactor: added licences, changed format scripts and removed useless logs --- libs/ast-extractor/Cargo.toml | 2 +- libs/ast-extractor/package.json | 2 +- libs/lsp-handler/Cargo.toml | 2 +- libs/lsp-handler/package.json | 2 +- libs/lsp-server-wrapper/Cargo.toml | 1 + libs/lsp-server-wrapper/package.json | 2 +- toolchains/solidity/core/Cargo.toml | 2 +- toolchains/solidity/core/crates/extension/Cargo.toml | 1 + toolchains/solidity/core/crates/linter-server/Cargo.toml | 1 + toolchains/solidity/extension/src/server.ts | 4 ---- 10 files changed, 9 insertions(+), 10 deletions(-) diff --git a/libs/ast-extractor/Cargo.toml b/libs/ast-extractor/Cargo.toml index 5b58e46c..c863a5d8 100644 --- a/libs/ast-extractor/Cargo.toml +++ b/libs/ast-extractor/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "osmium-libs-solidity-ast-extractor" description = "Extracts the AST from a Solidity file" -license = "GPL-3.0" +license = "GPL-3.0-or-later" repository = "https://github.com/astrodevs-labs/osmium" version = "0.1.0" edition = "2021" diff --git a/libs/ast-extractor/package.json b/libs/ast-extractor/package.json index 8279d2cb..958035da 100644 --- a/libs/ast-extractor/package.json +++ b/libs/ast-extractor/package.json @@ -3,7 +3,7 @@ "packageManager": "yarn@3.6.1", "scripts": { "build": "cargo build --release", - "format": "cargo fmt", + "format": "cargo fmt --check --all", "test": "cargo test", "lint": "cargo clippy --all-targets --all-features -- -D warnings", "publish": "cargo package && cargo publish" diff --git a/libs/lsp-handler/Cargo.toml b/libs/lsp-handler/Cargo.toml index 7e0b0c60..6d5f3e41 100644 --- a/libs/lsp-handler/Cargo.toml +++ b/libs/lsp-handler/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "osmium-libs-lsp-handler" description = "Dispatch LSP messages to all hooked handlers" -license = "GPL-3.0" +license = "GPL-3.0-or-later" repository = "https://github.com/astrodevs-labs/osmium" version = "0.0.1" edition = "2021" diff --git a/libs/lsp-handler/package.json b/libs/lsp-handler/package.json index b2f9b0f8..ada7b904 100644 --- a/libs/lsp-handler/package.json +++ b/libs/lsp-handler/package.json @@ -2,7 +2,7 @@ "name": "@osmium-libs/lsp-handler", "scripts": { "build": "cargo build --release", - "format": "cargo fmt", + "format": "cargo fmt --check --all", "test": "cargo test", "lint": "cargo clippy --all-targets --all-features -- -D warnings", "publish": "cargo package && cargo publish" diff --git a/libs/lsp-server-wrapper/Cargo.toml b/libs/lsp-server-wrapper/Cargo.toml index 85da3bb8..3a3c52eb 100644 --- a/libs/lsp-server-wrapper/Cargo.toml +++ b/libs/lsp-server-wrapper/Cargo.toml @@ -1,5 +1,6 @@ [package] name = "lsp-server-wrapper" +license = "GPL-3.0-or-later" version = "0.1.0" edition = "2021" diff --git a/libs/lsp-server-wrapper/package.json b/libs/lsp-server-wrapper/package.json index d3f5d643..ab9edb4e 100644 --- a/libs/lsp-server-wrapper/package.json +++ b/libs/lsp-server-wrapper/package.json @@ -2,7 +2,7 @@ "name": "@osmium-libs/lsp-server-wrapper", "scripts": { "build": "cargo build --release", - "format": "cargo fmt", + "format": "cargo fmt --check --all", "test": "cargo test", "lint": "cargo clippy --all-targets --all-features -- -D warnings" } diff --git a/toolchains/solidity/core/Cargo.toml b/toolchains/solidity/core/Cargo.toml index 6455b152..0f8f6933 100644 --- a/toolchains/solidity/core/Cargo.toml +++ b/toolchains/solidity/core/Cargo.toml @@ -6,7 +6,7 @@ resolver = "2" version = "0.3.0" edition = "2021" authors = ["Osmium Solidity Contributors"] -license = "MIT OR Apache-2.0" +license = "GPL-3.0-or-later" exclude = ["benches/", "tests/"] [workspace.metadata.docs.rs] diff --git a/toolchains/solidity/core/crates/extension/Cargo.toml b/toolchains/solidity/core/crates/extension/Cargo.toml index 92cd5110..ceb960a8 100644 --- a/toolchains/solidity/core/crates/extension/Cargo.toml +++ b/toolchains/solidity/core/crates/extension/Cargo.toml @@ -1,6 +1,7 @@ [package] name = "extension" version = "0.1.0" +license = "GPL-3.0-or-later" edition = "2021" [lib] diff --git a/toolchains/solidity/core/crates/linter-server/Cargo.toml b/toolchains/solidity/core/crates/linter-server/Cargo.toml index 97cd81d1..5c1bd541 100644 --- a/toolchains/solidity/core/crates/linter-server/Cargo.toml +++ b/toolchains/solidity/core/crates/linter-server/Cargo.toml @@ -1,5 +1,6 @@ [package] name = "linter-server" +license = "GPL-3.0-or-later" version = "0.0.2" edition = "2021" diff --git a/toolchains/solidity/extension/src/server.ts b/toolchains/solidity/extension/src/server.ts index 2036bca3..cbe766e2 100644 --- a/toolchains/solidity/extension/src/server.ts +++ b/toolchains/solidity/extension/src/server.ts @@ -36,20 +36,16 @@ const sendNotification = (method: string, params: any) => { const extension = create_extension(sendRequest, sendNotification); connection.onInitialize((params: InitializeParams) => { - console.log(`onInitialize: ${params.rootUri}`); return extension.onRequest('initialize', params); }); connection.onRequest((method: string, params: any) => { - console.log(`onRequest: ${method}`); connection.console.log(`onRequest: ${method}`); return extension.onRequest(method, params); }); connection.onNotification((method: string, params: any) => { - console.log(`onNotification: ${method}`); - connection.console.log(`onNotification: ${method}`); extension.onNotification(method, params); }); From f2ea41de17ca0d0fd5ec4b05fe238234de2954ab Mon Sep 17 00:00:00 2001 From: 0xMemoryGrinder <35138272+0xMemoryGrinder@users.noreply.github.com> Date: Sun, 22 Oct 2023 21:09:17 -0400 Subject: [PATCH 251/325] fix(cd): added missing dependency installation and migrated to yarn v4 --- .github/workflows/cd.yml | 3 +-- .github/workflows/ci.yml | 4 ---- toolchains/solidity/extension/package.json | 6 +++--- 3 files changed, 4 insertions(+), 9 deletions(-) diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index 68b9ad79..010980fd 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -47,11 +47,11 @@ jobs: corepack enable corepack prepare yarn@stable --activate yarn -v - yarn plugin import workspace-tools - name: Install dependencies run: | yarn install --immutable + cargo install wasm-pack - name: Build run: | @@ -84,7 +84,6 @@ jobs: corepack enable corepack prepare yarn@stable --activate yarn -v - yarn plugin import workspace-tools - name: Get workspace path id: workspace-path diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index bc1788b2..197954f6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -51,7 +51,6 @@ jobs: run: | corepack enable corepack prepare yarn@stable --activate - yarn plugin import workspace-tools - name: Get yarn cache directory path id: yarn-cache-dir-path @@ -87,7 +86,6 @@ jobs: run: | corepack enable corepack prepare yarn@stable --activate - yarn plugin import workspace-tools - name: Get yarn cache directory path id: yarn-cache-dir-path @@ -120,7 +118,6 @@ jobs: run: | corepack enable corepack prepare yarn@stable --activate - yarn plugin import workspace-tools - name: install run: cargo install wasm-pack @@ -156,7 +153,6 @@ jobs: run: | corepack enable corepack prepare yarn@stable --activate - yarn plugin import workspace-tools - name: Get yarn cache directory path id: yarn-cache-dir-path diff --git a/toolchains/solidity/extension/package.json b/toolchains/solidity/extension/package.json index d3ac974e..7f795582 100644 --- a/toolchains/solidity/extension/package.json +++ b/toolchains/solidity/extension/package.json @@ -9,9 +9,9 @@ "categories": [ "Other" ], - "activationEvents": [ - "onLanguage:solidity" - ], + "activationEvents": [ + "onLanguage:solidity" + ], "main": "./dist/extension.js", "contributes": { "commands": [ From d5dc1835f09a53e936aa46b8fe503cf82c3bf1d2 Mon Sep 17 00:00:00 2001 From: Astrodevs CI Date: Mon, 23 Oct 2023 02:04:54 +0000 Subject: [PATCH 252/325] chore: create branch feature/174-solidity-syntax-color-staging --- remove-me-6babd5d558ce4e45ad20.txt | 1 + 1 file changed, 1 insertion(+) create mode 100644 remove-me-6babd5d558ce4e45ad20.txt diff --git a/remove-me-6babd5d558ce4e45ad20.txt b/remove-me-6babd5d558ce4e45ad20.txt new file mode 100644 index 00000000..b905e13f --- /dev/null +++ b/remove-me-6babd5d558ce4e45ad20.txt @@ -0,0 +1 @@ +6babd5d558ce4e45ad20 From b3c507f90774d12f2df116fdd368329f9bf62af9 Mon Sep 17 00:00:00 2001 From: 0xMemoryGrinder <35138272+0xMemoryGrinder@users.noreply.github.com> Date: Sun, 22 Oct 2023 22:07:28 -0400 Subject: [PATCH 253/325] feat(solidity/extension): added syntax color for solidity language --- .pnp.cjs | 800 +++++------ .../extension/assets/configuration.json | 32 + .../solidity/extension/assets/syntax.json | 1215 +++++++++++++++++ toolchains/solidity/extension/package.json | 26 + 4 files changed, 1673 insertions(+), 400 deletions(-) create mode 100644 toolchains/solidity/extension/assets/configuration.json create mode 100644 toolchains/solidity/extension/assets/syntax.json diff --git a/.pnp.cjs b/.pnp.cjs index de0578d0..04702655 100755 --- a/.pnp.cjs +++ b/.pnp.cjs @@ -83,7 +83,7 @@ const RAW_RUNTIME_STATE = ]],\ ["@aashutoshrathi/word-wrap", [\ ["npm:1.2.6", {\ - "packageLocation": "../../../../.yarn/berry/cache/@aashutoshrathi-word-wrap-npm-1.2.6-5b1d95e487-10.zip/node_modules/@aashutoshrathi/word-wrap/",\ + "packageLocation": "./.yarn/cache/@aashutoshrathi-word-wrap-npm-1.2.6-5b1d95e487-6eebd12a5c.zip/node_modules/@aashutoshrathi/word-wrap/",\ "packageDependencies": [\ ["@aashutoshrathi/word-wrap", "npm:1.2.6"]\ ],\ @@ -92,7 +92,7 @@ const RAW_RUNTIME_STATE = ]],\ ["@discoveryjs/json-ext", [\ ["npm:0.5.7", {\ - "packageLocation": "../../../../.yarn/berry/cache/@discoveryjs-json-ext-npm-0.5.7-fe04af1f31-10.zip/node_modules/@discoveryjs/json-ext/",\ + "packageLocation": "./.yarn/cache/@discoveryjs-json-ext-npm-0.5.7-fe04af1f31-b95682a852.zip/node_modules/@discoveryjs/json-ext/",\ "packageDependencies": [\ ["@discoveryjs/json-ext", "npm:0.5.7"]\ ],\ @@ -101,14 +101,14 @@ const RAW_RUNTIME_STATE = ]],\ ["@eslint-community/eslint-utils", [\ ["npm:4.4.0", {\ - "packageLocation": "../../../../.yarn/berry/cache/@eslint-community-eslint-utils-npm-4.4.0-d1791bd5a3-10.zip/node_modules/@eslint-community/eslint-utils/",\ + "packageLocation": "./.yarn/cache/@eslint-community-eslint-utils-npm-4.4.0-d1791bd5a3-8d70bcdcd8.zip/node_modules/@eslint-community/eslint-utils/",\ "packageDependencies": [\ ["@eslint-community/eslint-utils", "npm:4.4.0"]\ ],\ "linkType": "SOFT"\ }],\ ["virtual:77fce3ec74d55c7e6791631c329cf3adde374e21e618e865127f72e63efeb3376dcf7fc8217de80f5a310e81c791a72e9d099b00fd3252d5653ff68dff50c2fa#npm:4.4.0", {\ - "packageLocation": "./.yarn/__virtual__/@eslint-community-eslint-utils-virtual-3663415ec2/5/.yarn/berry/cache/@eslint-community-eslint-utils-npm-4.4.0-d1791bd5a3-10.zip/node_modules/@eslint-community/eslint-utils/",\ + "packageLocation": "./.yarn/__virtual__/@eslint-community-eslint-utils-virtual-3663415ec2/0/cache/@eslint-community-eslint-utils-npm-4.4.0-d1791bd5a3-8d70bcdcd8.zip/node_modules/@eslint-community/eslint-utils/",\ "packageDependencies": [\ ["@eslint-community/eslint-utils", "virtual:77fce3ec74d55c7e6791631c329cf3adde374e21e618e865127f72e63efeb3376dcf7fc8217de80f5a310e81c791a72e9d099b00fd3252d5653ff68dff50c2fa#npm:4.4.0"],\ ["@types/eslint", null],\ @@ -122,7 +122,7 @@ const RAW_RUNTIME_STATE = "linkType": "HARD"\ }],\ ["virtual:dc7af99e618232ac0e2a751f560e2225037bf809144a4cc05369d5312b9d24061282984c0c0c6c5c199f3a0663f91f11c21afb60016655f472fa253e0b676e3b#npm:4.4.0", {\ - "packageLocation": "./.yarn/__virtual__/@eslint-community-eslint-utils-virtual-19d05ef909/5/.yarn/berry/cache/@eslint-community-eslint-utils-npm-4.4.0-d1791bd5a3-10.zip/node_modules/@eslint-community/eslint-utils/",\ + "packageLocation": "./.yarn/__virtual__/@eslint-community-eslint-utils-virtual-19d05ef909/0/cache/@eslint-community-eslint-utils-npm-4.4.0-d1791bd5a3-8d70bcdcd8.zip/node_modules/@eslint-community/eslint-utils/",\ "packageDependencies": [\ ["@eslint-community/eslint-utils", "virtual:dc7af99e618232ac0e2a751f560e2225037bf809144a4cc05369d5312b9d24061282984c0c0c6c5c199f3a0663f91f11c21afb60016655f472fa253e0b676e3b#npm:4.4.0"],\ ["@types/eslint", null],\ @@ -138,14 +138,14 @@ const RAW_RUNTIME_STATE = ]],\ ["@eslint-community/regexpp", [\ ["npm:4.6.2", {\ - "packageLocation": "../../../../.yarn/berry/cache/@eslint-community-regexpp-npm-4.6.2-0fc083c210-10.zip/node_modules/@eslint-community/regexpp/",\ + "packageLocation": "./.yarn/cache/@eslint-community-regexpp-npm-4.6.2-0fc083c210-59ea2fa13a.zip/node_modules/@eslint-community/regexpp/",\ "packageDependencies": [\ ["@eslint-community/regexpp", "npm:4.6.2"]\ ],\ "linkType": "HARD"\ }],\ ["npm:4.9.1", {\ - "packageLocation": "../../../../.yarn/berry/cache/@eslint-community-regexpp-npm-4.9.1-7805f77eb5-10.zip/node_modules/@eslint-community/regexpp/",\ + "packageLocation": "./.yarn/cache/@eslint-community-regexpp-npm-4.9.1-7805f77eb5-8f1ba51fa5.zip/node_modules/@eslint-community/regexpp/",\ "packageDependencies": [\ ["@eslint-community/regexpp", "npm:4.9.1"]\ ],\ @@ -154,7 +154,7 @@ const RAW_RUNTIME_STATE = ]],\ ["@eslint/eslintrc", [\ ["npm:2.1.1", {\ - "packageLocation": "../../../../.yarn/berry/cache/@eslint-eslintrc-npm-2.1.1-ced87d94ab-10.zip/node_modules/@eslint/eslintrc/",\ + "packageLocation": "./.yarn/cache/@eslint-eslintrc-npm-2.1.1-ced87d94ab-d4dda7f9f0.zip/node_modules/@eslint/eslintrc/",\ "packageDependencies": [\ ["@eslint/eslintrc", "npm:2.1.1"],\ ["ajv", "npm:6.12.6"],\ @@ -170,7 +170,7 @@ const RAW_RUNTIME_STATE = "linkType": "HARD"\ }],\ ["npm:2.1.2", {\ - "packageLocation": "../../../../.yarn/berry/cache/@eslint-eslintrc-npm-2.1.2-feb0771c9f-10.zip/node_modules/@eslint/eslintrc/",\ + "packageLocation": "./.yarn/cache/@eslint-eslintrc-npm-2.1.2-feb0771c9f-fa25638f26.zip/node_modules/@eslint/eslintrc/",\ "packageDependencies": [\ ["@eslint/eslintrc", "npm:2.1.2"],\ ["ajv", "npm:6.12.6"],\ @@ -188,14 +188,14 @@ const RAW_RUNTIME_STATE = ]],\ ["@eslint/js", [\ ["npm:8.46.0", {\ - "packageLocation": "../../../../.yarn/berry/cache/@eslint-js-npm-8.46.0-3cfe1ee88b-10.zip/node_modules/@eslint/js/",\ + "packageLocation": "./.yarn/cache/@eslint-js-npm-8.46.0-3cfe1ee88b-0cc409c5f4.zip/node_modules/@eslint/js/",\ "packageDependencies": [\ ["@eslint/js", "npm:8.46.0"]\ ],\ "linkType": "HARD"\ }],\ ["npm:8.51.0", {\ - "packageLocation": "../../../../.yarn/berry/cache/@eslint-js-npm-8.51.0-51f088b88b-10.zip/node_modules/@eslint/js/",\ + "packageLocation": "./.yarn/cache/@eslint-js-npm-8.51.0-51f088b88b-1641f02c78.zip/node_modules/@eslint/js/",\ "packageDependencies": [\ ["@eslint/js", "npm:8.51.0"]\ ],\ @@ -204,7 +204,7 @@ const RAW_RUNTIME_STATE = ]],\ ["@humanwhocodes/config-array", [\ ["npm:0.11.10", {\ - "packageLocation": "../../../../.yarn/berry/cache/@humanwhocodes-config-array-npm-0.11.10-7b63df9e7f-10.zip/node_modules/@humanwhocodes/config-array/",\ + "packageLocation": "./.yarn/cache/@humanwhocodes-config-array-npm-0.11.10-7b63df9e7f-f93086ae6a.zip/node_modules/@humanwhocodes/config-array/",\ "packageDependencies": [\ ["@humanwhocodes/config-array", "npm:0.11.10"],\ ["@humanwhocodes/object-schema", "npm:1.2.1"],\ @@ -214,7 +214,7 @@ const RAW_RUNTIME_STATE = "linkType": "HARD"\ }],\ ["npm:0.11.11", {\ - "packageLocation": "../../../../.yarn/berry/cache/@humanwhocodes-config-array-npm-0.11.11-e3582554ee-10.zip/node_modules/@humanwhocodes/config-array/",\ + "packageLocation": "./.yarn/cache/@humanwhocodes-config-array-npm-0.11.11-e3582554ee-4aad64bc4c.zip/node_modules/@humanwhocodes/config-array/",\ "packageDependencies": [\ ["@humanwhocodes/config-array", "npm:0.11.11"],\ ["@humanwhocodes/object-schema", "npm:1.2.1"],\ @@ -226,7 +226,7 @@ const RAW_RUNTIME_STATE = ]],\ ["@humanwhocodes/module-importer", [\ ["npm:1.0.1", {\ - "packageLocation": "../../../../.yarn/berry/cache/@humanwhocodes-module-importer-npm-1.0.1-9d07ed2e4a-10.zip/node_modules/@humanwhocodes/module-importer/",\ + "packageLocation": "./.yarn/cache/@humanwhocodes-module-importer-npm-1.0.1-9d07ed2e4a-e993950e34.zip/node_modules/@humanwhocodes/module-importer/",\ "packageDependencies": [\ ["@humanwhocodes/module-importer", "npm:1.0.1"]\ ],\ @@ -235,7 +235,7 @@ const RAW_RUNTIME_STATE = ]],\ ["@humanwhocodes/object-schema", [\ ["npm:1.2.1", {\ - "packageLocation": "../../../../.yarn/berry/cache/@humanwhocodes-object-schema-npm-1.2.1-eb622b5d0e-10.zip/node_modules/@humanwhocodes/object-schema/",\ + "packageLocation": "./.yarn/cache/@humanwhocodes-object-schema-npm-1.2.1-eb622b5d0e-b48a8f87fc.zip/node_modules/@humanwhocodes/object-schema/",\ "packageDependencies": [\ ["@humanwhocodes/object-schema", "npm:1.2.1"]\ ],\ @@ -244,7 +244,7 @@ const RAW_RUNTIME_STATE = ]],\ ["@isaacs/cliui", [\ ["npm:8.0.2", {\ - "packageLocation": "../../../../.yarn/berry/cache/@isaacs-cliui-npm-8.0.2-f4364666d5-10.zip/node_modules/@isaacs/cliui/",\ + "packageLocation": "./.yarn/cache/@isaacs-cliui-npm-8.0.2-f4364666d5-e9ed5fd27c.zip/node_modules/@isaacs/cliui/",\ "packageDependencies": [\ ["@isaacs/cliui", "npm:8.0.2"],\ ["string-width", "npm:5.1.2"],\ @@ -268,7 +268,7 @@ const RAW_RUNTIME_STATE = ]],\ ["@jridgewell/gen-mapping", [\ ["npm:0.3.3", {\ - "packageLocation": "../../../../.yarn/berry/cache/@jridgewell-gen-mapping-npm-0.3.3-1815eba94c-10.zip/node_modules/@jridgewell/gen-mapping/",\ + "packageLocation": "./.yarn/cache/@jridgewell-gen-mapping-npm-0.3.3-1815eba94c-072ace159c.zip/node_modules/@jridgewell/gen-mapping/",\ "packageDependencies": [\ ["@jridgewell/gen-mapping", "npm:0.3.3"],\ ["@jridgewell/set-array", "npm:1.1.2"],\ @@ -280,7 +280,7 @@ const RAW_RUNTIME_STATE = ]],\ ["@jridgewell/resolve-uri", [\ ["npm:3.1.1", {\ - "packageLocation": "../../../../.yarn/berry/cache/@jridgewell-resolve-uri-npm-3.1.1-aa2de3f210-10.zip/node_modules/@jridgewell/resolve-uri/",\ + "packageLocation": "./.yarn/cache/@jridgewell-resolve-uri-npm-3.1.1-aa2de3f210-64d59df8ae.zip/node_modules/@jridgewell/resolve-uri/",\ "packageDependencies": [\ ["@jridgewell/resolve-uri", "npm:3.1.1"]\ ],\ @@ -289,7 +289,7 @@ const RAW_RUNTIME_STATE = ]],\ ["@jridgewell/set-array", [\ ["npm:1.1.2", {\ - "packageLocation": "../../../../.yarn/berry/cache/@jridgewell-set-array-npm-1.1.2-45b82d7fb6-10.zip/node_modules/@jridgewell/set-array/",\ + "packageLocation": "./.yarn/cache/@jridgewell-set-array-npm-1.1.2-45b82d7fb6-69a84d5980.zip/node_modules/@jridgewell/set-array/",\ "packageDependencies": [\ ["@jridgewell/set-array", "npm:1.1.2"]\ ],\ @@ -298,7 +298,7 @@ const RAW_RUNTIME_STATE = ]],\ ["@jridgewell/source-map", [\ ["npm:0.3.5", {\ - "packageLocation": "../../../../.yarn/berry/cache/@jridgewell-source-map-npm-0.3.5-9f964eaf44-10.zip/node_modules/@jridgewell/source-map/",\ + "packageLocation": "./.yarn/cache/@jridgewell-source-map-npm-0.3.5-9f964eaf44-73838ac432.zip/node_modules/@jridgewell/source-map/",\ "packageDependencies": [\ ["@jridgewell/source-map", "npm:0.3.5"],\ ["@jridgewell/gen-mapping", "npm:0.3.3"],\ @@ -309,7 +309,7 @@ const RAW_RUNTIME_STATE = ]],\ ["@jridgewell/sourcemap-codec", [\ ["npm:1.4.15", {\ - "packageLocation": "../../../../.yarn/berry/cache/@jridgewell-sourcemap-codec-npm-1.4.15-a055fb62cf-10.zip/node_modules/@jridgewell/sourcemap-codec/",\ + "packageLocation": "./.yarn/cache/@jridgewell-sourcemap-codec-npm-1.4.15-a055fb62cf-89960ac087.zip/node_modules/@jridgewell/sourcemap-codec/",\ "packageDependencies": [\ ["@jridgewell/sourcemap-codec", "npm:1.4.15"]\ ],\ @@ -318,7 +318,7 @@ const RAW_RUNTIME_STATE = ]],\ ["@jridgewell/trace-mapping", [\ ["npm:0.3.20", {\ - "packageLocation": "../../../../.yarn/berry/cache/@jridgewell-trace-mapping-npm-0.3.20-d90f282910-10.zip/node_modules/@jridgewell/trace-mapping/",\ + "packageLocation": "./.yarn/cache/@jridgewell-trace-mapping-npm-0.3.20-d90f282910-683117e4e6.zip/node_modules/@jridgewell/trace-mapping/",\ "packageDependencies": [\ ["@jridgewell/trace-mapping", "npm:0.3.20"],\ ["@jridgewell/resolve-uri", "npm:3.1.1"],\ @@ -329,7 +329,7 @@ const RAW_RUNTIME_STATE = ]],\ ["@nodelib/fs.scandir", [\ ["npm:2.1.5", {\ - "packageLocation": "../../../../.yarn/berry/cache/@nodelib-fs.scandir-npm-2.1.5-89c67370dd-10.zip/node_modules/@nodelib/fs.scandir/",\ + "packageLocation": "./.yarn/cache/@nodelib-fs.scandir-npm-2.1.5-89c67370dd-6ab2a9b8a1.zip/node_modules/@nodelib/fs.scandir/",\ "packageDependencies": [\ ["@nodelib/fs.scandir", "npm:2.1.5"],\ ["@nodelib/fs.stat", "npm:2.0.5"],\ @@ -340,7 +340,7 @@ const RAW_RUNTIME_STATE = ]],\ ["@nodelib/fs.stat", [\ ["npm:2.0.5", {\ - "packageLocation": "../../../../.yarn/berry/cache/@nodelib-fs.stat-npm-2.0.5-01f4dd3030-10.zip/node_modules/@nodelib/fs.stat/",\ + "packageLocation": "./.yarn/cache/@nodelib-fs.stat-npm-2.0.5-01f4dd3030-012480b5ca.zip/node_modules/@nodelib/fs.stat/",\ "packageDependencies": [\ ["@nodelib/fs.stat", "npm:2.0.5"]\ ],\ @@ -349,7 +349,7 @@ const RAW_RUNTIME_STATE = ]],\ ["@nodelib/fs.walk", [\ ["npm:1.2.8", {\ - "packageLocation": "../../../../.yarn/berry/cache/@nodelib-fs.walk-npm-1.2.8-b4a89da548-10.zip/node_modules/@nodelib/fs.walk/",\ + "packageLocation": "./.yarn/cache/@nodelib-fs.walk-npm-1.2.8-b4a89da548-40033e33e9.zip/node_modules/@nodelib/fs.walk/",\ "packageDependencies": [\ ["@nodelib/fs.walk", "npm:1.2.8"],\ ["@nodelib/fs.scandir", "npm:2.1.5"],\ @@ -360,7 +360,7 @@ const RAW_RUNTIME_STATE = ]],\ ["@npmcli/fs", [\ ["npm:3.1.0", {\ - "packageLocation": "../../../../.yarn/berry/cache/@npmcli-fs-npm-3.1.0-0844a57978-10.zip/node_modules/@npmcli/fs/",\ + "packageLocation": "./.yarn/cache/@npmcli-fs-npm-3.1.0-0844a57978-f3a7ab3a31.zip/node_modules/@npmcli/fs/",\ "packageDependencies": [\ ["@npmcli/fs", "npm:3.1.0"],\ ["semver", "npm:7.5.4"]\ @@ -426,7 +426,7 @@ const RAW_RUNTIME_STATE = ]],\ ["@pkgjs/parseargs", [\ ["npm:0.11.0", {\ - "packageLocation": "../../../../.yarn/berry/cache/@pkgjs-parseargs-npm-0.11.0-cd2a3fe948-10.zip/node_modules/@pkgjs/parseargs/",\ + "packageLocation": "./.yarn/cache/@pkgjs-parseargs-npm-0.11.0-cd2a3fe948-115e8ceeec.zip/node_modules/@pkgjs/parseargs/",\ "packageDependencies": [\ ["@pkgjs/parseargs", "npm:0.11.0"]\ ],\ @@ -435,14 +435,14 @@ const RAW_RUNTIME_STATE = ]],\ ["@tootallnate/once", [\ ["npm:1.1.2", {\ - "packageLocation": "../../../../.yarn/berry/cache/@tootallnate-once-npm-1.1.2-0517220057-10.zip/node_modules/@tootallnate/once/",\ + "packageLocation": "./.yarn/cache/@tootallnate-once-npm-1.1.2-0517220057-e1fb1bbbc1.zip/node_modules/@tootallnate/once/",\ "packageDependencies": [\ ["@tootallnate/once", "npm:1.1.2"]\ ],\ "linkType": "HARD"\ }],\ ["npm:2.0.0", {\ - "packageLocation": "../../../../.yarn/berry/cache/@tootallnate-once-npm-2.0.0-e36cf4f140-10.zip/node_modules/@tootallnate/once/",\ + "packageLocation": "./.yarn/cache/@tootallnate-once-npm-2.0.0-e36cf4f140-ad87447820.zip/node_modules/@tootallnate/once/",\ "packageDependencies": [\ ["@tootallnate/once", "npm:2.0.0"]\ ],\ @@ -451,7 +451,7 @@ const RAW_RUNTIME_STATE = ]],\ ["@types/eslint", [\ ["npm:8.44.6", {\ - "packageLocation": "../../../../.yarn/berry/cache/@types-eslint-npm-8.44.6-5d79f5da7d-10.zip/node_modules/@types/eslint/",\ + "packageLocation": "./.yarn/cache/@types-eslint-npm-8.44.6-5d79f5da7d-07ee27c180.zip/node_modules/@types/eslint/",\ "packageDependencies": [\ ["@types/eslint", "npm:8.44.6"],\ ["@types/estree", "npm:1.0.3"],\ @@ -462,7 +462,7 @@ const RAW_RUNTIME_STATE = ]],\ ["@types/eslint-scope", [\ ["npm:3.7.6", {\ - "packageLocation": "../../../../.yarn/berry/cache/@types-eslint-scope-npm-3.7.6-21feb9c235-10.zip/node_modules/@types/eslint-scope/",\ + "packageLocation": "./.yarn/cache/@types-eslint-scope-npm-3.7.6-21feb9c235-a2339e3129.zip/node_modules/@types/eslint-scope/",\ "packageDependencies": [\ ["@types/eslint-scope", "npm:3.7.6"],\ ["@types/eslint", "npm:8.44.6"],\ @@ -473,7 +473,7 @@ const RAW_RUNTIME_STATE = ]],\ ["@types/estree", [\ ["npm:1.0.3", {\ - "packageLocation": "../../../../.yarn/berry/cache/@types-estree-npm-1.0.3-716b9810bd-10.zip/node_modules/@types/estree/",\ + "packageLocation": "./.yarn/cache/@types-estree-npm-1.0.3-716b9810bd-c51984ec30.zip/node_modules/@types/estree/",\ "packageDependencies": [\ ["@types/estree", "npm:1.0.3"]\ ],\ @@ -482,7 +482,7 @@ const RAW_RUNTIME_STATE = ]],\ ["@types/glob", [\ ["npm:8.1.0", {\ - "packageLocation": "../../../../.yarn/berry/cache/@types-glob-npm-8.1.0-bdb9d0520c-10.zip/node_modules/@types/glob/",\ + "packageLocation": "./.yarn/cache/@types-glob-npm-8.1.0-bdb9d0520c-9101f3a906.zip/node_modules/@types/glob/",\ "packageDependencies": [\ ["@types/glob", "npm:8.1.0"],\ ["@types/minimatch", "npm:5.1.2"],\ @@ -493,7 +493,7 @@ const RAW_RUNTIME_STATE = ]],\ ["@types/json-schema", [\ ["npm:7.0.14", {\ - "packageLocation": "../../../../.yarn/berry/cache/@types-json-schema-npm-7.0.14-7dad9e71b4-10.zip/node_modules/@types/json-schema/",\ + "packageLocation": "./.yarn/cache/@types-json-schema-npm-7.0.14-7dad9e71b4-84b5efed51.zip/node_modules/@types/json-schema/",\ "packageDependencies": [\ ["@types/json-schema", "npm:7.0.14"]\ ],\ @@ -502,7 +502,7 @@ const RAW_RUNTIME_STATE = ]],\ ["@types/minimatch", [\ ["npm:5.1.2", {\ - "packageLocation": "../../../../.yarn/berry/cache/@types-minimatch-npm-5.1.2-aab9c394d3-10.zip/node_modules/@types/minimatch/",\ + "packageLocation": "./.yarn/cache/@types-minimatch-npm-5.1.2-aab9c394d3-94db5060d2.zip/node_modules/@types/minimatch/",\ "packageDependencies": [\ ["@types/minimatch", "npm:5.1.2"]\ ],\ @@ -511,7 +511,7 @@ const RAW_RUNTIME_STATE = ]],\ ["@types/mocha", [\ ["npm:10.0.3", {\ - "packageLocation": "../../../../.yarn/berry/cache/@types-mocha-npm-10.0.3-a45fafc70f-10.zip/node_modules/@types/mocha/",\ + "packageLocation": "./.yarn/cache/@types-mocha-npm-10.0.3-a45fafc70f-31d44b6a45.zip/node_modules/@types/mocha/",\ "packageDependencies": [\ ["@types/mocha", "npm:10.0.3"]\ ],\ @@ -520,14 +520,14 @@ const RAW_RUNTIME_STATE = ]],\ ["@types/node", [\ ["npm:20.2.5", {\ - "packageLocation": "../../../../.yarn/berry/cache/@types-node-npm-20.2.5-0014d2d9ce-10.zip/node_modules/@types/node/",\ + "packageLocation": "./.yarn/cache/@types-node-npm-20.2.5-0014d2d9ce-37529473f0.zip/node_modules/@types/node/",\ "packageDependencies": [\ ["@types/node", "npm:20.2.5"]\ ],\ "linkType": "HARD"\ }],\ ["npm:20.8.7", {\ - "packageLocation": "../../../../.yarn/berry/cache/@types-node-npm-20.8.7-a09c56cd33-10.zip/node_modules/@types/node/",\ + "packageLocation": "./.yarn/cache/@types-node-npm-20.8.7-a09c56cd33-a347ac7e6a.zip/node_modules/@types/node/",\ "packageDependencies": [\ ["@types/node", "npm:20.8.7"],\ ["undici-types", "npm:5.25.3"]\ @@ -537,7 +537,7 @@ const RAW_RUNTIME_STATE = ]],\ ["@types/semver", [\ ["npm:7.5.4", {\ - "packageLocation": "../../../../.yarn/berry/cache/@types-semver-npm-7.5.4-aa93e70844-10.zip/node_modules/@types/semver/",\ + "packageLocation": "./.yarn/cache/@types-semver-npm-7.5.4-aa93e70844-e99c3edc8d.zip/node_modules/@types/semver/",\ "packageDependencies": [\ ["@types/semver", "npm:7.5.4"]\ ],\ @@ -546,7 +546,7 @@ const RAW_RUNTIME_STATE = ]],\ ["@types/vscode", [\ ["npm:1.83.1", {\ - "packageLocation": "../../../../.yarn/berry/cache/@types-vscode-npm-1.83.1-1e622f7668-10.zip/node_modules/@types/vscode/",\ + "packageLocation": "./.yarn/cache/@types-vscode-npm-1.83.1-1e622f7668-4acffc6586.zip/node_modules/@types/vscode/",\ "packageDependencies": [\ ["@types/vscode", "npm:1.83.1"]\ ],\ @@ -555,14 +555,14 @@ const RAW_RUNTIME_STATE = ]],\ ["@typescript-eslint/eslint-plugin", [\ ["npm:5.62.0", {\ - "packageLocation": "../../../../.yarn/berry/cache/@typescript-eslint-eslint-plugin-npm-5.62.0-c48b9a5492-10.zip/node_modules/@typescript-eslint/eslint-plugin/",\ + "packageLocation": "./.yarn/cache/@typescript-eslint-eslint-plugin-npm-5.62.0-c48b9a5492-9cc8319c6f.zip/node_modules/@typescript-eslint/eslint-plugin/",\ "packageDependencies": [\ ["@typescript-eslint/eslint-plugin", "npm:5.62.0"]\ ],\ "linkType": "SOFT"\ }],\ ["virtual:2b9e7e7d573ed38308251d9cfa9bcac1c01394d20ff25d4a07b4a0345be370b65803551137c4363442bf76c7d6f9363387c180207a65457c6616ca7fd9b2a56b#npm:5.62.0", {\ - "packageLocation": "./.yarn/__virtual__/@typescript-eslint-eslint-plugin-virtual-89014fb2f7/5/.yarn/berry/cache/@typescript-eslint-eslint-plugin-npm-5.62.0-c48b9a5492-10.zip/node_modules/@typescript-eslint/eslint-plugin/",\ + "packageLocation": "./.yarn/__virtual__/@typescript-eslint-eslint-plugin-virtual-89014fb2f7/0/cache/@typescript-eslint-eslint-plugin-npm-5.62.0-c48b9a5492-9cc8319c6f.zip/node_modules/@typescript-eslint/eslint-plugin/",\ "packageDependencies": [\ ["@typescript-eslint/eslint-plugin", "virtual:2b9e7e7d573ed38308251d9cfa9bcac1c01394d20ff25d4a07b4a0345be370b65803551137c4363442bf76c7d6f9363387c180207a65457c6616ca7fd9b2a56b#npm:5.62.0"],\ ["@eslint-community/regexpp", "npm:4.9.1"],\ @@ -595,14 +595,14 @@ const RAW_RUNTIME_STATE = ]],\ ["@typescript-eslint/parser", [\ ["npm:5.62.0", {\ - "packageLocation": "../../../../.yarn/berry/cache/@typescript-eslint-parser-npm-5.62.0-c6b29fa302-10.zip/node_modules/@typescript-eslint/parser/",\ + "packageLocation": "./.yarn/cache/@typescript-eslint-parser-npm-5.62.0-c6b29fa302-b6ca629d8f.zip/node_modules/@typescript-eslint/parser/",\ "packageDependencies": [\ ["@typescript-eslint/parser", "npm:5.62.0"]\ ],\ "linkType": "SOFT"\ }],\ ["virtual:2b9e7e7d573ed38308251d9cfa9bcac1c01394d20ff25d4a07b4a0345be370b65803551137c4363442bf76c7d6f9363387c180207a65457c6616ca7fd9b2a56b#npm:5.62.0", {\ - "packageLocation": "./.yarn/__virtual__/@typescript-eslint-parser-virtual-919dcabc11/5/.yarn/berry/cache/@typescript-eslint-parser-npm-5.62.0-c6b29fa302-10.zip/node_modules/@typescript-eslint/parser/",\ + "packageLocation": "./.yarn/__virtual__/@typescript-eslint-parser-virtual-919dcabc11/0/cache/@typescript-eslint-parser-npm-5.62.0-c6b29fa302-b6ca629d8f.zip/node_modules/@typescript-eslint/parser/",\ "packageDependencies": [\ ["@typescript-eslint/parser", "virtual:2b9e7e7d573ed38308251d9cfa9bcac1c01394d20ff25d4a07b4a0345be370b65803551137c4363442bf76c7d6f9363387c180207a65457c6616ca7fd9b2a56b#npm:5.62.0"],\ ["@types/eslint", null],\ @@ -625,7 +625,7 @@ const RAW_RUNTIME_STATE = ]],\ ["@typescript-eslint/scope-manager", [\ ["npm:5.62.0", {\ - "packageLocation": "../../../../.yarn/berry/cache/@typescript-eslint-scope-manager-npm-5.62.0-c0013838b0-10.zip/node_modules/@typescript-eslint/scope-manager/",\ + "packageLocation": "./.yarn/cache/@typescript-eslint-scope-manager-npm-5.62.0-c0013838b0-e827770baa.zip/node_modules/@typescript-eslint/scope-manager/",\ "packageDependencies": [\ ["@typescript-eslint/scope-manager", "npm:5.62.0"],\ ["@typescript-eslint/types", "npm:5.62.0"],\ @@ -636,14 +636,14 @@ const RAW_RUNTIME_STATE = ]],\ ["@typescript-eslint/type-utils", [\ ["npm:5.62.0", {\ - "packageLocation": "../../../../.yarn/berry/cache/@typescript-eslint-type-utils-npm-5.62.0-220216d668-10.zip/node_modules/@typescript-eslint/type-utils/",\ + "packageLocation": "./.yarn/cache/@typescript-eslint-type-utils-npm-5.62.0-220216d668-f9a4398d6d.zip/node_modules/@typescript-eslint/type-utils/",\ "packageDependencies": [\ ["@typescript-eslint/type-utils", "npm:5.62.0"]\ ],\ "linkType": "SOFT"\ }],\ ["virtual:89014fb2f72da20eb87d54c80bac37610b57a73485dee5ebf9333bf5c4bce0d972953cbf0f48420b275d3bc40f36aded8d47d2d24281f85e903e5d354ec64e4e#npm:5.62.0", {\ - "packageLocation": "./.yarn/__virtual__/@typescript-eslint-type-utils-virtual-7f3bc25884/5/.yarn/berry/cache/@typescript-eslint-type-utils-npm-5.62.0-220216d668-10.zip/node_modules/@typescript-eslint/type-utils/",\ + "packageLocation": "./.yarn/__virtual__/@typescript-eslint-type-utils-virtual-7f3bc25884/0/cache/@typescript-eslint-type-utils-npm-5.62.0-220216d668-f9a4398d6d.zip/node_modules/@typescript-eslint/type-utils/",\ "packageDependencies": [\ ["@typescript-eslint/type-utils", "virtual:89014fb2f72da20eb87d54c80bac37610b57a73485dee5ebf9333bf5c4bce0d972953cbf0f48420b275d3bc40f36aded8d47d2d24281f85e903e5d354ec64e4e#npm:5.62.0"],\ ["@types/eslint", null],\ @@ -666,7 +666,7 @@ const RAW_RUNTIME_STATE = ]],\ ["@typescript-eslint/types", [\ ["npm:5.62.0", {\ - "packageLocation": "../../../../.yarn/berry/cache/@typescript-eslint-types-npm-5.62.0-5c2e0aab15-10.zip/node_modules/@typescript-eslint/types/",\ + "packageLocation": "./.yarn/cache/@typescript-eslint-types-npm-5.62.0-5c2e0aab15-24e8443177.zip/node_modules/@typescript-eslint/types/",\ "packageDependencies": [\ ["@typescript-eslint/types", "npm:5.62.0"]\ ],\ @@ -675,14 +675,14 @@ const RAW_RUNTIME_STATE = ]],\ ["@typescript-eslint/typescript-estree", [\ ["npm:5.62.0", {\ - "packageLocation": "../../../../.yarn/berry/cache/@typescript-eslint-typescript-estree-npm-5.62.0-5d1ea132a9-10.zip/node_modules/@typescript-eslint/typescript-estree/",\ + "packageLocation": "./.yarn/cache/@typescript-eslint-typescript-estree-npm-5.62.0-5d1ea132a9-06c975eb5f.zip/node_modules/@typescript-eslint/typescript-estree/",\ "packageDependencies": [\ ["@typescript-eslint/typescript-estree", "npm:5.62.0"]\ ],\ "linkType": "SOFT"\ }],\ ["virtual:7f3bc25884a68a29ac4d296cb19161080b5427dc732e6412b6c8cd95f25543caace2cc48bfd515b6ed39d97808f3fde9257ccd25f2112571b23f01c85c15a049#npm:5.62.0", {\ - "packageLocation": "./.yarn/__virtual__/@typescript-eslint-typescript-estree-virtual-b284e7015c/5/.yarn/berry/cache/@typescript-eslint-typescript-estree-npm-5.62.0-5d1ea132a9-10.zip/node_modules/@typescript-eslint/typescript-estree/",\ + "packageLocation": "./.yarn/__virtual__/@typescript-eslint-typescript-estree-virtual-b284e7015c/0/cache/@typescript-eslint-typescript-estree-npm-5.62.0-5d1ea132a9-06c975eb5f.zip/node_modules/@typescript-eslint/typescript-estree/",\ "packageDependencies": [\ ["@typescript-eslint/typescript-estree", "virtual:7f3bc25884a68a29ac4d296cb19161080b5427dc732e6412b6c8cd95f25543caace2cc48bfd515b6ed39d97808f3fde9257ccd25f2112571b23f01c85c15a049#npm:5.62.0"],\ ["@types/typescript", null],\ @@ -702,7 +702,7 @@ const RAW_RUNTIME_STATE = "linkType": "HARD"\ }],\ ["virtual:b6c32928e3a73473744c61c91597c46acb3aac39cfd0cb6fa763edd86d59abe50465a1795d8d98162d97d00db3b3f55ab682576f5b7c142340f4654751eec0b2#npm:5.62.0", {\ - "packageLocation": "./.yarn/__virtual__/@typescript-eslint-typescript-estree-virtual-1272cbed28/5/.yarn/berry/cache/@typescript-eslint-typescript-estree-npm-5.62.0-5d1ea132a9-10.zip/node_modules/@typescript-eslint/typescript-estree/",\ + "packageLocation": "./.yarn/__virtual__/@typescript-eslint-typescript-estree-virtual-1272cbed28/0/cache/@typescript-eslint-typescript-estree-npm-5.62.0-5d1ea132a9-06c975eb5f.zip/node_modules/@typescript-eslint/typescript-estree/",\ "packageDependencies": [\ ["@typescript-eslint/typescript-estree", "virtual:b6c32928e3a73473744c61c91597c46acb3aac39cfd0cb6fa763edd86d59abe50465a1795d8d98162d97d00db3b3f55ab682576f5b7c142340f4654751eec0b2#npm:5.62.0"],\ ["@types/typescript", null],\ @@ -724,14 +724,14 @@ const RAW_RUNTIME_STATE = ]],\ ["@typescript-eslint/utils", [\ ["npm:5.62.0", {\ - "packageLocation": "../../../../.yarn/berry/cache/@typescript-eslint-utils-npm-5.62.0-907f2d579e-10.zip/node_modules/@typescript-eslint/utils/",\ + "packageLocation": "./.yarn/cache/@typescript-eslint-utils-npm-5.62.0-907f2d579e-15ef13e439.zip/node_modules/@typescript-eslint/utils/",\ "packageDependencies": [\ ["@typescript-eslint/utils", "npm:5.62.0"]\ ],\ "linkType": "SOFT"\ }],\ ["virtual:89014fb2f72da20eb87d54c80bac37610b57a73485dee5ebf9333bf5c4bce0d972953cbf0f48420b275d3bc40f36aded8d47d2d24281f85e903e5d354ec64e4e#npm:5.62.0", {\ - "packageLocation": "./.yarn/__virtual__/@typescript-eslint-utils-virtual-b6c32928e3/5/.yarn/berry/cache/@typescript-eslint-utils-npm-5.62.0-907f2d579e-10.zip/node_modules/@typescript-eslint/utils/",\ + "packageLocation": "./.yarn/__virtual__/@typescript-eslint-utils-virtual-b6c32928e3/0/cache/@typescript-eslint-utils-npm-5.62.0-907f2d579e-15ef13e439.zip/node_modules/@typescript-eslint/utils/",\ "packageDependencies": [\ ["@typescript-eslint/utils", "virtual:89014fb2f72da20eb87d54c80bac37610b57a73485dee5ebf9333bf5c4bce0d972953cbf0f48420b275d3bc40f36aded8d47d2d24281f85e903e5d354ec64e4e#npm:5.62.0"],\ ["@eslint-community/eslint-utils", "virtual:77fce3ec74d55c7e6791631c329cf3adde374e21e618e865127f72e63efeb3376dcf7fc8217de80f5a310e81c791a72e9d099b00fd3252d5653ff68dff50c2fa#npm:4.4.0"],\ @@ -754,7 +754,7 @@ const RAW_RUNTIME_STATE = ]],\ ["@typescript-eslint/visitor-keys", [\ ["npm:5.62.0", {\ - "packageLocation": "../../../../.yarn/berry/cache/@typescript-eslint-visitor-keys-npm-5.62.0-da1af55f83-10.zip/node_modules/@typescript-eslint/visitor-keys/",\ + "packageLocation": "./.yarn/cache/@typescript-eslint-visitor-keys-npm-5.62.0-da1af55f83-dc613ab756.zip/node_modules/@typescript-eslint/visitor-keys/",\ "packageDependencies": [\ ["@typescript-eslint/visitor-keys", "npm:5.62.0"],\ ["@typescript-eslint/types", "npm:5.62.0"],\ @@ -765,7 +765,7 @@ const RAW_RUNTIME_STATE = ]],\ ["@vscode/test-electron", [\ ["npm:2.3.5", {\ - "packageLocation": "../../../../.yarn/berry/cache/@vscode-test-electron-npm-2.3.5-a094bdf2db-10.zip/node_modules/@vscode/test-electron/",\ + "packageLocation": "./.yarn/cache/@vscode-test-electron-npm-2.3.5-a094bdf2db-b0de89154f.zip/node_modules/@vscode/test-electron/",\ "packageDependencies": [\ ["@vscode/test-electron", "npm:2.3.5"],\ ["http-proxy-agent", "npm:4.0.1"],\ @@ -778,7 +778,7 @@ const RAW_RUNTIME_STATE = ]],\ ["@webassemblyjs/ast", [\ ["npm:1.11.6", {\ - "packageLocation": "../../../../.yarn/berry/cache/@webassemblyjs-ast-npm-1.11.6-d3fd2bb49a-10.zip/node_modules/@webassemblyjs/ast/",\ + "packageLocation": "./.yarn/cache/@webassemblyjs-ast-npm-1.11.6-d3fd2bb49a-4c1303971c.zip/node_modules/@webassemblyjs/ast/",\ "packageDependencies": [\ ["@webassemblyjs/ast", "npm:1.11.6"],\ ["@webassemblyjs/helper-numbers", "npm:1.11.6"],\ @@ -789,7 +789,7 @@ const RAW_RUNTIME_STATE = ]],\ ["@webassemblyjs/floating-point-hex-parser", [\ ["npm:1.11.6", {\ - "packageLocation": "../../../../.yarn/berry/cache/@webassemblyjs-floating-point-hex-parser-npm-1.11.6-3a9928fc76-10.zip/node_modules/@webassemblyjs/floating-point-hex-parser/",\ + "packageLocation": "./.yarn/cache/@webassemblyjs-floating-point-hex-parser-npm-1.11.6-3a9928fc76-29b0875884.zip/node_modules/@webassemblyjs/floating-point-hex-parser/",\ "packageDependencies": [\ ["@webassemblyjs/floating-point-hex-parser", "npm:1.11.6"]\ ],\ @@ -798,7 +798,7 @@ const RAW_RUNTIME_STATE = ]],\ ["@webassemblyjs/helper-api-error", [\ ["npm:1.11.6", {\ - "packageLocation": "../../../../.yarn/berry/cache/@webassemblyjs-helper-api-error-npm-1.11.6-75f6275ff4-10.zip/node_modules/@webassemblyjs/helper-api-error/",\ + "packageLocation": "./.yarn/cache/@webassemblyjs-helper-api-error-npm-1.11.6-75f6275ff4-e8563df851.zip/node_modules/@webassemblyjs/helper-api-error/",\ "packageDependencies": [\ ["@webassemblyjs/helper-api-error", "npm:1.11.6"]\ ],\ @@ -807,7 +807,7 @@ const RAW_RUNTIME_STATE = ]],\ ["@webassemblyjs/helper-buffer", [\ ["npm:1.11.6", {\ - "packageLocation": "../../../../.yarn/berry/cache/@webassemblyjs-helper-buffer-npm-1.11.6-69996544b0-10.zip/node_modules/@webassemblyjs/helper-buffer/",\ + "packageLocation": "./.yarn/cache/@webassemblyjs-helper-buffer-npm-1.11.6-69996544b0-b14d0573bf.zip/node_modules/@webassemblyjs/helper-buffer/",\ "packageDependencies": [\ ["@webassemblyjs/helper-buffer", "npm:1.11.6"]\ ],\ @@ -816,7 +816,7 @@ const RAW_RUNTIME_STATE = ]],\ ["@webassemblyjs/helper-numbers", [\ ["npm:1.11.6", {\ - "packageLocation": "../../../../.yarn/berry/cache/@webassemblyjs-helper-numbers-npm-1.11.6-819ddab1da-10.zip/node_modules/@webassemblyjs/helper-numbers/",\ + "packageLocation": "./.yarn/cache/@webassemblyjs-helper-numbers-npm-1.11.6-819ddab1da-9ffd258ad8.zip/node_modules/@webassemblyjs/helper-numbers/",\ "packageDependencies": [\ ["@webassemblyjs/helper-numbers", "npm:1.11.6"],\ ["@webassemblyjs/floating-point-hex-parser", "npm:1.11.6"],\ @@ -828,7 +828,7 @@ const RAW_RUNTIME_STATE = ]],\ ["@webassemblyjs/helper-wasm-bytecode", [\ ["npm:1.11.6", {\ - "packageLocation": "../../../../.yarn/berry/cache/@webassemblyjs-helper-wasm-bytecode-npm-1.11.6-3bc23747de-10.zip/node_modules/@webassemblyjs/helper-wasm-bytecode/",\ + "packageLocation": "./.yarn/cache/@webassemblyjs-helper-wasm-bytecode-npm-1.11.6-3bc23747de-4ebf03e9c1.zip/node_modules/@webassemblyjs/helper-wasm-bytecode/",\ "packageDependencies": [\ ["@webassemblyjs/helper-wasm-bytecode", "npm:1.11.6"]\ ],\ @@ -837,7 +837,7 @@ const RAW_RUNTIME_STATE = ]],\ ["@webassemblyjs/helper-wasm-section", [\ ["npm:1.11.6", {\ - "packageLocation": "../../../../.yarn/berry/cache/@webassemblyjs-helper-wasm-section-npm-1.11.6-344f8ff2af-10.zip/node_modules/@webassemblyjs/helper-wasm-section/",\ + "packageLocation": "./.yarn/cache/@webassemblyjs-helper-wasm-section-npm-1.11.6-344f8ff2af-38a615ab3d.zip/node_modules/@webassemblyjs/helper-wasm-section/",\ "packageDependencies": [\ ["@webassemblyjs/helper-wasm-section", "npm:1.11.6"],\ ["@webassemblyjs/ast", "npm:1.11.6"],\ @@ -850,7 +850,7 @@ const RAW_RUNTIME_STATE = ]],\ ["@webassemblyjs/ieee754", [\ ["npm:1.11.6", {\ - "packageLocation": "../../../../.yarn/berry/cache/@webassemblyjs-ieee754-npm-1.11.6-95c92f446a-10.zip/node_modules/@webassemblyjs/ieee754/",\ + "packageLocation": "./.yarn/cache/@webassemblyjs-ieee754-npm-1.11.6-95c92f446a-13574b8e41.zip/node_modules/@webassemblyjs/ieee754/",\ "packageDependencies": [\ ["@webassemblyjs/ieee754", "npm:1.11.6"],\ ["@xtuc/ieee754", "npm:1.2.0"]\ @@ -860,7 +860,7 @@ const RAW_RUNTIME_STATE = ]],\ ["@webassemblyjs/leb128", [\ ["npm:1.11.6", {\ - "packageLocation": "../../../../.yarn/berry/cache/@webassemblyjs-leb128-npm-1.11.6-697d62da2e-10.zip/node_modules/@webassemblyjs/leb128/",\ + "packageLocation": "./.yarn/cache/@webassemblyjs-leb128-npm-1.11.6-697d62da2e-ec3b72db0e.zip/node_modules/@webassemblyjs/leb128/",\ "packageDependencies": [\ ["@webassemblyjs/leb128", "npm:1.11.6"],\ ["@xtuc/long", "npm:4.2.2"]\ @@ -870,7 +870,7 @@ const RAW_RUNTIME_STATE = ]],\ ["@webassemblyjs/utf8", [\ ["npm:1.11.6", {\ - "packageLocation": "../../../../.yarn/berry/cache/@webassemblyjs-utf8-npm-1.11.6-102c4e5d68-10.zip/node_modules/@webassemblyjs/utf8/",\ + "packageLocation": "./.yarn/cache/@webassemblyjs-utf8-npm-1.11.6-102c4e5d68-361a537bd6.zip/node_modules/@webassemblyjs/utf8/",\ "packageDependencies": [\ ["@webassemblyjs/utf8", "npm:1.11.6"]\ ],\ @@ -879,7 +879,7 @@ const RAW_RUNTIME_STATE = ]],\ ["@webassemblyjs/wasm-edit", [\ ["npm:1.11.6", {\ - "packageLocation": "../../../../.yarn/berry/cache/@webassemblyjs-wasm-edit-npm-1.11.6-8d2703f828-10.zip/node_modules/@webassemblyjs/wasm-edit/",\ + "packageLocation": "./.yarn/cache/@webassemblyjs-wasm-edit-npm-1.11.6-8d2703f828-c168bfc6d0.zip/node_modules/@webassemblyjs/wasm-edit/",\ "packageDependencies": [\ ["@webassemblyjs/wasm-edit", "npm:1.11.6"],\ ["@webassemblyjs/ast", "npm:1.11.6"],\ @@ -896,7 +896,7 @@ const RAW_RUNTIME_STATE = ]],\ ["@webassemblyjs/wasm-gen", [\ ["npm:1.11.6", {\ - "packageLocation": "../../../../.yarn/berry/cache/@webassemblyjs-wasm-gen-npm-1.11.6-0ca036cab0-10.zip/node_modules/@webassemblyjs/wasm-gen/",\ + "packageLocation": "./.yarn/cache/@webassemblyjs-wasm-gen-npm-1.11.6-0ca036cab0-f91903506c.zip/node_modules/@webassemblyjs/wasm-gen/",\ "packageDependencies": [\ ["@webassemblyjs/wasm-gen", "npm:1.11.6"],\ ["@webassemblyjs/ast", "npm:1.11.6"],\ @@ -910,7 +910,7 @@ const RAW_RUNTIME_STATE = ]],\ ["@webassemblyjs/wasm-opt", [\ ["npm:1.11.6", {\ - "packageLocation": "../../../../.yarn/berry/cache/@webassemblyjs-wasm-opt-npm-1.11.6-8be3443975-10.zip/node_modules/@webassemblyjs/wasm-opt/",\ + "packageLocation": "./.yarn/cache/@webassemblyjs-wasm-opt-npm-1.11.6-8be3443975-e0cfeea381.zip/node_modules/@webassemblyjs/wasm-opt/",\ "packageDependencies": [\ ["@webassemblyjs/wasm-opt", "npm:1.11.6"],\ ["@webassemblyjs/ast", "npm:1.11.6"],\ @@ -923,7 +923,7 @@ const RAW_RUNTIME_STATE = ]],\ ["@webassemblyjs/wasm-parser", [\ ["npm:1.11.6", {\ - "packageLocation": "../../../../.yarn/berry/cache/@webassemblyjs-wasm-parser-npm-1.11.6-88e2433c21-10.zip/node_modules/@webassemblyjs/wasm-parser/",\ + "packageLocation": "./.yarn/cache/@webassemblyjs-wasm-parser-npm-1.11.6-88e2433c21-6995e0b7b8.zip/node_modules/@webassemblyjs/wasm-parser/",\ "packageDependencies": [\ ["@webassemblyjs/wasm-parser", "npm:1.11.6"],\ ["@webassemblyjs/ast", "npm:1.11.6"],\ @@ -938,7 +938,7 @@ const RAW_RUNTIME_STATE = ]],\ ["@webassemblyjs/wast-printer", [\ ["npm:1.11.6", {\ - "packageLocation": "../../../../.yarn/berry/cache/@webassemblyjs-wast-printer-npm-1.11.6-3191861e3f-10.zip/node_modules/@webassemblyjs/wast-printer/",\ + "packageLocation": "./.yarn/cache/@webassemblyjs-wast-printer-npm-1.11.6-3191861e3f-fd45fd0d69.zip/node_modules/@webassemblyjs/wast-printer/",\ "packageDependencies": [\ ["@webassemblyjs/wast-printer", "npm:1.11.6"],\ ["@webassemblyjs/ast", "npm:1.11.6"],\ @@ -949,14 +949,14 @@ const RAW_RUNTIME_STATE = ]],\ ["@webpack-cli/configtest", [\ ["npm:2.1.1", {\ - "packageLocation": "../../../../.yarn/berry/cache/@webpack-cli-configtest-npm-2.1.1-2aa637b6bc-10.zip/node_modules/@webpack-cli/configtest/",\ + "packageLocation": "./.yarn/cache/@webpack-cli-configtest-npm-2.1.1-2aa637b6bc-9f9f9145c2.zip/node_modules/@webpack-cli/configtest/",\ "packageDependencies": [\ ["@webpack-cli/configtest", "npm:2.1.1"]\ ],\ "linkType": "SOFT"\ }],\ ["virtual:18451f3d8e5dacbf26b98823a0220f7b3f28daca71aa13b5ae585b8cdfc3a8ac3080a26c1c965a6c95afb7ef7c053188674829161ad475a0246dbc7ad48bc72c#npm:2.1.1", {\ - "packageLocation": "./.yarn/__virtual__/@webpack-cli-configtest-virtual-5a62e799ca/5/.yarn/berry/cache/@webpack-cli-configtest-npm-2.1.1-2aa637b6bc-10.zip/node_modules/@webpack-cli/configtest/",\ + "packageLocation": "./.yarn/__virtual__/@webpack-cli-configtest-virtual-5a62e799ca/0/cache/@webpack-cli-configtest-npm-2.1.1-2aa637b6bc-9f9f9145c2.zip/node_modules/@webpack-cli/configtest/",\ "packageDependencies": [\ ["@webpack-cli/configtest", "virtual:18451f3d8e5dacbf26b98823a0220f7b3f28daca71aa13b5ae585b8cdfc3a8ac3080a26c1c965a6c95afb7ef7c053188674829161ad475a0246dbc7ad48bc72c#npm:2.1.1"],\ ["@types/webpack", null],\ @@ -975,14 +975,14 @@ const RAW_RUNTIME_STATE = ]],\ ["@webpack-cli/info", [\ ["npm:2.0.2", {\ - "packageLocation": "../../../../.yarn/berry/cache/@webpack-cli-info-npm-2.0.2-494be2e91a-10.zip/node_modules/@webpack-cli/info/",\ + "packageLocation": "./.yarn/cache/@webpack-cli-info-npm-2.0.2-494be2e91a-8f9a178afc.zip/node_modules/@webpack-cli/info/",\ "packageDependencies": [\ ["@webpack-cli/info", "npm:2.0.2"]\ ],\ "linkType": "SOFT"\ }],\ ["virtual:18451f3d8e5dacbf26b98823a0220f7b3f28daca71aa13b5ae585b8cdfc3a8ac3080a26c1c965a6c95afb7ef7c053188674829161ad475a0246dbc7ad48bc72c#npm:2.0.2", {\ - "packageLocation": "./.yarn/__virtual__/@webpack-cli-info-virtual-77ec15a80f/5/.yarn/berry/cache/@webpack-cli-info-npm-2.0.2-494be2e91a-10.zip/node_modules/@webpack-cli/info/",\ + "packageLocation": "./.yarn/__virtual__/@webpack-cli-info-virtual-77ec15a80f/0/cache/@webpack-cli-info-npm-2.0.2-494be2e91a-8f9a178afc.zip/node_modules/@webpack-cli/info/",\ "packageDependencies": [\ ["@webpack-cli/info", "virtual:18451f3d8e5dacbf26b98823a0220f7b3f28daca71aa13b5ae585b8cdfc3a8ac3080a26c1c965a6c95afb7ef7c053188674829161ad475a0246dbc7ad48bc72c#npm:2.0.2"],\ ["@types/webpack", null],\ @@ -1001,14 +1001,14 @@ const RAW_RUNTIME_STATE = ]],\ ["@webpack-cli/serve", [\ ["npm:2.0.5", {\ - "packageLocation": "../../../../.yarn/berry/cache/@webpack-cli-serve-npm-2.0.5-5a220c2601-10.zip/node_modules/@webpack-cli/serve/",\ + "packageLocation": "./.yarn/cache/@webpack-cli-serve-npm-2.0.5-5a220c2601-20424e5c1e.zip/node_modules/@webpack-cli/serve/",\ "packageDependencies": [\ ["@webpack-cli/serve", "npm:2.0.5"]\ ],\ "linkType": "SOFT"\ }],\ ["virtual:18451f3d8e5dacbf26b98823a0220f7b3f28daca71aa13b5ae585b8cdfc3a8ac3080a26c1c965a6c95afb7ef7c053188674829161ad475a0246dbc7ad48bc72c#npm:2.0.5", {\ - "packageLocation": "./.yarn/__virtual__/@webpack-cli-serve-virtual-b389e525db/5/.yarn/berry/cache/@webpack-cli-serve-npm-2.0.5-5a220c2601-10.zip/node_modules/@webpack-cli/serve/",\ + "packageLocation": "./.yarn/__virtual__/@webpack-cli-serve-virtual-b389e525db/0/cache/@webpack-cli-serve-npm-2.0.5-5a220c2601-20424e5c1e.zip/node_modules/@webpack-cli/serve/",\ "packageDependencies": [\ ["@webpack-cli/serve", "virtual:18451f3d8e5dacbf26b98823a0220f7b3f28daca71aa13b5ae585b8cdfc3a8ac3080a26c1c965a6c95afb7ef7c053188674829161ad475a0246dbc7ad48bc72c#npm:2.0.5"],\ ["@types/webpack", null],\ @@ -1031,7 +1031,7 @@ const RAW_RUNTIME_STATE = ]],\ ["@xtuc/ieee754", [\ ["npm:1.2.0", {\ - "packageLocation": "../../../../.yarn/berry/cache/@xtuc-ieee754-npm-1.2.0-ec0ce4e025-10.zip/node_modules/@xtuc/ieee754/",\ + "packageLocation": "./.yarn/cache/@xtuc-ieee754-npm-1.2.0-ec0ce4e025-ab033b0329.zip/node_modules/@xtuc/ieee754/",\ "packageDependencies": [\ ["@xtuc/ieee754", "npm:1.2.0"]\ ],\ @@ -1040,7 +1040,7 @@ const RAW_RUNTIME_STATE = ]],\ ["@xtuc/long", [\ ["npm:4.2.2", {\ - "packageLocation": "../../../../.yarn/berry/cache/@xtuc-long-npm-4.2.2-37236e6d72-10.zip/node_modules/@xtuc/long/",\ + "packageLocation": "./.yarn/cache/@xtuc-long-npm-4.2.2-37236e6d72-7217bae9fe.zip/node_modules/@xtuc/long/",\ "packageDependencies": [\ ["@xtuc/long", "npm:4.2.2"]\ ],\ @@ -1049,7 +1049,7 @@ const RAW_RUNTIME_STATE = ]],\ ["abbrev", [\ ["npm:1.1.1", {\ - "packageLocation": "../../../../.yarn/berry/cache/abbrev-npm-1.1.1-3659247eab-10.zip/node_modules/abbrev/",\ + "packageLocation": "./.yarn/cache/abbrev-npm-1.1.1-3659247eab-2d88294118.zip/node_modules/abbrev/",\ "packageDependencies": [\ ["abbrev", "npm:1.1.1"]\ ],\ @@ -1058,7 +1058,7 @@ const RAW_RUNTIME_STATE = ]],\ ["acorn", [\ ["npm:8.10.0", {\ - "packageLocation": "../../../../.yarn/berry/cache/acorn-npm-8.10.0-2230c9e83e-10.zip/node_modules/acorn/",\ + "packageLocation": "./.yarn/cache/acorn-npm-8.10.0-2230c9e83e-522310c20f.zip/node_modules/acorn/",\ "packageDependencies": [\ ["acorn", "npm:8.10.0"]\ ],\ @@ -1067,14 +1067,14 @@ const RAW_RUNTIME_STATE = ]],\ ["acorn-import-assertions", [\ ["npm:1.9.0", {\ - "packageLocation": "../../../../.yarn/berry/cache/acorn-import-assertions-npm-1.9.0-22f56507c7-10.zip/node_modules/acorn-import-assertions/",\ + "packageLocation": "./.yarn/cache/acorn-import-assertions-npm-1.9.0-22f56507c7-af8dd58f6b.zip/node_modules/acorn-import-assertions/",\ "packageDependencies": [\ ["acorn-import-assertions", "npm:1.9.0"]\ ],\ "linkType": "SOFT"\ }],\ ["virtual:b98590e6182f1e3e809675a880704d2c50533e40386e60683f5d6ae6206f5e5e58cf33b625935351b9a4ef2066acd33ce7f25a0d7055a7a23f1ec398f2c56b3f#npm:1.9.0", {\ - "packageLocation": "./.yarn/__virtual__/acorn-import-assertions-virtual-fbd09c42d2/5/.yarn/berry/cache/acorn-import-assertions-npm-1.9.0-22f56507c7-10.zip/node_modules/acorn-import-assertions/",\ + "packageLocation": "./.yarn/__virtual__/acorn-import-assertions-virtual-fbd09c42d2/0/cache/acorn-import-assertions-npm-1.9.0-22f56507c7-af8dd58f6b.zip/node_modules/acorn-import-assertions/",\ "packageDependencies": [\ ["acorn-import-assertions", "virtual:b98590e6182f1e3e809675a880704d2c50533e40386e60683f5d6ae6206f5e5e58cf33b625935351b9a4ef2066acd33ce7f25a0d7055a7a23f1ec398f2c56b3f#npm:1.9.0"],\ ["@types/acorn", null],\ @@ -1089,14 +1089,14 @@ const RAW_RUNTIME_STATE = ]],\ ["acorn-jsx", [\ ["npm:5.3.2", {\ - "packageLocation": "../../../../.yarn/berry/cache/acorn-jsx-npm-5.3.2-d7594599ea-10.zip/node_modules/acorn-jsx/",\ + "packageLocation": "./.yarn/cache/acorn-jsx-npm-5.3.2-d7594599ea-d4371eaef7.zip/node_modules/acorn-jsx/",\ "packageDependencies": [\ ["acorn-jsx", "npm:5.3.2"]\ ],\ "linkType": "SOFT"\ }],\ ["virtual:a50722a5a9326b6a5f12350c494c4db3aa0f4caeac45e3e9e5fe071da20014ecfe738fe2ebe2c9c98abae81a4ea86b42f56d776b3bd5ec37f9ad3670c242b242#npm:5.3.2", {\ - "packageLocation": "./.yarn/__virtual__/acorn-jsx-virtual-834321b202/5/.yarn/berry/cache/acorn-jsx-npm-5.3.2-d7594599ea-10.zip/node_modules/acorn-jsx/",\ + "packageLocation": "./.yarn/__virtual__/acorn-jsx-virtual-834321b202/0/cache/acorn-jsx-npm-5.3.2-d7594599ea-d4371eaef7.zip/node_modules/acorn-jsx/",\ "packageDependencies": [\ ["acorn-jsx", "virtual:a50722a5a9326b6a5f12350c494c4db3aa0f4caeac45e3e9e5fe071da20014ecfe738fe2ebe2c9c98abae81a4ea86b42f56d776b3bd5ec37f9ad3670c242b242#npm:5.3.2"],\ ["@types/acorn", null],\ @@ -1111,7 +1111,7 @@ const RAW_RUNTIME_STATE = ]],\ ["agent-base", [\ ["npm:6.0.2", {\ - "packageLocation": "../../../../.yarn/berry/cache/agent-base-npm-6.0.2-428f325a93-10.zip/node_modules/agent-base/",\ + "packageLocation": "./.yarn/cache/agent-base-npm-6.0.2-428f325a93-21fb903e09.zip/node_modules/agent-base/",\ "packageDependencies": [\ ["agent-base", "npm:6.0.2"],\ ["debug", "virtual:ced87d94ab05a28b44536eb0cd61a9458e757a0ae7bb35e5ab5d27e03d08b996abd275928b29aad2eb0973d5bb0800e75ba8ca3e26bf62cbe8ea0fae8cca70a8#npm:4.3.4"]\ @@ -1121,7 +1121,7 @@ const RAW_RUNTIME_STATE = ]],\ ["agentkeepalive", [\ ["npm:4.5.0", {\ - "packageLocation": "../../../../.yarn/berry/cache/agentkeepalive-npm-4.5.0-f237b580b2-10.zip/node_modules/agentkeepalive/",\ + "packageLocation": "./.yarn/cache/agentkeepalive-npm-4.5.0-f237b580b2-dd210ba2a2.zip/node_modules/agentkeepalive/",\ "packageDependencies": [\ ["agentkeepalive", "npm:4.5.0"],\ ["humanize-ms", "npm:1.2.1"]\ @@ -1131,7 +1131,7 @@ const RAW_RUNTIME_STATE = ]],\ ["aggregate-error", [\ ["npm:3.1.0", {\ - "packageLocation": "../../../../.yarn/berry/cache/aggregate-error-npm-3.1.0-415a406f4e-10.zip/node_modules/aggregate-error/",\ + "packageLocation": "./.yarn/cache/aggregate-error-npm-3.1.0-415a406f4e-1101a33f21.zip/node_modules/aggregate-error/",\ "packageDependencies": [\ ["aggregate-error", "npm:3.1.0"],\ ["clean-stack", "npm:2.2.0"],\ @@ -1142,7 +1142,7 @@ const RAW_RUNTIME_STATE = ]],\ ["ajv", [\ ["npm:6.12.6", {\ - "packageLocation": "../../../../.yarn/berry/cache/ajv-npm-6.12.6-4b5105e2b2-10.zip/node_modules/ajv/",\ + "packageLocation": "./.yarn/cache/ajv-npm-6.12.6-4b5105e2b2-48d6ad2113.zip/node_modules/ajv/",\ "packageDependencies": [\ ["ajv", "npm:6.12.6"],\ ["fast-deep-equal", "npm:3.1.3"],\ @@ -1155,14 +1155,14 @@ const RAW_RUNTIME_STATE = ]],\ ["ajv-keywords", [\ ["npm:3.5.2", {\ - "packageLocation": "../../../../.yarn/berry/cache/ajv-keywords-npm-3.5.2-0e391b70e2-10.zip/node_modules/ajv-keywords/",\ + "packageLocation": "./.yarn/cache/ajv-keywords-npm-3.5.2-0e391b70e2-d57c9d5bf8.zip/node_modules/ajv-keywords/",\ "packageDependencies": [\ ["ajv-keywords", "npm:3.5.2"]\ ],\ "linkType": "SOFT"\ }],\ ["virtual:f2b36937f163b579815d3163513b3330d7a31aaf0599eea66346382b8838395c613f4204e9809cc2ff6bba09c17ab0c34b37deadcb147de7e2f5e535d6ccc245#npm:3.5.2", {\ - "packageLocation": "./.yarn/__virtual__/ajv-keywords-virtual-80fc73abbe/5/.yarn/berry/cache/ajv-keywords-npm-3.5.2-0e391b70e2-10.zip/node_modules/ajv-keywords/",\ + "packageLocation": "./.yarn/__virtual__/ajv-keywords-virtual-80fc73abbe/0/cache/ajv-keywords-npm-3.5.2-0e391b70e2-d57c9d5bf8.zip/node_modules/ajv-keywords/",\ "packageDependencies": [\ ["ajv-keywords", "virtual:f2b36937f163b579815d3163513b3330d7a31aaf0599eea66346382b8838395c613f4204e9809cc2ff6bba09c17ab0c34b37deadcb147de7e2f5e535d6ccc245#npm:3.5.2"],\ ["@types/ajv", null],\ @@ -1177,7 +1177,7 @@ const RAW_RUNTIME_STATE = ]],\ ["ansi-colors", [\ ["npm:4.1.1", {\ - "packageLocation": "../../../../.yarn/berry/cache/ansi-colors-npm-4.1.1-97ad42f223-10.zip/node_modules/ansi-colors/",\ + "packageLocation": "./.yarn/cache/ansi-colors-npm-4.1.1-97ad42f223-e862fddd0a.zip/node_modules/ansi-colors/",\ "packageDependencies": [\ ["ansi-colors", "npm:4.1.1"]\ ],\ @@ -1186,14 +1186,14 @@ const RAW_RUNTIME_STATE = ]],\ ["ansi-regex", [\ ["npm:5.0.1", {\ - "packageLocation": "../../../../.yarn/berry/cache/ansi-regex-npm-5.0.1-c963a48615-10.zip/node_modules/ansi-regex/",\ + "packageLocation": "./.yarn/cache/ansi-regex-npm-5.0.1-c963a48615-2aa4bb54ca.zip/node_modules/ansi-regex/",\ "packageDependencies": [\ ["ansi-regex", "npm:5.0.1"]\ ],\ "linkType": "HARD"\ }],\ ["npm:6.0.1", {\ - "packageLocation": "../../../../.yarn/berry/cache/ansi-regex-npm-6.0.1-8d663a607d-10.zip/node_modules/ansi-regex/",\ + "packageLocation": "./.yarn/cache/ansi-regex-npm-6.0.1-8d663a607d-1ff8b7667c.zip/node_modules/ansi-regex/",\ "packageDependencies": [\ ["ansi-regex", "npm:6.0.1"]\ ],\ @@ -1202,7 +1202,7 @@ const RAW_RUNTIME_STATE = ]],\ ["ansi-styles", [\ ["npm:4.3.0", {\ - "packageLocation": "../../../../.yarn/berry/cache/ansi-styles-npm-4.3.0-245c7d42c7-10.zip/node_modules/ansi-styles/",\ + "packageLocation": "./.yarn/cache/ansi-styles-npm-4.3.0-245c7d42c7-b4494dfbfc.zip/node_modules/ansi-styles/",\ "packageDependencies": [\ ["ansi-styles", "npm:4.3.0"],\ ["color-convert", "npm:2.0.1"]\ @@ -1210,7 +1210,7 @@ const RAW_RUNTIME_STATE = "linkType": "HARD"\ }],\ ["npm:6.2.1", {\ - "packageLocation": "../../../../.yarn/berry/cache/ansi-styles-npm-6.2.1-d43647018c-10.zip/node_modules/ansi-styles/",\ + "packageLocation": "./.yarn/cache/ansi-styles-npm-6.2.1-d43647018c-70fdf883b7.zip/node_modules/ansi-styles/",\ "packageDependencies": [\ ["ansi-styles", "npm:6.2.1"]\ ],\ @@ -1219,7 +1219,7 @@ const RAW_RUNTIME_STATE = ]],\ ["anymatch", [\ ["npm:3.1.3", {\ - "packageLocation": "../../../../.yarn/berry/cache/anymatch-npm-3.1.3-bc81d103b1-10.zip/node_modules/anymatch/",\ + "packageLocation": "./.yarn/cache/anymatch-npm-3.1.3-bc81d103b1-3e044fd6d1.zip/node_modules/anymatch/",\ "packageDependencies": [\ ["anymatch", "npm:3.1.3"],\ ["normalize-path", "npm:3.0.0"],\ @@ -1230,7 +1230,7 @@ const RAW_RUNTIME_STATE = ]],\ ["aproba", [\ ["npm:2.0.0", {\ - "packageLocation": "../../../../.yarn/berry/cache/aproba-npm-2.0.0-8716bcfde6-10.zip/node_modules/aproba/",\ + "packageLocation": "./.yarn/cache/aproba-npm-2.0.0-8716bcfde6-c2b9a63129.zip/node_modules/aproba/",\ "packageDependencies": [\ ["aproba", "npm:2.0.0"]\ ],\ @@ -1239,7 +1239,7 @@ const RAW_RUNTIME_STATE = ]],\ ["are-we-there-yet", [\ ["npm:3.0.1", {\ - "packageLocation": "../../../../.yarn/berry/cache/are-we-there-yet-npm-3.0.1-3395b1512f-10.zip/node_modules/are-we-there-yet/",\ + "packageLocation": "./.yarn/cache/are-we-there-yet-npm-3.0.1-3395b1512f-390731720e.zip/node_modules/are-we-there-yet/",\ "packageDependencies": [\ ["are-we-there-yet", "npm:3.0.1"],\ ["delegates", "npm:1.0.0"],\ @@ -1250,7 +1250,7 @@ const RAW_RUNTIME_STATE = ]],\ ["argparse", [\ ["npm:2.0.1", {\ - "packageLocation": "../../../../.yarn/berry/cache/argparse-npm-2.0.1-faff7999e6-10.zip/node_modules/argparse/",\ + "packageLocation": "./.yarn/cache/argparse-npm-2.0.1-faff7999e6-18640244e6.zip/node_modules/argparse/",\ "packageDependencies": [\ ["argparse", "npm:2.0.1"]\ ],\ @@ -1259,7 +1259,7 @@ const RAW_RUNTIME_STATE = ]],\ ["array-union", [\ ["npm:2.1.0", {\ - "packageLocation": "../../../../.yarn/berry/cache/array-union-npm-2.1.0-4e4852b221-10.zip/node_modules/array-union/",\ + "packageLocation": "./.yarn/cache/array-union-npm-2.1.0-4e4852b221-5bee12395c.zip/node_modules/array-union/",\ "packageDependencies": [\ ["array-union", "npm:2.1.0"]\ ],\ @@ -1268,7 +1268,7 @@ const RAW_RUNTIME_STATE = ]],\ ["balanced-match", [\ ["npm:1.0.2", {\ - "packageLocation": "../../../../.yarn/berry/cache/balanced-match-npm-1.0.2-a53c126459-10.zip/node_modules/balanced-match/",\ + "packageLocation": "./.yarn/cache/balanced-match-npm-1.0.2-a53c126459-9706c088a2.zip/node_modules/balanced-match/",\ "packageDependencies": [\ ["balanced-match", "npm:1.0.2"]\ ],\ @@ -1277,7 +1277,7 @@ const RAW_RUNTIME_STATE = ]],\ ["binary-extensions", [\ ["npm:2.2.0", {\ - "packageLocation": "../../../../.yarn/berry/cache/binary-extensions-npm-2.2.0-180c33fec7-10.zip/node_modules/binary-extensions/",\ + "packageLocation": "./.yarn/cache/binary-extensions-npm-2.2.0-180c33fec7-ccd267956c.zip/node_modules/binary-extensions/",\ "packageDependencies": [\ ["binary-extensions", "npm:2.2.0"]\ ],\ @@ -1286,7 +1286,7 @@ const RAW_RUNTIME_STATE = ]],\ ["brace-expansion", [\ ["npm:1.1.11", {\ - "packageLocation": "../../../../.yarn/berry/cache/brace-expansion-npm-1.1.11-fb95eb05ad-10.zip/node_modules/brace-expansion/",\ + "packageLocation": "./.yarn/cache/brace-expansion-npm-1.1.11-fb95eb05ad-faf34a7bb0.zip/node_modules/brace-expansion/",\ "packageDependencies": [\ ["brace-expansion", "npm:1.1.11"],\ ["balanced-match", "npm:1.0.2"],\ @@ -1295,7 +1295,7 @@ const RAW_RUNTIME_STATE = "linkType": "HARD"\ }],\ ["npm:2.0.1", {\ - "packageLocation": "../../../../.yarn/berry/cache/brace-expansion-npm-2.0.1-17aa2616f9-10.zip/node_modules/brace-expansion/",\ + "packageLocation": "./.yarn/cache/brace-expansion-npm-2.0.1-17aa2616f9-a61e7cd2e8.zip/node_modules/brace-expansion/",\ "packageDependencies": [\ ["brace-expansion", "npm:2.0.1"],\ ["balanced-match", "npm:1.0.2"]\ @@ -1305,7 +1305,7 @@ const RAW_RUNTIME_STATE = ]],\ ["braces", [\ ["npm:3.0.2", {\ - "packageLocation": "../../../../.yarn/berry/cache/braces-npm-3.0.2-782240b28a-10.zip/node_modules/braces/",\ + "packageLocation": "./.yarn/cache/braces-npm-3.0.2-782240b28a-966b1fb48d.zip/node_modules/braces/",\ "packageDependencies": [\ ["braces", "npm:3.0.2"],\ ["fill-range", "npm:7.0.1"]\ @@ -1315,7 +1315,7 @@ const RAW_RUNTIME_STATE = ]],\ ["browser-stdout", [\ ["npm:1.3.1", {\ - "packageLocation": "../../../../.yarn/berry/cache/browser-stdout-npm-1.3.1-6b2376bf3f-10.zip/node_modules/browser-stdout/",\ + "packageLocation": "./.yarn/cache/browser-stdout-npm-1.3.1-6b2376bf3f-ac70a84e34.zip/node_modules/browser-stdout/",\ "packageDependencies": [\ ["browser-stdout", "npm:1.3.1"]\ ],\ @@ -1324,7 +1324,7 @@ const RAW_RUNTIME_STATE = ]],\ ["browserslist", [\ ["npm:4.22.1", {\ - "packageLocation": "../../../../.yarn/berry/cache/browserslist-npm-4.22.1-cccae6d74e-10.zip/node_modules/browserslist/",\ + "packageLocation": "./.yarn/cache/browserslist-npm-4.22.1-cccae6d74e-4a515168e0.zip/node_modules/browserslist/",\ "packageDependencies": [\ ["browserslist", "npm:4.22.1"],\ ["caniuse-lite", "npm:1.0.30001551"],\ @@ -1337,7 +1337,7 @@ const RAW_RUNTIME_STATE = ]],\ ["buffer-from", [\ ["npm:1.1.2", {\ - "packageLocation": "../../../../.yarn/berry/cache/buffer-from-npm-1.1.2-03d2f20d7e-10.zip/node_modules/buffer-from/",\ + "packageLocation": "./.yarn/cache/buffer-from-npm-1.1.2-03d2f20d7e-0448524a56.zip/node_modules/buffer-from/",\ "packageDependencies": [\ ["buffer-from", "npm:1.1.2"]\ ],\ @@ -1346,7 +1346,7 @@ const RAW_RUNTIME_STATE = ]],\ ["cacache", [\ ["npm:17.1.4", {\ - "packageLocation": "../../../../.yarn/berry/cache/cacache-npm-17.1.4-51ef53d0a8-10.zip/node_modules/cacache/",\ + "packageLocation": "./.yarn/cache/cacache-npm-17.1.4-51ef53d0a8-6e26c788bc.zip/node_modules/cacache/",\ "packageDependencies": [\ ["cacache", "npm:17.1.4"],\ ["@npmcli/fs", "npm:3.1.0"],\ @@ -1367,7 +1367,7 @@ const RAW_RUNTIME_STATE = ]],\ ["callsites", [\ ["npm:3.1.0", {\ - "packageLocation": "../../../../.yarn/berry/cache/callsites-npm-3.1.0-268f989910-10.zip/node_modules/callsites/",\ + "packageLocation": "./.yarn/cache/callsites-npm-3.1.0-268f989910-072d17b6ab.zip/node_modules/callsites/",\ "packageDependencies": [\ ["callsites", "npm:3.1.0"]\ ],\ @@ -1376,7 +1376,7 @@ const RAW_RUNTIME_STATE = ]],\ ["camelcase", [\ ["npm:6.3.0", {\ - "packageLocation": "../../../../.yarn/berry/cache/camelcase-npm-6.3.0-e5e42a0d15-10.zip/node_modules/camelcase/",\ + "packageLocation": "./.yarn/cache/camelcase-npm-6.3.0-e5e42a0d15-8c96818a90.zip/node_modules/camelcase/",\ "packageDependencies": [\ ["camelcase", "npm:6.3.0"]\ ],\ @@ -1385,7 +1385,7 @@ const RAW_RUNTIME_STATE = ]],\ ["caniuse-lite", [\ ["npm:1.0.30001551", {\ - "packageLocation": "../../../../.yarn/berry/cache/caniuse-lite-npm-1.0.30001551-10ef18828c-10.zip/node_modules/caniuse-lite/",\ + "packageLocation": "./.yarn/cache/caniuse-lite-npm-1.0.30001551-10ef18828c-3ab880797f.zip/node_modules/caniuse-lite/",\ "packageDependencies": [\ ["caniuse-lite", "npm:1.0.30001551"]\ ],\ @@ -1394,7 +1394,7 @@ const RAW_RUNTIME_STATE = ]],\ ["chalk", [\ ["npm:4.1.2", {\ - "packageLocation": "../../../../.yarn/berry/cache/chalk-npm-4.1.2-ba8b67ab80-10.zip/node_modules/chalk/",\ + "packageLocation": "./.yarn/cache/chalk-npm-4.1.2-ba8b67ab80-cb3f3e5949.zip/node_modules/chalk/",\ "packageDependencies": [\ ["chalk", "npm:4.1.2"],\ ["ansi-styles", "npm:4.3.0"],\ @@ -1405,7 +1405,7 @@ const RAW_RUNTIME_STATE = ]],\ ["chokidar", [\ ["npm:3.5.3", {\ - "packageLocation": "../../../../.yarn/berry/cache/chokidar-npm-3.5.3-c5f9b0a56a-10.zip/node_modules/chokidar/",\ + "packageLocation": "./.yarn/cache/chokidar-npm-3.5.3-c5f9b0a56a-863e3ff78e.zip/node_modules/chokidar/",\ "packageDependencies": [\ ["chokidar", "npm:3.5.3"],\ ["anymatch", "npm:3.1.3"],\ @@ -1422,7 +1422,7 @@ const RAW_RUNTIME_STATE = ]],\ ["chownr", [\ ["npm:2.0.0", {\ - "packageLocation": "../../../../.yarn/berry/cache/chownr-npm-2.0.0-638f1c9c61-10.zip/node_modules/chownr/",\ + "packageLocation": "./.yarn/cache/chownr-npm-2.0.0-638f1c9c61-c57cf9dd07.zip/node_modules/chownr/",\ "packageDependencies": [\ ["chownr", "npm:2.0.0"]\ ],\ @@ -1431,7 +1431,7 @@ const RAW_RUNTIME_STATE = ]],\ ["chrome-trace-event", [\ ["npm:1.0.3", {\ - "packageLocation": "../../../../.yarn/berry/cache/chrome-trace-event-npm-1.0.3-e0ae3dcd60-10.zip/node_modules/chrome-trace-event/",\ + "packageLocation": "./.yarn/cache/chrome-trace-event-npm-1.0.3-e0ae3dcd60-b5fbdae5bf.zip/node_modules/chrome-trace-event/",\ "packageDependencies": [\ ["chrome-trace-event", "npm:1.0.3"]\ ],\ @@ -1440,7 +1440,7 @@ const RAW_RUNTIME_STATE = ]],\ ["clean-stack", [\ ["npm:2.2.0", {\ - "packageLocation": "../../../../.yarn/berry/cache/clean-stack-npm-2.2.0-a8ce435a5c-10.zip/node_modules/clean-stack/",\ + "packageLocation": "./.yarn/cache/clean-stack-npm-2.2.0-a8ce435a5c-2ac8cd2b2f.zip/node_modules/clean-stack/",\ "packageDependencies": [\ ["clean-stack", "npm:2.2.0"]\ ],\ @@ -1449,7 +1449,7 @@ const RAW_RUNTIME_STATE = ]],\ ["cliui", [\ ["npm:7.0.4", {\ - "packageLocation": "../../../../.yarn/berry/cache/cliui-npm-7.0.4-d6b8a9edb6-10.zip/node_modules/cliui/",\ + "packageLocation": "./.yarn/cache/cliui-npm-7.0.4-d6b8a9edb6-db858c49af.zip/node_modules/cliui/",\ "packageDependencies": [\ ["cliui", "npm:7.0.4"],\ ["string-width", "npm:4.2.3"],\ @@ -1461,7 +1461,7 @@ const RAW_RUNTIME_STATE = ]],\ ["clone-deep", [\ ["npm:4.0.1", {\ - "packageLocation": "../../../../.yarn/berry/cache/clone-deep-npm-4.0.1-70adab92c8-10.zip/node_modules/clone-deep/",\ + "packageLocation": "./.yarn/cache/clone-deep-npm-4.0.1-70adab92c8-770f912fe4.zip/node_modules/clone-deep/",\ "packageDependencies": [\ ["clone-deep", "npm:4.0.1"],\ ["is-plain-object", "npm:2.0.4"],\ @@ -1473,7 +1473,7 @@ const RAW_RUNTIME_STATE = ]],\ ["color-convert", [\ ["npm:2.0.1", {\ - "packageLocation": "../../../../.yarn/berry/cache/color-convert-npm-2.0.1-79730e935b-10.zip/node_modules/color-convert/",\ + "packageLocation": "./.yarn/cache/color-convert-npm-2.0.1-79730e935b-fa00c91b43.zip/node_modules/color-convert/",\ "packageDependencies": [\ ["color-convert", "npm:2.0.1"],\ ["color-name", "npm:1.1.4"]\ @@ -1483,7 +1483,7 @@ const RAW_RUNTIME_STATE = ]],\ ["color-name", [\ ["npm:1.1.4", {\ - "packageLocation": "../../../../.yarn/berry/cache/color-name-npm-1.1.4-025792b0ea-10.zip/node_modules/color-name/",\ + "packageLocation": "./.yarn/cache/color-name-npm-1.1.4-025792b0ea-b044585952.zip/node_modules/color-name/",\ "packageDependencies": [\ ["color-name", "npm:1.1.4"]\ ],\ @@ -1492,7 +1492,7 @@ const RAW_RUNTIME_STATE = ]],\ ["color-support", [\ ["npm:1.1.3", {\ - "packageLocation": "../../../../.yarn/berry/cache/color-support-npm-1.1.3-3be5c53455-10.zip/node_modules/color-support/",\ + "packageLocation": "./.yarn/cache/color-support-npm-1.1.3-3be5c53455-4bcfe30eea.zip/node_modules/color-support/",\ "packageDependencies": [\ ["color-support", "npm:1.1.3"]\ ],\ @@ -1501,7 +1501,7 @@ const RAW_RUNTIME_STATE = ]],\ ["colorette", [\ ["npm:2.0.20", {\ - "packageLocation": "../../../../.yarn/berry/cache/colorette-npm-2.0.20-692d428726-10.zip/node_modules/colorette/",\ + "packageLocation": "./.yarn/cache/colorette-npm-2.0.20-692d428726-0b8de48bfa.zip/node_modules/colorette/",\ "packageDependencies": [\ ["colorette", "npm:2.0.20"]\ ],\ @@ -1510,14 +1510,14 @@ const RAW_RUNTIME_STATE = ]],\ ["commander", [\ ["npm:10.0.1", {\ - "packageLocation": "../../../../.yarn/berry/cache/commander-npm-10.0.1-f17613b72b-10.zip/node_modules/commander/",\ + "packageLocation": "./.yarn/cache/commander-npm-10.0.1-f17613b72b-8799faa84a.zip/node_modules/commander/",\ "packageDependencies": [\ ["commander", "npm:10.0.1"]\ ],\ "linkType": "HARD"\ }],\ ["npm:2.20.3", {\ - "packageLocation": "../../../../.yarn/berry/cache/commander-npm-2.20.3-d8dcbaa39b-10.zip/node_modules/commander/",\ + "packageLocation": "./.yarn/cache/commander-npm-2.20.3-d8dcbaa39b-90c5b68986.zip/node_modules/commander/",\ "packageDependencies": [\ ["commander", "npm:2.20.3"]\ ],\ @@ -1526,7 +1526,7 @@ const RAW_RUNTIME_STATE = ]],\ ["concat-map", [\ ["npm:0.0.1", {\ - "packageLocation": "../../../../.yarn/berry/cache/concat-map-npm-0.0.1-85a921b7ee-10.zip/node_modules/concat-map/",\ + "packageLocation": "./.yarn/cache/concat-map-npm-0.0.1-85a921b7ee-9680699c8e.zip/node_modules/concat-map/",\ "packageDependencies": [\ ["concat-map", "npm:0.0.1"]\ ],\ @@ -1535,7 +1535,7 @@ const RAW_RUNTIME_STATE = ]],\ ["console-control-strings", [\ ["npm:1.1.0", {\ - "packageLocation": "../../../../.yarn/berry/cache/console-control-strings-npm-1.1.0-e3160e5275-10.zip/node_modules/console-control-strings/",\ + "packageLocation": "./.yarn/cache/console-control-strings-npm-1.1.0-e3160e5275-27b5fa302b.zip/node_modules/console-control-strings/",\ "packageDependencies": [\ ["console-control-strings", "npm:1.1.0"]\ ],\ @@ -1544,7 +1544,7 @@ const RAW_RUNTIME_STATE = ]],\ ["core-util-is", [\ ["npm:1.0.3", {\ - "packageLocation": "../../../../.yarn/berry/cache/core-util-is-npm-1.0.3-ca74b76c90-10.zip/node_modules/core-util-is/",\ + "packageLocation": "./.yarn/cache/core-util-is-npm-1.0.3-ca74b76c90-9de8597363.zip/node_modules/core-util-is/",\ "packageDependencies": [\ ["core-util-is", "npm:1.0.3"]\ ],\ @@ -1553,7 +1553,7 @@ const RAW_RUNTIME_STATE = ]],\ ["cross-spawn", [\ ["npm:7.0.3", {\ - "packageLocation": "../../../../.yarn/berry/cache/cross-spawn-npm-7.0.3-e4ff3e65b3-10.zip/node_modules/cross-spawn/",\ + "packageLocation": "./.yarn/cache/cross-spawn-npm-7.0.3-e4ff3e65b3-e1a13869d2.zip/node_modules/cross-spawn/",\ "packageDependencies": [\ ["cross-spawn", "npm:7.0.3"],\ ["path-key", "npm:3.1.1"],\ @@ -1565,14 +1565,14 @@ const RAW_RUNTIME_STATE = ]],\ ["debug", [\ ["npm:4.3.4", {\ - "packageLocation": "../../../../.yarn/berry/cache/debug-npm-4.3.4-4513954577-10.zip/node_modules/debug/",\ + "packageLocation": "./.yarn/cache/debug-npm-4.3.4-4513954577-0073c3bcbd.zip/node_modules/debug/",\ "packageDependencies": [\ ["debug", "npm:4.3.4"]\ ],\ "linkType": "SOFT"\ }],\ ["virtual:87db25c7c5e6b25bbc12571091cdabc648b79d427ab445d1714ccfdcdfb3265c9de6561ca760cc3de470037cbedf3af4be56ba3b684b3a1c01d4c9c2fd55a741#npm:4.3.4", {\ - "packageLocation": "./.yarn/__virtual__/debug-virtual-762d08cbe9/5/.yarn/berry/cache/debug-npm-4.3.4-4513954577-10.zip/node_modules/debug/",\ + "packageLocation": "./.yarn/__virtual__/debug-virtual-762d08cbe9/0/cache/debug-npm-4.3.4-4513954577-0073c3bcbd.zip/node_modules/debug/",\ "packageDependencies": [\ ["debug", "virtual:87db25c7c5e6b25bbc12571091cdabc648b79d427ab445d1714ccfdcdfb3265c9de6561ca760cc3de470037cbedf3af4be56ba3b684b3a1c01d4c9c2fd55a741#npm:4.3.4"],\ ["@types/supports-color", null],\ @@ -1586,7 +1586,7 @@ const RAW_RUNTIME_STATE = "linkType": "HARD"\ }],\ ["virtual:ced87d94ab05a28b44536eb0cd61a9458e757a0ae7bb35e5ab5d27e03d08b996abd275928b29aad2eb0973d5bb0800e75ba8ca3e26bf62cbe8ea0fae8cca70a8#npm:4.3.4", {\ - "packageLocation": "./.yarn/__virtual__/debug-virtual-023f479948/5/.yarn/berry/cache/debug-npm-4.3.4-4513954577-10.zip/node_modules/debug/",\ + "packageLocation": "./.yarn/__virtual__/debug-virtual-023f479948/0/cache/debug-npm-4.3.4-4513954577-0073c3bcbd.zip/node_modules/debug/",\ "packageDependencies": [\ ["debug", "virtual:ced87d94ab05a28b44536eb0cd61a9458e757a0ae7bb35e5ab5d27e03d08b996abd275928b29aad2eb0973d5bb0800e75ba8ca3e26bf62cbe8ea0fae8cca70a8#npm:4.3.4"],\ ["@types/supports-color", null],\ @@ -1602,7 +1602,7 @@ const RAW_RUNTIME_STATE = ]],\ ["decamelize", [\ ["npm:4.0.0", {\ - "packageLocation": "../../../../.yarn/berry/cache/decamelize-npm-4.0.0-12410e3409-10.zip/node_modules/decamelize/",\ + "packageLocation": "./.yarn/cache/decamelize-npm-4.0.0-12410e3409-b7d09b8265.zip/node_modules/decamelize/",\ "packageDependencies": [\ ["decamelize", "npm:4.0.0"]\ ],\ @@ -1611,7 +1611,7 @@ const RAW_RUNTIME_STATE = ]],\ ["deep-is", [\ ["npm:0.1.4", {\ - "packageLocation": "../../../../.yarn/berry/cache/deep-is-npm-0.1.4-88938b5a67-10.zip/node_modules/deep-is/",\ + "packageLocation": "./.yarn/cache/deep-is-npm-0.1.4-88938b5a67-ec12d074ae.zip/node_modules/deep-is/",\ "packageDependencies": [\ ["deep-is", "npm:0.1.4"]\ ],\ @@ -1620,7 +1620,7 @@ const RAW_RUNTIME_STATE = ]],\ ["delegates", [\ ["npm:1.0.0", {\ - "packageLocation": "../../../../.yarn/berry/cache/delegates-npm-1.0.0-9b1942d75f-10.zip/node_modules/delegates/",\ + "packageLocation": "./.yarn/cache/delegates-npm-1.0.0-9b1942d75f-a51744d9b5.zip/node_modules/delegates/",\ "packageDependencies": [\ ["delegates", "npm:1.0.0"]\ ],\ @@ -1629,7 +1629,7 @@ const RAW_RUNTIME_STATE = ]],\ ["diff", [\ ["npm:5.0.0", {\ - "packageLocation": "../../../../.yarn/berry/cache/diff-npm-5.0.0-ad6900db18-10.zip/node_modules/diff/",\ + "packageLocation": "./.yarn/cache/diff-npm-5.0.0-ad6900db18-4a179a75b1.zip/node_modules/diff/",\ "packageDependencies": [\ ["diff", "npm:5.0.0"]\ ],\ @@ -1638,7 +1638,7 @@ const RAW_RUNTIME_STATE = ]],\ ["dir-glob", [\ ["npm:3.0.1", {\ - "packageLocation": "../../../../.yarn/berry/cache/dir-glob-npm-3.0.1-1aea628b1b-10.zip/node_modules/dir-glob/",\ + "packageLocation": "./.yarn/cache/dir-glob-npm-3.0.1-1aea628b1b-fa05e18324.zip/node_modules/dir-glob/",\ "packageDependencies": [\ ["dir-glob", "npm:3.0.1"],\ ["path-type", "npm:4.0.0"]\ @@ -1648,7 +1648,7 @@ const RAW_RUNTIME_STATE = ]],\ ["doctrine", [\ ["npm:3.0.0", {\ - "packageLocation": "../../../../.yarn/berry/cache/doctrine-npm-3.0.0-c6f1615f04-10.zip/node_modules/doctrine/",\ + "packageLocation": "./.yarn/cache/doctrine-npm-3.0.0-c6f1615f04-b4b28f1df5.zip/node_modules/doctrine/",\ "packageDependencies": [\ ["doctrine", "npm:3.0.0"],\ ["esutils", "npm:2.0.3"]\ @@ -1658,7 +1658,7 @@ const RAW_RUNTIME_STATE = ]],\ ["eastasianwidth", [\ ["npm:0.2.0", {\ - "packageLocation": "../../../../.yarn/berry/cache/eastasianwidth-npm-0.2.0-c37eb16bd1-10.zip/node_modules/eastasianwidth/",\ + "packageLocation": "./.yarn/cache/eastasianwidth-npm-0.2.0-c37eb16bd1-9b1d3e1bae.zip/node_modules/eastasianwidth/",\ "packageDependencies": [\ ["eastasianwidth", "npm:0.2.0"]\ ],\ @@ -1667,7 +1667,7 @@ const RAW_RUNTIME_STATE = ]],\ ["electron-to-chromium", [\ ["npm:1.4.562", {\ - "packageLocation": "../../../../.yarn/berry/cache/electron-to-chromium-npm-1.4.562-385fc13106-10.zip/node_modules/electron-to-chromium/",\ + "packageLocation": "./.yarn/cache/electron-to-chromium-npm-1.4.562-385fc13106-9ccf9cc6b1.zip/node_modules/electron-to-chromium/",\ "packageDependencies": [\ ["electron-to-chromium", "npm:1.4.562"]\ ],\ @@ -1676,14 +1676,14 @@ const RAW_RUNTIME_STATE = ]],\ ["emoji-regex", [\ ["npm:8.0.0", {\ - "packageLocation": "../../../../.yarn/berry/cache/emoji-regex-npm-8.0.0-213764015c-10.zip/node_modules/emoji-regex/",\ + "packageLocation": "./.yarn/cache/emoji-regex-npm-8.0.0-213764015c-c72d67a682.zip/node_modules/emoji-regex/",\ "packageDependencies": [\ ["emoji-regex", "npm:8.0.0"]\ ],\ "linkType": "HARD"\ }],\ ["npm:9.2.2", {\ - "packageLocation": "../../../../.yarn/berry/cache/emoji-regex-npm-9.2.2-e6fac8d058-10.zip/node_modules/emoji-regex/",\ + "packageLocation": "./.yarn/cache/emoji-regex-npm-9.2.2-e6fac8d058-915acf859c.zip/node_modules/emoji-regex/",\ "packageDependencies": [\ ["emoji-regex", "npm:9.2.2"]\ ],\ @@ -1692,7 +1692,7 @@ const RAW_RUNTIME_STATE = ]],\ ["encoding", [\ ["npm:0.1.13", {\ - "packageLocation": "../../../../.yarn/berry/cache/encoding-npm-0.1.13-82a1837d30-10.zip/node_modules/encoding/",\ + "packageLocation": "./.yarn/cache/encoding-npm-0.1.13-82a1837d30-bb98632f8f.zip/node_modules/encoding/",\ "packageDependencies": [\ ["encoding", "npm:0.1.13"],\ ["iconv-lite", "npm:0.6.3"]\ @@ -1702,7 +1702,7 @@ const RAW_RUNTIME_STATE = ]],\ ["enhanced-resolve", [\ ["npm:5.15.0", {\ - "packageLocation": "../../../../.yarn/berry/cache/enhanced-resolve-npm-5.15.0-16eb7ddef9-10.zip/node_modules/enhanced-resolve/",\ + "packageLocation": "./.yarn/cache/enhanced-resolve-npm-5.15.0-16eb7ddef9-180c3f2706.zip/node_modules/enhanced-resolve/",\ "packageDependencies": [\ ["enhanced-resolve", "npm:5.15.0"],\ ["graceful-fs", "npm:4.2.11"],\ @@ -1713,7 +1713,7 @@ const RAW_RUNTIME_STATE = ]],\ ["env-paths", [\ ["npm:2.2.1", {\ - "packageLocation": "../../../../.yarn/berry/cache/env-paths-npm-2.2.1-7c7577428c-10.zip/node_modules/env-paths/",\ + "packageLocation": "./.yarn/cache/env-paths-npm-2.2.1-7c7577428c-65b5df55a8.zip/node_modules/env-paths/",\ "packageDependencies": [\ ["env-paths", "npm:2.2.1"]\ ],\ @@ -1722,7 +1722,7 @@ const RAW_RUNTIME_STATE = ]],\ ["envinfo", [\ ["npm:7.10.0", {\ - "packageLocation": "../../../../.yarn/berry/cache/envinfo-npm-7.10.0-cba8c054d4-10.zip/node_modules/envinfo/",\ + "packageLocation": "./.yarn/cache/envinfo-npm-7.10.0-cba8c054d4-d4db29c5a4.zip/node_modules/envinfo/",\ "packageDependencies": [\ ["envinfo", "npm:7.10.0"]\ ],\ @@ -1731,7 +1731,7 @@ const RAW_RUNTIME_STATE = ]],\ ["err-code", [\ ["npm:2.0.3", {\ - "packageLocation": "../../../../.yarn/berry/cache/err-code-npm-2.0.3-082e0ff9a7-10.zip/node_modules/err-code/",\ + "packageLocation": "./.yarn/cache/err-code-npm-2.0.3-082e0ff9a7-1d20d825cd.zip/node_modules/err-code/",\ "packageDependencies": [\ ["err-code", "npm:2.0.3"]\ ],\ @@ -1740,7 +1740,7 @@ const RAW_RUNTIME_STATE = ]],\ ["es-module-lexer", [\ ["npm:1.3.1", {\ - "packageLocation": "../../../../.yarn/berry/cache/es-module-lexer-npm-1.3.1-9fc669f676-10.zip/node_modules/es-module-lexer/",\ + "packageLocation": "./.yarn/cache/es-module-lexer-npm-1.3.1-9fc669f676-c6aa137c5f.zip/node_modules/es-module-lexer/",\ "packageDependencies": [\ ["es-module-lexer", "npm:1.3.1"]\ ],\ @@ -1749,7 +1749,7 @@ const RAW_RUNTIME_STATE = ]],\ ["escalade", [\ ["npm:3.1.1", {\ - "packageLocation": "../../../../.yarn/berry/cache/escalade-npm-3.1.1-e02da076aa-10.zip/node_modules/escalade/",\ + "packageLocation": "./.yarn/cache/escalade-npm-3.1.1-e02da076aa-afa618e733.zip/node_modules/escalade/",\ "packageDependencies": [\ ["escalade", "npm:3.1.1"]\ ],\ @@ -1758,7 +1758,7 @@ const RAW_RUNTIME_STATE = ]],\ ["escape-string-regexp", [\ ["npm:4.0.0", {\ - "packageLocation": "../../../../.yarn/berry/cache/escape-string-regexp-npm-4.0.0-4b531d8d59-10.zip/node_modules/escape-string-regexp/",\ + "packageLocation": "./.yarn/cache/escape-string-regexp-npm-4.0.0-4b531d8d59-98b48897d9.zip/node_modules/escape-string-regexp/",\ "packageDependencies": [\ ["escape-string-regexp", "npm:4.0.0"]\ ],\ @@ -1767,7 +1767,7 @@ const RAW_RUNTIME_STATE = ]],\ ["eslint", [\ ["npm:8.46.0", {\ - "packageLocation": "../../../../.yarn/berry/cache/eslint-npm-8.46.0-dc7af99e61-10.zip/node_modules/eslint/",\ + "packageLocation": "./.yarn/cache/eslint-npm-8.46.0-dc7af99e61-576f680afe.zip/node_modules/eslint/",\ "packageDependencies": [\ ["eslint", "npm:8.46.0"],\ ["@eslint-community/eslint-utils", "virtual:dc7af99e618232ac0e2a751f560e2225037bf809144a4cc05369d5312b9d24061282984c0c0c6c5c199f3a0663f91f11c21afb60016655f472fa253e0b676e3b#npm:4.4.0"],\ @@ -1811,7 +1811,7 @@ const RAW_RUNTIME_STATE = "linkType": "HARD"\ }],\ ["npm:8.51.0", {\ - "packageLocation": "../../../../.yarn/berry/cache/eslint-npm-8.51.0-77fce3ec74-10.zip/node_modules/eslint/",\ + "packageLocation": "./.yarn/cache/eslint-npm-8.51.0-77fce3ec74-1f3720dd2a.zip/node_modules/eslint/",\ "packageDependencies": [\ ["eslint", "npm:8.51.0"],\ ["@eslint-community/eslint-utils", "virtual:77fce3ec74d55c7e6791631c329cf3adde374e21e618e865127f72e63efeb3376dcf7fc8217de80f5a310e81c791a72e9d099b00fd3252d5653ff68dff50c2fa#npm:4.4.0"],\ @@ -1857,7 +1857,7 @@ const RAW_RUNTIME_STATE = ]],\ ["eslint-scope", [\ ["npm:5.1.1", {\ - "packageLocation": "../../../../.yarn/berry/cache/eslint-scope-npm-5.1.1-71fe59b18a-10.zip/node_modules/eslint-scope/",\ + "packageLocation": "./.yarn/cache/eslint-scope-npm-5.1.1-71fe59b18a-c541ef384c.zip/node_modules/eslint-scope/",\ "packageDependencies": [\ ["eslint-scope", "npm:5.1.1"],\ ["esrecurse", "npm:4.3.0"],\ @@ -1866,7 +1866,7 @@ const RAW_RUNTIME_STATE = "linkType": "HARD"\ }],\ ["npm:7.2.2", {\ - "packageLocation": "../../../../.yarn/berry/cache/eslint-scope-npm-7.2.2-53cb0df8e8-10.zip/node_modules/eslint-scope/",\ + "packageLocation": "./.yarn/cache/eslint-scope-npm-7.2.2-53cb0df8e8-5c660fb905.zip/node_modules/eslint-scope/",\ "packageDependencies": [\ ["eslint-scope", "npm:7.2.2"],\ ["esrecurse", "npm:4.3.0"],\ @@ -1877,14 +1877,14 @@ const RAW_RUNTIME_STATE = ]],\ ["eslint-visitor-keys", [\ ["npm:3.4.2", {\ - "packageLocation": "../../../../.yarn/berry/cache/eslint-visitor-keys-npm-3.4.2-304459f972-10.zip/node_modules/eslint-visitor-keys/",\ + "packageLocation": "./.yarn/cache/eslint-visitor-keys-npm-3.4.2-304459f972-04e7e9d546.zip/node_modules/eslint-visitor-keys/",\ "packageDependencies": [\ ["eslint-visitor-keys", "npm:3.4.2"]\ ],\ "linkType": "HARD"\ }],\ ["npm:3.4.3", {\ - "packageLocation": "../../../../.yarn/berry/cache/eslint-visitor-keys-npm-3.4.3-a356ac7e46-10.zip/node_modules/eslint-visitor-keys/",\ + "packageLocation": "./.yarn/cache/eslint-visitor-keys-npm-3.4.3-a356ac7e46-3f357c554a.zip/node_modules/eslint-visitor-keys/",\ "packageDependencies": [\ ["eslint-visitor-keys", "npm:3.4.3"]\ ],\ @@ -1893,7 +1893,7 @@ const RAW_RUNTIME_STATE = ]],\ ["espree", [\ ["npm:9.6.1", {\ - "packageLocation": "../../../../.yarn/berry/cache/espree-npm-9.6.1-a50722a5a9-10.zip/node_modules/espree/",\ + "packageLocation": "./.yarn/cache/espree-npm-9.6.1-a50722a5a9-255ab260f0.zip/node_modules/espree/",\ "packageDependencies": [\ ["espree", "npm:9.6.1"],\ ["acorn", "npm:8.10.0"],\ @@ -1905,7 +1905,7 @@ const RAW_RUNTIME_STATE = ]],\ ["esquery", [\ ["npm:1.5.0", {\ - "packageLocation": "../../../../.yarn/berry/cache/esquery-npm-1.5.0-d8f8a06879-10.zip/node_modules/esquery/",\ + "packageLocation": "./.yarn/cache/esquery-npm-1.5.0-d8f8a06879-e65fcdfc1e.zip/node_modules/esquery/",\ "packageDependencies": [\ ["esquery", "npm:1.5.0"],\ ["estraverse", "npm:5.3.0"]\ @@ -1915,7 +1915,7 @@ const RAW_RUNTIME_STATE = ]],\ ["esrecurse", [\ ["npm:4.3.0", {\ - "packageLocation": "../../../../.yarn/berry/cache/esrecurse-npm-4.3.0-10b86a887a-10.zip/node_modules/esrecurse/",\ + "packageLocation": "./.yarn/cache/esrecurse-npm-4.3.0-10b86a887a-44ffcd89e7.zip/node_modules/esrecurse/",\ "packageDependencies": [\ ["esrecurse", "npm:4.3.0"],\ ["estraverse", "npm:5.3.0"]\ @@ -1925,14 +1925,14 @@ const RAW_RUNTIME_STATE = ]],\ ["estraverse", [\ ["npm:4.3.0", {\ - "packageLocation": "../../../../.yarn/berry/cache/estraverse-npm-4.3.0-920a32f3c6-10.zip/node_modules/estraverse/",\ + "packageLocation": "./.yarn/cache/estraverse-npm-4.3.0-920a32f3c6-3f67ad02b6.zip/node_modules/estraverse/",\ "packageDependencies": [\ ["estraverse", "npm:4.3.0"]\ ],\ "linkType": "HARD"\ }],\ ["npm:5.3.0", {\ - "packageLocation": "../../../../.yarn/berry/cache/estraverse-npm-5.3.0-03284f8f63-10.zip/node_modules/estraverse/",\ + "packageLocation": "./.yarn/cache/estraverse-npm-5.3.0-03284f8f63-37cbe6e9a6.zip/node_modules/estraverse/",\ "packageDependencies": [\ ["estraverse", "npm:5.3.0"]\ ],\ @@ -1941,7 +1941,7 @@ const RAW_RUNTIME_STATE = ]],\ ["esutils", [\ ["npm:2.0.3", {\ - "packageLocation": "../../../../.yarn/berry/cache/esutils-npm-2.0.3-f865beafd5-10.zip/node_modules/esutils/",\ + "packageLocation": "./.yarn/cache/esutils-npm-2.0.3-f865beafd5-b23acd2479.zip/node_modules/esutils/",\ "packageDependencies": [\ ["esutils", "npm:2.0.3"]\ ],\ @@ -1950,7 +1950,7 @@ const RAW_RUNTIME_STATE = ]],\ ["events", [\ ["npm:3.3.0", {\ - "packageLocation": "../../../../.yarn/berry/cache/events-npm-3.3.0-c280bc7e48-10.zip/node_modules/events/",\ + "packageLocation": "./.yarn/cache/events-npm-3.3.0-c280bc7e48-a3d47e285e.zip/node_modules/events/",\ "packageDependencies": [\ ["events", "npm:3.3.0"]\ ],\ @@ -1959,7 +1959,7 @@ const RAW_RUNTIME_STATE = ]],\ ["exponential-backoff", [\ ["npm:3.1.1", {\ - "packageLocation": "../../../../.yarn/berry/cache/exponential-backoff-npm-3.1.1-04df458b30-10.zip/node_modules/exponential-backoff/",\ + "packageLocation": "./.yarn/cache/exponential-backoff-npm-3.1.1-04df458b30-2d9bbb6473.zip/node_modules/exponential-backoff/",\ "packageDependencies": [\ ["exponential-backoff", "npm:3.1.1"]\ ],\ @@ -1968,7 +1968,7 @@ const RAW_RUNTIME_STATE = ]],\ ["fast-deep-equal", [\ ["npm:3.1.3", {\ - "packageLocation": "../../../../.yarn/berry/cache/fast-deep-equal-npm-3.1.3-790edcfcf5-10.zip/node_modules/fast-deep-equal/",\ + "packageLocation": "./.yarn/cache/fast-deep-equal-npm-3.1.3-790edcfcf5-e21a9d8d84.zip/node_modules/fast-deep-equal/",\ "packageDependencies": [\ ["fast-deep-equal", "npm:3.1.3"]\ ],\ @@ -1977,7 +1977,7 @@ const RAW_RUNTIME_STATE = ]],\ ["fast-glob", [\ ["npm:3.3.1", {\ - "packageLocation": "../../../../.yarn/berry/cache/fast-glob-npm-3.3.1-8045ff8f4d-10.zip/node_modules/fast-glob/",\ + "packageLocation": "./.yarn/cache/fast-glob-npm-3.3.1-8045ff8f4d-51bcd15472.zip/node_modules/fast-glob/",\ "packageDependencies": [\ ["fast-glob", "npm:3.3.1"],\ ["@nodelib/fs.stat", "npm:2.0.5"],\ @@ -1991,7 +1991,7 @@ const RAW_RUNTIME_STATE = ]],\ ["fast-json-stable-stringify", [\ ["npm:2.1.0", {\ - "packageLocation": "../../../../.yarn/berry/cache/fast-json-stable-stringify-npm-2.1.0-02e8905fda-10.zip/node_modules/fast-json-stable-stringify/",\ + "packageLocation": "./.yarn/cache/fast-json-stable-stringify-npm-2.1.0-02e8905fda-2c20055c1f.zip/node_modules/fast-json-stable-stringify/",\ "packageDependencies": [\ ["fast-json-stable-stringify", "npm:2.1.0"]\ ],\ @@ -2000,7 +2000,7 @@ const RAW_RUNTIME_STATE = ]],\ ["fast-levenshtein", [\ ["npm:2.0.6", {\ - "packageLocation": "../../../../.yarn/berry/cache/fast-levenshtein-npm-2.0.6-fcd74b8df5-10.zip/node_modules/fast-levenshtein/",\ + "packageLocation": "./.yarn/cache/fast-levenshtein-npm-2.0.6-fcd74b8df5-eb7e220ecf.zip/node_modules/fast-levenshtein/",\ "packageDependencies": [\ ["fast-levenshtein", "npm:2.0.6"]\ ],\ @@ -2009,7 +2009,7 @@ const RAW_RUNTIME_STATE = ]],\ ["fastest-levenshtein", [\ ["npm:1.0.16", {\ - "packageLocation": "../../../../.yarn/berry/cache/fastest-levenshtein-npm-1.0.16-192d328856-10.zip/node_modules/fastest-levenshtein/",\ + "packageLocation": "./.yarn/cache/fastest-levenshtein-npm-1.0.16-192d328856-ee85d33b5c.zip/node_modules/fastest-levenshtein/",\ "packageDependencies": [\ ["fastest-levenshtein", "npm:1.0.16"]\ ],\ @@ -2018,7 +2018,7 @@ const RAW_RUNTIME_STATE = ]],\ ["fastq", [\ ["npm:1.15.0", {\ - "packageLocation": "../../../../.yarn/berry/cache/fastq-npm-1.15.0-1013f6514e-10.zip/node_modules/fastq/",\ + "packageLocation": "./.yarn/cache/fastq-npm-1.15.0-1013f6514e-67c01b1c97.zip/node_modules/fastq/",\ "packageDependencies": [\ ["fastq", "npm:1.15.0"],\ ["reusify", "npm:1.0.4"]\ @@ -2028,7 +2028,7 @@ const RAW_RUNTIME_STATE = ]],\ ["file-entry-cache", [\ ["npm:6.0.1", {\ - "packageLocation": "../../../../.yarn/berry/cache/file-entry-cache-npm-6.0.1-31965cf0af-10.zip/node_modules/file-entry-cache/",\ + "packageLocation": "./.yarn/cache/file-entry-cache-npm-6.0.1-31965cf0af-099bb9d4ab.zip/node_modules/file-entry-cache/",\ "packageDependencies": [\ ["file-entry-cache", "npm:6.0.1"],\ ["flat-cache", "npm:3.0.4"]\ @@ -2038,7 +2038,7 @@ const RAW_RUNTIME_STATE = ]],\ ["fill-range", [\ ["npm:7.0.1", {\ - "packageLocation": "../../../../.yarn/berry/cache/fill-range-npm-7.0.1-b8b1817caa-10.zip/node_modules/fill-range/",\ + "packageLocation": "./.yarn/cache/fill-range-npm-7.0.1-b8b1817caa-e260f7592f.zip/node_modules/fill-range/",\ "packageDependencies": [\ ["fill-range", "npm:7.0.1"],\ ["to-regex-range", "npm:5.0.1"]\ @@ -2048,7 +2048,7 @@ const RAW_RUNTIME_STATE = ]],\ ["find-up", [\ ["npm:4.1.0", {\ - "packageLocation": "../../../../.yarn/berry/cache/find-up-npm-4.1.0-c3ccf8d855-10.zip/node_modules/find-up/",\ + "packageLocation": "./.yarn/cache/find-up-npm-4.1.0-c3ccf8d855-4c172680e8.zip/node_modules/find-up/",\ "packageDependencies": [\ ["find-up", "npm:4.1.0"],\ ["locate-path", "npm:5.0.0"],\ @@ -2057,7 +2057,7 @@ const RAW_RUNTIME_STATE = "linkType": "HARD"\ }],\ ["npm:5.0.0", {\ - "packageLocation": "../../../../.yarn/berry/cache/find-up-npm-5.0.0-e03e9b796d-10.zip/node_modules/find-up/",\ + "packageLocation": "./.yarn/cache/find-up-npm-5.0.0-e03e9b796d-07955e3573.zip/node_modules/find-up/",\ "packageDependencies": [\ ["find-up", "npm:5.0.0"],\ ["locate-path", "npm:6.0.0"],\ @@ -2068,7 +2068,7 @@ const RAW_RUNTIME_STATE = ]],\ ["flat", [\ ["npm:5.0.2", {\ - "packageLocation": "../../../../.yarn/berry/cache/flat-npm-5.0.2-12748102a5-10.zip/node_modules/flat/",\ + "packageLocation": "./.yarn/cache/flat-npm-5.0.2-12748102a5-72479e651c.zip/node_modules/flat/",\ "packageDependencies": [\ ["flat", "npm:5.0.2"]\ ],\ @@ -2077,7 +2077,7 @@ const RAW_RUNTIME_STATE = ]],\ ["flat-cache", [\ ["npm:3.0.4", {\ - "packageLocation": "../../../../.yarn/berry/cache/flat-cache-npm-3.0.4-ee77e5911e-10.zip/node_modules/flat-cache/",\ + "packageLocation": "./.yarn/cache/flat-cache-npm-3.0.4-ee77e5911e-9fe5d0cb97.zip/node_modules/flat-cache/",\ "packageDependencies": [\ ["flat-cache", "npm:3.0.4"],\ ["flatted", "npm:3.2.7"],\ @@ -2088,7 +2088,7 @@ const RAW_RUNTIME_STATE = ]],\ ["flatted", [\ ["npm:3.2.7", {\ - "packageLocation": "../../../../.yarn/berry/cache/flatted-npm-3.2.7-0da10b7c56-10.zip/node_modules/flatted/",\ + "packageLocation": "./.yarn/cache/flatted-npm-3.2.7-0da10b7c56-427633049d.zip/node_modules/flatted/",\ "packageDependencies": [\ ["flatted", "npm:3.2.7"]\ ],\ @@ -2097,7 +2097,7 @@ const RAW_RUNTIME_STATE = ]],\ ["foreground-child", [\ ["npm:3.1.1", {\ - "packageLocation": "../../../../.yarn/berry/cache/foreground-child-npm-3.1.1-77e78ed774-10.zip/node_modules/foreground-child/",\ + "packageLocation": "./.yarn/cache/foreground-child-npm-3.1.1-77e78ed774-087edd4485.zip/node_modules/foreground-child/",\ "packageDependencies": [\ ["foreground-child", "npm:3.1.1"],\ ["cross-spawn", "npm:7.0.3"],\ @@ -2108,7 +2108,7 @@ const RAW_RUNTIME_STATE = ]],\ ["fs-minipass", [\ ["npm:2.1.0", {\ - "packageLocation": "../../../../.yarn/berry/cache/fs-minipass-npm-2.1.0-501ef87306-10.zip/node_modules/fs-minipass/",\ + "packageLocation": "./.yarn/cache/fs-minipass-npm-2.1.0-501ef87306-03191781e9.zip/node_modules/fs-minipass/",\ "packageDependencies": [\ ["fs-minipass", "npm:2.1.0"],\ ["minipass", "npm:3.3.6"]\ @@ -2116,7 +2116,7 @@ const RAW_RUNTIME_STATE = "linkType": "HARD"\ }],\ ["npm:3.0.3", {\ - "packageLocation": "../../../../.yarn/berry/cache/fs-minipass-npm-3.0.3-d148d6ac19-10.zip/node_modules/fs-minipass/",\ + "packageLocation": "./.yarn/cache/fs-minipass-npm-3.0.3-d148d6ac19-af143246cf.zip/node_modules/fs-minipass/",\ "packageDependencies": [\ ["fs-minipass", "npm:3.0.3"],\ ["minipass", "npm:7.0.3"]\ @@ -2126,7 +2126,7 @@ const RAW_RUNTIME_STATE = ]],\ ["fs.realpath", [\ ["npm:1.0.0", {\ - "packageLocation": "../../../../.yarn/berry/cache/fs.realpath-npm-1.0.0-c8f05d8126-10.zip/node_modules/fs.realpath/",\ + "packageLocation": "./.yarn/cache/fs.realpath-npm-1.0.0-c8f05d8126-e703107c28.zip/node_modules/fs.realpath/",\ "packageDependencies": [\ ["fs.realpath", "npm:1.0.0"]\ ],\ @@ -2145,7 +2145,7 @@ const RAW_RUNTIME_STATE = ]],\ ["gauge", [\ ["npm:4.0.4", {\ - "packageLocation": "../../../../.yarn/berry/cache/gauge-npm-4.0.4-8f878385e9-10.zip/node_modules/gauge/",\ + "packageLocation": "./.yarn/cache/gauge-npm-4.0.4-8f878385e9-09535dd53b.zip/node_modules/gauge/",\ "packageDependencies": [\ ["gauge", "npm:4.0.4"],\ ["aproba", "npm:2.0.0"],\ @@ -2162,7 +2162,7 @@ const RAW_RUNTIME_STATE = ]],\ ["get-caller-file", [\ ["npm:2.0.5", {\ - "packageLocation": "../../../../.yarn/berry/cache/get-caller-file-npm-2.0.5-80e8a86305-10.zip/node_modules/get-caller-file/",\ + "packageLocation": "./.yarn/cache/get-caller-file-npm-2.0.5-80e8a86305-b9769a836d.zip/node_modules/get-caller-file/",\ "packageDependencies": [\ ["get-caller-file", "npm:2.0.5"]\ ],\ @@ -2171,7 +2171,7 @@ const RAW_RUNTIME_STATE = ]],\ ["glob", [\ ["npm:10.3.4", {\ - "packageLocation": "../../../../.yarn/berry/cache/glob-npm-10.3.4-f58cd31f55-10.zip/node_modules/glob/",\ + "packageLocation": "./.yarn/cache/glob-npm-10.3.4-f58cd31f55-6375721bcd.zip/node_modules/glob/",\ "packageDependencies": [\ ["glob", "npm:10.3.4"],\ ["foreground-child", "npm:3.1.1"],\ @@ -2183,7 +2183,7 @@ const RAW_RUNTIME_STATE = "linkType": "HARD"\ }],\ ["npm:7.2.0", {\ - "packageLocation": "../../../../.yarn/berry/cache/glob-npm-7.2.0-bb4644d239-10.zip/node_modules/glob/",\ + "packageLocation": "./.yarn/cache/glob-npm-7.2.0-bb4644d239-bc78b6ea07.zip/node_modules/glob/",\ "packageDependencies": [\ ["glob", "npm:7.2.0"],\ ["fs.realpath", "npm:1.0.0"],\ @@ -2196,7 +2196,7 @@ const RAW_RUNTIME_STATE = "linkType": "HARD"\ }],\ ["npm:7.2.3", {\ - "packageLocation": "../../../../.yarn/berry/cache/glob-npm-7.2.3-2d866d17a5-10.zip/node_modules/glob/",\ + "packageLocation": "./.yarn/cache/glob-npm-7.2.3-2d866d17a5-59452a9202.zip/node_modules/glob/",\ "packageDependencies": [\ ["glob", "npm:7.2.3"],\ ["fs.realpath", "npm:1.0.0"],\ @@ -2209,7 +2209,7 @@ const RAW_RUNTIME_STATE = "linkType": "HARD"\ }],\ ["npm:8.1.0", {\ - "packageLocation": "../../../../.yarn/berry/cache/glob-npm-8.1.0-65f64af8b1-10.zip/node_modules/glob/",\ + "packageLocation": "./.yarn/cache/glob-npm-8.1.0-65f64af8b1-9aab1c75eb.zip/node_modules/glob/",\ "packageDependencies": [\ ["glob", "npm:8.1.0"],\ ["fs.realpath", "npm:1.0.0"],\ @@ -2223,7 +2223,7 @@ const RAW_RUNTIME_STATE = ]],\ ["glob-parent", [\ ["npm:5.1.2", {\ - "packageLocation": "../../../../.yarn/berry/cache/glob-parent-npm-5.1.2-021ab32634-10.zip/node_modules/glob-parent/",\ + "packageLocation": "./.yarn/cache/glob-parent-npm-5.1.2-021ab32634-32cd106ce8.zip/node_modules/glob-parent/",\ "packageDependencies": [\ ["glob-parent", "npm:5.1.2"],\ ["is-glob", "npm:4.0.3"]\ @@ -2231,7 +2231,7 @@ const RAW_RUNTIME_STATE = "linkType": "HARD"\ }],\ ["npm:6.0.2", {\ - "packageLocation": "../../../../.yarn/berry/cache/glob-parent-npm-6.0.2-2cbef12738-10.zip/node_modules/glob-parent/",\ + "packageLocation": "./.yarn/cache/glob-parent-npm-6.0.2-2cbef12738-c13ee97978.zip/node_modules/glob-parent/",\ "packageDependencies": [\ ["glob-parent", "npm:6.0.2"],\ ["is-glob", "npm:4.0.3"]\ @@ -2241,7 +2241,7 @@ const RAW_RUNTIME_STATE = ]],\ ["glob-to-regexp", [\ ["npm:0.4.1", {\ - "packageLocation": "../../../../.yarn/berry/cache/glob-to-regexp-npm-0.4.1-cd697e0fc7-10.zip/node_modules/glob-to-regexp/",\ + "packageLocation": "./.yarn/cache/glob-to-regexp-npm-0.4.1-cd697e0fc7-9009529195.zip/node_modules/glob-to-regexp/",\ "packageDependencies": [\ ["glob-to-regexp", "npm:0.4.1"]\ ],\ @@ -2250,7 +2250,7 @@ const RAW_RUNTIME_STATE = ]],\ ["globals", [\ ["npm:13.20.0", {\ - "packageLocation": "../../../../.yarn/berry/cache/globals-npm-13.20.0-4565a722e7-10.zip/node_modules/globals/",\ + "packageLocation": "./.yarn/cache/globals-npm-13.20.0-4565a722e7-9df85cde2f.zip/node_modules/globals/",\ "packageDependencies": [\ ["globals", "npm:13.20.0"],\ ["type-fest", "npm:0.20.2"]\ @@ -2260,7 +2260,7 @@ const RAW_RUNTIME_STATE = ]],\ ["globby", [\ ["npm:11.1.0", {\ - "packageLocation": "../../../../.yarn/berry/cache/globby-npm-11.1.0-bdcdf20c71-10.zip/node_modules/globby/",\ + "packageLocation": "./.yarn/cache/globby-npm-11.1.0-bdcdf20c71-288e95e310.zip/node_modules/globby/",\ "packageDependencies": [\ ["globby", "npm:11.1.0"],\ ["array-union", "npm:2.1.0"],\ @@ -2275,7 +2275,7 @@ const RAW_RUNTIME_STATE = ]],\ ["graceful-fs", [\ ["npm:4.2.11", {\ - "packageLocation": "../../../../.yarn/berry/cache/graceful-fs-npm-4.2.11-24bb648a68-10.zip/node_modules/graceful-fs/",\ + "packageLocation": "./.yarn/cache/graceful-fs-npm-4.2.11-24bb648a68-bf152d0ed1.zip/node_modules/graceful-fs/",\ "packageDependencies": [\ ["graceful-fs", "npm:4.2.11"]\ ],\ @@ -2284,7 +2284,7 @@ const RAW_RUNTIME_STATE = ]],\ ["graphemer", [\ ["npm:1.4.0", {\ - "packageLocation": "../../../../.yarn/berry/cache/graphemer-npm-1.4.0-0627732d35-10.zip/node_modules/graphemer/",\ + "packageLocation": "./.yarn/cache/graphemer-npm-1.4.0-0627732d35-6dd60dba97.zip/node_modules/graphemer/",\ "packageDependencies": [\ ["graphemer", "npm:1.4.0"]\ ],\ @@ -2293,7 +2293,7 @@ const RAW_RUNTIME_STATE = ]],\ ["has", [\ ["npm:1.0.4", {\ - "packageLocation": "../../../../.yarn/berry/cache/has-npm-1.0.4-0dc267d5e0-10.zip/node_modules/has/",\ + "packageLocation": "./.yarn/cache/has-npm-1.0.4-0dc267d5e0-c245f332fe.zip/node_modules/has/",\ "packageDependencies": [\ ["has", "npm:1.0.4"]\ ],\ @@ -2302,7 +2302,7 @@ const RAW_RUNTIME_STATE = ]],\ ["has-flag", [\ ["npm:4.0.0", {\ - "packageLocation": "../../../../.yarn/berry/cache/has-flag-npm-4.0.0-32af9f0536-10.zip/node_modules/has-flag/",\ + "packageLocation": "./.yarn/cache/has-flag-npm-4.0.0-32af9f0536-261a135703.zip/node_modules/has-flag/",\ "packageDependencies": [\ ["has-flag", "npm:4.0.0"]\ ],\ @@ -2311,7 +2311,7 @@ const RAW_RUNTIME_STATE = ]],\ ["has-unicode", [\ ["npm:2.0.1", {\ - "packageLocation": "../../../../.yarn/berry/cache/has-unicode-npm-2.0.1-893adb4747-10.zip/node_modules/has-unicode/",\ + "packageLocation": "./.yarn/cache/has-unicode-npm-2.0.1-893adb4747-041b4293ad.zip/node_modules/has-unicode/",\ "packageDependencies": [\ ["has-unicode", "npm:2.0.1"]\ ],\ @@ -2320,7 +2320,7 @@ const RAW_RUNTIME_STATE = ]],\ ["he", [\ ["npm:1.2.0", {\ - "packageLocation": "../../../../.yarn/berry/cache/he-npm-1.2.0-3b73a2ff07-10.zip/node_modules/he/",\ + "packageLocation": "./.yarn/cache/he-npm-1.2.0-3b73a2ff07-d09b2243da.zip/node_modules/he/",\ "packageDependencies": [\ ["he", "npm:1.2.0"]\ ],\ @@ -2329,7 +2329,7 @@ const RAW_RUNTIME_STATE = ]],\ ["http-cache-semantics", [\ ["npm:4.1.1", {\ - "packageLocation": "../../../../.yarn/berry/cache/http-cache-semantics-npm-4.1.1-1120131375-10.zip/node_modules/http-cache-semantics/",\ + "packageLocation": "./.yarn/cache/http-cache-semantics-npm-4.1.1-1120131375-362d5ed66b.zip/node_modules/http-cache-semantics/",\ "packageDependencies": [\ ["http-cache-semantics", "npm:4.1.1"]\ ],\ @@ -2338,7 +2338,7 @@ const RAW_RUNTIME_STATE = ]],\ ["http-proxy-agent", [\ ["npm:4.0.1", {\ - "packageLocation": "../../../../.yarn/berry/cache/http-proxy-agent-npm-4.0.1-ce9ef61788-10.zip/node_modules/http-proxy-agent/",\ + "packageLocation": "./.yarn/cache/http-proxy-agent-npm-4.0.1-ce9ef61788-2e17f5519f.zip/node_modules/http-proxy-agent/",\ "packageDependencies": [\ ["http-proxy-agent", "npm:4.0.1"],\ ["@tootallnate/once", "npm:1.1.2"],\ @@ -2348,7 +2348,7 @@ const RAW_RUNTIME_STATE = "linkType": "HARD"\ }],\ ["npm:5.0.0", {\ - "packageLocation": "../../../../.yarn/berry/cache/http-proxy-agent-npm-5.0.0-7f1f121b83-10.zip/node_modules/http-proxy-agent/",\ + "packageLocation": "./.yarn/cache/http-proxy-agent-npm-5.0.0-7f1f121b83-5ee19423bc.zip/node_modules/http-proxy-agent/",\ "packageDependencies": [\ ["http-proxy-agent", "npm:5.0.0"],\ ["@tootallnate/once", "npm:2.0.0"],\ @@ -2360,7 +2360,7 @@ const RAW_RUNTIME_STATE = ]],\ ["https-proxy-agent", [\ ["npm:5.0.1", {\ - "packageLocation": "../../../../.yarn/berry/cache/https-proxy-agent-npm-5.0.1-42d65f358e-10.zip/node_modules/https-proxy-agent/",\ + "packageLocation": "./.yarn/cache/https-proxy-agent-npm-5.0.1-42d65f358e-f0dce7bdca.zip/node_modules/https-proxy-agent/",\ "packageDependencies": [\ ["https-proxy-agent", "npm:5.0.1"],\ ["agent-base", "npm:6.0.2"],\ @@ -2371,7 +2371,7 @@ const RAW_RUNTIME_STATE = ]],\ ["humanize-ms", [\ ["npm:1.2.1", {\ - "packageLocation": "../../../../.yarn/berry/cache/humanize-ms-npm-1.2.1-e942bd7329-10.zip/node_modules/humanize-ms/",\ + "packageLocation": "./.yarn/cache/humanize-ms-npm-1.2.1-e942bd7329-9c7a74a282.zip/node_modules/humanize-ms/",\ "packageDependencies": [\ ["humanize-ms", "npm:1.2.1"],\ ["ms", "npm:2.1.3"]\ @@ -2381,7 +2381,7 @@ const RAW_RUNTIME_STATE = ]],\ ["husky", [\ ["npm:8.0.3", {\ - "packageLocation": "../../../../.yarn/berry/cache/husky-npm-8.0.3-b0b59c5127-10.zip/node_modules/husky/",\ + "packageLocation": "./.yarn/cache/husky-npm-8.0.3-b0b59c5127-b754cf70fd.zip/node_modules/husky/",\ "packageDependencies": [\ ["husky", "npm:8.0.3"]\ ],\ @@ -2390,7 +2390,7 @@ const RAW_RUNTIME_STATE = ]],\ ["iconv-lite", [\ ["npm:0.6.3", {\ - "packageLocation": "../../../../.yarn/berry/cache/iconv-lite-npm-0.6.3-24b8aae27e-10.zip/node_modules/iconv-lite/",\ + "packageLocation": "./.yarn/cache/iconv-lite-npm-0.6.3-24b8aae27e-24e3292dd3.zip/node_modules/iconv-lite/",\ "packageDependencies": [\ ["iconv-lite", "npm:0.6.3"],\ ["safer-buffer", "npm:2.1.2"]\ @@ -2400,7 +2400,7 @@ const RAW_RUNTIME_STATE = ]],\ ["ignore", [\ ["npm:5.2.4", {\ - "packageLocation": "../../../../.yarn/berry/cache/ignore-npm-5.2.4-fbe6e989e5-10.zip/node_modules/ignore/",\ + "packageLocation": "./.yarn/cache/ignore-npm-5.2.4-fbe6e989e5-4f7caf5d20.zip/node_modules/ignore/",\ "packageDependencies": [\ ["ignore", "npm:5.2.4"]\ ],\ @@ -2409,7 +2409,7 @@ const RAW_RUNTIME_STATE = ]],\ ["immediate", [\ ["npm:3.0.6", {\ - "packageLocation": "../../../../.yarn/berry/cache/immediate-npm-3.0.6-c27588a2d3-10.zip/node_modules/immediate/",\ + "packageLocation": "./.yarn/cache/immediate-npm-3.0.6-c27588a2d3-f9b3486477.zip/node_modules/immediate/",\ "packageDependencies": [\ ["immediate", "npm:3.0.6"]\ ],\ @@ -2418,7 +2418,7 @@ const RAW_RUNTIME_STATE = ]],\ ["import-fresh", [\ ["npm:3.3.0", {\ - "packageLocation": "../../../../.yarn/berry/cache/import-fresh-npm-3.3.0-3e34265ca9-10.zip/node_modules/import-fresh/",\ + "packageLocation": "./.yarn/cache/import-fresh-npm-3.3.0-3e34265ca9-2cacfad06e.zip/node_modules/import-fresh/",\ "packageDependencies": [\ ["import-fresh", "npm:3.3.0"],\ ["parent-module", "npm:1.0.1"],\ @@ -2429,7 +2429,7 @@ const RAW_RUNTIME_STATE = ]],\ ["import-local", [\ ["npm:3.1.0", {\ - "packageLocation": "../../../../.yarn/berry/cache/import-local-npm-3.1.0-8960af5e51-10.zip/node_modules/import-local/",\ + "packageLocation": "./.yarn/cache/import-local-npm-3.1.0-8960af5e51-bfcdb63b5e.zip/node_modules/import-local/",\ "packageDependencies": [\ ["import-local", "npm:3.1.0"],\ ["pkg-dir", "npm:4.2.0"],\ @@ -2440,7 +2440,7 @@ const RAW_RUNTIME_STATE = ]],\ ["imurmurhash", [\ ["npm:0.1.4", {\ - "packageLocation": "../../../../.yarn/berry/cache/imurmurhash-npm-0.1.4-610c5068a0-10.zip/node_modules/imurmurhash/",\ + "packageLocation": "./.yarn/cache/imurmurhash-npm-0.1.4-610c5068a0-2d30b157a9.zip/node_modules/imurmurhash/",\ "packageDependencies": [\ ["imurmurhash", "npm:0.1.4"]\ ],\ @@ -2449,7 +2449,7 @@ const RAW_RUNTIME_STATE = ]],\ ["indent-string", [\ ["npm:4.0.0", {\ - "packageLocation": "../../../../.yarn/berry/cache/indent-string-npm-4.0.0-7b717435b2-10.zip/node_modules/indent-string/",\ + "packageLocation": "./.yarn/cache/indent-string-npm-4.0.0-7b717435b2-cd3f5cbc9c.zip/node_modules/indent-string/",\ "packageDependencies": [\ ["indent-string", "npm:4.0.0"]\ ],\ @@ -2458,7 +2458,7 @@ const RAW_RUNTIME_STATE = ]],\ ["inflight", [\ ["npm:1.0.6", {\ - "packageLocation": "../../../../.yarn/berry/cache/inflight-npm-1.0.6-ccedb4b908-10.zip/node_modules/inflight/",\ + "packageLocation": "./.yarn/cache/inflight-npm-1.0.6-ccedb4b908-d2ebd65441.zip/node_modules/inflight/",\ "packageDependencies": [\ ["inflight", "npm:1.0.6"],\ ["once", "npm:1.4.0"],\ @@ -2469,7 +2469,7 @@ const RAW_RUNTIME_STATE = ]],\ ["inherits", [\ ["npm:2.0.4", {\ - "packageLocation": "../../../../.yarn/berry/cache/inherits-npm-2.0.4-c66b3957a0-10.zip/node_modules/inherits/",\ + "packageLocation": "./.yarn/cache/inherits-npm-2.0.4-c66b3957a0-cd45e923be.zip/node_modules/inherits/",\ "packageDependencies": [\ ["inherits", "npm:2.0.4"]\ ],\ @@ -2478,7 +2478,7 @@ const RAW_RUNTIME_STATE = ]],\ ["interpret", [\ ["npm:3.1.1", {\ - "packageLocation": "../../../../.yarn/berry/cache/interpret-npm-3.1.1-715bac2bd7-10.zip/node_modules/interpret/",\ + "packageLocation": "./.yarn/cache/interpret-npm-3.1.1-715bac2bd7-bc9e111269.zip/node_modules/interpret/",\ "packageDependencies": [\ ["interpret", "npm:3.1.1"]\ ],\ @@ -2487,7 +2487,7 @@ const RAW_RUNTIME_STATE = ]],\ ["ip", [\ ["npm:2.0.0", {\ - "packageLocation": "../../../../.yarn/berry/cache/ip-npm-2.0.0-204facb3cc-10.zip/node_modules/ip/",\ + "packageLocation": "./.yarn/cache/ip-npm-2.0.0-204facb3cc-1270b11e53.zip/node_modules/ip/",\ "packageDependencies": [\ ["ip", "npm:2.0.0"]\ ],\ @@ -2496,7 +2496,7 @@ const RAW_RUNTIME_STATE = ]],\ ["is-binary-path", [\ ["npm:2.1.0", {\ - "packageLocation": "../../../../.yarn/berry/cache/is-binary-path-npm-2.1.0-e61d46f557-10.zip/node_modules/is-binary-path/",\ + "packageLocation": "./.yarn/cache/is-binary-path-npm-2.1.0-e61d46f557-078e51b4f9.zip/node_modules/is-binary-path/",\ "packageDependencies": [\ ["is-binary-path", "npm:2.1.0"],\ ["binary-extensions", "npm:2.2.0"]\ @@ -2506,7 +2506,7 @@ const RAW_RUNTIME_STATE = ]],\ ["is-core-module", [\ ["npm:2.13.0", {\ - "packageLocation": "../../../../.yarn/berry/cache/is-core-module-npm-2.13.0-e444c50225-10.zip/node_modules/is-core-module/",\ + "packageLocation": "./.yarn/cache/is-core-module-npm-2.13.0-e444c50225-55ccb5ccd2.zip/node_modules/is-core-module/",\ "packageDependencies": [\ ["is-core-module", "npm:2.13.0"],\ ["has", "npm:1.0.4"]\ @@ -2516,7 +2516,7 @@ const RAW_RUNTIME_STATE = ]],\ ["is-extglob", [\ ["npm:2.1.1", {\ - "packageLocation": "../../../../.yarn/berry/cache/is-extglob-npm-2.1.1-0870ea68b5-10.zip/node_modules/is-extglob/",\ + "packageLocation": "./.yarn/cache/is-extglob-npm-2.1.1-0870ea68b5-df033653d0.zip/node_modules/is-extglob/",\ "packageDependencies": [\ ["is-extglob", "npm:2.1.1"]\ ],\ @@ -2525,7 +2525,7 @@ const RAW_RUNTIME_STATE = ]],\ ["is-fullwidth-code-point", [\ ["npm:3.0.0", {\ - "packageLocation": "../../../../.yarn/berry/cache/is-fullwidth-code-point-npm-3.0.0-1ecf4ebee5-10.zip/node_modules/is-fullwidth-code-point/",\ + "packageLocation": "./.yarn/cache/is-fullwidth-code-point-npm-3.0.0-1ecf4ebee5-44a30c2945.zip/node_modules/is-fullwidth-code-point/",\ "packageDependencies": [\ ["is-fullwidth-code-point", "npm:3.0.0"]\ ],\ @@ -2534,7 +2534,7 @@ const RAW_RUNTIME_STATE = ]],\ ["is-glob", [\ ["npm:4.0.3", {\ - "packageLocation": "../../../../.yarn/berry/cache/is-glob-npm-4.0.3-cb87bf1bdb-10.zip/node_modules/is-glob/",\ + "packageLocation": "./.yarn/cache/is-glob-npm-4.0.3-cb87bf1bdb-3ed74f2b0c.zip/node_modules/is-glob/",\ "packageDependencies": [\ ["is-glob", "npm:4.0.3"],\ ["is-extglob", "npm:2.1.1"]\ @@ -2544,7 +2544,7 @@ const RAW_RUNTIME_STATE = ]],\ ["is-lambda", [\ ["npm:1.0.1", {\ - "packageLocation": "../../../../.yarn/berry/cache/is-lambda-npm-1.0.1-7ab55bc8a8-10.zip/node_modules/is-lambda/",\ + "packageLocation": "./.yarn/cache/is-lambda-npm-1.0.1-7ab55bc8a8-93a32f0194.zip/node_modules/is-lambda/",\ "packageDependencies": [\ ["is-lambda", "npm:1.0.1"]\ ],\ @@ -2553,7 +2553,7 @@ const RAW_RUNTIME_STATE = ]],\ ["is-number", [\ ["npm:7.0.0", {\ - "packageLocation": "../../../../.yarn/berry/cache/is-number-npm-7.0.0-060086935c-10.zip/node_modules/is-number/",\ + "packageLocation": "./.yarn/cache/is-number-npm-7.0.0-060086935c-6a6c3383f6.zip/node_modules/is-number/",\ "packageDependencies": [\ ["is-number", "npm:7.0.0"]\ ],\ @@ -2562,7 +2562,7 @@ const RAW_RUNTIME_STATE = ]],\ ["is-path-inside", [\ ["npm:3.0.3", {\ - "packageLocation": "../../../../.yarn/berry/cache/is-path-inside-npm-3.0.3-2ea0ef44fd-10.zip/node_modules/is-path-inside/",\ + "packageLocation": "./.yarn/cache/is-path-inside-npm-3.0.3-2ea0ef44fd-abd50f0618.zip/node_modules/is-path-inside/",\ "packageDependencies": [\ ["is-path-inside", "npm:3.0.3"]\ ],\ @@ -2571,7 +2571,7 @@ const RAW_RUNTIME_STATE = ]],\ ["is-plain-obj", [\ ["npm:2.1.0", {\ - "packageLocation": "../../../../.yarn/berry/cache/is-plain-obj-npm-2.1.0-8dffd7ae9c-10.zip/node_modules/is-plain-obj/",\ + "packageLocation": "./.yarn/cache/is-plain-obj-npm-2.1.0-8dffd7ae9c-cec9100678.zip/node_modules/is-plain-obj/",\ "packageDependencies": [\ ["is-plain-obj", "npm:2.1.0"]\ ],\ @@ -2580,7 +2580,7 @@ const RAW_RUNTIME_STATE = ]],\ ["is-plain-object", [\ ["npm:2.0.4", {\ - "packageLocation": "../../../../.yarn/berry/cache/is-plain-object-npm-2.0.4-da3265d804-10.zip/node_modules/is-plain-object/",\ + "packageLocation": "./.yarn/cache/is-plain-object-npm-2.0.4-da3265d804-2a401140cf.zip/node_modules/is-plain-object/",\ "packageDependencies": [\ ["is-plain-object", "npm:2.0.4"],\ ["isobject", "npm:3.0.1"]\ @@ -2590,7 +2590,7 @@ const RAW_RUNTIME_STATE = ]],\ ["is-unicode-supported", [\ ["npm:0.1.0", {\ - "packageLocation": "../../../../.yarn/berry/cache/is-unicode-supported-npm-0.1.0-0833e1bbfb-10.zip/node_modules/is-unicode-supported/",\ + "packageLocation": "./.yarn/cache/is-unicode-supported-npm-0.1.0-0833e1bbfb-a2aab86ee7.zip/node_modules/is-unicode-supported/",\ "packageDependencies": [\ ["is-unicode-supported", "npm:0.1.0"]\ ],\ @@ -2599,7 +2599,7 @@ const RAW_RUNTIME_STATE = ]],\ ["isarray", [\ ["npm:1.0.0", {\ - "packageLocation": "../../../../.yarn/berry/cache/isarray-npm-1.0.0-db4f547720-10.zip/node_modules/isarray/",\ + "packageLocation": "./.yarn/cache/isarray-npm-1.0.0-db4f547720-f032df8e02.zip/node_modules/isarray/",\ "packageDependencies": [\ ["isarray", "npm:1.0.0"]\ ],\ @@ -2608,7 +2608,7 @@ const RAW_RUNTIME_STATE = ]],\ ["isexe", [\ ["npm:2.0.0", {\ - "packageLocation": "../../../../.yarn/berry/cache/isexe-npm-2.0.0-b58870bd2e-10.zip/node_modules/isexe/",\ + "packageLocation": "./.yarn/cache/isexe-npm-2.0.0-b58870bd2e-7c9f715c03.zip/node_modules/isexe/",\ "packageDependencies": [\ ["isexe", "npm:2.0.0"]\ ],\ @@ -2617,7 +2617,7 @@ const RAW_RUNTIME_STATE = ]],\ ["isobject", [\ ["npm:3.0.1", {\ - "packageLocation": "../../../../.yarn/berry/cache/isobject-npm-3.0.1-8145901fd2-10.zip/node_modules/isobject/",\ + "packageLocation": "./.yarn/cache/isobject-npm-3.0.1-8145901fd2-db85c4c970.zip/node_modules/isobject/",\ "packageDependencies": [\ ["isobject", "npm:3.0.1"]\ ],\ @@ -2626,7 +2626,7 @@ const RAW_RUNTIME_STATE = ]],\ ["jackspeak", [\ ["npm:2.3.3", {\ - "packageLocation": "../../../../.yarn/berry/cache/jackspeak-npm-2.3.3-755684cc60-10.zip/node_modules/jackspeak/",\ + "packageLocation": "./.yarn/cache/jackspeak-npm-2.3.3-755684cc60-a4c7c1a3ff.zip/node_modules/jackspeak/",\ "packageDependencies": [\ ["jackspeak", "npm:2.3.3"],\ ["@isaacs/cliui", "npm:8.0.2"],\ @@ -2637,7 +2637,7 @@ const RAW_RUNTIME_STATE = ]],\ ["jest-worker", [\ ["npm:27.5.1", {\ - "packageLocation": "../../../../.yarn/berry/cache/jest-worker-npm-27.5.1-1c110b5894-10.zip/node_modules/jest-worker/",\ + "packageLocation": "./.yarn/cache/jest-worker-npm-27.5.1-1c110b5894-06c6e2a845.zip/node_modules/jest-worker/",\ "packageDependencies": [\ ["jest-worker", "npm:27.5.1"],\ ["@types/node", "npm:20.8.7"],\ @@ -2649,7 +2649,7 @@ const RAW_RUNTIME_STATE = ]],\ ["js-yaml", [\ ["npm:4.1.0", {\ - "packageLocation": "../../../../.yarn/berry/cache/js-yaml-npm-4.1.0-3606f32312-10.zip/node_modules/js-yaml/",\ + "packageLocation": "./.yarn/cache/js-yaml-npm-4.1.0-3606f32312-c138a34a3f.zip/node_modules/js-yaml/",\ "packageDependencies": [\ ["js-yaml", "npm:4.1.0"],\ ["argparse", "npm:2.0.1"]\ @@ -2659,7 +2659,7 @@ const RAW_RUNTIME_STATE = ]],\ ["json-parse-even-better-errors", [\ ["npm:2.3.1", {\ - "packageLocation": "../../../../.yarn/berry/cache/json-parse-even-better-errors-npm-2.3.1-144d62256e-10.zip/node_modules/json-parse-even-better-errors/",\ + "packageLocation": "./.yarn/cache/json-parse-even-better-errors-npm-2.3.1-144d62256e-5f3a99009e.zip/node_modules/json-parse-even-better-errors/",\ "packageDependencies": [\ ["json-parse-even-better-errors", "npm:2.3.1"]\ ],\ @@ -2668,7 +2668,7 @@ const RAW_RUNTIME_STATE = ]],\ ["json-schema-traverse", [\ ["npm:0.4.1", {\ - "packageLocation": "../../../../.yarn/berry/cache/json-schema-traverse-npm-0.4.1-4759091693-10.zip/node_modules/json-schema-traverse/",\ + "packageLocation": "./.yarn/cache/json-schema-traverse-npm-0.4.1-4759091693-7486074d3b.zip/node_modules/json-schema-traverse/",\ "packageDependencies": [\ ["json-schema-traverse", "npm:0.4.1"]\ ],\ @@ -2677,7 +2677,7 @@ const RAW_RUNTIME_STATE = ]],\ ["json-stable-stringify-without-jsonify", [\ ["npm:1.0.1", {\ - "packageLocation": "../../../../.yarn/berry/cache/json-stable-stringify-without-jsonify-npm-1.0.1-b65772b28b-10.zip/node_modules/json-stable-stringify-without-jsonify/",\ + "packageLocation": "./.yarn/cache/json-stable-stringify-without-jsonify-npm-1.0.1-b65772b28b-12786c2e2f.zip/node_modules/json-stable-stringify-without-jsonify/",\ "packageDependencies": [\ ["json-stable-stringify-without-jsonify", "npm:1.0.1"]\ ],\ @@ -2686,7 +2686,7 @@ const RAW_RUNTIME_STATE = ]],\ ["jszip", [\ ["npm:3.10.1", {\ - "packageLocation": "../../../../.yarn/berry/cache/jszip-npm-3.10.1-2862546cfb-10.zip/node_modules/jszip/",\ + "packageLocation": "./.yarn/cache/jszip-npm-3.10.1-2862546cfb-bfbfbb9b0a.zip/node_modules/jszip/",\ "packageDependencies": [\ ["jszip", "npm:3.10.1"],\ ["lie", "npm:3.3.0"],\ @@ -2699,7 +2699,7 @@ const RAW_RUNTIME_STATE = ]],\ ["kind-of", [\ ["npm:6.0.3", {\ - "packageLocation": "../../../../.yarn/berry/cache/kind-of-npm-6.0.3-ab15f36220-10.zip/node_modules/kind-of/",\ + "packageLocation": "./.yarn/cache/kind-of-npm-6.0.3-ab15f36220-5873d303fb.zip/node_modules/kind-of/",\ "packageDependencies": [\ ["kind-of", "npm:6.0.3"]\ ],\ @@ -2708,7 +2708,7 @@ const RAW_RUNTIME_STATE = ]],\ ["levn", [\ ["npm:0.4.1", {\ - "packageLocation": "../../../../.yarn/berry/cache/levn-npm-0.4.1-d183b2d7bb-10.zip/node_modules/levn/",\ + "packageLocation": "./.yarn/cache/levn-npm-0.4.1-d183b2d7bb-2e4720ff79.zip/node_modules/levn/",\ "packageDependencies": [\ ["levn", "npm:0.4.1"],\ ["prelude-ls", "npm:1.2.1"],\ @@ -2719,7 +2719,7 @@ const RAW_RUNTIME_STATE = ]],\ ["lie", [\ ["npm:3.3.0", {\ - "packageLocation": "../../../../.yarn/berry/cache/lie-npm-3.3.0-35ddd11a4d-10.zip/node_modules/lie/",\ + "packageLocation": "./.yarn/cache/lie-npm-3.3.0-35ddd11a4d-f335ce67fe.zip/node_modules/lie/",\ "packageDependencies": [\ ["lie", "npm:3.3.0"],\ ["immediate", "npm:3.0.6"]\ @@ -2729,7 +2729,7 @@ const RAW_RUNTIME_STATE = ]],\ ["loader-runner", [\ ["npm:4.3.0", {\ - "packageLocation": "../../../../.yarn/berry/cache/loader-runner-npm-4.3.0-9ca67df372-10.zip/node_modules/loader-runner/",\ + "packageLocation": "./.yarn/cache/loader-runner-npm-4.3.0-9ca67df372-555ae00286.zip/node_modules/loader-runner/",\ "packageDependencies": [\ ["loader-runner", "npm:4.3.0"]\ ],\ @@ -2738,7 +2738,7 @@ const RAW_RUNTIME_STATE = ]],\ ["locate-path", [\ ["npm:5.0.0", {\ - "packageLocation": "../../../../.yarn/berry/cache/locate-path-npm-5.0.0-46580c43e4-10.zip/node_modules/locate-path/",\ + "packageLocation": "./.yarn/cache/locate-path-npm-5.0.0-46580c43e4-83e51725e6.zip/node_modules/locate-path/",\ "packageDependencies": [\ ["locate-path", "npm:5.0.0"],\ ["p-locate", "npm:4.1.0"]\ @@ -2746,7 +2746,7 @@ const RAW_RUNTIME_STATE = "linkType": "HARD"\ }],\ ["npm:6.0.0", {\ - "packageLocation": "../../../../.yarn/berry/cache/locate-path-npm-6.0.0-06a1e4c528-10.zip/node_modules/locate-path/",\ + "packageLocation": "./.yarn/cache/locate-path-npm-6.0.0-06a1e4c528-72eb661788.zip/node_modules/locate-path/",\ "packageDependencies": [\ ["locate-path", "npm:6.0.0"],\ ["p-locate", "npm:5.0.0"]\ @@ -2756,7 +2756,7 @@ const RAW_RUNTIME_STATE = ]],\ ["lodash.merge", [\ ["npm:4.6.2", {\ - "packageLocation": "../../../../.yarn/berry/cache/lodash.merge-npm-4.6.2-77cb4416bf-10.zip/node_modules/lodash.merge/",\ + "packageLocation": "./.yarn/cache/lodash.merge-npm-4.6.2-77cb4416bf-d0ea2dd009.zip/node_modules/lodash.merge/",\ "packageDependencies": [\ ["lodash.merge", "npm:4.6.2"]\ ],\ @@ -2765,7 +2765,7 @@ const RAW_RUNTIME_STATE = ]],\ ["log-symbols", [\ ["npm:4.1.0", {\ - "packageLocation": "../../../../.yarn/berry/cache/log-symbols-npm-4.1.0-0a13492d8b-10.zip/node_modules/log-symbols/",\ + "packageLocation": "./.yarn/cache/log-symbols-npm-4.1.0-0a13492d8b-fce1497b31.zip/node_modules/log-symbols/",\ "packageDependencies": [\ ["log-symbols", "npm:4.1.0"],\ ["chalk", "npm:4.1.2"],\ @@ -2776,14 +2776,14 @@ const RAW_RUNTIME_STATE = ]],\ ["lru-cache", [\ ["npm:10.0.1", {\ - "packageLocation": "../../../../.yarn/berry/cache/lru-cache-npm-10.0.1-0e1abf4c13-10.zip/node_modules/lru-cache/",\ + "packageLocation": "./.yarn/cache/lru-cache-npm-10.0.1-0e1abf4c13-5bb91a97a3.zip/node_modules/lru-cache/",\ "packageDependencies": [\ ["lru-cache", "npm:10.0.1"]\ ],\ "linkType": "HARD"\ }],\ ["npm:6.0.0", {\ - "packageLocation": "../../../../.yarn/berry/cache/lru-cache-npm-6.0.0-b4c8668fe1-10.zip/node_modules/lru-cache/",\ + "packageLocation": "./.yarn/cache/lru-cache-npm-6.0.0-b4c8668fe1-fc1fe2ee20.zip/node_modules/lru-cache/",\ "packageDependencies": [\ ["lru-cache", "npm:6.0.0"],\ ["yallist", "npm:4.0.0"]\ @@ -2791,7 +2791,7 @@ const RAW_RUNTIME_STATE = "linkType": "HARD"\ }],\ ["npm:7.18.3", {\ - "packageLocation": "../../../../.yarn/berry/cache/lru-cache-npm-7.18.3-e68be5b11c-10.zip/node_modules/lru-cache/",\ + "packageLocation": "./.yarn/cache/lru-cache-npm-7.18.3-e68be5b11c-6029ca5aba.zip/node_modules/lru-cache/",\ "packageDependencies": [\ ["lru-cache", "npm:7.18.3"]\ ],\ @@ -2800,7 +2800,7 @@ const RAW_RUNTIME_STATE = ]],\ ["make-fetch-happen", [\ ["npm:11.1.1", {\ - "packageLocation": "../../../../.yarn/berry/cache/make-fetch-happen-npm-11.1.1-f32b79aaaa-10.zip/node_modules/make-fetch-happen/",\ + "packageLocation": "./.yarn/cache/make-fetch-happen-npm-11.1.1-f32b79aaaa-b4b442cfaa.zip/node_modules/make-fetch-happen/",\ "packageDependencies": [\ ["make-fetch-happen", "npm:11.1.1"],\ ["agentkeepalive", "npm:4.5.0"],\ @@ -2824,7 +2824,7 @@ const RAW_RUNTIME_STATE = ]],\ ["merge-stream", [\ ["npm:2.0.0", {\ - "packageLocation": "../../../../.yarn/berry/cache/merge-stream-npm-2.0.0-2ac83efea5-10.zip/node_modules/merge-stream/",\ + "packageLocation": "./.yarn/cache/merge-stream-npm-2.0.0-2ac83efea5-6fa4dcc8d8.zip/node_modules/merge-stream/",\ "packageDependencies": [\ ["merge-stream", "npm:2.0.0"]\ ],\ @@ -2833,7 +2833,7 @@ const RAW_RUNTIME_STATE = ]],\ ["merge2", [\ ["npm:1.4.1", {\ - "packageLocation": "../../../../.yarn/berry/cache/merge2-npm-1.4.1-a2507bd06c-10.zip/node_modules/merge2/",\ + "packageLocation": "./.yarn/cache/merge2-npm-1.4.1-a2507bd06c-7268db63ed.zip/node_modules/merge2/",\ "packageDependencies": [\ ["merge2", "npm:1.4.1"]\ ],\ @@ -2842,7 +2842,7 @@ const RAW_RUNTIME_STATE = ]],\ ["micromatch", [\ ["npm:4.0.5", {\ - "packageLocation": "../../../../.yarn/berry/cache/micromatch-npm-4.0.5-cfab5d7669-10.zip/node_modules/micromatch/",\ + "packageLocation": "./.yarn/cache/micromatch-npm-4.0.5-cfab5d7669-a749888789.zip/node_modules/micromatch/",\ "packageDependencies": [\ ["micromatch", "npm:4.0.5"],\ ["braces", "npm:3.0.2"],\ @@ -2853,7 +2853,7 @@ const RAW_RUNTIME_STATE = ]],\ ["mime-db", [\ ["npm:1.52.0", {\ - "packageLocation": "../../../../.yarn/berry/cache/mime-db-npm-1.52.0-b5371d6fd2-10.zip/node_modules/mime-db/",\ + "packageLocation": "./.yarn/cache/mime-db-npm-1.52.0-b5371d6fd2-54bb60bf39.zip/node_modules/mime-db/",\ "packageDependencies": [\ ["mime-db", "npm:1.52.0"]\ ],\ @@ -2862,7 +2862,7 @@ const RAW_RUNTIME_STATE = ]],\ ["mime-types", [\ ["npm:2.1.35", {\ - "packageLocation": "../../../../.yarn/berry/cache/mime-types-npm-2.1.35-dd9ea9f3e2-10.zip/node_modules/mime-types/",\ + "packageLocation": "./.yarn/cache/mime-types-npm-2.1.35-dd9ea9f3e2-89aa9651b6.zip/node_modules/mime-types/",\ "packageDependencies": [\ ["mime-types", "npm:2.1.35"],\ ["mime-db", "npm:1.52.0"]\ @@ -2872,7 +2872,7 @@ const RAW_RUNTIME_STATE = ]],\ ["minimatch", [\ ["npm:3.1.2", {\ - "packageLocation": "../../../../.yarn/berry/cache/minimatch-npm-3.1.2-9405269906-10.zip/node_modules/minimatch/",\ + "packageLocation": "./.yarn/cache/minimatch-npm-3.1.2-9405269906-e0b25b04cd.zip/node_modules/minimatch/",\ "packageDependencies": [\ ["minimatch", "npm:3.1.2"],\ ["brace-expansion", "npm:1.1.11"]\ @@ -2880,7 +2880,7 @@ const RAW_RUNTIME_STATE = "linkType": "HARD"\ }],\ ["npm:5.0.1", {\ - "packageLocation": "../../../../.yarn/berry/cache/minimatch-npm-5.0.1-612724f6f0-10.zip/node_modules/minimatch/",\ + "packageLocation": "./.yarn/cache/minimatch-npm-5.0.1-612724f6f0-2656580f18.zip/node_modules/minimatch/",\ "packageDependencies": [\ ["minimatch", "npm:5.0.1"],\ ["brace-expansion", "npm:2.0.1"]\ @@ -2888,7 +2888,7 @@ const RAW_RUNTIME_STATE = "linkType": "HARD"\ }],\ ["npm:5.1.6", {\ - "packageLocation": "../../../../.yarn/berry/cache/minimatch-npm-5.1.6-1e71429f4c-10.zip/node_modules/minimatch/",\ + "packageLocation": "./.yarn/cache/minimatch-npm-5.1.6-1e71429f4c-126b36485b.zip/node_modules/minimatch/",\ "packageDependencies": [\ ["minimatch", "npm:5.1.6"],\ ["brace-expansion", "npm:2.0.1"]\ @@ -2896,7 +2896,7 @@ const RAW_RUNTIME_STATE = "linkType": "HARD"\ }],\ ["npm:9.0.3", {\ - "packageLocation": "../../../../.yarn/berry/cache/minimatch-npm-9.0.3-69d7d6fad5-10.zip/node_modules/minimatch/",\ + "packageLocation": "./.yarn/cache/minimatch-npm-9.0.3-69d7d6fad5-c81b47d281.zip/node_modules/minimatch/",\ "packageDependencies": [\ ["minimatch", "npm:9.0.3"],\ ["brace-expansion", "npm:2.0.1"]\ @@ -2906,7 +2906,7 @@ const RAW_RUNTIME_STATE = ]],\ ["minipass", [\ ["npm:3.3.6", {\ - "packageLocation": "../../../../.yarn/berry/cache/minipass-npm-3.3.6-b8d93a945b-10.zip/node_modules/minipass/",\ + "packageLocation": "./.yarn/cache/minipass-npm-3.3.6-b8d93a945b-a5c6ef069f.zip/node_modules/minipass/",\ "packageDependencies": [\ ["minipass", "npm:3.3.6"],\ ["yallist", "npm:4.0.0"]\ @@ -2914,14 +2914,14 @@ const RAW_RUNTIME_STATE = "linkType": "HARD"\ }],\ ["npm:5.0.0", {\ - "packageLocation": "../../../../.yarn/berry/cache/minipass-npm-5.0.0-c64fb63c92-10.zip/node_modules/minipass/",\ + "packageLocation": "./.yarn/cache/minipass-npm-5.0.0-c64fb63c92-61682162d2.zip/node_modules/minipass/",\ "packageDependencies": [\ ["minipass", "npm:5.0.0"]\ ],\ "linkType": "HARD"\ }],\ ["npm:7.0.3", {\ - "packageLocation": "../../../../.yarn/berry/cache/minipass-npm-7.0.3-3b57909ee9-10.zip/node_modules/minipass/",\ + "packageLocation": "./.yarn/cache/minipass-npm-7.0.3-3b57909ee9-04d72c8a43.zip/node_modules/minipass/",\ "packageDependencies": [\ ["minipass", "npm:7.0.3"]\ ],\ @@ -2930,7 +2930,7 @@ const RAW_RUNTIME_STATE = ]],\ ["minipass-collect", [\ ["npm:1.0.2", {\ - "packageLocation": "../../../../.yarn/berry/cache/minipass-collect-npm-1.0.2-3b4676eab5-10.zip/node_modules/minipass-collect/",\ + "packageLocation": "./.yarn/cache/minipass-collect-npm-1.0.2-3b4676eab5-14df761028.zip/node_modules/minipass-collect/",\ "packageDependencies": [\ ["minipass-collect", "npm:1.0.2"],\ ["minipass", "npm:3.3.6"]\ @@ -2940,7 +2940,7 @@ const RAW_RUNTIME_STATE = ]],\ ["minipass-fetch", [\ ["npm:3.0.4", {\ - "packageLocation": "../../../../.yarn/berry/cache/minipass-fetch-npm-3.0.4-200ac7c66d-10.zip/node_modules/minipass-fetch/",\ + "packageLocation": "./.yarn/cache/minipass-fetch-npm-3.0.4-200ac7c66d-3edf72b900.zip/node_modules/minipass-fetch/",\ "packageDependencies": [\ ["minipass-fetch", "npm:3.0.4"],\ ["encoding", "npm:0.1.13"],\ @@ -2953,7 +2953,7 @@ const RAW_RUNTIME_STATE = ]],\ ["minipass-flush", [\ ["npm:1.0.5", {\ - "packageLocation": "../../../../.yarn/berry/cache/minipass-flush-npm-1.0.5-efe79d9826-10.zip/node_modules/minipass-flush/",\ + "packageLocation": "./.yarn/cache/minipass-flush-npm-1.0.5-efe79d9826-56269a0b22.zip/node_modules/minipass-flush/",\ "packageDependencies": [\ ["minipass-flush", "npm:1.0.5"],\ ["minipass", "npm:3.3.6"]\ @@ -2963,7 +2963,7 @@ const RAW_RUNTIME_STATE = ]],\ ["minipass-pipeline", [\ ["npm:1.2.4", {\ - "packageLocation": "../../../../.yarn/berry/cache/minipass-pipeline-npm-1.2.4-5924cb077f-10.zip/node_modules/minipass-pipeline/",\ + "packageLocation": "./.yarn/cache/minipass-pipeline-npm-1.2.4-5924cb077f-b14240dac0.zip/node_modules/minipass-pipeline/",\ "packageDependencies": [\ ["minipass-pipeline", "npm:1.2.4"],\ ["minipass", "npm:3.3.6"]\ @@ -2973,7 +2973,7 @@ const RAW_RUNTIME_STATE = ]],\ ["minipass-sized", [\ ["npm:1.0.3", {\ - "packageLocation": "../../../../.yarn/berry/cache/minipass-sized-npm-1.0.3-306d86f432-10.zip/node_modules/minipass-sized/",\ + "packageLocation": "./.yarn/cache/minipass-sized-npm-1.0.3-306d86f432-40982d8d83.zip/node_modules/minipass-sized/",\ "packageDependencies": [\ ["minipass-sized", "npm:1.0.3"],\ ["minipass", "npm:3.3.6"]\ @@ -2983,7 +2983,7 @@ const RAW_RUNTIME_STATE = ]],\ ["minizlib", [\ ["npm:2.1.2", {\ - "packageLocation": "../../../../.yarn/berry/cache/minizlib-npm-2.1.2-ea89cd0cfb-10.zip/node_modules/minizlib/",\ + "packageLocation": "./.yarn/cache/minizlib-npm-2.1.2-ea89cd0cfb-ae0f45436f.zip/node_modules/minizlib/",\ "packageDependencies": [\ ["minizlib", "npm:2.1.2"],\ ["minipass", "npm:3.3.6"],\ @@ -2994,7 +2994,7 @@ const RAW_RUNTIME_STATE = ]],\ ["mkdirp", [\ ["npm:1.0.4", {\ - "packageLocation": "../../../../.yarn/berry/cache/mkdirp-npm-1.0.4-37f6ef56b9-10.zip/node_modules/mkdirp/",\ + "packageLocation": "./.yarn/cache/mkdirp-npm-1.0.4-37f6ef56b9-d71b8dcd4b.zip/node_modules/mkdirp/",\ "packageDependencies": [\ ["mkdirp", "npm:1.0.4"]\ ],\ @@ -3003,7 +3003,7 @@ const RAW_RUNTIME_STATE = ]],\ ["mocha", [\ ["npm:10.2.0", {\ - "packageLocation": "../../../../.yarn/berry/cache/mocha-npm-10.2.0-87db25c7c5-10.zip/node_modules/mocha/",\ + "packageLocation": "./.yarn/cache/mocha-npm-10.2.0-87db25c7c5-f7362898ae.zip/node_modules/mocha/",\ "packageDependencies": [\ ["mocha", "npm:10.2.0"],\ ["ansi-colors", "npm:4.1.1"],\ @@ -3033,14 +3033,14 @@ const RAW_RUNTIME_STATE = ]],\ ["ms", [\ ["npm:2.1.2", {\ - "packageLocation": "../../../../.yarn/berry/cache/ms-npm-2.1.2-ec0c1512ff-10.zip/node_modules/ms/",\ + "packageLocation": "./.yarn/cache/ms-npm-2.1.2-ec0c1512ff-673cdb2c31.zip/node_modules/ms/",\ "packageDependencies": [\ ["ms", "npm:2.1.2"]\ ],\ "linkType": "HARD"\ }],\ ["npm:2.1.3", {\ - "packageLocation": "../../../../.yarn/berry/cache/ms-npm-2.1.3-81ff3cfac1-10.zip/node_modules/ms/",\ + "packageLocation": "./.yarn/cache/ms-npm-2.1.3-81ff3cfac1-aa92de6080.zip/node_modules/ms/",\ "packageDependencies": [\ ["ms", "npm:2.1.3"]\ ],\ @@ -3049,7 +3049,7 @@ const RAW_RUNTIME_STATE = ]],\ ["nanoid", [\ ["npm:3.3.3", {\ - "packageLocation": "../../../../.yarn/berry/cache/nanoid-npm-3.3.3-25d865be84-10.zip/node_modules/nanoid/",\ + "packageLocation": "./.yarn/cache/nanoid-npm-3.3.3-25d865be84-c703ed58a2.zip/node_modules/nanoid/",\ "packageDependencies": [\ ["nanoid", "npm:3.3.3"]\ ],\ @@ -3058,7 +3058,7 @@ const RAW_RUNTIME_STATE = ]],\ ["natural-compare", [\ ["npm:1.4.0", {\ - "packageLocation": "../../../../.yarn/berry/cache/natural-compare-npm-1.4.0-97b75b362d-10.zip/node_modules/natural-compare/",\ + "packageLocation": "./.yarn/cache/natural-compare-npm-1.4.0-97b75b362d-23ad088b08.zip/node_modules/natural-compare/",\ "packageDependencies": [\ ["natural-compare", "npm:1.4.0"]\ ],\ @@ -3067,7 +3067,7 @@ const RAW_RUNTIME_STATE = ]],\ ["natural-compare-lite", [\ ["npm:1.4.0", {\ - "packageLocation": "../../../../.yarn/berry/cache/natural-compare-lite-npm-1.4.0-12b6b308ed-10.zip/node_modules/natural-compare-lite/",\ + "packageLocation": "./.yarn/cache/natural-compare-lite-npm-1.4.0-12b6b308ed-5222ac3986.zip/node_modules/natural-compare-lite/",\ "packageDependencies": [\ ["natural-compare-lite", "npm:1.4.0"]\ ],\ @@ -3076,7 +3076,7 @@ const RAW_RUNTIME_STATE = ]],\ ["negotiator", [\ ["npm:0.6.3", {\ - "packageLocation": "../../../../.yarn/berry/cache/negotiator-npm-0.6.3-9d50e36171-10.zip/node_modules/negotiator/",\ + "packageLocation": "./.yarn/cache/negotiator-npm-0.6.3-9d50e36171-2723fb822a.zip/node_modules/negotiator/",\ "packageDependencies": [\ ["negotiator", "npm:0.6.3"]\ ],\ @@ -3085,7 +3085,7 @@ const RAW_RUNTIME_STATE = ]],\ ["neo-async", [\ ["npm:2.6.2", {\ - "packageLocation": "../../../../.yarn/berry/cache/neo-async-npm-2.6.2-75d6902586-10.zip/node_modules/neo-async/",\ + "packageLocation": "./.yarn/cache/neo-async-npm-2.6.2-75d6902586-1a7948fea8.zip/node_modules/neo-async/",\ "packageDependencies": [\ ["neo-async", "npm:2.6.2"]\ ],\ @@ -3114,7 +3114,7 @@ const RAW_RUNTIME_STATE = ]],\ ["node-releases", [\ ["npm:2.0.13", {\ - "packageLocation": "../../../../.yarn/berry/cache/node-releases-npm-2.0.13-1f2e177887-10.zip/node_modules/node-releases/",\ + "packageLocation": "./.yarn/cache/node-releases-npm-2.0.13-1f2e177887-c9bb813aab.zip/node_modules/node-releases/",\ "packageDependencies": [\ ["node-releases", "npm:2.0.13"]\ ],\ @@ -3123,7 +3123,7 @@ const RAW_RUNTIME_STATE = ]],\ ["nopt", [\ ["npm:6.0.0", {\ - "packageLocation": "../../../../.yarn/berry/cache/nopt-npm-6.0.0-5ea8050815-10.zip/node_modules/nopt/",\ + "packageLocation": "./.yarn/cache/nopt-npm-6.0.0-5ea8050815-3c1128e07c.zip/node_modules/nopt/",\ "packageDependencies": [\ ["nopt", "npm:6.0.0"],\ ["abbrev", "npm:1.1.1"]\ @@ -3133,7 +3133,7 @@ const RAW_RUNTIME_STATE = ]],\ ["normalize-path", [\ ["npm:3.0.0", {\ - "packageLocation": "../../../../.yarn/berry/cache/normalize-path-npm-3.0.0-658ba7d77f-10.zip/node_modules/normalize-path/",\ + "packageLocation": "./.yarn/cache/normalize-path-npm-3.0.0-658ba7d77f-88eeb4da89.zip/node_modules/normalize-path/",\ "packageDependencies": [\ ["normalize-path", "npm:3.0.0"]\ ],\ @@ -3142,7 +3142,7 @@ const RAW_RUNTIME_STATE = ]],\ ["npmlog", [\ ["npm:6.0.2", {\ - "packageLocation": "../../../../.yarn/berry/cache/npmlog-npm-6.0.2-e0e69455c7-10.zip/node_modules/npmlog/",\ + "packageLocation": "./.yarn/cache/npmlog-npm-6.0.2-e0e69455c7-82b123677e.zip/node_modules/npmlog/",\ "packageDependencies": [\ ["npmlog", "npm:6.0.2"],\ ["are-we-there-yet", "npm:3.0.1"],\ @@ -3155,7 +3155,7 @@ const RAW_RUNTIME_STATE = ]],\ ["once", [\ ["npm:1.4.0", {\ - "packageLocation": "../../../../.yarn/berry/cache/once-npm-1.4.0-ccf03ef07a-10.zip/node_modules/once/",\ + "packageLocation": "./.yarn/cache/once-npm-1.4.0-ccf03ef07a-cd0a885013.zip/node_modules/once/",\ "packageDependencies": [\ ["once", "npm:1.4.0"],\ ["wrappy", "npm:1.0.2"]\ @@ -3165,7 +3165,7 @@ const RAW_RUNTIME_STATE = ]],\ ["optionator", [\ ["npm:0.9.3", {\ - "packageLocation": "../../../../.yarn/berry/cache/optionator-npm-0.9.3-56c3a4bf80-10.zip/node_modules/optionator/",\ + "packageLocation": "./.yarn/cache/optionator-npm-0.9.3-56c3a4bf80-fa28d30163.zip/node_modules/optionator/",\ "packageDependencies": [\ ["optionator", "npm:0.9.3"],\ ["@aashutoshrathi/word-wrap", "npm:1.2.6"],\ @@ -3243,7 +3243,7 @@ const RAW_RUNTIME_STATE = ]],\ ["p-limit", [\ ["npm:2.3.0", {\ - "packageLocation": "../../../../.yarn/berry/cache/p-limit-npm-2.3.0-94a0310039-10.zip/node_modules/p-limit/",\ + "packageLocation": "./.yarn/cache/p-limit-npm-2.3.0-94a0310039-84ff17f1a3.zip/node_modules/p-limit/",\ "packageDependencies": [\ ["p-limit", "npm:2.3.0"],\ ["p-try", "npm:2.2.0"]\ @@ -3251,7 +3251,7 @@ const RAW_RUNTIME_STATE = "linkType": "HARD"\ }],\ ["npm:3.1.0", {\ - "packageLocation": "../../../../.yarn/berry/cache/p-limit-npm-3.1.0-05d2ede37f-10.zip/node_modules/p-limit/",\ + "packageLocation": "./.yarn/cache/p-limit-npm-3.1.0-05d2ede37f-7c3690c4db.zip/node_modules/p-limit/",\ "packageDependencies": [\ ["p-limit", "npm:3.1.0"],\ ["yocto-queue", "npm:0.1.0"]\ @@ -3261,7 +3261,7 @@ const RAW_RUNTIME_STATE = ]],\ ["p-locate", [\ ["npm:4.1.0", {\ - "packageLocation": "../../../../.yarn/berry/cache/p-locate-npm-4.1.0-eec6872537-10.zip/node_modules/p-locate/",\ + "packageLocation": "./.yarn/cache/p-locate-npm-4.1.0-eec6872537-513bd14a45.zip/node_modules/p-locate/",\ "packageDependencies": [\ ["p-locate", "npm:4.1.0"],\ ["p-limit", "npm:2.3.0"]\ @@ -3269,7 +3269,7 @@ const RAW_RUNTIME_STATE = "linkType": "HARD"\ }],\ ["npm:5.0.0", {\ - "packageLocation": "../../../../.yarn/berry/cache/p-locate-npm-5.0.0-92cc7c7a3e-10.zip/node_modules/p-locate/",\ + "packageLocation": "./.yarn/cache/p-locate-npm-5.0.0-92cc7c7a3e-1623088f36.zip/node_modules/p-locate/",\ "packageDependencies": [\ ["p-locate", "npm:5.0.0"],\ ["p-limit", "npm:3.1.0"]\ @@ -3279,7 +3279,7 @@ const RAW_RUNTIME_STATE = ]],\ ["p-map", [\ ["npm:4.0.0", {\ - "packageLocation": "../../../../.yarn/berry/cache/p-map-npm-4.0.0-4677ae07c7-10.zip/node_modules/p-map/",\ + "packageLocation": "./.yarn/cache/p-map-npm-4.0.0-4677ae07c7-7ba4a2b1e2.zip/node_modules/p-map/",\ "packageDependencies": [\ ["p-map", "npm:4.0.0"],\ ["aggregate-error", "npm:3.1.0"]\ @@ -3289,7 +3289,7 @@ const RAW_RUNTIME_STATE = ]],\ ["p-try", [\ ["npm:2.2.0", {\ - "packageLocation": "../../../../.yarn/berry/cache/p-try-npm-2.2.0-e0390dbaf8-10.zip/node_modules/p-try/",\ + "packageLocation": "./.yarn/cache/p-try-npm-2.2.0-e0390dbaf8-f8a8e9a769.zip/node_modules/p-try/",\ "packageDependencies": [\ ["p-try", "npm:2.2.0"]\ ],\ @@ -3298,7 +3298,7 @@ const RAW_RUNTIME_STATE = ]],\ ["pako", [\ ["npm:1.0.11", {\ - "packageLocation": "../../../../.yarn/berry/cache/pako-npm-1.0.11-b8f1b69d3e-10.zip/node_modules/pako/",\ + "packageLocation": "./.yarn/cache/pako-npm-1.0.11-b8f1b69d3e-1ad07210e8.zip/node_modules/pako/",\ "packageDependencies": [\ ["pako", "npm:1.0.11"]\ ],\ @@ -3307,7 +3307,7 @@ const RAW_RUNTIME_STATE = ]],\ ["parent-module", [\ ["npm:1.0.1", {\ - "packageLocation": "../../../../.yarn/berry/cache/parent-module-npm-1.0.1-1fae11b095-10.zip/node_modules/parent-module/",\ + "packageLocation": "./.yarn/cache/parent-module-npm-1.0.1-1fae11b095-6ba8b25514.zip/node_modules/parent-module/",\ "packageDependencies": [\ ["parent-module", "npm:1.0.1"],\ ["callsites", "npm:3.1.0"]\ @@ -3317,7 +3317,7 @@ const RAW_RUNTIME_STATE = ]],\ ["path-exists", [\ ["npm:4.0.0", {\ - "packageLocation": "../../../../.yarn/berry/cache/path-exists-npm-4.0.0-e9e4f63eb0-10.zip/node_modules/path-exists/",\ + "packageLocation": "./.yarn/cache/path-exists-npm-4.0.0-e9e4f63eb0-505807199d.zip/node_modules/path-exists/",\ "packageDependencies": [\ ["path-exists", "npm:4.0.0"]\ ],\ @@ -3326,7 +3326,7 @@ const RAW_RUNTIME_STATE = ]],\ ["path-is-absolute", [\ ["npm:1.0.1", {\ - "packageLocation": "../../../../.yarn/berry/cache/path-is-absolute-npm-1.0.1-31bc695ffd-10.zip/node_modules/path-is-absolute/",\ + "packageLocation": "./.yarn/cache/path-is-absolute-npm-1.0.1-31bc695ffd-060840f92c.zip/node_modules/path-is-absolute/",\ "packageDependencies": [\ ["path-is-absolute", "npm:1.0.1"]\ ],\ @@ -3335,7 +3335,7 @@ const RAW_RUNTIME_STATE = ]],\ ["path-key", [\ ["npm:3.1.1", {\ - "packageLocation": "../../../../.yarn/berry/cache/path-key-npm-3.1.1-0e66ea8321-10.zip/node_modules/path-key/",\ + "packageLocation": "./.yarn/cache/path-key-npm-3.1.1-0e66ea8321-55cd7a9dd4.zip/node_modules/path-key/",\ "packageDependencies": [\ ["path-key", "npm:3.1.1"]\ ],\ @@ -3344,7 +3344,7 @@ const RAW_RUNTIME_STATE = ]],\ ["path-parse", [\ ["npm:1.0.7", {\ - "packageLocation": "../../../../.yarn/berry/cache/path-parse-npm-1.0.7-09564527b7-10.zip/node_modules/path-parse/",\ + "packageLocation": "./.yarn/cache/path-parse-npm-1.0.7-09564527b7-49abf3d811.zip/node_modules/path-parse/",\ "packageDependencies": [\ ["path-parse", "npm:1.0.7"]\ ],\ @@ -3353,7 +3353,7 @@ const RAW_RUNTIME_STATE = ]],\ ["path-scurry", [\ ["npm:1.10.1", {\ - "packageLocation": "../../../../.yarn/berry/cache/path-scurry-npm-1.10.1-52bd946f2e-10.zip/node_modules/path-scurry/",\ + "packageLocation": "./.yarn/cache/path-scurry-npm-1.10.1-52bd946f2e-eebfb8304f.zip/node_modules/path-scurry/",\ "packageDependencies": [\ ["path-scurry", "npm:1.10.1"],\ ["lru-cache", "npm:10.0.1"],\ @@ -3364,7 +3364,7 @@ const RAW_RUNTIME_STATE = ]],\ ["path-type", [\ ["npm:4.0.0", {\ - "packageLocation": "../../../../.yarn/berry/cache/path-type-npm-4.0.0-10d47fc86a-10.zip/node_modules/path-type/",\ + "packageLocation": "./.yarn/cache/path-type-npm-4.0.0-10d47fc86a-5b1e2daa24.zip/node_modules/path-type/",\ "packageDependencies": [\ ["path-type", "npm:4.0.0"]\ ],\ @@ -3373,7 +3373,7 @@ const RAW_RUNTIME_STATE = ]],\ ["picocolors", [\ ["npm:1.0.0", {\ - "packageLocation": "../../../../.yarn/berry/cache/picocolors-npm-1.0.0-d81e0b1927-10.zip/node_modules/picocolors/",\ + "packageLocation": "./.yarn/cache/picocolors-npm-1.0.0-d81e0b1927-a2e8092dd8.zip/node_modules/picocolors/",\ "packageDependencies": [\ ["picocolors", "npm:1.0.0"]\ ],\ @@ -3382,7 +3382,7 @@ const RAW_RUNTIME_STATE = ]],\ ["picomatch", [\ ["npm:2.3.1", {\ - "packageLocation": "../../../../.yarn/berry/cache/picomatch-npm-2.3.1-c782cfd986-10.zip/node_modules/picomatch/",\ + "packageLocation": "./.yarn/cache/picomatch-npm-2.3.1-c782cfd986-60c2595003.zip/node_modules/picomatch/",\ "packageDependencies": [\ ["picomatch", "npm:2.3.1"]\ ],\ @@ -3391,7 +3391,7 @@ const RAW_RUNTIME_STATE = ]],\ ["pkg-dir", [\ ["npm:4.2.0", {\ - "packageLocation": "../../../../.yarn/berry/cache/pkg-dir-npm-4.2.0-2b5d0a8d32-10.zip/node_modules/pkg-dir/",\ + "packageLocation": "./.yarn/cache/pkg-dir-npm-4.2.0-2b5d0a8d32-9863e3f351.zip/node_modules/pkg-dir/",\ "packageDependencies": [\ ["pkg-dir", "npm:4.2.0"],\ ["find-up", "npm:4.1.0"]\ @@ -3401,7 +3401,7 @@ const RAW_RUNTIME_STATE = ]],\ ["prelude-ls", [\ ["npm:1.2.1", {\ - "packageLocation": "../../../../.yarn/berry/cache/prelude-ls-npm-1.2.1-3e4d272a55-10.zip/node_modules/prelude-ls/",\ + "packageLocation": "./.yarn/cache/prelude-ls-npm-1.2.1-3e4d272a55-0b9d2c7680.zip/node_modules/prelude-ls/",\ "packageDependencies": [\ ["prelude-ls", "npm:1.2.1"]\ ],\ @@ -3410,7 +3410,7 @@ const RAW_RUNTIME_STATE = ]],\ ["prettier", [\ ["npm:3.0.0", {\ - "packageLocation": "../../../../.yarn/berry/cache/prettier-npm-3.0.0-7ffbcce680-10.zip/node_modules/prettier/",\ + "packageLocation": "./.yarn/cache/prettier-npm-3.0.0-7ffbcce680-3992926382.zip/node_modules/prettier/",\ "packageDependencies": [\ ["prettier", "npm:3.0.0"]\ ],\ @@ -3419,7 +3419,7 @@ const RAW_RUNTIME_STATE = ]],\ ["process-nextick-args", [\ ["npm:2.0.1", {\ - "packageLocation": "../../../../.yarn/berry/cache/process-nextick-args-npm-2.0.1-b8d7971609-10.zip/node_modules/process-nextick-args/",\ + "packageLocation": "./.yarn/cache/process-nextick-args-npm-2.0.1-b8d7971609-1d38588e52.zip/node_modules/process-nextick-args/",\ "packageDependencies": [\ ["process-nextick-args", "npm:2.0.1"]\ ],\ @@ -3428,7 +3428,7 @@ const RAW_RUNTIME_STATE = ]],\ ["promise-retry", [\ ["npm:2.0.1", {\ - "packageLocation": "../../../../.yarn/berry/cache/promise-retry-npm-2.0.1-871f0b01b7-10.zip/node_modules/promise-retry/",\ + "packageLocation": "./.yarn/cache/promise-retry-npm-2.0.1-871f0b01b7-96e1a82453.zip/node_modules/promise-retry/",\ "packageDependencies": [\ ["promise-retry", "npm:2.0.1"],\ ["err-code", "npm:2.0.3"],\ @@ -3439,7 +3439,7 @@ const RAW_RUNTIME_STATE = ]],\ ["punycode", [\ ["npm:2.3.0", {\ - "packageLocation": "../../../../.yarn/berry/cache/punycode-npm-2.3.0-df4bdce06b-10.zip/node_modules/punycode/",\ + "packageLocation": "./.yarn/cache/punycode-npm-2.3.0-df4bdce06b-d4e7fbb96f.zip/node_modules/punycode/",\ "packageDependencies": [\ ["punycode", "npm:2.3.0"]\ ],\ @@ -3448,7 +3448,7 @@ const RAW_RUNTIME_STATE = ]],\ ["queue-microtask", [\ ["npm:1.2.3", {\ - "packageLocation": "../../../../.yarn/berry/cache/queue-microtask-npm-1.2.3-fcc98e4e2d-10.zip/node_modules/queue-microtask/",\ + "packageLocation": "./.yarn/cache/queue-microtask-npm-1.2.3-fcc98e4e2d-72900df061.zip/node_modules/queue-microtask/",\ "packageDependencies": [\ ["queue-microtask", "npm:1.2.3"]\ ],\ @@ -3457,7 +3457,7 @@ const RAW_RUNTIME_STATE = ]],\ ["randombytes", [\ ["npm:2.1.0", {\ - "packageLocation": "../../../../.yarn/berry/cache/randombytes-npm-2.1.0-e3da76bccf-10.zip/node_modules/randombytes/",\ + "packageLocation": "./.yarn/cache/randombytes-npm-2.1.0-e3da76bccf-4efd1ad3d8.zip/node_modules/randombytes/",\ "packageDependencies": [\ ["randombytes", "npm:2.1.0"],\ ["safe-buffer", "npm:5.2.1"]\ @@ -3467,7 +3467,7 @@ const RAW_RUNTIME_STATE = ]],\ ["readable-stream", [\ ["npm:2.3.8", {\ - "packageLocation": "../../../../.yarn/berry/cache/readable-stream-npm-2.3.8-67a94c2cb1-10.zip/node_modules/readable-stream/",\ + "packageLocation": "./.yarn/cache/readable-stream-npm-2.3.8-67a94c2cb1-8500dd3a90.zip/node_modules/readable-stream/",\ "packageDependencies": [\ ["readable-stream", "npm:2.3.8"],\ ["core-util-is", "npm:1.0.3"],\ @@ -3481,7 +3481,7 @@ const RAW_RUNTIME_STATE = "linkType": "HARD"\ }],\ ["npm:3.6.2", {\ - "packageLocation": "../../../../.yarn/berry/cache/readable-stream-npm-3.6.2-d2a6069158-10.zip/node_modules/readable-stream/",\ + "packageLocation": "./.yarn/cache/readable-stream-npm-3.6.2-d2a6069158-d9e3e53193.zip/node_modules/readable-stream/",\ "packageDependencies": [\ ["readable-stream", "npm:3.6.2"],\ ["inherits", "npm:2.0.4"],\ @@ -3493,7 +3493,7 @@ const RAW_RUNTIME_STATE = ]],\ ["readdirp", [\ ["npm:3.6.0", {\ - "packageLocation": "../../../../.yarn/berry/cache/readdirp-npm-3.6.0-f950cc74ab-10.zip/node_modules/readdirp/",\ + "packageLocation": "./.yarn/cache/readdirp-npm-3.6.0-f950cc74ab-196b30ef6c.zip/node_modules/readdirp/",\ "packageDependencies": [\ ["readdirp", "npm:3.6.0"],\ ["picomatch", "npm:2.3.1"]\ @@ -3503,7 +3503,7 @@ const RAW_RUNTIME_STATE = ]],\ ["rechoir", [\ ["npm:0.8.0", {\ - "packageLocation": "../../../../.yarn/berry/cache/rechoir-npm-0.8.0-fb660b3bc8-10.zip/node_modules/rechoir/",\ + "packageLocation": "./.yarn/cache/rechoir-npm-0.8.0-fb660b3bc8-ad3caed8af.zip/node_modules/rechoir/",\ "packageDependencies": [\ ["rechoir", "npm:0.8.0"],\ ["resolve", "patch:resolve@npm%3A1.22.8#optional!builtin::version=1.22.8&hash=c3c19d"]\ @@ -3513,7 +3513,7 @@ const RAW_RUNTIME_STATE = ]],\ ["require-directory", [\ ["npm:2.1.1", {\ - "packageLocation": "../../../../.yarn/berry/cache/require-directory-npm-2.1.1-8608aee50b-10.zip/node_modules/require-directory/",\ + "packageLocation": "./.yarn/cache/require-directory-npm-2.1.1-8608aee50b-a72468e258.zip/node_modules/require-directory/",\ "packageDependencies": [\ ["require-directory", "npm:2.1.1"]\ ],\ @@ -3522,7 +3522,7 @@ const RAW_RUNTIME_STATE = ]],\ ["resolve", [\ ["patch:resolve@npm%3A1.22.8#optional!builtin::version=1.22.8&hash=c3c19d", {\ - "packageLocation": "../../../../.yarn/berry/cache/resolve-patch-4254c24959-10.zip/node_modules/resolve/",\ + "packageLocation": "./.yarn/cache/resolve-patch-4254c24959-f345cd37f5.zip/node_modules/resolve/",\ "packageDependencies": [\ ["resolve", "patch:resolve@npm%3A1.22.8#optional!builtin::version=1.22.8&hash=c3c19d"],\ ["is-core-module", "npm:2.13.0"],\ @@ -3534,7 +3534,7 @@ const RAW_RUNTIME_STATE = ]],\ ["resolve-cwd", [\ ["npm:3.0.0", {\ - "packageLocation": "../../../../.yarn/berry/cache/resolve-cwd-npm-3.0.0-e6f4e296bf-10.zip/node_modules/resolve-cwd/",\ + "packageLocation": "./.yarn/cache/resolve-cwd-npm-3.0.0-e6f4e296bf-546e081601.zip/node_modules/resolve-cwd/",\ "packageDependencies": [\ ["resolve-cwd", "npm:3.0.0"],\ ["resolve-from", "npm:5.0.0"]\ @@ -3544,14 +3544,14 @@ const RAW_RUNTIME_STATE = ]],\ ["resolve-from", [\ ["npm:4.0.0", {\ - "packageLocation": "../../../../.yarn/berry/cache/resolve-from-npm-4.0.0-f758ec21bf-10.zip/node_modules/resolve-from/",\ + "packageLocation": "./.yarn/cache/resolve-from-npm-4.0.0-f758ec21bf-91eb76ce83.zip/node_modules/resolve-from/",\ "packageDependencies": [\ ["resolve-from", "npm:4.0.0"]\ ],\ "linkType": "HARD"\ }],\ ["npm:5.0.0", {\ - "packageLocation": "../../../../.yarn/berry/cache/resolve-from-npm-5.0.0-15c9db4d33-10.zip/node_modules/resolve-from/",\ + "packageLocation": "./.yarn/cache/resolve-from-npm-5.0.0-15c9db4d33-be18a5e4d7.zip/node_modules/resolve-from/",\ "packageDependencies": [\ ["resolve-from", "npm:5.0.0"]\ ],\ @@ -3560,7 +3560,7 @@ const RAW_RUNTIME_STATE = ]],\ ["retry", [\ ["npm:0.12.0", {\ - "packageLocation": "../../../../.yarn/berry/cache/retry-npm-0.12.0-72ac7fb4cc-10.zip/node_modules/retry/",\ + "packageLocation": "./.yarn/cache/retry-npm-0.12.0-72ac7fb4cc-1f914879f9.zip/node_modules/retry/",\ "packageDependencies": [\ ["retry", "npm:0.12.0"]\ ],\ @@ -3569,7 +3569,7 @@ const RAW_RUNTIME_STATE = ]],\ ["reusify", [\ ["npm:1.0.4", {\ - "packageLocation": "../../../../.yarn/berry/cache/reusify-npm-1.0.4-95ac4aec11-10.zip/node_modules/reusify/",\ + "packageLocation": "./.yarn/cache/reusify-npm-1.0.4-95ac4aec11-14222c9e1d.zip/node_modules/reusify/",\ "packageDependencies": [\ ["reusify", "npm:1.0.4"]\ ],\ @@ -3578,7 +3578,7 @@ const RAW_RUNTIME_STATE = ]],\ ["rimraf", [\ ["npm:3.0.2", {\ - "packageLocation": "../../../../.yarn/berry/cache/rimraf-npm-3.0.2-2cb7dac69a-10.zip/node_modules/rimraf/",\ + "packageLocation": "./.yarn/cache/rimraf-npm-3.0.2-2cb7dac69a-063ffaccaa.zip/node_modules/rimraf/",\ "packageDependencies": [\ ["rimraf", "npm:3.0.2"],\ ["glob", "npm:7.2.3"]\ @@ -3588,7 +3588,7 @@ const RAW_RUNTIME_STATE = ]],\ ["run-parallel", [\ ["npm:1.2.0", {\ - "packageLocation": "../../../../.yarn/berry/cache/run-parallel-npm-1.2.0-3f47ff2034-10.zip/node_modules/run-parallel/",\ + "packageLocation": "./.yarn/cache/run-parallel-npm-1.2.0-3f47ff2034-cb4f97ad25.zip/node_modules/run-parallel/",\ "packageDependencies": [\ ["run-parallel", "npm:1.2.0"],\ ["queue-microtask", "npm:1.2.3"]\ @@ -3598,14 +3598,14 @@ const RAW_RUNTIME_STATE = ]],\ ["safe-buffer", [\ ["npm:5.1.2", {\ - "packageLocation": "../../../../.yarn/berry/cache/safe-buffer-npm-5.1.2-c27fedf6c4-10.zip/node_modules/safe-buffer/",\ + "packageLocation": "./.yarn/cache/safe-buffer-npm-5.1.2-c27fedf6c4-7eb5b48f2e.zip/node_modules/safe-buffer/",\ "packageDependencies": [\ ["safe-buffer", "npm:5.1.2"]\ ],\ "linkType": "HARD"\ }],\ ["npm:5.2.1", {\ - "packageLocation": "../../../../.yarn/berry/cache/safe-buffer-npm-5.2.1-3481c8aa9b-10.zip/node_modules/safe-buffer/",\ + "packageLocation": "./.yarn/cache/safe-buffer-npm-5.2.1-3481c8aa9b-32872cd0ff.zip/node_modules/safe-buffer/",\ "packageDependencies": [\ ["safe-buffer", "npm:5.2.1"]\ ],\ @@ -3614,7 +3614,7 @@ const RAW_RUNTIME_STATE = ]],\ ["safer-buffer", [\ ["npm:2.1.2", {\ - "packageLocation": "../../../../.yarn/berry/cache/safer-buffer-npm-2.1.2-8d5c0b705e-10.zip/node_modules/safer-buffer/",\ + "packageLocation": "./.yarn/cache/safer-buffer-npm-2.1.2-8d5c0b705e-7eaf7a0cf3.zip/node_modules/safer-buffer/",\ "packageDependencies": [\ ["safer-buffer", "npm:2.1.2"]\ ],\ @@ -3623,7 +3623,7 @@ const RAW_RUNTIME_STATE = ]],\ ["schema-utils", [\ ["npm:3.3.0", {\ - "packageLocation": "../../../../.yarn/berry/cache/schema-utils-npm-3.3.0-f2b36937f1-10.zip/node_modules/schema-utils/",\ + "packageLocation": "./.yarn/cache/schema-utils-npm-3.3.0-f2b36937f1-2c7bbb1da9.zip/node_modules/schema-utils/",\ "packageDependencies": [\ ["schema-utils", "npm:3.3.0"],\ ["@types/json-schema", "npm:7.0.14"],\ @@ -3635,7 +3635,7 @@ const RAW_RUNTIME_STATE = ]],\ ["semver", [\ ["npm:7.5.4", {\ - "packageLocation": "../../../../.yarn/berry/cache/semver-npm-7.5.4-c4ad957fcd-10.zip/node_modules/semver/",\ + "packageLocation": "./.yarn/cache/semver-npm-7.5.4-c4ad957fcd-985dec0d37.zip/node_modules/semver/",\ "packageDependencies": [\ ["semver", "npm:7.5.4"],\ ["lru-cache", "npm:6.0.0"]\ @@ -3645,7 +3645,7 @@ const RAW_RUNTIME_STATE = ]],\ ["serialize-javascript", [\ ["npm:6.0.0", {\ - "packageLocation": "../../../../.yarn/berry/cache/serialize-javascript-npm-6.0.0-0bb8a3c88d-10.zip/node_modules/serialize-javascript/",\ + "packageLocation": "./.yarn/cache/serialize-javascript-npm-6.0.0-0bb8a3c88d-ed3dabfbb5.zip/node_modules/serialize-javascript/",\ "packageDependencies": [\ ["serialize-javascript", "npm:6.0.0"],\ ["randombytes", "npm:2.1.0"]\ @@ -3653,7 +3653,7 @@ const RAW_RUNTIME_STATE = "linkType": "HARD"\ }],\ ["npm:6.0.1", {\ - "packageLocation": "../../../../.yarn/berry/cache/serialize-javascript-npm-6.0.1-fac87289ed-10.zip/node_modules/serialize-javascript/",\ + "packageLocation": "./.yarn/cache/serialize-javascript-npm-6.0.1-fac87289ed-f756b1ff34.zip/node_modules/serialize-javascript/",\ "packageDependencies": [\ ["serialize-javascript", "npm:6.0.1"],\ ["randombytes", "npm:2.1.0"]\ @@ -3663,7 +3663,7 @@ const RAW_RUNTIME_STATE = ]],\ ["set-blocking", [\ ["npm:2.0.0", {\ - "packageLocation": "../../../../.yarn/berry/cache/set-blocking-npm-2.0.0-49e2cffa24-10.zip/node_modules/set-blocking/",\ + "packageLocation": "./.yarn/cache/set-blocking-npm-2.0.0-49e2cffa24-8980ebf7ae.zip/node_modules/set-blocking/",\ "packageDependencies": [\ ["set-blocking", "npm:2.0.0"]\ ],\ @@ -3672,7 +3672,7 @@ const RAW_RUNTIME_STATE = ]],\ ["setimmediate", [\ ["npm:1.0.5", {\ - "packageLocation": "../../../../.yarn/berry/cache/setimmediate-npm-1.0.5-54587459b6-10.zip/node_modules/setimmediate/",\ + "packageLocation": "./.yarn/cache/setimmediate-npm-1.0.5-54587459b6-76e3f5d7f4.zip/node_modules/setimmediate/",\ "packageDependencies": [\ ["setimmediate", "npm:1.0.5"]\ ],\ @@ -3681,7 +3681,7 @@ const RAW_RUNTIME_STATE = ]],\ ["shallow-clone", [\ ["npm:3.0.1", {\ - "packageLocation": "../../../../.yarn/berry/cache/shallow-clone-npm-3.0.1-dab5873d0d-10.zip/node_modules/shallow-clone/",\ + "packageLocation": "./.yarn/cache/shallow-clone-npm-3.0.1-dab5873d0d-e066bd540c.zip/node_modules/shallow-clone/",\ "packageDependencies": [\ ["shallow-clone", "npm:3.0.1"],\ ["kind-of", "npm:6.0.3"]\ @@ -3691,7 +3691,7 @@ const RAW_RUNTIME_STATE = ]],\ ["shebang-command", [\ ["npm:2.0.0", {\ - "packageLocation": "../../../../.yarn/berry/cache/shebang-command-npm-2.0.0-eb2b01921d-10.zip/node_modules/shebang-command/",\ + "packageLocation": "./.yarn/cache/shebang-command-npm-2.0.0-eb2b01921d-6b52fe8727.zip/node_modules/shebang-command/",\ "packageDependencies": [\ ["shebang-command", "npm:2.0.0"],\ ["shebang-regex", "npm:3.0.0"]\ @@ -3701,7 +3701,7 @@ const RAW_RUNTIME_STATE = ]],\ ["shebang-regex", [\ ["npm:3.0.0", {\ - "packageLocation": "../../../../.yarn/berry/cache/shebang-regex-npm-3.0.0-899a0cd65e-10.zip/node_modules/shebang-regex/",\ + "packageLocation": "./.yarn/cache/shebang-regex-npm-3.0.0-899a0cd65e-1a2bcae50d.zip/node_modules/shebang-regex/",\ "packageDependencies": [\ ["shebang-regex", "npm:3.0.0"]\ ],\ @@ -3710,14 +3710,14 @@ const RAW_RUNTIME_STATE = ]],\ ["signal-exit", [\ ["npm:3.0.7", {\ - "packageLocation": "../../../../.yarn/berry/cache/signal-exit-npm-3.0.7-bd270458a3-10.zip/node_modules/signal-exit/",\ + "packageLocation": "./.yarn/cache/signal-exit-npm-3.0.7-bd270458a3-a2f098f247.zip/node_modules/signal-exit/",\ "packageDependencies": [\ ["signal-exit", "npm:3.0.7"]\ ],\ "linkType": "HARD"\ }],\ ["npm:4.1.0", {\ - "packageLocation": "../../../../.yarn/berry/cache/signal-exit-npm-4.1.0-61fb957687-10.zip/node_modules/signal-exit/",\ + "packageLocation": "./.yarn/cache/signal-exit-npm-4.1.0-61fb957687-c9fa63bbbd.zip/node_modules/signal-exit/",\ "packageDependencies": [\ ["signal-exit", "npm:4.1.0"]\ ],\ @@ -3726,7 +3726,7 @@ const RAW_RUNTIME_STATE = ]],\ ["slash", [\ ["npm:3.0.0", {\ - "packageLocation": "../../../../.yarn/berry/cache/slash-npm-3.0.0-b87de2279a-10.zip/node_modules/slash/",\ + "packageLocation": "./.yarn/cache/slash-npm-3.0.0-b87de2279a-94a93fff61.zip/node_modules/slash/",\ "packageDependencies": [\ ["slash", "npm:3.0.0"]\ ],\ @@ -3735,7 +3735,7 @@ const RAW_RUNTIME_STATE = ]],\ ["smart-buffer", [\ ["npm:4.2.0", {\ - "packageLocation": "../../../../.yarn/berry/cache/smart-buffer-npm-4.2.0-5ac3f668bb-10.zip/node_modules/smart-buffer/",\ + "packageLocation": "./.yarn/cache/smart-buffer-npm-4.2.0-5ac3f668bb-927484aa0b.zip/node_modules/smart-buffer/",\ "packageDependencies": [\ ["smart-buffer", "npm:4.2.0"]\ ],\ @@ -3744,7 +3744,7 @@ const RAW_RUNTIME_STATE = ]],\ ["socks", [\ ["npm:2.7.1", {\ - "packageLocation": "../../../../.yarn/berry/cache/socks-npm-2.7.1-17f2b53052-10.zip/node_modules/socks/",\ + "packageLocation": "./.yarn/cache/socks-npm-2.7.1-17f2b53052-5074f7d6a1.zip/node_modules/socks/",\ "packageDependencies": [\ ["socks", "npm:2.7.1"],\ ["ip", "npm:2.0.0"],\ @@ -3755,7 +3755,7 @@ const RAW_RUNTIME_STATE = ]],\ ["socks-proxy-agent", [\ ["npm:7.0.0", {\ - "packageLocation": "../../../../.yarn/berry/cache/socks-proxy-agent-npm-7.0.0-7aacf32ea0-10.zip/node_modules/socks-proxy-agent/",\ + "packageLocation": "./.yarn/cache/socks-proxy-agent-npm-7.0.0-7aacf32ea0-26c75d9c62.zip/node_modules/socks-proxy-agent/",\ "packageDependencies": [\ ["socks-proxy-agent", "npm:7.0.0"],\ ["agent-base", "npm:6.0.2"],\ @@ -3767,14 +3767,14 @@ const RAW_RUNTIME_STATE = ]],\ ["source-map", [\ ["npm:0.6.1", {\ - "packageLocation": "../../../../.yarn/berry/cache/source-map-npm-0.6.1-1a3621db16-10.zip/node_modules/source-map/",\ + "packageLocation": "./.yarn/cache/source-map-npm-0.6.1-1a3621db16-59ef7462f1.zip/node_modules/source-map/",\ "packageDependencies": [\ ["source-map", "npm:0.6.1"]\ ],\ "linkType": "HARD"\ }],\ ["npm:0.7.4", {\ - "packageLocation": "../../../../.yarn/berry/cache/source-map-npm-0.7.4-bc8d018ab6-10.zip/node_modules/source-map/",\ + "packageLocation": "./.yarn/cache/source-map-npm-0.7.4-bc8d018ab6-a0f7c9b797.zip/node_modules/source-map/",\ "packageDependencies": [\ ["source-map", "npm:0.7.4"]\ ],\ @@ -3783,7 +3783,7 @@ const RAW_RUNTIME_STATE = ]],\ ["source-map-support", [\ ["npm:0.5.21", {\ - "packageLocation": "../../../../.yarn/berry/cache/source-map-support-npm-0.5.21-09ca99e250-10.zip/node_modules/source-map-support/",\ + "packageLocation": "./.yarn/cache/source-map-support-npm-0.5.21-09ca99e250-8317e12d84.zip/node_modules/source-map-support/",\ "packageDependencies": [\ ["source-map-support", "npm:0.5.21"],\ ["buffer-from", "npm:1.1.2"],\ @@ -3794,7 +3794,7 @@ const RAW_RUNTIME_STATE = ]],\ ["ssri", [\ ["npm:10.0.5", {\ - "packageLocation": "../../../../.yarn/berry/cache/ssri-npm-10.0.5-1a7557d04d-10.zip/node_modules/ssri/",\ + "packageLocation": "./.yarn/cache/ssri-npm-10.0.5-1a7557d04d-453f9a1c24.zip/node_modules/ssri/",\ "packageDependencies": [\ ["ssri", "npm:10.0.5"],\ ["minipass", "npm:7.0.3"]\ @@ -3804,7 +3804,7 @@ const RAW_RUNTIME_STATE = ]],\ ["string-width", [\ ["npm:4.2.3", {\ - "packageLocation": "../../../../.yarn/berry/cache/string-width-npm-4.2.3-2c27177bae-10.zip/node_modules/string-width/",\ + "packageLocation": "./.yarn/cache/string-width-npm-4.2.3-2c27177bae-e52c10dc3f.zip/node_modules/string-width/",\ "packageDependencies": [\ ["string-width", "npm:4.2.3"],\ ["emoji-regex", "npm:8.0.0"],\ @@ -3814,7 +3814,7 @@ const RAW_RUNTIME_STATE = "linkType": "HARD"\ }],\ ["npm:5.1.2", {\ - "packageLocation": "../../../../.yarn/berry/cache/string-width-npm-5.1.2-bf60531341-10.zip/node_modules/string-width/",\ + "packageLocation": "./.yarn/cache/string-width-npm-5.1.2-bf60531341-7369deaa29.zip/node_modules/string-width/",\ "packageDependencies": [\ ["string-width", "npm:5.1.2"],\ ["eastasianwidth", "npm:0.2.0"],\ @@ -3826,7 +3826,7 @@ const RAW_RUNTIME_STATE = ]],\ ["string_decoder", [\ ["npm:1.1.1", {\ - "packageLocation": "../../../../.yarn/berry/cache/string_decoder-npm-1.1.1-e46a6c1353-10.zip/node_modules/string_decoder/",\ + "packageLocation": "./.yarn/cache/string_decoder-npm-1.1.1-e46a6c1353-7c41c17ed4.zip/node_modules/string_decoder/",\ "packageDependencies": [\ ["string_decoder", "npm:1.1.1"],\ ["safe-buffer", "npm:5.1.2"]\ @@ -3834,7 +3834,7 @@ const RAW_RUNTIME_STATE = "linkType": "HARD"\ }],\ ["npm:1.3.0", {\ - "packageLocation": "../../../../.yarn/berry/cache/string_decoder-npm-1.3.0-2422117fd0-10.zip/node_modules/string_decoder/",\ + "packageLocation": "./.yarn/cache/string_decoder-npm-1.3.0-2422117fd0-54d23f4a6a.zip/node_modules/string_decoder/",\ "packageDependencies": [\ ["string_decoder", "npm:1.3.0"],\ ["safe-buffer", "npm:5.2.1"]\ @@ -3844,7 +3844,7 @@ const RAW_RUNTIME_STATE = ]],\ ["strip-ansi", [\ ["npm:6.0.1", {\ - "packageLocation": "../../../../.yarn/berry/cache/strip-ansi-npm-6.0.1-caddc7cb40-10.zip/node_modules/strip-ansi/",\ + "packageLocation": "./.yarn/cache/strip-ansi-npm-6.0.1-caddc7cb40-ae3b5436d3.zip/node_modules/strip-ansi/",\ "packageDependencies": [\ ["strip-ansi", "npm:6.0.1"],\ ["ansi-regex", "npm:5.0.1"]\ @@ -3852,7 +3852,7 @@ const RAW_RUNTIME_STATE = "linkType": "HARD"\ }],\ ["npm:7.1.0", {\ - "packageLocation": "../../../../.yarn/berry/cache/strip-ansi-npm-7.1.0-7453b80b79-10.zip/node_modules/strip-ansi/",\ + "packageLocation": "./.yarn/cache/strip-ansi-npm-7.1.0-7453b80b79-475f53e9c4.zip/node_modules/strip-ansi/",\ "packageDependencies": [\ ["strip-ansi", "npm:7.1.0"],\ ["ansi-regex", "npm:6.0.1"]\ @@ -3862,7 +3862,7 @@ const RAW_RUNTIME_STATE = ]],\ ["strip-json-comments", [\ ["npm:3.1.1", {\ - "packageLocation": "../../../../.yarn/berry/cache/strip-json-comments-npm-3.1.1-dcb2324823-10.zip/node_modules/strip-json-comments/",\ + "packageLocation": "./.yarn/cache/strip-json-comments-npm-3.1.1-dcb2324823-492f73e272.zip/node_modules/strip-json-comments/",\ "packageDependencies": [\ ["strip-json-comments", "npm:3.1.1"]\ ],\ @@ -3871,7 +3871,7 @@ const RAW_RUNTIME_STATE = ]],\ ["supports-color", [\ ["npm:7.2.0", {\ - "packageLocation": "../../../../.yarn/berry/cache/supports-color-npm-7.2.0-606bfcf7da-10.zip/node_modules/supports-color/",\ + "packageLocation": "./.yarn/cache/supports-color-npm-7.2.0-606bfcf7da-c8bb7afd56.zip/node_modules/supports-color/",\ "packageDependencies": [\ ["supports-color", "npm:7.2.0"],\ ["has-flag", "npm:4.0.0"]\ @@ -3879,7 +3879,7 @@ const RAW_RUNTIME_STATE = "linkType": "HARD"\ }],\ ["npm:8.1.1", {\ - "packageLocation": "../../../../.yarn/berry/cache/supports-color-npm-8.1.1-289e937149-10.zip/node_modules/supports-color/",\ + "packageLocation": "./.yarn/cache/supports-color-npm-8.1.1-289e937149-157b534df8.zip/node_modules/supports-color/",\ "packageDependencies": [\ ["supports-color", "npm:8.1.1"],\ ["has-flag", "npm:4.0.0"]\ @@ -3889,7 +3889,7 @@ const RAW_RUNTIME_STATE = ]],\ ["supports-preserve-symlinks-flag", [\ ["npm:1.0.0", {\ - "packageLocation": "../../../../.yarn/berry/cache/supports-preserve-symlinks-flag-npm-1.0.0-f17c4d0028-10.zip/node_modules/supports-preserve-symlinks-flag/",\ + "packageLocation": "./.yarn/cache/supports-preserve-symlinks-flag-npm-1.0.0-f17c4d0028-a9dc19ae22.zip/node_modules/supports-preserve-symlinks-flag/",\ "packageDependencies": [\ ["supports-preserve-symlinks-flag", "npm:1.0.0"]\ ],\ @@ -3898,7 +3898,7 @@ const RAW_RUNTIME_STATE = ]],\ ["tapable", [\ ["npm:2.2.1", {\ - "packageLocation": "../../../../.yarn/berry/cache/tapable-npm-2.2.1-8cf5ff3039-10.zip/node_modules/tapable/",\ + "packageLocation": "./.yarn/cache/tapable-npm-2.2.1-8cf5ff3039-1769336dd2.zip/node_modules/tapable/",\ "packageDependencies": [\ ["tapable", "npm:2.2.1"]\ ],\ @@ -3907,7 +3907,7 @@ const RAW_RUNTIME_STATE = ]],\ ["tar", [\ ["npm:6.2.0", {\ - "packageLocation": "../../../../.yarn/berry/cache/tar-npm-6.2.0-3eb25205a7-10.zip/node_modules/tar/",\ + "packageLocation": "./.yarn/cache/tar-npm-6.2.0-3eb25205a7-2042bbb148.zip/node_modules/tar/",\ "packageDependencies": [\ ["tar", "npm:6.2.0"],\ ["chownr", "npm:2.0.0"],\ @@ -3922,7 +3922,7 @@ const RAW_RUNTIME_STATE = ]],\ ["terser", [\ ["npm:5.22.0", {\ - "packageLocation": "../../../../.yarn/berry/cache/terser-npm-5.22.0-e83cb45628-10.zip/node_modules/terser/",\ + "packageLocation": "./.yarn/cache/terser-npm-5.22.0-e83cb45628-e5407f9a14.zip/node_modules/terser/",\ "packageDependencies": [\ ["terser", "npm:5.22.0"],\ ["@jridgewell/source-map", "npm:0.3.5"],\ @@ -3935,14 +3935,14 @@ const RAW_RUNTIME_STATE = ]],\ ["terser-webpack-plugin", [\ ["npm:5.3.9", {\ - "packageLocation": "../../../../.yarn/berry/cache/terser-webpack-plugin-npm-5.3.9-7ba1eb45f4-10.zip/node_modules/terser-webpack-plugin/",\ + "packageLocation": "./.yarn/cache/terser-webpack-plugin-npm-5.3.9-7ba1eb45f4-339737a407.zip/node_modules/terser-webpack-plugin/",\ "packageDependencies": [\ ["terser-webpack-plugin", "npm:5.3.9"]\ ],\ "linkType": "SOFT"\ }],\ ["virtual:b98590e6182f1e3e809675a880704d2c50533e40386e60683f5d6ae6206f5e5e58cf33b625935351b9a4ef2066acd33ce7f25a0d7055a7a23f1ec398f2c56b3f#npm:5.3.9", {\ - "packageLocation": "./.yarn/__virtual__/terser-webpack-plugin-virtual-09deebe1a1/5/.yarn/berry/cache/terser-webpack-plugin-npm-5.3.9-7ba1eb45f4-10.zip/node_modules/terser-webpack-plugin/",\ + "packageLocation": "./.yarn/__virtual__/terser-webpack-plugin-virtual-09deebe1a1/0/cache/terser-webpack-plugin-npm-5.3.9-7ba1eb45f4-339737a407.zip/node_modules/terser-webpack-plugin/",\ "packageDependencies": [\ ["terser-webpack-plugin", "virtual:b98590e6182f1e3e809675a880704d2c50533e40386e60683f5d6ae6206f5e5e58cf33b625935351b9a4ef2066acd33ce7f25a0d7055a7a23f1ec398f2c56b3f#npm:5.3.9"],\ ["@jridgewell/trace-mapping", "npm:0.3.20"],\ @@ -3974,7 +3974,7 @@ const RAW_RUNTIME_STATE = ]],\ ["text-table", [\ ["npm:0.2.0", {\ - "packageLocation": "../../../../.yarn/berry/cache/text-table-npm-0.2.0-d92a778b59-10.zip/node_modules/text-table/",\ + "packageLocation": "./.yarn/cache/text-table-npm-0.2.0-d92a778b59-4383b5baae.zip/node_modules/text-table/",\ "packageDependencies": [\ ["text-table", "npm:0.2.0"]\ ],\ @@ -3983,7 +3983,7 @@ const RAW_RUNTIME_STATE = ]],\ ["to-regex-range", [\ ["npm:5.0.1", {\ - "packageLocation": "../../../../.yarn/berry/cache/to-regex-range-npm-5.0.1-f1e8263b00-10.zip/node_modules/to-regex-range/",\ + "packageLocation": "./.yarn/cache/to-regex-range-npm-5.0.1-f1e8263b00-10dda13571.zip/node_modules/to-regex-range/",\ "packageDependencies": [\ ["to-regex-range", "npm:5.0.1"],\ ["is-number", "npm:7.0.0"]\ @@ -3993,14 +3993,14 @@ const RAW_RUNTIME_STATE = ]],\ ["ts-loader", [\ ["npm:9.5.0", {\ - "packageLocation": "../../../../.yarn/berry/cache/ts-loader-npm-9.5.0-9514617263-10.zip/node_modules/ts-loader/",\ + "packageLocation": "./.yarn/cache/ts-loader-npm-9.5.0-9514617263-8ffc6411ec.zip/node_modules/ts-loader/",\ "packageDependencies": [\ ["ts-loader", "npm:9.5.0"]\ ],\ "linkType": "SOFT"\ }],\ ["virtual:2b9e7e7d573ed38308251d9cfa9bcac1c01394d20ff25d4a07b4a0345be370b65803551137c4363442bf76c7d6f9363387c180207a65457c6616ca7fd9b2a56b#npm:9.5.0", {\ - "packageLocation": "./.yarn/__virtual__/ts-loader-virtual-08d411a35a/5/.yarn/berry/cache/ts-loader-npm-9.5.0-9514617263-10.zip/node_modules/ts-loader/",\ + "packageLocation": "./.yarn/__virtual__/ts-loader-virtual-08d411a35a/0/cache/ts-loader-npm-9.5.0-9514617263-8ffc6411ec.zip/node_modules/ts-loader/",\ "packageDependencies": [\ ["ts-loader", "virtual:2b9e7e7d573ed38308251d9cfa9bcac1c01394d20ff25d4a07b4a0345be370b65803551137c4363442bf76c7d6f9363387c180207a65457c6616ca7fd9b2a56b#npm:9.5.0"],\ ["@types/typescript", null],\ @@ -4024,7 +4024,7 @@ const RAW_RUNTIME_STATE = ]],\ ["tslib", [\ ["npm:1.14.1", {\ - "packageLocation": "../../../../.yarn/berry/cache/tslib-npm-1.14.1-102499115e-10.zip/node_modules/tslib/",\ + "packageLocation": "./.yarn/cache/tslib-npm-1.14.1-102499115e-7dbf34e6f5.zip/node_modules/tslib/",\ "packageDependencies": [\ ["tslib", "npm:1.14.1"]\ ],\ @@ -4033,14 +4033,14 @@ const RAW_RUNTIME_STATE = ]],\ ["tsutils", [\ ["npm:3.21.0", {\ - "packageLocation": "../../../../.yarn/berry/cache/tsutils-npm-3.21.0-347e6636c5-10.zip/node_modules/tsutils/",\ + "packageLocation": "./.yarn/cache/tsutils-npm-3.21.0-347e6636c5-ea036bec1d.zip/node_modules/tsutils/",\ "packageDependencies": [\ ["tsutils", "npm:3.21.0"]\ ],\ "linkType": "SOFT"\ }],\ ["virtual:1272cbed28ba43154b1f70b1b9ccc5d5d4f0e0ea66cdbcdc34cdd20ac1a5aa8be13d64ab87eae1341f94e5df93a4932087a80587415043f9c7312b1f619267f4#npm:3.21.0", {\ - "packageLocation": "./.yarn/__virtual__/tsutils-virtual-5e32ddb4dd/5/.yarn/berry/cache/tsutils-npm-3.21.0-347e6636c5-10.zip/node_modules/tsutils/",\ + "packageLocation": "./.yarn/__virtual__/tsutils-virtual-5e32ddb4dd/0/cache/tsutils-npm-3.21.0-347e6636c5-ea036bec1d.zip/node_modules/tsutils/",\ "packageDependencies": [\ ["tsutils", "virtual:1272cbed28ba43154b1f70b1b9ccc5d5d4f0e0ea66cdbcdc34cdd20ac1a5aa8be13d64ab87eae1341f94e5df93a4932087a80587415043f9c7312b1f619267f4#npm:3.21.0"],\ ["@types/typescript", null],\ @@ -4054,7 +4054,7 @@ const RAW_RUNTIME_STATE = "linkType": "HARD"\ }],\ ["virtual:89014fb2f72da20eb87d54c80bac37610b57a73485dee5ebf9333bf5c4bce0d972953cbf0f48420b275d3bc40f36aded8d47d2d24281f85e903e5d354ec64e4e#npm:3.21.0", {\ - "packageLocation": "./.yarn/__virtual__/tsutils-virtual-b857208b27/5/.yarn/berry/cache/tsutils-npm-3.21.0-347e6636c5-10.zip/node_modules/tsutils/",\ + "packageLocation": "./.yarn/__virtual__/tsutils-virtual-b857208b27/0/cache/tsutils-npm-3.21.0-347e6636c5-ea036bec1d.zip/node_modules/tsutils/",\ "packageDependencies": [\ ["tsutils", "virtual:89014fb2f72da20eb87d54c80bac37610b57a73485dee5ebf9333bf5c4bce0d972953cbf0f48420b275d3bc40f36aded8d47d2d24281f85e903e5d354ec64e4e#npm:3.21.0"],\ ["@types/typescript", null],\ @@ -4070,7 +4070,7 @@ const RAW_RUNTIME_STATE = ]],\ ["type-check", [\ ["npm:0.4.0", {\ - "packageLocation": "../../../../.yarn/berry/cache/type-check-npm-0.4.0-60565800ce-10.zip/node_modules/type-check/",\ + "packageLocation": "./.yarn/cache/type-check-npm-0.4.0-60565800ce-1468777647.zip/node_modules/type-check/",\ "packageDependencies": [\ ["type-check", "npm:0.4.0"],\ ["prelude-ls", "npm:1.2.1"]\ @@ -4080,7 +4080,7 @@ const RAW_RUNTIME_STATE = ]],\ ["type-fest", [\ ["npm:0.20.2", {\ - "packageLocation": "../../../../.yarn/berry/cache/type-fest-npm-0.20.2-b36432617f-10.zip/node_modules/type-fest/",\ + "packageLocation": "./.yarn/cache/type-fest-npm-0.20.2-b36432617f-8907e16284.zip/node_modules/type-fest/",\ "packageDependencies": [\ ["type-fest", "npm:0.20.2"]\ ],\ @@ -4089,7 +4089,7 @@ const RAW_RUNTIME_STATE = ]],\ ["typescript", [\ ["patch:typescript@npm%3A5.2.2#optional!builtin::version=5.2.2&hash=f3b441", {\ - "packageLocation": "../../../../.yarn/berry/cache/typescript-patch-3914634c3a-10.zip/node_modules/typescript/",\ + "packageLocation": "./.yarn/cache/typescript-patch-3914634c3a-f79cc2ba80.zip/node_modules/typescript/",\ "packageDependencies": [\ ["typescript", "patch:typescript@npm%3A5.2.2#optional!builtin::version=5.2.2&hash=f3b441"]\ ],\ @@ -4098,7 +4098,7 @@ const RAW_RUNTIME_STATE = ]],\ ["undici-types", [\ ["npm:5.25.3", {\ - "packageLocation": "../../../../.yarn/berry/cache/undici-types-npm-5.25.3-2ac9eafc9e-10.zip/node_modules/undici-types/",\ + "packageLocation": "./.yarn/cache/undici-types-npm-5.25.3-2ac9eafc9e-9a57f2dd6f.zip/node_modules/undici-types/",\ "packageDependencies": [\ ["undici-types", "npm:5.25.3"]\ ],\ @@ -4107,7 +4107,7 @@ const RAW_RUNTIME_STATE = ]],\ ["unique-filename", [\ ["npm:3.0.0", {\ - "packageLocation": "../../../../.yarn/berry/cache/unique-filename-npm-3.0.0-77d68e0a45-10.zip/node_modules/unique-filename/",\ + "packageLocation": "./.yarn/cache/unique-filename-npm-3.0.0-77d68e0a45-8e2f59b356.zip/node_modules/unique-filename/",\ "packageDependencies": [\ ["unique-filename", "npm:3.0.0"],\ ["unique-slug", "npm:4.0.0"]\ @@ -4117,7 +4117,7 @@ const RAW_RUNTIME_STATE = ]],\ ["unique-slug", [\ ["npm:4.0.0", {\ - "packageLocation": "../../../../.yarn/berry/cache/unique-slug-npm-4.0.0-e6b08f28aa-10.zip/node_modules/unique-slug/",\ + "packageLocation": "./.yarn/cache/unique-slug-npm-4.0.0-e6b08f28aa-40912a8963.zip/node_modules/unique-slug/",\ "packageDependencies": [\ ["unique-slug", "npm:4.0.0"],\ ["imurmurhash", "npm:0.1.4"]\ @@ -4127,14 +4127,14 @@ const RAW_RUNTIME_STATE = ]],\ ["update-browserslist-db", [\ ["npm:1.0.13", {\ - "packageLocation": "../../../../.yarn/berry/cache/update-browserslist-db-npm-1.0.13-ea7b8ee24d-10.zip/node_modules/update-browserslist-db/",\ + "packageLocation": "./.yarn/cache/update-browserslist-db-npm-1.0.13-ea7b8ee24d-9074b4ef34.zip/node_modules/update-browserslist-db/",\ "packageDependencies": [\ ["update-browserslist-db", "npm:1.0.13"]\ ],\ "linkType": "SOFT"\ }],\ ["virtual:cccae6d74e613cbaceb4c608cb01004dea3f5ca235673f5c541d60f516ef320907d258256abf63eac9b8704e23cf5d52eb19f2a57a07471accc943ea645de308#npm:1.0.13", {\ - "packageLocation": "./.yarn/__virtual__/update-browserslist-db-virtual-1935275eaa/5/.yarn/berry/cache/update-browserslist-db-npm-1.0.13-ea7b8ee24d-10.zip/node_modules/update-browserslist-db/",\ + "packageLocation": "./.yarn/__virtual__/update-browserslist-db-virtual-1935275eaa/0/cache/update-browserslist-db-npm-1.0.13-ea7b8ee24d-9074b4ef34.zip/node_modules/update-browserslist-db/",\ "packageDependencies": [\ ["update-browserslist-db", "virtual:cccae6d74e613cbaceb4c608cb01004dea3f5ca235673f5c541d60f516ef320907d258256abf63eac9b8704e23cf5d52eb19f2a57a07471accc943ea645de308#npm:1.0.13"],\ ["@types/browserslist", null],\ @@ -4151,7 +4151,7 @@ const RAW_RUNTIME_STATE = ]],\ ["uri-js", [\ ["npm:4.4.1", {\ - "packageLocation": "../../../../.yarn/berry/cache/uri-js-npm-4.4.1-66d11cbcaf-10.zip/node_modules/uri-js/",\ + "packageLocation": "./.yarn/cache/uri-js-npm-4.4.1-66d11cbcaf-b271ca7e3d.zip/node_modules/uri-js/",\ "packageDependencies": [\ ["uri-js", "npm:4.4.1"],\ ["punycode", "npm:2.3.0"]\ @@ -4161,7 +4161,7 @@ const RAW_RUNTIME_STATE = ]],\ ["util-deprecate", [\ ["npm:1.0.2", {\ - "packageLocation": "../../../../.yarn/berry/cache/util-deprecate-npm-1.0.2-e3fe1a219c-10.zip/node_modules/util-deprecate/",\ + "packageLocation": "./.yarn/cache/util-deprecate-npm-1.0.2-e3fe1a219c-474acf1146.zip/node_modules/util-deprecate/",\ "packageDependencies": [\ ["util-deprecate", "npm:1.0.2"]\ ],\ @@ -4170,7 +4170,7 @@ const RAW_RUNTIME_STATE = ]],\ ["vscode-jsonrpc", [\ ["npm:8.1.0", {\ - "packageLocation": "../../../../.yarn/berry/cache/vscode-jsonrpc-npm-8.1.0-557f20ee72-10.zip/node_modules/vscode-jsonrpc/",\ + "packageLocation": "./.yarn/cache/vscode-jsonrpc-npm-8.1.0-557f20ee72-e3378ae849.zip/node_modules/vscode-jsonrpc/",\ "packageDependencies": [\ ["vscode-jsonrpc", "npm:8.1.0"]\ ],\ @@ -4179,7 +4179,7 @@ const RAW_RUNTIME_STATE = ]],\ ["vscode-languageclient", [\ ["npm:8.1.0", {\ - "packageLocation": "../../../../.yarn/berry/cache/vscode-languageclient-npm-8.1.0-3befe78fee-10.zip/node_modules/vscode-languageclient/",\ + "packageLocation": "./.yarn/cache/vscode-languageclient-npm-8.1.0-3befe78fee-b841e6d59e.zip/node_modules/vscode-languageclient/",\ "packageDependencies": [\ ["vscode-languageclient", "npm:8.1.0"],\ ["minimatch", "npm:5.1.6"],\ @@ -4191,7 +4191,7 @@ const RAW_RUNTIME_STATE = ]],\ ["vscode-languageserver", [\ ["npm:8.1.0", {\ - "packageLocation": "../../../../.yarn/berry/cache/vscode-languageserver-npm-8.1.0-baf13ef83a-10.zip/node_modules/vscode-languageserver/",\ + "packageLocation": "./.yarn/cache/vscode-languageserver-npm-8.1.0-baf13ef83a-3aa3d2f421.zip/node_modules/vscode-languageserver/",\ "packageDependencies": [\ ["vscode-languageserver", "npm:8.1.0"],\ ["vscode-languageserver-protocol", "npm:3.17.3"]\ @@ -4201,7 +4201,7 @@ const RAW_RUNTIME_STATE = ]],\ ["vscode-languageserver-protocol", [\ ["npm:3.17.3", {\ - "packageLocation": "../../../../.yarn/berry/cache/vscode-languageserver-protocol-npm-3.17.3-3c0373c95b-10.zip/node_modules/vscode-languageserver-protocol/",\ + "packageLocation": "./.yarn/cache/vscode-languageserver-protocol-npm-3.17.3-3c0373c95b-b1cc706bcf.zip/node_modules/vscode-languageserver-protocol/",\ "packageDependencies": [\ ["vscode-languageserver-protocol", "npm:3.17.3"],\ ["vscode-jsonrpc", "npm:8.1.0"],\ @@ -4212,7 +4212,7 @@ const RAW_RUNTIME_STATE = ]],\ ["vscode-languageserver-textdocument", [\ ["npm:1.0.11", {\ - "packageLocation": "../../../../.yarn/berry/cache/vscode-languageserver-textdocument-npm-1.0.11-6fc94d2b7b-10.zip/node_modules/vscode-languageserver-textdocument/",\ + "packageLocation": "./.yarn/cache/vscode-languageserver-textdocument-npm-1.0.11-6fc94d2b7b-6096d2a855.zip/node_modules/vscode-languageserver-textdocument/",\ "packageDependencies": [\ ["vscode-languageserver-textdocument", "npm:1.0.11"]\ ],\ @@ -4221,7 +4221,7 @@ const RAW_RUNTIME_STATE = ]],\ ["vscode-languageserver-types", [\ ["npm:3.17.3", {\ - "packageLocation": "../../../../.yarn/berry/cache/vscode-languageserver-types-npm-3.17.3-2fde4bb32b-10.zip/node_modules/vscode-languageserver-types/",\ + "packageLocation": "./.yarn/cache/vscode-languageserver-types-npm-3.17.3-2fde4bb32b-b2032b9c4b.zip/node_modules/vscode-languageserver-types/",\ "packageDependencies": [\ ["vscode-languageserver-types", "npm:3.17.3"]\ ],\ @@ -4230,7 +4230,7 @@ const RAW_RUNTIME_STATE = ]],\ ["watchpack", [\ ["npm:2.4.0", {\ - "packageLocation": "../../../../.yarn/berry/cache/watchpack-npm-2.4.0-7ec4b9cc65-10.zip/node_modules/watchpack/",\ + "packageLocation": "./.yarn/cache/watchpack-npm-2.4.0-7ec4b9cc65-4280b45bc4.zip/node_modules/watchpack/",\ "packageDependencies": [\ ["watchpack", "npm:2.4.0"],\ ["glob-to-regexp", "npm:0.4.1"],\ @@ -4241,14 +4241,14 @@ const RAW_RUNTIME_STATE = ]],\ ["webpack", [\ ["npm:5.89.0", {\ - "packageLocation": "../../../../.yarn/berry/cache/webpack-npm-5.89.0-3800e9efd0-10.zip/node_modules/webpack/",\ + "packageLocation": "./.yarn/cache/webpack-npm-5.89.0-3800e9efd0-ee19b07027.zip/node_modules/webpack/",\ "packageDependencies": [\ ["webpack", "npm:5.89.0"]\ ],\ "linkType": "SOFT"\ }],\ ["virtual:2b9e7e7d573ed38308251d9cfa9bcac1c01394d20ff25d4a07b4a0345be370b65803551137c4363442bf76c7d6f9363387c180207a65457c6616ca7fd9b2a56b#npm:5.89.0", {\ - "packageLocation": "./.yarn/__virtual__/webpack-virtual-b98590e618/5/.yarn/berry/cache/webpack-npm-5.89.0-3800e9efd0-10.zip/node_modules/webpack/",\ + "packageLocation": "./.yarn/__virtual__/webpack-virtual-b98590e618/0/cache/webpack-npm-5.89.0-3800e9efd0-ee19b07027.zip/node_modules/webpack/",\ "packageDependencies": [\ ["webpack", "virtual:2b9e7e7d573ed38308251d9cfa9bcac1c01394d20ff25d4a07b4a0345be370b65803551137c4363442bf76c7d6f9363387c180207a65457c6616ca7fd9b2a56b#npm:5.89.0"],\ ["@types/eslint-scope", "npm:3.7.6"],\ @@ -4287,14 +4287,14 @@ const RAW_RUNTIME_STATE = ]],\ ["webpack-cli", [\ ["npm:5.1.4", {\ - "packageLocation": "../../../../.yarn/berry/cache/webpack-cli-npm-5.1.4-7be5b53b38-10.zip/node_modules/webpack-cli/",\ + "packageLocation": "./.yarn/cache/webpack-cli-npm-5.1.4-7be5b53b38-9ac3ae7c43.zip/node_modules/webpack-cli/",\ "packageDependencies": [\ ["webpack-cli", "npm:5.1.4"]\ ],\ "linkType": "SOFT"\ }],\ ["virtual:2b9e7e7d573ed38308251d9cfa9bcac1c01394d20ff25d4a07b4a0345be370b65803551137c4363442bf76c7d6f9363387c180207a65457c6616ca7fd9b2a56b#npm:5.1.4", {\ - "packageLocation": "./.yarn/__virtual__/webpack-cli-virtual-18451f3d8e/5/.yarn/berry/cache/webpack-cli-npm-5.1.4-7be5b53b38-10.zip/node_modules/webpack-cli/",\ + "packageLocation": "./.yarn/__virtual__/webpack-cli-virtual-18451f3d8e/0/cache/webpack-cli-npm-5.1.4-7be5b53b38-9ac3ae7c43.zip/node_modules/webpack-cli/",\ "packageDependencies": [\ ["webpack-cli", "virtual:2b9e7e7d573ed38308251d9cfa9bcac1c01394d20ff25d4a07b4a0345be370b65803551137c4363442bf76c7d6f9363387c180207a65457c6616ca7fd9b2a56b#npm:5.1.4"],\ ["@discoveryjs/json-ext", "npm:0.5.7"],\ @@ -4334,7 +4334,7 @@ const RAW_RUNTIME_STATE = ]],\ ["webpack-merge", [\ ["npm:5.10.0", {\ - "packageLocation": "../../../../.yarn/berry/cache/webpack-merge-npm-5.10.0-c2d9fd1f83-10.zip/node_modules/webpack-merge/",\ + "packageLocation": "./.yarn/cache/webpack-merge-npm-5.10.0-c2d9fd1f83-fa46ab200f.zip/node_modules/webpack-merge/",\ "packageDependencies": [\ ["webpack-merge", "npm:5.10.0"],\ ["clone-deep", "npm:4.0.1"],\ @@ -4346,7 +4346,7 @@ const RAW_RUNTIME_STATE = ]],\ ["webpack-sources", [\ ["npm:3.2.3", {\ - "packageLocation": "../../../../.yarn/berry/cache/webpack-sources-npm-3.2.3-6bfb5d9563-10.zip/node_modules/webpack-sources/",\ + "packageLocation": "./.yarn/cache/webpack-sources-npm-3.2.3-6bfb5d9563-a661f41795.zip/node_modules/webpack-sources/",\ "packageDependencies": [\ ["webpack-sources", "npm:3.2.3"]\ ],\ @@ -4355,7 +4355,7 @@ const RAW_RUNTIME_STATE = ]],\ ["which", [\ ["npm:2.0.2", {\ - "packageLocation": "../../../../.yarn/berry/cache/which-npm-2.0.2-320ddf72f7-10.zip/node_modules/which/",\ + "packageLocation": "./.yarn/cache/which-npm-2.0.2-320ddf72f7-4782f8a1d6.zip/node_modules/which/",\ "packageDependencies": [\ ["which", "npm:2.0.2"],\ ["isexe", "npm:2.0.0"]\ @@ -4365,7 +4365,7 @@ const RAW_RUNTIME_STATE = ]],\ ["wide-align", [\ ["npm:1.1.5", {\ - "packageLocation": "../../../../.yarn/berry/cache/wide-align-npm-1.1.5-889d77e592-10.zip/node_modules/wide-align/",\ + "packageLocation": "./.yarn/cache/wide-align-npm-1.1.5-889d77e592-d5f8027b9a.zip/node_modules/wide-align/",\ "packageDependencies": [\ ["wide-align", "npm:1.1.5"],\ ["string-width", "npm:4.2.3"]\ @@ -4375,7 +4375,7 @@ const RAW_RUNTIME_STATE = ]],\ ["wildcard", [\ ["npm:2.0.1", {\ - "packageLocation": "../../../../.yarn/berry/cache/wildcard-npm-2.0.1-7c6a3a3365-10.zip/node_modules/wildcard/",\ + "packageLocation": "./.yarn/cache/wildcard-npm-2.0.1-7c6a3a3365-e0c60a12a2.zip/node_modules/wildcard/",\ "packageDependencies": [\ ["wildcard", "npm:2.0.1"]\ ],\ @@ -4384,7 +4384,7 @@ const RAW_RUNTIME_STATE = ]],\ ["workerpool", [\ ["npm:6.2.1", {\ - "packageLocation": "../../../../.yarn/berry/cache/workerpool-npm-6.2.1-1486cb2056-10.zip/node_modules/workerpool/",\ + "packageLocation": "./.yarn/cache/workerpool-npm-6.2.1-1486cb2056-3e637f7632.zip/node_modules/workerpool/",\ "packageDependencies": [\ ["workerpool", "npm:6.2.1"]\ ],\ @@ -4393,7 +4393,7 @@ const RAW_RUNTIME_STATE = ]],\ ["wrap-ansi", [\ ["npm:7.0.0", {\ - "packageLocation": "../../../../.yarn/berry/cache/wrap-ansi-npm-7.0.0-ad6e1a0554-10.zip/node_modules/wrap-ansi/",\ + "packageLocation": "./.yarn/cache/wrap-ansi-npm-7.0.0-ad6e1a0554-cebdaeca3a.zip/node_modules/wrap-ansi/",\ "packageDependencies": [\ ["wrap-ansi", "npm:7.0.0"],\ ["ansi-styles", "npm:4.3.0"],\ @@ -4403,7 +4403,7 @@ const RAW_RUNTIME_STATE = "linkType": "HARD"\ }],\ ["npm:8.1.0", {\ - "packageLocation": "../../../../.yarn/berry/cache/wrap-ansi-npm-8.1.0-26a4e6ae28-10.zip/node_modules/wrap-ansi/",\ + "packageLocation": "./.yarn/cache/wrap-ansi-npm-8.1.0-26a4e6ae28-7b1e4b35e9.zip/node_modules/wrap-ansi/",\ "packageDependencies": [\ ["wrap-ansi", "npm:8.1.0"],\ ["ansi-styles", "npm:6.2.1"],\ @@ -4415,7 +4415,7 @@ const RAW_RUNTIME_STATE = ]],\ ["wrappy", [\ ["npm:1.0.2", {\ - "packageLocation": "../../../../.yarn/berry/cache/wrappy-npm-1.0.2-916de4d4b3-10.zip/node_modules/wrappy/",\ + "packageLocation": "./.yarn/cache/wrappy-npm-1.0.2-916de4d4b3-159da4805f.zip/node_modules/wrappy/",\ "packageDependencies": [\ ["wrappy", "npm:1.0.2"]\ ],\ @@ -4424,7 +4424,7 @@ const RAW_RUNTIME_STATE = ]],\ ["y18n", [\ ["npm:5.0.8", {\ - "packageLocation": "../../../../.yarn/berry/cache/y18n-npm-5.0.8-5f3a0a7e62-10.zip/node_modules/y18n/",\ + "packageLocation": "./.yarn/cache/y18n-npm-5.0.8-5f3a0a7e62-5f1b5f95e3.zip/node_modules/y18n/",\ "packageDependencies": [\ ["y18n", "npm:5.0.8"]\ ],\ @@ -4433,7 +4433,7 @@ const RAW_RUNTIME_STATE = ]],\ ["yallist", [\ ["npm:4.0.0", {\ - "packageLocation": "../../../../.yarn/berry/cache/yallist-npm-4.0.0-b493d9e907-10.zip/node_modules/yallist/",\ + "packageLocation": "./.yarn/cache/yallist-npm-4.0.0-b493d9e907-4cb02b42b8.zip/node_modules/yallist/",\ "packageDependencies": [\ ["yallist", "npm:4.0.0"]\ ],\ @@ -4442,7 +4442,7 @@ const RAW_RUNTIME_STATE = ]],\ ["yargs", [\ ["npm:16.2.0", {\ - "packageLocation": "../../../../.yarn/berry/cache/yargs-npm-16.2.0-547873d425-10.zip/node_modules/yargs/",\ + "packageLocation": "./.yarn/cache/yargs-npm-16.2.0-547873d425-807fa21211.zip/node_modules/yargs/",\ "packageDependencies": [\ ["yargs", "npm:16.2.0"],\ ["cliui", "npm:7.0.4"],\ @@ -4458,14 +4458,14 @@ const RAW_RUNTIME_STATE = ]],\ ["yargs-parser", [\ ["npm:20.2.4", {\ - "packageLocation": "../../../../.yarn/berry/cache/yargs-parser-npm-20.2.4-1de20916a6-10.zip/node_modules/yargs-parser/",\ + "packageLocation": "./.yarn/cache/yargs-parser-npm-20.2.4-1de20916a6-db8f251ae4.zip/node_modules/yargs-parser/",\ "packageDependencies": [\ ["yargs-parser", "npm:20.2.4"]\ ],\ "linkType": "HARD"\ }],\ ["npm:20.2.9", {\ - "packageLocation": "../../../../.yarn/berry/cache/yargs-parser-npm-20.2.9-a1d19e598d-10.zip/node_modules/yargs-parser/",\ + "packageLocation": "./.yarn/cache/yargs-parser-npm-20.2.9-a1d19e598d-0188f430a0.zip/node_modules/yargs-parser/",\ "packageDependencies": [\ ["yargs-parser", "npm:20.2.9"]\ ],\ @@ -4474,7 +4474,7 @@ const RAW_RUNTIME_STATE = ]],\ ["yargs-unparser", [\ ["npm:2.0.0", {\ - "packageLocation": "../../../../.yarn/berry/cache/yargs-unparser-npm-2.0.0-930f3ff3f6-10.zip/node_modules/yargs-unparser/",\ + "packageLocation": "./.yarn/cache/yargs-unparser-npm-2.0.0-930f3ff3f6-68f9a542c6.zip/node_modules/yargs-unparser/",\ "packageDependencies": [\ ["yargs-unparser", "npm:2.0.0"],\ ["camelcase", "npm:6.3.0"],\ @@ -4487,7 +4487,7 @@ const RAW_RUNTIME_STATE = ]],\ ["yocto-queue", [\ ["npm:0.1.0", {\ - "packageLocation": "../../../../.yarn/berry/cache/yocto-queue-npm-0.1.0-c6c9a7db29-10.zip/node_modules/yocto-queue/",\ + "packageLocation": "./.yarn/cache/yocto-queue-npm-0.1.0-c6c9a7db29-f77b3d8d00.zip/node_modules/yocto-queue/",\ "packageDependencies": [\ ["yocto-queue", "npm:0.1.0"]\ ],\ diff --git a/toolchains/solidity/extension/assets/configuration.json b/toolchains/solidity/extension/assets/configuration.json new file mode 100644 index 00000000..17648abd --- /dev/null +++ b/toolchains/solidity/extension/assets/configuration.json @@ -0,0 +1,32 @@ +{ + "comments": { + // symbol used for single line comment. Remove this entry if your language does not support line comments + "lineComment": "//", + // symbols used for start and end a block comment. Remove this entry if your language does not support block comments + "blockComment": [ "/*", "*/" ] + }, + // symbols used as brackets + "brackets": [ + ["{", "}"], + ["[", "]"], + ["(", ")"] + ], + "autoClosingPairs": [ + { "open": "{", "close": "}" }, + { "open": "[", "close": "]" }, + { "open": "(", "close": ")" }, + { "open": "/**", "close": " */", "notIn": ["string"] } + ], + "surroundingPairs": [ + ["{", "}"], + ["[", "]"], + ["(", ")"] + ], + // markers used to folding code regions + "folding": { + "markers": { + "start": "^\\s*//\\s*#?region\\b", + "end": "^\\s*//\\s*#?endregion\\b" + } + } +} \ No newline at end of file diff --git a/toolchains/solidity/extension/assets/syntax.json b/toolchains/solidity/extension/assets/syntax.json new file mode 100644 index 00000000..2af36e4d --- /dev/null +++ b/toolchains/solidity/extension/assets/syntax.json @@ -0,0 +1,1215 @@ +{ + "fileTypes": [ + "sol" + ], + "name": "Solidity", + "patterns": [ + { + "include": "#natspec" + }, + { + "include": "#declaration-userType" + }, + { + "include": "#comment" + }, + { + "include": "#operator" + }, + { + "include": "#global" + }, + { + "include": "#control" + }, + { + "include": "#constant" + }, + { + "include": "#primitive" + }, + { + "include": "#type-primitive" + }, + { + "include": "#type-modifier-extended-scope" + }, + { + "include": "#declaration" + }, + { + "include": "#function-call" + }, + { + "include": "#assembly" + }, + { + "include": "#punctuation" + } + ], + "repository": { + "natspec": { + "patterns": [ + { + "begin": "/\\*\\*", + "end": "\\*/", + "name": "comment.block.documentation", + "patterns": [ + { + "include": "#natspec-tags" + } + ] + }, + { + "begin": "///", + "end": "$", + "name": "comment.block.documentation", + "patterns": [ + { + "include": "#natspec-tags" + } + ] + } + ] + }, + "natspec-tags": { + "patterns": [ + { + "include": "#comment-todo" + }, + { + "include": "#natspec-tag-title" + }, + { + "include": "#natspec-tag-author" + }, + { + "include": "#natspec-tag-notice" + }, + { + "include": "#natspec-tag-dev" + }, + { + "include": "#natspec-tag-param" + }, + { + "include": "#natspec-tag-return" + }, + { + "include": "#natspec-tag-custom" + }, + { + "include": "#natspec-tag-inheritdoc" + } + ] + }, + "natspec-tag-title": { + "match": "(@title)\\b", + "name": "storage.type.title.natspec" + }, + + "natspec-tag-author": { + "match": "(@author)\\b", + "name": "storage.type.author.natspec" + }, + "natspec-tag-notice": { + "match": "(@notice)\\b", + "name": "storage.type.dev.natspec" + }, + "natspec-tag-custom": { + "match": "(@custom:\\w*)\\b", + "name": "storage.type.dev.natspec" + }, + "natspec-tag-inheritdoc": { + "match": "(@inheritdoc)\\b", + "name": "storage.type.author.natspec" + }, + "natspec-tag-dev": { + "match": "(@dev)\\b", + "name": "storage.type.dev.natspec" + }, + "natspec-tag-param": { + "match": "(@param)(\\s+([A-Za-z_]\\w*))?\\b", + "captures": { + "1": { + "name": "storage.type.param.natspec" + }, + "3": { + "name": "variable.other.natspec" + } + } + }, + "natspec-tag-return": { + "match": "(@return)(\\s+([A-Za-z_]\\w*))?\\b", + "captures": { + "1": { + "name": "storage.type.return.natspec" + }, + "3": { + "name": "variable.other.natspec" + } + } + }, + "comment": { + "patterns": [ + { + "include": "#comment-line" + }, + { + "include": "#comment-block" + } + ] + }, + "comment-todo": { + "match": "(?i)\\b(FIXME|TODO|CHANGED|XXX|IDEA|HACK|NOTE|REVIEW|NB|BUG|QUESTION|COMBAK|TEMP|SUPPRESS|LINT|\\w+-disable|\\w+-suppress)\\b(?-i)", + "name": "keyword.comment.todo" + }, + "comment-line": { + "begin": "(?(?!>)|>=|\\&\\&|\\|\\||\\:(?!=)|\\?|\\!)", + "name": "keyword.operator.logic" + }, + "operator-mapping": { + "match": "(=>)", + "name": "keyword.operator.mapping" + }, + "operator-arithmetic": { + "match": "(\\+|\\-|\\/|\\*)", + "name": "keyword.operator.arithmetic" + }, + "operator-binary": { + "match": "(\\^|\\&|\\||<<|>>)", + "name": "keyword.operator.binary" + }, + "operator-assignment": { + "match": "(\\:?=)", + "name": "keyword.operator.assignment" + }, + "control": { + "patterns": [ + { + "include": "#control-flow" + }, + { + "include": "#control-using" + }, + { + "include": "#control-import" + }, + { + "include": "#control-pragma" + }, + { + "include": "#control-underscore" + }, + { + "include": "#control-unchecked" + }, + { + "include": "#control-other" + } + ] + }, + "control-flow": { + "patterns": [ + { + "match": "\\b(if|else|for|while|do|break|continue|try|catch|finally|throw|return|global)\\b", + "name": "keyword.control.flow" + }, + { + "begin": "\\b(returns)\\b", + "beginCaptures": { + "1": { + "name": "keyword.control.flow.return" + } + }, + "end": "(?=\\))", + "patterns": [ + { + "include": "#declaration-function-parameters" + } + ] + } + ] + }, + "control-using": { + "patterns": [ + { + "match": "\\b(using)\\b\\s+\\b([A-Za-z\\d_]+)\\b\\s+\\b(for)\\b\\s+\\b([A-Za-z\\d_]+)", + "captures": { + "1": { + "name": "keyword.control.using" + }, + "2": { + "name": "entity.name.type.library" + }, + "3": { + "name": "keyword.control.for" + }, + "4": { + "name": "entity.name.type" + } + } + }, + { + "match": "\\b(using)\\b", + "name": "keyword.control.using" + } + ] + }, + "control-import": { + "patterns": [ + { + "begin": "\\b(import)\\b", + "beginCaptures": { + "1": { + "name": "keyword.control.import" + } + }, + "end": "(?=\\;)", + "patterns": [ + { + "begin": "((?=\\{))", + "end": "((?=\\}))", + "patterns": [ + { + "match": "\\b(\\w+)\\b", + "name": "entity.name.type.interface" + } + ] + }, + { + "match": "\\b(from)\\b", + "name": "keyword.control.import.from" + }, + { + "include": "#string" + }, + { + "include": "#punctuation" + } + ] + }, + { + "match": "\\b(import)\\b", + "name": "keyword.control.import" + } + ] + }, + "control-unchecked": { + "match": "\\b(unchecked)\\b", + "name": "keyword.control.unchecked" + }, + "control-pragma": { + "match": "\\b(pragma)(?:\\s+([A-Za-z_]\\w+)\\s+([^\\s]+))?\\b", + "captures": { + "1": { + "name": "keyword.control.pragma" + }, + "2": { + "name": "entity.name.tag.pragma" + }, + "3": { + "name": "constant.other.pragma" + } + } + }, + "control-underscore": { + "match": "\\b(_)\\b", + "name": "constant.other.underscore" + }, + "control-other": { + "match": "\\b(new|delete|emit)\\b", + "name": "keyword.control" + }, + "constant": { + "patterns": [ + { + "include": "#constant-boolean" + }, + { + "include": "#constant-time" + }, + { + "include": "#constant-currency" + } + ] + }, + "constant-boolean": { + "match": "\\b(true|false)\\b", + "name": "constant.language.boolean" + }, + "constant-time": { + "match": "\\b(seconds|minutes|hours|days|weeks|years)\\b", + "name": "constant.language.time" + }, + "constant-currency": { + "match": "\\b(ether|wei|gwei|finney|szabo)\\b", + "name": "constant.language.currency" + }, + "number": { + "patterns": [ + { + "include": "#number-decimal" + }, + { + "include": "#number-hex" + }, + { + "include": "#number-scientific" + } + ] + }, + "number-decimal": { + "match": "\\b([0-9_]+(\\.[0-9_]+)?)\\b", + "name": "constant.numeric.decimal" + }, + "number-hex": { + "match": "\\b(0[xX][a-fA-F0-9]+)\\b", + "name": "constant.numeric.hexadecimal" + }, + "number-scientific": { + "match": "\\b(?:0\\.(?:0[0-9]|[0-9][0-9_]?)|[0-9][0-9_]*(?:\\.\\d{1,2})?)(?:e[+-]?[0-9_]+)?", + "name": "constant.numeric.scientific" + }, + "string": { + "patterns": [ + { + "match": "\\\"(?:\\\\\"|[^\\\"])*\\\"", + "name": "string.quoted.double" + }, + { + "match": "\\'(?:\\\\'|[^\\'])*\\'", + "name": "string.quoted.single" + } + ] + }, + "primitive": { + "patterns": [ + { + "include": "#number-decimal" + }, + { + "include": "#number-hex" + }, + { + "include": "#number-scientific" + }, + { + "include": "#string" + } + ] + }, + "type-primitive": { + "patterns": [ + { + "begin": "\\b(address|string\\d*|bytes\\d*|int\\d*|uint\\d*|bool|hash\\d*)\\b(?:\\[\\])(\\()", + "beginCaptures": { + "1": { + "name": "support.type.primitive" + } + }, + "end": "(\\))", + "patterns": [ + { + "include": "#primitive" + }, + { + "include": "#punctuation" + }, + { + "include": "#global" + }, + { + "include": "#variable" + } + ] + }, + { + "match": "\\b(address|string\\d*|bytes\\d*|int\\d*|uint\\d*|bool|hash\\d*)\\b", + "name": "support.type.primitive" + } + ] + }, + "global": { + "patterns": [ + { + "include": "#global-variables" + }, + { + "include": "#global-functions" + } + ] + }, + "global-variables": { + "patterns": [ + { + "match": "\\b(this)\\b", + "name": "variable.language.this" + }, + { + "match": "\\b(super)\\b", + "name": "variable.language.super" + }, + { + "match": "\\b(abi)\\b", + "name": "variable.language.builtin.abi" + }, + { + "match": "\\b(msg\\.sender|msg|block|tx|now)\\b", + "name": "variable.language.transaction" + }, + { + "match": "\\b(tx\\.origin|tx\\.gasprice|msg\\.data|msg\\.sig|msg\\.value)\\b", + "name": "variable.language.transaction" + } + ] + }, + "global-functions": { + "patterns": [ + { + "match": "\\b(require|assert|revert)\\b", + "name": "keyword.control.exceptions" + }, + { + "match": "\\b(selfdestruct|suicide)\\b", + "name": "keyword.control.contract" + }, + { + "match": "\\b(addmod|mulmod|keccak256|sha256|sha3|ripemd160|ecrecover)\\b", + "name": "support.function.math" + }, + { + "match": "\\b(unicode)\\b", + "name": "support.function.string" + }, + { + "match": "\\b(blockhash|gasleft)\\b", + "name": "variable.language.transaction" + }, + { + "match": "\\b(type)\\b", + "name": "variable.language.type" + } + ] + }, + "type-modifier-access": { + "match": "\\b(internal|external|private|public)\\b", + "name": "storage.type.modifier.access" + }, + "type-modifier-payable": { + "match": "\\b(nonpayable|payable)\\b", + "name": "storage.type.modifier.payable" + }, + "type-modifier-constant": { + "match": "\\b(constant)\\b", + "name": "storage.type.modifier.readonly" + }, + "type-modifier-immutable": { + "match": "\\b(immutable)\\b", + "name": "storage.type.modifier.readonly" + }, + "type-modifier-extended-scope": { + "match": "\\b(pure|view|inherited|indexed|storage|memory|virtual|calldata|override|abstract)\\b", + "name": "storage.type.modifier.extendedscope" + }, + "variable": { + "patterns": [ + { + "match": "\\b(\\_\\w+)\\b", + "captures": { + "1": { + "name": "variable.parameter.function" + } + } + }, + { + "match": "(?:\\.)(\\w+)\\b", + "captures": { + "1": { + "name": "support.variable.property" + } + } + }, + { + "match": "\\b(\\w+)\\b", + "captures": { + "1": { + "name": "variable.parameter.other" + } + } + } + ] + }, + "modifier-call": { + "patterns": [ + { + "include": "#function-call" + }, + { + "match": "\\b(\\w+)\\b", + "name": "entity.name.function.modifier" + } + ] + }, + "declaration": { + "patterns": [ + { + "include": "#declaration-contract" + }, + { + "include": "#declaration-userType" + }, + { + "include": "#declaration-interface" + }, + { + "include": "#declaration-library" + }, + { + "include": "#declaration-function" + }, + { + "include": "#declaration-modifier" + }, + { + "include": "#declaration-constructor" + }, + { + "include": "#declaration-event" + }, + { + "include": "#declaration-storage" + }, + { + "include": "#declaration-error" + } + + ] + }, + "declaration-storage-field": { + "patterns": [ + { + "include": "#comment" + }, + { + "include": "#control" + }, + { + "include": "#type-primitive" + }, + { + "include": "#type-modifier-access" + }, + { + "include": "#type-modifier-immutable" + }, + { + "include": "#type-modifier-extend-scope" + }, + { + "include": "#type-modifier-payable" + }, + { + "include": "#type-modifier-constant" + }, + { + "include": "#primitive" + }, + { + "include": "#constant" + }, + { + "include": "#operator" + }, + { + "include": "#punctuation" + } + ] + }, + "declaration-storage": { + "patterns": [ + { + "include": "#declaration-storage-mapping" + }, + { + "include": "#declaration-struct" + }, + { + "include": "#declaration-enum" + }, + { + "include": "#declaration-storage-field" + } + ] + }, + "declaration-userType": { + "match": "\\b(type)\\b\\s+(\\w+)\\b\\s+\\b(is)\\b", + "captures": { + "1": { + "name": "storage.type.userType" + }, + "2": { + "name": "entity.name.type.userType" + }, + "3": { + "name": "storage.modifier.is" + } + } + }, + "declaration-contract": { + "patterns": [ + { + "begin": "\\b(contract)\\b\\s+(\\w+)\\b\\s+\\b(is)\\b\\s+", + "end": "(?=\\{)", + "beginCaptures": { + "1": { + "name": "storage.type.contract" + }, + "2": { + "name": "entity.name.type.contract" + }, + "3": { + "name": "storage.modifier.is" + } + }, + "patterns": [ + { + "match": "\\b(\\w+)\\b", + "name": "entity.name.type.contract.extend" + } + ] + }, + { + "match": "\\b(contract)(\\s+([A-Za-z_]\\w*))?\\b", + "captures": { + "1": { + "name": "storage.type.contract" + }, + "2": { + "name": "entity.name.type.contract" + } + } + } + + ] + }, + "declaration-interface": { + "patterns": [ + { + "begin": "\\b(interface)\\b\\s+(\\w+)\\b\\s+\\b(is)\\b\\s+", + "end": "(?=\\{)", + "beginCaptures": { + "1": { + "name": "storage.type.interface" + }, + "2": { + "name": "entity.name.type.interface" + }, + "3": { + "name": "storage.modifier.is" + } + }, + "patterns": [ + { + "match": "\\b(\\w+)\\b", + "name": "entity.name.type.interface.extend" + } + ] + }, + { + "match": "\\b(interface)(\\s+([A-Za-z_]\\w*))?\\b", + "captures": { + "1": { + "name": "storage.type.interface" + }, + "2": { + "name": "entity.name.type.interface" + } + } + } + + ] + }, + "declaration-library": { + "match": "\\b(library)(\\s+([A-Za-z_]\\w*))?\\b", + "captures": { + "1": { + "name": "storage.type.library" + }, + "3": { + "name": "entity.name.type.library" + } + } + }, + "declaration-struct": { + "patterns": [ + { + "match": "\\b(struct)(\\s+([A-Za-z_]\\w*))?\\b", + "captures": { + "1": { + "name": "storage.type.struct" + }, + "3": { + "name": "entity.name.type.struct" + } + } + }, + { + "begin": "\\b(struct)\\b\\s*(\\w+)?\\b\\s*(?=\\{)", + "beginCaptures": { + "1": { + "name": "storage.type.struct" + }, + "2": { + "name": "entity.name.type.struct" + } + }, + "end": "(?=\\})", + "patterns": [ + { + "include": "#type-primitive" + }, + { + "include": "#variable" + }, + { + "include": "#punctuation" + }, + { + "include": "#comment" + } + ] + } + ] + }, + "declaration-event": { + "patterns": [ + { + "begin": "\\b(event)\\b(?:\\s+(\\w+)\\b)?", + "end": "(?=\\))", + "beginCaptures": { + "1": { + "name": "storage.type.event" + }, + "2": { + "name": "entity.name.type.event" + } + }, + "patterns": [ + { + "include": "#type-primitive" + }, + { + "match": "\\b(?:(indexed)\\s)?(\\w+)(?:,\\s*|)", + "captures": { + "1": { + "name": "storage.type.modifier.indexed" + }, + "2": { + "name": "variable.parameter.event" + } + } + }, + { + "include": "#punctuation" + } + ] + }, + { + "match": "\\b(event)(\\s+([A-Za-z_]\\w*))?\\b", + "captures": { + "1": { + "name": "storage.type.event" + }, + "3": { + "name": "entity.name.type.event" + } + } + } + ] + }, + "declaration-constructor": { + "patterns": [ + { + "begin": "\\b(constructor)\\b", + "beginCaptures": { + "1": { + "name": "storage.type.constructor" + } + }, + "end": "(?=\\{)", + "patterns": [ + { + "begin": "\\G\\s*(?=\\()", + "end": "(?=\\))", + "patterns": [ + { + "include": "#declaration-function-parameters" + } + ] + }, + { + "begin": "(?<=\\))", + "end": "(?=\\{)", + "patterns": [ + { + "include": "#type-modifier-access" + }, + { + "include": "#function-call" + } + ] + } + ] + }, + { + "match": "\\b(constructor)\\b", + "captures": { + "1": { + "name": "storage.type.constructor" + } + } + } + ] + }, + "declaration-enum": { + "patterns": [ + { + "begin": "\\b(enum)\\s+(\\w+)\\b", + "beginCaptures": { + "1": { + "name": "storage.type.enum" + }, + "2": { + "name": "entity.name.type.enum" + } + }, + "end": "(?=\\})", + "patterns": [ + { + "match": "\\b(\\w+)\\b", + "name": "variable.other.enummember" + }, + { + "include": "#punctuation" + }, + { + "include": "#comment" + } + ] + }, + { + "match": "\\b(enum)(\\s+([A-Za-z_]\\w*))?\\b", + "captures": { + "1": { + "name": "storage.type.enum" + }, + "3": { + "name": "entity.name.type.enum" + } + } + } + ] + }, + "declaration-function-parameters": { + "begin": "\\G\\s*(?=\\()", + "end": "(?=\\))", + "patterns": [ + { + "include": "#type-primitive" + }, + { + "include": "#type-modifier-extended-scope" + }, + { + "match": "\\b([A-Z]\\w*)\\b", + "captures": { + "1": { + "name": "storage.type.struct" + } + } + }, + { + "include": "#variable" + }, + { + "include": "#punctuation" + }, + { + "include": "#comment" + } + ] + }, + "declaration-function": { + "patterns": [ + { + "begin": "\\b(function)\\s+(\\w+)\\b", + "beginCaptures": { + "1": { + "name": "storage.type.function" + }, + "2": { + "name": "entity.name.function" + } + }, + "end": "(?=\\{|;)", + "patterns": [ + { + "include": "#natspec" + }, + { + "include": "#global" + }, + { + "include": "#declaration-function-parameters" + }, + { + "include": "#type-modifier-access" + }, + { + "include": "#type-modifier-payable" + }, + { + "include": "#type-modifier-immutable" + }, + { + "include": "#type-modifier-extended-scope" + }, + { + "include": "#control-flow" + }, + { + "include": "#function-call" + }, + { + "include": "#modifier-call" + }, + { + "include": "#punctuation" + } + ] + }, + { + "match": "\\b(function)\\s+([A-Za-z_]\\w*)\\b", + "captures": { + "1": { + "name": "storage.type.function" + }, + "2": { + "name": "entity.name.function" + } + } + } + ] + }, + "declaration-modifier": { + "patterns": [ + { + "begin": "\\b(modifier)\\b\\s*(\\w+)", + "beginCaptures": { + "1": { + "name": "storage.type.function.modifier" + }, + "2": { + "name": "entity.name.function.modifier" + } + }, + "end": "(?=\\{)", + "patterns": [ + { + "include": "#declaration-function-parameters" + }, + { + "begin": "(?<=\\))", + "end": "(?=\\{)", + "patterns": [ + { + "include": "#declaration-function-parameters" + }, + { + "include": "#type-modifier-access" + }, + { + "include": "#type-modifier-payable" + }, + { + "include": "#type-modifier-immutable" + }, + { + "include": "#type-modifier-extended-scope" + }, + { + "include": "#function-call" + }, + { + "include": "#modifier-call" + }, + { + "include": "#control-flow" + } + ] + } + ] + }, + { + "match": "\\b(modifier)(\\s+([A-Za-z_]\\w*))?\\b", + "captures": { + "1": { + "name": "storage.type.modifier" + }, + "3": { + "name": "entity.name.function" + } + } + } + ] + }, + "declaration-storage-mapping": { + "patterns": [ + { + "begin": "\\b(mapping)\\b", + "beginCaptures": { + "1": { + "name": "storage.type.mapping" + } + }, + "end": "(?=\\))", + "patterns": [ + { + "include": "#declaration-storage-mapping" + }, + { + "include": "#type-primitive" + }, + { + "include": "#punctuation" + }, + { + "include": "#operator" + } + ] + }, + { + "match": "\\b(mapping)\\b", + "name": "storage.type.mapping" + } + ] + }, + "declaration-error": { + "match": "\\b(error)(\\s+([A-Za-z_]\\w*))?\\b", + "captures": { + "1": { + "name": "storage.type.error" + }, + "3": { + "name": "entity.name.type.error" + } + } + }, + "function-call": { + "match": "\\b([A-Za-z_]\\w*)\\s*(\\()", + "captures": { + "1": { + "name": "entity.name.function" + }, + "2": { + "name": "punctuation.parameters.begin" + } + } + }, + "assembly": { + "patterns": [ + { + "match": "\\b(assembly)\\b", + "name": "keyword.control.assembly" + }, + { + "match": "\\b(let)\\b", + "name": "storage.type.assembly" + } + ] + }, + "punctuation": { + "patterns": [ + { + "match": ";", + "name": "punctuation.terminator.statement" + }, + { + "match": "\\.", + "name": "punctuation.accessor" + }, + { + "match": ",", + "name": "punctuation.separator" + }, + { + "match": "\\{", + "name": "punctuation.brace.curly.begin" + }, + { + "match": "\\}", + "name": "punctuation.brace.curly.end" + }, + { + "match": "\\[", + "name": "punctuation.brace.square.begin" + }, + { + "match": "\\]", + "name": "punctuation.brace.square.end" + }, + { + "match": "\\(", + "name": "punctuation.parameters.begin" + }, + { + "match": "\\)", + "name": "punctuation.parameters.end" + } + ] + } + }, + "scopeName": "source.solidity", + "uuid": "ad87d2cd-8575-4afe-984e-9421a3788933" + +} \ No newline at end of file diff --git a/toolchains/solidity/extension/package.json b/toolchains/solidity/extension/package.json index 7f795582..6a6224ca 100644 --- a/toolchains/solidity/extension/package.json +++ b/toolchains/solidity/extension/package.json @@ -19,6 +19,32 @@ "command": "extension.helloWorld", "title": "Hello World" } + ], + "languages": [ + { + "id": "solidity", + "aliases": [ + "Solidity", + "solidity" + ], + "extensions": [ + ".sol" + ], + "configuration": "./assets/configuration.json" + } + ], + "grammars": [ + { + "language": "solidity", + "scopeName": "source.solidity", + "path": "./assets/syntax.json", + "balancedBracketScopes": [ + "*" + ], + "unbalancedBracketScopes": [ + "meta.scope.case-pattern.solidity" + ] + } ] }, "scripts": { From 3c0e5f747474e81cc3c4306a677523df5320b38b Mon Sep 17 00:00:00 2001 From: Astrodevs CI Date: Tue, 24 Oct 2023 04:35:43 +0000 Subject: [PATCH 254/325] chore: create branch feature/188-prepare-solidity-extension-announcement-staging --- remove-me-e9da91787492451f8e6e.txt | 1 + 1 file changed, 1 insertion(+) create mode 100644 remove-me-e9da91787492451f8e6e.txt diff --git a/remove-me-e9da91787492451f8e6e.txt b/remove-me-e9da91787492451f8e6e.txt new file mode 100644 index 00000000..f3f8abf8 --- /dev/null +++ b/remove-me-e9da91787492451f8e6e.txt @@ -0,0 +1 @@ +e9da91787492451f8e6e From 2bd9c1e15d6fa8071ae100603a680636d3668e22 Mon Sep 17 00:00:00 2001 From: 0xMemoryGrinder <35138272+0xMemoryGrinder@users.noreply.github.com> Date: Tue, 24 Oct 2023 01:35:39 -0400 Subject: [PATCH 255/325] fix(solidity/extension): added missing yarn script --- toolchains/solidity/extension/package.json | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/toolchains/solidity/extension/package.json b/toolchains/solidity/extension/package.json index 6a6224ca..bdc7911e 100644 --- a/toolchains/solidity/extension/package.json +++ b/toolchains/solidity/extension/package.json @@ -1,8 +1,9 @@ { "name": "osmium-solidity-extension", - "displayName": "Osmium solidity", + "displayName": "Osmium Solidity", "description": "", "version": "0.0.1", + "publisher": "OsmiumToolchains", "engines": { "vscode": "^1.75.0" }, @@ -56,7 +57,8 @@ "pretest": "yarn run compile && yarn run extension:lint", "extension:lint": "eslint src --ext ts", "extension:test": "echo 'not tests'", - "extension:format": "echo 'no formatter'" + "extension:format": "echo 'no formatter'", + "extension:publish": "yarn run package && vsce publish --no-dependencies" }, "dependencies": { "vscode-languageclient": "^8.1.0", @@ -67,10 +69,11 @@ "@types/glob": "^8.1.0", "@types/mocha": "^10.0.1", "@types/node": "20.2.5", - "@types/vscode": "^1.83.0", + "@types/vscode": "^1.75.0", "@typescript-eslint/eslint-plugin": "^5.59.8", "@typescript-eslint/parser": "^5.59.8", "@vscode/test-electron": "^2.3.2", + "@vscode/vsce": "2.21.1", "eslint": "^8.41.0", "glob": "^8.1.0", "mocha": "^10.2.0", From 8634178e0ba328e8687326e47d0187d5823871f3 Mon Sep 17 00:00:00 2001 From: 0xMemoryGrinder <35138272+0xMemoryGrinder@users.noreply.github.com> Date: Tue, 24 Oct 2023 01:36:25 -0400 Subject: [PATCH 256/325] fix(solidity/extension): renamed entrypoint file to client.ts to avoid conflict with wasm-pack output --- .pnp.cjs | 1278 ++++++++++++++--- toolchains/solidity/extension/package.json | 2 +- .../extension/src/{extension.ts => client.ts} | 0 .../solidity/extension/webpack.config.js | 2 +- yarn.lock | 1109 +++++++++++--- 5 files changed, 2017 insertions(+), 374 deletions(-) rename toolchains/solidity/extension/src/{extension.ts => client.ts} (100%) diff --git a/.pnp.cjs b/.pnp.cjs index 04702655..8579e879 100755 --- a/.pnp.cjs +++ b/.pnp.cjs @@ -107,27 +107,13 @@ const RAW_RUNTIME_STATE = ],\ "linkType": "SOFT"\ }],\ - ["virtual:77fce3ec74d55c7e6791631c329cf3adde374e21e618e865127f72e63efeb3376dcf7fc8217de80f5a310e81c791a72e9d099b00fd3252d5653ff68dff50c2fa#npm:4.4.0", {\ - "packageLocation": "./.yarn/__virtual__/@eslint-community-eslint-utils-virtual-3663415ec2/0/cache/@eslint-community-eslint-utils-npm-4.4.0-d1791bd5a3-8d70bcdcd8.zip/node_modules/@eslint-community/eslint-utils/",\ + ["virtual:e7f048a4398cf12bbd1cde95eff45a3327b9fe42e04c31ed99d0e926830d0b78ff78b511118c2bd3bc6add84782ab97a5b001e972071d6fdbfe85a86c150922a#npm:4.4.0", {\ + "packageLocation": "./.yarn/__virtual__/@eslint-community-eslint-utils-virtual-a282c466c0/0/cache/@eslint-community-eslint-utils-npm-4.4.0-d1791bd5a3-8d70bcdcd8.zip/node_modules/@eslint-community/eslint-utils/",\ "packageDependencies": [\ - ["@eslint-community/eslint-utils", "virtual:77fce3ec74d55c7e6791631c329cf3adde374e21e618e865127f72e63efeb3376dcf7fc8217de80f5a310e81c791a72e9d099b00fd3252d5653ff68dff50c2fa#npm:4.4.0"],\ + ["@eslint-community/eslint-utils", "virtual:e7f048a4398cf12bbd1cde95eff45a3327b9fe42e04c31ed99d0e926830d0b78ff78b511118c2bd3bc6add84782ab97a5b001e972071d6fdbfe85a86c150922a#npm:4.4.0"],\ ["@types/eslint", null],\ - ["eslint", "npm:8.51.0"],\ - ["eslint-visitor-keys", "npm:3.4.2"]\ - ],\ - "packagePeers": [\ - "@types/eslint",\ - "eslint"\ - ],\ - "linkType": "HARD"\ - }],\ - ["virtual:dc7af99e618232ac0e2a751f560e2225037bf809144a4cc05369d5312b9d24061282984c0c0c6c5c199f3a0663f91f11c21afb60016655f472fa253e0b676e3b#npm:4.4.0", {\ - "packageLocation": "./.yarn/__virtual__/@eslint-community-eslint-utils-virtual-19d05ef909/0/cache/@eslint-community-eslint-utils-npm-4.4.0-d1791bd5a3-8d70bcdcd8.zip/node_modules/@eslint-community/eslint-utils/",\ - "packageDependencies": [\ - ["@eslint-community/eslint-utils", "virtual:dc7af99e618232ac0e2a751f560e2225037bf809144a4cc05369d5312b9d24061282984c0c0c6c5c199f3a0663f91f11c21afb60016655f472fa253e0b676e3b#npm:4.4.0"],\ - ["@types/eslint", null],\ - ["eslint", "npm:8.46.0"],\ - ["eslint-visitor-keys", "npm:3.4.2"]\ + ["eslint", "npm:8.52.0"],\ + ["eslint-visitor-keys", "npm:3.4.3"]\ ],\ "packagePeers": [\ "@types/eslint",\ @@ -137,13 +123,6 @@ const RAW_RUNTIME_STATE = }]\ ]],\ ["@eslint-community/regexpp", [\ - ["npm:4.6.2", {\ - "packageLocation": "./.yarn/cache/@eslint-community-regexpp-npm-4.6.2-0fc083c210-59ea2fa13a.zip/node_modules/@eslint-community/regexpp/",\ - "packageDependencies": [\ - ["@eslint-community/regexpp", "npm:4.6.2"]\ - ],\ - "linkType": "HARD"\ - }],\ ["npm:4.9.1", {\ "packageLocation": "./.yarn/cache/@eslint-community-regexpp-npm-4.9.1-7805f77eb5-8f1ba51fa5.zip/node_modules/@eslint-community/regexpp/",\ "packageDependencies": [\ @@ -153,30 +132,14 @@ const RAW_RUNTIME_STATE = }]\ ]],\ ["@eslint/eslintrc", [\ - ["npm:2.1.1", {\ - "packageLocation": "./.yarn/cache/@eslint-eslintrc-npm-2.1.1-ced87d94ab-d4dda7f9f0.zip/node_modules/@eslint/eslintrc/",\ - "packageDependencies": [\ - ["@eslint/eslintrc", "npm:2.1.1"],\ - ["ajv", "npm:6.12.6"],\ - ["debug", "virtual:ced87d94ab05a28b44536eb0cd61a9458e757a0ae7bb35e5ab5d27e03d08b996abd275928b29aad2eb0973d5bb0800e75ba8ca3e26bf62cbe8ea0fae8cca70a8#npm:4.3.4"],\ - ["espree", "npm:9.6.1"],\ - ["globals", "npm:13.20.0"],\ - ["ignore", "npm:5.2.4"],\ - ["import-fresh", "npm:3.3.0"],\ - ["js-yaml", "npm:4.1.0"],\ - ["minimatch", "npm:3.1.2"],\ - ["strip-json-comments", "npm:3.1.1"]\ - ],\ - "linkType": "HARD"\ - }],\ ["npm:2.1.2", {\ "packageLocation": "./.yarn/cache/@eslint-eslintrc-npm-2.1.2-feb0771c9f-fa25638f26.zip/node_modules/@eslint/eslintrc/",\ "packageDependencies": [\ ["@eslint/eslintrc", "npm:2.1.2"],\ ["ajv", "npm:6.12.6"],\ - ["debug", "virtual:ced87d94ab05a28b44536eb0cd61a9458e757a0ae7bb35e5ab5d27e03d08b996abd275928b29aad2eb0973d5bb0800e75ba8ca3e26bf62cbe8ea0fae8cca70a8#npm:4.3.4"],\ + ["debug", "virtual:feb0771c9f8eadaf509cfed41e14a8bebbea5442233275c1c87085111077a08ef71eb773b899665b154d8203a55a489610a54117ae059fce5f5b8b844493b1b1#npm:4.3.4"],\ ["espree", "npm:9.6.1"],\ - ["globals", "npm:13.20.0"],\ + ["globals", "npm:13.23.0"],\ ["ignore", "npm:5.2.4"],\ ["import-fresh", "npm:3.3.0"],\ ["js-yaml", "npm:4.1.0"],\ @@ -187,38 +150,21 @@ const RAW_RUNTIME_STATE = }]\ ]],\ ["@eslint/js", [\ - ["npm:8.46.0", {\ - "packageLocation": "./.yarn/cache/@eslint-js-npm-8.46.0-3cfe1ee88b-0cc409c5f4.zip/node_modules/@eslint/js/",\ - "packageDependencies": [\ - ["@eslint/js", "npm:8.46.0"]\ - ],\ - "linkType": "HARD"\ - }],\ - ["npm:8.51.0", {\ - "packageLocation": "./.yarn/cache/@eslint-js-npm-8.51.0-51f088b88b-1641f02c78.zip/node_modules/@eslint/js/",\ + ["npm:8.52.0", {\ + "packageLocation": "./.yarn/cache/@eslint-js-npm-8.52.0-801dbdf7b0-86beff213d.zip/node_modules/@eslint/js/",\ "packageDependencies": [\ - ["@eslint/js", "npm:8.51.0"]\ + ["@eslint/js", "npm:8.52.0"]\ ],\ "linkType": "HARD"\ }]\ ]],\ ["@humanwhocodes/config-array", [\ - ["npm:0.11.10", {\ - "packageLocation": "./.yarn/cache/@humanwhocodes-config-array-npm-0.11.10-7b63df9e7f-f93086ae6a.zip/node_modules/@humanwhocodes/config-array/",\ + ["npm:0.11.13", {\ + "packageLocation": "./.yarn/cache/@humanwhocodes-config-array-npm-0.11.13-12314014f2-9f655e1df7.zip/node_modules/@humanwhocodes/config-array/",\ "packageDependencies": [\ - ["@humanwhocodes/config-array", "npm:0.11.10"],\ - ["@humanwhocodes/object-schema", "npm:1.2.1"],\ - ["debug", "virtual:ced87d94ab05a28b44536eb0cd61a9458e757a0ae7bb35e5ab5d27e03d08b996abd275928b29aad2eb0973d5bb0800e75ba8ca3e26bf62cbe8ea0fae8cca70a8#npm:4.3.4"],\ - ["minimatch", "npm:3.1.2"]\ - ],\ - "linkType": "HARD"\ - }],\ - ["npm:0.11.11", {\ - "packageLocation": "./.yarn/cache/@humanwhocodes-config-array-npm-0.11.11-e3582554ee-4aad64bc4c.zip/node_modules/@humanwhocodes/config-array/",\ - "packageDependencies": [\ - ["@humanwhocodes/config-array", "npm:0.11.11"],\ - ["@humanwhocodes/object-schema", "npm:1.2.1"],\ - ["debug", "virtual:ced87d94ab05a28b44536eb0cd61a9458e757a0ae7bb35e5ab5d27e03d08b996abd275928b29aad2eb0973d5bb0800e75ba8ca3e26bf62cbe8ea0fae8cca70a8#npm:4.3.4"],\ + ["@humanwhocodes/config-array", "npm:0.11.13"],\ + ["@humanwhocodes/object-schema", "npm:2.0.1"],\ + ["debug", "virtual:feb0771c9f8eadaf509cfed41e14a8bebbea5442233275c1c87085111077a08ef71eb773b899665b154d8203a55a489610a54117ae059fce5f5b8b844493b1b1#npm:4.3.4"],\ ["minimatch", "npm:3.1.2"]\ ],\ "linkType": "HARD"\ @@ -234,10 +180,10 @@ const RAW_RUNTIME_STATE = }]\ ]],\ ["@humanwhocodes/object-schema", [\ - ["npm:1.2.1", {\ - "packageLocation": "./.yarn/cache/@humanwhocodes-object-schema-npm-1.2.1-eb622b5d0e-b48a8f87fc.zip/node_modules/@humanwhocodes/object-schema/",\ + ["npm:2.0.1", {\ + "packageLocation": "./.yarn/cache/@humanwhocodes-object-schema-npm-2.0.1-c23364bbfc-dbddfd0465.zip/node_modules/@humanwhocodes/object-schema/",\ "packageDependencies": [\ - ["@humanwhocodes/object-schema", "npm:1.2.1"]\ + ["@humanwhocodes/object-schema", "npm:2.0.1"]\ ],\ "linkType": "HARD"\ }]\ @@ -409,7 +355,7 @@ const RAW_RUNTIME_STATE = "packageLocation": "./packages/eslint-config/",\ "packageDependencies": [\ ["@osmium-packages/eslint-config", "workspace:packages/eslint-config"],\ - ["eslint", "npm:8.46.0"]\ + ["eslint", "npm:8.52.0"]\ ],\ "linkType": "SOFT"\ }]\ @@ -419,7 +365,7 @@ const RAW_RUNTIME_STATE = "packageLocation": "./packages/prettier-config/",\ "packageDependencies": [\ ["@osmium-packages/prettier-config", "workspace:packages/prettier-config"],\ - ["prettier", "npm:3.0.0"]\ + ["prettier", "npm:3.0.3"]\ ],\ "linkType": "SOFT"\ }]\ @@ -573,8 +519,8 @@ const RAW_RUNTIME_STATE = ["@typescript-eslint/scope-manager", "npm:5.62.0"],\ ["@typescript-eslint/type-utils", "virtual:89014fb2f72da20eb87d54c80bac37610b57a73485dee5ebf9333bf5c4bce0d972953cbf0f48420b275d3bc40f36aded8d47d2d24281f85e903e5d354ec64e4e#npm:5.62.0"],\ ["@typescript-eslint/utils", "virtual:89014fb2f72da20eb87d54c80bac37610b57a73485dee5ebf9333bf5c4bce0d972953cbf0f48420b275d3bc40f36aded8d47d2d24281f85e903e5d354ec64e4e#npm:5.62.0"],\ - ["debug", "virtual:ced87d94ab05a28b44536eb0cd61a9458e757a0ae7bb35e5ab5d27e03d08b996abd275928b29aad2eb0973d5bb0800e75ba8ca3e26bf62cbe8ea0fae8cca70a8#npm:4.3.4"],\ - ["eslint", "npm:8.51.0"],\ + ["debug", "virtual:feb0771c9f8eadaf509cfed41e14a8bebbea5442233275c1c87085111077a08ef71eb773b899665b154d8203a55a489610a54117ae059fce5f5b8b844493b1b1#npm:4.3.4"],\ + ["eslint", "npm:8.52.0"],\ ["graphemer", "npm:1.4.0"],\ ["ignore", "npm:5.2.4"],\ ["natural-compare-lite", "npm:1.4.0"],\ @@ -610,8 +556,8 @@ const RAW_RUNTIME_STATE = ["@typescript-eslint/scope-manager", "npm:5.62.0"],\ ["@typescript-eslint/types", "npm:5.62.0"],\ ["@typescript-eslint/typescript-estree", "virtual:7f3bc25884a68a29ac4d296cb19161080b5427dc732e6412b6c8cd95f25543caace2cc48bfd515b6ed39d97808f3fde9257ccd25f2112571b23f01c85c15a049#npm:5.62.0"],\ - ["debug", "virtual:ced87d94ab05a28b44536eb0cd61a9458e757a0ae7bb35e5ab5d27e03d08b996abd275928b29aad2eb0973d5bb0800e75ba8ca3e26bf62cbe8ea0fae8cca70a8#npm:4.3.4"],\ - ["eslint", "npm:8.51.0"],\ + ["debug", "virtual:feb0771c9f8eadaf509cfed41e14a8bebbea5442233275c1c87085111077a08ef71eb773b899665b154d8203a55a489610a54117ae059fce5f5b8b844493b1b1#npm:4.3.4"],\ + ["eslint", "npm:8.52.0"],\ ["typescript", "patch:typescript@npm%3A5.2.2#optional!builtin::version=5.2.2&hash=f3b441"]\ ],\ "packagePeers": [\ @@ -650,8 +596,8 @@ const RAW_RUNTIME_STATE = ["@types/typescript", null],\ ["@typescript-eslint/typescript-estree", "virtual:7f3bc25884a68a29ac4d296cb19161080b5427dc732e6412b6c8cd95f25543caace2cc48bfd515b6ed39d97808f3fde9257ccd25f2112571b23f01c85c15a049#npm:5.62.0"],\ ["@typescript-eslint/utils", "virtual:89014fb2f72da20eb87d54c80bac37610b57a73485dee5ebf9333bf5c4bce0d972953cbf0f48420b275d3bc40f36aded8d47d2d24281f85e903e5d354ec64e4e#npm:5.62.0"],\ - ["debug", "virtual:ced87d94ab05a28b44536eb0cd61a9458e757a0ae7bb35e5ab5d27e03d08b996abd275928b29aad2eb0973d5bb0800e75ba8ca3e26bf62cbe8ea0fae8cca70a8#npm:4.3.4"],\ - ["eslint", "npm:8.51.0"],\ + ["debug", "virtual:feb0771c9f8eadaf509cfed41e14a8bebbea5442233275c1c87085111077a08ef71eb773b899665b154d8203a55a489610a54117ae059fce5f5b8b844493b1b1#npm:4.3.4"],\ + ["eslint", "npm:8.52.0"],\ ["tsutils", "virtual:89014fb2f72da20eb87d54c80bac37610b57a73485dee5ebf9333bf5c4bce0d972953cbf0f48420b275d3bc40f36aded8d47d2d24281f85e903e5d354ec64e4e#npm:3.21.0"],\ ["typescript", "patch:typescript@npm%3A5.2.2#optional!builtin::version=5.2.2&hash=f3b441"]\ ],\ @@ -688,7 +634,7 @@ const RAW_RUNTIME_STATE = ["@types/typescript", null],\ ["@typescript-eslint/types", "npm:5.62.0"],\ ["@typescript-eslint/visitor-keys", "npm:5.62.0"],\ - ["debug", "virtual:ced87d94ab05a28b44536eb0cd61a9458e757a0ae7bb35e5ab5d27e03d08b996abd275928b29aad2eb0973d5bb0800e75ba8ca3e26bf62cbe8ea0fae8cca70a8#npm:4.3.4"],\ + ["debug", "virtual:feb0771c9f8eadaf509cfed41e14a8bebbea5442233275c1c87085111077a08ef71eb773b899665b154d8203a55a489610a54117ae059fce5f5b8b844493b1b1#npm:4.3.4"],\ ["globby", "npm:11.1.0"],\ ["is-glob", "npm:4.0.3"],\ ["semver", "npm:7.5.4"],\ @@ -708,7 +654,7 @@ const RAW_RUNTIME_STATE = ["@types/typescript", null],\ ["@typescript-eslint/types", "npm:5.62.0"],\ ["@typescript-eslint/visitor-keys", "npm:5.62.0"],\ - ["debug", "virtual:ced87d94ab05a28b44536eb0cd61a9458e757a0ae7bb35e5ab5d27e03d08b996abd275928b29aad2eb0973d5bb0800e75ba8ca3e26bf62cbe8ea0fae8cca70a8#npm:4.3.4"],\ + ["debug", "virtual:feb0771c9f8eadaf509cfed41e14a8bebbea5442233275c1c87085111077a08ef71eb773b899665b154d8203a55a489610a54117ae059fce5f5b8b844493b1b1#npm:4.3.4"],\ ["globby", "npm:11.1.0"],\ ["is-glob", "npm:4.0.3"],\ ["semver", "npm:7.5.4"],\ @@ -734,14 +680,14 @@ const RAW_RUNTIME_STATE = "packageLocation": "./.yarn/__virtual__/@typescript-eslint-utils-virtual-b6c32928e3/0/cache/@typescript-eslint-utils-npm-5.62.0-907f2d579e-15ef13e439.zip/node_modules/@typescript-eslint/utils/",\ "packageDependencies": [\ ["@typescript-eslint/utils", "virtual:89014fb2f72da20eb87d54c80bac37610b57a73485dee5ebf9333bf5c4bce0d972953cbf0f48420b275d3bc40f36aded8d47d2d24281f85e903e5d354ec64e4e#npm:5.62.0"],\ - ["@eslint-community/eslint-utils", "virtual:77fce3ec74d55c7e6791631c329cf3adde374e21e618e865127f72e63efeb3376dcf7fc8217de80f5a310e81c791a72e9d099b00fd3252d5653ff68dff50c2fa#npm:4.4.0"],\ + ["@eslint-community/eslint-utils", "virtual:e7f048a4398cf12bbd1cde95eff45a3327b9fe42e04c31ed99d0e926830d0b78ff78b511118c2bd3bc6add84782ab97a5b001e972071d6fdbfe85a86c150922a#npm:4.4.0"],\ ["@types/eslint", null],\ ["@types/json-schema", "npm:7.0.14"],\ ["@types/semver", "npm:7.5.4"],\ ["@typescript-eslint/scope-manager", "npm:5.62.0"],\ ["@typescript-eslint/types", "npm:5.62.0"],\ ["@typescript-eslint/typescript-estree", "virtual:b6c32928e3a73473744c61c91597c46acb3aac39cfd0cb6fa763edd86d59abe50465a1795d8d98162d97d00db3b3f55ab682576f5b7c142340f4654751eec0b2#npm:5.62.0"],\ - ["eslint", "npm:8.51.0"],\ + ["eslint", "npm:8.52.0"],\ ["eslint-scope", "npm:5.1.1"],\ ["semver", "npm:7.5.4"]\ ],\ @@ -758,7 +704,16 @@ const RAW_RUNTIME_STATE = "packageDependencies": [\ ["@typescript-eslint/visitor-keys", "npm:5.62.0"],\ ["@typescript-eslint/types", "npm:5.62.0"],\ - ["eslint-visitor-keys", "npm:3.4.2"]\ + ["eslint-visitor-keys", "npm:3.4.3"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["@ungap/structured-clone", [\ + ["npm:1.2.0", {\ + "packageLocation": "./.yarn/cache/@ungap-structured-clone-npm-1.2.0-648f0b82e0-c6fe89a505.zip/node_modules/@ungap/structured-clone/",\ + "packageDependencies": [\ + ["@ungap/structured-clone", "npm:1.2.0"]\ ],\ "linkType": "HARD"\ }]\ @@ -776,6 +731,36 @@ const RAW_RUNTIME_STATE = "linkType": "HARD"\ }]\ ]],\ + ["@vscode/vsce", [\ + ["npm:2.21.1", {\ + "packageLocation": "./.yarn/cache/@vscode-vsce-npm-2.21.1-51e6accf0d-145ca25f8a.zip/node_modules/@vscode/vsce/",\ + "packageDependencies": [\ + ["@vscode/vsce", "npm:2.21.1"],\ + ["azure-devops-node-api", "npm:11.2.0"],\ + ["chalk", "npm:2.4.2"],\ + ["cheerio", "npm:1.0.0-rc.12"],\ + ["commander", "npm:6.2.1"],\ + ["glob", "npm:7.2.3"],\ + ["hosted-git-info", "npm:4.1.0"],\ + ["jsonc-parser", "npm:3.2.0"],\ + ["keytar", "npm:7.9.0"],\ + ["leven", "npm:3.1.0"],\ + ["markdown-it", "npm:12.3.2"],\ + ["mime", "npm:1.6.0"],\ + ["minimatch", "npm:3.1.2"],\ + ["parse-semver", "npm:1.1.1"],\ + ["read", "npm:1.0.7"],\ + ["semver", "npm:7.5.4"],\ + ["tmp", "npm:0.2.1"],\ + ["typed-rest-client", "npm:1.8.11"],\ + ["url-join", "npm:4.0.1"],\ + ["xml2js", "npm:0.5.0"],\ + ["yauzl", "npm:2.10.0"],\ + ["yazl", "npm:2.5.1"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ ["@webassemblyjs/ast", [\ ["npm:1.11.6", {\ "packageLocation": "./.yarn/cache/@webassemblyjs-ast-npm-1.11.6-d3fd2bb49a-4c1303971c.zip/node_modules/@webassemblyjs/ast/",\ @@ -1114,7 +1099,7 @@ const RAW_RUNTIME_STATE = "packageLocation": "./.yarn/cache/agent-base-npm-6.0.2-428f325a93-21fb903e09.zip/node_modules/agent-base/",\ "packageDependencies": [\ ["agent-base", "npm:6.0.2"],\ - ["debug", "virtual:ced87d94ab05a28b44536eb0cd61a9458e757a0ae7bb35e5ab5d27e03d08b996abd275928b29aad2eb0973d5bb0800e75ba8ca3e26bf62cbe8ea0fae8cca70a8#npm:4.3.4"]\ + ["debug", "virtual:feb0771c9f8eadaf509cfed41e14a8bebbea5442233275c1c87085111077a08ef71eb773b899665b154d8203a55a489610a54117ae059fce5f5b8b844493b1b1#npm:4.3.4"]\ ],\ "linkType": "HARD"\ }]\ @@ -1201,6 +1186,14 @@ const RAW_RUNTIME_STATE = }]\ ]],\ ["ansi-styles", [\ + ["npm:3.2.1", {\ + "packageLocation": "./.yarn/cache/ansi-styles-npm-3.2.1-8cb8107983-d85ade01c1.zip/node_modules/ansi-styles/",\ + "packageDependencies": [\ + ["ansi-styles", "npm:3.2.1"],\ + ["color-convert", "npm:1.9.3"]\ + ],\ + "linkType": "HARD"\ + }],\ ["npm:4.3.0", {\ "packageLocation": "./.yarn/cache/ansi-styles-npm-4.3.0-245c7d42c7-b4494dfbfc.zip/node_modules/ansi-styles/",\ "packageDependencies": [\ @@ -1266,6 +1259,17 @@ const RAW_RUNTIME_STATE = "linkType": "HARD"\ }]\ ]],\ + ["azure-devops-node-api", [\ + ["npm:11.2.0", {\ + "packageLocation": "./.yarn/cache/azure-devops-node-api-npm-11.2.0-4f40e3421f-a01ee699e2.zip/node_modules/azure-devops-node-api/",\ + "packageDependencies": [\ + ["azure-devops-node-api", "npm:11.2.0"],\ + ["tunnel", "npm:0.0.6"],\ + ["typed-rest-client", "npm:1.8.11"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ ["balanced-match", [\ ["npm:1.0.2", {\ "packageLocation": "./.yarn/cache/balanced-match-npm-1.0.2-a53c126459-9706c088a2.zip/node_modules/balanced-match/",\ @@ -1275,6 +1279,15 @@ const RAW_RUNTIME_STATE = "linkType": "HARD"\ }]\ ]],\ + ["base64-js", [\ + ["npm:1.5.1", {\ + "packageLocation": "./.yarn/cache/base64-js-npm-1.5.1-b2f7275641-669632eb37.zip/node_modules/base64-js/",\ + "packageDependencies": [\ + ["base64-js", "npm:1.5.1"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ ["binary-extensions", [\ ["npm:2.2.0", {\ "packageLocation": "./.yarn/cache/binary-extensions-npm-2.2.0-180c33fec7-ccd267956c.zip/node_modules/binary-extensions/",\ @@ -1284,6 +1297,27 @@ const RAW_RUNTIME_STATE = "linkType": "HARD"\ }]\ ]],\ + ["bl", [\ + ["npm:4.1.0", {\ + "packageLocation": "./.yarn/cache/bl-npm-4.1.0-7f94cdcf3f-b7904e66ed.zip/node_modules/bl/",\ + "packageDependencies": [\ + ["bl", "npm:4.1.0"],\ + ["buffer", "npm:5.7.1"],\ + ["inherits", "npm:2.0.4"],\ + ["readable-stream", "npm:3.6.2"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["boolbase", [\ + ["npm:1.0.0", {\ + "packageLocation": "./.yarn/cache/boolbase-npm-1.0.0-965fe9af6d-3e25c80ef6.zip/node_modules/boolbase/",\ + "packageDependencies": [\ + ["boolbase", "npm:1.0.0"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ ["brace-expansion", [\ ["npm:1.1.11", {\ "packageLocation": "./.yarn/cache/brace-expansion-npm-1.1.11-fb95eb05ad-faf34a7bb0.zip/node_modules/brace-expansion/",\ @@ -1327,14 +1361,34 @@ const RAW_RUNTIME_STATE = "packageLocation": "./.yarn/cache/browserslist-npm-4.22.1-cccae6d74e-4a515168e0.zip/node_modules/browserslist/",\ "packageDependencies": [\ ["browserslist", "npm:4.22.1"],\ - ["caniuse-lite", "npm:1.0.30001551"],\ - ["electron-to-chromium", "npm:1.4.562"],\ + ["caniuse-lite", "npm:1.0.30001553"],\ + ["electron-to-chromium", "npm:1.4.565"],\ ["node-releases", "npm:2.0.13"],\ ["update-browserslist-db", "virtual:cccae6d74e613cbaceb4c608cb01004dea3f5ca235673f5c541d60f516ef320907d258256abf63eac9b8704e23cf5d52eb19f2a57a07471accc943ea645de308#npm:1.0.13"]\ ],\ "linkType": "HARD"\ }]\ ]],\ + ["buffer", [\ + ["npm:5.7.1", {\ + "packageLocation": "./.yarn/cache/buffer-npm-5.7.1-513ef8259e-997434d3c6.zip/node_modules/buffer/",\ + "packageDependencies": [\ + ["buffer", "npm:5.7.1"],\ + ["base64-js", "npm:1.5.1"],\ + ["ieee754", "npm:1.2.1"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["buffer-crc32", [\ + ["npm:0.2.13", {\ + "packageLocation": "./.yarn/cache/buffer-crc32-npm-0.2.13-c4b6fceac1-06252347ae.zip/node_modules/buffer-crc32/",\ + "packageDependencies": [\ + ["buffer-crc32", "npm:0.2.13"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ ["buffer-from", [\ ["npm:1.1.2", {\ "packageLocation": "./.yarn/cache/buffer-from-npm-1.1.2-03d2f20d7e-0448524a56.zip/node_modules/buffer-from/",\ @@ -1351,9 +1405,9 @@ const RAW_RUNTIME_STATE = ["cacache", "npm:17.1.4"],\ ["@npmcli/fs", "npm:3.1.0"],\ ["fs-minipass", "npm:3.0.3"],\ - ["glob", "npm:10.3.4"],\ + ["glob", "npm:10.3.10"],\ ["lru-cache", "npm:7.18.3"],\ - ["minipass", "npm:7.0.3"],\ + ["minipass", "npm:7.0.4"],\ ["minipass-collect", "npm:1.0.2"],\ ["minipass-flush", "npm:1.0.5"],\ ["minipass-pipeline", "npm:1.2.4"],\ @@ -1365,6 +1419,18 @@ const RAW_RUNTIME_STATE = "linkType": "HARD"\ }]\ ]],\ + ["call-bind", [\ + ["npm:1.0.5", {\ + "packageLocation": "./.yarn/cache/call-bind-npm-1.0.5-65600fae47-246d44db6e.zip/node_modules/call-bind/",\ + "packageDependencies": [\ + ["call-bind", "npm:1.0.5"],\ + ["function-bind", "npm:1.1.2"],\ + ["get-intrinsic", "npm:1.2.2"],\ + ["set-function-length", "npm:1.1.1"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ ["callsites", [\ ["npm:3.1.0", {\ "packageLocation": "./.yarn/cache/callsites-npm-3.1.0-268f989910-072d17b6ab.zip/node_modules/callsites/",\ @@ -1384,15 +1450,25 @@ const RAW_RUNTIME_STATE = }]\ ]],\ ["caniuse-lite", [\ - ["npm:1.0.30001551", {\ - "packageLocation": "./.yarn/cache/caniuse-lite-npm-1.0.30001551-10ef18828c-3ab880797f.zip/node_modules/caniuse-lite/",\ + ["npm:1.0.30001553", {\ + "packageLocation": "./.yarn/cache/caniuse-lite-npm-1.0.30001553-af33af7fcd-b14b512307.zip/node_modules/caniuse-lite/",\ "packageDependencies": [\ - ["caniuse-lite", "npm:1.0.30001551"]\ + ["caniuse-lite", "npm:1.0.30001553"]\ ],\ "linkType": "HARD"\ }]\ ]],\ ["chalk", [\ + ["npm:2.4.2", {\ + "packageLocation": "./.yarn/cache/chalk-npm-2.4.2-3ea16dd91e-3d1d103433.zip/node_modules/chalk/",\ + "packageDependencies": [\ + ["chalk", "npm:2.4.2"],\ + ["ansi-styles", "npm:3.2.1"],\ + ["escape-string-regexp", "npm:1.0.5"],\ + ["supports-color", "npm:5.5.0"]\ + ],\ + "linkType": "HARD"\ + }],\ ["npm:4.1.2", {\ "packageLocation": "./.yarn/cache/chalk-npm-4.1.2-ba8b67ab80-cb3f3e5949.zip/node_modules/chalk/",\ "packageDependencies": [\ @@ -1403,6 +1479,37 @@ const RAW_RUNTIME_STATE = "linkType": "HARD"\ }]\ ]],\ + ["cheerio", [\ + ["npm:1.0.0-rc.12", {\ + "packageLocation": "./.yarn/cache/cheerio-npm-1.0.0-rc.12-6785a97c2a-812fed61aa.zip/node_modules/cheerio/",\ + "packageDependencies": [\ + ["cheerio", "npm:1.0.0-rc.12"],\ + ["cheerio-select", "npm:2.1.0"],\ + ["dom-serializer", "npm:2.0.0"],\ + ["domhandler", "npm:5.0.3"],\ + ["domutils", "npm:3.1.0"],\ + ["htmlparser2", "npm:8.0.2"],\ + ["parse5", "npm:7.1.2"],\ + ["parse5-htmlparser2-tree-adapter", "npm:7.0.0"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["cheerio-select", [\ + ["npm:2.1.0", {\ + "packageLocation": "./.yarn/cache/cheerio-select-npm-2.1.0-e92bc2f296-b5d89208c2.zip/node_modules/cheerio-select/",\ + "packageDependencies": [\ + ["cheerio-select", "npm:2.1.0"],\ + ["boolbase", "npm:1.0.0"],\ + ["css-select", "npm:5.1.0"],\ + ["css-what", "npm:6.1.0"],\ + ["domelementtype", "npm:2.3.0"],\ + ["domhandler", "npm:5.0.3"],\ + ["domutils", "npm:3.1.0"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ ["chokidar", [\ ["npm:3.5.3", {\ "packageLocation": "./.yarn/cache/chokidar-npm-3.5.3-c5f9b0a56a-863e3ff78e.zip/node_modules/chokidar/",\ @@ -1421,6 +1528,13 @@ const RAW_RUNTIME_STATE = }]\ ]],\ ["chownr", [\ + ["npm:1.1.4", {\ + "packageLocation": "./.yarn/cache/chownr-npm-1.1.4-5bd400ab08-115648f8eb.zip/node_modules/chownr/",\ + "packageDependencies": [\ + ["chownr", "npm:1.1.4"]\ + ],\ + "linkType": "HARD"\ + }],\ ["npm:2.0.0", {\ "packageLocation": "./.yarn/cache/chownr-npm-2.0.0-638f1c9c61-c57cf9dd07.zip/node_modules/chownr/",\ "packageDependencies": [\ @@ -1472,6 +1586,14 @@ const RAW_RUNTIME_STATE = }]\ ]],\ ["color-convert", [\ + ["npm:1.9.3", {\ + "packageLocation": "./.yarn/cache/color-convert-npm-1.9.3-1fe690075e-ffa3190250.zip/node_modules/color-convert/",\ + "packageDependencies": [\ + ["color-convert", "npm:1.9.3"],\ + ["color-name", "npm:1.1.3"]\ + ],\ + "linkType": "HARD"\ + }],\ ["npm:2.0.1", {\ "packageLocation": "./.yarn/cache/color-convert-npm-2.0.1-79730e935b-fa00c91b43.zip/node_modules/color-convert/",\ "packageDependencies": [\ @@ -1482,6 +1604,13 @@ const RAW_RUNTIME_STATE = }]\ ]],\ ["color-name", [\ + ["npm:1.1.3", {\ + "packageLocation": "./.yarn/cache/color-name-npm-1.1.3-728b7b5d39-09c5d3e33d.zip/node_modules/color-name/",\ + "packageDependencies": [\ + ["color-name", "npm:1.1.3"]\ + ],\ + "linkType": "HARD"\ + }],\ ["npm:1.1.4", {\ "packageLocation": "./.yarn/cache/color-name-npm-1.1.4-025792b0ea-b044585952.zip/node_modules/color-name/",\ "packageDependencies": [\ @@ -1522,6 +1651,13 @@ const RAW_RUNTIME_STATE = ["commander", "npm:2.20.3"]\ ],\ "linkType": "HARD"\ + }],\ + ["npm:6.2.1", {\ + "packageLocation": "./.yarn/cache/commander-npm-6.2.1-d5b635f237-25b88c2efd.zip/node_modules/commander/",\ + "packageDependencies": [\ + ["commander", "npm:6.2.1"]\ + ],\ + "linkType": "HARD"\ }]\ ]],\ ["concat-map", [\ @@ -1563,6 +1699,29 @@ const RAW_RUNTIME_STATE = "linkType": "HARD"\ }]\ ]],\ + ["css-select", [\ + ["npm:5.1.0", {\ + "packageLocation": "./.yarn/cache/css-select-npm-5.1.0-9365a79de5-d486b1e7eb.zip/node_modules/css-select/",\ + "packageDependencies": [\ + ["css-select", "npm:5.1.0"],\ + ["boolbase", "npm:1.0.0"],\ + ["css-what", "npm:6.1.0"],\ + ["domhandler", "npm:5.0.3"],\ + ["domutils", "npm:3.1.0"],\ + ["nth-check", "npm:2.1.1"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["css-what", [\ + ["npm:6.1.0", {\ + "packageLocation": "./.yarn/cache/css-what-npm-6.1.0-57f751efbb-c67a3a2d0d.zip/node_modules/css-what/",\ + "packageDependencies": [\ + ["css-what", "npm:6.1.0"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ ["debug", [\ ["npm:4.3.4", {\ "packageLocation": "./.yarn/cache/debug-npm-4.3.4-4513954577-0073c3bcbd.zip/node_modules/debug/",\ @@ -1585,10 +1744,10 @@ const RAW_RUNTIME_STATE = ],\ "linkType": "HARD"\ }],\ - ["virtual:ced87d94ab05a28b44536eb0cd61a9458e757a0ae7bb35e5ab5d27e03d08b996abd275928b29aad2eb0973d5bb0800e75ba8ca3e26bf62cbe8ea0fae8cca70a8#npm:4.3.4", {\ - "packageLocation": "./.yarn/__virtual__/debug-virtual-023f479948/0/cache/debug-npm-4.3.4-4513954577-0073c3bcbd.zip/node_modules/debug/",\ + ["virtual:feb0771c9f8eadaf509cfed41e14a8bebbea5442233275c1c87085111077a08ef71eb773b899665b154d8203a55a489610a54117ae059fce5f5b8b844493b1b1#npm:4.3.4", {\ + "packageLocation": "./.yarn/__virtual__/debug-virtual-954df360d3/0/cache/debug-npm-4.3.4-4513954577-0073c3bcbd.zip/node_modules/debug/",\ "packageDependencies": [\ - ["debug", "virtual:ced87d94ab05a28b44536eb0cd61a9458e757a0ae7bb35e5ab5d27e03d08b996abd275928b29aad2eb0973d5bb0800e75ba8ca3e26bf62cbe8ea0fae8cca70a8#npm:4.3.4"],\ + ["debug", "virtual:feb0771c9f8eadaf509cfed41e14a8bebbea5442233275c1c87085111077a08ef71eb773b899665b154d8203a55a489610a54117ae059fce5f5b8b844493b1b1#npm:4.3.4"],\ ["@types/supports-color", null],\ ["ms", "npm:2.1.2"],\ ["supports-color", null]\ @@ -1609,6 +1768,25 @@ const RAW_RUNTIME_STATE = "linkType": "HARD"\ }]\ ]],\ + ["decompress-response", [\ + ["npm:6.0.0", {\ + "packageLocation": "./.yarn/cache/decompress-response-npm-6.0.0-359de2878c-d377cf47e0.zip/node_modules/decompress-response/",\ + "packageDependencies": [\ + ["decompress-response", "npm:6.0.0"],\ + ["mimic-response", "npm:3.1.0"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["deep-extend", [\ + ["npm:0.6.0", {\ + "packageLocation": "./.yarn/cache/deep-extend-npm-0.6.0-e182924219-7be7e5a8d4.zip/node_modules/deep-extend/",\ + "packageDependencies": [\ + ["deep-extend", "npm:0.6.0"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ ["deep-is", [\ ["npm:0.1.4", {\ "packageLocation": "./.yarn/cache/deep-is-npm-0.1.4-88938b5a67-ec12d074ae.zip/node_modules/deep-is/",\ @@ -1618,6 +1796,18 @@ const RAW_RUNTIME_STATE = "linkType": "HARD"\ }]\ ]],\ + ["define-data-property", [\ + ["npm:1.1.1", {\ + "packageLocation": "./.yarn/cache/define-data-property-npm-1.1.1-2b5156d112-5573c8df96.zip/node_modules/define-data-property/",\ + "packageDependencies": [\ + ["define-data-property", "npm:1.1.1"],\ + ["get-intrinsic", "npm:1.2.2"],\ + ["gopd", "npm:1.0.1"],\ + ["has-property-descriptors", "npm:1.0.1"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ ["delegates", [\ ["npm:1.0.0", {\ "packageLocation": "./.yarn/cache/delegates-npm-1.0.0-9b1942d75f-a51744d9b5.zip/node_modules/delegates/",\ @@ -1627,6 +1817,15 @@ const RAW_RUNTIME_STATE = "linkType": "HARD"\ }]\ ]],\ + ["detect-libc", [\ + ["npm:2.0.2", {\ + "packageLocation": "./.yarn/cache/detect-libc-npm-2.0.2-03afa59137-6118f30c0c.zip/node_modules/detect-libc/",\ + "packageDependencies": [\ + ["detect-libc", "npm:2.0.2"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ ["diff", [\ ["npm:5.0.0", {\ "packageLocation": "./.yarn/cache/diff-npm-5.0.0-ad6900db18-4a179a75b1.zip/node_modules/diff/",\ @@ -1656,6 +1855,49 @@ const RAW_RUNTIME_STATE = "linkType": "HARD"\ }]\ ]],\ + ["dom-serializer", [\ + ["npm:2.0.0", {\ + "packageLocation": "./.yarn/cache/dom-serializer-npm-2.0.0-378ebc7200-e3bf9027a6.zip/node_modules/dom-serializer/",\ + "packageDependencies": [\ + ["dom-serializer", "npm:2.0.0"],\ + ["domelementtype", "npm:2.3.0"],\ + ["domhandler", "npm:5.0.3"],\ + ["entities", "npm:4.5.0"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["domelementtype", [\ + ["npm:2.3.0", {\ + "packageLocation": "./.yarn/cache/domelementtype-npm-2.3.0-02de7cbfba-ee837a318f.zip/node_modules/domelementtype/",\ + "packageDependencies": [\ + ["domelementtype", "npm:2.3.0"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["domhandler", [\ + ["npm:5.0.3", {\ + "packageLocation": "./.yarn/cache/domhandler-npm-5.0.3-3ede73dc10-809b805a50.zip/node_modules/domhandler/",\ + "packageDependencies": [\ + ["domhandler", "npm:5.0.3"],\ + ["domelementtype", "npm:2.3.0"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["domutils", [\ + ["npm:3.1.0", {\ + "packageLocation": "./.yarn/cache/domutils-npm-3.1.0-66c92ef7eb-9a169a6e57.zip/node_modules/domutils/",\ + "packageDependencies": [\ + ["domutils", "npm:3.1.0"],\ + ["dom-serializer", "npm:2.0.0"],\ + ["domelementtype", "npm:2.3.0"],\ + ["domhandler", "npm:5.0.3"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ ["eastasianwidth", [\ ["npm:0.2.0", {\ "packageLocation": "./.yarn/cache/eastasianwidth-npm-0.2.0-c37eb16bd1-9b1d3e1bae.zip/node_modules/eastasianwidth/",\ @@ -1666,10 +1908,10 @@ const RAW_RUNTIME_STATE = }]\ ]],\ ["electron-to-chromium", [\ - ["npm:1.4.562", {\ - "packageLocation": "./.yarn/cache/electron-to-chromium-npm-1.4.562-385fc13106-9ccf9cc6b1.zip/node_modules/electron-to-chromium/",\ + ["npm:1.4.565", {\ + "packageLocation": "./.yarn/cache/electron-to-chromium-npm-1.4.565-e46f4c4b3f-caee9af984.zip/node_modules/electron-to-chromium/",\ "packageDependencies": [\ - ["electron-to-chromium", "npm:1.4.562"]\ + ["electron-to-chromium", "npm:1.4.565"]\ ],\ "linkType": "HARD"\ }]\ @@ -1700,6 +1942,16 @@ const RAW_RUNTIME_STATE = "linkType": "HARD"\ }]\ ]],\ + ["end-of-stream", [\ + ["npm:1.4.4", {\ + "packageLocation": "./.yarn/cache/end-of-stream-npm-1.4.4-497fc6dee1-530a5a5a1e.zip/node_modules/end-of-stream/",\ + "packageDependencies": [\ + ["end-of-stream", "npm:1.4.4"],\ + ["once", "npm:1.4.0"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ ["enhanced-resolve", [\ ["npm:5.15.0", {\ "packageLocation": "./.yarn/cache/enhanced-resolve-npm-5.15.0-16eb7ddef9-180c3f2706.zip/node_modules/enhanced-resolve/",\ @@ -1711,6 +1963,22 @@ const RAW_RUNTIME_STATE = "linkType": "HARD"\ }]\ ]],\ + ["entities", [\ + ["npm:2.1.0", {\ + "packageLocation": "./.yarn/cache/entities-npm-2.1.0-b27b8aebc6-fe71642e42.zip/node_modules/entities/",\ + "packageDependencies": [\ + ["entities", "npm:2.1.0"]\ + ],\ + "linkType": "HARD"\ + }],\ + ["npm:4.5.0", {\ + "packageLocation": "./.yarn/cache/entities-npm-4.5.0-7cdb83b832-ede2a35c9b.zip/node_modules/entities/",\ + "packageDependencies": [\ + ["entities", "npm:4.5.0"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ ["env-paths", [\ ["npm:2.2.1", {\ "packageLocation": "./.yarn/cache/env-paths-npm-2.2.1-7c7577428c-65b5df55a8.zip/node_modules/env-paths/",\ @@ -1757,6 +2025,13 @@ const RAW_RUNTIME_STATE = }]\ ]],\ ["escape-string-regexp", [\ + ["npm:1.0.5", {\ + "packageLocation": "./.yarn/cache/escape-string-regexp-npm-1.0.5-3284de402f-6092fda75c.zip/node_modules/escape-string-regexp/",\ + "packageDependencies": [\ + ["escape-string-regexp", "npm:1.0.5"]\ + ],\ + "linkType": "HARD"\ + }],\ ["npm:4.0.0", {\ "packageLocation": "./.yarn/cache/escape-string-regexp-npm-4.0.0-4b531d8d59-98b48897d9.zip/node_modules/escape-string-regexp/",\ "packageDependencies": [\ @@ -1766,65 +2041,22 @@ const RAW_RUNTIME_STATE = }]\ ]],\ ["eslint", [\ - ["npm:8.46.0", {\ - "packageLocation": "./.yarn/cache/eslint-npm-8.46.0-dc7af99e61-576f680afe.zip/node_modules/eslint/",\ - "packageDependencies": [\ - ["eslint", "npm:8.46.0"],\ - ["@eslint-community/eslint-utils", "virtual:dc7af99e618232ac0e2a751f560e2225037bf809144a4cc05369d5312b9d24061282984c0c0c6c5c199f3a0663f91f11c21afb60016655f472fa253e0b676e3b#npm:4.4.0"],\ - ["@eslint-community/regexpp", "npm:4.6.2"],\ - ["@eslint/eslintrc", "npm:2.1.1"],\ - ["@eslint/js", "npm:8.46.0"],\ - ["@humanwhocodes/config-array", "npm:0.11.10"],\ - ["@humanwhocodes/module-importer", "npm:1.0.1"],\ - ["@nodelib/fs.walk", "npm:1.2.8"],\ - ["ajv", "npm:6.12.6"],\ - ["chalk", "npm:4.1.2"],\ - ["cross-spawn", "npm:7.0.3"],\ - ["debug", "virtual:ced87d94ab05a28b44536eb0cd61a9458e757a0ae7bb35e5ab5d27e03d08b996abd275928b29aad2eb0973d5bb0800e75ba8ca3e26bf62cbe8ea0fae8cca70a8#npm:4.3.4"],\ - ["doctrine", "npm:3.0.0"],\ - ["escape-string-regexp", "npm:4.0.0"],\ - ["eslint-scope", "npm:7.2.2"],\ - ["eslint-visitor-keys", "npm:3.4.2"],\ - ["espree", "npm:9.6.1"],\ - ["esquery", "npm:1.5.0"],\ - ["esutils", "npm:2.0.3"],\ - ["fast-deep-equal", "npm:3.1.3"],\ - ["file-entry-cache", "npm:6.0.1"],\ - ["find-up", "npm:5.0.0"],\ - ["glob-parent", "npm:6.0.2"],\ - ["globals", "npm:13.20.0"],\ - ["graphemer", "npm:1.4.0"],\ - ["ignore", "npm:5.2.4"],\ - ["imurmurhash", "npm:0.1.4"],\ - ["is-glob", "npm:4.0.3"],\ - ["is-path-inside", "npm:3.0.3"],\ - ["js-yaml", "npm:4.1.0"],\ - ["json-stable-stringify-without-jsonify", "npm:1.0.1"],\ - ["levn", "npm:0.4.1"],\ - ["lodash.merge", "npm:4.6.2"],\ - ["minimatch", "npm:3.1.2"],\ - ["natural-compare", "npm:1.4.0"],\ - ["optionator", "npm:0.9.3"],\ - ["strip-ansi", "npm:6.0.1"],\ - ["text-table", "npm:0.2.0"]\ - ],\ - "linkType": "HARD"\ - }],\ - ["npm:8.51.0", {\ - "packageLocation": "./.yarn/cache/eslint-npm-8.51.0-77fce3ec74-1f3720dd2a.zip/node_modules/eslint/",\ + ["npm:8.52.0", {\ + "packageLocation": "./.yarn/cache/eslint-npm-8.52.0-e7f048a439-01784ab153.zip/node_modules/eslint/",\ "packageDependencies": [\ - ["eslint", "npm:8.51.0"],\ - ["@eslint-community/eslint-utils", "virtual:77fce3ec74d55c7e6791631c329cf3adde374e21e618e865127f72e63efeb3376dcf7fc8217de80f5a310e81c791a72e9d099b00fd3252d5653ff68dff50c2fa#npm:4.4.0"],\ - ["@eslint-community/regexpp", "npm:4.6.2"],\ + ["eslint", "npm:8.52.0"],\ + ["@eslint-community/eslint-utils", "virtual:e7f048a4398cf12bbd1cde95eff45a3327b9fe42e04c31ed99d0e926830d0b78ff78b511118c2bd3bc6add84782ab97a5b001e972071d6fdbfe85a86c150922a#npm:4.4.0"],\ + ["@eslint-community/regexpp", "npm:4.9.1"],\ ["@eslint/eslintrc", "npm:2.1.2"],\ - ["@eslint/js", "npm:8.51.0"],\ - ["@humanwhocodes/config-array", "npm:0.11.11"],\ + ["@eslint/js", "npm:8.52.0"],\ + ["@humanwhocodes/config-array", "npm:0.11.13"],\ ["@humanwhocodes/module-importer", "npm:1.0.1"],\ ["@nodelib/fs.walk", "npm:1.2.8"],\ + ["@ungap/structured-clone", "npm:1.2.0"],\ ["ajv", "npm:6.12.6"],\ ["chalk", "npm:4.1.2"],\ ["cross-spawn", "npm:7.0.3"],\ - ["debug", "virtual:ced87d94ab05a28b44536eb0cd61a9458e757a0ae7bb35e5ab5d27e03d08b996abd275928b29aad2eb0973d5bb0800e75ba8ca3e26bf62cbe8ea0fae8cca70a8#npm:4.3.4"],\ + ["debug", "virtual:feb0771c9f8eadaf509cfed41e14a8bebbea5442233275c1c87085111077a08ef71eb773b899665b154d8203a55a489610a54117ae059fce5f5b8b844493b1b1#npm:4.3.4"],\ ["doctrine", "npm:3.0.0"],\ ["escape-string-regexp", "npm:4.0.0"],\ ["eslint-scope", "npm:7.2.2"],\ @@ -1836,7 +2068,7 @@ const RAW_RUNTIME_STATE = ["file-entry-cache", "npm:6.0.1"],\ ["find-up", "npm:5.0.0"],\ ["glob-parent", "npm:6.0.2"],\ - ["globals", "npm:13.20.0"],\ + ["globals", "npm:13.23.0"],\ ["graphemer", "npm:1.4.0"],\ ["ignore", "npm:5.2.4"],\ ["imurmurhash", "npm:0.1.4"],\ @@ -1876,13 +2108,6 @@ const RAW_RUNTIME_STATE = }]\ ]],\ ["eslint-visitor-keys", [\ - ["npm:3.4.2", {\ - "packageLocation": "./.yarn/cache/eslint-visitor-keys-npm-3.4.2-304459f972-04e7e9d546.zip/node_modules/eslint-visitor-keys/",\ - "packageDependencies": [\ - ["eslint-visitor-keys", "npm:3.4.2"]\ - ],\ - "linkType": "HARD"\ - }],\ ["npm:3.4.3", {\ "packageLocation": "./.yarn/cache/eslint-visitor-keys-npm-3.4.3-a356ac7e46-3f357c554a.zip/node_modules/eslint-visitor-keys/",\ "packageDependencies": [\ @@ -1898,7 +2123,7 @@ const RAW_RUNTIME_STATE = ["espree", "npm:9.6.1"],\ ["acorn", "npm:8.10.0"],\ ["acorn-jsx", "virtual:a50722a5a9326b6a5f12350c494c4db3aa0f4caeac45e3e9e5fe071da20014ecfe738fe2ebe2c9c98abae81a4ea86b42f56d776b3bd5ec37f9ad3670c242b242#npm:5.3.2"],\ - ["eslint-visitor-keys", "npm:3.4.2"]\ + ["eslint-visitor-keys", "npm:3.4.3"]\ ],\ "linkType": "HARD"\ }]\ @@ -1957,6 +2182,15 @@ const RAW_RUNTIME_STATE = "linkType": "HARD"\ }]\ ]],\ + ["expand-template", [\ + ["npm:2.0.3", {\ + "packageLocation": "./.yarn/cache/expand-template-npm-2.0.3-80de959306-588c198472.zip/node_modules/expand-template/",\ + "packageDependencies": [\ + ["expand-template", "npm:2.0.3"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ ["exponential-backoff", [\ ["npm:3.1.1", {\ "packageLocation": "./.yarn/cache/exponential-backoff-npm-3.1.1-04df458b30-2d9bbb6473.zip/node_modules/exponential-backoff/",\ @@ -2026,12 +2260,22 @@ const RAW_RUNTIME_STATE = "linkType": "HARD"\ }]\ ]],\ + ["fd-slicer", [\ + ["npm:1.1.0", {\ + "packageLocation": "./.yarn/cache/fd-slicer-npm-1.1.0-3cade0050a-db3e34fa48.zip/node_modules/fd-slicer/",\ + "packageDependencies": [\ + ["fd-slicer", "npm:1.1.0"],\ + ["pend", "npm:1.2.0"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ ["file-entry-cache", [\ ["npm:6.0.1", {\ "packageLocation": "./.yarn/cache/file-entry-cache-npm-6.0.1-31965cf0af-099bb9d4ab.zip/node_modules/file-entry-cache/",\ "packageDependencies": [\ ["file-entry-cache", "npm:6.0.1"],\ - ["flat-cache", "npm:3.0.4"]\ + ["flat-cache", "npm:3.1.1"]\ ],\ "linkType": "HARD"\ }]\ @@ -2076,21 +2320,22 @@ const RAW_RUNTIME_STATE = }]\ ]],\ ["flat-cache", [\ - ["npm:3.0.4", {\ - "packageLocation": "./.yarn/cache/flat-cache-npm-3.0.4-ee77e5911e-9fe5d0cb97.zip/node_modules/flat-cache/",\ + ["npm:3.1.1", {\ + "packageLocation": "./.yarn/cache/flat-cache-npm-3.1.1-b79e22b54f-04b57c7cb4.zip/node_modules/flat-cache/",\ "packageDependencies": [\ - ["flat-cache", "npm:3.0.4"],\ - ["flatted", "npm:3.2.7"],\ + ["flat-cache", "npm:3.1.1"],\ + ["flatted", "npm:3.2.9"],\ + ["keyv", "npm:4.5.4"],\ ["rimraf", "npm:3.0.2"]\ ],\ "linkType": "HARD"\ }]\ ]],\ ["flatted", [\ - ["npm:3.2.7", {\ - "packageLocation": "./.yarn/cache/flatted-npm-3.2.7-0da10b7c56-427633049d.zip/node_modules/flatted/",\ + ["npm:3.2.9", {\ + "packageLocation": "./.yarn/cache/flatted-npm-3.2.9-0462256d3c-dc2b89e46a.zip/node_modules/flatted/",\ "packageDependencies": [\ - ["flatted", "npm:3.2.7"]\ + ["flatted", "npm:3.2.9"]\ ],\ "linkType": "HARD"\ }]\ @@ -2106,6 +2351,15 @@ const RAW_RUNTIME_STATE = "linkType": "HARD"\ }]\ ]],\ + ["fs-constants", [\ + ["npm:1.0.0", {\ + "packageLocation": "./.yarn/cache/fs-constants-npm-1.0.0-59576b2177-18f5b71837.zip/node_modules/fs-constants/",\ + "packageDependencies": [\ + ["fs-constants", "npm:1.0.0"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ ["fs-minipass", [\ ["npm:2.1.0", {\ "packageLocation": "./.yarn/cache/fs-minipass-npm-2.1.0-501ef87306-03191781e9.zip/node_modules/fs-minipass/",\ @@ -2119,7 +2373,7 @@ const RAW_RUNTIME_STATE = "packageLocation": "./.yarn/cache/fs-minipass-npm-3.0.3-d148d6ac19-af143246cf.zip/node_modules/fs-minipass/",\ "packageDependencies": [\ ["fs-minipass", "npm:3.0.3"],\ - ["minipass", "npm:7.0.3"]\ + ["minipass", "npm:7.0.4"]\ ],\ "linkType": "HARD"\ }]\ @@ -2143,6 +2397,15 @@ const RAW_RUNTIME_STATE = "linkType": "HARD"\ }]\ ]],\ + ["function-bind", [\ + ["npm:1.1.2", {\ + "packageLocation": "./.yarn/cache/function-bind-npm-1.1.2-7a55be9b03-185e20d20f.zip/node_modules/function-bind/",\ + "packageDependencies": [\ + ["function-bind", "npm:1.1.2"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ ["gauge", [\ ["npm:4.0.4", {\ "packageLocation": "./.yarn/cache/gauge-npm-4.0.4-8f878385e9-09535dd53b.zip/node_modules/gauge/",\ @@ -2169,15 +2432,37 @@ const RAW_RUNTIME_STATE = "linkType": "HARD"\ }]\ ]],\ + ["get-intrinsic", [\ + ["npm:1.2.2", {\ + "packageLocation": "./.yarn/cache/get-intrinsic-npm-1.2.2-3f446d8847-aa96db4f80.zip/node_modules/get-intrinsic/",\ + "packageDependencies": [\ + ["get-intrinsic", "npm:1.2.2"],\ + ["function-bind", "npm:1.1.2"],\ + ["has-proto", "npm:1.0.1"],\ + ["has-symbols", "npm:1.0.3"],\ + ["hasown", "npm:2.0.0"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["github-from-package", [\ + ["npm:0.0.0", {\ + "packageLocation": "./.yarn/cache/github-from-package-npm-0.0.0-519f80c9a1-2a091ba07f.zip/node_modules/github-from-package/",\ + "packageDependencies": [\ + ["github-from-package", "npm:0.0.0"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ ["glob", [\ - ["npm:10.3.4", {\ - "packageLocation": "./.yarn/cache/glob-npm-10.3.4-f58cd31f55-6375721bcd.zip/node_modules/glob/",\ + ["npm:10.3.10", {\ + "packageLocation": "./.yarn/cache/glob-npm-10.3.10-da1ef8b112-38bdb2c9ce.zip/node_modules/glob/",\ "packageDependencies": [\ - ["glob", "npm:10.3.4"],\ + ["glob", "npm:10.3.10"],\ ["foreground-child", "npm:3.1.1"],\ - ["jackspeak", "npm:2.3.3"],\ + ["jackspeak", "npm:2.3.6"],\ ["minimatch", "npm:9.0.3"],\ - ["minipass", "npm:7.0.3"],\ + ["minipass", "npm:7.0.4"],\ ["path-scurry", "npm:1.10.1"]\ ],\ "linkType": "HARD"\ @@ -2249,10 +2534,10 @@ const RAW_RUNTIME_STATE = }]\ ]],\ ["globals", [\ - ["npm:13.20.0", {\ - "packageLocation": "./.yarn/cache/globals-npm-13.20.0-4565a722e7-9df85cde2f.zip/node_modules/globals/",\ + ["npm:13.23.0", {\ + "packageLocation": "./.yarn/cache/globals-npm-13.23.0-7f02426fd5-bf6a8616f4.zip/node_modules/globals/",\ "packageDependencies": [\ - ["globals", "npm:13.20.0"],\ + ["globals", "npm:13.23.0"],\ ["type-fest", "npm:0.20.2"]\ ],\ "linkType": "HARD"\ @@ -2273,6 +2558,16 @@ const RAW_RUNTIME_STATE = "linkType": "HARD"\ }]\ ]],\ + ["gopd", [\ + ["npm:1.0.1", {\ + "packageLocation": "./.yarn/cache/gopd-npm-1.0.1-10c1d0b534-5fbc7ad57b.zip/node_modules/gopd/",\ + "packageDependencies": [\ + ["gopd", "npm:1.0.1"],\ + ["get-intrinsic", "npm:1.2.2"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ ["graceful-fs", [\ ["npm:4.2.11", {\ "packageLocation": "./.yarn/cache/graceful-fs-npm-4.2.11-24bb648a68-bf152d0ed1.zip/node_modules/graceful-fs/",\ @@ -2291,16 +2586,14 @@ const RAW_RUNTIME_STATE = "linkType": "HARD"\ }]\ ]],\ - ["has", [\ - ["npm:1.0.4", {\ - "packageLocation": "./.yarn/cache/has-npm-1.0.4-0dc267d5e0-c245f332fe.zip/node_modules/has/",\ + ["has-flag", [\ + ["npm:3.0.0", {\ + "packageLocation": "./.yarn/cache/has-flag-npm-3.0.0-16ac11fe05-4a15638b45.zip/node_modules/has-flag/",\ "packageDependencies": [\ - ["has", "npm:1.0.4"]\ + ["has-flag", "npm:3.0.0"]\ ],\ "linkType": "HARD"\ - }]\ - ]],\ - ["has-flag", [\ + }],\ ["npm:4.0.0", {\ "packageLocation": "./.yarn/cache/has-flag-npm-4.0.0-32af9f0536-261a135703.zip/node_modules/has-flag/",\ "packageDependencies": [\ @@ -2309,6 +2602,34 @@ const RAW_RUNTIME_STATE = "linkType": "HARD"\ }]\ ]],\ + ["has-property-descriptors", [\ + ["npm:1.0.1", {\ + "packageLocation": "./.yarn/cache/has-property-descriptors-npm-1.0.1-61cd62fce3-21a47bb080.zip/node_modules/has-property-descriptors/",\ + "packageDependencies": [\ + ["has-property-descriptors", "npm:1.0.1"],\ + ["get-intrinsic", "npm:1.2.2"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["has-proto", [\ + ["npm:1.0.1", {\ + "packageLocation": "./.yarn/cache/has-proto-npm-1.0.1-631ea9d820-eab2ab0ed1.zip/node_modules/has-proto/",\ + "packageDependencies": [\ + ["has-proto", "npm:1.0.1"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["has-symbols", [\ + ["npm:1.0.3", {\ + "packageLocation": "./.yarn/cache/has-symbols-npm-1.0.3-1986bff2c4-464f97a820.zip/node_modules/has-symbols/",\ + "packageDependencies": [\ + ["has-symbols", "npm:1.0.3"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ ["has-unicode", [\ ["npm:2.0.1", {\ "packageLocation": "./.yarn/cache/has-unicode-npm-2.0.1-893adb4747-041b4293ad.zip/node_modules/has-unicode/",\ @@ -2318,6 +2639,16 @@ const RAW_RUNTIME_STATE = "linkType": "HARD"\ }]\ ]],\ + ["hasown", [\ + ["npm:2.0.0", {\ + "packageLocation": "./.yarn/cache/hasown-npm-2.0.0-78b794ceef-c330f8d93f.zip/node_modules/hasown/",\ + "packageDependencies": [\ + ["hasown", "npm:2.0.0"],\ + ["function-bind", "npm:1.1.2"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ ["he", [\ ["npm:1.2.0", {\ "packageLocation": "./.yarn/cache/he-npm-1.2.0-3b73a2ff07-d09b2243da.zip/node_modules/he/",\ @@ -2327,6 +2658,29 @@ const RAW_RUNTIME_STATE = "linkType": "HARD"\ }]\ ]],\ + ["hosted-git-info", [\ + ["npm:4.1.0", {\ + "packageLocation": "./.yarn/cache/hosted-git-info-npm-4.1.0-4efcdf8fd3-4dc67022b7.zip/node_modules/hosted-git-info/",\ + "packageDependencies": [\ + ["hosted-git-info", "npm:4.1.0"],\ + ["lru-cache", "npm:6.0.0"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["htmlparser2", [\ + ["npm:8.0.2", {\ + "packageLocation": "./.yarn/cache/htmlparser2-npm-8.0.2-5d9f901bb6-ea5512956e.zip/node_modules/htmlparser2/",\ + "packageDependencies": [\ + ["htmlparser2", "npm:8.0.2"],\ + ["domelementtype", "npm:2.3.0"],\ + ["domhandler", "npm:5.0.3"],\ + ["domutils", "npm:3.1.0"],\ + ["entities", "npm:4.5.0"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ ["http-cache-semantics", [\ ["npm:4.1.1", {\ "packageLocation": "./.yarn/cache/http-cache-semantics-npm-4.1.1-1120131375-362d5ed66b.zip/node_modules/http-cache-semantics/",\ @@ -2343,7 +2697,7 @@ const RAW_RUNTIME_STATE = ["http-proxy-agent", "npm:4.0.1"],\ ["@tootallnate/once", "npm:1.1.2"],\ ["agent-base", "npm:6.0.2"],\ - ["debug", "virtual:ced87d94ab05a28b44536eb0cd61a9458e757a0ae7bb35e5ab5d27e03d08b996abd275928b29aad2eb0973d5bb0800e75ba8ca3e26bf62cbe8ea0fae8cca70a8#npm:4.3.4"]\ + ["debug", "virtual:feb0771c9f8eadaf509cfed41e14a8bebbea5442233275c1c87085111077a08ef71eb773b899665b154d8203a55a489610a54117ae059fce5f5b8b844493b1b1#npm:4.3.4"]\ ],\ "linkType": "HARD"\ }],\ @@ -2353,7 +2707,7 @@ const RAW_RUNTIME_STATE = ["http-proxy-agent", "npm:5.0.0"],\ ["@tootallnate/once", "npm:2.0.0"],\ ["agent-base", "npm:6.0.2"],\ - ["debug", "virtual:ced87d94ab05a28b44536eb0cd61a9458e757a0ae7bb35e5ab5d27e03d08b996abd275928b29aad2eb0973d5bb0800e75ba8ca3e26bf62cbe8ea0fae8cca70a8#npm:4.3.4"]\ + ["debug", "virtual:feb0771c9f8eadaf509cfed41e14a8bebbea5442233275c1c87085111077a08ef71eb773b899665b154d8203a55a489610a54117ae059fce5f5b8b844493b1b1#npm:4.3.4"]\ ],\ "linkType": "HARD"\ }]\ @@ -2364,7 +2718,7 @@ const RAW_RUNTIME_STATE = "packageDependencies": [\ ["https-proxy-agent", "npm:5.0.1"],\ ["agent-base", "npm:6.0.2"],\ - ["debug", "virtual:ced87d94ab05a28b44536eb0cd61a9458e757a0ae7bb35e5ab5d27e03d08b996abd275928b29aad2eb0973d5bb0800e75ba8ca3e26bf62cbe8ea0fae8cca70a8#npm:4.3.4"]\ + ["debug", "virtual:feb0771c9f8eadaf509cfed41e14a8bebbea5442233275c1c87085111077a08ef71eb773b899665b154d8203a55a489610a54117ae059fce5f5b8b844493b1b1#npm:4.3.4"]\ ],\ "linkType": "HARD"\ }]\ @@ -2398,6 +2752,15 @@ const RAW_RUNTIME_STATE = "linkType": "HARD"\ }]\ ]],\ + ["ieee754", [\ + ["npm:1.2.1", {\ + "packageLocation": "./.yarn/cache/ieee754-npm-1.2.1-fb63b3caeb-d9f2557a59.zip/node_modules/ieee754/",\ + "packageDependencies": [\ + ["ieee754", "npm:1.2.1"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ ["ignore", [\ ["npm:5.2.4", {\ "packageLocation": "./.yarn/cache/ignore-npm-5.2.4-fbe6e989e5-4f7caf5d20.zip/node_modules/ignore/",\ @@ -2476,6 +2839,15 @@ const RAW_RUNTIME_STATE = "linkType": "HARD"\ }]\ ]],\ + ["ini", [\ + ["npm:1.3.8", {\ + "packageLocation": "./.yarn/cache/ini-npm-1.3.8-fb5040b4c0-314ae176e8.zip/node_modules/ini/",\ + "packageDependencies": [\ + ["ini", "npm:1.3.8"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ ["interpret", [\ ["npm:3.1.1", {\ "packageLocation": "./.yarn/cache/interpret-npm-3.1.1-715bac2bd7-bc9e111269.zip/node_modules/interpret/",\ @@ -2505,11 +2877,11 @@ const RAW_RUNTIME_STATE = }]\ ]],\ ["is-core-module", [\ - ["npm:2.13.0", {\ - "packageLocation": "./.yarn/cache/is-core-module-npm-2.13.0-e444c50225-55ccb5ccd2.zip/node_modules/is-core-module/",\ + ["npm:2.13.1", {\ + "packageLocation": "./.yarn/cache/is-core-module-npm-2.13.1-36e17434f9-d53bd0cc24.zip/node_modules/is-core-module/",\ "packageDependencies": [\ - ["is-core-module", "npm:2.13.0"],\ - ["has", "npm:1.0.4"]\ + ["is-core-module", "npm:2.13.1"],\ + ["hasown", "npm:2.0.0"]\ ],\ "linkType": "HARD"\ }]\ @@ -2625,10 +2997,10 @@ const RAW_RUNTIME_STATE = }]\ ]],\ ["jackspeak", [\ - ["npm:2.3.3", {\ - "packageLocation": "./.yarn/cache/jackspeak-npm-2.3.3-755684cc60-a4c7c1a3ff.zip/node_modules/jackspeak/",\ + ["npm:2.3.6", {\ + "packageLocation": "./.yarn/cache/jackspeak-npm-2.3.6-42e1233172-6e6490d676.zip/node_modules/jackspeak/",\ "packageDependencies": [\ - ["jackspeak", "npm:2.3.3"],\ + ["jackspeak", "npm:2.3.6"],\ ["@isaacs/cliui", "npm:8.0.2"],\ ["@pkgjs/parseargs", "npm:0.11.0"]\ ],\ @@ -2657,6 +3029,15 @@ const RAW_RUNTIME_STATE = "linkType": "HARD"\ }]\ ]],\ + ["json-buffer", [\ + ["npm:3.0.1", {\ + "packageLocation": "./.yarn/cache/json-buffer-npm-3.0.1-f8f6d20603-8287615452.zip/node_modules/json-buffer/",\ + "packageDependencies": [\ + ["json-buffer", "npm:3.0.1"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ ["json-parse-even-better-errors", [\ ["npm:2.3.1", {\ "packageLocation": "./.yarn/cache/json-parse-even-better-errors-npm-2.3.1-144d62256e-5f3a99009e.zip/node_modules/json-parse-even-better-errors/",\ @@ -2684,6 +3065,15 @@ const RAW_RUNTIME_STATE = "linkType": "HARD"\ }]\ ]],\ + ["jsonc-parser", [\ + ["npm:3.2.0", {\ + "packageLocation": "./.yarn/cache/jsonc-parser-npm-3.2.0-1896ece3b7-bd68b902e5.zip/node_modules/jsonc-parser/",\ + "packageDependencies": [\ + ["jsonc-parser", "npm:3.2.0"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ ["jszip", [\ ["npm:3.10.1", {\ "packageLocation": "./.yarn/cache/jszip-npm-3.10.1-2862546cfb-bfbfbb9b0a.zip/node_modules/jszip/",\ @@ -2697,6 +3087,28 @@ const RAW_RUNTIME_STATE = "linkType": "HARD"\ }]\ ]],\ + ["keytar", [\ + ["npm:7.9.0", {\ + "packageLocation": "./.yarn/unplugged/keytar-npm-7.9.0-682d6e5c1d/node_modules/keytar/",\ + "packageDependencies": [\ + ["keytar", "npm:7.9.0"],\ + ["node-addon-api", "npm:4.3.0"],\ + ["node-gyp", "npm:9.4.0"],\ + ["prebuild-install", "npm:7.1.1"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["keyv", [\ + ["npm:4.5.4", {\ + "packageLocation": "./.yarn/cache/keyv-npm-4.5.4-4c8e2cf7f7-167eb6ef64.zip/node_modules/keyv/",\ + "packageDependencies": [\ + ["keyv", "npm:4.5.4"],\ + ["json-buffer", "npm:3.0.1"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ ["kind-of", [\ ["npm:6.0.3", {\ "packageLocation": "./.yarn/cache/kind-of-npm-6.0.3-ab15f36220-5873d303fb.zip/node_modules/kind-of/",\ @@ -2706,6 +3118,15 @@ const RAW_RUNTIME_STATE = "linkType": "HARD"\ }]\ ]],\ + ["leven", [\ + ["npm:3.1.0", {\ + "packageLocation": "./.yarn/cache/leven-npm-3.1.0-b7697736a3-638401d534.zip/node_modules/leven/",\ + "packageDependencies": [\ + ["leven", "npm:3.1.0"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ ["levn", [\ ["npm:0.4.1", {\ "packageLocation": "./.yarn/cache/levn-npm-0.4.1-d183b2d7bb-2e4720ff79.zip/node_modules/levn/",\ @@ -2727,6 +3148,16 @@ const RAW_RUNTIME_STATE = "linkType": "HARD"\ }]\ ]],\ + ["linkify-it", [\ + ["npm:3.0.3", {\ + "packageLocation": "./.yarn/cache/linkify-it-npm-3.0.3-6880fe29c1-1ed466b02a.zip/node_modules/linkify-it/",\ + "packageDependencies": [\ + ["linkify-it", "npm:3.0.3"],\ + ["uc.micro", "npm:1.0.6"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ ["loader-runner", [\ ["npm:4.3.0", {\ "packageLocation": "./.yarn/cache/loader-runner-npm-4.3.0-9ca67df372-555ae00286.zip/node_modules/loader-runner/",\ @@ -2822,6 +3253,29 @@ const RAW_RUNTIME_STATE = "linkType": "HARD"\ }]\ ]],\ + ["markdown-it", [\ + ["npm:12.3.2", {\ + "packageLocation": "./.yarn/cache/markdown-it-npm-12.3.2-6c66b716e8-d83d794bfb.zip/node_modules/markdown-it/",\ + "packageDependencies": [\ + ["markdown-it", "npm:12.3.2"],\ + ["argparse", "npm:2.0.1"],\ + ["entities", "npm:2.1.0"],\ + ["linkify-it", "npm:3.0.3"],\ + ["mdurl", "npm:1.0.1"],\ + ["uc.micro", "npm:1.0.6"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["mdurl", [\ + ["npm:1.0.1", {\ + "packageLocation": "./.yarn/cache/mdurl-npm-1.0.1-054d974269-ada367d01c.zip/node_modules/mdurl/",\ + "packageDependencies": [\ + ["mdurl", "npm:1.0.1"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ ["merge-stream", [\ ["npm:2.0.0", {\ "packageLocation": "./.yarn/cache/merge-stream-npm-2.0.0-2ac83efea5-6fa4dcc8d8.zip/node_modules/merge-stream/",\ @@ -2851,6 +3305,15 @@ const RAW_RUNTIME_STATE = "linkType": "HARD"\ }]\ ]],\ + ["mime", [\ + ["npm:1.6.0", {\ + "packageLocation": "./.yarn/cache/mime-npm-1.6.0-60ae95038a-b7d98bb1e0.zip/node_modules/mime/",\ + "packageDependencies": [\ + ["mime", "npm:1.6.0"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ ["mime-db", [\ ["npm:1.52.0", {\ "packageLocation": "./.yarn/cache/mime-db-npm-1.52.0-b5371d6fd2-54bb60bf39.zip/node_modules/mime-db/",\ @@ -2870,6 +3333,15 @@ const RAW_RUNTIME_STATE = "linkType": "HARD"\ }]\ ]],\ + ["mimic-response", [\ + ["npm:3.1.0", {\ + "packageLocation": "./.yarn/cache/mimic-response-npm-3.1.0-a4a24b4e96-7e71904761.zip/node_modules/mimic-response/",\ + "packageDependencies": [\ + ["mimic-response", "npm:3.1.0"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ ["minimatch", [\ ["npm:3.1.2", {\ "packageLocation": "./.yarn/cache/minimatch-npm-3.1.2-9405269906-e0b25b04cd.zip/node_modules/minimatch/",\ @@ -2904,6 +3376,15 @@ const RAW_RUNTIME_STATE = "linkType": "HARD"\ }]\ ]],\ + ["minimist", [\ + ["npm:1.2.8", {\ + "packageLocation": "./.yarn/cache/minimist-npm-1.2.8-d7af7b1dce-908491b6cc.zip/node_modules/minimist/",\ + "packageDependencies": [\ + ["minimist", "npm:1.2.8"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ ["minipass", [\ ["npm:3.3.6", {\ "packageLocation": "./.yarn/cache/minipass-npm-3.3.6-b8d93a945b-a5c6ef069f.zip/node_modules/minipass/",\ @@ -2920,10 +3401,10 @@ const RAW_RUNTIME_STATE = ],\ "linkType": "HARD"\ }],\ - ["npm:7.0.3", {\ - "packageLocation": "./.yarn/cache/minipass-npm-7.0.3-3b57909ee9-04d72c8a43.zip/node_modules/minipass/",\ + ["npm:7.0.4", {\ + "packageLocation": "./.yarn/cache/minipass-npm-7.0.4-eacb4e042e-e864bd02ce.zip/node_modules/minipass/",\ "packageDependencies": [\ - ["minipass", "npm:7.0.3"]\ + ["minipass", "npm:7.0.4"]\ ],\ "linkType": "HARD"\ }]\ @@ -2944,7 +3425,7 @@ const RAW_RUNTIME_STATE = "packageDependencies": [\ ["minipass-fetch", "npm:3.0.4"],\ ["encoding", "npm:0.1.13"],\ - ["minipass", "npm:7.0.3"],\ + ["minipass", "npm:7.0.4"],\ ["minipass-sized", "npm:1.0.3"],\ ["minizlib", "npm:2.1.2"]\ ],\ @@ -3001,6 +3482,15 @@ const RAW_RUNTIME_STATE = "linkType": "HARD"\ }]\ ]],\ + ["mkdirp-classic", [\ + ["npm:0.5.3", {\ + "packageLocation": "./.yarn/cache/mkdirp-classic-npm-0.5.3-3b5c991910-3f4e088208.zip/node_modules/mkdirp-classic/",\ + "packageDependencies": [\ + ["mkdirp-classic", "npm:0.5.3"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ ["mocha", [\ ["npm:10.2.0", {\ "packageLocation": "./.yarn/cache/mocha-npm-10.2.0-87db25c7c5-f7362898ae.zip/node_modules/mocha/",\ @@ -3047,6 +3537,15 @@ const RAW_RUNTIME_STATE = "linkType": "HARD"\ }]\ ]],\ + ["mute-stream", [\ + ["npm:0.0.8", {\ + "packageLocation": "./.yarn/cache/mute-stream-npm-0.0.8-489a7d6c2b-a2d2e79dde.zip/node_modules/mute-stream/",\ + "packageDependencies": [\ + ["mute-stream", "npm:0.0.8"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ ["nanoid", [\ ["npm:3.3.3", {\ "packageLocation": "./.yarn/cache/nanoid-npm-3.3.3-25d865be84-c703ed58a2.zip/node_modules/nanoid/",\ @@ -3056,6 +3555,15 @@ const RAW_RUNTIME_STATE = "linkType": "HARD"\ }]\ ]],\ + ["napi-build-utils", [\ + ["npm:1.0.2", {\ + "packageLocation": "./.yarn/cache/napi-build-utils-npm-1.0.2-892e4bba56-276feb8e30.zip/node_modules/napi-build-utils/",\ + "packageDependencies": [\ + ["napi-build-utils", "npm:1.0.2"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ ["natural-compare", [\ ["npm:1.4.0", {\ "packageLocation": "./.yarn/cache/natural-compare-npm-1.4.0-97b75b362d-23ad088b08.zip/node_modules/natural-compare/",\ @@ -3092,6 +3600,26 @@ const RAW_RUNTIME_STATE = "linkType": "HARD"\ }]\ ]],\ + ["node-abi", [\ + ["npm:3.51.0", {\ + "packageLocation": "./.yarn/cache/node-abi-npm-3.51.0-7cb12efc40-7ab89e7ecf.zip/node_modules/node-abi/",\ + "packageDependencies": [\ + ["node-abi", "npm:3.51.0"],\ + ["semver", "npm:7.5.4"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["node-addon-api", [\ + ["npm:4.3.0", {\ + "packageLocation": "./.yarn/unplugged/node-addon-api-npm-4.3.0-a07a1232df/node_modules/node-addon-api/",\ + "packageDependencies": [\ + ["node-addon-api", "npm:4.3.0"],\ + ["node-gyp", "npm:9.4.0"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ ["node-gyp", [\ ["npm:9.4.0", {\ "packageLocation": "./.yarn/unplugged/node-gyp-npm-9.4.0-ebf5f5573e/node_modules/node-gyp/",\ @@ -3153,6 +3681,25 @@ const RAW_RUNTIME_STATE = "linkType": "HARD"\ }]\ ]],\ + ["nth-check", [\ + ["npm:2.1.1", {\ + "packageLocation": "./.yarn/cache/nth-check-npm-2.1.1-f97afc8169-5afc3dafcd.zip/node_modules/nth-check/",\ + "packageDependencies": [\ + ["nth-check", "npm:2.1.1"],\ + ["boolbase", "npm:1.0.0"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["object-inspect", [\ + ["npm:1.13.1", {\ + "packageLocation": "./.yarn/cache/object-inspect-npm-1.13.1-fd038a2f0a-92f4989ed8.zip/node_modules/object-inspect/",\ + "packageDependencies": [\ + ["object-inspect", "npm:1.13.1"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ ["once", [\ ["npm:1.4.0", {\ "packageLocation": "./.yarn/cache/once-npm-1.4.0-ccf03ef07a-cd0a885013.zip/node_modules/once/",\ @@ -3227,7 +3774,8 @@ const RAW_RUNTIME_STATE = ["@typescript-eslint/eslint-plugin", "virtual:2b9e7e7d573ed38308251d9cfa9bcac1c01394d20ff25d4a07b4a0345be370b65803551137c4363442bf76c7d6f9363387c180207a65457c6616ca7fd9b2a56b#npm:5.62.0"],\ ["@typescript-eslint/parser", "virtual:2b9e7e7d573ed38308251d9cfa9bcac1c01394d20ff25d4a07b4a0345be370b65803551137c4363442bf76c7d6f9363387c180207a65457c6616ca7fd9b2a56b#npm:5.62.0"],\ ["@vscode/test-electron", "npm:2.3.5"],\ - ["eslint", "npm:8.51.0"],\ + ["@vscode/vsce", "npm:2.21.1"],\ + ["eslint", "npm:8.52.0"],\ ["glob", "npm:8.1.0"],\ ["mocha", "npm:10.2.0"],\ ["ts-loader", "virtual:2b9e7e7d573ed38308251d9cfa9bcac1c01394d20ff25d4a07b4a0345be370b65803551137c4363442bf76c7d6f9363387c180207a65457c6616ca7fd9b2a56b#npm:9.5.0"],\ @@ -3315,6 +3863,37 @@ const RAW_RUNTIME_STATE = "linkType": "HARD"\ }]\ ]],\ + ["parse-semver", [\ + ["npm:1.1.1", {\ + "packageLocation": "./.yarn/cache/parse-semver-npm-1.1.1-45d28f8138-15ae06553a.zip/node_modules/parse-semver/",\ + "packageDependencies": [\ + ["parse-semver", "npm:1.1.1"],\ + ["semver", "npm:5.7.2"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["parse5", [\ + ["npm:7.1.2", {\ + "packageLocation": "./.yarn/cache/parse5-npm-7.1.2-aa9a92c270-3c86806bb0.zip/node_modules/parse5/",\ + "packageDependencies": [\ + ["parse5", "npm:7.1.2"],\ + ["entities", "npm:4.5.0"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["parse5-htmlparser2-tree-adapter", [\ + ["npm:7.0.0", {\ + "packageLocation": "./.yarn/cache/parse5-htmlparser2-tree-adapter-npm-7.0.0-38e1b3a974-23dbe45fdd.zip/node_modules/parse5-htmlparser2-tree-adapter/",\ + "packageDependencies": [\ + ["parse5-htmlparser2-tree-adapter", "npm:7.0.0"],\ + ["domhandler", "npm:5.0.3"],\ + ["parse5", "npm:7.1.2"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ ["path-exists", [\ ["npm:4.0.0", {\ "packageLocation": "./.yarn/cache/path-exists-npm-4.0.0-e9e4f63eb0-505807199d.zip/node_modules/path-exists/",\ @@ -3357,7 +3936,7 @@ const RAW_RUNTIME_STATE = "packageDependencies": [\ ["path-scurry", "npm:1.10.1"],\ ["lru-cache", "npm:10.0.1"],\ - ["minipass", "npm:7.0.3"]\ + ["minipass", "npm:7.0.4"]\ ],\ "linkType": "HARD"\ }]\ @@ -3371,6 +3950,15 @@ const RAW_RUNTIME_STATE = "linkType": "HARD"\ }]\ ]],\ + ["pend", [\ + ["npm:1.2.0", {\ + "packageLocation": "./.yarn/cache/pend-npm-1.2.0-7a13d93266-6c72f52433.zip/node_modules/pend/",\ + "packageDependencies": [\ + ["pend", "npm:1.2.0"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ ["picocolors", [\ ["npm:1.0.0", {\ "packageLocation": "./.yarn/cache/picocolors-npm-1.0.0-d81e0b1927-a2e8092dd8.zip/node_modules/picocolors/",\ @@ -3399,6 +3987,27 @@ const RAW_RUNTIME_STATE = "linkType": "HARD"\ }]\ ]],\ + ["prebuild-install", [\ + ["npm:7.1.1", {\ + "packageLocation": "./.yarn/cache/prebuild-install-npm-7.1.1-cb9fc9d341-6c70a2f82f.zip/node_modules/prebuild-install/",\ + "packageDependencies": [\ + ["prebuild-install", "npm:7.1.1"],\ + ["detect-libc", "npm:2.0.2"],\ + ["expand-template", "npm:2.0.3"],\ + ["github-from-package", "npm:0.0.0"],\ + ["minimist", "npm:1.2.8"],\ + ["mkdirp-classic", "npm:0.5.3"],\ + ["napi-build-utils", "npm:1.0.2"],\ + ["node-abi", "npm:3.51.0"],\ + ["pump", "npm:3.0.0"],\ + ["rc", "npm:1.2.8"],\ + ["simple-get", "npm:4.0.1"],\ + ["tar-fs", "npm:2.1.1"],\ + ["tunnel-agent", "npm:0.6.0"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ ["prelude-ls", [\ ["npm:1.2.1", {\ "packageLocation": "./.yarn/cache/prelude-ls-npm-1.2.1-3e4d272a55-0b9d2c7680.zip/node_modules/prelude-ls/",\ @@ -3409,10 +4018,10 @@ const RAW_RUNTIME_STATE = }]\ ]],\ ["prettier", [\ - ["npm:3.0.0", {\ - "packageLocation": "./.yarn/cache/prettier-npm-3.0.0-7ffbcce680-3992926382.zip/node_modules/prettier/",\ + ["npm:3.0.3", {\ + "packageLocation": "./.yarn/unplugged/prettier-npm-3.0.3-fced695dae/node_modules/prettier/",\ "packageDependencies": [\ - ["prettier", "npm:3.0.0"]\ + ["prettier", "npm:3.0.3"]\ ],\ "linkType": "HARD"\ }]\ @@ -3437,6 +4046,17 @@ const RAW_RUNTIME_STATE = "linkType": "HARD"\ }]\ ]],\ + ["pump", [\ + ["npm:3.0.0", {\ + "packageLocation": "./.yarn/cache/pump-npm-3.0.0-0080bf6a7a-e42e9229fb.zip/node_modules/pump/",\ + "packageDependencies": [\ + ["pump", "npm:3.0.0"],\ + ["end-of-stream", "npm:1.4.4"],\ + ["once", "npm:1.4.0"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ ["punycode", [\ ["npm:2.3.0", {\ "packageLocation": "./.yarn/cache/punycode-npm-2.3.0-df4bdce06b-d4e7fbb96f.zip/node_modules/punycode/",\ @@ -3446,6 +4066,16 @@ const RAW_RUNTIME_STATE = "linkType": "HARD"\ }]\ ]],\ + ["qs", [\ + ["npm:6.11.2", {\ + "packageLocation": "./.yarn/cache/qs-npm-6.11.2-b118bc1c6f-f2321d0796.zip/node_modules/qs/",\ + "packageDependencies": [\ + ["qs", "npm:6.11.2"],\ + ["side-channel", "npm:1.0.4"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ ["queue-microtask", [\ ["npm:1.2.3", {\ "packageLocation": "./.yarn/cache/queue-microtask-npm-1.2.3-fcc98e4e2d-72900df061.zip/node_modules/queue-microtask/",\ @@ -3465,6 +4095,29 @@ const RAW_RUNTIME_STATE = "linkType": "HARD"\ }]\ ]],\ + ["rc", [\ + ["npm:1.2.8", {\ + "packageLocation": "./.yarn/cache/rc-npm-1.2.8-d6768ac936-5c4d72ae7e.zip/node_modules/rc/",\ + "packageDependencies": [\ + ["rc", "npm:1.2.8"],\ + ["deep-extend", "npm:0.6.0"],\ + ["ini", "npm:1.3.8"],\ + ["minimist", "npm:1.2.8"],\ + ["strip-json-comments", "npm:2.0.1"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["read", [\ + ["npm:1.0.7", {\ + "packageLocation": "./.yarn/cache/read-npm-1.0.7-950ec74ca8-2777c254e5.zip/node_modules/read/",\ + "packageDependencies": [\ + ["read", "npm:1.0.7"],\ + ["mute-stream", "npm:0.0.8"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ ["readable-stream", [\ ["npm:2.3.8", {\ "packageLocation": "./.yarn/cache/readable-stream-npm-2.3.8-67a94c2cb1-8500dd3a90.zip/node_modules/readable-stream/",\ @@ -3525,7 +4178,7 @@ const RAW_RUNTIME_STATE = "packageLocation": "./.yarn/cache/resolve-patch-4254c24959-f345cd37f5.zip/node_modules/resolve/",\ "packageDependencies": [\ ["resolve", "patch:resolve@npm%3A1.22.8#optional!builtin::version=1.22.8&hash=c3c19d"],\ - ["is-core-module", "npm:2.13.0"],\ + ["is-core-module", "npm:2.13.1"],\ ["path-parse", "npm:1.0.7"],\ ["supports-preserve-symlinks-flag", "npm:1.0.0"]\ ],\ @@ -3621,6 +4274,15 @@ const RAW_RUNTIME_STATE = "linkType": "HARD"\ }]\ ]],\ + ["sax", [\ + ["npm:1.3.0", {\ + "packageLocation": "./.yarn/cache/sax-npm-1.3.0-e6c479267f-bb571b31d3.zip/node_modules/sax/",\ + "packageDependencies": [\ + ["sax", "npm:1.3.0"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ ["schema-utils", [\ ["npm:3.3.0", {\ "packageLocation": "./.yarn/cache/schema-utils-npm-3.3.0-f2b36937f1-2c7bbb1da9.zip/node_modules/schema-utils/",\ @@ -3634,6 +4296,13 @@ const RAW_RUNTIME_STATE = }]\ ]],\ ["semver", [\ + ["npm:5.7.2", {\ + "packageLocation": "./.yarn/cache/semver-npm-5.7.2-938ee91eaa-fca14418a1.zip/node_modules/semver/",\ + "packageDependencies": [\ + ["semver", "npm:5.7.2"]\ + ],\ + "linkType": "HARD"\ + }],\ ["npm:7.5.4", {\ "packageLocation": "./.yarn/cache/semver-npm-7.5.4-c4ad957fcd-985dec0d37.zip/node_modules/semver/",\ "packageDependencies": [\ @@ -3670,6 +4339,19 @@ const RAW_RUNTIME_STATE = "linkType": "HARD"\ }]\ ]],\ + ["set-function-length", [\ + ["npm:1.1.1", {\ + "packageLocation": "./.yarn/cache/set-function-length-npm-1.1.1-d362bf8221-745ed1d7dc.zip/node_modules/set-function-length/",\ + "packageDependencies": [\ + ["set-function-length", "npm:1.1.1"],\ + ["define-data-property", "npm:1.1.1"],\ + ["get-intrinsic", "npm:1.2.2"],\ + ["gopd", "npm:1.0.1"],\ + ["has-property-descriptors", "npm:1.0.1"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ ["setimmediate", [\ ["npm:1.0.5", {\ "packageLocation": "./.yarn/cache/setimmediate-npm-1.0.5-54587459b6-76e3f5d7f4.zip/node_modules/setimmediate/",\ @@ -3708,6 +4390,18 @@ const RAW_RUNTIME_STATE = "linkType": "HARD"\ }]\ ]],\ + ["side-channel", [\ + ["npm:1.0.4", {\ + "packageLocation": "./.yarn/cache/side-channel-npm-1.0.4-e1f38b9e06-c4998d9fc5.zip/node_modules/side-channel/",\ + "packageDependencies": [\ + ["side-channel", "npm:1.0.4"],\ + ["call-bind", "npm:1.0.5"],\ + ["get-intrinsic", "npm:1.2.2"],\ + ["object-inspect", "npm:1.13.1"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ ["signal-exit", [\ ["npm:3.0.7", {\ "packageLocation": "./.yarn/cache/signal-exit-npm-3.0.7-bd270458a3-a2f098f247.zip/node_modules/signal-exit/",\ @@ -3724,6 +4418,27 @@ const RAW_RUNTIME_STATE = "linkType": "HARD"\ }]\ ]],\ + ["simple-concat", [\ + ["npm:1.0.1", {\ + "packageLocation": "./.yarn/cache/simple-concat-npm-1.0.1-48df70de29-4d211042cc.zip/node_modules/simple-concat/",\ + "packageDependencies": [\ + ["simple-concat", "npm:1.0.1"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["simple-get", [\ + ["npm:4.0.1", {\ + "packageLocation": "./.yarn/cache/simple-get-npm-4.0.1-fa2a97645d-93f1b32319.zip/node_modules/simple-get/",\ + "packageDependencies": [\ + ["simple-get", "npm:4.0.1"],\ + ["decompress-response", "npm:6.0.0"],\ + ["once", "npm:1.4.0"],\ + ["simple-concat", "npm:1.0.1"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ ["slash", [\ ["npm:3.0.0", {\ "packageLocation": "./.yarn/cache/slash-npm-3.0.0-b87de2279a-94a93fff61.zip/node_modules/slash/",\ @@ -3759,7 +4474,7 @@ const RAW_RUNTIME_STATE = "packageDependencies": [\ ["socks-proxy-agent", "npm:7.0.0"],\ ["agent-base", "npm:6.0.2"],\ - ["debug", "virtual:ced87d94ab05a28b44536eb0cd61a9458e757a0ae7bb35e5ab5d27e03d08b996abd275928b29aad2eb0973d5bb0800e75ba8ca3e26bf62cbe8ea0fae8cca70a8#npm:4.3.4"],\ + ["debug", "virtual:feb0771c9f8eadaf509cfed41e14a8bebbea5442233275c1c87085111077a08ef71eb773b899665b154d8203a55a489610a54117ae059fce5f5b8b844493b1b1#npm:4.3.4"],\ ["socks", "npm:2.7.1"]\ ],\ "linkType": "HARD"\ @@ -3797,7 +4512,7 @@ const RAW_RUNTIME_STATE = "packageLocation": "./.yarn/cache/ssri-npm-10.0.5-1a7557d04d-453f9a1c24.zip/node_modules/ssri/",\ "packageDependencies": [\ ["ssri", "npm:10.0.5"],\ - ["minipass", "npm:7.0.3"]\ + ["minipass", "npm:7.0.4"]\ ],\ "linkType": "HARD"\ }]\ @@ -3861,6 +4576,13 @@ const RAW_RUNTIME_STATE = }]\ ]],\ ["strip-json-comments", [\ + ["npm:2.0.1", {\ + "packageLocation": "./.yarn/cache/strip-json-comments-npm-2.0.1-e7883b2d04-1074ccb632.zip/node_modules/strip-json-comments/",\ + "packageDependencies": [\ + ["strip-json-comments", "npm:2.0.1"]\ + ],\ + "linkType": "HARD"\ + }],\ ["npm:3.1.1", {\ "packageLocation": "./.yarn/cache/strip-json-comments-npm-3.1.1-dcb2324823-492f73e272.zip/node_modules/strip-json-comments/",\ "packageDependencies": [\ @@ -3870,6 +4592,14 @@ const RAW_RUNTIME_STATE = }]\ ]],\ ["supports-color", [\ + ["npm:5.5.0", {\ + "packageLocation": "./.yarn/cache/supports-color-npm-5.5.0-183ac537bc-5f505c6fa3.zip/node_modules/supports-color/",\ + "packageDependencies": [\ + ["supports-color", "npm:5.5.0"],\ + ["has-flag", "npm:3.0.0"]\ + ],\ + "linkType": "HARD"\ + }],\ ["npm:7.2.0", {\ "packageLocation": "./.yarn/cache/supports-color-npm-7.2.0-606bfcf7da-c8bb7afd56.zip/node_modules/supports-color/",\ "packageDependencies": [\ @@ -3920,6 +4650,33 @@ const RAW_RUNTIME_STATE = "linkType": "HARD"\ }]\ ]],\ + ["tar-fs", [\ + ["npm:2.1.1", {\ + "packageLocation": "./.yarn/cache/tar-fs-npm-2.1.1-e374d3b7a2-526deae025.zip/node_modules/tar-fs/",\ + "packageDependencies": [\ + ["tar-fs", "npm:2.1.1"],\ + ["chownr", "npm:1.1.4"],\ + ["mkdirp-classic", "npm:0.5.3"],\ + ["pump", "npm:3.0.0"],\ + ["tar-stream", "npm:2.2.0"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["tar-stream", [\ + ["npm:2.2.0", {\ + "packageLocation": "./.yarn/cache/tar-stream-npm-2.2.0-884c79b510-1a52a51d24.zip/node_modules/tar-stream/",\ + "packageDependencies": [\ + ["tar-stream", "npm:2.2.0"],\ + ["bl", "npm:4.1.0"],\ + ["end-of-stream", "npm:1.4.4"],\ + ["fs-constants", "npm:1.0.0"],\ + ["inherits", "npm:2.0.4"],\ + ["readable-stream", "npm:3.6.2"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ ["terser", [\ ["npm:5.22.0", {\ "packageLocation": "./.yarn/cache/terser-npm-5.22.0-e83cb45628-e5407f9a14.zip/node_modules/terser/",\ @@ -3981,6 +4738,16 @@ const RAW_RUNTIME_STATE = "linkType": "HARD"\ }]\ ]],\ + ["tmp", [\ + ["npm:0.2.1", {\ + "packageLocation": "./.yarn/cache/tmp-npm-0.2.1-a9c8d9c0ca-445148d72d.zip/node_modules/tmp/",\ + "packageDependencies": [\ + ["tmp", "npm:0.2.1"],\ + ["rimraf", "npm:3.0.2"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ ["to-regex-range", [\ ["npm:5.0.1", {\ "packageLocation": "./.yarn/cache/to-regex-range-npm-5.0.1-f1e8263b00-10dda13571.zip/node_modules/to-regex-range/",\ @@ -4068,6 +4835,25 @@ const RAW_RUNTIME_STATE = "linkType": "HARD"\ }]\ ]],\ + ["tunnel", [\ + ["npm:0.0.6", {\ + "packageLocation": "./.yarn/cache/tunnel-npm-0.0.6-b1c0830ea4-cf1ffed5e6.zip/node_modules/tunnel/",\ + "packageDependencies": [\ + ["tunnel", "npm:0.0.6"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["tunnel-agent", [\ + ["npm:0.6.0", {\ + "packageLocation": "./.yarn/cache/tunnel-agent-npm-0.6.0-64345ab7eb-7f0d9ed5c2.zip/node_modules/tunnel-agent/",\ + "packageDependencies": [\ + ["tunnel-agent", "npm:0.6.0"],\ + ["safe-buffer", "npm:5.2.1"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ ["type-check", [\ ["npm:0.4.0", {\ "packageLocation": "./.yarn/cache/type-check-npm-0.4.0-60565800ce-1468777647.zip/node_modules/type-check/",\ @@ -4087,6 +4873,18 @@ const RAW_RUNTIME_STATE = "linkType": "HARD"\ }]\ ]],\ + ["typed-rest-client", [\ + ["npm:1.8.11", {\ + "packageLocation": "./.yarn/cache/typed-rest-client-npm-1.8.11-7be28960b2-9c160780f4.zip/node_modules/typed-rest-client/",\ + "packageDependencies": [\ + ["typed-rest-client", "npm:1.8.11"],\ + ["qs", "npm:6.11.2"],\ + ["tunnel", "npm:0.0.6"],\ + ["underscore", "npm:1.13.6"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ ["typescript", [\ ["patch:typescript@npm%3A5.2.2#optional!builtin::version=5.2.2&hash=f3b441", {\ "packageLocation": "./.yarn/cache/typescript-patch-3914634c3a-f79cc2ba80.zip/node_modules/typescript/",\ @@ -4096,6 +4894,24 @@ const RAW_RUNTIME_STATE = "linkType": "HARD"\ }]\ ]],\ + ["uc.micro", [\ + ["npm:1.0.6", {\ + "packageLocation": "./.yarn/cache/uc.micro-npm-1.0.6-36f3dc2fc4-6898bb5563.zip/node_modules/uc.micro/",\ + "packageDependencies": [\ + ["uc.micro", "npm:1.0.6"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["underscore", [\ + ["npm:1.13.6", {\ + "packageLocation": "./.yarn/cache/underscore-npm-1.13.6-3ebe9d92fb-58cf5dc42c.zip/node_modules/underscore/",\ + "packageDependencies": [\ + ["underscore", "npm:1.13.6"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ ["undici-types", [\ ["npm:5.25.3", {\ "packageLocation": "./.yarn/cache/undici-types-npm-5.25.3-2ac9eafc9e-9a57f2dd6f.zip/node_modules/undici-types/",\ @@ -4159,6 +4975,15 @@ const RAW_RUNTIME_STATE = "linkType": "HARD"\ }]\ ]],\ + ["url-join", [\ + ["npm:4.0.1", {\ + "packageLocation": "./.yarn/cache/url-join-npm-4.0.1-e1f4415722-b53b256a9a.zip/node_modules/url-join/",\ + "packageDependencies": [\ + ["url-join", "npm:4.0.1"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ ["util-deprecate", [\ ["npm:1.0.2", {\ "packageLocation": "./.yarn/cache/util-deprecate-npm-1.0.2-e3fe1a219c-474acf1146.zip/node_modules/util-deprecate/",\ @@ -4422,6 +5247,26 @@ const RAW_RUNTIME_STATE = "linkType": "HARD"\ }]\ ]],\ + ["xml2js", [\ + ["npm:0.5.0", {\ + "packageLocation": "./.yarn/cache/xml2js-npm-0.5.0-06e57a2771-27c4d75921.zip/node_modules/xml2js/",\ + "packageDependencies": [\ + ["xml2js", "npm:0.5.0"],\ + ["sax", "npm:1.3.0"],\ + ["xmlbuilder", "npm:11.0.1"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["xmlbuilder", [\ + ["npm:11.0.1", {\ + "packageLocation": "./.yarn/cache/xmlbuilder-npm-11.0.1-b8b04dc929-c8c3d20878.zip/node_modules/xmlbuilder/",\ + "packageDependencies": [\ + ["xmlbuilder", "npm:11.0.1"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ ["y18n", [\ ["npm:5.0.8", {\ "packageLocation": "./.yarn/cache/y18n-npm-5.0.8-5f3a0a7e62-5f1b5f95e3.zip/node_modules/y18n/",\ @@ -4485,6 +5330,27 @@ const RAW_RUNTIME_STATE = "linkType": "HARD"\ }]\ ]],\ + ["yauzl", [\ + ["npm:2.10.0", {\ + "packageLocation": "./.yarn/cache/yauzl-npm-2.10.0-72e70ea021-1e4c311050.zip/node_modules/yauzl/",\ + "packageDependencies": [\ + ["yauzl", "npm:2.10.0"],\ + ["buffer-crc32", "npm:0.2.13"],\ + ["fd-slicer", "npm:1.1.0"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["yazl", [\ + ["npm:2.5.1", {\ + "packageLocation": "./.yarn/cache/yazl-npm-2.5.1-07fc697bef-498ea4c6bc.zip/node_modules/yazl/",\ + "packageDependencies": [\ + ["yazl", "npm:2.5.1"],\ + ["buffer-crc32", "npm:0.2.13"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ ["yocto-queue", [\ ["npm:0.1.0", {\ "packageLocation": "./.yarn/cache/yocto-queue-npm-0.1.0-c6c9a7db29-f77b3d8d00.zip/node_modules/yocto-queue/",\ diff --git a/toolchains/solidity/extension/package.json b/toolchains/solidity/extension/package.json index bdc7911e..a04bfd17 100644 --- a/toolchains/solidity/extension/package.json +++ b/toolchains/solidity/extension/package.json @@ -13,7 +13,7 @@ "activationEvents": [ "onLanguage:solidity" ], - "main": "./dist/extension.js", + "main": "./dist/client.js", "contributes": { "commands": [ { diff --git a/toolchains/solidity/extension/src/extension.ts b/toolchains/solidity/extension/src/client.ts similarity index 100% rename from toolchains/solidity/extension/src/extension.ts rename to toolchains/solidity/extension/src/client.ts diff --git a/toolchains/solidity/extension/webpack.config.js b/toolchains/solidity/extension/webpack.config.js index 6d1fa198..c5d42b7f 100644 --- a/toolchains/solidity/extension/webpack.config.js +++ b/toolchains/solidity/extension/webpack.config.js @@ -13,7 +13,7 @@ const extensionConfig = { mode: 'none', // this leaves the source code as close as possible to the original (when packaging we set this to 'production') entry: { - extension: './src/extension.ts', // the entry point of this extension, 📖 -> https://webpack.js.org/configuration/entry-context/ + client: './src/client.ts', // the entry point of this extension, 📖 -> https://webpack.js.org/configuration/entry-context/ server: './src/server.ts', }, output: { diff --git a/yarn.lock b/yarn.lock index 8cce2cbe..6d844cbb 100644 --- a/yarn.lock +++ b/yarn.lock @@ -30,37 +30,13 @@ __metadata: languageName: node linkType: hard -"@eslint-community/regexpp@npm:^4.4.0": +"@eslint-community/regexpp@npm:^4.4.0, @eslint-community/regexpp@npm:^4.6.1": version: 4.9.1 resolution: "@eslint-community/regexpp@npm:4.9.1" checksum: 8f1ba51fa5dedd93f01623382d006c838a436aaea85561c7e540b15600988350843bf746a60e2aaefa79ee4904c9dc0a2f3f00e025b162112c76520ffb34805d languageName: node linkType: hard -"@eslint-community/regexpp@npm:^4.6.1": - version: 4.6.2 - resolution: "@eslint-community/regexpp@npm:4.6.2" - checksum: 59ea2fa13a70996a8cebbd5a9f4499c92bceeff872286ef2fb34948fcfb9d3467692371d9cc116e7d613f2c18086a1c8337c9d461ccdf213f0dc47f6f6d2fbb6 - languageName: node - linkType: hard - -"@eslint/eslintrc@npm:^2.1.1": - version: 2.1.1 - resolution: "@eslint/eslintrc@npm:2.1.1" - dependencies: - ajv: "npm:^6.12.4" - debug: "npm:^4.3.2" - espree: "npm:^9.6.0" - globals: "npm:^13.19.0" - ignore: "npm:^5.2.0" - import-fresh: "npm:^3.2.1" - js-yaml: "npm:^4.1.0" - minimatch: "npm:^3.1.2" - strip-json-comments: "npm:^3.1.1" - checksum: d4dda7f9f0c4d3d81f871d0bff4c028fa321fe5f23ead19c8438b9f405747b7bb275d72572e1ec4a55c542723a544ebefe7255e37a1747a355e56286e465806f - languageName: node - linkType: hard - "@eslint/eslintrc@npm:^2.1.2": version: 2.1.2 resolution: "@eslint/eslintrc@npm:2.1.2" @@ -78,39 +54,21 @@ __metadata: languageName: node linkType: hard -"@eslint/js@npm:8.51.0": - version: 8.51.0 - resolution: "@eslint/js@npm:8.51.0" - checksum: 1641f02c787a6477bf4b054afb8113abdca552b8c222520b5ee44d85352294dafd4a34f0e510b1e38a02fc27c1f68547cb6c2abbea891d20688f474440266af3 - languageName: node - linkType: hard - -"@eslint/js@npm:^8.46.0": - version: 8.46.0 - resolution: "@eslint/js@npm:8.46.0" - checksum: 0cc409c5f443f2309657cd28279859f4f2c38d507c9b1396b34fabbe81c76b09d49d1b70579695653c8c590a1711c10772da86a6040f2657275f646952ead839 +"@eslint/js@npm:8.52.0": + version: 8.52.0 + resolution: "@eslint/js@npm:8.52.0" + checksum: 86beff213d0ae4ced203a922b74e2cc4d767d109e7815f985bf648946ba072198977102e32afc9fa04f7825a6de83a831874f6b6675ba0c1d0743ade2dc2d53d languageName: node linkType: hard -"@humanwhocodes/config-array@npm:^0.11.10": - version: 0.11.10 - resolution: "@humanwhocodes/config-array@npm:0.11.10" +"@humanwhocodes/config-array@npm:^0.11.13": + version: 0.11.13 + resolution: "@humanwhocodes/config-array@npm:0.11.13" dependencies: - "@humanwhocodes/object-schema": "npm:^1.2.1" + "@humanwhocodes/object-schema": "npm:^2.0.1" debug: "npm:^4.1.1" minimatch: "npm:^3.0.5" - checksum: f93086ae6a340e739a6bb23d4575b69f52acc4e4e3d62968eaaf77a77db4ba69d6d3e50c0028ba19b634ef6b241553a9d9a13d91b797b3ea33d5d711bb3362fb - languageName: node - linkType: hard - -"@humanwhocodes/config-array@npm:^0.11.11": - version: 0.11.11 - resolution: "@humanwhocodes/config-array@npm:0.11.11" - dependencies: - "@humanwhocodes/object-schema": "npm:^1.2.1" - debug: "npm:^4.1.1" - minimatch: "npm:^3.0.5" - checksum: 4aad64bc4c68ec99a72c91ad9a8a9070e8da47e8fc4f51eefa2eaf56f4b0cae17dfc3ff82eb9268298f687b5bb3b68669ff542203c77bcd400dc27924d56cad6 + checksum: 9f655e1df7efa5a86822cd149ca5cef57240bb8ffd728f0c07cc682cc0a15c6bdce68425fbfd58f9b3e8b16f79b3fd8cb1e96b10c434c9a76f20b2a89f213272 languageName: node linkType: hard @@ -121,10 +79,10 @@ __metadata: languageName: node linkType: hard -"@humanwhocodes/object-schema@npm:^1.2.1": - version: 1.2.1 - resolution: "@humanwhocodes/object-schema@npm:1.2.1" - checksum: b48a8f87fcd5fdc4ac60a31a8bf710d19cc64556050575e6a35a4a48a8543cf8cde1598a65640ff2cdfbfd165b38f9db4fa3782bea7848eb585cc3db824002e6 +"@humanwhocodes/object-schema@npm:^2.0.1": + version: 2.0.1 + resolution: "@humanwhocodes/object-schema@npm:2.0.1" + checksum: dbddfd0465aecf92ed845ec30d06dba3f7bb2496d544b33b53dac7abc40370c0e46b8787b268d24a366730d5eeb5336ac88967232072a183905ee4abf7df4dab languageName: node linkType: hard @@ -372,7 +330,7 @@ __metadata: languageName: node linkType: hard -"@types/vscode@npm:^1.83.0": +"@types/vscode@npm:^1.75.0": version: 1.83.1 resolution: "@types/vscode@npm:1.83.1" checksum: 4acffc65861ec672b32d513f9859507a60db80f093b2edaa1f197c587f2456242e8865cc8a497ccdcad083522866b5a3d43b0d2aa854d63d7be955a0032c9623 @@ -500,6 +458,13 @@ __metadata: languageName: node linkType: hard +"@ungap/structured-clone@npm:^1.2.0": + version: 1.2.0 + resolution: "@ungap/structured-clone@npm:1.2.0" + checksum: c6fe89a505e513a7592e1438280db1c075764793a2397877ff1351721fe8792a966a5359769e30242b3cd023f2efb9e63ca2ca88019d73b564488cc20e3eab12 + languageName: node + linkType: hard + "@vscode/test-electron@npm:^2.3.2": version: 2.3.5 resolution: "@vscode/test-electron@npm:2.3.5" @@ -512,6 +477,40 @@ __metadata: languageName: node linkType: hard +"@vscode/vsce@npm:2.21.1": + version: 2.21.1 + resolution: "@vscode/vsce@npm:2.21.1" + dependencies: + azure-devops-node-api: "npm:^11.0.1" + chalk: "npm:^2.4.2" + cheerio: "npm:^1.0.0-rc.9" + commander: "npm:^6.2.1" + glob: "npm:^7.0.6" + hosted-git-info: "npm:^4.0.2" + jsonc-parser: "npm:^3.2.0" + keytar: "npm:^7.7.0" + leven: "npm:^3.1.0" + markdown-it: "npm:^12.3.2" + mime: "npm:^1.3.4" + minimatch: "npm:^3.0.3" + parse-semver: "npm:^1.1.1" + read: "npm:^1.0.7" + semver: "npm:^7.5.2" + tmp: "npm:^0.2.1" + typed-rest-client: "npm:^1.8.4" + url-join: "npm:^4.0.1" + xml2js: "npm:^0.5.0" + yauzl: "npm:^2.3.1" + yazl: "npm:^2.2.2" + dependenciesMeta: + keytar: + optional: true + bin: + vsce: vsce + checksum: 145ca25f8a7fc13223b1ad6372913e75b08c5dea624256dd16267380d3fecdb1a2184d3eaa56bdba34cda6bb612dd0801cf68f24a11cac21a4d97670f56647c8 + languageName: node + linkType: hard + "@webassemblyjs/ast@npm:1.11.6, @webassemblyjs/ast@npm:^1.11.5": version: 1.11.6 resolution: "@webassemblyjs/ast@npm:1.11.6" @@ -814,6 +813,15 @@ __metadata: languageName: node linkType: hard +"ansi-styles@npm:^3.2.1": + version: 3.2.1 + resolution: "ansi-styles@npm:3.2.1" + dependencies: + color-convert: "npm:^1.9.0" + checksum: d85ade01c10e5dd77b6c89f34ed7531da5830d2cb5882c645f330079975b716438cd7ebb81d0d6e6b4f9c577f19ae41ab55f07f19786b02f9dfd9e0377395665 + languageName: node + linkType: hard + "ansi-styles@npm:^4.0.0, ansi-styles@npm:^4.1.0": version: 4.3.0 resolution: "ansi-styles@npm:4.3.0" @@ -871,6 +879,16 @@ __metadata: languageName: node linkType: hard +"azure-devops-node-api@npm:^11.0.1": + version: 11.2.0 + resolution: "azure-devops-node-api@npm:11.2.0" + dependencies: + tunnel: "npm:0.0.6" + typed-rest-client: "npm:^1.8.4" + checksum: a01ee699e2488a3dce7ec99994db97c8124f7b793a0d9affacdbdb30235009c4e2151ebc2ec75eadbe91c2ea849d2a591f3535945343eaf235d1943253045aee + languageName: node + linkType: hard + "balanced-match@npm:^1.0.0": version: 1.0.2 resolution: "balanced-match@npm:1.0.2" @@ -878,6 +896,13 @@ __metadata: languageName: node linkType: hard +"base64-js@npm:^1.3.1": + version: 1.5.1 + resolution: "base64-js@npm:1.5.1" + checksum: 669632eb3745404c2f822a18fc3a0122d2f9a7a13f7fb8b5823ee19d1d2ff9ee5b52c53367176ea4ad093c332fd5ab4bd0ebae5a8e27917a4105a4cfc86b1005 + languageName: node + linkType: hard + "binary-extensions@npm:^2.0.0": version: 2.2.0 resolution: "binary-extensions@npm:2.2.0" @@ -885,6 +910,24 @@ __metadata: languageName: node linkType: hard +"bl@npm:^4.0.3": + version: 4.1.0 + resolution: "bl@npm:4.1.0" + dependencies: + buffer: "npm:^5.5.0" + inherits: "npm:^2.0.4" + readable-stream: "npm:^3.4.0" + checksum: b7904e66ed0bdfc813c06ea6c3e35eafecb104369dbf5356d0f416af90c1546de3b74e5b63506f0629acf5e16a6f87c3798f16233dcff086e9129383aa02ab55 + languageName: node + linkType: hard + +"boolbase@npm:^1.0.0": + version: 1.0.0 + resolution: "boolbase@npm:1.0.0" + checksum: 3e25c80ef626c3a3487c73dbfc70ac322ec830666c9ad915d11b701142fab25ec1e63eff2c450c74347acfd2de854ccde865cd79ef4db1683f7c7b046ea43bb0 + languageName: node + linkType: hard + "brace-expansion@npm:^1.1.7": version: 1.1.11 resolution: "brace-expansion@npm:1.1.11" @@ -934,6 +977,13 @@ __metadata: languageName: node linkType: hard +"buffer-crc32@npm:~0.2.3": + version: 0.2.13 + resolution: "buffer-crc32@npm:0.2.13" + checksum: 06252347ae6daca3453b94e4b2f1d3754a3b146a111d81c68924c22d91889a40623264e95e67955b1cb4a68cbedf317abeabb5140a9766ed248973096db5ce1c + languageName: node + linkType: hard + "buffer-from@npm:^1.0.0": version: 1.1.2 resolution: "buffer-from@npm:1.1.2" @@ -941,6 +991,16 @@ __metadata: languageName: node linkType: hard +"buffer@npm:^5.5.0": + version: 5.7.1 + resolution: "buffer@npm:5.7.1" + dependencies: + base64-js: "npm:^1.3.1" + ieee754: "npm:^1.1.13" + checksum: 997434d3c6e3b39e0be479a80288875f71cd1c07d75a3855e6f08ef848a3c966023f79534e22e415ff3a5112708ce06127277ab20e527146d55c84566405c7c6 + languageName: node + linkType: hard + "cacache@npm:^17.0.0": version: 17.1.4 resolution: "cacache@npm:17.1.4" @@ -961,6 +1021,17 @@ __metadata: languageName: node linkType: hard +"call-bind@npm:^1.0.0": + version: 1.0.5 + resolution: "call-bind@npm:1.0.5" + dependencies: + function-bind: "npm:^1.1.2" + get-intrinsic: "npm:^1.2.1" + set-function-length: "npm:^1.1.1" + checksum: 246d44db6ef9bbd418828dbd5337f80b46be4398d522eded015f31554cbb2ea33025b0203b75c7ab05a1a255b56ef218880cca1743e4121e306729f9e414da39 + languageName: node + linkType: hard + "callsites@npm:^3.0.0": version: 3.1.0 resolution: "callsites@npm:3.1.0" @@ -976,9 +1047,20 @@ __metadata: linkType: hard "caniuse-lite@npm:^1.0.30001541": - version: 1.0.30001551 - resolution: "caniuse-lite@npm:1.0.30001551" - checksum: 3ab880797f2a47ce5e2db38700283219faacbddb4382a730883657b2155240aedda1931aac456bc957f61a41c99e15b42f452e5f68e62272def026fd3bf474a7 + version: 1.0.30001553 + resolution: "caniuse-lite@npm:1.0.30001553" + checksum: b14b512307aeaeccd4798439ae8665c9c215778132d4a87194552edbbd11965c1a8b3bee593e43a511332e5c4282962e12006ffb75bd3d938c080af7cfc89096 + languageName: node + linkType: hard + +"chalk@npm:^2.4.2": + version: 2.4.2 + resolution: "chalk@npm:2.4.2" + dependencies: + ansi-styles: "npm:^3.2.1" + escape-string-regexp: "npm:^1.0.5" + supports-color: "npm:^5.3.0" + checksum: 3d1d103433166f6bfe82ac75724951b33769675252d8417317363ef9d54699b7c3b2d46671b772b893a8e50c3ece70c4b933c73c01e81bc60ea4df9b55afa303 languageName: node linkType: hard @@ -992,6 +1074,35 @@ __metadata: languageName: node linkType: hard +"cheerio-select@npm:^2.1.0": + version: 2.1.0 + resolution: "cheerio-select@npm:2.1.0" + dependencies: + boolbase: "npm:^1.0.0" + css-select: "npm:^5.1.0" + css-what: "npm:^6.1.0" + domelementtype: "npm:^2.3.0" + domhandler: "npm:^5.0.3" + domutils: "npm:^3.0.1" + checksum: b5d89208c23468c3a32d1e04f88b9e8c6e332e3649650c5cd29255e2cebc215071ae18563f58c3dc3f6ef4c234488fc486035490fceb78755572288245e2931a + languageName: node + linkType: hard + +"cheerio@npm:^1.0.0-rc.9": + version: 1.0.0-rc.12 + resolution: "cheerio@npm:1.0.0-rc.12" + dependencies: + cheerio-select: "npm:^2.1.0" + dom-serializer: "npm:^2.0.0" + domhandler: "npm:^5.0.3" + domutils: "npm:^3.0.1" + htmlparser2: "npm:^8.0.1" + parse5: "npm:^7.0.0" + parse5-htmlparser2-tree-adapter: "npm:^7.0.0" + checksum: 812fed61aa4b669bbbdd057d0d7f73ba4649cabfd4fc3a8f1d5c7499e4613b430636102716369cbd6bbed8f1bdcb06387ae8342289fb908b2743184775f94f18 + languageName: node + linkType: hard + "chokidar@npm:3.5.3": version: 3.5.3 resolution: "chokidar@npm:3.5.3" @@ -1011,6 +1122,13 @@ __metadata: languageName: node linkType: hard +"chownr@npm:^1.1.1": + version: 1.1.4 + resolution: "chownr@npm:1.1.4" + checksum: 115648f8eb38bac5e41c3857f3e663f9c39ed6480d1349977c4d96c95a47266fcacc5a5aabf3cb6c481e22d72f41992827db47301851766c4fd77ac21a4f081d + languageName: node + linkType: hard + "chownr@npm:^2.0.0": version: 2.0.0 resolution: "chownr@npm:2.0.0" @@ -1054,6 +1172,15 @@ __metadata: languageName: node linkType: hard +"color-convert@npm:^1.9.0": + version: 1.9.3 + resolution: "color-convert@npm:1.9.3" + dependencies: + color-name: "npm:1.1.3" + checksum: ffa319025045f2973919d155f25e7c00d08836b6b33ea2d205418c59bd63a665d713c52d9737a9e0fe467fb194b40fbef1d849bae80d674568ee220a31ef3d10 + languageName: node + linkType: hard + "color-convert@npm:^2.0.1": version: 2.0.1 resolution: "color-convert@npm:2.0.1" @@ -1063,6 +1190,13 @@ __metadata: languageName: node linkType: hard +"color-name@npm:1.1.3": + version: 1.1.3 + resolution: "color-name@npm:1.1.3" + checksum: 09c5d3e33d2105850153b14466501f2bfb30324a2f76568a408763a3b7433b0e50e5b4ab1947868e65cb101bb7cb75029553f2c333b6d4b8138a73fcc133d69d + languageName: node + linkType: hard + "color-name@npm:~1.1.4": version: 1.1.4 resolution: "color-name@npm:1.1.4" @@ -1100,6 +1234,13 @@ __metadata: languageName: node linkType: hard +"commander@npm:^6.2.1": + version: 6.2.1 + resolution: "commander@npm:6.2.1" + checksum: 25b88c2efd0380c84f7844b39cf18510da7bfc5013692d68cdc65f764a1c34e6c8a36ea6d72b6620e3710a930cf8fab2695bdec2bf7107a0f4fa30a3ef3b7d0e + languageName: node + linkType: hard + "concat-map@npm:0.0.1": version: 0.0.1 resolution: "concat-map@npm:0.0.1" @@ -1132,6 +1273,26 @@ __metadata: languageName: node linkType: hard +"css-select@npm:^5.1.0": + version: 5.1.0 + resolution: "css-select@npm:5.1.0" + dependencies: + boolbase: "npm:^1.0.0" + css-what: "npm:^6.1.0" + domhandler: "npm:^5.0.2" + domutils: "npm:^3.0.1" + nth-check: "npm:^2.0.1" + checksum: d486b1e7eb140468218a5ab5af53257e01f937d2173ac46981f6b7de9c5283d55427a36715dc8decfc0c079cf89259ac5b41ef58f6e1a422eee44ab8bfdc78da + languageName: node + linkType: hard + +"css-what@npm:^6.1.0": + version: 6.1.0 + resolution: "css-what@npm:6.1.0" + checksum: c67a3a2d0d81843af87f8bf0a4d0845b0f952377714abbb2884e48942409d57a2110eabee003609d02ee487b054614bdfcfc59ee265728ff105bd5aa221c1d0e + languageName: node + linkType: hard + "debug@npm:4, debug@npm:4.3.4, debug@npm:^4.1.1, debug@npm:^4.3.2, debug@npm:^4.3.3, debug@npm:^4.3.4": version: 4.3.4 resolution: "debug@npm:4.3.4" @@ -1151,6 +1312,22 @@ __metadata: languageName: node linkType: hard +"decompress-response@npm:^6.0.0": + version: 6.0.0 + resolution: "decompress-response@npm:6.0.0" + dependencies: + mimic-response: "npm:^3.1.0" + checksum: d377cf47e02d805e283866c3f50d3d21578b779731e8c5072d6ce8c13cc31493db1c2f6784da9d1d5250822120cefa44f1deab112d5981015f2e17444b763812 + languageName: node + linkType: hard + +"deep-extend@npm:^0.6.0": + version: 0.6.0 + resolution: "deep-extend@npm:0.6.0" + checksum: 7be7e5a8d468d6b10e6a67c3de828f55001b6eb515d014f7aeb9066ce36bd5717161eb47d6a0f7bed8a9083935b465bc163ee2581c8b128d29bf61092fdf57a7 + languageName: node + linkType: hard + "deep-is@npm:^0.1.3": version: 0.1.4 resolution: "deep-is@npm:0.1.4" @@ -1158,6 +1335,17 @@ __metadata: languageName: node linkType: hard +"define-data-property@npm:^1.1.1": + version: 1.1.1 + resolution: "define-data-property@npm:1.1.1" + dependencies: + get-intrinsic: "npm:^1.2.1" + gopd: "npm:^1.0.1" + has-property-descriptors: "npm:^1.0.0" + checksum: 5573c8df96b5857408cad64d9b91b69152e305ce4b06218e5f49b59c6cafdbb90a8bd8a0bb83c7bc67a8d479c04aa697063c9bc28d849b7282f9327586d6bc7b + languageName: node + linkType: hard + "delegates@npm:^1.0.0": version: 1.0.0 resolution: "delegates@npm:1.0.0" @@ -1165,6 +1353,13 @@ __metadata: languageName: node linkType: hard +"detect-libc@npm:^2.0.0": + version: 2.0.2 + resolution: "detect-libc@npm:2.0.2" + checksum: 6118f30c0c425b1e56b9d2609f29bec50d35a6af0b762b6ad127271478f3bbfda7319ce869230cf1a351f2b219f39332cde290858553336d652c77b970f15de8 + languageName: node + linkType: hard + "diff@npm:5.0.0": version: 5.0.0 resolution: "diff@npm:5.0.0" @@ -1190,6 +1385,44 @@ __metadata: languageName: node linkType: hard +"dom-serializer@npm:^2.0.0": + version: 2.0.0 + resolution: "dom-serializer@npm:2.0.0" + dependencies: + domelementtype: "npm:^2.3.0" + domhandler: "npm:^5.0.2" + entities: "npm:^4.2.0" + checksum: e3bf9027a64450bca0a72297ecdc1e3abb7a2912268a9f3f5d33a2e29c1e2c3502c6e9f860fc6625940bfe0cfb57a44953262b9e94df76872fdfb8151097eeb3 + languageName: node + linkType: hard + +"domelementtype@npm:^2.3.0": + version: 2.3.0 + resolution: "domelementtype@npm:2.3.0" + checksum: ee837a318ff702622f383409d1f5b25dd1024b692ef64d3096ff702e26339f8e345820f29a68bcdcea8cfee3531776b3382651232fbeae95612d6f0a75efb4f6 + languageName: node + linkType: hard + +"domhandler@npm:^5.0.2, domhandler@npm:^5.0.3": + version: 5.0.3 + resolution: "domhandler@npm:5.0.3" + dependencies: + domelementtype: "npm:^2.3.0" + checksum: 809b805a50a9c6884a29f38aec0a4e1b4537f40e1c861950ed47d10b049febe6b79ab72adaeeebb3cc8fc1cd33f34e97048a72a9265103426d93efafa78d3e96 + languageName: node + linkType: hard + +"domutils@npm:^3.0.1": + version: 3.1.0 + resolution: "domutils@npm:3.1.0" + dependencies: + dom-serializer: "npm:^2.0.0" + domelementtype: "npm:^2.3.0" + domhandler: "npm:^5.0.3" + checksum: 9a169a6e57ac4c738269a73ab4caf785114ed70e46254139c1bbc8144ac3102aacb28a6149508395ae34aa5d6a40081f4fa5313855dc8319c6d8359866b6dfea + languageName: node + linkType: hard + "eastasianwidth@npm:^0.2.0": version: 0.2.0 resolution: "eastasianwidth@npm:0.2.0" @@ -1198,9 +1431,9 @@ __metadata: linkType: hard "electron-to-chromium@npm:^1.4.535": - version: 1.4.562 - resolution: "electron-to-chromium@npm:1.4.562" - checksum: 9ccf9cc6b1e80b99a309e55b640ae8682aa1b1c54332cfbd50143aec54410885db2a2f1d8f5465058f1fd6c4a4c0de127fda93183088f2335aecd7e8ae861a39 + version: 1.4.565 + resolution: "electron-to-chromium@npm:1.4.565" + checksum: caee9af984e0387ab8bb852c544b0f606c3f20ce26636fb863d121b98be00ad70d86e9f5d8281bc895e0bce8d8243784d276ca1c22041b010ae3df0c9bddf6a7 languageName: node linkType: hard @@ -1227,6 +1460,15 @@ __metadata: languageName: node linkType: hard +"end-of-stream@npm:^1.1.0, end-of-stream@npm:^1.4.1": + version: 1.4.4 + resolution: "end-of-stream@npm:1.4.4" + dependencies: + once: "npm:^1.4.0" + checksum: 530a5a5a1e517e962854a31693dbb5c0b2fc40b46dad2a56a2deec656ca040631124f4795823acc68238147805f8b021abbe221f4afed5ef3c8e8efc2024908b + languageName: node + linkType: hard + "enhanced-resolve@npm:^5.0.0, enhanced-resolve@npm:^5.15.0": version: 5.15.0 resolution: "enhanced-resolve@npm:5.15.0" @@ -1237,6 +1479,20 @@ __metadata: languageName: node linkType: hard +"entities@npm:^4.2.0, entities@npm:^4.4.0": + version: 4.5.0 + resolution: "entities@npm:4.5.0" + checksum: ede2a35c9bce1aeccd055a1b445d41c75a14a2bb1cd22e242f20cf04d236cdcd7f9c859eb83f76885327bfae0c25bf03303665ee1ce3d47c5927b98b0e3e3d48 + languageName: node + linkType: hard + +"entities@npm:~2.1.0": + version: 2.1.0 + resolution: "entities@npm:2.1.0" + checksum: fe71642e42e108540b0324dea03e00f3dbad93617c601bfcf292c3f852c236af3e58469219c4653f6f05df781a446f3b82105b8d26b936d0fa246b0103f2f951 + languageName: node + linkType: hard + "env-paths@npm:^2.2.0": version: 2.2.1 resolution: "env-paths@npm:2.2.1" @@ -1281,6 +1537,13 @@ __metadata: languageName: node linkType: hard +"escape-string-regexp@npm:^1.0.5": + version: 1.0.5 + resolution: "escape-string-regexp@npm:1.0.5" + checksum: 6092fda75c63b110c706b6a9bfde8a612ad595b628f0bd2147eea1d3406723020810e591effc7db1da91d80a71a737a313567c5abb3813e8d9c71f4aa595b410 + languageName: node + linkType: hard + "eslint-scope@npm:5.1.1, eslint-scope@npm:^5.1.1": version: 5.1.1 resolution: "eslint-scope@npm:5.1.1" @@ -1301,31 +1564,25 @@ __metadata: languageName: node linkType: hard -"eslint-visitor-keys@npm:^3.3.0, eslint-visitor-keys@npm:^3.4.1, eslint-visitor-keys@npm:^3.4.2": - version: 3.4.2 - resolution: "eslint-visitor-keys@npm:3.4.2" - checksum: 04e7e9d546ba01611fb7dc9dc3484b088cb3fd7bad90312a8eb8b28bc8bf23aa191b0d45cdabc7ab67a7aaa8966e505aef7ff1571397a045857836a3e107fe6a - languageName: node - linkType: hard - -"eslint-visitor-keys@npm:^3.4.3": +"eslint-visitor-keys@npm:^3.3.0, eslint-visitor-keys@npm:^3.4.1, eslint-visitor-keys@npm:^3.4.3": version: 3.4.3 resolution: "eslint-visitor-keys@npm:3.4.3" checksum: 3f357c554a9ea794b094a09bd4187e5eacd1bc0d0653c3adeb87962c548e6a1ab8f982b86963ae1337f5d976004146536dcee5d0e2806665b193fbfbf1a9231b languageName: node linkType: hard -"eslint@npm:^8.41.0": - version: 8.51.0 - resolution: "eslint@npm:8.51.0" +"eslint@npm:^8.41.0, eslint@npm:^8.46.0": + version: 8.52.0 + resolution: "eslint@npm:8.52.0" dependencies: "@eslint-community/eslint-utils": "npm:^4.2.0" "@eslint-community/regexpp": "npm:^4.6.1" "@eslint/eslintrc": "npm:^2.1.2" - "@eslint/js": "npm:8.51.0" - "@humanwhocodes/config-array": "npm:^0.11.11" + "@eslint/js": "npm:8.52.0" + "@humanwhocodes/config-array": "npm:^0.11.13" "@humanwhocodes/module-importer": "npm:^1.0.1" "@nodelib/fs.walk": "npm:^1.2.8" + "@ungap/structured-clone": "npm:^1.2.0" ajv: "npm:^6.12.4" chalk: "npm:^4.0.0" cross-spawn: "npm:^7.0.2" @@ -1358,54 +1615,7 @@ __metadata: text-table: "npm:^0.2.0" bin: eslint: bin/eslint.js - checksum: 1f3720dd2a8e25198815c33720dd66ceee88d7527b3b6f2da57b57d0476440af29da2a1d9f28515660afb3345e4f84438562772d6b5fc19b6fab7c77c478ebca - languageName: node - linkType: hard - -"eslint@npm:^8.46.0": - version: 8.46.0 - resolution: "eslint@npm:8.46.0" - dependencies: - "@eslint-community/eslint-utils": "npm:^4.2.0" - "@eslint-community/regexpp": "npm:^4.6.1" - "@eslint/eslintrc": "npm:^2.1.1" - "@eslint/js": "npm:^8.46.0" - "@humanwhocodes/config-array": "npm:^0.11.10" - "@humanwhocodes/module-importer": "npm:^1.0.1" - "@nodelib/fs.walk": "npm:^1.2.8" - ajv: "npm:^6.12.4" - chalk: "npm:^4.0.0" - cross-spawn: "npm:^7.0.2" - debug: "npm:^4.3.2" - doctrine: "npm:^3.0.0" - escape-string-regexp: "npm:^4.0.0" - eslint-scope: "npm:^7.2.2" - eslint-visitor-keys: "npm:^3.4.2" - espree: "npm:^9.6.1" - esquery: "npm:^1.4.2" - esutils: "npm:^2.0.2" - fast-deep-equal: "npm:^3.1.3" - file-entry-cache: "npm:^6.0.1" - find-up: "npm:^5.0.0" - glob-parent: "npm:^6.0.2" - globals: "npm:^13.19.0" - graphemer: "npm:^1.4.0" - ignore: "npm:^5.2.0" - imurmurhash: "npm:^0.1.4" - is-glob: "npm:^4.0.0" - is-path-inside: "npm:^3.0.3" - js-yaml: "npm:^4.1.0" - json-stable-stringify-without-jsonify: "npm:^1.0.1" - levn: "npm:^0.4.1" - lodash.merge: "npm:^4.6.2" - minimatch: "npm:^3.1.2" - natural-compare: "npm:^1.4.0" - optionator: "npm:^0.9.3" - strip-ansi: "npm:^6.0.1" - text-table: "npm:^0.2.0" - bin: - eslint: bin/eslint.js - checksum: 576f680afe92c82d9e080aa676b94604dce53b3b0bdcf1fe12c5120263d8548cfa9299e7f7ef367fc076a6f535fe580ebb15d36b9b7dbe6be12267ffa24cfd83 + checksum: 01784ab15351d749bc95446039ed7acd5124f7cc84acdbf98c7199272eae06212a8f3ea4a9b47e7cc54ab17ca094c3a664bbfc3002c7de27936220e278b5028a languageName: node linkType: hard @@ -1466,6 +1676,13 @@ __metadata: languageName: node linkType: hard +"expand-template@npm:^2.0.3": + version: 2.0.3 + resolution: "expand-template@npm:2.0.3" + checksum: 588c19847216421ed92befb521767b7018dc88f88b0576df98cb242f20961425e96a92cbece525ef28cc5becceae5d544ae0f5b9b5e2aa05acb13716ca5b3099 + languageName: node + linkType: hard + "exponential-backoff@npm:^3.1.1": version: 3.1.1 resolution: "exponential-backoff@npm:3.1.1" @@ -1523,6 +1740,15 @@ __metadata: languageName: node linkType: hard +"fd-slicer@npm:~1.1.0": + version: 1.1.0 + resolution: "fd-slicer@npm:1.1.0" + dependencies: + pend: "npm:~1.2.0" + checksum: db3e34fa483b5873b73f248e818f8a8b59a6427fd8b1436cd439c195fdf11e8659419404826059a642b57d18075c856d06d6a50a1413b714f12f833a9341ead3 + languageName: node + linkType: hard + "file-entry-cache@npm:^6.0.1": version: 6.0.1 resolution: "file-entry-cache@npm:6.0.1" @@ -1562,12 +1788,13 @@ __metadata: linkType: hard "flat-cache@npm:^3.0.4": - version: 3.0.4 - resolution: "flat-cache@npm:3.0.4" + version: 3.1.1 + resolution: "flat-cache@npm:3.1.1" dependencies: - flatted: "npm:^3.1.0" + flatted: "npm:^3.2.9" + keyv: "npm:^4.5.3" rimraf: "npm:^3.0.2" - checksum: 9fe5d0cb97c988e3b25242e71346965fae22757674db3fca14206850af2efa3ca3b04a3ba0eba8d5e20fd8a3be80a2e14b1c2917e70ffe1acb98a8c3327e4c9f + checksum: 04b57c7cb4bd54f1e80a335f037bff467cc7b2479ecc015ff7e78fd41aa12777757d55836e99c7e5faca2271eb204a96bf109b4d98c36c20c3b98cf1372b5592 languageName: node linkType: hard @@ -1580,10 +1807,10 @@ __metadata: languageName: node linkType: hard -"flatted@npm:^3.1.0": - version: 3.2.7 - resolution: "flatted@npm:3.2.7" - checksum: 427633049d55bdb80201c68f7eb1cbd533e03eac541f97d3aecab8c5526f12a20ccecaeede08b57503e772c769e7f8680b37e8d482d1e5f8d7e2194687f9ea35 +"flatted@npm:^3.2.9": + version: 3.2.9 + resolution: "flatted@npm:3.2.9" + checksum: dc2b89e46a2ebde487199de5a4fcb79e8c46f984043fea5c41dbf4661eb881fefac1c939b5bdcd8a09d7f960ec364f516970c7ec44e58ff451239c07fd3d419b languageName: node linkType: hard @@ -1597,6 +1824,13 @@ __metadata: languageName: node linkType: hard +"fs-constants@npm:^1.0.0": + version: 1.0.0 + resolution: "fs-constants@npm:1.0.0" + checksum: 18f5b718371816155849475ac36c7d0b24d39a11d91348cfcb308b4494824413e03572c403c86d3a260e049465518c4f0d5bd00f0371cdfcad6d4f30a85b350d + languageName: node + linkType: hard + "fs-minipass@npm:^2.0.0": version: 2.1.0 resolution: "fs-minipass@npm:2.1.0" @@ -1641,6 +1875,13 @@ __metadata: languageName: node linkType: hard +"function-bind@npm:^1.1.2": + version: 1.1.2 + resolution: "function-bind@npm:1.1.2" + checksum: 185e20d20f10c8d661d59aac0f3b63b31132d492e1b11fcc2a93cb2c47257ebaee7407c38513efd2b35cafdf972d9beb2ea4593c1e0f3bf8f2744836928d7454 + languageName: node + linkType: hard + "gauge@npm:^4.0.3": version: 4.0.4 resolution: "gauge@npm:4.0.4" @@ -1664,6 +1905,25 @@ __metadata: languageName: node linkType: hard +"get-intrinsic@npm:^1.0.2, get-intrinsic@npm:^1.1.3, get-intrinsic@npm:^1.2.1, get-intrinsic@npm:^1.2.2": + version: 1.2.2 + resolution: "get-intrinsic@npm:1.2.2" + dependencies: + function-bind: "npm:^1.1.2" + has-proto: "npm:^1.0.1" + has-symbols: "npm:^1.0.3" + hasown: "npm:^2.0.0" + checksum: aa96db4f809734d26d49b59bc8669d73a0ae792da561514e987735573a1dfaede516cd102f217a078ea2b42d4c4fb1f83d487932cb15d49826b726cc9cd4470b + languageName: node + linkType: hard + +"github-from-package@npm:0.0.0": + version: 0.0.0 + resolution: "github-from-package@npm:0.0.0" + checksum: 2a091ba07fbce22205642543b4ea8aaf068397e1433c00ae0f9de36a3607baf5bcc14da97fbb798cfca6393b3c402031fca06d8b491a44206d6efef391c58537 + languageName: node + linkType: hard + "glob-parent@npm:^5.1.2, glob-parent@npm:~5.1.2": version: 5.1.2 resolution: "glob-parent@npm:5.1.2" @@ -1704,21 +1964,21 @@ __metadata: linkType: hard "glob@npm:^10.2.2": - version: 10.3.4 - resolution: "glob@npm:10.3.4" + version: 10.3.10 + resolution: "glob@npm:10.3.10" dependencies: foreground-child: "npm:^3.1.0" - jackspeak: "npm:^2.0.3" + jackspeak: "npm:^2.3.5" minimatch: "npm:^9.0.1" minipass: "npm:^5.0.0 || ^6.0.2 || ^7.0.0" path-scurry: "npm:^1.10.1" bin: - glob: dist/cjs/src/bin.js - checksum: 6375721bcd0c615fe4c1d61faaf9eb93e15d428f26bac6e85739221a84659b42601b2a085b20915142c0eb3d8a7155914884ff80f145d8c9f2397c8b771b8b60 + glob: dist/esm/bin.mjs + checksum: 38bdb2c9ce75eb5ed168f309d4ed05b0798f640b637034800a6bf306f39d35409bf278b0eaaffaec07591085d3acb7184a201eae791468f0f617771c2486a6a8 languageName: node linkType: hard -"glob@npm:^7.1.3, glob@npm:^7.1.4": +"glob@npm:^7.0.6, glob@npm:^7.1.3, glob@npm:^7.1.4": version: 7.2.3 resolution: "glob@npm:7.2.3" dependencies: @@ -1746,11 +2006,11 @@ __metadata: linkType: hard "globals@npm:^13.19.0": - version: 13.20.0 - resolution: "globals@npm:13.20.0" + version: 13.23.0 + resolution: "globals@npm:13.23.0" dependencies: type-fest: "npm:^0.20.2" - checksum: 9df85cde2f0dce6ac9b3a5e08bec109d2f3b38ddd055a83867e0672c55704866d53ce6a4265859fa630624baadd46f50ca38602a13607ad86be853a8c179d3e7 + checksum: bf6a8616f4a64959c0b9a8eb4dc8a02e7dd0082385f7f06bc9694d9fceabe39f83f83789322cfe0470914dc8b273b7a29af5570b9e1a0507d3fb7348a64703a3 languageName: node linkType: hard @@ -1768,6 +2028,15 @@ __metadata: languageName: node linkType: hard +"gopd@npm:^1.0.1": + version: 1.0.1 + resolution: "gopd@npm:1.0.1" + dependencies: + get-intrinsic: "npm:^1.1.3" + checksum: 5fbc7ad57b368ae4cd2f41214bd947b045c1a4be2f194a7be1778d71f8af9dbf4004221f3b6f23e30820eb0d052b4f819fe6ebe8221e2a3c6f0ee4ef173421ca + languageName: node + linkType: hard + "graceful-fs@npm:^4.1.2, graceful-fs@npm:^4.2.4, graceful-fs@npm:^4.2.6, graceful-fs@npm:^4.2.9": version: 4.2.11 resolution: "graceful-fs@npm:4.2.11" @@ -1782,6 +2051,13 @@ __metadata: languageName: node linkType: hard +"has-flag@npm:^3.0.0": + version: 3.0.0 + resolution: "has-flag@npm:3.0.0" + checksum: 4a15638b454bf086c8148979aae044dd6e39d63904cd452d970374fa6a87623423da485dfb814e7be882e05c096a7ccf1ebd48e7e7501d0208d8384ff4dea73b + languageName: node + linkType: hard + "has-flag@npm:^4.0.0": version: 4.0.0 resolution: "has-flag@npm:4.0.0" @@ -1789,6 +2065,29 @@ __metadata: languageName: node linkType: hard +"has-property-descriptors@npm:^1.0.0": + version: 1.0.1 + resolution: "has-property-descriptors@npm:1.0.1" + dependencies: + get-intrinsic: "npm:^1.2.2" + checksum: 21a47bb080a24e79594aef1ce71e1a18a1c5ab4120308e218088f67ebb7f6f408847541e2d96e5bd00e90eef5c5a49e4ebbdc8fc2d5b365a2c379aef071642f0 + languageName: node + linkType: hard + +"has-proto@npm:^1.0.1": + version: 1.0.1 + resolution: "has-proto@npm:1.0.1" + checksum: eab2ab0ed1eae6d058b9bbc4c1d99d2751b29717be80d02fd03ead8b62675488de0c7359bc1fdd4b87ef6fd11e796a9631ad4d7452d9324fdada70158c2e5be7 + languageName: node + linkType: hard + +"has-symbols@npm:^1.0.3": + version: 1.0.3 + resolution: "has-symbols@npm:1.0.3" + checksum: 464f97a8202a7690dadd026e6d73b1ceeddd60fe6acfd06151106f050303eaa75855aaa94969df8015c11ff7c505f196114d22f7386b4a471038da5874cf5e9b + languageName: node + linkType: hard + "has-unicode@npm:^2.0.1": version: 2.0.1 resolution: "has-unicode@npm:2.0.1" @@ -1796,10 +2095,12 @@ __metadata: languageName: node linkType: hard -"has@npm:^1.0.3": - version: 1.0.4 - resolution: "has@npm:1.0.4" - checksum: c245f332fe78c7b6b8753857240ac12b3286f995f656a33c77e0f5baab7d0157e6ddb1c34940ffd2bffc51f75ede50cd8b29ff65c13e336376aca8cf3df58043 +"hasown@npm:^2.0.0": + version: 2.0.0 + resolution: "hasown@npm:2.0.0" + dependencies: + function-bind: "npm:^1.1.2" + checksum: c330f8d93f9d23fe632c719d4db3d698ef7d7c367d51548b836069e06a90fa9151e868c8e67353cfe98d67865bf7354855db28fa36eb1b18fa5d4a3f4e7f1c90 languageName: node linkType: hard @@ -1812,6 +2113,27 @@ __metadata: languageName: node linkType: hard +"hosted-git-info@npm:^4.0.2": + version: 4.1.0 + resolution: "hosted-git-info@npm:4.1.0" + dependencies: + lru-cache: "npm:^6.0.0" + checksum: 4dc67022b7ecb12829966bd731fb9a5f14d351547aafc6520ef3c8e7211f4f0e69452d24e29eae3d9b17df924d660052e53d8ca321cf3008418fb7e6c7c47d6f + languageName: node + linkType: hard + +"htmlparser2@npm:^8.0.1": + version: 8.0.2 + resolution: "htmlparser2@npm:8.0.2" + dependencies: + domelementtype: "npm:^2.3.0" + domhandler: "npm:^5.0.3" + domutils: "npm:^3.0.1" + entities: "npm:^4.4.0" + checksum: ea5512956eee06f5835add68b4291d313c745e8407efa63848f4b8a90a2dee45f498a698bca8614e436f1ee0cfdd609938b71d67c693794545982b76e53e6f11 + languageName: node + linkType: hard + "http-cache-semantics@npm:^4.1.1": version: 4.1.1 resolution: "http-cache-semantics@npm:4.1.1" @@ -1878,6 +2200,13 @@ __metadata: languageName: node linkType: hard +"ieee754@npm:^1.1.13": + version: 1.2.1 + resolution: "ieee754@npm:1.2.1" + checksum: d9f2557a59036f16c282aaeb107832dc957a93d73397d89bbad4eb1130560560eb695060145e8e6b3b498b15ab95510226649a0b8f52ae06583575419fe10fc4 + languageName: node + linkType: hard + "ignore@npm:^5.2.0": version: 5.2.4 resolution: "ignore@npm:5.2.4" @@ -1938,13 +2267,20 @@ __metadata: languageName: node linkType: hard -"inherits@npm:2, inherits@npm:^2.0.3, inherits@npm:~2.0.3": +"inherits@npm:2, inherits@npm:^2.0.3, inherits@npm:^2.0.4, inherits@npm:~2.0.3": version: 2.0.4 resolution: "inherits@npm:2.0.4" checksum: cd45e923bee15186c07fa4c89db0aace24824c482fb887b528304694b2aa6ff8a898da8657046a5dcf3e46cd6db6c61629551f9215f208d7c3f157cf9b290521 languageName: node linkType: hard +"ini@npm:~1.3.0": + version: 1.3.8 + resolution: "ini@npm:1.3.8" + checksum: 314ae176e8d4deb3def56106da8002b462221c174ddb7ce0c49ee72c8cd1f9044f7b10cc555a7d8850982c3b9ca96fc212122749f5234bc2b6fb05fb942ed566 + languageName: node + linkType: hard + "interpret@npm:^3.1.1": version: 3.1.1 resolution: "interpret@npm:3.1.1" @@ -1969,11 +2305,11 @@ __metadata: linkType: hard "is-core-module@npm:^2.13.0": - version: 2.13.0 - resolution: "is-core-module@npm:2.13.0" + version: 2.13.1 + resolution: "is-core-module@npm:2.13.1" dependencies: - has: "npm:^1.0.3" - checksum: 55ccb5ccd208a1e088027065ee6438a99367e4c31c366b52fbaeac8fa23111cd17852111836d904da604801b3286d38d3d1ffa6cd7400231af8587f021099dc6 + hasown: "npm:^2.0.0" + checksum: d53bd0cc24b0a0351fb4b206ee3908f71b9bbf1c47e9c9e14e5f06d292af1663704d2abd7e67700d6487b2b7864e0d0f6f10a1edf1892864bdffcb197d1845a2 languageName: node linkType: hard @@ -2065,16 +2401,16 @@ __metadata: languageName: node linkType: hard -"jackspeak@npm:^2.0.3": - version: 2.3.3 - resolution: "jackspeak@npm:2.3.3" +"jackspeak@npm:^2.3.5": + version: 2.3.6 + resolution: "jackspeak@npm:2.3.6" dependencies: "@isaacs/cliui": "npm:^8.0.2" "@pkgjs/parseargs": "npm:^0.11.0" dependenciesMeta: "@pkgjs/parseargs": optional: true - checksum: a4c7c1a3ffea90bbcaa2f7a0d2885861e94138982aef0ced8efd299b32ccb69645b49d27f5e3e81c57005002674dd7e2b5d08a4287e9110534e512ada53557b2 + checksum: 6e6490d676af8c94a7b5b29b8fd5629f21346911ebe2e32931c2a54210134408171c24cee1a109df2ec19894ad04a429402a8438cbf5cc2794585d35428ace76 languageName: node linkType: hard @@ -2100,6 +2436,13 @@ __metadata: languageName: node linkType: hard +"json-buffer@npm:3.0.1": + version: 3.0.1 + resolution: "json-buffer@npm:3.0.1" + checksum: 82876154521b7b68ba71c4f969b91572d1beabadd87bd3a6b236f85fbc7dc4695089191ed60bb59f9340993c51b33d479f45b6ba9f3548beb519705281c32c3c + languageName: node + linkType: hard + "json-parse-even-better-errors@npm:^2.3.1": version: 2.3.1 resolution: "json-parse-even-better-errors@npm:2.3.1" @@ -2121,6 +2464,13 @@ __metadata: languageName: node linkType: hard +"jsonc-parser@npm:^3.2.0": + version: 3.2.0 + resolution: "jsonc-parser@npm:3.2.0" + checksum: bd68b902e5f9394f01da97921f49c5084b2dc03a0c5b4fdb2a429f8d6f292686c1bf87badaeb0a8148d024192a88f5ad2e57b2918ba43fe25cf15f3371db64d4 + languageName: node + linkType: hard + "jszip@npm:^3.10.1": version: 3.10.1 resolution: "jszip@npm:3.10.1" @@ -2133,6 +2483,26 @@ __metadata: languageName: node linkType: hard +"keytar@npm:^7.7.0": + version: 7.9.0 + resolution: "keytar@npm:7.9.0" + dependencies: + node-addon-api: "npm:^4.3.0" + node-gyp: "npm:latest" + prebuild-install: "npm:^7.0.1" + checksum: 904795bc304f8ad89b80f915c869a941a383312b58584212a199473d18647035cfda92a9c53e6c53bf13ea0fed23037c9597eb418a5c71ee9454f140f026fac9 + languageName: node + linkType: hard + +"keyv@npm:^4.5.3": + version: 4.5.4 + resolution: "keyv@npm:4.5.4" + dependencies: + json-buffer: "npm:3.0.1" + checksum: 167eb6ef64cc84b6fa0780ee50c9de456b422a1e18802209234f7c2cf7eae648c7741f32e50d7e24ccb22b24c13154070b01563d642755b156c357431a191e75 + languageName: node + linkType: hard + "kind-of@npm:^6.0.2": version: 6.0.3 resolution: "kind-of@npm:6.0.3" @@ -2140,6 +2510,13 @@ __metadata: languageName: node linkType: hard +"leven@npm:^3.1.0": + version: 3.1.0 + resolution: "leven@npm:3.1.0" + checksum: 638401d534585261b6003db9d99afd244dfe82d75ddb6db5c0df412842d5ab30b2ef18de471aaec70fe69a46f17b4ae3c7f01d8a4e6580ef7adb9f4273ad1e55 + languageName: node + linkType: hard + "levn@npm:^0.4.1": version: 0.4.1 resolution: "levn@npm:0.4.1" @@ -2159,6 +2536,15 @@ __metadata: languageName: node linkType: hard +"linkify-it@npm:^3.0.1": + version: 3.0.3 + resolution: "linkify-it@npm:3.0.3" + dependencies: + uc.micro: "npm:^1.0.1" + checksum: 1ed466b02ad361bb5e5b94a81232fc126890751038bf3e61f648f4ccb01e5e096bba66c3eff3d21ed5e3da738de0dc29783afedf0255733669889aa09d49e47e + languageName: node + linkType: hard + "loader-runner@npm:^4.2.0": version: 4.3.0 resolution: "loader-runner@npm:4.3.0" @@ -2247,6 +2633,28 @@ __metadata: languageName: node linkType: hard +"markdown-it@npm:^12.3.2": + version: 12.3.2 + resolution: "markdown-it@npm:12.3.2" + dependencies: + argparse: "npm:^2.0.1" + entities: "npm:~2.1.0" + linkify-it: "npm:^3.0.1" + mdurl: "npm:^1.0.1" + uc.micro: "npm:^1.0.5" + bin: + markdown-it: bin/markdown-it.js + checksum: d83d794bfb9f5e05750b25db401d9c1f9b97c6bbabb6cfd78988bb98652c62c24417435487238e2b91fd4e495547ae8c9429fb4c69e9f5bf49bd0dd292d53f24 + languageName: node + linkType: hard + +"mdurl@npm:^1.0.1": + version: 1.0.1 + resolution: "mdurl@npm:1.0.1" + checksum: ada367d01c9e81d07328101f187d5bd8641b71f33eab075df4caed935a24fa679e625f07108801d8250a5e4a99e5cd4be7679957a11424a3aa3e740d2bb2d5cb + languageName: node + linkType: hard + "merge-stream@npm:^2.0.0": version: 2.0.0 resolution: "merge-stream@npm:2.0.0" @@ -2287,6 +2695,22 @@ __metadata: languageName: node linkType: hard +"mime@npm:^1.3.4": + version: 1.6.0 + resolution: "mime@npm:1.6.0" + bin: + mime: cli.js + checksum: b7d98bb1e006c0e63e2c91b590fe1163b872abf8f7ef224d53dd31499c2197278a6d3d0864c45239b1a93d22feaf6f9477e9fc847eef945838150b8c02d03170 + languageName: node + linkType: hard + +"mimic-response@npm:^3.1.0": + version: 3.1.0 + resolution: "mimic-response@npm:3.1.0" + checksum: 7e719047612411fe071332a7498cf0448bbe43c485c0d780046c76633a771b223ff49bd00267be122cedebb897037fdb527df72335d0d0f74724604ca70b37ad + languageName: node + linkType: hard + "minimatch@npm:5.0.1": version: 5.0.1 resolution: "minimatch@npm:5.0.1" @@ -2296,7 +2720,7 @@ __metadata: languageName: node linkType: hard -"minimatch@npm:^3.0.4, minimatch@npm:^3.0.5, minimatch@npm:^3.1.1, minimatch@npm:^3.1.2": +"minimatch@npm:^3.0.3, minimatch@npm:^3.0.4, minimatch@npm:^3.0.5, minimatch@npm:^3.1.1, minimatch@npm:^3.1.2": version: 3.1.2 resolution: "minimatch@npm:3.1.2" dependencies: @@ -2323,6 +2747,13 @@ __metadata: languageName: node linkType: hard +"minimist@npm:^1.2.0, minimist@npm:^1.2.3": + version: 1.2.8 + resolution: "minimist@npm:1.2.8" + checksum: 908491b6cc15a6c440ba5b22780a0ba89b9810e1aea684e253e43c4e3b8d56ec1dcdd7ea96dde119c29df59c936cde16062159eae4225c691e19c70b432b6e6f + languageName: node + linkType: hard + "minipass-collect@npm:^1.0.2": version: 1.0.2 resolution: "minipass-collect@npm:1.0.2" @@ -2391,9 +2822,9 @@ __metadata: linkType: hard "minipass@npm:^5.0.0 || ^6.0.2 || ^7.0.0, minipass@npm:^7.0.3": - version: 7.0.3 - resolution: "minipass@npm:7.0.3" - checksum: 04d72c8a437de54a024f3758ff17c0226efb532ef37dbdaca1ea6039c7b9b1704e612abbd2e3a0d2c825c64eb0a9ab266c843baa71d18ad1a279baecee28ed97 + version: 7.0.4 + resolution: "minipass@npm:7.0.4" + checksum: e864bd02ceb5e0707696d58f7ce3a0b89233f0d686ef0d447a66db705c0846a8dc6f34865cd85256c1472ff623665f616b90b8ff58058b2ad996c5de747d2d18 languageName: node linkType: hard @@ -2407,6 +2838,13 @@ __metadata: languageName: node linkType: hard +"mkdirp-classic@npm:^0.5.2, mkdirp-classic@npm:^0.5.3": + version: 0.5.3 + resolution: "mkdirp-classic@npm:0.5.3" + checksum: 3f4e088208270bbcc148d53b73e9a5bd9eef05ad2cbf3b3d0ff8795278d50dd1d11a8ef1875ff5aea3fa888931f95bfcb2ad5b7c1061cfefd6284d199e6776ac + languageName: node + linkType: hard + "mkdirp@npm:^1.0.3": version: 1.0.4 resolution: "mkdirp@npm:1.0.4" @@ -2462,6 +2900,13 @@ __metadata: languageName: node linkType: hard +"mute-stream@npm:~0.0.4": + version: 0.0.8 + resolution: "mute-stream@npm:0.0.8" + checksum: a2d2e79dde87e3424ffc8c334472c7f3d17b072137734ca46e6f221131f1b014201cc593b69a38062e974fb2394d3d1cb4349f80f012bbf8b8ac1b28033e515f + languageName: node + linkType: hard + "nanoid@npm:3.3.3": version: 3.3.3 resolution: "nanoid@npm:3.3.3" @@ -2471,6 +2916,13 @@ __metadata: languageName: node linkType: hard +"napi-build-utils@npm:^1.0.1": + version: 1.0.2 + resolution: "napi-build-utils@npm:1.0.2" + checksum: 276feb8e30189fe18718e85b6f82e4f952822baa2e7696f771cc42571a235b789dc5907a14d9ffb6838c3e4ff4c25717c2575e5ce1cf6e02e496e204c11e57f6 + languageName: node + linkType: hard + "natural-compare-lite@npm:^1.4.0": version: 1.4.0 resolution: "natural-compare-lite@npm:1.4.0" @@ -2499,6 +2951,24 @@ __metadata: languageName: node linkType: hard +"node-abi@npm:^3.3.0": + version: 3.51.0 + resolution: "node-abi@npm:3.51.0" + dependencies: + semver: "npm:^7.3.5" + checksum: 7ab89e7ecfee46cfa33b5687e57d55d25472af46f0df79876fa6b0a00ba4d72cd66519462ca269d42d19a789f177f5d0b17c1d0f201572704e63bcc7de9a75c4 + languageName: node + linkType: hard + +"node-addon-api@npm:^4.3.0": + version: 4.3.0 + resolution: "node-addon-api@npm:4.3.0" + dependencies: + node-gyp: "npm:latest" + checksum: d3b38d16cb9ad0714d965331d0e38cef1c27750c2c3343cd3464a9ed8158501a2910ccbf2fd9fdc476e806a19dbc9e0524ff9d66a7c779d42a9752a63ba30b80 + languageName: node + linkType: hard + "node-gyp@npm:latest": version: 9.4.0 resolution: "node-gyp@npm:9.4.0" @@ -2557,7 +3027,23 @@ __metadata: languageName: node linkType: hard -"once@npm:^1.3.0": +"nth-check@npm:^2.0.1": + version: 2.1.1 + resolution: "nth-check@npm:2.1.1" + dependencies: + boolbase: "npm:^1.0.0" + checksum: 5afc3dafcd1573b08877ca8e6148c52abd565f1d06b1eb08caf982e3fa289a82f2cae697ffb55b5021e146d60443f1590a5d6b944844e944714a5b549675bcd3 + languageName: node + linkType: hard + +"object-inspect@npm:^1.9.0": + version: 1.13.1 + resolution: "object-inspect@npm:1.13.1" + checksum: 92f4989ed83422d56431bc39656d4c780348eb15d397ce352ade6b7fec08f973b53744bd41b94af021901e61acaf78fcc19e65bf464ecc0df958586a672700f0 + languageName: node + linkType: hard + +"once@npm:^1.3.0, once@npm:^1.3.1, once@npm:^1.4.0": version: 1.4.0 resolution: "once@npm:1.4.0" dependencies: @@ -2599,10 +3085,11 @@ __metadata: "@types/glob": "npm:^8.1.0" "@types/mocha": "npm:^10.0.1" "@types/node": "npm:20.2.5" - "@types/vscode": "npm:^1.83.0" + "@types/vscode": "npm:^1.75.0" "@typescript-eslint/eslint-plugin": "npm:^5.59.8" "@typescript-eslint/parser": "npm:^5.59.8" "@vscode/test-electron": "npm:^2.3.2" + "@vscode/vsce": "npm:2.21.1" eslint: "npm:^8.41.0" glob: "npm:^8.1.0" mocha: "npm:^10.2.0" @@ -2698,6 +3185,34 @@ __metadata: languageName: node linkType: hard +"parse-semver@npm:^1.1.1": + version: 1.1.1 + resolution: "parse-semver@npm:1.1.1" + dependencies: + semver: "npm:^5.1.0" + checksum: 15ae06553a4ef745adfead1714b8e3253aa98cbff3212551917ff4e646a2e031f4cd11bf1bd7ba2e7a7fb4f5b4816d9dddb4d783ae487b9fb4a767b6af6b2f78 + languageName: node + linkType: hard + +"parse5-htmlparser2-tree-adapter@npm:^7.0.0": + version: 7.0.0 + resolution: "parse5-htmlparser2-tree-adapter@npm:7.0.0" + dependencies: + domhandler: "npm:^5.0.2" + parse5: "npm:^7.0.0" + checksum: 23dbe45fdd338fe726cf5c55b236e1f403aeb0c1b926e18ab8ef0aa580980a25f8492d160fe2ed0ec906c3c8e38b51e68ef5620a3b9460d9458ea78946a3f7c0 + languageName: node + linkType: hard + +"parse5@npm:^7.0.0": + version: 7.1.2 + resolution: "parse5@npm:7.1.2" + dependencies: + entities: "npm:^4.4.0" + checksum: 3c86806bb0fb1e9a999ff3a4c883b1ca243d99f45a619a0898dbf021a95a0189ed955c31b07fe49d342b54e814f33f2c9d7489198e8630dacd5477d413ec5782 + languageName: node + linkType: hard + "path-exists@npm:^4.0.0": version: 4.0.0 resolution: "path-exists@npm:4.0.0" @@ -2743,6 +3258,13 @@ __metadata: languageName: node linkType: hard +"pend@npm:~1.2.0": + version: 1.2.0 + resolution: "pend@npm:1.2.0" + checksum: 6c72f5243303d9c60bd98e6446ba7d30ae29e3d56fdb6fae8767e8ba6386f33ee284c97efe3230a0d0217e2b1723b8ab490b1bbf34fcbb2180dbc8a9de47850d + languageName: node + linkType: hard + "picocolors@npm:^1.0.0": version: 1.0.0 resolution: "picocolors@npm:1.0.0" @@ -2766,6 +3288,28 @@ __metadata: languageName: node linkType: hard +"prebuild-install@npm:^7.0.1": + version: 7.1.1 + resolution: "prebuild-install@npm:7.1.1" + dependencies: + detect-libc: "npm:^2.0.0" + expand-template: "npm:^2.0.3" + github-from-package: "npm:0.0.0" + minimist: "npm:^1.2.3" + mkdirp-classic: "npm:^0.5.3" + napi-build-utils: "npm:^1.0.1" + node-abi: "npm:^3.3.0" + pump: "npm:^3.0.0" + rc: "npm:^1.2.7" + simple-get: "npm:^4.0.0" + tar-fs: "npm:^2.0.0" + tunnel-agent: "npm:^0.6.0" + bin: + prebuild-install: bin.js + checksum: 6c70a2f82fbda8903497c560a761b000d861a3e772322c8bed012be0f0a084b5aaca4438a3fad1bd3a24210765f4fae06ddd89ea04dc4c034dde693cc0d9d5f4 + languageName: node + linkType: hard + "prelude-ls@npm:^1.2.1": version: 1.2.1 resolution: "prelude-ls@npm:1.2.1" @@ -2774,11 +3318,11 @@ __metadata: linkType: hard "prettier@npm:^3.0.0": - version: 3.0.0 - resolution: "prettier@npm:3.0.0" + version: 3.0.3 + resolution: "prettier@npm:3.0.3" bin: prettier: bin/prettier.cjs - checksum: 399292638280988ecd44db6532e908246b7c9468e6f5f571b3835a5206b7f1132cb674c12be430d921474901dc85398429dfd2dc31b282eef9affebd3ce72cef + checksum: ccf1ead9794b017be6b42d0873f459070beef2069eb393c8b4c0d11aa3430acefc54f6d5f44a5b7ce9af05ad8daf694b912f0aa2808d1c22dfa86e61e9d563f8 languageName: node linkType: hard @@ -2799,6 +3343,16 @@ __metadata: languageName: node linkType: hard +"pump@npm:^3.0.0": + version: 3.0.0 + resolution: "pump@npm:3.0.0" + dependencies: + end-of-stream: "npm:^1.1.0" + once: "npm:^1.3.1" + checksum: e42e9229fba14732593a718b04cb5e1cfef8254544870997e0ecd9732b189a48e1256e4e5478148ecb47c8511dca2b09eae56b4d0aad8009e6fac8072923cfc9 + languageName: node + linkType: hard + "punycode@npm:^2.1.0": version: 2.3.0 resolution: "punycode@npm:2.3.0" @@ -2806,6 +3360,15 @@ __metadata: languageName: node linkType: hard +"qs@npm:^6.9.1": + version: 6.11.2 + resolution: "qs@npm:6.11.2" + dependencies: + side-channel: "npm:^1.0.4" + checksum: f2321d0796664d0f94e92447ccd3bdfd6b6f3a50b6b762aa79d7f5b1ea3a7a9f94063ba896b82bc2a877ed6a7426d4081e4f16568fdb04f0ee188cca9d8505b4 + languageName: node + linkType: hard + "queue-microtask@npm:^1.2.2": version: 1.2.3 resolution: "queue-microtask@npm:1.2.3" @@ -2822,7 +3385,30 @@ __metadata: languageName: node linkType: hard -"readable-stream@npm:^3.6.0": +"rc@npm:^1.2.7": + version: 1.2.8 + resolution: "rc@npm:1.2.8" + dependencies: + deep-extend: "npm:^0.6.0" + ini: "npm:~1.3.0" + minimist: "npm:^1.2.0" + strip-json-comments: "npm:~2.0.1" + bin: + rc: ./cli.js + checksum: 5c4d72ae7eec44357171585938c85ce066da8ca79146b5635baf3d55d74584c92575fa4e2c9eac03efbed3b46a0b2e7c30634c012b4b4fa40d654353d3c163eb + languageName: node + linkType: hard + +"read@npm:^1.0.7": + version: 1.0.7 + resolution: "read@npm:1.0.7" + dependencies: + mute-stream: "npm:~0.0.4" + checksum: 2777c254e5732cac96f5d0a1c0f6b836c89ae23d8febd405b206f6f24d5de1873420f1a0795e0e3721066650d19adf802c7882c4027143ee0acf942a4f34f97b + languageName: node + linkType: hard + +"readable-stream@npm:^3.1.1, readable-stream@npm:^3.4.0, readable-stream@npm:^3.6.0": version: 3.6.2 resolution: "readable-stream@npm:3.6.2" dependencies: @@ -2936,7 +3522,7 @@ __metadata: languageName: node linkType: hard -"rimraf@npm:^3.0.2": +"rimraf@npm:^3.0.0, rimraf@npm:^3.0.2": version: 3.0.2 resolution: "rimraf@npm:3.0.2" dependencies: @@ -2956,7 +3542,7 @@ __metadata: languageName: node linkType: hard -"safe-buffer@npm:^5.1.0, safe-buffer@npm:~5.2.0": +"safe-buffer@npm:^5.0.1, safe-buffer@npm:^5.1.0, safe-buffer@npm:~5.2.0": version: 5.2.1 resolution: "safe-buffer@npm:5.2.1" checksum: 32872cd0ff68a3ddade7a7617b8f4c2ae8764d8b7d884c651b74457967a9e0e886267d3ecc781220629c44a865167b61c375d2da6c720c840ecd73f45d5d9451 @@ -2977,6 +3563,13 @@ __metadata: languageName: node linkType: hard +"sax@npm:>=0.6.0": + version: 1.3.0 + resolution: "sax@npm:1.3.0" + checksum: bb571b31d30ecb0353c2ff5f87b117a03e5fb9eb4c1519141854c1a8fbee0a77ddbe8045f413259e711833aa03da210887df8527d19cdc55f299822dbf4b34de + languageName: node + linkType: hard + "schema-utils@npm:^3.1.1, schema-utils@npm:^3.2.0": version: 3.3.0 resolution: "schema-utils@npm:3.3.0" @@ -2988,6 +3581,15 @@ __metadata: languageName: node linkType: hard +"semver@npm:^5.1.0": + version: 5.7.2 + resolution: "semver@npm:5.7.2" + bin: + semver: bin/semver + checksum: fca14418a174d4b4ef1fecb32c5941e3412d52a4d3d85165924ce3a47fbc7073372c26faf7484ceb4bbc2bde25880c6b97e492473dc7e9708fdfb1c6a02d546e + languageName: node + linkType: hard + "semver@npm:^7.3.4, semver@npm:^7.3.5, semver@npm:^7.3.7, semver@npm:^7.5.2": version: 7.5.4 resolution: "semver@npm:7.5.4" @@ -3024,6 +3626,18 @@ __metadata: languageName: node linkType: hard +"set-function-length@npm:^1.1.1": + version: 1.1.1 + resolution: "set-function-length@npm:1.1.1" + dependencies: + define-data-property: "npm:^1.1.1" + get-intrinsic: "npm:^1.2.1" + gopd: "npm:^1.0.1" + has-property-descriptors: "npm:^1.0.0" + checksum: 745ed1d7dc69a6185e0820082fe73838ab3dfd01e75cce83a41e4c1d68bbf34bc5fb38f32ded542ae0b557536b5d2781594499b5dcd19e7db138e06292a76c7b + languageName: node + linkType: hard + "setimmediate@npm:^1.0.5": version: 1.0.5 resolution: "setimmediate@npm:1.0.5" @@ -3056,6 +3670,17 @@ __metadata: languageName: node linkType: hard +"side-channel@npm:^1.0.4": + version: 1.0.4 + resolution: "side-channel@npm:1.0.4" + dependencies: + call-bind: "npm:^1.0.0" + get-intrinsic: "npm:^1.0.2" + object-inspect: "npm:^1.9.0" + checksum: c4998d9fc530b0e75a7fd791ad868fdc42846f072734f9080ff55cc8dc7d3899abcda24fd896aa6648c3ab7021b4bb478073eb4f44dfd55bce9714bc1a7c5d45 + languageName: node + linkType: hard + "signal-exit@npm:^3.0.7": version: 3.0.7 resolution: "signal-exit@npm:3.0.7" @@ -3070,6 +3695,24 @@ __metadata: languageName: node linkType: hard +"simple-concat@npm:^1.0.0": + version: 1.0.1 + resolution: "simple-concat@npm:1.0.1" + checksum: 4d211042cc3d73a718c21ac6c4e7d7a0363e184be6a5ad25c8a1502e49df6d0a0253979e3d50dbdd3f60ef6c6c58d756b5d66ac1e05cda9cacd2e9fc59e3876a + languageName: node + linkType: hard + +"simple-get@npm:^4.0.0": + version: 4.0.1 + resolution: "simple-get@npm:4.0.1" + dependencies: + decompress-response: "npm:^6.0.0" + once: "npm:^1.3.1" + simple-concat: "npm:^1.0.0" + checksum: 93f1b32319782f78f2f2234e9ce34891b7ab6b990d19d8afefaa44423f5235ce2676aae42d6743fecac6c8dfff4b808d4c24fe5265be813d04769917a9a44f36 + languageName: node + linkType: hard + "slash@npm:^3.0.0": version: 3.0.0 resolution: "slash@npm:3.0.0" @@ -3203,6 +3846,13 @@ __metadata: languageName: node linkType: hard +"strip-json-comments@npm:~2.0.1": + version: 2.0.1 + resolution: "strip-json-comments@npm:2.0.1" + checksum: 1074ccb63270d32ca28edfb0a281c96b94dc679077828135141f27d52a5a398ef5e78bcf22809d23cadc2b81dfbe345eb5fd8699b385c8b1128907dec4a7d1e1 + languageName: node + linkType: hard + "supports-color@npm:8.1.1, supports-color@npm:^8.0.0": version: 8.1.1 resolution: "supports-color@npm:8.1.1" @@ -3212,6 +3862,15 @@ __metadata: languageName: node linkType: hard +"supports-color@npm:^5.3.0": + version: 5.5.0 + resolution: "supports-color@npm:5.5.0" + dependencies: + has-flag: "npm:^3.0.0" + checksum: 5f505c6fa3c6e05873b43af096ddeb22159831597649881aeb8572d6fe3b81e798cc10840d0c9735e0026b250368851b7f77b65e84f4e4daa820a4f69947f55b + languageName: node + linkType: hard + "supports-color@npm:^7.1.0": version: 7.2.0 resolution: "supports-color@npm:7.2.0" @@ -3235,6 +3894,31 @@ __metadata: languageName: node linkType: hard +"tar-fs@npm:^2.0.0": + version: 2.1.1 + resolution: "tar-fs@npm:2.1.1" + dependencies: + chownr: "npm:^1.1.1" + mkdirp-classic: "npm:^0.5.2" + pump: "npm:^3.0.0" + tar-stream: "npm:^2.1.4" + checksum: 526deae025453e825f87650808969662fbb12eb0461d033e9b447de60ec951c6c4607d0afe7ce057defe9d4e45cf80399dd74bc15f9d9e0773d5e990a78ce4ac + languageName: node + linkType: hard + +"tar-stream@npm:^2.1.4": + version: 2.2.0 + resolution: "tar-stream@npm:2.2.0" + dependencies: + bl: "npm:^4.0.3" + end-of-stream: "npm:^1.4.1" + fs-constants: "npm:^1.0.0" + inherits: "npm:^2.0.3" + readable-stream: "npm:^3.1.1" + checksum: 1a52a51d240c118cbcd30f7368ea5e5baef1eac3e6b793fb1a41e6cd7319296c79c0264ccc5859f5294aa80f8f00b9239d519e627b9aade80038de6f966fec6a + languageName: node + linkType: hard + "tar@npm:^6.1.11, tar@npm:^6.1.2": version: 6.2.0 resolution: "tar@npm:6.2.0" @@ -3292,6 +3976,15 @@ __metadata: languageName: node linkType: hard +"tmp@npm:^0.2.1": + version: 0.2.1 + resolution: "tmp@npm:0.2.1" + dependencies: + rimraf: "npm:^3.0.0" + checksum: 445148d72df3ce99356bc89a7857a0c5c3b32958697a14e50952c6f7cf0a8016e746ababe9a74c1aa52f04c526661992f14659eba34d3c6701d49ba2f3cf781b + languageName: node + linkType: hard + "to-regex-range@npm:^5.0.1": version: 5.0.1 resolution: "to-regex-range@npm:5.0.1" @@ -3335,6 +4028,22 @@ __metadata: languageName: node linkType: hard +"tunnel-agent@npm:^0.6.0": + version: 0.6.0 + resolution: "tunnel-agent@npm:0.6.0" + dependencies: + safe-buffer: "npm:^5.0.1" + checksum: 7f0d9ed5c22404072b2ae8edc45c071772affd2ed14a74f03b4e71b4dd1a14c3714d85aed64abcaaee5fec2efc79002ba81155c708f4df65821b444abb0cfade + languageName: node + linkType: hard + +"tunnel@npm:0.0.6": + version: 0.0.6 + resolution: "tunnel@npm:0.0.6" + checksum: cf1ffed5e67159b901a924dbf94c989f20b2b3b65649cfbbe4b6abb35955ce2cf7433b23498bdb2c5530ab185b82190fce531597b3b4a649f06a907fc8702405 + languageName: node + linkType: hard + "type-check@npm:^0.4.0, type-check@npm:~0.4.0": version: 0.4.0 resolution: "type-check@npm:0.4.0" @@ -3351,6 +4060,17 @@ __metadata: languageName: node linkType: hard +"typed-rest-client@npm:^1.8.4": + version: 1.8.11 + resolution: "typed-rest-client@npm:1.8.11" + dependencies: + qs: "npm:^6.9.1" + tunnel: "npm:0.0.6" + underscore: "npm:^1.12.1" + checksum: 9c160780f476aa03ad1ce6e7961894d06c17d9b67d94da9fbbcd0c5a5ff741e4a6d85c3b938964b13826d3f20ea36febcd6186b43e361cc62a9960241e0f5a4f + languageName: node + linkType: hard + "typescript@npm:^5.1.3": version: 5.2.2 resolution: "typescript@npm:5.2.2" @@ -3371,6 +4091,20 @@ __metadata: languageName: node linkType: hard +"uc.micro@npm:^1.0.1, uc.micro@npm:^1.0.5": + version: 1.0.6 + resolution: "uc.micro@npm:1.0.6" + checksum: 6898bb556319a38e9cf175e3628689347bd26fec15fc6b29fa38e0045af63075ff3fea4cf1fdba9db46c9f0cbf07f2348cd8844889dd31ebd288c29fe0d27e7a + languageName: node + linkType: hard + +"underscore@npm:^1.12.1": + version: 1.13.6 + resolution: "underscore@npm:1.13.6" + checksum: 58cf5dc42cb0ac99c146ae4064792c0a2cc84f3a3c4ad88f5082e79057dfdff3371d896d1ec20379e9ece2450d94fa78f2ef5bfefc199ba320653e32c009bd66 + languageName: node + linkType: hard + "undici-types@npm:~5.25.1": version: 5.25.3 resolution: "undici-types@npm:5.25.3" @@ -3419,6 +4153,13 @@ __metadata: languageName: node linkType: hard +"url-join@npm:^4.0.1": + version: 4.0.1 + resolution: "url-join@npm:4.0.1" + checksum: b53b256a9a36ed6b0f6768101e78ca97f32d7b935283fd29ce19d0bbfb6f88aa80aa6c03fd87f2f8978ab463a6539f597a63051e7086f3379685319a7495f709 + languageName: node + linkType: hard + "util-deprecate@npm:^1.0.1, util-deprecate@npm:~1.0.1": version: 1.0.2 resolution: "util-deprecate@npm:1.0.2" @@ -3639,6 +4380,23 @@ __metadata: languageName: node linkType: hard +"xml2js@npm:^0.5.0": + version: 0.5.0 + resolution: "xml2js@npm:0.5.0" + dependencies: + sax: "npm:>=0.6.0" + xmlbuilder: "npm:~11.0.0" + checksum: 27c4d759214e99be5ec87ee5cb1290add427fa43df509d3b92d10152b3806fd2f7c9609697a18b158ccf2caa01e96af067cdba93196f69ca10c90e4f79a08896 + languageName: node + linkType: hard + +"xmlbuilder@npm:~11.0.0": + version: 11.0.1 + resolution: "xmlbuilder@npm:11.0.1" + checksum: c8c3d208783718db5b285101a736cd8e6b69a5c265199a0739abaa93d1a1b7de5489fd16df4e776e18b2c98cb91f421a7349e99fd8c1ebeb44ecfed72a25091a + languageName: node + linkType: hard + "y18n@npm:^5.0.5": version: 5.0.8 resolution: "y18n@npm:5.0.8" @@ -3694,6 +4452,25 @@ __metadata: languageName: node linkType: hard +"yauzl@npm:^2.3.1": + version: 2.10.0 + resolution: "yauzl@npm:2.10.0" + dependencies: + buffer-crc32: "npm:~0.2.3" + fd-slicer: "npm:~1.1.0" + checksum: 1e4c311050dc0cf2ee3dbe8854fe0a6cde50e420b3e561a8d97042526b4cf7a0718d6c8d89e9e526a152f4a9cec55bcea9c3617264115f48bd6704cf12a04445 + languageName: node + linkType: hard + +"yazl@npm:^2.2.2": + version: 2.5.1 + resolution: "yazl@npm:2.5.1" + dependencies: + buffer-crc32: "npm:~0.2.3" + checksum: 498ea4c6bca26130608c44db166e2f63b3437b94b7ad020ca0c161268d29517e8517146e91e51b78da100ad62feadc1a1a85aaa94aab0b2dc29b355ec75bc8f0 + languageName: node + linkType: hard + "yocto-queue@npm:^0.1.0": version: 0.1.0 resolution: "yocto-queue@npm:0.1.0" From 8f584872e135a6e2993c56d5f45dbf4fb59134c3 Mon Sep 17 00:00:00 2001 From: 0xMemoryGrinder <35138272+0xMemoryGrinder@users.noreply.github.com> Date: Tue, 24 Oct 2023 02:06:27 -0400 Subject: [PATCH 257/325] feat(solidity/extension): added repository and logo to manifest --- toolchains/solidity/extension/assets/logo.png | Bin 0 -> 105726 bytes toolchains/solidity/extension/package.json | 5 +++++ 2 files changed, 5 insertions(+) create mode 100644 toolchains/solidity/extension/assets/logo.png diff --git a/toolchains/solidity/extension/assets/logo.png b/toolchains/solidity/extension/assets/logo.png new file mode 100644 index 0000000000000000000000000000000000000000..9356cdf54d0de768879567c37c4b030182dc7471 GIT binary patch literal 105726 zcmZ^KbyOQ&^leHhl;RYJLa`PrR$Pl0m*NtvxJxN6E$;5_9^8X_a0~9i-JO^IzW3I8 zf4rA9Ozzy7Id`9Z&OY~M5`q=wCDGpzzXJdO=u+RslmP&wb^rij|LtpdPm69lG5ihD zR9H?J0H}&YeKdFjKYrz?EGYu07$w~U0A44!sc1MU8~pxg=U{7MZe{$@$<@yIql>j2 z0Pwv(T}`__l?Ck)O5cnaWrdQkiTDV0yq|~trWQS=@mu8Nq44<<&hD1%_3|h#bV?K( zL9I~CIiHmqBFL`2A*@-GGTJ=U)jHe1sg!)?HM?b7EhQg{W?n^saxKsMBc+TGu|`A6 zQa;3+7S|W6MnyA_QXw^OE)Q$Ex6^5>GxMsrG#C_3)sd1na}+g+4_xey5k+4S=qjN5 z;;P?J*i6J9^%Je?DePi;zPCt)S8^qDuEt2UPb^IJ>YiuYAzR;$ ztPeT7TdS5sMx1Nkp~a*Vz7RLS-r9;2pI2LN1{0d?)x$Cp=b6)`o6Z>) z>#r^{xVTU3RW}FJzP~h|SQ=y!TueaI%Qt(UT7k&Lj>z=x?w!pFY**ec(?#$i zr&Q9mXDn7udet%l4&(aZj z!wwQV1}4g%#y@&~E1Ll#(0Ku6bWPe(CF$2j%g$mb@&0}&>WY=XmIM-s2rpur^ws12 zR%AMA=zB}}aCeSmvR_B2Hu>TtQE@_%WBJbLY?0+sso-F0-YbQlv;N{I-zM+CU7U>d z-bUHc8{(cn4cwom$c61eac67%$Z)kb{y!CJZe#=ia6{66=#FlFMDy6ebw}LPUU!cV3!xjH+U*_3DTr%6#GHO84rUn|NP9ESd8o)A0ld;IHH zhisVYKErL9UbhHYG3*RPM0Ny*cmaB4>#Cn~Jzl3*3MF|qO(xzI@>)}cix5e7IMLXm zp?%RBYJI<V7Xw)~r2x=n)F3Iy2fal4073VMTa)@g;bq$6U%do3QZ!_6R0tg*52A z^;-M-Eb5h_f?n5uQ_fnAnUlQRvU@XFkdqj6$i0Ej$Jfh4XP?{1-oagZd+cT4Ys{qV z{YY8zuuSfR!0rgb?KJLSCR{R)1+-B7$}8e$9$zneTyD+bDQYWyy)QDhXAr6rs}HIk z+aFeVRc2bRPTt;?>bM$y092-QqYkJcLH_te?1(*dU*GIT2=3|{qXL0Xq^F^`B)jo~ ztmD|6*=!pk(3>A*4j+V@?B1<%-MdhzY1=bcj^*=Z%^$^NPVU;Es}|~ev6A6ae%D2& zJA4zE#_Z+(;RETkH7id2*XPQ59Lw@juBA8n-(_9^nbI$1TN3%Y@REyS_g&Kw0KljD z_xDOlnfer7r0*4FRm3IjWM5uho}QlI`^TrJ>$`h+12jFmb#e-C{P)r>DgUqW-(~-& z`+vXR-v7Jhzt{8gGrXZ%R0_ZH;o;%GPIyDHp!mP`|7{_mr|-Yc|KI+5PJu*rKK!gi z&cD5AR^GSFTzCV%7s|*H{GScpfFBBE3zN6*}xR!RBt#)e#e zQCNFd>-0>;=y=KSDBN0DN7n`nRyHzLF*?>U3(X!J63fop-rk;HUytnUUfbG&Z~gQ0 zRbvxy0Gluve1l&D+unw6xkHetl~wrYa2WpqfZr&Po(%^N_d+~7|34S3tLtoQ>gDr` z;r<$wR~l7RIo36pfU0#%L8g^8=9M-7d1P5tE16Rum0KW_R|rQ7CqXW+NUf;sM`4Ll zK?&R)IOif+xxee1#Io|>ex>&hx;M5IK}HPAEA`7N;lBK=s4}jomdwdd?CneL?e}bI zEgKoNsH%liWK~@o-qEF5TrQnk7~Iwo+TIEGsAhaZv!px_+_Ad3C7V~+35BW`m(@*7 z!ilx7tzTTFqAt8$r&8V9~#c=AKZe$3L(R(eFMeAqu`mD z_LEj*4XZziREQD$$wkg{K4%5^9yi3`{w4M zYipxR%ahA1zv>!))i*XzO}9)(%TOj9gpnj_H6-I zj*Ulkc89ce)=x~qqdBy&IJ3IyF<31Nmxia4viuLg4Q3F^o3mF44+h)Fz7)cT&ueaj zW_YEQ45Yk7gtYl_a+viJtXh$(8XTD|JvO5$j*3gvtn=SGpGn1T`ueYPlH!KD087WT6M%`6oQ=0H30gpEk_1^%;%4723jmnFCgB9lTDreHYVGi70DR1_ zD2E<;d4K?)&BYMf6ZM}2bbyZN{QWc7f=a+95`a5L%-vMX6-0vZ0kEdALODcM70L`) zqvgalUOaeAu}6FbFqjIWJ#p-0x&-(r?up0Uq}Wlv0%T7_(w-Oy(eR|edkMwkgmhpV zeBQt{9|Qn`DXG$P5|FjD>4HlYgC6ivBZG3t_Q5I+m}oBh`#FMG2JkJaRU+<1p7~%B zCL?LV_zECAFBT_I4y7Gk<>F~|Y!XiRcM;ZkZ2Zx$as%h{D)E!3e?1x)p|q$|km?Pa z24ef9R{*c(!}mmU4|Z83M!eb`BwA$Z~$w$Dgw_=yBPrrPr3{nkjV;g zF%3ro0FX(&P_xm=cix8fgO9wG#@3BH@%XZ%6B*!QG@et|$bNmu24=KmTq!eD?fG0o z&hrcaV4laSx>+CmjGL0_jZ0-(DoBjSCHQLc@|YzRP6JrO8q9DOyW6POa#{`EEGXYS zF9~iq)X+ZQDXKyQ5V8i*5}0qM@0BHr2X-VBWY@b(wK3=`e%4;@? z>~lZgYk-|GmeOc_v+aY~w8~WJ52!n^xV8H3xf}1_=;-j#cXVtWrAlX&mtbn{t6^;} z4U-R;f&aL^h6nhUNg_C9YxP9Ml5W;z>H0ELmmXx*{&LDD11IELCv8qzu}4^IvZ0%* z`zKHq)ymb0Q?0|lo0s4TwkVIM{ygF7Hb25wLqO5?r!=znn&V&U@Fk1K`7fiA4DA`a zl~5PFFSUhwRM3!Gzbc%t{LF5)n3qq$F z`qOOThJK9cVz3B{@9K%mFdj{P3oz|764OirQuXR?+yu5ZdJi%9L%%>Z3S2(FS_{*` zZxxSw^9FXwd+HAMhA?~}+AD5uO$OL8p-~RW(B&|uA>yfp;Dt2(1xZW6;?GAvNEP=@ zw!xkdeQGL$X&2qFVJ&%erJs4`Ka>`zAD*h;Q8F1W0nfOjn1+?$36;4*fo;65v=D+! zm*9~EbZ~`TT-z2`A^JEvD2mPNyU}>Ml!J9)@e$bYDBFGdCqYp=R#jP$>u_NrLxTE3 zzPA?~EQYK5t2M_3u{aLxIC9(_h2m_(UQg%aRhv^jIA(`%SjcZefMB*L)lk>vemiXe zv}cUzJsm!Hla~~3_q3SCy=l(?4kWGc1$Xwcy6kZDTw3yr9GrL$wNKcv{_Bi8$7Cg0 z&_Q+k6ayW6*iBuoV&#AMV=%Fe&E3A>O)+dfAawk>y)D;m$bySmkRlh~IPqW1hC(hH zjX(Lo4&EoijY{)=Nc-eE^=fVU4o3-}T4m~>nEdQ;qY1i1v&PVA%{_LONSMl5h$#hn70H!0neolQ^h@!T3Vr9U8azc(EcQ#HZ0!e z0rF3)pU0?k_{S^-&C2qUfK%d8bTSG4~XPcbUTU6ycx?DJC+EJtJsQEr#~+R`BKQmw);HvqU#176)yUfO9jW%ztm4 zM1pqA0CF1ONcim`0r=?fZ^l>+s=mGbDvr>+fO=(%H&zld#KQ>HsJ~4De9J?`Rhmr$ zIuA@iN(epZXrUT?w`G8DKjG3Q$Os7{i457BL3`3}`qRl1@1)%_-2VoULs9uJcq#RU zZX8`Nxi^XG?+OdxNWN{|F6Fc?rW?BDlaut{wr~tF=msn|j}{^UBFdDStFC4(2_@k$ zRpB|R`ONKoKk|Goy^eMz!gYuSc)Or2rpb_fNRh+1s|uY+1*%D>eV56t;o$q1YNRri z*v6gR<%Vu`5e+02YOeV#e*dJfiOT&iDiMa*&udBUP0VOqu=qBc)&h8zbqSrl%@KEP zXm)U0Cck2dL%U&*vt(TKhyZ+)?feIWLz&<0aV{|`FVuk;_2WNlMkw&nWrw6=&!~VuHRehfg8xqUULqDiXJ^VPW_7oSA*`89fVbbxu#F9X7^+j2WZ4_o zdysD<@sBj{H2Y{*HBLFSap|TOHsDGr-7neRI%%%}XAO}-i0I8iPOH1yl^*VtB~I}k zO`>{)(~0=MbDyV!syC}ajpGSlK2ti!<%taW7P^o5h8 zmi7b^9kocACXK=4?89u>ZNl0bRLu^?6}{kn-y;CFCc2|npmY5i;tx)eI%={_IA92ERlBBTDLSgE)xKW0`Ly_&K-D2VwB z*B21(C{MmnOE)q$Kvo_h;=R&rI*{vV067;vk<@(c<%Zw6HdytK-yyoT2GZZT`i`IT>$o9?aA*Tu-~xh~rl0O$?I68&&zI-T{;|wmtIlJ&O?a-Q%A3+;U4-Y0p9=5cqu>3v-x zUT$6%`mXEa+wZF1zR|5jVSW%tteWG4y*a#yvOV#5aYZJ(8Eb;2#TF2m$FfV^q$C3; zagyt+HQYg9_09WwC~57zD1aGo%HV|xix;!AoI62F0oy#>?{9pFCNju4^TCD*krZl1 zpq-G@gr$P%6W_XiRdUG}PB&!S5iYj*W3YqoQG&O2=taZWmBP2NneNE z#OAxUHM@RSYuDo}1O|68pwsqM-@6@D+b@z_Zr;(MXvIsJy#;cx16-Mj|l07p{R%; zq21*eLMj!KH-t*{c1bUQ5Jf8fSohX^`74>OFaA3?<$!{#=irbr)kz!0Wy@Zka!OMmQ5- zM%1?QZ9P#=W@H@NCTw3NcOp?ypjLTjD0cUXZb;LJIT|e8{5XaJdgPg)TOx#TU3PwH zIV5(&MCc(GRfvwgAgz3^If(EXH;=)hQbFv6qdm3fTG!@gINDzj?e}1tXV`4T$2HPa zD|;+Itd1l2=9flE(-YmNK1|^AYmx$mRpjpMOcfix+&?FwXLT2Fb23cCIQ@<#$7-G37mOcq4SCe!TaVv~ zP5*1i2w`fqL0*$XT0ZQGiaC5o;YWrUq@3c>Q^3wbWdtmQx=7lhWrumE;;+8U1f6eA zrFl&WeZTd>7d%RQm~l>W75N~=nn2Tc|JP4_nuZ)t(M$kPA4}F3#L40;rYJt>GsDuz z*J`d8g+>*JUN~kdlw(x`O{Bi22WzkQZ>`58!TnX%skIGQ`FRLqueGw7l=U|vHVwG` z=KZC_J*6{`OQ`Yv0E>eY){x(ke{v+PwhLzl*a9{3xAcnz^NJi9(EJ-~LOwOf29k;! z{fe2LMyx#hqv7Qmz9_TDbP&5it|Z#n>y!>36oSpu?G*Z8zZm_!i($z)bhV5pX}bs& zA28*5yy^SQ05}x^&?8?i8vW_IR}?5j_mhT@*QFXopr7mG^^2hk*;?GNSLbA!?Z3tS z#YE1ks_)!qsfK2`F4k8OuNUTudr$>cUGiVSWAW|)%C(mNW@7c7C!qxu^2adtCP3G( z58F5bGq(t#k70hITc#qrPRx7ORJf!&FT*Zk^Y??#*Ty*Rs>WmY6YT%7lC!E=;r3Ll zk_cM_Y!ZfXwkn3xq}rQQLM4cJ3bb^|V)gpB45l&vxRGjE6Qfb#5<((P`Ewo<59_XS zcNwFN*Ob zXc<=?Q;veF^FNKYk084XXjP@3C=_x}j9T!9vx_8r&)&m>UJ+N#@Zr1p1(}J~Ilo>m z6xEPJVpVpXSzF6-)W9=Zh#NqyvMI)vNa9Ht-H?dCsMlw<{amK| zSfwU)?N-b0>5|`x-K&9*c>sOQ{57lPw`e6^4|~6&6dU*+3(t~HxKBj+=V*l+kR8{f zSFBE{LK4?s>{%=zsGE$V>upW1Nt*hT>L^luKK1pzrqZ=TH$!29tUFxn?5!oO2Rh#G?=DL-M0^C6qKxdllKrHq9-c26frSu zDV=5Effl6!D-z7V;&DvVa`LW4cv>0JFE{K5Ez=qa3G{a#Ttrjz-+t|i4d>3(Ya4kH zyS{f+UgutqXNS*O@Ivl*?=*&caCBLlIC!Oe_3d{!QW)W3rxyPSX)Iz;PB9I!VM=|E zoWXXKs`#hbNymN)mzWWcWh&9r*JrRdF~gET3BOOQga-I?!7`ukxS*;^GOG=JHP93K z8fdOl7ejesj3HxaHxQc6o)7gV_oG!8Kkum3TM>0K>HS7W-|a8`Ggy;(9$D0YZ_99a z2a^pbyVcX{S5BqRm3go4_h^sx*+USf>7wOP^-G$3#O$)DECJ5zjVNG(^5y-LIpT<;RbH69=@; z1rAVyB`uEFH}^|T7j~@t;*3l`8MaeTtW*!8%@T&jqld?YZ<*VjZ(R+TZDzy;+R0t{ zUb%vxi)6AOsQ-Yvf2zoJU(9w|qAz;z{aej+QixcI^LL z-(OkDJC}aQ2cHcFSCxVDB3)M+8waI-)4exrlwT=e3bR?ROmy%Qbmy2iHc65U4NC)I zsRq4kHz>O>G>;=hjV0MLW=R@*qXCe&@Z~g`YbpQ-`IS|9;O2T}WN!BZQ8(ugAdh9o zG7PPgYka*LqgV$G-C-)~MOhuJj^7TWl7MU{V)>0$`KdbVUFdH=cXV-Fwa(C_1<59H zZ^h^pH~ZPI?7Y|4@w8_`Z46z-+_m~<;wDl*7m3Q{)gC*Q`Mf>Vbvv}4`1j70HDc3AcU^8eN>XSIBd%*_fRn+p(cQ17!25V4nfXw70?=S0-=z>b{_ z_emFH#qRz?Q5`jqXrf0YE#e-_8t-KTjurPFmNG8XM-*nk~PR_@(GG2 znCGuIJXt=Og$8@SmKS|#o64f3q@d!T55gAGCU>}x_KfQQg5-A&(p^%0;h%CDP5+`v z2Tmw$?aEd!6Z~!5f(2#1R)L_RKfKyKm0l+NLBg4&XtCr*o1)+5G>h8ViyD$v#a)=q z{J8^x6+i8>KC8U><3_-CGD@=kj%S*-KxRBis%a_8A;<4!;zG?|X`?*qY1YF+dpB!o z(t%&#g;Pl%i?ejY3?oM~!GKaDFT6nKBmD}hN<5CJRR7j2x}pho)G?ZZEORJ*j@2)F zjy~J_>Wp1f5mYG4n>n)Ki&@P1m+p3EGlhXPZi;iMyB z5ED>-%a6t?khUlB@dhZ*&Q%=r{d+7pVc-6a+SRV#0G!YP40OD6W?b}p{#-ZJ%$o3U zSv5wePLzO=F0S;_G@(9&*C}N>o0@ZrtA3k=V^UNST2v4t-m56C%hptr*n%aV7Gh_^ z0u#9u7zMtP=>)Sl-L^S7u&kDC>OXsCh6MTHN^Si{b3fc(Q(8owvn2H{_YzE-YUmzJ zEi-joXhFZ9Gi7LN2G(D4upuF3y;n30>^a;sR-%flePed?Y8JQe(u>aV6)Oi zC8{iSfe)^(&!38KVLXoVo8>He&76cQp`~kpcla$g$kd&0>DH-DV7>d$L%v7%md!fo z{`{kjl+Y+G(|krqg+M+bgwcL}D5dq|O4+OEj<|7Mv;FY(pKMyk7@sg%6kv*4mV2t0 zXdaQl{>mG!FQz98^{LzmwEBNN*X%GckP&?CSW#KluyAl}UUgwoXGYs{*EB!K3hiRv z%Q1Mn6*#MoImrlgC7QQ4UgN}+g@R|lo0XP0ABE#*XKTqadVDD7xWM>2)``|b+M`eC z_p7JZUBBY!c|-`TjuLGcVl(4RS6uzvHuKl^r6mR&ak9uK!`H;OeuEoc#b2^<5L!&l z!!Gx!oACSaoN$jph_zU(8x=;|k7R`CuN^;io6cg?>98RI!Du0_B~7Hnfzt|?(&(4K-}y$hjGJ9CE7OpZEb(R$D}9g!(d(mU6R5Ym4?Fm z6_9`CzUEa5Ojf!jY0tRYY8#dn*BHx4Db|u@me*X;5Vdh-8tD>utkw?%SMocho%I^f z4FHTXX^(OK)bYm>wtTPh%18-Z7PqS%DYM1vUAL>kb?|7bhxKi`Zyx@tHUe!fYYlWU z6!PQl)V%i8UVT!nJZszNtCq@XPQX3qbWf5y%C+LW-}hD`*CQeyH2F|HXl2+Z9rw|V zGxMg*HSdXO?p_&l!T^ADMd4*PZQys4{nzKU5lAhB*+u$SVWb6ZKKHP9T`3JDye0l+ ze?;}L&hwzLomSHYHtN^zav^bVp|>)7J~??IYL#5rd+c}yYnXB)UN;(N%9J?ELraWM;ZY0u8zqLzAaGB^19 z(hSlztLh{JMi4SHD(-pCap6KQ6wa%OwTxceo7^zV*ysHRVk1ogA&)XzUebhy;h6W5 z?FnfdB-Xa3Nxw*&Ja>`hB*#qp@;-HZTDUcQpA639zDD&kj?Vj2XB4lp0RFwj8V~ygIIx46=$u4RP0(auUK2~EcS|4^zuEWKR7z_KD$?2uH z<&^nhExMc>+Z>xq$fLy6p|h8H#%`%@EJR!9jq?!4;7H<2Fc)A{ubC(;e z69E}Bft}ffL6nTQAAeMiSE=_KmgK1)k{>X?BR#J!m|yFAN>@G1k0$$bNGs=|a!v^8 zcdPvD`PbV#;+>4Ah&C?qLfEsFA!nup=u%gTTWr4V+Hezn|C5$;dcP3q>Jb_zoxk^XkDHVnxK4V^TB%g5I62axBm`J;Y|o>wf#-1{dKdG>U^n? z;vVN+e6aVOnwq1~M6Q7G$*J`Z^#<0TxpNfulZ*wqb8S>fF0#q~R`FIrCUcrp!S7NbkBfjnzcCEunAAt+~4ExEMKvi8|LpgQ~?YHk~BI88YDA35od zG*xUhRR$zfB$oE(Rmf=6yDQpqk|b*hAnyfsyazWDQI;cxf1XDyyL-lcsAo*uIrxII z-{J`Mnp9=!&9HYX|JkI(tZYo9ZiL&Ea)T#{omvgMoJwov2EbN#@-$h?n4V zMQ*eibq2~FtcCg``pP?k4}a*c1GH)IdJimyu0|wn`z%3@EhQVH_H`mI#>y+^VaD+# zcaVwUW+eKrcRdiMpI;nx9MZzCBJ2LX7_`RH1TY?bce)o$`FyU>IxiclKR*70A=-gK zpkU2?N>6lN3TKCKThRCt^v%an-?b}EQ_V_gxT zZfnNuD*jS33CSHdX4~<1c^#mf;U4(C%t@(}qU_C?L{N$ATW&43&5s*7T4B6F*)tSL zhM23kzftX@O)Zj}GQ4gtTv`*W)luLDXls?86AB;KLFI#IvO^hE{1Ib;+& z&wYIay8?aJe=11S7!7q1jSI92{4PQ2i(*xgsvi=6t58hprX2WPtp=(&l1aZIoPIi# z{oDp0bBb(yUt6zWmCSx*LCd;*ITGHkj=H8$yzoQm=p{b0-kCAgKp)833`UR-nZ zwi;`shL!ntn9ZKZ>WkzuMFonr!5*rdD9^+eYP#sOUQyRJ`HY-2YeXQtzFVrcU6$#! zu#Ezl~Q*&xX}BCJ*$( zI~nZ>?h(M+^J#W5f26Z)nDVe_3@rl2XRx^DempQ6!jvUUcP5DnU~EaK+#HN^iOt} z3>oyuDGP5kDLeF&+EH{F{{HT(yJRmeOZ7Y;UzlCtbyY-uRLAhKQbc|rzCE2vEDf(1 z52~UWx0QSLQplI?gqh2WW8Saxf$H}K%5iqtKYi>$0efrrHIAEyS3BKuo?rT+jUg(@ z^5$VMCzq@23Wshqw_BK|28i<~P7SK8sZ|pO{`1lF~m`BP^ID% zL27F;SIclAZAVu_rPE6B{-R5kh6vvD0yl)Yy9>N1%^xrXg4A4$|B%ch`NQK)*#4~g``Y;7 zvRt_<(Fq`@31ns%4J9>8>9iM|Oq(02sfrU9H*v4e6<`i)J!P>C+bN*XwKpRcNeVJg zH0}(jMXyRdG&&RC@r6{4cX7VERx0Y=p5{&K|H1bnx2hF_rky`NkiNJ0qp+glCv$wi z7dpYzYv;mA@~$GQ*I8YC}Noq*tXU?^82W#?v0ilMs$Ua$1^{dPq)6na($bb$fFtI`loB7<6GaqjE3oaeS|6uYN~ zx9%}xwMMn+Kps@i;QIDxXtJh{t-X+@r0>8-k;96QN082l*GNGs9#VTVs2E^OVf>ED z6_}PiKlQo8Avqq>2g69$MWwmc^p}cEypW)9OSseq{Y?u;Gl@(==@0i2OQ^tU)c=wm zs=od4_GzH2jSYj|eCK_!f%h^7W8%_J*BMA9jiJ+4maxWDe^tjGRyJJ(UohF2-w#|@ zIoIph&tMOya0K_Oia=d-e2p>eoPchW_}*EApiz>KwGowCv*e@A??*bEuw}8Uo;{`B za9_=NmBMGM$h-8=d!i<;X*3XN7HdM_v;6JZTT%LOqJdBCiv4!LfQ)Ly;A3)IA@2^4f^(E3d<=gIfLyUcTrz9624@f=v=ay4P22 zBXbVfWC9dvUc!fIOQO3hItj4fGn0JQPk^1p?D%&QfC8mv?AO$I z(u*U;j+xD!X1_i{cAGHhbeo6QZ@U3J);y&gOpT?eOruKm^cJ8wNc5xW1B-aj8& zTZ-(ZcY7R}o9a0)B06!2q%_MYruB|5-$8Uw0At9NM7=}tXSS&sOs!GexAPmY2vm9L z-#=i@ewEXfgQ&UyWF!CJuIWw7j`Yy|ag>Bo^w1M?$2SldHEx8%c`#HN(Y7#eRp3kC z|AEU{`prb1UW4tDrjq;e)Wp!UB3CP$Fuu{9a>MzxxZX*`pZaQ_p=frz?vyYUGF#(e zV|N~888q89LbZ{?gc4z$x4`o8pr}#4UP8pqQTA$MS%1(rs&@ zSEv-Iz=CmUMSNuS09Tda&BAeh+os27_UTQwJ%{Om-r z1YhUFR7j_V@@gWwo^Rx}gZc?l;h$ND5*F(d^j%vVw&Wtxxtq>1=A?S1NSUh{1GK(8 z`&y&+}9{SKjirC#*4zUf~0GimWo}0x7`>$E^W8bbs`t$p3`03i(@$7V@a9;7KA@DRU`gh@)cYYRZ4W zhOniO58WpYVCDzY5(Fbx)@WJowA*S^wyj{gEw^5jd%xTM7JpB5-#Vo?Lm0Ml$(m4D zUMeX7NEFDXPYbd6d;^xvdOm}xmuvr#fUwy44O=_EK|5t*7wcgh-sduap(c>LY4%3| zBGHSbi2Dz z@(&95q<0EV*VNAq#ws5Ay;qvYbBntAHAc@~8O;fp$f;U4?x}zEZ<5a) z`o)?UrEEc@n~<2#En1}7;e%UBp(lYrx4vUJ^Mti878*5#^_7*-7MGea&o|D$u2prJ z!dDif%b6^WLHUXQ1BQL?7tlE+g!E!)?yIZ=GEg&yU^kw+>GuY=C8+vfZ1EBoQoZEj zV2b4SR^@R({`jM{62r|z&n9hV7mxQ&pJ&@ad!T^nltsSWfMW@g z{9&J~XQ&T%m@o~eF|*|OG9jyPjXBwWqFnu!Ko+wX5KSF=r)O?XWIVz0Q|n!YM1ko)vpr}D1vHWTzG|E zonYVjk9Es-$%*wissbBaV-qI=U74ylr|F2`ObYgM7Qtx`TpIX_=MCG{A0o*CB*QTA zZ5AYB)OlI7_&_Cog{khMh3lMUe)b^Bc<2_coXkWyD9DIedRrXSIjElC2uO&8(UV8^ zuY^CN&E%tg8E`O``XnzjCISis_SS27E;CSB^l1oQV!rfSwCl}#vHr3m0A+F3W=NNr z&BC$xooaul=_H=_#MPmKJr~xRME*(9w#bUA7?<=7>f+7kRn1~|+eK2RlP}2Nw#*3N zj@RXGo!Rm(f#UHkAw;2AX(xlEV4hQD&;4ueB>PP}aX_21NS)b%5ULObQciCl4ZUc@ z`em4L<2%M3e;X-Tv zYK)T1p;27#FEK9u_|t59Y$>$YOl;g9OQY87XoNH$w&S{aEubEn2 zJYUWh{{26Y0Z_vdf7X*ncB&AXEIQNPz|^!;G@KxRU9#Vihg$7M%hSVG;#2x3Vg6$Q zEmG<{+h z<0_wie5PVjFgqzHcChO*HsV;r5)K%`oxqOsVgAmI*fuT`=g+J}AyU?9h5M8BuUBt& zb>&=i^>~wY)^EbXElsnJAr};Pi6vZYsOfNf^r=m18M2uV zB_lQezR`PSd~5yI&A+;}Y#p*cd$0{uv@Qw|Or&9<$27iG1uSrn^?O_2$J+HC43^?M zxz^w67##)b!K)2NBv7UVvg3vVD)U@9gIE8u7WWS%*Y(VwQ@0;WR$Ii3OUShp6p?kLZX=D`ym3Z7TPGTSix&2K1R&9%JW%h*rNE- zSp^rTNnHBCZ(qb1w12JnOc)fsW-Z+MUgus^9X>sXE!@mH zg4gaqVQAF!xm@)5LV}b*m%!T=CEBB|61g=CI{gb4u1y9`&|r4|P5p0DbjL<>pBYXi zwy%ywftYmt>TayhF?S(T~2U$h6$ zg7qpBFsIwpkqxHDzZS3+9Al}G1j$5;rW_cv?sPqdvg)Zl3f{G{j$uu>MxC zPxcJOT`~mIG2HSLYuq^d-E~@hksdf0p z`q7uQ)oO|)Ub7lY7>m3zY^qM%J4D4rt6`?)`rhg16W;JR*ckHbP7Bq|dPxHpyrLip zVrYj8&20vDxO30y*WS2p#3-beE`wQ@|J#t1Gx>Z*-=Ls2f@@YqKFD1XIk$6mds(xF zvVOf{WqFA>3?t$iEkNg^5$hY$S0}Myn2qdsN|jEkn`Zq(K?LM^i6{ao^&(F|aD_B1;0?Lx4HnWx z&UVz|z+;Y~AoZW7Mo@`)QBm*V5N&ww_pgjpgyVtDLt%I<_6y(lrc#aLoydIYlC2me zCmFZU&@A;XR|kU4-uQhux#fn$m#RU+$qDWsz099RoG$Or86ttY)3IX|CO51JG z390Gb)y5iqP8?#v1x+JmCAaB+JGWC#OWq)2Sf>8{`$5ABSO4c6uUNG-p#v_GMkxBp z{%rNkBXdLh@F&XXPzMZR@&Zjyb0QMRPlGU>g2PIcu^-*9E?oC0)es^!G6*OtG|Hc5 zO`594FJC6_OEq_4xfm_QS7SMEtn6;kUzX(CS_1@pp^^d~2bF3cmPjJ%6Z)mdY{LWG z?RfH{s3d-11KXF>6F!*Gb17d%#y|$DSWB>thu&<_GqDZuOrK(XOknxy&$7*r`CgHk zx*$xr4PdUX2Vlz9>lf*axOw7flK%B9jM~?#_w&|!uavnk7h3x31p_L>0OF$Sm4Pof zOC{0|IO&V^Q+*$$(rWUHHto1wz#dX}3kRL2Q4hd3J8ZHK2oG#2HDU3_D?dZALiL&M zLK_gl%Jwm~>mfZDUFH7G0gVWzJToqFMM zgIqBg4{Ks^& z&k>EI{dQ{|@4k`*r2T!>;`1}QCY#{3-bP{wX1q;)UAb|?wLcgp3&N@6^>YwZdI0uT zvNAv|aVpze-`X4R?@2+zQ}sMJUQDY)+jWyi!7Kb%yEDdD#6V5eA1(Lg-eeY6_bj^& z(nPIwpBdd4()dV^otb;w!4Jn{grdx-)v$yFBP}Ubr(`vfdS!?4KV&87XkDZp`FPHq ztn`z;%pp7do3h0koDvr-f#*@4qJaketyg0iP`fe-UAH-r__jw^ip!KC@XE_pgEn6| zNa#K0Is6f(`GAr_lJTeC&4+{Rc#_@2Ey8-l0sVh}YoKlp5#)a;$?wMsQ;IJJitF6s z>=_X9q~5)?*V{5mmH`$VA*BQ)_j#$p5J`g1nZ9%P^{4rGV&Rgwkw>T&y)@k6cnLKG zFZU9BZG@7OftxENh@p`J&l@IT`8O)XCEBa#dy@hVE z=iW_YS|^Y|xBZhZ8aNAbp%;l{U|x_!(x6*p`&_?M9F2GpcM^Q75WX2zymb8CB>fVeAEnH33UPnYNuE(@iBQ(;)S{X^zEPX5H&(B+X zCdgi>*1sivm()~dhxmHARa$}NR#|R9{F;QY^>Bhgd^*%SIwXu&TR&WP2c(XWBD(N7 z?eRS9FR(tbiDXH03f=y5Up1wd>avs9pzgdQ@WEnmT8osdHqr4C4J>v=!Q_v!go6E9 z&+cuSUv^4HJvaeRGxT92mLM2_)U4<6(p81R zJ5TcizX~TqW@oxRchgOG>k2J4SJ08c7Ggys%9AIS_vP?s@akz$gwpna64x8Am-x=5 zZ|zShEfs~`3?5CW(Xwj~z_*4$8W2L&;1!ZXiS^U`-GV@X9$PKOAeS`F63#elNZK}D zWRZn$e2zuBr_{IZxmN^IyrY!&%oV?W$;rxIhDAmShes;NIz3G;aFb70w5wMxaoZo* z?as7f-rN^23xl*&Q^O^iF^5-MdV{OPy3VQtWb|x)P=`FkV$Yk|>efPZ%AY)2t%HVK zlO=t=T;Q^tFRkUE`>{J^CZbQ#%6_NV1cvA$4dZ;PHn0yD=|^ACQNyk%vP{Zh`d<`X zcQjmI7Yzwf!XSDl(aRuV^!#E%L`g!l2u2N}6J_*1dJBdS38I(LyV0VK9*i#P=xwxN z@cGtyf4}way?dRr_dVzAmlImwD;(SCZoXS@jj+z=wPx7J?^@L0T|M>o+daJe<%$%R zD=5Hhe73eO_`K2E!?#`E<-P5gw_XYs+0S%RtOR*qS1;gbOBP^VU=}|TCqoO*O#Ki) z(-U2Npp&j+npE<_2EUrvIa|?_;^l3&uv!EUquZG5vpnH%2V6`;ZX;kKVzZp~SOC#B zb5b~1OIO)#KQGhjm1x*3jKuhh+6U*fIap@En|tQHO0NJFr`}&&mzDWx-xmB`6f1ep z*n!#^y5~jhkE@!o7iHK2CdVT#jCP`?HRY9h-rT1 zC-k&tc`?od)MRvHA>d>@7KQS@&zji5^wTU`n-{yHA^j1XdBWHEiKOn z@0zC3eMUR;vYmx9IfqfVNq^+?BMfR*hsSU9X zfwfQHU9_EL`WSnTmh@PGz4ElC7*Pl|DI=?;LY`{5iIoD<6lTqxow66HW3w;*a{zY& zMOeb*bNeo-HkmjXH}d)>g4RRo^7u zp0JLcFFxSb=WigRBMZ|D^0n%;z0=Qb9oZ@2kWs}!0)HaHdyqfvYTY)}|4LXz;1-qB z^J^RykL%hp-Y%8X_PUc)G=6pG*gu{8!CUafDD`l_@ENCF%=)Rtt+~z^Xy8j#_Bn+( z#Y_u*50cf(=%+%J-8)#3UxP*!bY^q}6;+z2Gca$#&d^5d8k@t;{RJdO{HPt3`;xJL zLpR5meZlX3HhCX|seY7bd)sehE?>?8a|ZN=yMZjBTa>kJ+Ci3W_`ib$7etIF!_~k_ zN1A@>XbCL|t$H`11w`vNWX#|>acv!SwB`u%J4gMI=A<7&yWrs8{qwqqB3HlAnh!O< zm~0#l3}4mW?3aH=Jt*C4_=^}bY=`>**>YHnHy&Q@oMRj94%e&pWt_fyldiFb>1j0_ zFc`p78-W}1H~L)0+kuB&F`IEX?c(MiQm|}a;0fJ zSUsBj_a$MJ+*z2FaGNf8pUaftr$6oyNyuV0zz~)hNW|!@g%MN3M-woDD_!j!9Nc0j zPfBp4J~te5LNfAf^RD+t?M8-|i5|A@7Rq^q>VIFPNj?7$D;^+zSprn}dJuKGVwQ5* z_K~U72|oM!$@c}~8Y+F^9@u9zRO^G&XqY9;s5vN~MKC+97aZL6&Q!fQ|M?YvPb+s( z!~@W4l~=c$Gi%XL!R69m(KFL~;jF^RpW~gSY0XEw`xr2gO#jMn)Ibj zDa8BT?04v8Tm^!?Hgo$K?u&9lls7q5$R9P^oaw5ZDIeD6qkD)$Dq=y;ENb!BKk&s# z&z4_)Qh=W;BT$-eXFi;T>N8u#R<^ijLdej4=I-6F<}M-JAWCe3ao;Hvuu;yH7GP^P zn5Gl?M?ICOOGfQ!vkA@ceWu3(;$fTcVm^_-O;yEAPHAE>mMr|4@$Hgyk@pf_-WNZv zS-#crzLsZtNBr0&ASn^?G^9dTn#r3egzHBjfxlI!$(kwC2MpCF91sd4pkA~xwD z#zc=o8X2g?3@(&T!x=6ZhFWdxW>5se7;>9KB0PB>OiT0!-!AtV(Zd6FLN5aEb!-Oi zM?F?@OXo$QX`{=3@Z)HPvzLg6y?!=MPU%E}Y##V~m`q0X#Sx~$vlEoDE#t;i4a@yj zO^WL8bF!*|VPLV3p#>{MW;3b>(!TXa#Ek-f%nH~Yc+<#FdFb}U78!77i2Q){q!_(jN22C{BfVQ)advm{ zog>JUvX#2W`g@B!^7E5yY&Ng_gn4SD&vKcn1#tdKX~cv8-qx^4buINuE5pBt_c~my z3am(Ye@b~Rx`W=BJFySe6GPbC({8r_u}RmWxH!xd z*kY+u2ziK#d@=A6V6wh0oYDB^ zBVQ`x)en*9{)Mk3(p7n(id+ehUSsBRkSR}=>K)FDTkRt)5t9wZ4~uG&$xQa zCH6#KyI+idhxH+)KrUy>*IjtZiL=aY@|Af~)!{73M)~%A+1j%AsRYCDxK;2VD z7nJP7Z>kL)3FNAbGtLH^49&g~k0e=74Gqo_&oW)9jefl&v zH|JD>el5@H|NlzSzQ<_SO_fN?_zB-Q;%$u8hrfRfNkD=P7b{p(i|r1MSTe)KDq)nY zKk1rx;kusoghYI?j?SXw(|QxY3r`XMY>cnk$^uw`a4dyd;PfRoj<{Wa4Gb0uI@M@x zuj3+Q)UNPiRW)E8yMw&+J@B#_Gx=CFfj%RfkDp?2h43spw?C0^E$sN;o2zSCRJB5C2H{Gx9lDU#s*SjqbPogjIdD zC6m;rfR8Fc&Wd!)Wnk7oO9F?$D-dzkfOHsywSn>L`V1+pJ!}jiqS6-Vf-#ewl8jT(dnQ0wu=-8XiRV+nlC~hTYOYr<^Q(S^66ZT+-bk?X_@1|YXdH{JaHl) zi*hX>295oiH}`3iHLBKGUax#+h+JuI9XWt5o@YLmB~6QcXWv%&BQW%UntQ^H~!F%e2KGxQW%^e}&;w$c>>{6uVd3QDp zOzYi1veh$Myke3PmFgHXw<+295i}AFY`qdJ7uwGwVWcY68Bn-HveV>PNWMl~JDeO3 z;6_vaO%|5e;F#5yQoOOEPo%$wDVupTq&%!cIvArb-4|T{n}Xylm`?f{NkM*@CN~DH z!#$k%awrL$p6~3Kae#NXU}u~JywmP zhmG4$^BBiuWK7BE-YGu z43b%5A3&mfg8apO>D0oMij2HYt|8l35F?S%5-YmT?D7RH1}3%~`mt8;$fpe08+F^D zW{CS0m#l5C^bS_<3On29`+qQ;kW8-#wlor|`!wEteRPNCI}Ok(A09E;ua;-bkD?>? zgocJ7V-cUtw3f|ES0W6j=*5EE=UW*vDQSFPdZ{)+lN<&|SA^c6fD)p2Az(abvtu(Q z%oWV-^HVHTM84yKDqTy~3#{-Yhof>emp=<(Hyf>?-jc~Sx?(?q)oF@#;cmM*ASVXTrknVx{1kGi;M5P zK|Nq6^Wed|P%e^8kAt7cC+{)r4p2Md$2(wKh4<13MaeI$y5%Wv*Z}*QkG;h`G&P4z z0}D;)Zp{zPkBMgF`Pj8LvO6n+gg0PyuIzX_v!G9Hue?+<5M+Wvu?OV$cq3aM%gb5r z^^k?Ks9PGF@ZkmN(YD?OJ)0H(ZRWK{bDY}^b_`EYAdkhC{p}sPusI3|ozsN0=Q;v_w zC!fM!(QOxSxWW?BiJiv7%v-vUG0ogK#>hY$0`9SoiI9A({obZLfH7n_We21MI%=IY`sk+(5KA9+O(4Wtq?3@0+E zPoz3`Rr1WYVSF;lMS0(V+YG~gNmTL5l~HqN8XQ9<@)D7DNsFxsU5!SF$z1G0E=i5Ocz zab@lL90Y0VO)k|??@-{v_(@3{q>3_oHX>u*Wc$t0Rb#Qlzv+NRIOJ6m)r?RWr0z07 z6IJ@}{XLZnNvCf4jLtE4K9Y-^A^rE2i1ZEtZO73=XD?pKOpUx(GB0FhVI8fnqPn}2!dn3H~+WGHO}2NfiHl3ZttUYW1z%TtrsOtyS*N>gqA-X?uG3Lr3_0D41B)B2=@sla%*e9V)0vn!;(i@QPh!owk)Pdn!}&oq&LO?9 zhsKecVvgQ&7Ai-1IwrsN1R!b5 z$}(5)pqpKkxR{(9sK%T92FPt19%AOrIGF*YuuOdjia<7>M?i!81rC`fB3Z-&c&w8I zr2G@l?Q}9B^0Jvc4_Mj{#pI|w-U71ab^di*r9=hjnttM4g&UvejiRL6cZSAi$NP3{|8%Ejp?#oYQwUVXt(Jw`e-t~*)4D&sG_0pti#RG+;nz17*YJvPjh=8!CBIVya#UNF>AJJ}OwlO~C%x#m)CoOwg zb*>0TO(=}B>^@98H+qzV*eT(30n#`=8s8V<|3|chuJG2Rh<{2gGm@x9P^umQ~K1szwC^yZ|B>Q*Ci&{zKe-Bbfx2aY5rI0hXzG~4L z!rU`y>cjjHF9UVEap`1vy~J?+S!*ZMlz|7DqQyHvMPZ2# zu`uNMgtXm2#z`W#4>7m}BkcoeOySjwv^v`lIR}sDiYamoa~3&Q=&Ct?S+n)}+VAG{ z=8plCvTe18-dT97_8>T)W4C2A@`2PGagTO7xL%@F8IPefLqfZqy@Ab6>0>BWOwmDf zMG4`)a{fBQW8x0la4QLqWwhF7(tIm(NVh~K!o1RwBhgXE4Oc8n)=1L6Sz4xWY3$%Q z(2<39Ouw!5vGqVw(6g^W4xqiW|Ar%P98kW1Z42YYP$NHCAF%LHJOZ>@w%erAPWSr2 zl~tAaL~Zmzq6jL+kl+P6U@M9?osF<*eEdwAoAR|W8964>xAHQf5KctYi^pVLMj|hq zWi8v)dmRhmPyOCf*VF#3se$g`@K9iWa9$>SW zmDTvG;hobvF}NiawVqVxzwYI&I)H0o=aBFp8giINME2OgQC+?lDK~>fSsubAz3*1< z40O=PZ|#r^jUPEqwijOYTs|sH^j-CKTU76Ex4EWEm|wh+-qv0r(BIDPU-~Mw7_W zKXG^%A&So#GfUG32uKf%olCYyV&Ah7w$Z2gM&g|tg9nn2qDTNg(pet!ezj2k3Y*sz zC}LUX{>@_8lGt@pL3T1g>ScRj_-StX;%ub0LA<~OveaS$`6PRAv?`3)m7n|5`F%qLNTo zla~gJ{jiU+geH!s;mIN;7>Rz6pdqM@Y+F*aNGoT~+44-yl6IY){*A1Y^)OsoTClf6 zYf}CVpu~;Pl;st26W`4H?3E|UO37BnyJphq#=D?Yxf*n=cI7*obZb~XW$id^*GVav zaO%qb(9f?G>ST?kkP`iNQvnfdv!PJ&0jdJ-_hkU4n{dyU4Gc>FR$h#fc=ar;GT9jF z&_vIV*$kwclWx0JuRp^)NozS5(s&oUJE7Wl9zC|V%Ck@+V}b8%adGdhqZ~EOw#?{P zyGq~gt@i+n@#d5G;3vdVSd?%(T@S>v2$ICi|$CRX@A|4&mL)* z8Llw|hGisc(mdR23b%hTc`}5o-v77gu?j~IGXcvoeFI!ghR|ipwGBFadA>iteQiv^ z`u&u|mbG560jO3yC5fSOFXLqJ%SNT}xQL^Nhg4Xb+Irl(mTfU1b9rh#RCxKnO;Ib{EjhH7sN;wB8Q< zcyGNBrj;@YX!+_AkX8O zF*UJlqDLRl06xv1Z3veZc2`Hu>tTw zz0)e6VBB|m#*=<{8%#yQ(%4cpY;;6nM_lg!w%FQi#jF?l7pF$c`V^ldn$KH?p{2B8@YV}_I>P!6@?cSV0P+4 z?-(x2ddiv0ov&4U!;EK{=ma@I>m|tBSR$?$6!-jE^I8K7>?jXpOndX3zDH?D}ntyQ+r{lvtJznm^ir(s?q4I4}UeG(@5%slrM2za6{1i(nqdMjK3eXJQ~H=x}|Plf67wuo~bR8z~+K~pC73r+b$ zNiv$>9oas87qMfa9pEor(9MR27)ux0NFSr`>Uf;|TsQ4g1xF9H?`FV#S4#rROBrW4 zS6Rq?pJ-_K)?@G^(5!Pm8iwaHsf!nrPdYX!H-e1g5VaZp$&9e z^|@6hwxqlpSVIYtV#Tz)!5c!*gC;Ydrh1^;9Oj4J>*(3pV^`a~62Fz-Z=08lwogD0 zg-eamM^bHQ_1-7TDZ@t}W7c23YYX0w0oL1g@z3@$TsuR4Ub5+%{yQCCJ^>D^Z@G*h zEuEO^z@~ui{{Sdr24m`6$OShps@Kw8Mg@xqE^a3i`4MP*5uC^}ZS>g$k&1Yl3!+I* zPf8}!cql4FosrIDwkEFzv}IQ_<*~{W-kwC<+(>l$ojRpnp>+Q$u&%ZzlMe0C*(85f zA$2y1M+(XX$I=jd*zVqsHQt05qW$dsvwa$JnqhghhGjaJ+lZ@60Y3zF0M^qX?qJJe zZ}rD&;-MO5T0FH)ar?z>H0-aOO5%5C3;x&-`9jmm3>!}m6`ys zlfSb2b;>hh%Egbwa%4Zi+bqSf;#RUz#Ebe-T5N~NG28H4@so=99bl=yW|Es?qN?^n z3bO|1o}II)O<--biHg^rI(FlLai=92q8{yOX`4=0+Vn;pr5h{H+U2J7&|jtm^7n7k zg+xy*S+B0Eq1EDlxyR=e75ar*Pffn+rE-}{@|e`pkQ&%RMC00D?}Ol;+jw%H%AMQS z?`q$<#reoW=gBAIM$Cof07JfBbE1EOD<+nZenUXdvpI;Gr5a$B5-c_f%Tj$Cd3Y>g zgQf132VR*_dtSZQgDWE==F~TEUIgzhzbsHrQ=Cv1-DAo6{(DBBh%13gF0j1qsT~w+q6_qMVET-x8;*A9vgM5O*L~2KU4{+! zCfSsaMb3|Q^-denpXO|2YgcIG|IWI4ToH~RT7sgQwnZR37G77G&U4o$$A6sqrApcN z7*XwE;LhQP=ihxhyuAj1^&bBu3UtVPL%O5KSoR0hTUfZJK@luOX!*9ji|7iiMw2u@nPV01F+ODrR1q;M)}=#8Rdx&zuVl7F49s%dKffH#e5a9!Qe$Bu=5JfR}pj) z9OD;uP^-o|qmpc&!V{ryMSjSi=gk;qTcVp9l=TOk^#;D(r~M_Q+kl-DcW4K)v^bbr z-kbA3bWE#1ed{2{DjD8YpogUTMmR?d-8`LwbAmFTjCT`XGL9f!j|_w<$zL;G>e^6; zD<1Y&PyxiR3D2Cz89_RG%2`kzvu&1sbV8PIHlD^N`J0}tN1NDGk7^ z;t7bwr?;~bp8&m&P7>6CvAfFu(3d@NkM#u-1?Ck8QHv7M49@`F&6VM2*~RV2zE-~= zGlQ5rr_-!@{Lrbl_}e*p%AZzUJ{K*!FHOG1-%T$0`KE0pzpHs1$>!ew4&>QOXL418i#^_w(M?a_NV zK!MG!<5-iT-xFSvpYukBF2_CMORv;B64v^gXC ztfSlO=kRd|9K>E;<>ddm6eh=#67}(ui2JQYp(M7TQ&U&XWcy={NLzKwRn zEPgG|X4`jm`HbwI)@Ku=XaP18ye;MIrWc8J z2F4--Gti@jZ$fo>A0~V7gfWIqWk16)=kzlic~>^=7PtMr;GSE~c@F4^&6zDRY}GGs z8c!8jYsvB}b3LtHeGiI2e{#8mLDPL*?jI>qv~4gkhYeZfs6=9^YV|1w!j6T$4SkNj zwegLfj*|1uUc4R2FutiuQ4s3Avj`imv=D~KcD}fd+j-b_M)!5hCnW#EJSsUL9OAmj zw%$T}HV88sj;-0}%%8cl^;6R5foQ?dp(+>=%A*EOT0me6!7}OQnz^8|`vr^4Bu8YNM&FDn<@G zzny)xP;1+nT3@%jm>sEMW<#sa2xv>VsLd9tAo^iIx~XD918;PS=!YkpY?r*6WKd_A zG*N4-tDd{Hzj#|0d5l0qC*PnNrcbZy!nz*!s{cR5XvVBJ!)Oh*ZrHzmkM?Kw@4sFU zZ~%X$^ij$#m>~ZIA)c^v5XF4G&O1+i(?#~5;~%%G(-fi5Mo-mkI!X{5xAL*1WZ2De zGP_?#8`mCK*Pn+bxju9Bm}i566Le2O=M+7dnF#!=XymHY7C6rjFQGN~n3A_H;(5w5 zx@ZgcR+w04(1$#Tn-#NzkmKBkb{A@~$PF!D1?}y;bL5l`t~OO5a;wP`gTEXou|2xAFN484ymD zNT-m$sekQd2aig4&&aS;XI+dRL9UHT@;yj!o`qV=Cbgr~E5ToDcJ$+S^9Xem5A>40 znw{k(m&9+FkoGt}&1|PN!L2k{xv~$Z-(+W>X=9yTY!lUh!lFW?bI)s_WEy7I-%afg zYKVvLH+2LFljX9BSmM+WQ7Ohvxkf4crO^_ z_tbKsi$jcr;Fn|;*dzHzVeQ-N4!{M_M1Cy4lV4=Gz*ZFfsG^Rx%C>S95gj>9D_D|= z`}BO~mh#&c6%r?~Xq2_fvqy7I%-#0zol2nUMG|wV3|7oE~rvt+N)Yl7Zi@j@KPcO(pRDbpb>j^rG(?T zOc`T)#RHk^Ha~iqD|J~tRj`UZH8}&Lpi8INJKWvJXgbOA_|jNF*YB;P%5*#anY{f| z!iH?=Ub4Vsmq4Wlo&aN-(|r1Vbk$HAN%^2;TF<*bh=r?kugDNOuC27R#9SjPNDMAA z^2aqD9|_@&4^u4_-#+G%1ha;2MTNknA;k?#+e@m5mcxL=;KxBVFf&-wIK;GQD_^YZR2L%GY_)qb3<2cM0@-vgkRy8l{%#(oRBOBt_U z-*lA;D6yZNRr#4@!fKi_|IA992odcQ4YsR9glO98??~? zb$!Q9N}6PNBO&KKM(F~7AK#_eErtS-TzA#^*r+g1-^H#sOuhC zvTE1%9&;{>QT#S!1@Zz%-4QKPH^uL9YU8!pk_I4woJ&jPyIzEW%~3g|Mub&F@dZ{m<#;gh;b-D<_Dpl4kR|hM zba~vrEB~8%4;jmPKxCbnIWiM%^UAtFOj3|R@()H7i@@+Dp^t@g#C`a~{<@BT{JKFhWOv~|RqW6k z{>USwy;XNreqMW9ITCdz+4z9UzgnM~$_29Pc}!V3e5`$A9{*6zfS!chV&zY2DZeH03_}kHNm?b6xp)DHYwrL_ zY^q2|oh=}-nQn^*en0GWqAZ1u&v`s-)VbW(R7R( zxuXxPVR~)Ap*<<#0^-&9jN?^;_}+VrlAqMwz{&;|1=Hy?JId98%S$Ye3==yMKlsdl zz!$g_&s5ua_d0=Rj-~rmr_Ph#5a!g2;JX7LlomX-A)lg1LL???c&ufpEvD%j9xvka zvA`St3TM`RZ1kmrpzQ@SD!O)>eKsU5_GOD}4FpqgJ2{n4|HnD$z~l`_L!w5wrmfoa zAEd@I`kt;{rwoVLAu-Fw5qS(&r6c@sm2*)jvt!FHrVv)&@XV^_Lj=}%v*bZNyp`o< zIeHH1b@4qdp$8~A3ociO_N{bJgNxPst9KIgVE)zv*K?ls+guj8?78Arer&yn zSZgr=#n&z%o_i;J18L*4Ndb{DW)t*WWoH6dU3PvDOsT@sb+_+&_VNvQdE$i%SXQrK zy}<>%@f6JRdJvX;{U65I*A(Y@2=2>6CjU4;9O4DXixuDrxyOua5-8$WsEqm{V=KXC z&xd*h0SQ9|_PLjG`*v+O!Uoo!YtR`UPI)ibYn!9~28^Ug128ppz=5*f1k)LTE+%!b z1mLNp6=B6py%9Bd5a_=4;zbA(m z3=vX0KyEIS`=I@P)K&0u2yqj^^{jVIEl(Fi8K8PbyDqukQc!|R55GU%h^o)L;2cc= z`?|Ft&Lo@UG*b=>*-2V!^uBP`}R$P8vuU^ z7bAWX`ACC@DU4d4*O&eS?=a=ineQ>NYW{q3++7Kj@ptzSkQ7Y(&p|EogghH4P+~bJ z&xN_N#hYXBp#e8JN9w21aM+r>(Q4CxS=TO`XasK5oc%HkA}0vpFSXogdC-={FBxUe z^6hN@eJ?Png7ue{y2gS565|7)HuSgbL6m|5pvRIgZV$+i^9Y^G{R=Bt*7WgbEFc&& zn&r8}^lWp&Aj_tqqI+GinG&q`Wk#!diUlP4P^IXF%!EnZC~U5we*8pa2h2^se0coG z6gyuxm<1KVe_yT?`f>$wzPA%GDKBu-Ez;xomCUp2Tg58|El^WWrEJXKv62GN+d+z~ zwpXo}$=)QV-^IvZNe+*Azi1x9k^ccx`C#vzb=G(ETfJ`ax@74$fMY#y==XF`@EK|ow3vl%1Sxb{#1E_j1kKlXu?6OhKzqQ4A`vsk2!E^UnL(0BG#-yP zB4VYiUu%u=?A83)Kp$5hd{74V$+X&UK0Rxen`t+h%oox%VhJxj2EP8QRQ5Wf#VnxX z)>H);V{E=;YMRV%@ZAP$rZU`B-4VjDf@)_^vQSj(7N8crsiK5{lWseo8GIVI#OexD zCK{^fs`33q@}EnREiQWjGFeT^k?FkUl=?RaxT+fc*L6Fd_6QS^T zwXuPIF67hvt{mRSk}7?LZv{T(BL`eAf9-M2Y@|a;Or0PB2pzq*flV%di$8t7=H4e3 z2XGu8*_HXYIZQj@nWv^*J9y62zRWyE{OC2(Z>;2YNGUb3(GVZ(Dk@SCFaDi&5e91`PTKqD(@gJV}8=&y7l0N?9zCz z{bSqf>zn!E{qU;G%rb6S!L%zPgHK`!&P>9pZT z^_dsDA{u>_PATbZ+~EgehCU>+yqqn=#c)vOIT z$vjs(Lcasvw9W3#G5m=hh5*KDHBumJnGh^_TZA;i50!7n^z)9WVi|bao}TesN{XNn zZ+;;2c?(oq9x&I&qR?kaXSy4ysi|&C^0Wsk+a_P4v$gIy%5&ocI~s!~x%%Pf$?-W( zH?7w&)WJXl)j_qh@8y@nA$RF_eyRGGBcFhh_OW*+iJvxZ87>d2KXeGO9ZU_Am+Pms zIu8NF{4F>$^&aP#y;jz+Ob-{Gs<44&w#jO23PnwF^=UbC^l+L=vO+V;2lniA3SnQb z%y;DdMyJF?d!WH8LCj(841z*eTD6aGRi!M+c<$5fvv9=6x1t{`)coDNhMY7Kci@__ zIb%C<(g5l!!-BsIC2(53Z5LAy>L-!!XCOjBq z^8mYUw?EgWh-qGR%`aT4VU6`J@D6x8<-_ICHD!?1q*vX!{=Tn!1Xlh4_%;2L^nukj z@`9KbNwIH8`L{^DMDWSY1s&aid?AeUZ2N?#Gj9y≫&rqAxL~aQlny^COs5?<87j z2~90}&XX0<>!aNAz&ip9X9V@hEFr=Klwz6$262w_$ONNdjM)O!obSsrmPd;fo-kEm z^$V0V1|%gl(JZboGzV7j*VNqmShT+2;6(UI8#e$2*fN+ykZy`8+W%U5QeP+Fb0)cV z(4F(0r&Y1L`^~H8C>-Q4F&EP7Pw(r*Hh}$hDU3Mz8D3T?e||TBT`&dX3OWlVYBhYtPcosl&Vz_rzjTvPG%(TC>g0lRP4WC(DU;TM@GT zvLh3VT2hWNyea}`bR6f3AI$Q&bH)73d{n0?-nCq^A8wJ?K^Hji{FBV86@j?T*rrLa*^15C8KGQC)VlS~TDl6*6u zzu{#80{5r~IN!EG&oI#I>}!K@GZE^2ec^`gJn}y*bH7;CR7fRwE)(m*0eTy?rCsY0 z#-+kqx8J4w@%B*ZP!^4Ogol}pi3(h;T)-Ql=~F=F7UIw2{3S6J_R142;<>X{GE}f% z#%z_8%x%OLlF`DxZxYwV>)4ZmV+R(g`mJ2qlH8E64=7<1PABKjOpm9B{6ltYBU+8p zxF;yghcODvD{ECtb-uls$ieN=abTE=*~x6hj$jJ2WFu((KY*u9UCYy{F7xt+79-(B zEJveX>_ySK@Pn9A*k_-HiiU=Zg?cL=suzW<)Hf<9txdkt^IlOI|1wcT0)?RkR8S{2 zDcL%+S?OK6YAO4~#vhA)(M%Ux1V8@tnG~#_cb@q0 zLhMCLoy=~%2*dm;gAAs>_UNM0sO>$xs_HG-h7-UAuWdPzm5#)(9gAjQ(xC>SPX01{ zKLi9e;Z#1aWBgOpJ{o{Fo(Y?fySYU_HCy+gVq-jrM;ZJl)w*Jk`$>^fm=$&?y`J)O zYTc>wrJeAILV=aZRG5@hlp9Ly@7&5X^BofZ`ttUVLO-ONm%>tg6m!BLrN%~|-VAoB ze&y|~=_=ev71`us0-X?UZ0VPAp8SkIx{xGW4S#vY`|rm)8?>v_yZJ|uEbr6vj+X4H zF8@mQx=)S3Jq_wz{2}whw&SlCf~t_HY{&VtN)~xP+a(5$wyCmtxce112G3r^KrH5T zsI-7CpGQV%WJ2o5+Ng|qu|280@aiW#e~_;_I8CF;-J(5PN$o4`DOYwx=+I6LGZW#v zp2b&~9}K3johbvUf$S4s-4j%1%T0XVlRkf$gA5?g%iT$&+Vvw#o$m_Rq$~6LFp#&_ zhESO%YPQb47a2a$7=(ovn1}p^gw*0XZ;6h(&$>j-hxxoh(gL9&y}%q5T&zHAXpHt3 z#1VVbFwTQucn3VywLB#M7Lq~qT#sJkQ`GNN8Ea>RJXaQ-pHt8Y7z2oE~&-y1#o3 zME)P1_+JyQDsLfPEz3Lm3(ZR@v5BrpeS8Dk@t4`FCiYOdiw)Vsf;g1WHRc;}X{G!X zeid%9=JgpTal4-W&uX7!+G>%tPT=(YzKQK5@b7n}F7zWk7RGLEeBC@3BPHe6cE_#`2Bm`d$BtqzWVZ1S;~=x{_xtmn8jIEZCY`;1~WvzI>xX2FFML-<3ZpTP5= zjBrZsJQ3?!JH_mNEwz^a6zq3EJ+c0|CJqG}*F00P9t$rl@0)Lv?uzJe1i55A`M@lF zpxy)%PuqBd{N8x+MRshE&HxYr(+N2Jf^H#pN(j_4QOiyDGv-;9m!#|lIn|{yfODlC zKW?ENV&x}>z!aHn=4VJz+y+IIdLvh)z`V>_CH&c?#1PnF(e$6ZFBTmRc9O_IS(OkdO!>gMfm+~lyER+@o&<@B|CfN1!Q^WADau;Gl)Frx$Bz#^9sVp%@B;i z64^ITgH)>x1$Kny1c}nTD3>!{>sSRxwyIU%%VIdszQ1R6Z9be&!0zm!y*hFZO7K(Z`H+vP$9bujI0ywP_?TsPdCGp zfF}UVw9E^>KT!QPP6%UQC3IEFC0F=Bp23uyvI-rqzI7kLFifE`ytLAdAm5*bYwjwb zdcbwV0Ck-53ehz)YCSpJk4fhh*~`%8d);d34$1F?@_u&-T^Hc4qoON?4Zo6MetTsJ z47A9Dt{*PX$wS&aoVQLTo&2>%-q%xpqE72f7nqRyv!b6v0h+yvs$1s~ksFLH9BfP4 zU1U_v@+HjeeL_J|brIH}7OukO&?xXNvZH|jw?d{NhY3=kUE-1fe0m^#&`F5LK!w*_nL?x^{X2XjHnIiVo0>yJ#Ti0LZWGqBzx`+XZ>z?Y`Q z^o2v}jXBwYa0m#vL7~yMP0BK9C)Gw=bn=DucRQ`hS&nB!yOjvU&HC$%Uc zygBC;2kk4hR9smR`5T+#ntVw^fD?BRyti6o_0->GPtrYr1_|b1o>caMBmfDW`VQ^< zZFJIF(Z1L_P-p>3reEAG*NOig^-XZ~{D&)TMw;g0upt2Ismg>$aXCbvz+vM>nNibr zDVx<0{M>iF_*qIiLy`|17kd>yp)kP$DQj|JMDIgQZgN@?uU>ex|1!O!d^NS}MEj-4CPWj?^ay=O+8k z^x#&La70(~G#@^*yj)1jZ?_WXFzf;f?MDZ;?qgiP)-6JIdhtV3kl6Q`Sbqba#~`oM9a$`8I`g_k zZn8gaieeUTINF2j)$v=P+T}6>-OGdp8jGzE?QrEo!lhq))mssSSsp}Zz@8K$U1iGK znp}ciH;rF;Rfw$@D0+x$j=<>SCgtGmlU@+ z>>-4~cpmSb<-gFn^8|yiu|zZhjW+(M9kHolsdi)g-+Y4;njVyqPsr1rdjGP9NZc_0 zz--&~QDMTo`TqjFK&q`xd^hxm%I?(5h=*4rFAB> z-oL6|Wq3U;%))0n0kVxxU%-AmX6y0W2rustBet+{3Q+15QJ;pZ$4Zd#4npny$MEFq z4D8*??;N+qG9c3F;Re=^rn=q|pN-%B&3-D?CzK^@2=SP;&i$%X>V9n zUCc7vWjNZsE2_kDhik3m^X;v(qgCZ_-jaUZ7-)9~Rd?Ra(h>zoSUK0EV2u8EzV zwb)+XBk~LggXl#h%J{S0#~7G3lQiN)y&o-U_y0778I=w7Dw=yiNdHol+t;q0qDo{q zZ)Ys7oz%WXpf&U0u=G}><~SDT%g!i&pE0Y_2oH9!iM94IP+Bk~uH ztL%tz+_I{_(lq_*Y|5lLuaYY-xHo#}euBM+y}d0hrts34DOU#tcu34%2pGH@r>AA> zi%KsY_ay~b&Ax*NcJA7}dr!4IqsSU{xsOzD+P!P%FAf|#c=+}mfAx#EmI=Gz3mCNy z`xtr1fnUUoLhEqK6kxQpY%P8PI6prm$X?w$c}SK+k*}1Ju7Ol4nc7>_r+tL{37rCEYH4Rou3o;;c2PBSh+SuNU|1R zq9YOcyXsv^#Eg77dtZ8QnFE*ou;od^>xKKUi=Bt$+|b_nQC?l9?x9!@dHAL3F1`0f z;+5;3>7JRH`8=40RIOcC2nXsnZU^zz@YA(gXG7V%?hz-bXZ`Et{kp$b7&OXTM%g@j zE$pk1z40yQE%Xnwt#NU2=-#15M}gT(>|PXLY}_F2^1X+r7#fAbD{7!ovbdb&-eLQI zlCXj5B0lRk^yrJ$zCex2q%)mB&NpQkxZe%>f=qs0-pyAiV%*@10PzvH}D~BK|`E%Njwa zDf#fq<$Ba_R+aVZ{y{-`m5Vl*xoucyZ+)@e)rIbj<=#$*ti0t`=^K)Hqn|AE**5Gi z6K%e~t*zf+59xkN7hhzZ*T@ZcHhA|7;*}amrc(G)Ob7j^(mm`z+;Tbw=0*(2ULE;` z_TdSNT&C7x4>RX`TUvT8;|6A5^@FzcP!cN}fs8W1!_(3_JTrInz#gi)0=>R#*6coZ zSbOLFtS=bnztMRqTz!e_&|3TA#4msPH99{^i_0c2WkmFAL^}_C@8N{1zaBmeYN6lk z=vTl_ROFY=dTK@NrNyB&?VNu#XxD*Bc`R zOJ`!S&Y03J*f(@wr3TKE?NI73f=2aPX(_^uIkXK`RMc zSh#HEEi-c-)z_pkZgAx_WyO7sca7WXg~YFUVMYxLw3o1l+PQH~isUf77;PP0)t*jlF6VbqVT6!Sb6U{R*^I?zKBE}DPgR>T3=Hdt788{U!#DbI3kI32{W zeYpHNWZC9<=?lIMURb8UFI9c%t*@wY&o7GoVrEoQI){1ymP#t=8aSyQsUmKGeTc1P zJTg>#fw@7|S6Yg%6P#Dci7D_M_Vf~X!zM-@dOd+;9K19juHb|2Op zD13GoiLBXuaDf9;F3aBXH=k5pkN)#zz;2R@2oFqxb(=#K09YuC^J)QWd#isoR}AX;o#0iMXR;}Uv*C%Q!y<6x zFMxgZes%aBU%r8urM%@Vn>P|!wryzZVb(;YxXeQi`#QyWUt&BwbtuCjnx<}G z_%%$-!?D~LQ8&6x_i%>93+LZKE%Yt~F=z*{$^k*tKDROae62!7^S$y4U#pZD%gDPc zByV{3##}xv z=~&p3I$f6ynzT#8SV|MdI_N(zVx(Ve5nI?`BG8*L_T3i+xQJ9U}A;| z`PB~o#V^CfKkYf+bDn$eqZr#)mPBs2Ph2~RlOSDmdvwnEem`GfZt&J?5ZEZN4zc|j z4AZYr!$ffybLORlMK>Qt$JLSG0U|mt_I;`Ti<&PwA6IOA_-|^zfQ?e^7eS*aYdJz6 z8LnMzOpT(wmkwNRm)bSJvO^giHo>txBGQe8mL)QNQU68GWwI?VU#_6>x~{JN8g0Jl zzk6^lLwC4B%EOhFc}M$&;?-xzebMr3Vs#aPm3nwM3FRSnU$auZ=4AOb_u#=gs@KNG z-&{V%mkkKwTdqf0ri9}y{|2kU@kDr~easlkpLq7NA9Y>0LZuRVr*Nax-W;^rvSa>B ze4B3OuiE_uUQ{%CGYa5gjGW8xe1SPHEtsvG?~wM3Xos2^rCKk1PEhf}0<2h!(7O_p$8l`he42(q_j5$)H) zk`tUe+XbHz>fz0sQLR11-YXgdGD?-O;jrYUgu{;Y zm+&@NIiIvbD@8q@Dkk7tPN90mQ}OtRm3qJ*_ONoE!5bJOl5)N^)7r}Qs|}9j)_ySO zsem;O*uJkOE@0@rhYRX5X>{IsX9SjdhtG=G1XJKn$EP45qH%&i~kyaD3Ol z!K!_p^+tH5eO~(36JZnlUAfwMYXKH&*r}{hQ|2dEZa+Z$M--`*%<3Hkub0}dD02_B zY$F`D#T%mC0DGf@X}w7uRY|60@+~K*^NOqL6_+pZ3OSfRhI5&1%gxQ1Y%{43Gnq)1 zdoSVjLOm~=FZh-Rr1@gcGMSfE`!&LoL+ZWA_SLea!A@BwQznFU1vOun79hh?Q{VHDa zGhbNL4b^?!VrH*oevxr`&EZ<6=1U9bB{F4tnx*sUSvzhSt1oB|H)Qoi^(&VveCBon zXc$bNcm3R6G~Qi%o-zLTAFqU0+UJRgv3$2&Xs;G>1WO!X!3I-QFGQ)|`mgZq&vEDv z_413>UeL``_Z5ZZYuK6`>d_(nBnj8DHZ3QBjY1JCasdOkSG8U=KBNU$zA_Hxz}21` zz0Ef$t&*8h*$flsBN0MIMZlZyXYqVLVWY(O)o9`7;aMi}yrtY&!1%DG)AD_FE?+!S z%}ZWaj{>#==KRWvo*tt6V(Q_Vj$2;sCfBkN_{Fxbv;d>hHgF!o`E}KMt)ux;-B+%V z`@7o*_sSj(rr$Ith~M|`uo}Cuxp{+b*;f9tTQvX#@ zCzo?;VcxUB)Pzu7|G9sMRr4J5AW!fKh_Q5&UFlF~n3F>jG{42PG1%~tub$uOoWkOZ zm{Ef_6&?=j31W=%QZ#O!w_mdU;>IggwEHjWy^7d<;Z(%I{FfWOg5Jo0 z7}c5;*B6*kl(&r9H6Y3jVa_{!UrmtBH_7af)0SHnX>_>MxwuI6YxztKuKIy%EAtXq z>C|pmvqKhc%#e0tb(LwolT+Z$&w|>UW^9yHFIs=i$@EY)Uqc(19jXepx#<={zh{GK z;D@G!<0bzVtKxavi#R6l$5!_AV!(;E>s&Hhm?Tx&ht>OkceF%9Dm8KUxU~bKnEWHnJq1r@&=eei1V& z!jgG_Hz+QJ^HNAQ4{&dj@OnqE`=aTgRlXJ%78Xf)sAq@Eoy!+$a@n8xd_|bOmiQ31 zWmGUxZp=)G?`v{OOE)H`IWR?p^AuJo)Ts4!rbeOr8Y=MFEd0}L2W3JK%WxDOG~Qm9 zp#kyF?$2{xq*=V~`3~K^ds)g;Nc>&Fk{IT#ey71-f9>KNVeQ6nbl92oHH_*d+Bybs{Lkk-vy%&A0h=chm)Q4GMqg3ma&1mdKn`X}UV{{1VhN@ld zjT+nAB=u`#T)0upjH2lwc=K9$*mbc+iq%)IAT{Nd25kHDOYtX!SKs z&_i2!DB44=UpXpXdik|kD2x@{rdXC3Ov?yFH2(o_r#wCG=Xp<>feq2gFFfdSKkcgH zvL=KkF)9?ag&o01u=Dr>{`za@p5`3lQf^Y~H3-^#6u|kgj{DLpFx`E12yk9c4|NZg zkmgGoFs@!)!SbW={GTfDSkFrNYR)uEU}Z*ZUwZci=!R6Ub|0p?E=i$gX7}_7e1Pjt*5XP!CBr zzaiC2m9NdQg6jdIX)t}o{S(`N*r;Fc?Duc7svW16Z=YwhGM}BV25zLLaRl8EDd_Eo@r62hU z^fm7?F)Ewk*&!7#=;q;A?$^xT{{BWOUjs({Y6SI=jb9^>ZctVVaPxYA*wyt(&Gfv1 z`Y%Md(MQ6|g1J zZq%;*Qs<}hviV}!Jk>5PUw4rAr4BKpB<@Rn%+l;Ioz~RDFI5MI=Ig;a`@*@ zn5tf5V-Fv?W%!mr5X)gY7>I@I`wsdyS(VO@JgVd~K+lIfC-Dh<3)Qt{%_hn@*CvEu#Mu#Hbpz>AZ;UOwm9_z2$s{hJYK!Er`Guf7V zv$XsIwKv1Xt5ukX?W{gD;wqcW;USdsE#nIiDrE|O?o=T&xgEq7h2>6L%xbB1ov z^stYGhuC}(v3Ej@UlRg7oYb>JO^qV$A&`d~I1L($t z1g1>N>g%osM=`ROsZrc}Z43<&bY3gx$56f0`PB8pdTQTZ1@H%q7VgktU&2v?GVrp8 z25@hCI>z$XyIy{6z4fxmy|noX8oA3Nucx~9-v8OVy4a@9GmP4Gq$=ykevr1YR_fYG z^lu$y>gXt=KN^FIjY?zdS|OxyL%EwK^)Auz#S&j6OGG3r+p!h7AO$W+WSt9YDRCUh zL6AftaqiAVZtcXo$&ir9&A#{VJLhu(I`%P`Bc0DqqKZ&C#wU-T_kDh%7r2kpbrdoW zr$E91(?hqbQpSf#mTbU%ln7W_CWoU!yuh{$)GJ-m+Cv~;nWAD|sj`AEyA26ar$MD;J#?#9U{{p4Rj{6f?6 z|6Jw#;^rcb55@Pzy7>h+v6pSjYpbjG6ox_OA)%MR7cIX4zc%KY2M;3@_W4$RFPb~F z@J)z9aza*K>3M_mLfCrCjCcJ0BR6JTSjHSt{=k?eei*&L{harp?n?n!GLF*2 z%W)QNc*$2>EMHl@0z=<2Y`!w6o`>`ekRFQq5aFv>hSir{vTj=7sJ9wJ%~*^B|k#oTr3MDw6WBtd4D$6?~Nohk`!RLlD_J4!Kd3cQ`zZ1Z+sO z^QfE8_kngp>QZ#wGS+>O@DQk%<0$ZQL^z)ttLFf}a{Hh7vwwhv^Ne1IU^;aJQxB=_ zYk{O2%LHGN+Do%TSGqCdD(7W@w`+ z`N*Gq!^^Z{+l#=gSggU{91|vn_!Wis`aI__d1Gpd@;4eiUs)D#0Cd6pP%|&yeq}~c zzyVFmr4*4b{3rtZQV>>D@TE|!P(B=(C|;wY%5j1(8XwZ?i!94|ij49O4>|G>=7tKp z1i&CUswU*ChSCiMVY$C_;N8PT>|4I;25&&%A+{~gbMD3h)h#oCvF&RW`YI>LwS4cs z_I&|<&CSfQbe>N00*;0r<%6yKU}nmA=vEw|IB$ozNh`3+uybd>FX7>ixxCiH)b)sB zG4roQ-Ie~%5vZ(8PHFxXm%>VK>>*4Lb>tzgz_OIuOSv1RQYo#a8%50A00grE!R$oA zwhQ*zfDg0luh#*;t_||^Q0h`JHVU1~lzPasLrLw0vM&tY004v8A&EB}MZc<5O5La{ z?8+(r^|uZ@`JYkjhTFFM4YpNo-np$Czm{lvxFn4!oO+1T`THzAyeX=AO}-R<&8=@J z0@l2MW7l`~8sw>!pX<5b8Tj?WGtqU{_VZ4Ni%5dI3_Et-^Xpu;dbg*}dpVdkdI@ZK z7@K89@(rKotczb$Q*pwtWaH?N*I%Qeo==nS3vi3OQc`K;T`3}8sgw=dFNI+0i(N?A zH;y)rtK$ioat4^g&(nt5_9o?5mI{1WoYm`tOU;TY<=;1BeeUWzFaVT}(sp`lLreErO*@>tB0K?ZJ z^er!L!uD&Pj#h3g;PlW<>|Mpm6iPhA)fXub-P9-$Z@}(rL*dufR`UXmT`zVAU#+}h zN;rNJU1@DTU0$EVyP+O_hN`Ihm>>0qwR4bEukJ=MR$mR^h5sF;Z}>cik|5ro$c?18 zb6NAR_^7V@N^@H!n!Yj;8--PsDb&sviwI(XU@5x{+QYJ9U+Q)`=zFZQBhGn!1GbJ3qjU*gxe&6|G zs6$Q+mtptIA$sH=H6EUvrHNN;pipq^FlZ$X}z3zNCYhF%{%1KsI)dN zkCOBdwTGFKn>Y`ud5n%KmWxHu9;#cS04EVt-FHS@Uw~i~xiK{9R;GY@V?=T{+{Af> zUnJTf4}8UK zc(M+6*nKqwN$q5F-XFcf{l1}yQ*cyV=N@Lg;zJ@|*);FH)JK*%7zWO#Q)wwp;ldP{ z9i~7ykIMOk`kF`-5{008&@;IFLiyn^;1^F13BN`rfqISfoAAX0L>+ku$mP@=aV^8} zFz24*9eMUoP--vOmVtaB_tLgyQO=`uUhlqGH}6TDpV7Oo2cnz@?Z%42uSyF7j$K{v z247Ef89h(kdm{-)d(Zd6E$|F$jpc6ZQQ$=ycxwmNFeMZeZkm-h*DZuUpzaU5aB$>M!ER)U@PU(7(5~o_O8Z zqJ_=n^VFYkmRGvRczg4M(9~G&_gT06@KCAk;tlWL03m%Wk{>p4&LZuanqt)k^RKL~ zt3(1eD%uToFA?|hisn7SLkjIJ!vN7PDg?6=fL@8f0{T-ToJR;F=hx84$Z(#WUxx0G zrSp`#F`x^V9d*atje4Ckdr5kT0Cu7?PyYc5?WMY9NIjhQq(*7m*Rl>hq{=UkY@SzN z4`#G$d3^&$hlpR5m90Ow@Syg!V?AMvh*WyL%$zo4=*n-=9Est&31 ztE8oeWl|reAa(=pxc4fkFA0TUK@;dtVqg?$Hz@NE>b}tXg^9i7{6ZX?)yj>5*#WBj zQs`AvHVLh?W@R9ZWs4KeI+IK=)Ug`M(_J&e`;@AGAfsEqh zjgg_Oy(E9$YS@nbySMjP^a}U=jv~pi^LlugH6RR}%Rs>tdSxkmgYxD%cmt9*^zJJ~ zsZol26^Z~~sGU#P3cnIT?NuiS-NeI5K(I+n-T>JK2@lP_WdyJR6ds~?8BNQOyTNrS z3cLWmkbGT11UufL=l>$49xlrAYn~$yv9NN9g@-sfT&CC!pkI`ED20`-?+XD8bsHNr zJX}%u)rtVoTu*ejSfXq;#fL2;;^{uGhqS!XJ!Xw%SZYq+fArYUVohPJk#ia9daFV3 z5%bCt@k^9`=$in%0_Np7B_3vtx@B~J#f5^6rg?~nsTDyIg=!SV&0 zFVt=flWt>#Lgz)gq20@{_yP=L+5CW0qtN*=-T0;GS6z$eJBVM$H<5nL-`2SsOTfN} ze=Td};WFC36oLVI-Tao=*UXIMMrrf{;XEzBDiwua)6@S5{`;}j4$9YzoYtOqqHFE( zu$Nau`6Ik(=u<;dV|nbM_+=TrC^1X6VV(pj#3tAAWi|T4T;z+&m;IkVQRs%5cqpm8 z3}9*Yd{OA3EV?S1mm(b3O5kcKntNSI$C+e))%~ zywY8m9Cg6-Gr0F+fyS7ohQ6WVwu`be$N=4z<^gml0 zD?i(g^~5tqQ(@1qo{O%wHl4j*?h?))!Kkt9ek&Xg`r}87He%KedoNR`Vg9ip-H2Ia zc(#5Yy}RfMzLqPM8d-oCeEu*fL^IG>gHi|ShO*B0|4w2 zGO+(#3g{?5t0NCbSbK<(ha);RiZmO2{Y-bYltg=CyF1m4}cw&*V#|MoDJW10i3+zEHZMz-wATSZh{DGX$~K^@Q2Q z((`t7wYBH`Ja9$8Q*eG5!WzpDn&4gA`oJtkGqZ@<(n1bV*IS=NuW z0tqIg8!2<{h6>Hi&iixDca9`yl|CibXU=O&jvd=bpFio*^S;mfJo!|zkcZZxBw@Kk zk{~RRNCa%@o<{BAGPMtBYZ-@M+B0fuin1zkXBpnmbG|~3QSBB5eo zE$zjQ;eN@4)#r-rdeA-GMpB2u8(!(38xMvs#_~jezj?+a;dQ~9=z=(JvdeWtTlxw{ zHl%QF{p+*W?qdjA{tOIlqd0OIR=#F2@M{j37b!PpDRDV%Y%k;PR{^G9@(m_mAUn*{ z>N28NEEY^3vHLXcEiaR06m}1nfqrS>p_0x^^omZ?=!?J$W?$GlZ1e7ywmekM8ySGG z`sN8Z(DINR=i&XzKgqP$ww(XB-dnyzrW@or|G}pKVAlw~ZrmUM``3++VfF>!b$xa9 z$HU#Mua89h{*W!>S3G(SIwt6yY#h^~jUvrM`}xGJD_9xV^iGYaH~EZxWhdO`m%pn=pcw01*{ zzVyzQowr;;2&+`cb)!iooZNqdL zwHvs&Ork?DjVdU^d5K_P*bCD6Bq$Jxf60r4uS7rtsdHev@weq=&>k+Uz%R`ES}~TE zOSt$|(x!(M5Y8_|TQK=*`;PMz`lV)H2w<7|tD7bI`Rj*}w~XxT$`#W!>OHu+isB9G z9sc)|F8I=0%hx{mkK$gaoL^mC<@Vv~uZO%@_IP60C&?Wa3`Wj43CAeP3a{J|)_XB= z#ymBi4S{Fv(VOH|ioW0_?A>M|`ZF|EC2}|MxI4o?d);I3E|SfY^Whx97kWk&De4Qb zOLDJSi2LHeFX$Z70IW>fdCIGVsaGP;(hck%1~ia5276yKZ=-S^T@Pny?~9vl@b z@x~=zy78&8_eJ9`Nxqz*-T2|*&;A8-%2z-4(?+#lZiVZ~U6VK{pHCSjGPDqi$@%X^k-lwjIr|#~>O*ji^10WHr96a{FYuek#L5zlzCb(QZfoI&WM2ec>)N(AL(M~guWEIZED$&9 zn@p&>MZf?5)z?Ntoc35xQel3&9h-VI+~JjenHdFp$3Mn$;yb2j!|T%r?62i8ax8^0 z4AU!Mf_|GvMu?s`;!g1a>ZGaM(2YZ%f01DnLRS$*8|)gTEH_YjC@Y^Ymuc?B)C+}& z61=kVE%AE5Tlo`M{h9&aC`?imU|smCWZ8 z=r~W-8!@6^iNFR@ug@TSp=%V!Rcg=PDJ|Wol%h&|*lI=5@vx@Y7xJ$K!}D-4!`;I= z0a*1VcQTmxb=PQcXNMK%967wh9om5Pm5_&5`W3Pm%NK7ZJ`^Sd^-?j-Ug_6Je4;l8zl8EE6h``q4@aVpyHxkS7@5(t z=+NH{bM{dK)z7qco;R0SyfI7SjUqX3Ac&>NbE8<`=~n>^4?#SSc`5m_#4kg*LEt5? zvaxtP9`IJaLehpXj{@$NlC$*KKLoquCJN2E#9*zRCKW=V(IZ zf*}KY-ksxv)UT*>$ovaM8^plKGYY~gK{}7{rT3PVb{^Cl2w^!ttdcAb6G?)vY$6-W z#^c$5r1y&!z=yzT&Q9!pX*7h+)#)pdfSY`XJVdZeu&a}fH4wsIQzqa z>NvL!dG^H{%hWmq2%F=qWf*{^Y4BA@rOUXsoXPikbY&Mff#T- z`1A}6z(Bl#2)1J9ErW1=x-^ZZQJD9IiC>z0t!v|`C0{nrg~Kn2ULE<~`Qs^fJ{V)m>4gwxH_$YQ(o0_bgor|P>F>=X<`>;5K1dx?Tg&r0 zGi4S6mpO77_LkEa`c?F|mU;IJ#$V_eRYvV0IBz8K32Gk35+vM+#pz?f0F?vFE94qw z$>tUPg559loR8wp7f!y2eyz79dJ%rDlV2}M=QaDPQ}?hVt06BAz)ak+0=xobG}%^n zp^1wh&-%7`DEEc@&V(w)@?^KWJg;nZ%i~3_Ka|%+xIBAQriJtp+8lljieE4R1IY$m zgLZ?k3z~>(_%-WqEhGObbK)1;^#Xu_XB3XVBznb&d%^M-Y=21*iw9iFoA^2GeN6#` zfp71Ml5I>u<4_I1uzT3Tv}H-XbpLRj<0`du!{{Dn>eUR=uZD!MMzi4n%q-gk@sZ(w zk!9u)x$_}+Xor6!n3{*X!+vjUpXf1!?=0z9!XkDRab_`KAuhGix9pV>-=f|iZ zfAd~&=lCFX6js0H<|(pr7KdLduCiE!$mKLN5P^lIwCe_5OXLCs1GjmI`%0n)k=2JV z_)5l5JD-5=VPO2)_Jg;9eNo=BnYLUhm8MB~2)cPltOWK2OUo@@TITNIy6-rzT%)Q$ zz2MS;w@#zc>@=I__q%gKm7US_WPo2}Y4Ic9bP|r?59L+}ue=2>k#0jhKWPlQL@&?s z!@LaVd9T0BL*bd$ZV;Nu&m4XY^aALp?jFvmsO8xrtuGgG>;;`ejH_e-qw!a{3~OKI zToM={``H3mh(>{DvsCTIHzM>SiTvKt&>x&A& zmauoY=(Ddn(l4BVN%)f73*Oh7uR0Z?E=&5pJwQg2?bRB2)E(MkYb%6T-int z+^#;^%cip46J5yWyKM+k%cI{Ri8gq58UD}V*FbfI!z$S{YL276NWYP$#vxuy^eO^$ zp>88pX6gl^jXdb)**Hosevxq$kuUik)Lro0%9Lrkf%sJ-(fJ zkM((RLTnITY3zWB{{Fs-*@NuApGmdJgEq^sHyU)ATNam$ca39=2CeI;{wlpUgWBT2%;L{@bW<6yt>ZqTOO?iubMPWx%g z(-m?(tW;?6s|NIoTZe76^VNl4zVwjk7XVnN*+KP2vq|{1)_CI{cV<9+d1U#?PudcW zuexJ9Ts^TR!YhrJNY--2nQ@+se%FYj6x|D8%5B551@&fHm{1<|N?`A4R}R53VxI6^ z{PJMNdd^W=9}rle(MyJ2+@<5+=* zO0TW-;up0KOHo?GTt57)7Ms5}n|zQD0}DZ{Q&%66lJ{X^&+HkxYyU{L>9 zJMX4oP@tr00&lb2XRiD&LjB(*#;!{u$3 zFJ|^?ZWOr=g@V=VEMc&22>F756~v?P;8yVB=_@ch`P{qX=)u4 zW7&UDj8qSGsF`EXY2x@gMi!WwIJ&mhi4TE(`PMHlayj`_37BZS@L=S;JX~h##ysVH zm2>mt+Q^Z6eonPtafDT}fMvk#jR^@$w?n^fNz=TBZcyh{Dh)?V`tFNt^HmTJd3d-D z1=EW!@A9j*Tr=CRje1>ZSACtQhmfy)p^(o%_*2j%oDH=rE%6mAEhF^Pz`}8qdawIf z{?=sq%$vvd>wNWjN@U5G8BOUlA$?ufHGV)ZzgWmHP!yl_55bGv*PjXx4`t-nC|@p* z0lHBn`-Ws5vT>f6z2!uCP6*jt8QggUEyoo$ici0|{fdcaItKL$$I@T4{B{1#Jo_SM zuS!hufb)QF5Vdy#ktrJ6YsFP^^EJcBC^}oNFK=LYDAh~oS3b{={Jr;keh+5h9)5hP zh0pZCfF)oTgZJJM>L=YtlI)Zi%S+E06*jYbb<~&TPLxwZm!0%Tz;qo&nHn-aL7-p$ zx?;tRN-{bMw)ruHeHAG#C8?xKo-Gq_p1>QFmLfW@If|&>Psc2R2Qn%C`}GwKBU%*csk5=HY-XT(^ZZ<-T224uq<0D443 zMU8Uo#Tc_XEPRIp0|zwCaRdGGS5Miwp_m)^NXTB+u%y>}B?voT&LwhX@@`1!io-jP z$sz2AFm8Z2PqV|c+DeKe zhZ}_5*kJErp-`Y_zJT^iC|G0m(cPYQ)7ucl-?#FqPS_TXp9g1l{_AJvwN!Wf5A1)Z zGh!?+Id*zwQ=GDy!R&E3tVCwx*XZO+7rLcdGVw!!e))U#=)+~SU@Tpdy)jl)hhMbx zBHAHQ4|9MX5_SXJsQ8>bS(eB{5TnR6Kaz%Zo;t8tto8ouw$4i-=f=W<_)avc%o`N> zHIBUHO%<9V^lMv+*ThVdaei6r*G7G9U1}E=UueJbG(BwO^Ru(!k)3Va?PV*6HL(h{ zQ+Ya?)R`&JFXcQO}0&5QPHo^ic7Ms7&*2HLL?ZokMiPwow# zAI8${*njo)e`7RXB?K-j?Ly!e3e+egt})oB?{Uv^eb1d~-`46Q+rsfi@b>drzw8{^l8@?)7|VXkcVWnwV-6GT(V}IRcLyDB zyy$`$C8I1I$(IWJhyJ@_xDH|4C?-c?mq%3Pm?X}Njtk1g+$d0^K%A%TR}Rfr+{^ot z=EE2=mxXYpGeWz<;dHun|6yO>9ZfwfF>+pZU)9a%W|Y-Sc3vRPdx4cR-rX|irPN@Y zm((b7&g;W38Xc}<^Ci14p#8jUqPnsRJAL17V`sG)@6gf)9RRVa3(8@6hj$-J>Jggf; zou4D_#*=ti=Pj$VFE($$HJ=$tr_p|e({0kPTf@5j0xyc5)rCzu`r6zAws%ue54Ul; zJgKpVLcwa{Lrr#HxcXXNUZe3LQKQ(qv93EWqyNg1f{}n__p^`g-s(X^eSbR%KktS* z=34bw*2QiLuk@-jVk|#116hGg(ag}LU*sxrbDTiGeARjK z&THd5lMm5<6_HelyDy6S8iRo4;64-$SQ%lJY}^>Z-SP;AhnW!>TgiJbnjWT8;c%*T zoJD{CH*7nEbz_*3heE-sG(4pBm+HT~z-4v%1zzu@$J|)1@!b~**gBwxy!|5Y2HQ6B zjfR{aLc6ki*}c7NcBOLf@$KFdu#e5ZU9Pnx;U_FNNa)(B;0@@jx+=WVtG7EM#_|(O zq|6-VCTG3lg{fG)ddH$m8HPp2pwtKaL!bIZMRpC6F1q;wa|35zI zrgL5!H)izR7vjE%dk6tj?bo_qebMw#l@PAI{XOy6-`}rPRvx_HYmWMM5`Jtue)o*P zUeZ4$x+=WVtImkA{6v}Mt*w`gojepxZyYJ>nW3W{_nxtX8#QNe$PM_tKHm|SN6EmE z#QLiU87m6KLJLN#FY3SMW#kw2UvuShF0SOu%1nWTk$UmvS0^z83a``1b))1J&k(E3?T%*mG&@TE`;P#8Hhh#j2bAGnL zlSA&mgnF&)udGy7Ny2){&0!OMT7wq#e`x8~={JM7ppQD&5k|cuR7b>E-Z(TF<-q-N z6WrI{l{p$#??@A(k;UxLEb))Q%iK?0PL9gBO8PiP_Cwux6%+I9J*2#^GG$gu;QSoy zhx8GvuekJWWK?Kn3wuyiDxYKH^8{~yXbkH)LIK+cWoW>rYn=B64Q;_hp5 z+pr$8`%v9|v2&i}i`?_tdniwq^U^xs(A^hlmw4{2kbG5EDwWFW&dzG(;r$*OB({_A zbHTQ7ycN6yeblcy!sl>=dZQC!EN>i++;9dDLG?PGZ^JQZh&(NHhk)vJU5;pmcnvvB zuMhOgSLc3((<+OjoS0JN#7c%nDc3yRei1IJoS4he_>dwi<8#`%A)SX$0Grp&`7}m{ z=`h!oc6_nl4lC*gG3SMhLA=m^v3hMQ?8ck@J`yg4jzE#v0bh zd#kVP{vJJre2J={R#z+gt2_4|_lljPt%M)@o~(;Z2rr?2(+O*$Bh_2&O8WjD>t<8h zq&Yxzn^?WJjovxLs3_N6L#{G_FonYn^vhRWNwW8_I7;Wre75Wrk}Aowf$ocZhx8wa z*Apn1JX(HYKo1pi9s-tzfTdEG+wrwtqTyjwi5Hyn)hfhmi+iu_ZQgtxK=#&ZNUKzL z%QCJ~A1<%wjn!8pudN$W!S-l)xKG`e6tJDj(v+yB@9uup6A%gWZfl?=2x4FVNo&^; z`Z%y~9Pw}YUw6@Otlv6p8#tb8(VLDj96V%*s2i-o1E*gm9?@HtDT4=TnCk+=F*NvT z@G|%F!nvB1SIesRV(NxET!w%p*mFqJL)v}`-QvVbfDcEQxgn{C6t@g$FVImmKTJi! z;#*tvtM87ATdpq1<(KZgKs{8%!)-IL(!2bsGxQMDD4||!>ua?6Dy-}Ni_~it=8Z&E6dcVAna zwv6GS!bb7Y@}zgSjK$aTT3rTKsMwwE-$T?pY z-4~lSI5LHe^Ju+5jgtE>IXtARFH$e6NTf}k^E=T}iQOBt`=aKns@pFN5KZ2^vH7AW z-F+c!nOyUAgjF(iqpE$MWR)Bd?B})h>)F^J;>K z80eXKt;+xm^J4ib4x4VBlks%`82i5aoS!c7?OWoRQsxEc-V!{|%_(jOP=Ar)3wpHh zzRUlTy2Lqe0m#Edq&p))Uyo{VdG!=T^`C_8pZ0EFQ2q7%mut8Ck$;^Wv*g7nF!J!v+@ocT`TOBOKzQ4Zh;d?&os`R=^=sWja#g50^)jO0Tr*tWD8I3Do z>=ii7uq?h4@XNif2u<;4D^i>e<7Qewt}04O@;FP8U0de72Z*?R)CsJ>7LKJpsO`*r zB>~#e6Hve_+{seD4xFh0UNpz5S14E9>SROR7X?iG(}FIPcEuEXm!%3FzQ^ym$?cpY}5)6xV>!by~sO&@47kBs=JOGRhp26v&hK|DTI&b(dK+sGTZK4L38lK=ig+%@AG%uBf{`CmW zYd#$Hv3PCu8|<~2`O==8tthW!E^$xTNcanxzrS;!oTyvL7cluxhet`5-?cD< z3j8$A?uCxTiub(ym-_O7?o_u!HMBrd;Hg=T=v_)zWJM>$>yqOuqa)2Vx7(ZTAR!qF zcWjvD_P zX?;F?Oie?G@LD?Al9kuX#BSWQ*N7HvG#FG*(}y?<6!<7wqG*$$md`<9W_1Bo=1|CP z1McSY4lq=9?#*&3`xOi89ZV2?X?`SQ_h{=snTUJ;4$CljJ-i^JuFgDnPZ#Zb*--TX9(XZ2%1s%C#Y2@7<;o<+oO5Oa{Z~t z^0%PpImXM@zeK8epy^B!cMP5ult?#>CFRdJ3d{K*+xs*Cyte(Mp!f+<+F3zSH-9kW zmKhU(2%BX|P*m){t-iy~eKM^%NHxWlV$0^a6{xXK8cidb1egYt{sIy}-JVsg@_Y0n zC_}Cm`@{y~jU^&^ADHK@QazFSmI>Innde+*?02c+L!AibGI6&trj?d=nKN`~htDQZ zF|mDh@DH&MQS3%NDKuy4d=`|pi)-(#`50r~KoVBFX19e{d8i!&_2Ui)pU*EHm#i4Q zu7W>Sm1GNrk6%4x2$ZfixAw0}Hm>+be?0a|V21sHf^lmG%Rwvl(hTy-sy45sz z99G!dV5HWgh`k9c^@8ddt-S#W!GbEe|st#?tnMev7Dg6_8?c*V!%azTOHjV z+(+DrHjuoihvful1*($iowF?YHArO~oMsLpA`78sAbqjga&ci{XlW6zX4GLZ~= zYF5jvc5s#+JkC6j>|srx4w{o6TnZagtTM)P?;abR+jg~SO!yPjzchw$Nyh6DXn_a_Fae!Wa`G1YDZ%o?=)m)WU>E16GsK0wP+FCD!q-M84d`Ows^ zTP^tRf#P}Jk!b zPsa!uMMoIIi8jq{v;T9%t7Vhvt%zhHt~~WFNScAsavNPZo|w&|`LnbFG)Kfp&nD#* zAZM2H$XhHWwwSBp^!2~hJuw6VUJB3^0?n-9?e0;hr*7!^wL)vBcodn zrhk03e}3nsc@KEDIl3pRccCQu)+mI^Vind~!%HqRgzVHI$#G)NV0q0|eN%#-q0R#tvS0*3}+TpdX%opacD+=ok4!Gj2 zGT&J`!tl0xb@hs+n^9Gw#t)!N+c|KBiCHq@SU~+8S;AX4@?@8-ChX-6DVA5h#RNIO z``_KcE-yiZL-fOf(z>p=cObHnM1)3l1V`M*PC{(#F{25pH$>#u`!|OR9st{&p1h?7 z`Tf<(8O=%{JNe)K%`&IlHsI%D7G(ZwrkTnmvtNo`JiuMTT(C9ks2U92N{3)&9LVIq z^CIm1O3-VT(?a&r&)gZ&RsWy>AQhc`I9kz+kq^jEQ1-TRB`pRdwT~}^oAGLN{wMpb zyOSK$)y28vCE`D^Qu*&p>N&`dRB#8)Km?5%<1q^1xI3wWdtpxGawWfcBV|y$XKoFH znOH4|$g9TU77$%KEkZSvd{U9tCH3T)oInQJl5o6I)=>F~lgP*VBYeqT(J~k^dR1G) zHG^94{ApE|54~froyNPb-=tX@sF55x+)Na7k`7ANqcR}xBsIsu)IS)Vw%qGgao9D+ zZuL$a7R|k@&b*!f?M*L(!GV0mnx3{Lx#J16?GwBkD6L-2!{9PUdb=^&^?FE&lhKjq1$owg)MAjL~@&5&6Ie9xRqVncBawRC_vK;*ef zyaBIV)uQ%US0G;(>UQ!Eo?P7x*0*}MWT~v$(R>qRwijG_2I~u3_JK62jx#O7?je2mEPDXz{Xw!`&S?htDibG0f6}|9>lIUia`yTRB zfT$d^f%CIpiwJ&?66Dvu z`ds?&wv#w-u%vvIzC!?BK~;0@hBgUWV7VAL-oZ3XjfcKcuwjCjqrh~XYw_lube+#a z-klmRmtrqow@g19cMYDkbSj#;4G-_Wy#yt;ppUh{%?7?7MKSCxv(al2EjMpzXqCcm zk=iN#-_8L%q@5m5k>HE^bZfv=7fG^Y?oWZn}TuJrOTd#MG87P$E(1SySbfiy`_^{BOHd12VpSIi}PDlUqbu6+9?XOd9@; zBmmW3|Jp$(U@!pWLTt$U4<9~gXlQ(Bq>7lks^tnKdyAZyx}EOneu5j2Im?D``Zn!4 z?64r$OS5$Rbj4v&wxc&%WlD7!Jr2=l4CRYS?CoKdz_E!UE`gU}V!^sFzxxGo<8dN^ z!nl`|muY?N7=h<5ZgwR)u3=vC;S10QcITXglnsArTR=On2#ln2HFD>`POrT`5YIAb zf+$GYgm`vHw_Kjy>HMTJ4oR3x17%2ks{mwAW#}la7zN48tCy7k+ZS=^C#Ma&n zq6F6sGtvBsSjG9E1l1$sC=6rH{XdB3XbnwG4b2v^|Al3E{*MGy&&>)YY1!b?RDl>~ zS)+{PS9DN5Ls|6F25SZN{_d>>73E&9%6VrWNsA?O(nhwfQbdSIY_z*YJ!kDZ zKg2&&LelNRNpV!PS zs#o&}sTiWlViR%^+#Ty-m~p8JP>|qpX5&W~Nxp{fWU?8|H9e>R1D2NK0F) z&&<@7C6B;LBTB=9F;`{v&vFit3FjPSdqqu*%^{Y5ElEoN#(}eO+i6-OHaOKco0e)5 z&}TVbC%M6Gm%4|bW*wU3K(m6uRFa<>ALoph<_pIZzny6DOZ1b&;(dq{K+m#4g%}jA zC)9uRgi=SsYQFh~{k%r-Rn1=Pb6Sb0(l7TWo;w)Nzj|-NVvn_-c=cW}tKTI{#Q|%t z_&v3l_Z7$?ME%(&^&)%bvC-8-@*7>$#1QQq16{o+De{)7+lVfJ`E{2<`Udd61Ta^>nTz~lCP*&4LfL>)1n*q4DS@zX~1(f^yB_?0E4aF8s zUUVaXm7R?%;>iLlE9>H7j;4G>-;>F)v$JS+u74U_M1U(`b9)5-V6UwdLL{-HT0#Jn{-aYbLQqt*<^O-47PcdksBL` zzGT_n7Co(u@8uaE=D&6P?(|JP2lW$^XYksqsD#8HkUJZ6!1q*&Vgag913%WzC#em+ zssPxPxZpVL@U(BUx2A_}nQf~6(K~2TJMb+4;N#W0%)i|fvRUk0Wh#CDgrUzREZ|K@ z^cYXV{!)vq!cx>%#`nnd;5iH=k*2Kfw%yC&imnMT8+`v-o=jy{;QV%J>Qe1118em1J7Ty%3Y8(gZTv76gnGt3MBU^jZh-!c9fN)zuG~@41}6?_#0bH{BB*5 zV(gZ7=0waf$2MepGg$`2x1lB#4g$IiSHp7&Y(=+d-bRATtV@Bziy4phJra1|0x2Xv zZ(1I*ETp4~+6ODR>!J2|A)=$EQ9(pHL?z1TLhO}Z0$reriV8DpNxT2_lMhg$4g*2l zmEHiP!2B^{bBpo$=E|+fS4Fz@*lx1jqkN`7#L{UAKB-b~o9dAKMGb=e1MF&3h=WXx zp^K7aZS6kDN*SlL64h>#?dD7Cw75cGRA##>w03LvmZMV`l^PpPWwsl6nmji z$>PX;tGVXjgHo5}cM_6v`@*!O=%7kRYVAy-V^TeA2Stfhg%MAxnpDmclhe@^I94pq zY}3O)fhH|DW`FFUbMr?gYM`9!7yRnuh4*&SO0&kPu^|TLhe(GF;57UD+oxMKmZEsJ zY!1a<6<0#X*FS;yWMx$k&@qpgo>=*{s_jJmf{a0j-*e!tO|X=dkYU_vb;P-)GlIL6 zrlW&86eB16URCZb2h}@utM3c0Vkca;YWpFodcbZ^=20ZW+t?nBps?~bZ2VO1!_H@> zoXh0gSF~$X&A{xH+&&4#`$eOrR2E_@{GrQ~^V7n$jPJ3%cppxNLA0Yeo@xm36sH4TT{Cr2oxgJT}wv0L5H z{XOHIV{Ap0u0jZ3hMRwfymtfDV)on`d(86ODrs z=eCJuLxtE;mU>tg;+RJ5$ zcLO=2&!#n3Fa}H)9G#s*4<)NgjCP}=b~kzDKCN+l2H8FHSa!qvJahiV%%$r~BI4m{ z_(d-~iXN^PAj#$+kr5#I{?u4*f0&x;j1#xEPfNDHce1h3yRos+5&CXT;2>N0=BG;h zzCK-IS#!xK(kX|1MUpAh*UCvCl*7Cx-ZOy25G6#$oF652jp6%}NF!&-xo<8aF|?XR zQcN=Ul;P=&UtVJ{D6quc|Azv~gQOdfGRr?mRbl*ir~hxB>MI(QVWo6Bq4{NmPtmgh z{XvYd+#>ehjNDff*ZGIZ!21UbEA=i2dt)CsCNsp5M&jk`MsK9!jd7XlM}Tg+q})B+ zNh&tKD!zJlNYPOOKM}((t+e!;07X4L*Hm8jB*VwV|_q{va+SKeUxDE zBT|H0B3tgw(=X5V3)&IwvJ-l)`qspFjvzFCggA!E#(&}`x#;dmd-@&!Kx>5mSY=W< zcWC^*xEkP}*IxgiRbQ&LWQQ$jONn|}Mi)+nXa-2DbPB@qg4419)2K~Tq%#v6#Vuz5 zo_cd{@3VJ-_RnmIeI$WVg_gj^#*M8ydoOhce1tEIqu%g3eaq;Qds312diStpvPThc zJJY<#Ux3we$@$nYPvwVby*dd3rMmE3D_9Rkt8P{5zxHC=h|^D-Y1UX5(UEv2wp(jw z^8A{GHGZ2BO?l&_aD>e9T~W(oJx*?K@o~QUVEW75^{V$~|N2$vp`V@g>zRXZ&zt&B z>YhGFY4vkk^*)WBIwdmy!sW`AAHTH>9CO zF&9LKk|7{6V2*aw{d8OM1zfnidPKY3cg!Iw@hM;c4%NAj?XjZXpk%kOz@b{seOA!v zAhKw4yLa$sO^lO0QU{ee?g_m1Hy-m;fBvUw`x~sqHqivzpxb&lFQa@jZ%3mj@z&q( zrqxm6!7bf7>fi11?%usrEa#FIrr%PV&FWU{kcwuDp)<@BCLqLi%VSCY7zLhIy6<~E z{Qmw2Dz)CW&SQLy#k%EM5AI%k#r^y*ZE{?OvLX6DG%=MzWFnojLHXezCGjI%Q1tBb zf2z!I#RsB@5YA4tlQi_D7)2>C9K_(I&vNuLDU_MO3AF?X2PQlJ_usd!o*E%zgpoe) ze24K+H&0J7g)TZ~_eK6%-f0IW>eygGn3=8qnkhCXRJ zMH0-et*N+jJ90OYaJRYt`8Z)^^4$$?c35qlGHQ5xA?o|=UGkNefHl{VPO+8Q5RnHf znOddCYQ)7CK8X#MFz31sIy4qP9msh8bmrV;?H{!ZTOBrW&GiayGCGKw(r4MUecip$hTfR2Wqy@p*iJ;q+VZ-%iN#03N8A_-PY3k^&p!K!5!@J z4=O=LBYstMYpH{;IDc1p*QbGj;XSsfza^a(h5tRE-`1JN57Das9HJOd+x#v3$nq<)a%bGj}`nYU}ojANAkoqalXF_Fkf zQ$i-v``|B7Ib1dS7W~NYTpwRZb}FktbREJ)H|pNtLHLXqmUd(Bflgq7Y!2N@J$t~w z5LG1fq4vn$uDU6b!aU2rHFS{~qM7rhXeW!mN>sPS$-t0aW$-MKpJfouxxrBfAk4&s_LC;cs|3sx!qY1P1_3~Hx(_|K2b9y2D5y1PhjID=J*Zy@bG^fpFe!|WKv!>@#=c{mG{3LR0SB5g zn73BYH#yXsg|_IB^4^1uN+Uk{iY(y3&C$vs2>iSL_KcXPvUgWqByiL}7^#vdiGg(s z0o_8XQPi~B%|Xgdfa70-e^uK#GQs}O`@2me-PXZV9_W7>5_Z*VLAVm2Mwgyg)wI|c(^9aXAph%R|y4|WZa$g{9=@j%tzi-v^DsK z|Hw$;ACQ+voO^tu!rqErSQjrQnx$=BVFAddQEN4;G0scj<5CK*|a9;k(%R-zmmCs zxbH;bEDb`%=>@7SYA`UJIj1Ht?Xc)k?IPKB{SESuM7i82dp$#SO-2l${Yqr9Qt3)Z z>!ZU_W!Mpw{>YK-@sD zO<26N85%6!Xvj(9VA8yy9syWir*&a{Ylhic2YPxWT_Bd;A~jtAVC3kw= z?$F181Z z0L_P$5CYQ46JuZ+_%SR!-QMJRK<;ij8vTOD#5`s`{bMuCv|5NpKi7k}r^j+**l9be zAw*l!m6CrBuX1zl66+OW`K3<#(JIL03?qoB{n!375Iq>lZ)iIjnh`NKZjid+5-9t4 z-`$Q6eKZ;_k<~3zA(lRBR9pYyrJ8VY>c@xb=_d0ZnWL4Y24-)1UXlyHe~|6GE@Eh2 zfD@4sXsDG0&uvYZ{JYDSD6XYTLyirHhc@X3%-VIp^(5##jkO{)+#Kr7b}z6}Z&?la3&@l0BjDJmm;wScdG9-oo2%opJhsLj(WPJ_Jli9Ko~<=144Dj6I# zj0Z|5+foFSw*+Y)r3nJd8w_W$ojIXr30DW5fqq8N_WveJ-dmz)Q(0K4x7kh#32j;er!WMK&v71W@>2WAX1E` z1W#!JRaV;M{n5NTHIi?a&EHm=xqBH*!IE3%#03-aNfAzeU6T&nqatBczBU(MLK*_V z3WXvm(4oJD(wpy&rp0QzXyQXMS4g*?U6mdU){^#Y5n;8Z2~4p2m#_=Jm91B7=N_k# zy+9@9kGln&MOj&5P#se&$@^=*MoKq0*Fs{I8Uan55@(>N)Bzg{?rJsJe0t$HV=IhU?r~Ul)W*Vg`WwoGx{#5+=mgmRHZk96pW7mJ^=gl13 z9UNx<2x3|yoGznZ_jw%SFjVg%q!Q$ROKH!1Rb$DdW*hsE2lzlvn4RS~h4&-VJwgrE zSpw_?;cV8HoS#H|#M!vi=tN0WnINWzfoXx!je}Ay!5=>z zawj58v18;JGVAMc)Kac7SbjUMzft5&!QgP?5GfMREAQ{iidhn$aW)@t4G6=@BBZoj zp?umA2KD;(ZNRr(|5Afr{MKdC)&eazQtN#g+SC)-F=7v!&esO`H?r!Vh2dgTiSCW3 zh|k)8+DZb9STg;%Iq6&}23R=d2HOM9El)|#l{Ht6#l1(=NlMQce*$&!z?+YLox{Ht z?d@y(44Xww?lrbF%+Ae5;~`O*y!5pFm78i6Ai~A;$yfIf`!`V_3l}fn zjsf}w*{LR*rs3b!;NwlSptMA(&AEPFaZp0S`-FtxQ#}T`_Nqs;oNY{Icc1V<<30}m z|J_`Pg#rVaDaB8#Mzy+5PROhdXqO5@_uljnZnt++i@wXe0GkJtH;YQ%xkfsGwV@8uw45|~k}MyCxx+{nh} zF~!3ia^FX>1uoEJm<_he4f?aj*tl2Y>0-1OCCXOwAr7xgqo2nb9>PqLeN|kD`Gd`t zD13JLZsOOmX#ix(3b zwJM=s;z>Wb~NlRDb zpGRX=s7Ki|^S_A(IxJ-1>$d_8T7IfG^^4K`$>rGCI7!F(wBU>)zqy^+*3n<*n&6lq z{7Fi{+S$u~A{3|EA~gX|$gwJ7Y0pqYQ&Y2c4Biu=635&1AB@}O9MFDpO>P5o1~TZh z@rn^9Bxt?>Qe5=OG=k#b_*}Gr%Hi=m%Z*gfyXDFY@>L12l%WDiDm zL>dVG%wBk^vr!<%?sH%AC-N~UBZT>OkWY+axF;&{Jn@4b$T4@+@+K0_Q4OvxB}Lwq zaQ4|OEgY^ylavZ{bOJfptWKIvO8~)m=kz2XCk>QV>NU+lVTk3qH#3GY7jQK4J;0t= zH|NZ4yZk9lHP-Ez-#<+!D7awEUz}#N^)EUznmO`>UmRz3CMG2=CM9P5Y~Nf7Z1Kmt z`fS&M`w!c<*Y>yQkx~{4XuO#>9!s6Z=P%UIaH2d(Cxhg!nzhzwBa{uxT@@D-Lrb&@LJAcp#$*% zj%b>nf2ch1voPhF@(USof>fRBhUH>d07gO*c0x$e92iQU;W42Uf-e)NY#vu)8e2g+ zh%w2xw>IywkcSyx=M3pvf_Uezb!-py`vqwT@$n)|%?EjB%=wLseP$HNau7a(oEA0Tt`0_q2So9L;bp`p$|(Yx}+_hyh)n;XYmc+&d?9m?N^qrQ%hs6M6%r+d5d znVM4qLAZ|vP1bSUI}%fX@wVbJoM*ttz5csWQ^GznM)dUV0Jy{76%G2_gG^{{dT z@tb#ujW{*kfBvr5XvR=I9s~WpjT=xuOdZmFUij95-qYYiN7p^C2Q^jFQ*xJlnMcn|gFn=SrMV>4P>3P7tPL8f} z)@1O;`R0_L{Rbzf5EYVqerA$zzZg&Rn9ea^d?)Lf+v71F0}vP3I)+zmsg?7f2MPHj z3*(uk+RIg$Jqb$#QdLEGhmZBRJm~t+cMcy}kKBzMXGB7~yF0?~*d;aB3r66a>#{ju zYh6ANZLMar;coVIuY~x$x~y8h&r4TU0cFd-#cK+hT0g~O&UY^hm&c6gmClG9%4Guz zKC3oy11t)FO<6BKrun=RAir0Sc4E{4TNL2P3RE~mb<)LY*=Nh=d`%Vk1Mf+%%uG%d z_5j6ccH|=5!-xEpOI|U~Gf01f(dz`FbAQhpf>~(V&e9Bz2h-H5@BaO$N3~&GuPtRw zoBh*Xx(MJskEhJl#oci5+CeVqYw7KY^sOtJ6c(lJsJI)C1|Yyt>RBJ^@@ui6uW!D` zR06hc4$`A6ER2a42w8F;!O8pt9XA1u@rXwrMCn_2e8^H|P8?Ukt87Gzxn_I*dwPon z@sbP234UG0(jmxRC9Mf;lEH-KeFb!PGl@AvExY*VfK`L$ODM2P@$54JA4Ad-tzyE19=vV$u&*(cAk+_3f`Cq&;Id;Gq}slp^ic7Ibz^J-YKhw)2Y~iO_fD+Vs#bmEc}KKRsfER*0ZL zxvzYziTOwOT}%eJ^pYjD3+hw{OO=smYZe&mx#t~DlJSbB>V|niLfE4Jon|^S9Z9GKjec7(yL~t$t^3V8%IRf}cf4WF z_Zr=ko{_u>xBWwQ^4s##wq5Sz%#J-6Yh*q%41EmARB)j$N^ffun4z*LdU>fZZ>ZQ& zGUDq)-=O5}{B~eDhACeMFp(#mx* z&x}5tsOPvbhezrYA9N?}Q^CrzA_>btuiP?zQo07?-e-u@BL2Owc6BuYxq>tSwOBzx z=XRXZGVH5FyZs8!D{ptZIe!TX*5G7(-B5lUh|C=mLc8FB-LKDU#2ag_s12PVpIhg* ze>`1^`Ww#E(>eV`q%6?A`a^en1)zt+g_?Pdv896DBk<7XMR?S!Kb`Cz2z9Ko`ge8t zDcZ&)T4P=7>{5Qp#xI4uO#2h1Tw{#0{&`y$cln;5v41u;BRucgBv7U3UvhpyK_Q4O z8-jkDE<@EWo%+bni^o5Uv3H_pq&^_K)$8{1p=H&My4H+SK}2OQk6iIW*pb#C?$L|2 zc`Ch9)4Vh9G<2y4X+^EBi7;c)Z>m`6Gql;f_A?i zAiq)EY{m`XS-y(!$ETDek>?_n5?V9LUwY$ADZkN9Bt7Y)y^?KWja1nq?!|1Q)CXi) zXHIL2#}Yb)Z&F-8QofX}{@m6CDCk_$bFuK7rI>_R1-|Q&ex-2lkcHraf_E0ndo`7i zAoK62KXkT5W6~qq;!fUkeply%x&(B{JRC?gtBwD3<>XHGb_~Rd=JwPrfMr|EsS?Va zCU`xtJPPw8PT;k@@|aW{hiZPtdM74#qBv3Yyj$Jy8W6-I&yIewXFQX(d**F#oqrmq z!T0b#n`ELPEw)gYi1f;P%LI%y?kisOCQPp&NwvUE!D?9{kkF9h)%bPac8_UYMngOB z>tpk{9~O(jUxM`Q$ttHrgCI}X6@*`JOl)>UoAa0$*x8ift?a$X4@glUT6Tp%@;wo{ zq94m)j_{WJ_eho}IsxQ6%Kks3Uup?KLeqYJTblJdyoC~VsUoV5oI*eQwcd5Dxd$K~ zz%8x|-9pyN7lIscN|>9NU~SvO)6*)eqIA4r#dPqKL`r;}9MR15Vrx&By`sc7k_HzT z&cGOuUrG?KPx!nd;yR1)j^)Wm0D(zK^mJ5jXj2yaWcc$+wYzjXxAmQ7UOyh_*ZLJo z``vU;BzS;uU7YFXL!)^P1m;xNzbDrJ4NHiWmQ4u^xnZFsvuc@kMc|&z+f`9RWzeIbhvpa=*mKezgc(1qTv1b#gy-&L zi-lv-#y_SNwgLUw+?Rz^x=!Y!KL*CWWu=HyFrW`FqHxsg9uo$dQkH8KgEH^y5O(ux z-Vgrq9N8Y}pNV~d$0aFj9BEYor66Ry*}o~OJb}bT^qpUJEJxXl5j;!w2TCS3fghE+?q*+U*;l>DOh)lb(suvk7r!nxW$@5B@f7M*`T*@b2>zi098|&us>&Ad-iv zfXQ@!zmG^@SvEU@PE-iwU4!|~b1QOnhNFT*orIcvT}IwXi~uFk_#YV9y7?xHBP=04 z9tJ1XW~h8zm$g_Wwv>#?K1@OWS}{&DRZmv?#lT-(LRVm2$nO*v#CXeg&Fh}N}l zMv4S74mAe_$4@90fw;P$nJCoi=D#=C-B-HKFwx`wQRl&`KfFJtnbEje?M% zX%CI|0yr?r<*7SyVNaf1bvkp&1n@bVh=(C@ncx(>X#rjRXzbvmD{vdB1%&WZP<}@&z$Ug1a+}!`!|9$J4SHlvDp38!> zAYYi;rf!^+pIEgjckgWynhb3bk2R^BC z@yNr^7A6z}5Nbb7OV^#WF2y8g@wgW`$LrnZ#%1|!iGVkV`Fo&b&p8U+LE@XAQM5D1 z3wrAL0PzR`fi=)?#tZh>VPng_yh~l%M|8o+5A6jz9KXRYZq0~MjVWgj}t0^N-{tA!*}D zv`b)rpNM}y;u7Lf|-((iZ?0 zb96KpA8mnL_$21oY@<^YXfpBl5sRfr6v5!lTeneL+Gt2VTS~ALy1*JlS#yj`#Zq@# z?eEc#n1~tf;G5&gh@c$k?P zg)FOpuvbyTi(aT)t}B4#0SX9r&bMvU??ypDh|~e;EQEK9=1FXcOBc?&@BWtdrI?L3$Xxsm z{w==ngfiV{cBx$@3j@CT5%IG$mfCSk{-Dg34;&75;Wo6kBbA z`t$kLtj-=I0V4;a)Q>vb;{!Rw_=4Un2bG-#zY&2>Q3W}Pp+vm!z==i?cX)msU@$?) zj=~1a5z+L({#M@wF9l=z-3$t=EAN9iYytgI_1zF=#Q77?L8?O&+a=V#&91oVJ{te* ziB~!58&rEVl6@H0qgbh)?9FV0oDa72@$(t^?b54IB!4!MFn;ek>t5Jx$&8^8b6vpb zVCQjvL~|YPH$XI?!?qD7!YR{I3hh6!%uL0WF4q16IuRnJMj;*{Z^oZazqFW4tV*&z z4SG6z;>EwZU%T25?o%`Cc3<}|z!$P^#CZUQv=ezEs2iv{&GE3x#1gyo)STmPw`aB% zQ7soFe3arwTnhY*cmVq;IL(L}eLqoK;Er+vQX;zGLVqsBERj%aE0DNsyxlq5+f}rH z83+;s0(0Rp{6SSONp=%HIi_-fTmt-_QOLWp(9;$t1 zq7$tb>KkTco{38^(yBND@}Xb*J+w0GKJLSwYC*2xRmbWvo!op9(!49%mK(4VHXq$U zp5rLat-!##Ye%QO!|CnX_jLdP4Z^Sbbyq(POpMKqT_Ltxw@|nzYc^1Mq@&$tAs9Dg zUM8D*;N%k!F#j3!0fvqOYuiw?p{AxUk6!+)e08i0`|Ff=6L%UHgGDjYZ6J#QTn~dD z!W1sEs+wZq9G26L^RTanFfm^AY|ik4x6|&8W|KT`Ro#u!$d#5ry3Se}tN$LwNSx zx(E!ZDy!$9R*6f$Hd%O@Z)m61VG62oZ|hvN%!a0Ws7HhLfQU->o`VkaYqDa%;L=M> zf3NU3um*nKmkORV4yilZ8wN@7oorY#sr_aW`>}xjz{4|8h=B6J%RuiQ-*ogU5jh_Ps-kO zKacqE4$Aj(h?+7!AM#MZjwGFgPimVy9G>+2W&C~Y^Yx_7+8?=w<2y8W%>OpF7R0AC zZ)C+5F;)@^yVFX`C4V@)vAJ?APh&#}JB{B9Z*s|7;l0#9!J zK-^>eH|@5W0F~4>_s5yqo|q3Y{5#^K!J9XQrICgUIRj zr~Pr{LrziJIL#>z{tqvkeW{qQcRjM9DVgc+O`vi2(fqqvaZItFw>eD_J$q`pR(&{B z7_t6kDu!`}pr@rc5&ZfmoSuhj_$R9>+>#{Szq;@1U4yR+LOa)x-j~i|KSErRgO-JS zWBJ+hvHw&V)E+53vd>P9GtSa;=3XUKHE9~uKXCn~QYfJj|oOeVixh$X;ctLc+>uZ^c?|hCIPPJxoYzP;FC_XgraMq5p>!cG4ptg3G7&Bl0z1tas8DyIgIL$#ut)@&W0&f z=2&8ZwxHsQr)2TURP2GkgLbd$NZbA2@5d?fQc>7l^#bsRt_Vp`8eZa{sGj7E?Q45M z2N25%@3DF(qB|Byb$&+0a+}hKc|#lMfVb6}o)&afUp=q!M%d53&hcLtb%x`?1p)Wh z`p^Yeo4lY$snD3QX^|{w9HZI%iIi`%tdyM83)jDY)wjS&z*51{2qIm-7J(B6`J48x zIgZMa=T|D4Ko+#U^@e(j95c4;Z!25({{nLQLoW=LH6t|-mr8GBonN#u4Mwja?e@5J zNL>p~0_H+uoO*gR=Lr~!%$Tuno}*xv)F?78!i%I4s<)-&(iD@5`<*!ec34NMuH*<5C9w*3GHEgj}P4njx!O$a9UQq;bmwkJj6ET4uJw-MB)~WV5|! z4HZA<-PY1W#M^mQdgIUGV=O}b9++(V=AgG9OBo`g_vw!?leGW}9ks<1-ctQv`RJJY z55NDSpRqh&Ro{%B@Qv}7CzGW{N(g&4v{-8Y<^z+-s++_(_G-WV!^J4ja9BY6T7tyrTdD?@ z?|%#lezKw8J`M34Q8|Iz=j1moF$Ms4QSqK^qys(2^L|E%9Cvw6P_B2s+h%?60{{h`VBERyIm=aR5Xf`Ck z7r;Ykl|5X}<$N6;ikf-55-rVQ{mwDx)i*yhRLx@fCDubY=aHBq_W8W^9_DehY+j10 zT*~Yn9HN&JnXW&FG|=_Gkz{N8up2G9$wYBFVlUUIfJmuGh?B+%2}7UEW~*^ z`wDHpoNfNg8W*9>n=?822@1XNR*BE^m3tP7mem%MA}n zjiPZL!$UYX0_dTpEr+@O#m3>MG=G^FV49!;XFQOHR7V@ z3$PB$5 zJRa!Ryyi>JzB+Gq&ab*!I1-C_p!0In!qL(3jMU?%)}l5_y=-c$)Fx9eNIii14(d_V z52Rj^dJOd->UpW}n|jsMQ>LDkdRXcSsh3PWXKJ0PCry1<>U*X(Y}l~I)csP+q?Rw2 zN%I0fvhfbD3@RF9xv2rZqj!=@?*+S8?C}h)lx~dqUSMyK$qPS+SPdEam14Xy$Axqt z=6q_EZ#u9{hC49XhM@&(Zop9M5BwcR%gQ_)Qs_L*ht(c*Us>+HxB%Mo9-YI8donFg=vGWnO*Jz0vi{CG46>B=#Ts=+Za;Qsn%nHg0)hEF@hMQ*QUA ziC-5(*7X}QK;*oM%jU5Ww@M-6On_krn!jS!mAL!x>k;{sW>aS+icqoY}1)2}@>YUHRJYT}qvK)R1azhksu#daHJ4NQ^IVRU*Z z5(eLV?d;`Spoh1SuX=mvUsx;%qN&GDe;X?*sqO#sZ@bNJX0#I2CH`P0jD)r9J9hGv zX}%CxISctx?#7g=*VN|{xBNNP>!KYVTIT$hL0sjWz5BZ6!j^AQuL$zcUM*W{)V*!M zq6az;Ea=y6U46P)h>(f%lUFpxa%TfAAKUd>D? zN#a*8qP}pnTx9#D%=y9L0XPq(|6&8yZ8WS~_Fo^yW#zc?;ECfr`7u>s@o zFofN>;pEGy*EF#kf%g#GuNfy`)UK~WY0II&lrKWi!+YI;g%5PvS1oL#@KSqIyQJ2} z`q``DVk}p_4c(HxSDJ)F5~ET{KS^M(5ihWzjCf&snDjg#>OIY=gn*@K-*D?N&vG|% z`ihIN-LY4%#9kUV`bV_)lB+LJHy~g#IqZRYN#~XC>CKnWf0c#W3uu(g5Bqfc<;I6D zZCU4rqd;$Tb^R(nk87f3-)~Qz8guKf3AN2nh4t%V$T&|0o5tbS^qlIK5)a+k@{BMy z0%}w(;yiTfb)oaW))#dRN{SxnJioACd{a}q;)>4-DjH+Cu>roL-MaCzNnh!tkJ(@n zSYEjSOS=}#eCW~4kzh_7d59{oga8yRVwOgwMVlb>j~DRo@0IdZ4p;VgKgdzp5!- zrmcOvHP%mHTf>hI2E zcKapMLk+B~xx^GUUuW++Jj4xHUDy3l2;u?*tR8Ht7Y2xNHgL2&*Jv@8iCyB+5Sx5j z(os@gk}1q^bC7%}gTgei$hk zd))mej!euu`?ALQ8}9Cly_Y-uqIk{QeFbOBU!na94-e1Uv`RVsxJgX^`vy3@VmU-##yuF!94Wc};{CD%7~2O)51?oEy6Onm0TYX0NjzGB5?q zLmO8aOb_oUU!8xc>z_SxpmW~>ALy)WS~&Quy)MR2VbL!9seAtoZAa)=GDTXiXciIj z2n9>yfH}?JFBs@OM0|n1p%-7l;>+TCz2NjK!!4NfUY-b8tUdJG`$w2oSsl{6FANW> zS)CtR=b_j)Xge$^bfZ`VbpzyHP!FkI^c_|zg53ztzI1%}vp7H0tu1Sgot#qa;Vsq; zJ^Y%U4BssavDZNlXB=>zVU@LUwQk(P-MHC#=c;Q^QWW&`$^w7&Lrv|%-e<+L@%@Jt ziLq>drUAaAJrb7U^a~rWbV`_qpv%KtnAF>486u`RO(dun;6rgA`hkN(r-vD7!Nfx^ zlS3~<2V&+Aakg;0C&rDD5r~(0mlfYeRvq&QtL)*~vdjC*b9gA!jk1go2N+jr)0S!6 z(B&68Fggz*U)}Gv#Jm#sA3MUcFOCmygriS3C8M#$j;QNWSP3=;ER*WH1i+Lsgf7Kg6Z}@3g=)JTuqR@yXeO-b1 zX>GcoRXKoq(>Z*`{0?eXhA#O?JC?Bq4i7?RYEOJIh=<{wA5r2)HR!#v{aLGC=8a)r zv~KhYa-&>A>!o>LgUalcxD;J|Rfe5;BN!ik7;mE#p3PfY_MbQsK}LysO$Lc6b9%Wf z(?cQlUc2sgU!lOST5UXRJ^T-Q=kgoXeZ}!9ufb^>Lei#znyMipMM_ZBG>}wzK!}=@ zmWEfGWI+~9rKqSyDpI3XC=7G2?)7MF{20%IyPMtEKXzekc@s002Hu#Zf6o}_}4ojtWsnq#nE-M)%Za?+;SKpvUQNI>~yh^lR z_rtrd2z7(j!x(mB?xxNTmsc;pcJ%Yh-L$QT$F`fJkNudRyz|?)Z`}%vE`Yj1*4?v5 zFuS_}+!gZfu3ftX#Jf+3yg>5;(krxH!S=o={9fVs0_aP&FFC(L`~~}$7+@lSi3bKL zSdhU#1w2?N!mkLm5com?8NMJyLqQw9DvZMe2M!4GP|$}zf9tK&r%xX`bm*6U2^$fR z#F#LD=YI)vdTofY7|Ul8@W0^*AcqQyatmtN0CA&Wskt6P#?6>TY?K!}SSCHnHK)pa zD?>za9twa%)JuNVQcL0ZtrB~oU08or#^{`%LgJTZE!UOUE4(P-M$x$;-i>j+`)XqO zHC}BtmAesKeFd{azkZX;%FOJ~p8NNIjC{%M*BxDc#p0H4i*;V|z81soi_^nv1{@Vz zecfDk^~L(KuU~8I%y?jJmv6s#5{_+t#h;A+qx{PLwO;=av^ldO1{J%K-}&;o|M%nv z&%mpp`UU8rFI5HG|_G5g0enepMpK!ztV>0~;kZL+{4)jO@O^jp6{2ktt1dU{o-sRmRn;-A=W8 z<1u~7pZ{cl^PC@IdU#{u#zK@he>+V4x*JBO2sKKOy>mOCBH6|nj$!bLB`K{;%eoJyOSm9BUU}-^@FmRQ4VaV4B+I=Y@!*T@`HE@2(0z&Pu&(VF)0WwPO;0zbMZ!$p z^0-nr(0<9}uvu+2x%z79)fW}4-7bBY%PRh3`iakV{l(qa!-qE>n(j-@hxc!D`Gx7> z;`JbInX|)N0W*sF^OoQ)fe4|zHn7rbZ(S*wcIXseEs?) zm(@3>K%4&Zl{s8qc)0NJMqu4g>f!C+ZuxGI_jL=SL*Z`B-GXytZdvHzx;hYZ`(xi- z_OInb|G1at{G`{eXEPfjYfs{0EZ;BK2(skmGU4(Z8j6|2E`q)xAHlC-4!t zp=wu?aVhA%TEW>DMu$V~cE@kOQg5Drd=s|y?1ejbzBbg2h<5{L%MtU&-9^j}argyl zlyM#!@BD)YE7q@n^mn`ygCM@yv)SZxsr$D5gUp7=N?MF%{tY+~MUF(pY-K}p484u$%hqSH)iQO zoSKsTR~_sqS`TIO)xhR!MoyN6c4)?j=)bB}U&X2|=6!{GFLiEo+UZG7>3)oO>fG1C z)$)RFzV6*e;@6|7asIkGH?D`yjmY6wH~rV;{$ftQ-?Q<~p6CPrEOk$wEkDX^h^WNH zSmxicfT0(;D&ji1AgaYAFd8>R$J}C(+$hjDEN;OZlb7PUM#6CU4WGXlHeXzQN!+ps*y3UYdZ>vhp>sY=OzB3w`piJg?e5ul zXG`>fUrFB+C$k}{T%1l`jHTs@fxf`D%XNvL=PFDr8y1I#xCR4r-gZ6L0&T+zVwW*T z#I}oDi}{lX}*{7$M?VENA`4X!ufM(OYn+$eD!4pYJ!07uRE0w!0>B3;wW z`x0pHXj8EpVmoBqax0i0hW%H&{fBg8CYSls$mfrpk2&WtJ(R$dXk4YiZm|0bpojC_ zI5*bCLEppiPBi`Lr8GWwG8-Z)c`=rUWmssb3(;j77*SE0!t9!e6oZ@>E%THXW!#2t z$n3@WvKkI4UZ!eNsak=(F$wM=I8d6gs5deOEq4dDE! zfkp+1DZX-r&iMe^>#JA0o!u_~e*w$oPMiy%y|?d0Z1b`13)GEkO6)bx`S}$a=R*g5 zf43yP8}EEKVaDnHKXo!2qEzx?EZ-ISybKPp2rCu^wE;;h(u;_e%hIW##TLx+6np4! zi0IOF$d4UIZHHpms5$h{H3R^Ea=Z9fEtXD>Y%~u`FLvT05xzV8M zki)}>c!_yKe1|PX_R=`-zqaM2-Dw}oL~7YOb-_@h?wP=4uD%u*!?Q25`MNb9;cj#* zUzZ>Jq`%)}5A|xi6QwI2O6Suivmr{wNMcEdvD|xavjBNn1Q14&O00+mi>>*Xu-<0)U3chgKWv!GGbHEd@=P)#)lPb zzJT1&xMd6wr(rytR%Gw!gkCL+bWQN?t2Jb>Q6)1yY?nG6anEPys1^NOkvn@a8u+!S zzIl!h*?e7#Qa9#ruEM(^b@Pk$9Pg|l1Tnf<8%V3gHM1e+mSmYGA;xm>OaT@S$zFEZ zddcz&!OH|3xrI}mbv#dXjv?X1vyowWuBNr zG-c*$8M4J=WpTv^X(_V*f^3n%!Nr$ndM}YJ`Z#8x}*jA%ef$p#6#z z12kRE@&flE1gxw!j&cglmO?34(L3A^9Wp)u;pqiAkGK+)#l}Lr_=rDCL@XN>5QyM!eLt z;Tkz(+oh{7n=X1!HeVuMwQ?CfSZ(8zeD{7d8N_`Fbz_XvL-8F7ah|tdBZ56_Gzi@o z;pR)Z8`64>PGJ89^C5ln)d+EZ$WRYu`PJ!MX$lOcV1hohy7s>!!f^Im3kZE(>oIuW0`yXOwmGyii`^ZH{_|Z6?ipZ zoks)a*e2u4HlfQJwQM8xOTqI}HMP$>931K-QChHad83;Uw;vyi1b$VBJoM!Y$oYC5 z)Ly^)sslPNnJFVP(+I4b8Rg|y*nLf4dRSHCVavoVmxhArVW}<|1j!msi_=o$vD(6(8@sx>gUnzh`LRZ(XI{hWJv_Vl4AVM6)EN5|}6? zr?`|cHeN-Lqg+k=a*2*|?GQXKziOBus$>P+D4ihIYJ6KR*W}eHAAWs9|8)Q9)quJo zb3@TEP5ctqyx)L{cY}$`br=tEyF9J(#rYw!QbGYk|E1KZ(0SP14n$kb7`&a&vqn?d$*pIb{pc0my(vIGkDZ36bcrEi=-%_ zAriPD$(2}(S!RS7c3?=TwCOcue5Dr*4?StP%Eq{%y_eoFi-c`x7ya*ew>&vHE5k!# zHvrub>B8}sxDR#vh2f#!dCd@bI36J9Nu8gl$}bq_o7JjeMw#xb4e=^cihWWRbRb?cQ{#@ z4Fgl8{X$%dUVhPeSV!X5Xv3E;?7xDvN(O#S80O(n0F7!H?tEKEhaI{8%5J~9uP-!h z8NPYE2FAlDbsic6V&8|lFT@~-Yt$F)PB(ylX{FnS7>}_`f}3aWVL0U(lET>`uD?J) zgrd1ch!oxPg!H;thk-bcPdbj#E_uJEhhH^E`MqM@kkO(1E}z)A0`@VZmJwDtYf7$` z6&xi^*a+^v0F08uFaNbc--hN@f*Cc=;o$@lzp9~mBQVbU+Er2k%g`IEsOSI7-nGTH zd6waH5^{k`fHVyR1q2#`4FsD&l#X@`G?jHsEt@u=9YY8-Kon7=aS%f+jSq>O*lCko z)OVH@Id;-SiBl=LU{~p+CxrTz)Zi<31y!R_?C=!FCP^vNN?Hu{r)05xyzpQ?v zI{Yu-5BB&}`(I9L%Md^Bf7mA)!Oni_JfnFfcs{~Sm~6bdM0ptTdA~GxKJ1hm5`P#B zdfP8XMhWu@GdN0&UxY9sSPFMjO$lIU`;~nS^owi*iBYon;`ET(4WVCsLcc~OcY~oD z>RT4!h9};boxHQsTu`G|O!IYAT@i>P!X5=P!ef(0rvJEUDR zT(pPkTpq&ka9W&SHgw*f*{i#+`B$qSJb&`S6SY6}UfKn&+sOF`?|J0Qr<_0J^ssZ~ z`q2+XYteDxFD`tgjb0rsEkmrVv3#Ww-Z=-Jhf1ENWsz^Fb^{^4vh?CK(K9Y5;0l~p2+3uDiy!xsNd*`&CSK$s=-6~<;=g#nVH$&pPik(dw14c zrkfTEtmiUQMTe zSMTTRvL`%r^vjpJaaj23?EKBqKc=tx-yK(}*;`^GeNZs(@3&9)nbFuj=HTYW$ zyg6ge{>&`SzCka6uQK6l3jkIIeib*1#lmJ$0SxGcW5A2}wI=YDU&sT%h+zU=i>s@v z%jwnM*Zmp$lSIxt-?HGBEWdVE4h>&NUBQg=WDPm0Wm4F#HihTC6o3}G#WDC6@rMP znS5YBadC&(ehm!tBe6Hf#;*bTzD8Wz7YkE>Ut`GZ)#)J+Omv4g8F@G~`tr5bMemMfB z@U;x`MFdO#weC;ZFWC3>9)yQ3aen3gp>^}_{J9Q~>Cx(UT=+TNKU=LcLui?Z%5>MYC5VVnv6doTu85Mav0UcqNpEg>7ChzoRQJ86wK+i}1zO zm)=XI&Nq*8?ni^S1->{!%o+Fsa7pS0V-M;58bRXWm|)mgwvWCqiVvmpD=xD`*uHKJ zLAEh1%dd**;am@0%OGE|?fEM;*&DwO{xw7Bnzh5jk|AKFE#TJ{z-xn}!=eGO@lB6@ z?X681=(6-{H@~oJE?{3eJ2cp}jOn4luXMd%3Im@t@Fjg;8aQu#UpqTh!LPs7;X!?* z`W+Wv_W#6Bx1mcY;%M5ID5-$lwL24-THm2JSh z9F{bWq!&Gp%CDqXT}ix3QHDtQJaCIA6iTI1*P0@Y{?vf-^*b)w0rVgAUZFK*h>cfc2@~@T+P%6oElTHx(qEa-IQ%S10^_mY0qD7g2+KF+L) z55c}lWn6$>;9rG8v4GK`Z+1xdGS~$IHav`LK5xiZUgU?13Sg_tU|$5V_4*4quB&hP z-3M5Hsd9d&TJY7mQV&j9{f>*T)TEZB8BS};5F4+?(lChURdN`l1d+JqwN@%_NyV}N zn5Z?R;|oMAnXqk@30GDrj4P>;8!5a0N|Ay=foQ%Ag`PX^lBO3fX=3kS&U~WZE0@#Z zVMb<$eIu%zH^dA43!xj?th0T&*hAnK>r$qNy6IeY!VPz@`eJMp=+|pC`hWQXWQU$= z{%*N+cZ=i0ErG8MP7eze=mq#%Tl19jyTib)-33p1h}G9}nrD4Iz5e&Q>ra2~B70?Y zNC4Z}sSiJRC*c z@|a5JMRy43V(j76&6`t0&>jkeLAYTXQ@W*Und`4ukC3nJE44y^i&lF`-3F8!AYY|& zd81qq`c;JPuxL$RbbU?i?d?qr6TQ|rIo$Q57iEXbBHl=^t^>keuJ=>-F|{q<_Zye1 zhF*2TuP;@oNM8p%#BZEVv8w@?P zU?ow9tWM$Jkemyud3ArK3~mXACCR^_pr@Q8bte=$e~eWefj0z z$FItci$|;Qa@ByZR*iF7QHI!XHI^O7q3>b=7|mZ2f0*z*UrM_SKt)7GpODIBvMo*C zNNQ|Ul)kSd(>9WHeo2y4lx&MQma^Ng6j|7{XO8O(@ry4R__}S$m%x{ejl%3u=7)XM z9!lo?7!>qzWnUy;Vpx{l*OcL3Q?mH-8<({)g`JgvFY>Sd)UfvJO)qt$q@f!SZ#eA+ z=+~yhFY_Up8*YA>H&;>4FM0fnyRUU*Z>*a$Ir-aqKkJvd{kmUKS6M~)stg+uB`1RO_tJ`=I@c+C| zwgKzlX+0TYCB^?*gZx(KYzBSMHCTov_b{xn8>C(Ie^H7UcB1*9?7xyy{iV1iksG{4 z;s!s+yKo6P2$Q?VafTRp!*DNbzQngo-9~O8m+2MdytJjL_>iiNzELnRI+i&# z7&8y2nK|$AuO93DVrNRve9s((^V{38t2KORS5-G(vZ+z!4FXs}rH3wcLqj(>JlylR z7iEV&=^=JsM6h&vb$#99*RSgQ1U~j|En+w7jb8^kE)E}p=+~Qlr;S$+znr(44Dm}9 z3d9p1YK-6N^be>x?6Tk$)R=iGsSL|9EMcXGf?bw_N#$~wRh3bZ%_o!5q-$I@5GLup zA#B1z7Q#{rVRu4zu04C)W{9U>bhAUSE|M>)Ovy2ELt>*KKGd>haeig9qw)AyJT7&W zO2BX(^0r^yLt^^U%9L)an@8@U_?BbaKdt58*UN%m(9SdQu)Lv>hlYCzetE{Py*(Je zWc9UXxEDVb@_B^zF1XpDNawBka1v+r9~bNU3|@BH!xaM9PG?i#S4GD~6%-fW_WiW) zw&Ci1PHV{!pZs{`Lv0kOeg@c;uq7&X4+fn^f@LXG&xdJV=I}5n?8~(+N5d+W=K>6Y zyr=exQf~EsU0~8to#jrLEYYnzU7#HbC2| zBK0Dw?HC!`{3OSK%^wvMHOkY0t8aY3PKjjt#dOej-zn7?|t6)JLfoN zQkY|(gX7OXM7fB3lHe!L`#wJl13I-=c3(`tI5kRqU$-FM5a$=uFPyI&wlM#ouG2%u z@XPa({oUmkHSc0_odJ*DTQCjgimk5klxGal>~0_HcWxo@rOvpvGs#k7axUP zSbec*gZh?-M7#mU(`BOzGj`y&0xocTkuzKY#nKEpZ;wd4*o4YZ<=f$?GKy53gO*p}n_w{RQr2 z;#b~L1&7D;#6RuQjgHlZFQ@QpSqNgy@1u6P*}4{3-S?~=8RGZXExXQ_T=UX){FVh9 zq&$T5kR|kf-hg>^Y_Ix+84u;<#0>^6{uEYTeiqMj+#ws6MZclQm@nw7JXw;_XS2S8 zJ06lB;_mh?&fFjZ)-{CGL+bp3^srARhrlk8&Sxm`P(7zY(9NefHHxSgVxtBbzXoAk zmb$MqIx~uG%cxtPklc;%hjljp{t?2%MTE}ZA=NyM56QE9+rIr`^@eB*vs@QoH(0fS%@>sO;T-WVnjhv0;qcs{I$z?^D_DIk&Mad2h0&pcu6Z^t_uKGm!B+Q0 zsT(jZU$+;g&;qQ7r1PA+A@G$~r~I*#|HD0ht&{J|Y5r9i8DDck!jIgz>~P#2Tn zSHaizHut=`jr+V(oWhz7DCWIv`4aZUiVd%*H@p(M!Im$Q9{Pip^9z{8K<4AgAxz7` zWX1Xm@C67njI8mx>xGD(BkeJUFLo|-ZKdv72L0+oUN0@bLXdCthLAWP$&mIimEz%{ zjy)ViVDBLA!vV?N2-s(bwECjL6l6vf)KfjJUwpQ4486`1NcBe%0tX_EZ?k)5<}V00Oz=Wzlqul|B5I!LmoPBhodV!W zatKE@oL+}Q{S8pE&M}@d- z8F9VoNJimTMp3Zy=Xv>MwN;XFSu&$ox-o147_=K_5O@gqnk&@P`X%SB#VhEmB;EWy z4PWS5wuuiZF>1k5ZcysRrOA@EEl;8@1?oc*ZuIo@*k*^9XJ_-}+4Ah)9Q^Ceb6T^n zdJGSp$?ui3eKivjUbKI)EiIt>-|z0tE<=2>8lX43>lN9FBgcWzlk%y3P2y7`vmNa7z8Mu;KGLPISI}0W+tDy!MKF5sY*ju~-bNuNXF8 zig<~3qi={K581jb;zN`zll6;`D;?2Q%aF}S#P-!K>W$%Hz562hye+eL0*xuT0s~k$ ze5C#t`q3g6rf}caT^=AZbeXXmq?#YlyRT{5eR1E{qzLD)6MTvAu*Y0}VRlH%uY9?@ zH0z)Q@i$gwNxD;M_7W+GJ}xQr>|ORU zfXM{WFLDj&5B)kW3IG-t=T|~p%R!za66fO7d4N?=0L&U6X0Zdq{ws?q;z)GgZg(mX zH~zYPd^{$DL&@DB<%S|)3}V=R^(o#3FpP3H_X(HepFUUStZX7iG9)Xt2C)YqZq$n zTGqxdQEtfeaA~Rh*{>Y?X`Wo|!mnlLAI|-vwtb`GU8c4#)(W6s@o8omqUZ6dYuoO= z{oamW#w9UIoXc@uf+>h%EF+}S$@4Nczr`ve>Wo90ly2IPD`eNxJ;OmmaM%lF+m>sGc z>kcV#-ab84@Ks(?^sBtI^k>H;9H;7$d1yPQ9Q<9a3_+}|HTfs40Qwc5=9MAdXTA57 z8|5jlbV_h9EMHz`U}#-t`sGcSO)2VA$U5YJUe<0%Rxfd{Bv4H9dVQ>&uiSoR<=HTp zh0#Y)aTw9;UYBX4a+y&%|=}ATZ@Q1yeF>ZnR)Vl_1n%szs`)((!)|| zO2&uGymdR_#jOs7HpD7tTyo7>zIqXm~Fn|^XAaZGnPcObW`;d-L%jT0d z|CeFu4{7-Y^olC{GNRD~ZbGn~hZSm#cM<V?#(cSbHe!YZ-h6#I-!Z$c0;>SSbFzF&F$1Qs+4~>h8?#`T6;NTWD1O zz_i(zBIJw28uOn3 zcpUn=X#yEy+w)Zy^}I`I<<@;(v#FB%Q_z*7`%eFoJ?H`@$HpV?#KvP+ zF+8-EUtRXhC`2Bfr3d#dbK4inzDRnQN)h)0aMAq&OXt;tR$s)x7`-gxvWyQ|c9`ST zLxo?3LipWAr9>X0*&!nsOv|>&UPZqarU#~3y&;)Vh@3B>tWq87OM&l8VVE8snyW8G zzZCys_BA#-Ha7MLCw|7q>bm=)^Ms@0?mhN5o0n_)4u8{yZ5b{;%_l=#|Gny^o{O{o zUZvS#r@F-vw;@F-EZN{SSUeGA4i-~|ZXqNaFJ~E;sBl{dy({KHKyP{s>>L$AR7#CHN@({7}SbtGr%0&fWy=Oxv z1ET?AI-QPW(xg1hWH335Si7%5mTpkwM!<9}qwOoe^oyh$Ig@=6|C%cvYS3kGXge`; z=Po3p7jUkbhy{Tdq^RgW*nzI338 zdBdmmO5HHevyT4WR(f@6!qS&rnRe&m(_}Kl_1mj1=i6?Ms`VU11P6yjp{)`FMD{Lo za&N+njgr(}B4G-=WD6GLoDCizBEVM=tU|qkfgx$<4Fa(&&kiBqP}mjaCxu|g-*7IO z{^<|eV^`HJCbln34}o46A)V*eFBu+k>|uy1Q)u_qOPjAWp%>+K$< z(0Mq&Ds_hv*_&hWJP9}E=8ALgHSW@niu8~}qip1BpnrN`VZf%`!17D#zRc7OQXYzW zgLhwFY2R{wiL@JKVqc(N3cwnlgLv#_owr{d9nNm;AFUt(HI4o3n!0bb&}jvysbq+c zzEE{7E?1#G{Teq`BKc5I3pLBS?Mr&UpqbaDl?mox$m~r>-XTznr5iLs6!}KBQaW#d zhY@Z;cnI>P(TmT>-rY`+u&qZ9{|mHBu`hxxn{1vm8?b#1VSI?uA#7j0bmP7+%Ir;t zA|WZOw3c72JG{_M+C#KeqVvl<3|$Jm&QRYnFpTbnVsY;M27Vj1%}8D4-5KcSE!#3; zHwLD)ZXU}o#lA|W?aT5lYw~qj$k*k3-qdc;?u*b%Jw9u26|?7=zffjWJ<+S$S__<3L|K|ghPb&Ji=TA+Yu<&l4KLFz)K<#;kYam9JZ}r_#r8{< zUqL2eifi!}Oh7BB_g=|L=^;p%&j5fi^~y$teG!C>&|~C_5##uQosFfeo?UOZUscpg zVb?g@zG7V(yM`c|hx<#mUuNtE>b_VsPmN!pOgf`o%RD-~Aigg|_DX70z<%`VYvK%# z4_UcEr}%CorFt7rNaUd{vv+`FHzYRd5&&$fr0!EB-MA*w4GxXE!PM)Pwfed|n=j|t zx2(w5(wNXMb^hI80P}nT?p4p}VaF#<53wrVavrbYD^(Oaw>{E2E16F>iwyCZJypxR zhhP-CAJK;dTF8ouOZJ8z_{ASd^ahU({V;s#jxUxVa!*Ro(rhHDDMkCfI55h@F7*`k z5&KfOH3H5>vqSaqNc4;UvUhbcZJuY8L}?u@S(`~yF48C)Y?0Dxtu_^!hNf$)sF}79 z){APRX%O9}PR){Tl{RU;sDzXtiunmY0UH||W1)s%5*3gw5u`5;NG3`M4GDC)@CCO9 zq)CHFmf&XZbDrn@{26W%7u$RdukjDLKo-G1KIb{lIT1P?k@6hsh{cuU*@%*GNLNXW zf^TDpP4fg`n0pcVf^9?EmZh!|!BL8Og|1xD=ED}^UQG;P1YK<0pvl*z6n51z_af)U z_&B$H#p#lW#}lV=`Zw?~(JyNIO38=U(gNpYZQ1m0=)x4~Od;+?>`Pk@DK$zVSdzs< zMZW~R2)|Zx3Sc`=WB8R-`jub%Je}9AZ#uia1MZ|TxxEEj=dsTB!-lx;wRMxcLpFHY zlp{ssF9?O_#k9dXBKK3mF%Q+y$$gbIff`+!f&_Z))nNC0y75pNml1l{&U;_j`oi)T zONZ)~VXH&2FHkVTv17k3&OQrslvI|5V^Oy|M$`-Bt4)G8++sb1ayTTB^N8Q6}`vb(p;=Uo0B#_55pnQK>R0rZ6hTjz0) z-ED{m_pE*P&)VnXODWfXvGGvXq;!ge$X#EEJq+k^7vWb>{lf*>_re0RRXfzS4FDLE zFLmER+slkwoV~%*FVlSp>~cjs%)&f|VqtZLQT|Tph8j8?B_~dn$HLJlz{~B9jnaYl zkOSvQIW!F%#J=>YhknS;!}`l;`y%JOg02v)EmQP{!Y$miC=44!T}sO^CvPCIcQ}>1 zG0xMkTiSQ1co&&B5(>eN=ln0=H~%v?mml)%%bM6b-Mgd!jKFKktXr1E-n*vt@GHtZ zyw8~%bC1ZmF-McH#WgPQOJ#Q27-JI>gdA@PPQEe zgVwm-Ac0m8!!N=zo_P(3^DvEl5&2^MkdKQ*L_-0X$K~-Dp1QiKWA7f>2u-c%cxBmp z-f%P)W%!DPN7Y4vn06jQIvh%Q=MlO=eU*J2IN!?ji$gbveTAqng{T+RRW|9RYXCv z{3I5?#J9n|Lv*H?f%Al4KrjNYN68Vb9bOmla7Ey2ap6q%U)%fso#oh#O_1KJPujcZ zvl)jVzOZ3YR8QTpu?^Aj!n*n0E?fCe9LKnPnWe){fiJXt(FSuTIGA>9SehyUU^M*F zQN2#R^fe%!d762Fd%?KD4i27sN$LhuFhVdBydsK$X(r}U0OqOl)O9NmD}U$RBPE$m z#CDhbq4H$8SDmQW8;dFQiiV*dl50K;?ltPxt6#kQ1>eTd#l9hhU-hkKWeV1o8)WiD zg_R9g`t{N>mo3ZM@*vlJnQdQ}((~qTna+)Ioq3pO>`5d}=0lD;#nwX|dw6wu+05LK z*bNN7CfU3p@O9U8Zisj|%X`boIS~(O_BFzLUp)I#;6?DYu)4VLr!2cT90xzo_S*7h zNRN{9{KjnU9M~u${?mADYeW3`wsr7jGw)8(n`}K~8)AT$m@)MVunm!ymTR2i-T-*< z4Jen>-1dTXK0UfuBbn*gz}8np-1E3I@r#I;%Vj9$Wzd~L;H98Tu`olS7@ewP6(NQXv=dPv5N zdXz2qlWn8_N=V^XsHsWRLq@Q{W+_Y=Y{A;HsT}edm-!a~SmU@PMkV6$_{ls;>TKGpIz4H1qQtnSKP?yD>84(|PP_Lo8f}yRSZHx8Hs7Te7z- zIZ<-&WCMq3l@FNuA%AD4ZO{W}W-0>5-D+{YAUeU#^bbMf;0Oj+9nb94#xa^3(B- zDfse(eMMtlqFx|iaLr3sN*ntRvGsKkRVhfEm-$y;y?EzQ_|;IapbHib+WHDfoeXYWCLM{MHY{#{t>kcYFXL-D|4+>w^QvkJ^))}H)xY4vP&1vW ze`iDc6meZ%%QH{!1+o^pGTJzD`nMfJP-V2QwS64zAado5IN11mJp63t_wwm#d5hE4 z>H@J#RTeLvn)}XXZ}T^XqdRMZ;8%wF)x>iig7eeN&>L5bCDzS*RAj}#dW%T+V{0Y3 ztEN$=bT2XJzZeQ12=%@DJ3$z~HmK!QjH$>gsN^r)MHy#DUp4M*Ef2&6U+0isVqoW-HCN%JfaPe+xu&6< z5O(=(zDs0EZC&lDm6<}bP>AvBt1qXG!nBqs&4&6<7AWOL%Pfl!b5ZY3PPR4f2RmI5 z8Ao7k(kv{=uVUyhv$$+VO!!^Ovn`dtJ5gxORH>8`U$D7Cd^_^z z0sm=AhGKfv#RdNLYTMv~L;ZgCOk^s#3X}7+rr1sIRTgjA;by~05Ed&GP5nx1ug)wH zkam-|o>Yy-v9X1qE;n_*v%0w`wT*TDJyKb}cz@zPb_$*ou-Y>qWzNH-IN6-_Yor|NIzGL*NsVYvdT&0 zC1c#!zbNvhQdRWi>7#YA>(!4!|InW4ke*-ux6N}$l{LYky|3SMz?=(ERm++pDb)F)H0G5PmT@cY?z7Bjp^VmVBY|`iuz9W0pG^+~!O*AnidomgX)xrvfh`%PI?}*HREB>2&`4Kb(-e zUi{Bj8E@)ux{`*654*ZR;iQMOvC{&1)a3-9_C56h!Zm=6jSZsn6iI*!%PJ^O?FPDE zfiFqE)|hVE8;ZOY7?Ge@UrYO+Hfr4(;&EzE`Wk?&(+niPdlf$j@&Tvz8-!EXs|`hX zxZ_N1H~qL@@GqA;240gl( zpGcJ0pIlo1TA#oh^y{k&$%}Sdk+uAu@S6h=$p^cO(A~brEGRShojPs;b}+<%rX+dr z+N#RTa5NC^UzVAn%^6bC1zl2=@AUJ*B4LwZOiB(H|I&rTJ5*zSf1ze@f~WRAyR73$ zB*^y;0rbpOBz)rGIJZtA9RuIxQX;{teIU{g6YTI7Z!W_!$BkUBvAMfQ_`o=0_IAz! z-Rh?*3+FPVx(*7h)3PKE}%8k_Q*B&8-W=qM{l4HRDP=I4znK<5wvH zy4uPO6G)b5->U+t=JUerfu_uNH19=U@bcb2mtqKSx*2S1p0RW$m(g>0(sd^46-zFd zfJSd9z7!63p6Vf^U|ULZaU4+q#z%o+>vGV5LE>UTdVB#RP$Zzn^v0gbv*$}6UB?~St*mRlo9g@zh zglN-fG!QKAl0L7VA*8;y&FGn0V^{P%-@1WOYiPWk!x+=zzGhE2{Vx`aPPpFq%h$Qp|m4^7|RPtjK<>IVIxR(X4>jh$*NX zCS3UBau(T|1vR*D!2CRdUO=|MV+|vo83CNw-l%iKrxFVbXNrwr{+vEEGVtMq?w1v?C2 zxRq33E#T`DGC`#@y{?P*DMeAG2K&F9MuQgw_Twr$z8S?~zZKuDT6Y&=f&E|ktWP4>ie4zmz3mGHxX-!5CWGk4C%ckc6_ z$CNwBM6NFU*s*}6yOZNaY4feVdpvxmoGf4WD75-wp&YxjK-#Q^2VT>KXu0%uL?RnB zCU_wuBD^&a?4$=WS;jezoGJ3vPgHgs@7{!ka-gZgI5LREC#vW%XC z!|o~f)9&Ys*HEP6iA1OAXp3a7Zp)pDAL~&2 z%78x$k&@;a79LbBgBqd`f*ZK@13fo_+F4yodZt zlzSCh_MhzkzHjcf+8O*gY0U4KhdkvkW$-db-R!Aq^6NV-=?d)b1n>p&xxK$V(`*ZtBYTZ?ELH)-F0BAx{3PM^;_Iw^+0zzItP=GgNEZ&T!;PV?q4k0U#sRg$OQJESUq9P@bI%X!$uMCyNlL( zBwe@n#LxuqO|Fm9+J6ZbhEO7glR(f+=b{?vHDx9+*A3lfly+h@Oh?@RXsIN4X-4`d zO!TDqpOG}D;?q4}Fg-u+z}a31!P;-=wkgur%2WGTvMY>zzpufLz($Sp{zlDY$HtE- zp6yhE!z5Kgw`ecj(iRy+7BS2Ab!qQo_=jmegdg!d^(L0G)tb^(g4x_1agH<5m%ae( zsCeot^jBj>xAiSy-T0)+roYi|IThY$7tAxRbiK*p0JP0BG$VRf+#ZmG^xc9pb<;*Z z=pL2)$HxHx)GLu+m(NxyvJL5}^XIC-_D52cLkauoE$)-}q zZ?*$Z?iwgJ~T745bsiQe=jjEDTHZ?H{=RgW?r3!{KWE2QnRR19Ja*3a1<*mfV@U` z!g@tAB2!oNMi>1_@4fr0BxuNe)XRDg4+s_)Iwn;v`lO$=N)s^GxUaG|8HvE#bDLGr z)i)g!B(@Z2t+D?gm%utnI*d`rdbQQgMu!16%BwzfVRBSTy<9!448b{#fd=aE4#80@ ze5q#I`O8v?XO*1j%ihUw(f=%Nx`J)pMlyc`<>XSK%v52=^00CX_-Y+D5flsJ;_9El zXd#w2FwE5X#lQ1IDZX`HtG2EdO&8*p+MImHYdfvU$;;wv?8M=-xOD~qscEyK{PfSk z)_+)=T`>Q(?^Bh58i>!_3j4w06kjK7{kHSWrOtv64a_Nk{_i5~886cSFY9a*IlP8Y zqDaEh+&*S{kubDU_Og3Cn5@|=B-oI0^*-zGHE3ja7kP%Ap5yP^MgW;-%l~jt@|{^g zn#154c1V?`J8~Boe(X!*+~}R$57JNSM<3DM#H`6A-=*DEd4|Oe{L}QqK3{Z8eu|cO z&*Rtb34iM{IfkOr(s)3PVfScl2OK?57%jo6J#dAuxcL43FLqu&R%uiL2vu)#Z)=%j zt0acpz)X60Me^aUbxeZ}7VUOaf%K+M-v8`mG^!OIeUEmS#|;g|`#YHt+-GffN`L%l zeoTAqFxj~^{p=b&BPXArApiOFKznC2g1qA=L#h)(}*AF>p-+I|eO$Zw89X)xVP$gzY`C^UWP_P#N zk9NAuzOAl&*5l_{Sy_*>bc;0Dp(D&b`r<=@krz8DQPJ~jwa5pGjgS$W0tI_ z?jGuwTQD$3k$wzlh*KP>hy0ZMm@NoT+|O>Y9?%QZ-{*T(6otoZ1N%c?I6i0n)!J4q8tsuThR%$55viZG*8Hc; zv;}d^)^hUl2J&Vki8qFMf*jvKV}7^2(&NZw6zW)V47#_(BE0+gc8peHxQ}XdLf%1O z^|JOk@#4uAPZRR9Q~U1Pv8RH`W=S}Et7I6E)`o>&U)VT=7&Q^|4_l{1N=ltyZsYkC zBor3J^VP&;XisO)0f|H;)2{bDO2+mn>w&W2j~_oW*Ud6xA+;~=5?Q;5pO<+400xs^ zFu7kkb~;1$hKROYv9s#x3Gn;Uu%2E;tbggAbN|&av{#@6Iltsu<`~mpAxjo1)W*=t zepz65BX=NPwjLLOL!I~jq-^)m>_-^Q8dyAdcq}SYE|`?5k|_}K8UJFkL=v7`5Jj%* z2fb3!)wRC56Ya}UV*LB~$0@fkCRqlK#P!=W#!Tq+)1HLjKq*}5v3=ZDS@Vt*!L5dS zpN1Wtn-d7-=ln~9?9qVtu_T{igTOuXsDBZ85K{)X8r~n>6=FoV?3O?m(UreJS5oo* zeGdWI+v?sZO-)TLnB``hJS>pgCv3aTI4%_JV3Ncs9DZW__6sxUwn!gU=ZsyBdhV07 zu&(l&`m;UfodT?lNI?fRARW4z-P-BJ^v|!Y$RFnWO(ss$Nt(Z_VH%zOVU4{X7!u`S zccE+oO6E!&bI}#Fiq7#Foj_d%Pkkw3&+zAN$XtgOHseljj>zagk#Y9XO{BbnM%)6J z&`Le{!X&|e`Eul~wmYe*50n<%8oCkJ%P=3wF~YE*=WV|%U>||&_lXSg zH$)X0Tx^0k;^nMsYM(4%PJ?y}B-m>g)vuL}te%upjNiWlX#yCY-$cV(NHGQ2@dolw zSVR1`sa|h5=Gr@7pM{7Gm%9mkU!{!G%Zl)w+ak%PhI8n3OebRkO32}|U(hJ`|EdZh zvV;>HWesgm`@B>m?6zJ#C6m_FGkDN-4wR-Kcej2DM{=VM1-=AIXI!*#`47tDKlvvZ zwevPI?ilgo>$7L5m!QI>x|2{AXJGI5#Qg9_6|W=WB%Kn6|(yx1qBM8QhmbjakJwg+!-V!w!KpA2GQ|$P5 zKp=7~o|Gl#9ezbO8J%MmdstGZ4u3pW-q?0vjVjeP3Do+tDds2y{}ct%mLLbDUsWHr7c zVIbjBe7ZstO$l{cZRMG+WXo23?n-dM*Rr@{o@(G_vd$f1o&VqA;*uvJvpfY5wImOe zo$CSJjdun zd!AvwPPlz;!lt$*CXCRVZ+&>H2LRa4U{3l37753`4jQq|EQSE-fPFxO6Ha%HKl#*> zw96P7piIC-n;Rd7Y-Gk8)Mf;#!fdylp1~|hIusfAML{6GF^b093eWbomZGi)uL_d; zoO(3~inW?=utM3Pj1JyoKxrh7A!$61A2r;6#Q?4gYJy%z&qV^WM z=bN=er-QL?Jy(DUn0}BEFk)Y46({3n^`cuqGT#7-*0f1~4_C`z@}rdonejEGm~pu@ z^Nb)3m-Y{6S5@4fTfv>u?^;hH=`hb!Q-_D*>DB>DHj6fk?K?>>*NP@5)|X)?;o{_!Vq zxCL@KmnBk)cB$=rygGm+Np5=?F}%}DRdK1VW)2AjvRuW4ld7XeFosLodX3AZ>W+oX zXgELY>(|U39oqFr{$y(fl+%TS*sre~!<$Xk7ebU5tS|7p+OHhLdJ=qIr^5#`w!ch@ zu4ak=igqKj*lTpv)%5Mf50uAGW2zkAX|}dczL?sTqRzY5=os=n6ZvJFUaJdihk6%z z37%|NR24JU)uy`LuBMt5vv`m7=Hy^*w9nvL_}yx1Lg&zgyB&UXJ--BNoM>cE1-ft@ z3^9C{ur9%6WMWYt!N;#RXx+1ltdoYZ7M58bYZt;fC+l1-KURUnQC(g5ixW5x*$RH) zBn5a$dMI|&ljzcYM=B7d)7s-pB89(nQA%fgWbD$bzOJqxU3B5z;~-e6Qrz3m_KRVVHj< zmudW{eG~-z?Ch!vpBoGT6S7Zp2GW%e*YY=b!d$4bKFOp2NN7n-4MpjppW=B&q)87G zQ2Fc;Sx28ZS*I(=M%ptNn817yDmaYs289d3$!i2aVmmt&%~j|6j4GA6R2MP2W>YPj znwsN`vfFg<8y$2wfip+Ql9+ze3y#ykX?v$Kiu@Ox!ZHGFS1y{qK#?!)>Su*!1oZ;E1!hHGSJjBu9><5yb;M_i`ymqTGXdu5$j-x|xO)^OP@8`MWwC4+; zvFQEa;OPCcTf%js8c?**x(Ol?$MQji;mbPjO2LGvMUAyk0n1V*i!i>Fr{=*awkl0> zy1vrDcuyS**Gno3T$OAtEu39F`KP@^`L`}U8Zr!AjmDt-#0z_mQj4OCqh1p_x;1v+YCx(^v$TR;mS6ak3WXJo=`UhZvGls{Bw4lEebAz z;4K4hJLjUpogUjvh}gy-Ey}uUHC(Oz(CH>%MJ&pJAufGwQXkVxS(eo}G+JSAKsU&t z81~fk7p8+80X#=kJ_*~Q#6%}fZ60R`l@|Na2vJ9cyW=dHqsR}t>p;)oH#P;1Hu!i{ z(%2T;jEp$lj>|@N&u3YV6C-8(?|Km8;5Sp3Xm*-If@)pmBZT03bN&zEP>;Z6E4a5^ znxdCrHEMKa4dOh>i$|Ram1dAIRt`V9h^HjDakkEIhazhQcMcA|+mK;)XERk3Z@$8w zh%UK5cKKGb^0i0Nz!rp3JFlYuT~`8>YK?t&@X_akzv^b&(VxM9L4LPMINtF(VMg5s zM6)DBX&s7x^{fm&E2{*xzMKhKWhW*^j|!N<#SwcS>U4*H4dnXD0J4kp+~72y<7gjM zqPa$8Ctl6ZxR{9eA$v|+!qe1Jq5I6sGo7asYu}j9dJ=o;t&cqu+mU|*kca`6W4+!( zTAM9yES#R6{tx8rqmSJT^uBapat$an(OKkBd6O;=2zK&oU&sVIoBMIp1)Tj_ud(KS z@bt)STj^GDNoU|Y#d`&x^7FfIDzKJQpWARZEyJiva&rF}oX7b}Jt3W^4e|>P;lQbG z?f3IE!cLi6U~H(-(E>AX^la*%mcdN{eam3>Ds)A~*kLwJC3>77|8kRPXDIbCc0^z( zx|=2wT_ajl(6Vkl2mP9kfA_!m*bJv;#bW5%%rv!aYfhRzQZ~oF0-#If9Ctk7kGWmA zJQIvD{g)hBl6A>g#pG@6fVrXP?^4Gh(|R_Uy>)HuQ64bz zUbL!CA`HyFw*;z9>Ptf{{Rr+w}Jp{A+VtspTc2H1L8 zFzsm-dkZWUlzA{z;0+Vdza;PYZWxmU_;&lu%^f4Qgns$it%H`VVj_a7sZp;7iXc?S zhr>gYLn)Ndu*4uR>qyxHlyH!6n{h?y;;gs45Eq&Fj%dbPFYrWKoDB1YM`;NFH@6P z)I6aIMowBB2N{C<#|{mCSrdcxDosHFe6OPHf1botGu+2bL>4lpIab8_NHISIc=NiU zXnG-Z_{DpRi%XNI;w}s@h!IaN`Xm?r9gzxR)2-Ini2Kip+_v6&>e=N7w%oO@vEE&D zHq~46zn+T!(H$LDo7s&72XaPQfXlZEXod(^zk#=xBp6?s<`9LVsulDMQd!S!`7I!( z_!=dgBvz=bLw)PgNaWq9D~4Y}8?H~i(BzRPH*bdcegJPhNW+a)I3p*b&Fj1)KizKN zUZl8s1++?{_Z*ezmF_m$X0ZR8;ku%dDW3h6`p<#+wMuN!i9EBYVH{a>3K+Sk=l89! zP>d8`tUlaS-$aCh0tW!qqXik=$Y1cT`hZf0+0boT)j6z7V!Q(t2DNT8YjIg zM3rqon~bF4)(&pJJ7eF<-i1b-@ziMCzPU5s^Op5}cE;{F(=aBTgsU8CGzZ}{Hrs@! z-rl{6uU})j1_B2#B-^EvhnI6-CrM_+m3jc z>ByOWneM@BkPyWDF0#{H48X)iNziPb(oWopZejF%5U#8cH`6t1?N_ zpdVfSIwH2PcJBmtYph^*Ayao43$LB8LZAOHaeVs?eQbk;bBR$rePk>VxyURUB4Oh~ zwbp$t&oAgfH{e9j9J)8WiZu`I^Bt_t}lwQPd{A(IRo;N?{I`OND{ z_L$R>5$LbVj2P zvYx8BmB^5o8W+vy?WvJCr*|fy3Imn%=(j2#TQuGlD!oo;-reG%yY^~BO4M$b>ADo- zI@O|^I@K_2+{73=_-!IX@ET27uyDX6M8)SID++)Fg6_jC9lT0exiDc*B2j-vE)&?C`kx_B z3|i1q=+2$jaKBt69JXcf!6)m{0AcPql#T7YR$2yAzfuHv87;O1`e8hD9#^K z>F@J89{q=<-c{n##^9nuM?b$2UI8vSdm8@T4fQsGtgz>@8K#$|)9|X3pmK!6^$&r( zKZ2>y@Zg6ikkqJs1hK0@ag7h+zf4Ji??+zSa|-nI<}Hfr8dhNKwmQt7MpnY(>QdEM zHT`q7UjZ_|9dg~^K1ih5fHqGB=56*Cz``>>>15GaqojCuDH^%^_j)^7ZZYcOI;^oS ztWN~2-Iyy1@L!)RUFlw`lNCZ31;A5MJ}wp%d43vT5X8OlO#-el?}TTjTp$9|9+5OQ4k$*H~ zoSTvELfRD91SW*(%`Kdi!d?W1fVi66u#TgdjaEs-0v-hkUDp*?@bwY`MPJ_AS6q7v z@t%M14cwMcZyzG|)}xsae*n`si(^gt8IT=mX+l>4{ocT9 zNnopS+-1l{++qaoyXefL?{))9X~-D3H8S1^pDUNTHzvYH#p0c%X;pt1Yh8f;O2Vns zC4fP(e6amjCkX@#^9Wr4AjwHOd~o=~4QhWa?n4Vm(aFdf&6?TWBiJdZ^nTx(bL4?` zn#@KhdP)5G0^2KmeFx77uP2JO1lTMm=Pp|)SHB3v_Xe2Z=f4BVPt)-C5%|rKJ?g9Y zulWO&6JxJRkr}=Jf&Oq`NA=YB9mmY2(jwQQJmN)xXB_o@$G8iNJi3e;&+wnKx{-hX z!mxw20{G@Z9D8d!Hh$}vKgA7)Wgp;O4A8BfIpcI8E8pgN$}$cV4-EIRQeDIBEDCKq z7zY6tp_1?3R2a7|(&tCNl3+UI*)M>vvYUt~y?x~$_Sd2c!gaHv%IPPAvg4ECq05%e ze+;{aIlWZ(Urk~<0VaY7B>usXf$M^L8ZihVC|LfV?fycyyF%IF{m5a>yHszmk9vP1 zK(wSk+rXHd-5mW}VuXPeVG6IT2NmP$k39)qaD)#_^k?E2TE{OT^4gCFCO=QSHs$7`;XP9;9uo{st%dW zvA_p(PH^FE`Z_H4bJT0ghy$2$^Fvb7r!@!jvZyADi+5iNV42~76kmKh?&w}#;Cl6@pPz?>z5tvhw_8VUx z##lJJbNbg~s+sDi0oM=b(Ohz5)s@NxK8Dkq*+P#IMn8e~A9QzT^e#FKMKd}lIU&1+ z@bM!BBhhUyvZ_xb+SHcwdOxi$IruDie*~SrHMLvy{IDtvar7qYfb1e z9Epc~Coc8g4-Ci+Y9v+Z9Q<;35H;D%`@Y zveNf3f08N+354P&kMMDKc+KzpO)S|d(Bl^GNYXV7eCb#HJZ`uy&khr;5^(R63X*nx zy9x4nr0z*SMVaUj{VH4r8n?6hN%=MMbwhuKs^WR4(QY@@CI z_R?VWx&apG{&ET<4rf1iXeW@L0iTh=+IH#R>vMcOYF>rky|O&K#ykiO9XUPfcyJ#5 zpvCz(RP);f(^b{J!)#Hw<*Az8gGA zqZU#-k+ioSw|uxff*B3ct@`lOS}Dh;mEM(@^nlIxQ~l-1`X~UoTv*+b=efR=;{Cq* zj#x(lCGxGJ&gg~eW4(oXKYJvIoz)y4h`t*5h)vz*EThy9cJ!y$u z{SVTMomG}q6}%Vx#euy!Pd1sPLgENn5s>XqTv#l)(hM;N>)>-`o=DuZ@`P)K-k zUBkR}Sh??L9fXebmnMr!q5o!14JFlw*-L-}&Pg7@x(OMgLLp-e?~QE^4WzZ~<2xB< zD7(j4-c?4zMbD(-wQ0FKcxvEn2cwXK>R0qX)6ORL@IUtW<}-Ua*Xs(Vh!aKIj};sg_v5(FeXKMozA~t)GvK{< z_xU~pber1zgboX!WSrhe(BDn<=ET+tQ|29u2j%E&B^~?>Q8JX7t-8=6AqmJ>H$G07UevzEaciqHhKaS?!+mmV`3**-E#Bgy7J3F?p>zlXvxM!cO}HT zKQfMP?Z>n;^&W5*=j)zUc;{35*mku)>uE-|Q>D+3nSwR9tbBdeayr02PsA28^}uX= zY3wsIcZdB$#zAV}V)g0avRB|m5YY26Q<9i>d@aNYU+6Evd~YEwP)Wdj7M)o)o1bQ? zITdwzZ_Ru4G33;`%X}C5rFF}5`}COMI{4s*+vEW}^&wkVx!@Ul7wnDmL&v-Q(Q#uq zbJI$kz=jfq1&=F! z9)no=jv-k1mWQXpehjyQi9QbYIeJ+@G428dP65eX9W7YH!ftnEecaDmh_vIob@tIV zc&eYRT5udY!{ml)x6TP$Ben`@ll^RT$o$XmW_AIRj!KM$*z?aqXxgbNrv1Gb|MpJM zGPqV*ZcBm+mvmc*BtcCi1tf0S@li?sE2}yindv=obelZRsAgY~$da`D#Fw2+Zoi9q zibBm~9b!^^YPZS7GD3sV;-pEkg@f@^E1RJUqw?aT-X1Wrb3w``F+L0DKT@qib{jn1koqvd#X5iUWzm00lsaz!)JJc~I;hGmb=o}&-=?^gc&gpL!@`Z}P1 zmJJjt49)hpGq?V7l*l*Tc)j#%2cgd&B|fDFb6&e%4|nSA&f1~*?JYP=h5!HeUvZYh ztt^Pnk`N*}AK4CmRSU^NysAzYok=obfUHRrE1tZ)41p6GOzz}OB*sEUn2|5&0#xAQ(l zX%c50L>||Hr0`;fsF&{7mrtM2q3uu0R;fIk;BMlkz!d5A9D5s@)Q`&Bb5Y7cO9w5v z*9bpFdAj&u_T_r$^(AU5nmXKX{o4?2aj+Tw(|4_}*U7Qs z!3xBV43FG$TXWe=yH&cTg3T_Yr>ViXZ@F_xHkmr@)wlaMHE{q8DvFx1Oj=I?hdBs zzUX$?Xk8d?s#K{P$&`O^rk;nMGQ~Mcg9qwnhTsbGr%@?jDd*8OPQ4A~A>^ddP_^0s z9BPpUE`spkR%;LTS5|(d4E+fAsKbixdn9a)v0hq+o)yM3h?W=3{*mKq9}ezzaE6;7 z%8fH_R9k;GrgOuo4k4j96^)hFHR73C^zJ1+u}fC-q4xm)?B)$V^E*$Ho#OkK?=wr} zzgV7prJ&V@OhMV1^1KAhNi!|ohW?#o$Zw$2@ng9D+&<_>;&ZJ5*B{9mPeWG=1ahto z@OpLEC1CWx8YeDMHE5lZ3y;qiGo+kQ;yHbY@#g@l1IqzHp*^d$K^sig!A9j$b(gsf z;Pa%UgIrzjCy2Z4ljEU4>&JdV_5;J7DX279LEUo&=kXl=an&zE*|zlEyWP~LsY#&T z4#cbc>VwTI&h|x$7lZF@mT6D8wQ;!tKCxZssL%HciTJG*>b~+=`cX>I0fV|^c zb(+QJT$3d<`0r+oT-`qoQos)I|M|_jZj>LINFa{F8Z2cC9V|QYD#ju76q@fSC<&6# zQ+cH35^PfR+YxA~Zq0D$@en?knt=;wQm5Xoamy}+51Py~K0>4NoU?{QRl=Pon>l|3 zB+VvZ`*cT^{u{+#X8l?Xx&%;f8RNy!znWa$DUUP*2662k(YG^j1?~*7udvsE?+c=C zZ;Pxdahm%fooWQ==jej7n9Uly2(_YuNWP7@O2MIM*K$T6McQ?03KY4cvj{(AqIjm& z0O3a+SiS{BXZPgpR=~@qtF@T~&}$Q1hXe6o5h_pSzo<+knSg{Ye>^HYOGF2M8_$<_ z6#N%jy@O78T&}ZS`qmrjHy0+dlrSWagS;&&lBMInUlyR?n20|ftk1L~a+Ox~OfSY_ z;AgF@IBkEt()zw`fL7WZ?I?!a6eD*cfC8$U9=5JdJr= z0qwknPeP7_bkMKCH#X=Cf#wHddoJsZnQf@~8zCuQ%npLc_7lC6GtnmpjAoP+Yx}M8 z)nQI0RM*{A>PqB0=h5^4yTcN#Zpxg4FRHgb)9d;Vz>5nv7iW`(--19(awMxWN-zeS zuRVUPtgNt|_oIs0I%iFL`()(1XBQBH(b;+_8fc1J=9}+-p?Ri> z^`La>=%CH9@*rkdUWv>kKxLA0-mlaE!sDTL6Ux=9jykqyF+NLw{gODk`^VVV(UNZI zC+K2Sn#0~uruRX>lL44kLH)0KBz3B5Y*)zaw106%Jcj)BD{Q~D8zO}BvAesE0Xfwu z?C$?f=`oo?RxV0m7caelSN(nmoUJ6WZqb+h=MW$qI2ZOL!0e$VOHn}IG*yAyFDH2K zUuH#(#(0OI*;&+@_0|mUI#7JCc}%Q~e_L+7gG-WKZr*&_n>&i^scFI?UBE2T&a;WEwI6mP%h&YGN`b$C58azlf`R4y z|9_^=rYkG+--k=KJPXtnm7#x%smSQUd$6uQ5-+@d<=U3uZ%PT+l)A`9GD}>+Yzo%V zw5=1~1U~o*_)otO?n13W*xAkPv^4lwrM4pf@yAw~#;icU{557f;r>Za%MqMqyWMl)t75z8cJpwVQ}J%^CUP5k^6^7Mx?3sa5&)9iY#+1;Xn$c?gD#@p1Vb2 z{mKs))HP;k9NAp?da=kJ^i13C)f1_Bw{qPg}tBw=y?;R@dj5U!#bl?gD z1@%&HL|}s@;vj4Kt7-m6R@U*gbIn!O#eO2B8+f*QXsO>^wzse$y!QHe2`00_&dVh} zE@Dk+iGGjYr<+0YK{~sw^XF!M&-H~>b_P7%wd=^`RSX1V?w4j8I);Ya%|x`+{zyFv zX$NJ&Hzs4tLA#vkz%996pX%sqia*hnY1_>D{sYk<4H%EJkc0U`{Ud5zGx9~(S9P`! zK>JA*)~_}4{@dT*`pO`BHd(#zSmgF@>X!Gls`A0}uKdwZjxoKNlaXzW?U%wEO>zSV z-yXN#{%RE74(iR4s_17dU^!!6=QamY&r^^}wvYQ=T8{5zyBU>)eix@0pO^Suirj6$ zT(f-C^9t}a7iaG(H?S!wZiYRIj35nuC|8Sz-TrK{SdTSSndQ%f85x;zX}y!*U|v;` z)yB0k-klhe@M8W+&sXLk1I2~aW&@&+Z*_F*OxDx{+0o-75P7=`?cOzZY~z!Y#zdj z{WFhJM0zK0WUF*h?&v4gW_}|+f|pVDJL6 zFxe{M(@9Om>k5R0>xTdCJg7EcS4Oe=MXIGdyRpXL*PDyV=8TBQKCW-G=y35nDSw}2 zbI6^7Mw}UFJq?%9rYDAQMW4);t05jleCnHpR&fBXU9*^&W{!$QYkj&SkhT5|O7@T6 zk8~l23x}Wn0EO0l*cq1kCA1ZQwIgjBttiA6IV;y$wn3`j7kOHgezgc!)|$!Tlgr?^CAlm~J9B zhFf7z-WuBxExy#1GL1SMB!){(VF@6&?z(;U@kRC5A&0dIP+WZHv+&`yb3R_t{7ZAE z$h#=ljn+oqIr&c?`?}eA-pafQWRNZ=OZ@DlB(0-vJkO8(orqpZDp9jQT=JDVKlfWZ zmZ|dhKMPHSKYwJduNQzMK|o^GdYR}aFn3E*ke8h~&ljBBvW0vMa2&W2-ty;PE?w@7 zRg&V}3F4|teiipyEh5*AB%;6%bLY={pL>Vc#S2G(izR9qK{v$J1j&*83JG{1bFg3m@b0)UdkLndQD{;vWsvmYJk!K)hrW_>{SMf$L5%I7L?DrM zw@su2Yw?`YUj(Y6FBmYSewKt13j9d39Nt4ZlS4KG}?vcu*=f|)9{<*Ao_ zH)x-)8ncT#j`HVGf3@xz3EJgi>#)vm;1$be`f}()(>9Il$4Y$%+CF?F9O4LE=2Cli z6S*jQ$(>&0FsYwdfG=zFt@*uJ4s1D zpwVA%pthM{yM<^^cP=hxM7h^C5qB~^`#Tn6e{wK=s*NhjFXP7PWx8PzHx%kvYiTlb zDit{`-o|fB%B`s=)-7hc^KL+lPSle7*dwqC5?$m~_L(1Qlqa)#9rxeX1dS3wN^j%b zAOD$$xN^k>JnrX?O+Zi<-c^6#Ai9jXX-Gu*lL;-cJaBQ7CBZ zWzUs2?D=8grUsMs0X_w!`4Rr6FhGes8$9CMOrMZb_fIgS$k&Lb-tV5OvNYvYT=)J% zUazK$l-=f1`+=cH<4B9bu>paVaiIc39v%H?CEjr^Q`4<=GLhjXvW`r>^=m!YdTMq6 z(vDgkCk;=mO*&U<6qbFWn|it5RQ5^GgkvCbH}H(|rwBN|Sh)KJ?t3&4a^Z7W zHT%kB?)UL`DONA`sua$AY;(cacZ|B0a@oBWb>OSWAr-0zbm#DD(v36qrQN57b+}T; zgrAe<3-YM{Ty{ppZ4E`kYT`{xgRpMS(-4gMaAuq0_}e`{X-_d%es9D*M2)8kC$Sv<0oRJDHl*eh~^$zc23q9G;$G051rZd zpyw9@uBoEGtrRU4?xU##IY+EVT_Oj}9zD?<3>V134;_r7(v;KE3FzyNI z-6gOGRmI-Oo$boIJ!LsZW8Y#?tdhRy@#<}snav%0V`Bj5(^FH(ey6~9{_%s-lQ37- z8YEdRW9IZz#Awlck~pu<1aV)uE$V$?Crspm)a?~d*1BrKbB;NO>^DpfUFeLVzd9=X zyKvf_eI$8wsG4H@ni#5iDLIKYvA}O-84pX+$OzNL)t5IB6OnZH-^{gX5T;^k%V-Y= z4%GK!gaSL8SppAITSnWJ++MR7GNRqPjMv&+yJ)@{QUk$rseTH!lY>Q+#Z0YRztiAv zC^BFvntInbF&lez+wN3z!ex1`6XlQ1ezktv_C^x1;Fug(T}Iu6#` zOTKq80?0=j51O>;INBEBDP-VmV}(#G;2vxy1c0P2G5d-5QJ+y5_9q(|G{B|}$RBBw zX8Ivk$i*-I1EWFB7UO*rQxsEm7ThL?dn!Ku)&C-SpPk%!zG}#ymGr7e_ja*+z8jkz zXhq}66^C$r$mkj2N{kMvtf=8bf;%G8d@;%20k2w5oX!}NWZ81Y34FqOZW9G68`+@m2KFGd zW&Uo{q1HF!KnCwTW`F0+C^q<5SM};{5pR~A92fVY3QoJ!r_7i6slP6V>^eqC8aTRx zl6&Y>o>lAN?{Ax41)<6lIznq4r$&$PcP0x0vn{0j{YoT7g`I~!S2PCK-BZc~Zb;B( zLOhz!KEgx}Nx{vgirHyMuG(g`Rjt}(yw?-eN4x}cMWZ8v{-#$h4~<~(SXY-$#a@?^ z)taC7DF!ze$ig&}ze=bw$>)4s`U8GJzINEdiBBpnIxT)BRWY_d2jslf8Ok5NWDI`1 zJ~982)Ic4Rlso8l8FZ|pbAxl-UKtG zd^Oknv|)F=htLHL+=o^2J*iZc|KND#lM9UbzWRRSC1zkv>u&1|!;_e@a@pD2y5aaE z)t|(luoA0|hHobwGUry}PQ}|;t5^0$E@dBze2$w?M&p&4 z0FNt|xaf78vlE=wq#g!*?OHQ5ysac`7l=bgmC1llmJ%ppCB#Iw<|~n#V$43Ph8+ra zw~&S8wpU1rNLjaOTQMoOtk1jAf&G})G~T?gV@7)zd^FlhZ5dDdD`i}%9vHh5&ClY>IF*{FpW+4%ku(s>w z=6ZZ9;3L66(YYSst$H^sTef#i#xfG6VB_sz>fX|qj29ki>1+PHyr|KGLLGgzXJ2ls z+xhY)EJTPWTDmF$*(ECy@7?n2>23~tgb0PeSANT1^&KA`bv65)lJA9-+4#Do#58>L zzUSaKEyknMCwz_0r{XdjqXxCMta;RAGV2KqT129JG*8k`#=3qz-H>d^C(XaeFny@X zAZDrdbi>)(dyP=R=Ob|T=7c(+#R>Hbd@}QPH}X4-d;BEPF!#wpWd#cuNxj#jyH?r5 z$ehT0ijNS`dH-`_ovwP&d)JGSl5*y51ErT)Fs?=-7lBcX+-wjWa^T#2~1v zZ#Nx&^h}pRJ+K(>8I5X3t;5LV-OQLU zwp^Pz;q@=>z`psknkj3~Dq-kS++?I+qc4Kd6j8Q~skvaK7jsf%*Xw0SGCrzQ4nm^R zs#CY6U62hfQQ>bF>;ln3x$X&Mo|Ey?pOK8${L70Y)Ctv9$*h`ldDS(Ajn1OAKCft_ zAvq-A*6n*WyjF54>kE`Y^mo5_nMt%3ImUK(^4!u=&(mda!(as7_StZnVL3|6$C|~x zMQ$#BwyhtLdWr!p32ue5Ft#=9WGtWGTQu|Xs;c5JNz1yp&fs_D{+fd?{#!7ta@&se zr!ex{L#B(*wuSE~l(4F&vlZ*Z(cG1tElJ#m`Tqj-GH(^vj!%yW1a+N?w8Ft6MvPZH z6tme3)`s$pb{w7+<_JZ}XOGWCX-WY{h!)}gmVg<}Nv}rabJX+aaXzmK%Sz7Pp$}43 z+lAA?HKghOd>0;3n18t3a*`WS?Hn^2cmB(Pak;b*D5MdcT~k2;Y-U=j3vCJo?bvsj zGDdHHSkL1^lub-bJCiuXUIVaBto0D9B5%oI|_>^ng zG=avTUD^mdCw*Nmi$~D!Qt?NnmlS4X+sD3JCE{y$6w@aXY1_F@?8O%1jbh3wh4{kV zLH!Uj_a7hDpTv4zd7MLiSnwz)IWc_yotuQjoohFzGflc0o9~J96rS3R0FL)shZQVz zVti{Y^p^RfD4kY#A@{MMDaCs;`f2CdIyqUHjX;yEuOALev;2qhc|-}UcsXhDNz;h2 zO2ra&YL(&&XN$KBbmtVd(w^9N^^(u`IA&Z~stbd8F$cZ2b>5BDC6Qd={67;9E2<;wK1qmk59wknTvO4;~c|rr+nWqym4lDbmX_+kIG^?Se2#1l)*`V z$F~IO^o6y#vaGXs5B<4+h_XpSRBsL0CJZtr3kUs_cJoQ!T6YUWz&whZrkX8_9BkqZBei#yML0D-0@=?SC$5v$0uPM z`})ZWnw}NaV-&rDjs5nOjZr5Cd>a~8@yG=^d6z3q|c1N)%Mr$R+lhsRoz$f(wN(}ylEifv}yQdHK638x-fV3rEbr$?o(FAJD+a8 zFR(Ap9LS{pRz4u8shj)n7HzuXb?)oeiFsd#wH$vl%R)nltCN^Oj z>NIXz`<)v6ZzPuDEoqwLgEmUJ2uJ+1aque)%^3E|)6>(&#&c|7%*M$vzpO}1vE@n4 zw^#wOjVH4ISX1;TEmRS7?c@8N4KItXw=e`{JdcaRkI*~fbe^i$C$6iV$B;|KY_f1;(6ZGgTekbr%F2GBFr9W8P?@YS6#|G6>;(SHf!%c$GIN6OsJWz& zt{jJV1##oh54jL3l^7%IyH2>)iDlvLq|a>%C$I6*-?aU>)VwYSW-xTosno|FVYos4 z%iGZ{P_PP9{8gjSxOV2P7}=QX%Mf+pzhk@P9Ix#W6MEQc?P{zzS))h*wpySHtfNLV zBC>N)`vWF6(O)q|<~@WX#k= z2mKYsYxd--%H$Q$8BHIJ(RD)KtPKc&fX4N#syN)ZJP%IUunoP7`vvvC{ul4Ml@QoK zaJzv*IsGhiwmZTsg@e%d7j^~zgAaKWTnP2Pm4Ih~+B|`L`C_u^G=VmnM6F=ApMQku zNv9qA`*>jEq#-oU?Eg@w`|_jKp%$}^f|Jt$aArhOm+xG3{@Iiw(C%sX20H1jl+l19wF za)t8i#AZ=&yV&u&3IsSsi-(UA^N)7g>(OZu%9U3_nWrUMJmzka82<1RGap#X?#>YM z>16_i_$^}$Tb<+ZBh*>%ecs%7t@AQ~Zch}WQ)<_t)&iuyauv2N0-!}1UG2jb?QnnE z-@@|S(`AQ{d^WFLih8;yAe7c(GefQbXFzb2{~E|s?Lfz+hACIBg zg^-?k-YY=+%Mix(z_>=Zo_6o$c1sKkt{Tuz9ONv;W%3Zf_C{@MP3J(A zzqG=cG!arGYcjmbN*=yq&d>`n;dt7P^r;X8@_=<(ybd>Eawpv}H<)w|1}*9Uws4qk zg};2TxVCY3MxKs9k*h4i6X>~H_kgRsA~oyqBNL97>neeQRLp^j=xDKPb7rwm?Q1{D zuYfT>B*zsZDEXE#7TQj~F&HqbtCrNdd>ARHEfg?YAoOv0i=6{|PXg}fIcBYM_Ys)_ zPSyZSWx@3*Ne~7R)R@b?3-Pwi^aXUH#Wyiv1cW*KeqNK4G7Q1Sa^QZDE0CHUEj{hh0sQ7M;%g3l z!(fsY_GUcotd)NF<}L1cbxt!S>t;LX%ys#A+Kd&+7S{{kTD`0O(|ygt&*%wu=g%o} zf2zBkBVh?k5)T3pP_VM*u=A|%a)EIj*w6ISx}C;l!ZKhN-KAW+%a)#5t9~vp4Jf!N z2`90`)LKMO|Hr?#OMXBVX3#YKnm0l{83=L!Laf_0kt^t+r;HhzR|ykkN}7FG!ay?-P}ix>2DWeTUMj^N zE5HdKSo`kH#c)yZ5$*+A`H{a@`_BWQyoV2fGIaG@U!Dit_dVc|D!{C?%=VrNhVCB$ zpVTlO3@>@r`d7V8?A!;&$Pry$0fG2N2Vmf%663Oz zV03oan30k(6EHFY&C}J5Z)y|)xWpyBP36oO4~oi|2}A(YZSxCj$`!x~ssGGt^t67~ z)c;V7s$H>9)%5Bd-QYlAhk@ZVb znq3zL^6m5iox**<`s&D}1aQk#oS~qNL?}g!%pt($k}m+zhb_GZ?6|0v Date: Tue, 24 Oct 2023 02:09:18 -0400 Subject: [PATCH 258/325] feat(solidity/extension): added extension readme --- toolchains/solidity/extension/README.md | 75 +++---------------------- 1 file changed, 9 insertions(+), 66 deletions(-) diff --git a/toolchains/solidity/extension/README.md b/toolchains/solidity/extension/README.md index dacb82d5..6996965b 100644 --- a/toolchains/solidity/extension/README.md +++ b/toolchains/solidity/extension/README.md @@ -1,71 +1,14 @@ -# extension README +# Solidity support for Visual Studio code +[![Version](https://vsmarketplacebadges.dev/version/OsmiumToolchains.osmium-solidity-extension.png)](https://marketplace.visualstudio.com/items?itemName=OsmiumToolchains.osmium-solidity-extension) [![Downloads](https://vsmarketplacebadges.dev/downloads-short/OsmiumToolchains.osmium-solidity-extension.png)](https://marketplace.visualstudio.com/items?itemName=OsmiumToolchains.osmium-solidity-extension) [![Installs](https://vsmarketplacebadges.dev/installs-short/OsmiumToolchains.osmium-solidity-extension.png)](https://marketplace.visualstudio.com/items?itemName=OsmiumToolchains.osmium-solidity-extension) [![Rating](https://vsmarketplacebadges.dev/rating-short/OsmiumToolchains.osmium-solidity-extension.png)](https://marketplace.visualstudio.com/items?itemName=OsmiumToolchains.osmium-solidity-extension#review-details) -This is the README for your extension "extension". After writing up a brief description, we recommend including the following sections. +Solidity is the language used in Ethereum to create smart contracts, this extension provides: -## Features +* Syntax highlighting +* Linting using our linter ([Solidhunter](https://github.com/astrodevs-labs/osmium/toolchains/solidity/core/crates/linter-cli)) + -Describe specific features of your extension including screenshots of your extension in action. Image paths are relative to this README file. +# Osmium embeded tools +## Solidhunter +The blazing fast solidity linter cli -For example if there is an image subfolder under your extension project workspace: -\!\[feature X\]\(images/feature-x.png\) - -> Tip: Many popular extensions utilize animations. This is an excellent way to show off your extension! We recommend short, focused animations that are easy to follow. - -## Requirements - -If you have any requirements or dependencies, add a section describing those and how to install and configure them. - -## Extension Settings - -Include if your extension adds any VS Code settings through the `contributes.configuration` extension point. - -For example: - -This extension contributes the following settings: - -* `myExtension.enable`: Enable/disable this extension. -* `myExtension.thing`: Set to `blah` to do something. - -## Known Issues - -Calling out known issues can help limit users opening duplicate issues against your extension. - -## Release Notes - -Users appreciate release notes as you update your extension. - -### 1.0.0 - -Initial release of ... - -### 1.0.1 - -Fixed issue #. - -### 1.1.0 - -Added features X, Y, and Z. - ---- - -## Following extension guidelines - -Ensure that you've read through the extensions guidelines and follow the best practices for creating your extension. - -* [Extension Guidelines](https://code.visualstudio.com/api/references/extension-guidelines) - -## Working with Markdown - -You can author your README using Visual Studio Code. Here are some useful editor keyboard shortcuts: - -* Split the editor (`Cmd+\` on macOS or `Ctrl+\` on Windows and Linux). -* Toggle preview (`Shift+Cmd+V` on macOS or `Shift+Ctrl+V` on Windows and Linux). -* Press `Ctrl+Space` (Windows, Linux, macOS) to see a list of Markdown snippets. - -## For more information - -* [Visual Studio Code's Markdown Support](http://code.visualstudio.com/docs/languages/markdown) -* [Markdown Syntax Reference](https://help.github.com/articles/markdown-basics/) - -**Enjoy!** From 95801a8aa93da3ec49ec3e9bda342c8fd1733865 Mon Sep 17 00:00:00 2001 From: 0xMemoryGrinder <35138272+0xMemoryGrinder@users.noreply.github.com> Date: Tue, 24 Oct 2023 02:18:48 -0400 Subject: [PATCH 259/325] feat(solidity/core/linter-cli): added readme for solidhunter --- .../solidity/core/crates/linter-cli/readme.md | 77 +++++++++++++++++++ 1 file changed, 77 insertions(+) create mode 100644 toolchains/solidity/core/crates/linter-cli/readme.md diff --git a/toolchains/solidity/core/crates/linter-cli/readme.md b/toolchains/solidity/core/crates/linter-cli/readme.md new file mode 100644 index 00000000..f262277f --- /dev/null +++ b/toolchains/solidity/core/crates/linter-cli/readme.md @@ -0,0 +1,77 @@ + +This is an open source project for linting [Solidity](http://solidity.readthedocs.io/en/develop/) code. This project +provides **Style Guide** validations. + +## Installation + +```sh +cargo install solidhunter +``` + +## Usage + +First initialize a configuration file, if you don't have one: + +```sh +solidhunter --init +``` + +This will create a `.solidhunter.json` file with the default rules enabled. + +Run `solidhunter` without arguments to get more information: + +```text +Usage: solidhunter [OPTIONS] + +Options: + -p, --path Specify project path [default: .] + -e, --exclude Exclude part of the project path + -r, --rules Specify rules file [default: .solidhunter.json] + -v, --verbose Verbose output + -i, --init Initialize rules file + -h, --help Print help information + -V, --version Print version information +``` + +## Configuration + +You can use a `.solidhunter.json` file to configure Solidhunter for the whole project. + +This file has the following +format: + + +```json +{ + "name": "solidhunter", + "rules": [ + { + "id": "line-max-len", + "severity": 2, + "data": [ + "80" + ] + }, + { + "id": "code-complexity", + "severity": 2, + "data": [ + "7" + ] + }, + { + "id": "quotes", + "severity": 1, + "data": [] + } + ] +} +``` +A full list of all supported rules can be found [here](https://github.com/astrodevs-labs/osmium/tree/main/toolchains/solidity/core/crates/linter-lib/src/rules). + + +You can disable a rule by simply removing the entry in the file. + +## IDE Integrations + + - **[Visual Studio Extention](https://github.com/astrodevs-labs/osmium)** \ No newline at end of file From fb5742998e88d28dbd987d41e2e24bc63a8a46fc Mon Sep 17 00:00:00 2001 From: 0xMemoryGrinder <35138272+0xMemoryGrinder@users.noreply.github.com> Date: Wed, 25 Oct 2023 00:42:05 -0400 Subject: [PATCH 260/325] fix(solidity/extension): broken link in solidity readme --- toolchains/solidity/extension/README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/toolchains/solidity/extension/README.md b/toolchains/solidity/extension/README.md index 6996965b..0291c213 100644 --- a/toolchains/solidity/extension/README.md +++ b/toolchains/solidity/extension/README.md @@ -4,11 +4,11 @@ Solidity is the language used in Ethereum to create smart contracts, this extension provides: * Syntax highlighting -* Linting using our linter ([Solidhunter](https://github.com/astrodevs-labs/osmium/toolchains/solidity/core/crates/linter-cli)) +* Linting using our linter ([Solidhunter](https://github.com/astrodevs-labs/osmium/tree/main/toolchains/solidity/core/crates/linter-cli)) # Osmium embeded tools -## Solidhunter -The blazing fast solidity linter cli +## [Solidhunter](https://github.com/astrodevs-labs/osmium/tree/main/toolchains/solidity/core/crates/linter-cli) +The blazing fast solidity linter cli. Includes nearly all solhint rules From 09be0ecaf1807b0a193a577117d9262f844c8930 Mon Sep 17 00:00:00 2001 From: 0xMemoryGrinder <35138272+0xMemoryGrinder@users.noreply.github.com> Date: Wed, 25 Oct 2023 00:51:29 -0400 Subject: [PATCH 261/325] chore: deleted remove-me (+1 scrap from dev) --- remove-me-6babd5d558ce4e45ad20.txt | 1 - remove-me-e9da91787492451f8e6e.txt | 1 - 2 files changed, 2 deletions(-) delete mode 100644 remove-me-6babd5d558ce4e45ad20.txt delete mode 100644 remove-me-e9da91787492451f8e6e.txt diff --git a/remove-me-6babd5d558ce4e45ad20.txt b/remove-me-6babd5d558ce4e45ad20.txt deleted file mode 100644 index b905e13f..00000000 --- a/remove-me-6babd5d558ce4e45ad20.txt +++ /dev/null @@ -1 +0,0 @@ -6babd5d558ce4e45ad20 diff --git a/remove-me-e9da91787492451f8e6e.txt b/remove-me-e9da91787492451f8e6e.txt deleted file mode 100644 index f3f8abf8..00000000 --- a/remove-me-e9da91787492451f8e6e.txt +++ /dev/null @@ -1 +0,0 @@ -e9da91787492451f8e6e From 26a8b3f7cd52b5315eb8d6f0eba999f017a787a3 Mon Sep 17 00:00:00 2001 From: Astrodevs CI Date: Wed, 25 Oct 2023 04:41:12 +0000 Subject: [PATCH 262/325] chore: create branch chore/193-better-cd-versionning-staging --- remove-me-83a0eff5a34f45459563.txt | 1 + 1 file changed, 1 insertion(+) create mode 100644 remove-me-83a0eff5a34f45459563.txt diff --git a/remove-me-83a0eff5a34f45459563.txt b/remove-me-83a0eff5a34f45459563.txt new file mode 100644 index 00000000..a67a9c8f --- /dev/null +++ b/remove-me-83a0eff5a34f45459563.txt @@ -0,0 +1 @@ +83a0eff5a34f45459563 From c3e4071633399011ee367d6515098564ac1f2593 Mon Sep 17 00:00:00 2001 From: 0xMemoryGrinder <35138272+0xMemoryGrinder@users.noreply.github.com> Date: Wed, 25 Oct 2023 00:44:49 -0400 Subject: [PATCH 263/325] feat(cd): added language prefix to version tags --- .github/workflows/cd.yml | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index 010980fd..5fe66abf 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -100,11 +100,21 @@ jobs: echo "is-unstable=false" >> $GITHUB_OUTPUT fi + - name: Get tag prefix + id: get-tag-prefix + uses: actions/github-script@v6 + with: + result-encoding: string + script: | + const workspace = "${{ matrix.workspace.name }}"; + const language = workspace.split('-')[1]; + return language; + - uses: paulhatch/semantic-version@d43966692519e4a5d4423b3da1b4b903c58c8f6b id: find-new-version with: # The prefix to use to identify tags - tag_prefix: "" + tag_prefix: "${{ steps.get-tag-prefix.outputs.result }}-" # A string which, if present in a git commit, indicates that a change represents a # major (breaking) change, supports regular expressions wrapped with '/' major_pattern: "!:" From 2851ab8768dba08b88b28494eba5b873656168df Mon Sep 17 00:00:00 2001 From: 0xMemoryGrinder <35138272+0xMemoryGrinder@users.noreply.github.com> Date: Wed, 25 Oct 2023 00:50:27 -0400 Subject: [PATCH 264/325] chore: bumped version for all crates for publish by cd --- libs/ast-extractor/Cargo.toml | 2 +- libs/ast-extractor/LICENSE.txt | 675 ++++++++++++++++++ libs/lsp-handler/Cargo.toml | 2 +- libs/lsp-handler/LICENSE.txt | 675 ++++++++++++++++++ toolchains/solidity/core/Cargo.lock | 8 +- .../solidity/core/crates/extension/Cargo.toml | 2 +- .../core/crates/linter-cli/Cargo.toml | 4 +- .../core/crates/linter-cli/LICENSE.txt | 675 ++++++++++++++++++ .../core/crates/linter-lib/Cargo.toml | 4 +- .../core/crates/linter-lib/LICENSE.txt | 675 ++++++++++++++++++ .../core/crates/linter-server/Cargo.toml | 4 +- 11 files changed, 2713 insertions(+), 13 deletions(-) create mode 100644 libs/ast-extractor/LICENSE.txt create mode 100644 libs/lsp-handler/LICENSE.txt create mode 100644 toolchains/solidity/core/crates/linter-cli/LICENSE.txt create mode 100644 toolchains/solidity/core/crates/linter-lib/LICENSE.txt diff --git a/libs/ast-extractor/Cargo.toml b/libs/ast-extractor/Cargo.toml index c863a5d8..f924ba26 100644 --- a/libs/ast-extractor/Cargo.toml +++ b/libs/ast-extractor/Cargo.toml @@ -3,7 +3,7 @@ name = "osmium-libs-solidity-ast-extractor" description = "Extracts the AST from a Solidity file" license = "GPL-3.0-or-later" repository = "https://github.com/astrodevs-labs/osmium" -version = "0.1.0" +version = "0.1.1" edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/libs/ast-extractor/LICENSE.txt b/libs/ast-extractor/LICENSE.txt new file mode 100644 index 00000000..5dc6b429 --- /dev/null +++ b/libs/ast-extractor/LICENSE.txt @@ -0,0 +1,675 @@ + + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + {project} Copyright (C) {year} {fullname} + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +. + + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +. diff --git a/libs/lsp-handler/Cargo.toml b/libs/lsp-handler/Cargo.toml index 6d5f3e41..6bb65123 100644 --- a/libs/lsp-handler/Cargo.toml +++ b/libs/lsp-handler/Cargo.toml @@ -3,7 +3,7 @@ name = "osmium-libs-lsp-handler" description = "Dispatch LSP messages to all hooked handlers" license = "GPL-3.0-or-later" repository = "https://github.com/astrodevs-labs/osmium" -version = "0.0.1" +version = "0.0.2" edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/libs/lsp-handler/LICENSE.txt b/libs/lsp-handler/LICENSE.txt new file mode 100644 index 00000000..5dc6b429 --- /dev/null +++ b/libs/lsp-handler/LICENSE.txt @@ -0,0 +1,675 @@ + + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + {project} Copyright (C) {year} {fullname} + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +. + + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +. diff --git a/toolchains/solidity/core/Cargo.lock b/toolchains/solidity/core/Cargo.lock index b958fc4c..c8cf6e08 100644 --- a/toolchains/solidity/core/Cargo.lock +++ b/toolchains/solidity/core/Cargo.lock @@ -289,7 +289,7 @@ checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d" [[package]] name = "osmium-libs-lsp-handler" -version = "0.0.1" +version = "0.0.2" dependencies = [ "js-sys", "lsp-types", @@ -303,7 +303,7 @@ dependencies = [ [[package]] name = "osmium-libs-solidity-ast-extractor" -version = "0.1.0" +version = "0.1.1" dependencies = [ "proc-macro2", "quote", @@ -451,7 +451,7 @@ dependencies = [ [[package]] name = "solidhunter" -version = "0.0.2" +version = "0.0.3" dependencies = [ "clap", "colored", @@ -462,7 +462,7 @@ dependencies = [ [[package]] name = "solidhunter-lib" -version = "0.0.2" +version = "0.0.3" dependencies = [ "anyhow", "clap", diff --git a/toolchains/solidity/core/crates/extension/Cargo.toml b/toolchains/solidity/core/crates/extension/Cargo.toml index ceb960a8..abb885af 100644 --- a/toolchains/solidity/core/crates/extension/Cargo.toml +++ b/toolchains/solidity/core/crates/extension/Cargo.toml @@ -11,6 +11,6 @@ crate-type = ["cdylib", "rlib"] [dependencies] wasm-bindgen = "0.2.87" -osmium-libs-lsp-handler = { path = "../../../../../libs/lsp-handler", version = "0.0.1" } +osmium-libs-lsp-handler = { path = "../../../../../libs/lsp-handler", version = "0.0.2" } linter-server = { path= "../linter-server"} js-sys = "0.3.64" \ No newline at end of file diff --git a/toolchains/solidity/core/crates/linter-cli/Cargo.toml b/toolchains/solidity/core/crates/linter-cli/Cargo.toml index 4d02432c..d929a24d 100644 --- a/toolchains/solidity/core/crates/linter-cli/Cargo.toml +++ b/toolchains/solidity/core/crates/linter-cli/Cargo.toml @@ -2,14 +2,14 @@ name = "solidhunter" description = "Fast solidity linter cli" repository = "https://github.com/astrodevs-labs/osmium" -version = "0.0.2" +version = "0.0.3" edition = "2021" license = "GPL-3.0-or-later" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -solidhunter-lib = { path = "../linter-lib", version = "0.0.2" } +solidhunter-lib = { path = "../linter-lib", version = "0.0.3" } clap = { version = "4.0.29", features = ["derive"] } colored = "2" serde = { version = "1.0.149", features = ["derive"] } diff --git a/toolchains/solidity/core/crates/linter-cli/LICENSE.txt b/toolchains/solidity/core/crates/linter-cli/LICENSE.txt new file mode 100644 index 00000000..5dc6b429 --- /dev/null +++ b/toolchains/solidity/core/crates/linter-cli/LICENSE.txt @@ -0,0 +1,675 @@ + + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + {project} Copyright (C) {year} {fullname} + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +. + + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +. diff --git a/toolchains/solidity/core/crates/linter-lib/Cargo.toml b/toolchains/solidity/core/crates/linter-lib/Cargo.toml index e3bccc85..86b68ed2 100644 --- a/toolchains/solidity/core/crates/linter-lib/Cargo.toml +++ b/toolchains/solidity/core/crates/linter-lib/Cargo.toml @@ -2,7 +2,7 @@ name = "solidhunter-lib" description = "Solidhunter/Osmium solidity linter library" repository = "https://github.com/astrodevs-labs/osmium" -version = "0.0.2" +version = "0.0.3" edition = "2021" authors = ["Astrodevs Labs"] license = "GPL-3.0-or-later" @@ -18,5 +18,5 @@ serde_json = "1.0.89" anyhow = "1.0" glob = "0.3.0" thiserror = "1.0" -osmium-libs-solidity-ast-extractor = { path = "../../../../../libs/ast-extractor", version = "0.1.0" } +osmium-libs-solidity-ast-extractor = { path = "../../../../../libs/ast-extractor", version = "0.1.1" } regex = "1.9.6" diff --git a/toolchains/solidity/core/crates/linter-lib/LICENSE.txt b/toolchains/solidity/core/crates/linter-lib/LICENSE.txt new file mode 100644 index 00000000..5dc6b429 --- /dev/null +++ b/toolchains/solidity/core/crates/linter-lib/LICENSE.txt @@ -0,0 +1,675 @@ + + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + {project} Copyright (C) {year} {fullname} + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +. + + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +. diff --git a/toolchains/solidity/core/crates/linter-server/Cargo.toml b/toolchains/solidity/core/crates/linter-server/Cargo.toml index 5c1bd541..5939bc56 100644 --- a/toolchains/solidity/core/crates/linter-server/Cargo.toml +++ b/toolchains/solidity/core/crates/linter-server/Cargo.toml @@ -10,6 +10,6 @@ crate-type = ["cdylib", "rlib"] # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -osmium-libs-lsp-handler = { path = "../../../../../libs/lsp-handler", version = "0.0.1" } -solidhunter-lib = { path = "../linter-lib", version = "0.0.2" } +osmium-libs-lsp-handler = { path = "../../../../../libs/lsp-handler", version = "0.0.2" } +solidhunter-lib = { path = "../linter-lib", version = "0.0.3" } js-sys = "0.3.64" \ No newline at end of file From fc4594836785bbc30aced1d669e3ff1831e01b28 Mon Sep 17 00:00:00 2001 From: 0xMemoryGrinder <35138272+0xMemoryGrinder@users.noreply.github.com> Date: Fri, 27 Oct 2023 00:43:41 -0400 Subject: [PATCH 265/325] fix(cd): changed workspaces to libraries for publish-libraries (was using extensions) --- .github/workflows/cd.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index 5fe66abf..94e16fa7 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -32,7 +32,7 @@ jobs: needs: setup strategy: matrix: - workspace: ${{ fromJson(needs.setup.outputs.extensions)}} + workspace: ${{ fromJson(needs.setup.outputs.libraries)}} steps: - uses: actions/checkout@v3 with: From 48b7ecc0c5a86f7862138e79f24fb63274eb4620 Mon Sep 17 00:00:00 2001 From: 0xMemoryGrinder <35138272+0xMemoryGrinder@users.noreply.github.com> Date: Fri, 27 Oct 2023 10:52:23 -0400 Subject: [PATCH 266/325] chore: deleted remove-me --- remove-me-83a0eff5a34f45459563.txt | 1 - 1 file changed, 1 deletion(-) delete mode 100644 remove-me-83a0eff5a34f45459563.txt diff --git a/remove-me-83a0eff5a34f45459563.txt b/remove-me-83a0eff5a34f45459563.txt deleted file mode 100644 index a67a9c8f..00000000 --- a/remove-me-83a0eff5a34f45459563.txt +++ /dev/null @@ -1 +0,0 @@ -83a0eff5a34f45459563 From 1eb1b227aef2192b149d41a89d4520419abcb832 Mon Sep 17 00:00:00 2001 From: 0xMemoryGrinder <35138272+0xMemoryGrinder@users.noreply.github.com> Date: Fri, 27 Oct 2023 11:06:29 -0400 Subject: [PATCH 267/325] fixcd): inverted workspaces list in CD pipeline --- .github/workflows/cd.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index 94e16fa7..97b24232 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -69,7 +69,7 @@ jobs: - publish-libraries strategy: matrix: - workspace: ${{ fromJson(needs.setup.outputs.libraries)}} + workspace: ${{ fromJson(needs.setup.outputs.extensions)}} steps: - uses: actions/checkout@v3 with: From 42933de3ae1939c060bd8d825963cc49f6780017 Mon Sep 17 00:00:00 2001 From: Astrodevs CI Date: Mon, 23 Oct 2023 22:39:41 +0000 Subject: [PATCH 268/325] chore: create branch feature/173-no-project-file-differenciation-staging --- remove-me-721d707bd04a482faf07.txt | 1 + 1 file changed, 1 insertion(+) create mode 100644 remove-me-721d707bd04a482faf07.txt diff --git a/remove-me-721d707bd04a482faf07.txt b/remove-me-721d707bd04a482faf07.txt new file mode 100644 index 00000000..a6d71134 --- /dev/null +++ b/remove-me-721d707bd04a482faf07.txt @@ -0,0 +1 @@ +721d707bd04a482faf07 From 4c80cfbcacf7caf4bd5e3a8d27c771b90543f60b Mon Sep 17 00:00:00 2001 From: 0xSwapFeeder Date: Wed, 25 Oct 2023 15:59:55 -0400 Subject: [PATCH 269/325] feat(solidity/linter): added a parse path method in linter + cleaning --- .../core/crates/linter-lib/src/linter.rs | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/toolchains/solidity/core/crates/linter-lib/src/linter.rs b/toolchains/solidity/core/crates/linter-lib/src/linter.rs index 8e18632a..6066cec1 100644 --- a/toolchains/solidity/core/crates/linter-lib/src/linter.rs +++ b/toolchains/solidity/core/crates/linter-lib/src/linter.rs @@ -7,6 +7,7 @@ use crate::types::*; use std::fs; use glob::glob; +use osmium_libs_solidity_ast_extractor::YulExpr::Path; #[derive(Debug, Clone)] pub struct SolidFile { @@ -91,21 +92,13 @@ impl SolidLinter { } } + pub fn parse_file(&mut self, filepath: String) -> LintResult { let content = fs::read_to_string(filepath.clone())?; - let res = osmium_libs_solidity_ast_extractor::extract::extract_ast_from_content(&content)?; - - self._add_file(filepath.as_str(), res, content.as_str()); - let mut res: Vec = Vec::new(); - - for rule in &self.rules { - let mut diags = rule.diagnose(&self.files[self.files.len() - 1], &self.files); - res.append(&mut diags); - } - Ok(res) + self.parse_content(filepath, content.as_str()) } - pub fn parse_content(&mut self, filepath: String, content: &str) -> LintResult { + fn parse_content(&mut self, filepath: String, content: &str) -> LintResult { let res = osmium_libs_solidity_ast_extractor::extract::extract_ast_from_content(content)?; self._add_file(filepath.as_str(), res, content); @@ -118,7 +111,7 @@ impl SolidLinter { Ok(res) } - pub fn parse_folder(&mut self, folder: String) -> Vec { + fn parse_folder(&mut self, folder: String) -> Vec { let mut result: Vec = Vec::new(); if let Ok(entries) = glob(&(folder + "/**/*.sol")) { for entry in entries.flatten() { @@ -127,6 +120,13 @@ impl SolidLinter { } result } + pub fn parse_path(&mut self, path: String) -> Vec { + return if Path::new(&path).is_file() { + vec!(self.parse_file(path)) + } else { + self.parse_folder(path) + } + } pub fn delete_file(&mut self, path: String) { loop { From b51351180773337b2475a39b59547bdbb2116671 Mon Sep 17 00:00:00 2001 From: 0xSwapFeeder Date: Mon, 30 Oct 2023 14:45:37 -0400 Subject: [PATCH 270/325] fix(solidity/linter): fixed path argument in cli and fixed bad import in linter-lib --- .../core/crates/linter-cli/src/main.rs | 73 +++++++------------ .../core/crates/linter-lib/src/linter.rs | 2 +- 2 files changed, 28 insertions(+), 47 deletions(-) diff --git a/toolchains/solidity/core/crates/linter-cli/src/main.rs b/toolchains/solidity/core/crates/linter-cli/src/main.rs index 2aba0631..2dbdef7f 100644 --- a/toolchains/solidity/core/crates/linter-cli/src/main.rs +++ b/toolchains/solidity/core/crates/linter-cli/src/main.rs @@ -13,15 +13,7 @@ struct Args { default_value = ".", help = "Specify project path" )] - project_path: Vec, - - #[arg( - short = 'f', - long = "file", - default_value = "", - help = "Specify a single file to lint" - )] - file_to_lint: String, + project_path: String, #[arg( short = 'e', @@ -63,28 +55,17 @@ struct Args { init: bool, } -fn lint_folder(args: Args) -> Result<(), SolidHunterError> { - let mut linter: SolidLinter = SolidLinter::new(); - linter.initialize_rules(&args.rules_file)?; - let mut result = Vec::new(); - for path in args.project_path { - result.append(&mut linter.parse_folder(path)); - } - for res in result { - print_result(res); - } - Ok(()) -} - -fn print_result(result: LintResult) { - match result { - Ok(diags) => { - for diag in diags { - println!("{}", &diag); +fn print_result(results: Vec) { + for result in results { + match result { + Ok(diags) => { + for diag in diags { + println!("{}", &diag); + } + } + Err(e) => { + println!("{}", e); } - } - Err(e) => { - println!("{}", e); } } } @@ -118,30 +99,30 @@ fn main() -> Result<(), SolidHunterError> { return Ok(()); } - if !args.to_json && args.file_to_lint.is_empty() { - lint_folder(args)?; - } else if !args.file_to_lint.is_empty() { + if !args.project_path.is_empty() { let mut linter: SolidLinter = SolidLinter::new(); linter.initialize_rules(&args.rules_file)?; - let result = linter.parse_file(args.file_to_lint); + let result = linter.parse_path(args.project_path); if !args.to_json { print_result(result); } else { - match result { - Ok(diags) => { - let json = serde_json::to_string_pretty(&diags); - match json { - Ok(j) => { - println!("{}", j); - } - Err(e) => { - println!("{}", e); + for res in result { + match res { + Ok(diags) => { + let json = serde_json::to_string_pretty(&diags); + match json { + Ok(j) => { + println!("{}", j); + } + Err(e) => { + println!("{}", e); + } } } - } - Err(e) => { - println!("{}", e); + Err(e) => { + println!("{}", e); + } } } } diff --git a/toolchains/solidity/core/crates/linter-lib/src/linter.rs b/toolchains/solidity/core/crates/linter-lib/src/linter.rs index 6066cec1..ccf3358b 100644 --- a/toolchains/solidity/core/crates/linter-lib/src/linter.rs +++ b/toolchains/solidity/core/crates/linter-lib/src/linter.rs @@ -7,7 +7,7 @@ use crate::types::*; use std::fs; use glob::glob; -use osmium_libs_solidity_ast_extractor::YulExpr::Path; +use std::path::Path; #[derive(Debug, Clone)] pub struct SolidFile { From 2fc6fe530324f8aca6b92ab3f951d623a228e906 Mon Sep 17 00:00:00 2001 From: 0xSwapFeeder Date: Mon, 30 Oct 2023 15:08:24 -0400 Subject: [PATCH 271/325] fix(solidity/linter): fixed lint errors --- toolchains/solidity/core/crates/linter-lib/src/linter.rs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/toolchains/solidity/core/crates/linter-lib/src/linter.rs b/toolchains/solidity/core/crates/linter-lib/src/linter.rs index ccf3358b..79af540b 100644 --- a/toolchains/solidity/core/crates/linter-lib/src/linter.rs +++ b/toolchains/solidity/core/crates/linter-lib/src/linter.rs @@ -92,13 +92,12 @@ impl SolidLinter { } } - pub fn parse_file(&mut self, filepath: String) -> LintResult { let content = fs::read_to_string(filepath.clone())?; self.parse_content(filepath, content.as_str()) } - fn parse_content(&mut self, filepath: String, content: &str) -> LintResult { + pub fn parse_content(&mut self, filepath: String, content: &str) -> LintResult { let res = osmium_libs_solidity_ast_extractor::extract::extract_ast_from_content(content)?; self._add_file(filepath.as_str(), res, content); @@ -111,7 +110,7 @@ impl SolidLinter { Ok(res) } - fn parse_folder(&mut self, folder: String) -> Vec { + pub fn parse_folder(&mut self, folder: String) -> Vec { let mut result: Vec = Vec::new(); if let Ok(entries) = glob(&(folder + "/**/*.sol")) { for entry in entries.flatten() { @@ -121,8 +120,8 @@ impl SolidLinter { result } pub fn parse_path(&mut self, path: String) -> Vec { - return if Path::new(&path).is_file() { - vec!(self.parse_file(path)) + if Path::new(&path).is_file() { + vec![self.parse_file(path)] } else { self.parse_folder(path) } From 2537c9e45c237b1f551f831e98dc3d68761555d2 Mon Sep 17 00:00:00 2001 From: 0xSwapFeeder Date: Thu, 2 Nov 2023 17:29:56 -0400 Subject: [PATCH 272/325] feat(solidity/linter/cli): updated version as breaking change and deleted remove-me --- remove-me-721d707bd04a482faf07.txt | 1 - toolchains/solidity/core/crates/linter-cli/Cargo.toml | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) delete mode 100644 remove-me-721d707bd04a482faf07.txt diff --git a/remove-me-721d707bd04a482faf07.txt b/remove-me-721d707bd04a482faf07.txt deleted file mode 100644 index a6d71134..00000000 --- a/remove-me-721d707bd04a482faf07.txt +++ /dev/null @@ -1 +0,0 @@ -721d707bd04a482faf07 diff --git a/toolchains/solidity/core/crates/linter-cli/Cargo.toml b/toolchains/solidity/core/crates/linter-cli/Cargo.toml index d929a24d..ae6e7b2b 100644 --- a/toolchains/solidity/core/crates/linter-cli/Cargo.toml +++ b/toolchains/solidity/core/crates/linter-cli/Cargo.toml @@ -2,7 +2,7 @@ name = "solidhunter" description = "Fast solidity linter cli" repository = "https://github.com/astrodevs-labs/osmium" -version = "0.0.3" +version = "0.1.0" edition = "2021" license = "GPL-3.0-or-later" From 4df7fbc64320cf0f65f97260043faf55d528fbea Mon Sep 17 00:00:00 2001 From: 0xSwapFeeder Date: Thu, 2 Nov 2023 18:15:14 -0400 Subject: [PATCH 273/325] fix(solidty/linter/cli): fixed path argument cli --- .../solidity/core/crates/linter-cli/Cargo.toml | 2 +- .../core/crates/linter-cli/src/main.rs | 18 ++++++++---------- 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/toolchains/solidity/core/crates/linter-cli/Cargo.toml b/toolchains/solidity/core/crates/linter-cli/Cargo.toml index ae6e7b2b..37c03646 100644 --- a/toolchains/solidity/core/crates/linter-cli/Cargo.toml +++ b/toolchains/solidity/core/crates/linter-cli/Cargo.toml @@ -5,7 +5,7 @@ repository = "https://github.com/astrodevs-labs/osmium" version = "0.1.0" edition = "2021" license = "GPL-3.0-or-later" - +authors = ["AstroDevs-Labs"] # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] diff --git a/toolchains/solidity/core/crates/linter-cli/src/main.rs b/toolchains/solidity/core/crates/linter-cli/src/main.rs index 2dbdef7f..c713ec22 100644 --- a/toolchains/solidity/core/crates/linter-cli/src/main.rs +++ b/toolchains/solidity/core/crates/linter-cli/src/main.rs @@ -1,4 +1,4 @@ -use clap::Parser; +use clap::{arg, Parser}; use solidhunter_lib::errors::SolidHunterError; use solidhunter_lib::linter::SolidLinter; use solidhunter_lib::rules::rule_impl::create_rules_file; @@ -8,13 +8,11 @@ use solidhunter_lib::types::LintResult; #[command(author, version, about, long_about = None)] struct Args { #[arg( - short = 'p', - long = "path", + required = false, default_value = ".", - help = "Specify project path" + help = "Path to the project to lint" )] - project_path: String, - + path: String, #[arg( short = 'e', long = "exclude", @@ -32,7 +30,7 @@ struct Args { #[arg( short = 'j', - long = "json_output", + long = "json", default_value = "false", help = "Outputs a json format instead" )] @@ -86,7 +84,7 @@ fn main() -> Result<(), SolidHunterError> { if args.verbose { println!("Verbose output enabled"); - println!("Project path: {:?}", args.project_path); + println!("Project path: {:?}", args.path); println!("Exclude path: {:?}", args.ignore_path); println!("Using rules file: {}", args.rules_file); println!("Verbose output: {}", args.verbose); @@ -99,11 +97,11 @@ fn main() -> Result<(), SolidHunterError> { return Ok(()); } - if !args.project_path.is_empty() { + if args.path.is_empty() { let mut linter: SolidLinter = SolidLinter::new(); linter.initialize_rules(&args.rules_file)?; - let result = linter.parse_path(args.project_path); + let result = linter.parse_path(args.path); if !args.to_json { print_result(result); } else { From 7a497c4390a31e7619e320a418c7379ab2a6e68a Mon Sep 17 00:00:00 2001 From: 0xSwapFeeder Date: Thu, 2 Nov 2023 18:48:29 -0400 Subject: [PATCH 274/325] feat(solidity/linter/lib): updated version --- toolchains/solidity/core/crates/linter-cli/Cargo.toml | 2 +- toolchains/solidity/core/crates/linter-lib/Cargo.toml | 2 +- toolchains/solidity/core/crates/linter-server/Cargo.toml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/toolchains/solidity/core/crates/linter-cli/Cargo.toml b/toolchains/solidity/core/crates/linter-cli/Cargo.toml index 37c03646..99a84c6f 100644 --- a/toolchains/solidity/core/crates/linter-cli/Cargo.toml +++ b/toolchains/solidity/core/crates/linter-cli/Cargo.toml @@ -9,7 +9,7 @@ authors = ["AstroDevs-Labs"] # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -solidhunter-lib = { path = "../linter-lib", version = "0.0.3" } +solidhunter-lib = { path = "../linter-lib", version = "0.0.4" } clap = { version = "4.0.29", features = ["derive"] } colored = "2" serde = { version = "1.0.149", features = ["derive"] } diff --git a/toolchains/solidity/core/crates/linter-lib/Cargo.toml b/toolchains/solidity/core/crates/linter-lib/Cargo.toml index 86b68ed2..ab114db9 100644 --- a/toolchains/solidity/core/crates/linter-lib/Cargo.toml +++ b/toolchains/solidity/core/crates/linter-lib/Cargo.toml @@ -2,7 +2,7 @@ name = "solidhunter-lib" description = "Solidhunter/Osmium solidity linter library" repository = "https://github.com/astrodevs-labs/osmium" -version = "0.0.3" +version = "0.0.4" edition = "2021" authors = ["Astrodevs Labs"] license = "GPL-3.0-or-later" diff --git a/toolchains/solidity/core/crates/linter-server/Cargo.toml b/toolchains/solidity/core/crates/linter-server/Cargo.toml index 5939bc56..d45dd078 100644 --- a/toolchains/solidity/core/crates/linter-server/Cargo.toml +++ b/toolchains/solidity/core/crates/linter-server/Cargo.toml @@ -11,5 +11,5 @@ crate-type = ["cdylib", "rlib"] [dependencies] osmium-libs-lsp-handler = { path = "../../../../../libs/lsp-handler", version = "0.0.2" } -solidhunter-lib = { path = "../linter-lib", version = "0.0.3" } +solidhunter-lib = { path = "../linter-lib", version = "0.0.4" } js-sys = "0.3.64" \ No newline at end of file From 6b7baf7a067c48b6f2a1081c851c38f20af43db6 Mon Sep 17 00:00:00 2001 From: Astrodevs CI Date: Wed, 25 Oct 2023 19:32:21 +0000 Subject: [PATCH 275/325] chore: create branch chore/183-vscode-linter-analyze-all-files-from-the-project-staging --- remove-me-759554465d5041259aca.txt | 1 + 1 file changed, 1 insertion(+) create mode 100644 remove-me-759554465d5041259aca.txt diff --git a/remove-me-759554465d5041259aca.txt b/remove-me-759554465d5041259aca.txt new file mode 100644 index 00000000..5b8a7994 --- /dev/null +++ b/remove-me-759554465d5041259aca.txt @@ -0,0 +1 @@ +759554465d5041259aca From 1cd1a65c008e69aba5cfaedd5ff90251103a585b Mon Sep 17 00:00:00 2001 From: 0xtekgrinder <0xtekgrinder@protonmail.com> Date: Fri, 3 Nov 2023 17:24:21 -0400 Subject: [PATCH 276/325] feat(solidity/linter): send a didOpen when initializing --- remove-me-759554465d5041259aca.txt | 1 - toolchains/solidity/core/Cargo.lock | 4 +- .../core/crates/linter-cli/src/main.rs | 2 +- .../core/crates/linter-lib/src/linter.rs | 18 ++++---- .../core/crates/linter-server/src/lib.rs | 41 ++++++++++++++----- toolchains/solidity/extension/src/client.ts | 15 ++++++- 6 files changed, 56 insertions(+), 25 deletions(-) delete mode 100644 remove-me-759554465d5041259aca.txt diff --git a/remove-me-759554465d5041259aca.txt b/remove-me-759554465d5041259aca.txt deleted file mode 100644 index 5b8a7994..00000000 --- a/remove-me-759554465d5041259aca.txt +++ /dev/null @@ -1 +0,0 @@ -759554465d5041259aca diff --git a/toolchains/solidity/core/Cargo.lock b/toolchains/solidity/core/Cargo.lock index c8cf6e08..06786689 100644 --- a/toolchains/solidity/core/Cargo.lock +++ b/toolchains/solidity/core/Cargo.lock @@ -451,7 +451,7 @@ dependencies = [ [[package]] name = "solidhunter" -version = "0.0.3" +version = "0.1.0" dependencies = [ "clap", "colored", @@ -462,7 +462,7 @@ dependencies = [ [[package]] name = "solidhunter-lib" -version = "0.0.3" +version = "0.0.4" dependencies = [ "anyhow", "clap", diff --git a/toolchains/solidity/core/crates/linter-cli/src/main.rs b/toolchains/solidity/core/crates/linter-cli/src/main.rs index c713ec22..b3d4e38b 100644 --- a/toolchains/solidity/core/crates/linter-cli/src/main.rs +++ b/toolchains/solidity/core/crates/linter-cli/src/main.rs @@ -101,7 +101,7 @@ fn main() -> Result<(), SolidHunterError> { let mut linter: SolidLinter = SolidLinter::new(); linter.initialize_rules(&args.rules_file)?; - let result = linter.parse_path(args.path); + let result = linter.parse_path(&args.path); if !args.to_json { print_result(result); } else { diff --git a/toolchains/solidity/core/crates/linter-lib/src/linter.rs b/toolchains/solidity/core/crates/linter-lib/src/linter.rs index 79af540b..0f86237f 100644 --- a/toolchains/solidity/core/crates/linter-lib/src/linter.rs +++ b/toolchains/solidity/core/crates/linter-lib/src/linter.rs @@ -92,15 +92,15 @@ impl SolidLinter { } } - pub fn parse_file(&mut self, filepath: String) -> LintResult { - let content = fs::read_to_string(filepath.clone())?; + pub fn parse_file(&mut self, filepath: &str) -> LintResult { + let content = fs::read_to_string(&filepath)?; self.parse_content(filepath, content.as_str()) } - pub fn parse_content(&mut self, filepath: String, content: &str) -> LintResult { + pub fn parse_content(&mut self, filepath: &str, content: &str) -> LintResult { let res = osmium_libs_solidity_ast_extractor::extract::extract_ast_from_content(content)?; - self._add_file(filepath.as_str(), res, content); + self._add_file(filepath, res, content); let mut res: Vec = Vec::new(); for rule in &self.rules { @@ -110,16 +110,16 @@ impl SolidLinter { Ok(res) } - pub fn parse_folder(&mut self, folder: String) -> Vec { + pub fn parse_folder(&mut self, folder: &str) -> Vec { let mut result: Vec = Vec::new(); - if let Ok(entries) = glob(&(folder + "/**/*.sol")) { + if let Ok(entries) = glob(&(folder.to_owned() + "/**/*.sol")) { for entry in entries.flatten() { - result.push(self.parse_file(entry.into_os_string().into_string().unwrap())); + result.push(self.parse_file(&entry.into_os_string().into_string().unwrap())); } } result } - pub fn parse_path(&mut self, path: String) -> Vec { + pub fn parse_path(&mut self, path: &str) -> Vec { if Path::new(&path).is_file() { vec![self.parse_file(path)] } else { @@ -127,7 +127,7 @@ impl SolidLinter { } } - pub fn delete_file(&mut self, path: String) { + pub fn delete_file(&mut self, path: &str) { loop { let idx = self.files.iter().position(|x| x.path == path); match idx { diff --git a/toolchains/solidity/core/crates/linter-server/src/lib.rs b/toolchains/solidity/core/crates/linter-server/src/lib.rs index 3aa32e27..8cfe447c 100644 --- a/toolchains/solidity/core/crates/linter-server/src/lib.rs +++ b/toolchains/solidity/core/crates/linter-server/src/lib.rs @@ -2,9 +2,10 @@ use std::cell::RefCell; use osmium_libs_lsp_handler::{ lsp_types::{ - Diagnostic, DiagnosticSeverity, DidChangeTextDocumentParams, DidOpenTextDocumentParams, - InitializeParams, InitializeResult, InitializedParams, MessageType, Position, Range, - ServerCapabilities, TextDocumentSyncCapability, TextDocumentSyncKind, Url, + Diagnostic, DiagnosticSeverity, DidChangeTextDocumentParams, DidChangeWatchedFilesParams, + DidOpenTextDocumentParams, InitializeParams, InitializeResult, InitializedParams, + MessageType, Position, Range, ServerCapabilities, TextDocumentSyncCapability, + TextDocumentSyncKind, Url, }, Connection, Handler, Result, }; @@ -43,9 +44,12 @@ impl Handler for Backend { let res = linter.initialize_rules(&self.config_file_path); if let Err(e) = res { eprintln!("Error initializing rules: {:?}", e); + self.linter + .borrow_mut() + .replace(SolidLinter::new_fileless()); return; } - self.linter.borrow_mut().replace(linter); + self.linter.replace(Some(linter)); } else { self.linter .borrow_mut() @@ -63,8 +67,10 @@ impl Handler for Backend { } fn did_open(&self, params: DidOpenTextDocumentParams) { - self.connection - .log_message(MessageType::INFO, "file opened!"); + self.connection.log_message( + MessageType::INFO, + format!("file opened!: {:}", params.text_document.uri), + ); let filepath = filepath_from_uri(¶ms.text_document.uri); let mut linter = self.linter.borrow_mut(); @@ -75,7 +81,7 @@ impl Handler for Backend { return; } }; - let diags_res = linter.parse_content(filepath, ¶ms.text_document.text); + let diags_res = linter.parse_content(&filepath, ¶ms.text_document.text); if let Ok(diags) = diags_res { let diags = diags @@ -92,8 +98,10 @@ impl Handler for Backend { } fn did_change(&self, params: DidChangeTextDocumentParams) { - self.connection - .log_message(MessageType::INFO, "file changed!"); + self.connection.log_message( + MessageType::INFO, + format!("file changed!: {:}", params.text_document.uri), + ); let filepath = filepath_from_uri(¶ms.text_document.uri); let mut linter = self.linter.borrow_mut(); @@ -104,7 +112,7 @@ impl Handler for Backend { return; } }; - let diags_res = linter.parse_content(filepath, ¶ms.content_changes[0].text); + let diags_res = linter.parse_content(&filepath, ¶ms.content_changes[0].text); if let Ok(diags) = diags_res { let diags = diags @@ -119,6 +127,19 @@ impl Handler for Backend { .log_message(MessageType::ERROR, e.to_string()); } } + + fn did_change_watched_files(&self, _: DidChangeWatchedFilesParams) { + self.connection + .log_message(MessageType::INFO, "configuration file changed!"); + + if std::path::Path::new(&self.config_file_path).is_file() { + let mut linter = SolidLinter::new(); + let res = linter.initialize_rules(&self.config_file_path); + if let Ok(_) = res { + self.linter.replace(Some(linter)); + } + } + } } pub fn filepath_from_uri(uri: &Url) -> String { diff --git a/toolchains/solidity/extension/src/client.ts b/toolchains/solidity/extension/src/client.ts index 8650ba50..2c44efdd 100644 --- a/toolchains/solidity/extension/src/client.ts +++ b/toolchains/solidity/extension/src/client.ts @@ -3,6 +3,7 @@ * Licensed under the MIT License. See License.txt in the project root for license information. * ------------------------------------------------------------------------------------------ */ +import { glob } from 'glob'; import * as path from 'path'; import { workspace, ExtensionContext } from 'vscode'; @@ -15,7 +16,7 @@ import { let client: LanguageClient; -export function activate(context: ExtensionContext) { +export async function activate(context: ExtensionContext) { // The server is implemented in node const serverModule = context.asAbsolutePath( path.join('dist', 'server.js') @@ -37,7 +38,7 @@ export function activate(context: ExtensionContext) { documentSelector: [{ scheme: 'file', language: 'solidity' }], synchronize: { // Notify the server about file changes to '.clientrc files contained in the workspace - fileEvents: workspace.createFileSystemWatcher('**/.clientrc') + fileEvents: workspace.createFileSystemWatcher('**/.solidhunter.json') } }; @@ -51,6 +52,16 @@ export function activate(context: ExtensionContext) { // Start the client. This will also launch the server client.start(); + + const folders = workspace.workspaceFolders; + if (folders) { + const folder = folders[0]; + const files = await workspace.findFiles('**/*.sol', `${folder.uri.fsPath}/**`); + files.forEach(file => { + workspace.openTextDocument(file); + }); + } + } export function deactivate(): Thenable | undefined { From 8f1163fb162b473f1b6864da5832044c92c394f3 Mon Sep 17 00:00:00 2001 From: 0xtekgrinder <0xtekgrinder@protonmail.com> Date: Fri, 3 Nov 2023 17:33:52 -0400 Subject: [PATCH 277/325] fix(solidity/linter): linter-lib now ocmpiles --- toolchains/solidity/core/crates/linter-lib/tests/linter.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/toolchains/solidity/core/crates/linter-lib/tests/linter.rs b/toolchains/solidity/core/crates/linter-lib/tests/linter.rs index e93282d1..0025ad8c 100644 --- a/toolchains/solidity/core/crates/linter-lib/tests/linter.rs +++ b/toolchains/solidity/core/crates/linter-lib/tests/linter.rs @@ -53,7 +53,7 @@ fn test_linter(config: &str, source: &str, expected_findings: &Vec) { let mut linter: SolidLinter = SolidLinter::new(); let _ = linter.initialize_rules(&String::from(config)); - let result = linter.parse_file(String::from(source)); + let result = linter.parse_file(source); let mut found_findings: Vec<&Finding> = Vec::new(); let mut not_found_findings: Vec<&Finding> = Vec::new(); let mut not_needed_findings: Vec<&LintDiag> = Vec::new(); From d4daad0977da36c7db1ebd96802aaa6015cec5c5 Mon Sep 17 00:00:00 2001 From: 0xtekgrinder <0xtekgrinder@protonmail.com> Date: Fri, 3 Nov 2023 17:36:48 -0400 Subject: [PATCH 278/325] style(solidity/linter-lib): lint linter.rs --- toolchains/solidity/core/crates/linter-lib/src/linter.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/toolchains/solidity/core/crates/linter-lib/src/linter.rs b/toolchains/solidity/core/crates/linter-lib/src/linter.rs index 0f86237f..a328dd57 100644 --- a/toolchains/solidity/core/crates/linter-lib/src/linter.rs +++ b/toolchains/solidity/core/crates/linter-lib/src/linter.rs @@ -93,7 +93,7 @@ impl SolidLinter { } pub fn parse_file(&mut self, filepath: &str) -> LintResult { - let content = fs::read_to_string(&filepath)?; + let content = fs::read_to_string(filepath)?; self.parse_content(filepath, content.as_str()) } From d6e5af73da5b055d8f436702b2c05736b300f6a7 Mon Sep 17 00:00:00 2001 From: 0xtekgrinder <0xtekgrinder@protonmail.com> Date: Fri, 3 Nov 2023 17:46:32 -0400 Subject: [PATCH 279/325] style(solidity/linter): lint lib.rs --- toolchains/solidity/core/crates/linter-server/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/toolchains/solidity/core/crates/linter-server/src/lib.rs b/toolchains/solidity/core/crates/linter-server/src/lib.rs index 8cfe447c..356f7d20 100644 --- a/toolchains/solidity/core/crates/linter-server/src/lib.rs +++ b/toolchains/solidity/core/crates/linter-server/src/lib.rs @@ -135,7 +135,7 @@ impl Handler for Backend { if std::path::Path::new(&self.config_file_path).is_file() { let mut linter = SolidLinter::new(); let res = linter.initialize_rules(&self.config_file_path); - if let Ok(_) = res { + if res.is_ok() { self.linter.replace(Some(linter)); } } From 0ae885ef54cf798654c3af0bdc4d0098dbe79c58 Mon Sep 17 00:00:00 2001 From: 0xMemoryGrinder <35138272+0xMemoryGrinder@users.noreply.github.com> Date: Fri, 3 Nov 2023 22:51:48 -0400 Subject: [PATCH 280/325] fix(cd): the publish matrix was skipped if there was no library to publish --- .github/workflows/cd.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index 97b24232..7ff642a3 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -28,9 +28,11 @@ jobs: since: ${{ needs.find-last-commit.outputs.commit }} publish-libraries: + if : ${{ needs.setup.outputs.libraries != '[]' }} runs-on: ubuntu-latest needs: setup strategy: + fail-fast: false matrix: workspace: ${{ fromJson(needs.setup.outputs.libraries)}} steps: @@ -63,11 +65,13 @@ jobs: CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} publish: + if : ${{ needs.setup.outputs.extensions != '[]' }} runs-on: ubuntu-latest needs: - setup - publish-libraries strategy: + fail-fast: false matrix: workspace: ${{ fromJson(needs.setup.outputs.extensions)}} steps: From 393b745d9b9dc9193d3426ef488cb37ba0810809 Mon Sep 17 00:00:00 2001 From: Astrodevs CI Date: Sat, 4 Nov 2023 02:53:29 +0000 Subject: [PATCH 281/325] chore: create branch chore/172-remove-file-content-in-solidity-linter-diagnostics-staging --- remove-me-3ce10a5cfd484331b1db.txt | 1 + 1 file changed, 1 insertion(+) create mode 100644 remove-me-3ce10a5cfd484331b1db.txt diff --git a/remove-me-3ce10a5cfd484331b1db.txt b/remove-me-3ce10a5cfd484331b1db.txt new file mode 100644 index 00000000..31f505a8 --- /dev/null +++ b/remove-me-3ce10a5cfd484331b1db.txt @@ -0,0 +1 @@ +3ce10a5cfd484331b1db From d86f414ff77624cf3c063b3ef36c783cc3c9e2c1 Mon Sep 17 00:00:00 2001 From: 0xMemoryGrinder <35138272+0xMemoryGrinder@users.noreply.github.com> Date: Sat, 4 Nov 2023 01:03:24 -0400 Subject: [PATCH 282/325] fix(solidity/linter/cli): inverted condition made the linter never run --- toolchains/solidity/core/crates/linter-cli/src/main.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/toolchains/solidity/core/crates/linter-cli/src/main.rs b/toolchains/solidity/core/crates/linter-cli/src/main.rs index b3d4e38b..c8123dbf 100644 --- a/toolchains/solidity/core/crates/linter-cli/src/main.rs +++ b/toolchains/solidity/core/crates/linter-cli/src/main.rs @@ -97,7 +97,7 @@ fn main() -> Result<(), SolidHunterError> { return Ok(()); } - if args.path.is_empty() { + if !args.path.is_empty() { let mut linter: SolidLinter = SolidLinter::new(); linter.initialize_rules(&args.rules_file)?; From 2e29f89415e86ec45ff963f0bac6ee69bac7456e Mon Sep 17 00:00:00 2001 From: 0xMemoryGrinder <35138272+0xMemoryGrinder@users.noreply.github.com> Date: Sat, 4 Nov 2023 01:04:21 -0400 Subject: [PATCH 283/325] perf(solidity/linter): avoid to duplicate file content more than necessary --- toolchains/solidity/core/Cargo.lock | 76 +++--- .../core/crates/linter-cli/Cargo.toml | 4 +- .../core/crates/linter-cli/src/main.rs | 4 +- .../core/crates/linter-lib/Cargo.toml | 2 +- .../core/crates/linter-lib/src/linter.rs | 2 +- .../src/rules/best_practises/custom_errors.rs | 2 +- .../rules/best_practises/explicit_types.rs | 2 +- .../best_practises/function_max_lines.rs | 2 +- .../rules/best_practises/max_line_length.rs | 2 +- .../rules/best_practises/max_states_count.rs | 2 +- .../src/rules/best_practises/no_console.rs | 2 +- .../rules/best_practises/no_empty_block.rs | 2 +- .../rules/best_practises/no_global_import.rs | 2 +- .../best_practises/one_contract_per_file.rs | 2 +- .../rules/best_practises/payable_fallback.rs | 2 +- .../src/rules/best_practises/reason_string.rs | 2 +- .../src/rules/naming/const_name_snakecase.rs | 2 +- .../rules/naming/contract_name_camelcase.rs | 2 +- .../src/rules/naming/event_name_camelcase.rs | 2 +- .../rules/naming/foundry_test_functions.rs | 2 +- .../src/rules/naming/func_name_mixedcase.rs | 2 +- .../rules/naming/func_param_name_mixedcase.rs | 2 +- .../rules/naming/modifier_name_mixedcase.rs | 2 +- .../rules/naming/named_parameters_mapping.rs | 2 +- .../naming/private_vars_leading_underscore.rs | 2 +- .../src/rules/naming/use_forbidden_name.rs | 2 +- .../src/rules/naming/var_name_mixedcase.rs | 2 +- .../src/rules/order/import_on_top.rs | 2 +- .../linter-lib/src/rules/order/ordering.rs | 2 +- .../rules/order/visibility_modifier_order.rs | 2 +- .../src/rules/security/avoid_tx_origin.rs | 2 +- .../src/rules/security/func_visibility.rs | 2 +- .../src/rules/security/no_inline_assembly.rs | 2 +- .../src/rules/security/not_rely_on_time.rs | 2 +- .../src/rules/security/state_visibility.rs | 2 +- .../core/crates/linter-lib/src/types.rs | 218 +++--------------- .../crates/linter-lib/src/types/file_diags.rs | 100 ++++++++ .../crates/linter-lib/src/types/lint_diag.rs | 50 ++++ .../crates/linter-lib/src/types/position.rs | 13 ++ .../core/crates/linter-lib/src/types/range.rs | 29 +++ .../crates/linter-lib/src/types/severity.rs | 27 +++ .../core/crates/linter-lib/tests/linter.rs | 6 +- .../core/crates/linter-server/Cargo.toml | 2 +- .../core/crates/linter-server/src/lib.rs | 4 +- 44 files changed, 330 insertions(+), 267 deletions(-) create mode 100644 toolchains/solidity/core/crates/linter-lib/src/types/file_diags.rs create mode 100644 toolchains/solidity/core/crates/linter-lib/src/types/lint_diag.rs create mode 100644 toolchains/solidity/core/crates/linter-lib/src/types/position.rs create mode 100644 toolchains/solidity/core/crates/linter-lib/src/types/range.rs create mode 100644 toolchains/solidity/core/crates/linter-lib/src/types/severity.rs diff --git a/toolchains/solidity/core/Cargo.lock b/toolchains/solidity/core/Cargo.lock index 06786689..fc5dc822 100644 --- a/toolchains/solidity/core/Cargo.lock +++ b/toolchains/solidity/core/Cargo.lock @@ -91,9 +91,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "clap" -version = "4.4.6" +version = "4.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d04704f56c2cde07f43e8e2c154b43f216dc5c92fc98ada720177362f953b956" +checksum = "ac495e00dcec98c83465d5ad66c5c4fabd652fd6686e7c6269b117e729a6f17b" dependencies = [ "clap_builder", "clap_derive", @@ -101,9 +101,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.4.6" +version = "4.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e231faeaca65ebd1ea3c737966bf858971cd38c3849107aa3ea7de90a804e45" +checksum = "c77ed9a32a62e6ca27175d00d29d05ca32e396ea1eb5fb01d8256b669cec7663" dependencies = [ "anstream", "anstyle", @@ -113,9 +113,9 @@ dependencies = [ [[package]] name = "clap_derive" -version = "4.4.2" +version = "4.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0862016ff20d69b84ef8247369fabf5c008a7417002411897d40ee1f4532b873" +checksum = "cf9804afaaf59a91e75b022a30fb7229a7901f60c755489cc61c9b423b836442" dependencies = [ "heck", "proc-macro2", @@ -125,9 +125,9 @@ dependencies = [ [[package]] name = "clap_lex" -version = "0.5.1" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd7cc57abe963c6d3b9d8be5b06ba7c8957a930305ca90304f24ef040aa6f961" +checksum = "702fc72eb24e5a1e48ce58027a675bc24edd52096d5397d4aea7c6dd9eca0bd1" [[package]] name = "colorchoice" @@ -222,9 +222,9 @@ checksum = "af150ab688ff2122fcef229be89cb50dd66af9e01a4ff320cc137eecc9bacc38" [[package]] name = "js-sys" -version = "0.3.64" +version = "0.3.65" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c5f195fe497f702db0f318b07fdd68edb16955aed830df8363d837542f8f935a" +checksum = "54c0c35952f67de54bb584e9fd912b3023117cbafc0a77d8f3dee1fb5f572fe8" dependencies = [ "wasm-bindgen", ] @@ -379,9 +379,9 @@ checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" [[package]] name = "rustix" -version = "0.38.20" +version = "0.38.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67ce50cb2e16c2903e30d1cbccfd8387a74b9d4c938b6a4c5ec6cc7556f7a8a0" +checksum = "2b426b0506e5d50a7d8dafcf2e81471400deb602392c7dd110815afb4eaf02a3" dependencies = [ "bitflags 2.4.1", "errno", @@ -398,18 +398,18 @@ checksum = "1ad4cc8da4ef723ed60bced201181d83791ad433213d8c24efffda1eec85d741" [[package]] name = "serde" -version = "1.0.189" +version = "1.0.190" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e422a44e74ad4001bdc8eede9a4570ab52f71190e9c076d14369f38b9200537" +checksum = "91d3c334ca1ee894a2c6f6ad698fe8c435b76d504b13d436f0685d648d6d96f7" dependencies = [ "serde_derive", ] [[package]] name = "serde-wasm-bindgen" -version = "0.6.0" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30c9933e5689bd420dc6c87b7a1835701810cbc10cd86a26e4da45b73e6b1d78" +checksum = "17ba92964781421b6cef36bf0d7da26d201e96d84e1b10e7ae6ed416e516906d" dependencies = [ "js-sys", "serde", @@ -418,9 +418,9 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.189" +version = "1.0.190" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e48d1f918009ce3145511378cf68d613e3b3d9137d67272562080d68a2b32d5" +checksum = "67c5609f394e5c2bd7fc51efda478004ea80ef42fee983d5c67a65e34f32c0e3" dependencies = [ "proc-macro2", "quote", @@ -429,9 +429,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.107" +version = "1.0.108" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b420ce6e3d8bd882e9b243c6eed35dbc9a6110c9769e74b584e0d68d1f20c65" +checksum = "3d1c7e3eac408d115102c4c24ad393e0821bb3a5df4d506a80f85f7a742a526b" dependencies = [ "itoa", "ryu", @@ -440,9 +440,9 @@ dependencies = [ [[package]] name = "serde_repr" -version = "0.1.16" +version = "0.1.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8725e1dfadb3a50f7e5ce0b1a540466f6ed3fe7a0fca2ac2b8b831d31316bd00" +checksum = "3081f5ffbb02284dda55132aa26daecedd7372a42417bbbab6f14ab7d6bb9145" dependencies = [ "proc-macro2", "quote", @@ -451,7 +451,7 @@ dependencies = [ [[package]] name = "solidhunter" -version = "0.1.0" +version = "0.1.1" dependencies = [ "clap", "colored", @@ -462,7 +462,7 @@ dependencies = [ [[package]] name = "solidhunter-lib" -version = "0.0.4" +version = "0.1.0" dependencies = [ "anyhow", "clap", @@ -611,9 +611,9 @@ checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a" [[package]] name = "wasm-bindgen" -version = "0.2.87" +version = "0.2.88" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7706a72ab36d8cb1f80ffbf0e071533974a60d0a308d01a5d0375bf60499a342" +checksum = "7daec296f25a1bae309c0cd5c29c4b260e510e6d813c286b19eaadf409d40fce" dependencies = [ "cfg-if", "wasm-bindgen-macro", @@ -621,9 +621,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.87" +version = "0.2.88" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ef2b6d3c510e9625e5fe6f509ab07d66a760f0885d858736483c32ed7809abd" +checksum = "e397f4664c0e4e428e8313a469aaa58310d302159845980fd23b0f22a847f217" dependencies = [ "bumpalo", "log", @@ -636,9 +636,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-futures" -version = "0.4.37" +version = "0.4.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c02dbc21516f9f1f04f187958890d7e6026df8d16540b7ad9492bc34a67cea03" +checksum = "9afec9963e3d0994cac82455b2b3502b81a7f40f9a0d32181f7528d9f4b43e02" dependencies = [ "cfg-if", "js-sys", @@ -648,9 +648,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.87" +version = "0.2.88" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dee495e55982a3bd48105a7b947fd2a9b4a8ae3010041b9e0faab3f9cd028f1d" +checksum = "5961017b3b08ad5f3fe39f1e79877f8ee7c23c5e5fd5eb80de95abc41f1f16b2" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -658,9 +658,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.87" +version = "0.2.88" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54681b18a46765f095758388f2d0cf16eb8d4169b639ab575a8f5693af210c7b" +checksum = "c5353b8dab669f5e10f5bd76df26a9360c748f054f862ff5f3f8aae0c7fb3907" dependencies = [ "proc-macro2", "quote", @@ -671,15 +671,15 @@ dependencies = [ [[package]] name = "wasm-bindgen-shared" -version = "0.2.87" +version = "0.2.88" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca6ad05a4870b2bf5fe995117d3728437bd27d7cd5f06f13c17443ef369775a1" +checksum = "0d046c5d029ba91a1ed14da14dca44b68bf2f124cfbaf741c54151fdb3e0750b" [[package]] name = "web-sys" -version = "0.3.64" +version = "0.3.65" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b85cbef8c220a6abc02aefd892dfc0fc23afb1c6a426316ec33253a3877249b" +checksum = "5db499c5f66323272151db0e666cd34f78617522fb0c1604d31a27c50c206a85" dependencies = [ "js-sys", "wasm-bindgen", diff --git a/toolchains/solidity/core/crates/linter-cli/Cargo.toml b/toolchains/solidity/core/crates/linter-cli/Cargo.toml index 99a84c6f..f9d3501a 100644 --- a/toolchains/solidity/core/crates/linter-cli/Cargo.toml +++ b/toolchains/solidity/core/crates/linter-cli/Cargo.toml @@ -2,14 +2,14 @@ name = "solidhunter" description = "Fast solidity linter cli" repository = "https://github.com/astrodevs-labs/osmium" -version = "0.1.0" +version = "0.1.1" edition = "2021" license = "GPL-3.0-or-later" authors = ["AstroDevs-Labs"] # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -solidhunter-lib = { path = "../linter-lib", version = "0.0.4" } +solidhunter-lib = { path = "../linter-lib", version = "0.1.0" } clap = { version = "4.0.29", features = ["derive"] } colored = "2" serde = { version = "1.0.149", features = ["derive"] } diff --git a/toolchains/solidity/core/crates/linter-cli/src/main.rs b/toolchains/solidity/core/crates/linter-cli/src/main.rs index c8123dbf..92df48c8 100644 --- a/toolchains/solidity/core/crates/linter-cli/src/main.rs +++ b/toolchains/solidity/core/crates/linter-cli/src/main.rs @@ -57,9 +57,7 @@ fn print_result(results: Vec) { for result in results { match result { Ok(diags) => { - for diag in diags { - println!("{}", &diag); - } + println!("{}", &diags); } Err(e) => { println!("{}", e); diff --git a/toolchains/solidity/core/crates/linter-lib/Cargo.toml b/toolchains/solidity/core/crates/linter-lib/Cargo.toml index ab114db9..eb013ffb 100644 --- a/toolchains/solidity/core/crates/linter-lib/Cargo.toml +++ b/toolchains/solidity/core/crates/linter-lib/Cargo.toml @@ -2,7 +2,7 @@ name = "solidhunter-lib" description = "Solidhunter/Osmium solidity linter library" repository = "https://github.com/astrodevs-labs/osmium" -version = "0.0.4" +version = "0.1.0" edition = "2021" authors = ["Astrodevs Labs"] license = "GPL-3.0-or-later" diff --git a/toolchains/solidity/core/crates/linter-lib/src/linter.rs b/toolchains/solidity/core/crates/linter-lib/src/linter.rs index a328dd57..35d53a57 100644 --- a/toolchains/solidity/core/crates/linter-lib/src/linter.rs +++ b/toolchains/solidity/core/crates/linter-lib/src/linter.rs @@ -107,7 +107,7 @@ impl SolidLinter { let mut diags = rule.diagnose(&self.files[self.files.len() - 1], &self.files); res.append(&mut diags); } - Ok(res) + Ok(FileDiags::new(content.to_string(), res)) } pub fn parse_folder(&mut self, folder: &str) -> Vec { diff --git a/toolchains/solidity/core/crates/linter-lib/src/rules/best_practises/custom_errors.rs b/toolchains/solidity/core/crates/linter-lib/src/rules/best_practises/custom_errors.rs index 6d7d377d..b4ec9a2c 100644 --- a/toolchains/solidity/core/crates/linter-lib/src/rules/best_practises/custom_errors.rs +++ b/toolchains/solidity/core/crates/linter-lib/src/rules/best_practises/custom_errors.rs @@ -37,7 +37,7 @@ impl CustomErrors { code: None, source: None, uri: file.path.clone(), - source_file_content: file.content.clone(), + } } } diff --git a/toolchains/solidity/core/crates/linter-lib/src/rules/best_practises/explicit_types.rs b/toolchains/solidity/core/crates/linter-lib/src/rules/best_practises/explicit_types.rs index 0e0005b9..0c413d0d 100644 --- a/toolchains/solidity/core/crates/linter-lib/src/rules/best_practises/explicit_types.rs +++ b/toolchains/solidity/core/crates/linter-lib/src/rules/best_practises/explicit_types.rs @@ -85,7 +85,7 @@ impl ExplicitTypes { code: None, source: None, uri: file.path.clone(), - source_file_content: file.content.clone(), + } } } diff --git a/toolchains/solidity/core/crates/linter-lib/src/rules/best_practises/function_max_lines.rs b/toolchains/solidity/core/crates/linter-lib/src/rules/best_practises/function_max_lines.rs index 52465efd..1467b8a7 100644 --- a/toolchains/solidity/core/crates/linter-lib/src/rules/best_practises/function_max_lines.rs +++ b/toolchains/solidity/core/crates/linter-lib/src/rules/best_practises/function_max_lines.rs @@ -43,7 +43,7 @@ impl RuleType for FunctionMaxLines { self.number_max_lines ), uri: _file.path.clone(), - source_file_content: _file.content.clone(), + }); } } diff --git a/toolchains/solidity/core/crates/linter-lib/src/rules/best_practises/max_line_length.rs b/toolchains/solidity/core/crates/linter-lib/src/rules/best_practises/max_line_length.rs index f5e629fc..2f93ecfc 100644 --- a/toolchains/solidity/core/crates/linter-lib/src/rules/best_practises/max_line_length.rs +++ b/toolchains/solidity/core/crates/linter-lib/src/rules/best_practises/max_line_length.rs @@ -37,7 +37,7 @@ impl MaxLineLength { code: None, source: None, uri: file.path.clone(), - source_file_content: file.content.clone(), + } } } diff --git a/toolchains/solidity/core/crates/linter-lib/src/rules/best_practises/max_states_count.rs b/toolchains/solidity/core/crates/linter-lib/src/rules/best_practises/max_states_count.rs index 7060008b..d1c83e68 100644 --- a/toolchains/solidity/core/crates/linter-lib/src/rules/best_practises/max_states_count.rs +++ b/toolchains/solidity/core/crates/linter-lib/src/rules/best_practises/max_states_count.rs @@ -42,7 +42,7 @@ impl MaxStatesCount { code: None, source: None, uri: file.path.clone(), - source_file_content: file.content.clone(), + } } } diff --git a/toolchains/solidity/core/crates/linter-lib/src/rules/best_practises/no_console.rs b/toolchains/solidity/core/crates/linter-lib/src/rules/best_practises/no_console.rs index b612f028..b3c15693 100644 --- a/toolchains/solidity/core/crates/linter-lib/src/rules/best_practises/no_console.rs +++ b/toolchains/solidity/core/crates/linter-lib/src/rules/best_practises/no_console.rs @@ -38,7 +38,7 @@ impl NoConsole { code: None, source: None, uri: file.path.clone(), - source_file_content: file.content.clone(), + } } } diff --git a/toolchains/solidity/core/crates/linter-lib/src/rules/best_practises/no_empty_block.rs b/toolchains/solidity/core/crates/linter-lib/src/rules/best_practises/no_empty_block.rs index 5705691d..942839d1 100644 --- a/toolchains/solidity/core/crates/linter-lib/src/rules/best_practises/no_empty_block.rs +++ b/toolchains/solidity/core/crates/linter-lib/src/rules/best_practises/no_empty_block.rs @@ -30,7 +30,7 @@ impl RuleType for NoEmptyBlock { source: None, message: DEFAULT_MESSAGE.to_string(), uri: _file.path.clone(), - source_file_content: _file.content.clone(), + }); } res diff --git a/toolchains/solidity/core/crates/linter-lib/src/rules/best_practises/no_global_import.rs b/toolchains/solidity/core/crates/linter-lib/src/rules/best_practises/no_global_import.rs index 5c4165d2..a205ede8 100644 --- a/toolchains/solidity/core/crates/linter-lib/src/rules/best_practises/no_global_import.rs +++ b/toolchains/solidity/core/crates/linter-lib/src/rules/best_practises/no_global_import.rs @@ -29,7 +29,7 @@ impl RuleType for NoGlobalImport { source: None, message: DEFAULT_MESSAGE.to_string(), uri: _file.path.clone(), - source_file_content: _file.content.clone(), + }); } res diff --git a/toolchains/solidity/core/crates/linter-lib/src/rules/best_practises/one_contract_per_file.rs b/toolchains/solidity/core/crates/linter-lib/src/rules/best_practises/one_contract_per_file.rs index abe46474..ca6869bd 100644 --- a/toolchains/solidity/core/crates/linter-lib/src/rules/best_practises/one_contract_per_file.rs +++ b/toolchains/solidity/core/crates/linter-lib/src/rules/best_practises/one_contract_per_file.rs @@ -34,7 +34,7 @@ impl OneContractPerFile { code: None, source: None, uri: file.path.clone(), - source_file_content: file.content.clone(), + } } } diff --git a/toolchains/solidity/core/crates/linter-lib/src/rules/best_practises/payable_fallback.rs b/toolchains/solidity/core/crates/linter-lib/src/rules/best_practises/payable_fallback.rs index 0f64fa5b..d3c4bca0 100644 --- a/toolchains/solidity/core/crates/linter-lib/src/rules/best_practises/payable_fallback.rs +++ b/toolchains/solidity/core/crates/linter-lib/src/rules/best_practises/payable_fallback.rs @@ -32,7 +32,7 @@ impl RuleType for PayableFallback { source: None, message: DEFAULT_MESSAGE.to_string(), uri: file.path.clone(), - source_file_content: file.content.clone(), + }); } res diff --git a/toolchains/solidity/core/crates/linter-lib/src/rules/best_practises/reason_string.rs b/toolchains/solidity/core/crates/linter-lib/src/rules/best_practises/reason_string.rs index 813b5b45..62ae27cb 100644 --- a/toolchains/solidity/core/crates/linter-lib/src/rules/best_practises/reason_string.rs +++ b/toolchains/solidity/core/crates/linter-lib/src/rules/best_practises/reason_string.rs @@ -40,7 +40,7 @@ impl ReasonString { code: None, source: None, uri: file.path.clone(), - source_file_content: file.content.clone(), + } } } diff --git a/toolchains/solidity/core/crates/linter-lib/src/rules/naming/const_name_snakecase.rs b/toolchains/solidity/core/crates/linter-lib/src/rules/naming/const_name_snakecase.rs index 503fb296..e53c884d 100644 --- a/toolchains/solidity/core/crates/linter-lib/src/rules/naming/const_name_snakecase.rs +++ b/toolchains/solidity/core/crates/linter-lib/src/rules/naming/const_name_snakecase.rs @@ -34,7 +34,7 @@ impl ConstNameSnakeCase { code: None, source: None, uri: file.path.clone(), - source_file_content: file.content.clone(), + } } } diff --git a/toolchains/solidity/core/crates/linter-lib/src/rules/naming/contract_name_camelcase.rs b/toolchains/solidity/core/crates/linter-lib/src/rules/naming/contract_name_camelcase.rs index a282f6ef..13b68599 100644 --- a/toolchains/solidity/core/crates/linter-lib/src/rules/naming/contract_name_camelcase.rs +++ b/toolchains/solidity/core/crates/linter-lib/src/rules/naming/contract_name_camelcase.rs @@ -34,7 +34,7 @@ impl ContractNameCamelCase { code: None, source: None, uri: file.path.clone(), - source_file_content: file.content.clone(), + } } } diff --git a/toolchains/solidity/core/crates/linter-lib/src/rules/naming/event_name_camelcase.rs b/toolchains/solidity/core/crates/linter-lib/src/rules/naming/event_name_camelcase.rs index 3470f83a..84cd6d82 100644 --- a/toolchains/solidity/core/crates/linter-lib/src/rules/naming/event_name_camelcase.rs +++ b/toolchains/solidity/core/crates/linter-lib/src/rules/naming/event_name_camelcase.rs @@ -34,7 +34,7 @@ impl EventNameCamelCase { code: None, source: None, uri: file.path.clone(), - source_file_content: file.content.clone(), + } } } diff --git a/toolchains/solidity/core/crates/linter-lib/src/rules/naming/foundry_test_functions.rs b/toolchains/solidity/core/crates/linter-lib/src/rules/naming/foundry_test_functions.rs index fbf2e3ef..014eca89 100644 --- a/toolchains/solidity/core/crates/linter-lib/src/rules/naming/foundry_test_functions.rs +++ b/toolchains/solidity/core/crates/linter-lib/src/rules/naming/foundry_test_functions.rs @@ -43,7 +43,7 @@ impl FoundryTestFunctions { code: None, source: None, uri: file.path.clone(), - source_file_content: file.content.clone(), + } } } diff --git a/toolchains/solidity/core/crates/linter-lib/src/rules/naming/func_name_mixedcase.rs b/toolchains/solidity/core/crates/linter-lib/src/rules/naming/func_name_mixedcase.rs index c6dc7f06..1b621956 100644 --- a/toolchains/solidity/core/crates/linter-lib/src/rules/naming/func_name_mixedcase.rs +++ b/toolchains/solidity/core/crates/linter-lib/src/rules/naming/func_name_mixedcase.rs @@ -34,7 +34,7 @@ impl FuncNameMixedCase { code: None, source: None, uri: file.path.clone(), - source_file_content: file.content.clone(), + } } } diff --git a/toolchains/solidity/core/crates/linter-lib/src/rules/naming/func_param_name_mixedcase.rs b/toolchains/solidity/core/crates/linter-lib/src/rules/naming/func_param_name_mixedcase.rs index 89007395..631b08c5 100644 --- a/toolchains/solidity/core/crates/linter-lib/src/rules/naming/func_param_name_mixedcase.rs +++ b/toolchains/solidity/core/crates/linter-lib/src/rules/naming/func_param_name_mixedcase.rs @@ -33,7 +33,7 @@ impl FuncParamNameMixedCase { code: None, source: None, uri: file.path.clone(), - source_file_content: file.content.clone(), + } } } diff --git a/toolchains/solidity/core/crates/linter-lib/src/rules/naming/modifier_name_mixedcase.rs b/toolchains/solidity/core/crates/linter-lib/src/rules/naming/modifier_name_mixedcase.rs index 7cb8ae70..529e712f 100644 --- a/toolchains/solidity/core/crates/linter-lib/src/rules/naming/modifier_name_mixedcase.rs +++ b/toolchains/solidity/core/crates/linter-lib/src/rules/naming/modifier_name_mixedcase.rs @@ -34,7 +34,7 @@ impl ModifierNameMixedcase { code: None, source: None, uri: file.path.clone(), - source_file_content: file.content.clone(), + } } } diff --git a/toolchains/solidity/core/crates/linter-lib/src/rules/naming/named_parameters_mapping.rs b/toolchains/solidity/core/crates/linter-lib/src/rules/naming/named_parameters_mapping.rs index ffedfac3..ba5d2cad 100644 --- a/toolchains/solidity/core/crates/linter-lib/src/rules/naming/named_parameters_mapping.rs +++ b/toolchains/solidity/core/crates/linter-lib/src/rules/naming/named_parameters_mapping.rs @@ -58,7 +58,7 @@ impl NamedParametersMapping { code: None, source: None, uri: file.path.clone(), - source_file_content: file.content.clone(), + } } } diff --git a/toolchains/solidity/core/crates/linter-lib/src/rules/naming/private_vars_leading_underscore.rs b/toolchains/solidity/core/crates/linter-lib/src/rules/naming/private_vars_leading_underscore.rs index 00214de8..23a4d657 100644 --- a/toolchains/solidity/core/crates/linter-lib/src/rules/naming/private_vars_leading_underscore.rs +++ b/toolchains/solidity/core/crates/linter-lib/src/rules/naming/private_vars_leading_underscore.rs @@ -44,7 +44,7 @@ impl PrivateVarsLeadingUnderscore { code: None, source: None, uri: file.path.clone(), - source_file_content: file.content.clone(), + } } } diff --git a/toolchains/solidity/core/crates/linter-lib/src/rules/naming/use_forbidden_name.rs b/toolchains/solidity/core/crates/linter-lib/src/rules/naming/use_forbidden_name.rs index 06c68165..94490f2f 100644 --- a/toolchains/solidity/core/crates/linter-lib/src/rules/naming/use_forbidden_name.rs +++ b/toolchains/solidity/core/crates/linter-lib/src/rules/naming/use_forbidden_name.rs @@ -33,7 +33,7 @@ impl UseForbiddenName { code: None, source: None, uri: file.path.clone(), - source_file_content: file.content.clone(), + } } } diff --git a/toolchains/solidity/core/crates/linter-lib/src/rules/naming/var_name_mixedcase.rs b/toolchains/solidity/core/crates/linter-lib/src/rules/naming/var_name_mixedcase.rs index 83370e0f..8a69e693 100644 --- a/toolchains/solidity/core/crates/linter-lib/src/rules/naming/var_name_mixedcase.rs +++ b/toolchains/solidity/core/crates/linter-lib/src/rules/naming/var_name_mixedcase.rs @@ -34,7 +34,7 @@ impl VarNameMixedCase { code: None, source: None, uri: file.path.clone(), - source_file_content: file.content.clone(), + } } } diff --git a/toolchains/solidity/core/crates/linter-lib/src/rules/order/import_on_top.rs b/toolchains/solidity/core/crates/linter-lib/src/rules/order/import_on_top.rs index a390243d..b858a93f 100644 --- a/toolchains/solidity/core/crates/linter-lib/src/rules/order/import_on_top.rs +++ b/toolchains/solidity/core/crates/linter-lib/src/rules/order/import_on_top.rs @@ -35,7 +35,7 @@ impl ImportOnTop { code: None, source: None, uri: file.path.clone(), - source_file_content: file.content.clone(), + } } } diff --git a/toolchains/solidity/core/crates/linter-lib/src/rules/order/ordering.rs b/toolchains/solidity/core/crates/linter-lib/src/rules/order/ordering.rs index ff2f1a87..ba0a32de 100644 --- a/toolchains/solidity/core/crates/linter-lib/src/rules/order/ordering.rs +++ b/toolchains/solidity/core/crates/linter-lib/src/rules/order/ordering.rs @@ -298,7 +298,7 @@ impl OrderingVisitor { code: None, source: None, uri: file.path.clone(), - source_file_content: file.content.clone(), + } } diff --git a/toolchains/solidity/core/crates/linter-lib/src/rules/order/visibility_modifier_order.rs b/toolchains/solidity/core/crates/linter-lib/src/rules/order/visibility_modifier_order.rs index 3f8bcea0..23a35f4b 100644 --- a/toolchains/solidity/core/crates/linter-lib/src/rules/order/visibility_modifier_order.rs +++ b/toolchains/solidity/core/crates/linter-lib/src/rules/order/visibility_modifier_order.rs @@ -32,7 +32,7 @@ impl RuleType for VisibilityModiferOrder { source: None, message: DEFAULT_MESSAGE.to_string(), uri: _file.path.clone(), - source_file_content: _file.content.clone(), + }); } res diff --git a/toolchains/solidity/core/crates/linter-lib/src/rules/security/avoid_tx_origin.rs b/toolchains/solidity/core/crates/linter-lib/src/rules/security/avoid_tx_origin.rs index 7387b89a..804e7d71 100644 --- a/toolchains/solidity/core/crates/linter-lib/src/rules/security/avoid_tx_origin.rs +++ b/toolchains/solidity/core/crates/linter-lib/src/rules/security/avoid_tx_origin.rs @@ -50,7 +50,7 @@ impl AvoidTxOrigin { code: None, source: None, uri: file.path.clone(), - source_file_content: file.content.clone(), + } } } diff --git a/toolchains/solidity/core/crates/linter-lib/src/rules/security/func_visibility.rs b/toolchains/solidity/core/crates/linter-lib/src/rules/security/func_visibility.rs index 5f1f8a93..2e9ce6be 100644 --- a/toolchains/solidity/core/crates/linter-lib/src/rules/security/func_visibility.rs +++ b/toolchains/solidity/core/crates/linter-lib/src/rules/security/func_visibility.rs @@ -42,7 +42,7 @@ impl FuncVisibility { code: None, source: None, uri: file.path.clone(), - source_file_content: file.content.clone(), + } } } diff --git a/toolchains/solidity/core/crates/linter-lib/src/rules/security/no_inline_assembly.rs b/toolchains/solidity/core/crates/linter-lib/src/rules/security/no_inline_assembly.rs index 7f444957..817636c3 100644 --- a/toolchains/solidity/core/crates/linter-lib/src/rules/security/no_inline_assembly.rs +++ b/toolchains/solidity/core/crates/linter-lib/src/rules/security/no_inline_assembly.rs @@ -33,7 +33,7 @@ impl NoInlineAssembly { code: None, source: None, uri: file.path.clone(), - source_file_content: file.content.clone(), + } } } diff --git a/toolchains/solidity/core/crates/linter-lib/src/rules/security/not_rely_on_time.rs b/toolchains/solidity/core/crates/linter-lib/src/rules/security/not_rely_on_time.rs index 9fb0990a..b1260f94 100644 --- a/toolchains/solidity/core/crates/linter-lib/src/rules/security/not_rely_on_time.rs +++ b/toolchains/solidity/core/crates/linter-lib/src/rules/security/not_rely_on_time.rs @@ -33,7 +33,7 @@ impl NotRelyOnTime { code: None, source: None, uri: file.path.clone(), - source_file_content: file.content.clone(), + } } } diff --git a/toolchains/solidity/core/crates/linter-lib/src/rules/security/state_visibility.rs b/toolchains/solidity/core/crates/linter-lib/src/rules/security/state_visibility.rs index 69cf402e..1f6c1617 100644 --- a/toolchains/solidity/core/crates/linter-lib/src/rules/security/state_visibility.rs +++ b/toolchains/solidity/core/crates/linter-lib/src/rules/security/state_visibility.rs @@ -33,7 +33,7 @@ impl StateVisibility { code: None, source: None, uri: file.path.clone(), - source_file_content: file.content.clone(), + } } } diff --git a/toolchains/solidity/core/crates/linter-lib/src/types.rs b/toolchains/solidity/core/crates/linter-lib/src/types.rs index c6ef6d22..17e2a17d 100644 --- a/toolchains/solidity/core/crates/linter-lib/src/types.rs +++ b/toolchains/solidity/core/crates/linter-lib/src/types.rs @@ -1,192 +1,38 @@ use crate::errors::SolidHunterError; -use colored::Colorize; -use serde::{Deserialize, Serialize}; -use std::fmt; - -pub type LintResult = Result, SolidHunterError>; - -#[derive(Clone, Serialize, Deserialize, Debug)] -pub struct LintDiag { - /// The range at which the message applies. - pub range: Range, - - /// The diagnostic's severity. - pub severity: Severity, - - #[serde(skip_serializing_if = "Option::is_none")] - /// The diagnostic's code. Can be omitted. - pub code: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - /// A human-readable string describing the source of this - /// diagnostic, e.g. 'typescript' or 'super lint'. - pub source: Option, - - /// The diagnostic's message. - pub message: String, - - pub id: String, - - pub uri: Uri, - - #[serde(rename = "sourceFileContent")] - pub source_file_content: String, -} - -fn compute_format_line_padding(line: usize) -> String { - let padding: String; - if line > 99 { - padding = " ".repeat(0); - } else if line > 9 { - padding = " ".to_string(); - } else { - padding = " ".repeat(2); - } - padding -} - -fn try_trim_max_offset(line: &str, max_offset: usize) -> (&str, usize) { - let mut offset: usize = 0; - - for (i, c) in line.chars().enumerate() { - if i >= max_offset { - break; - } - if c.is_whitespace() { - offset += 1; - } - } - (&line[offset..], offset) -} - -impl LintDiag { - fn format_highlighted_lines(&self) -> String { - let mut formatted = " |\n".to_string(); - let first_line = self - .source_file_content - .lines() - .nth(self.range.start.line - 1) - .unwrap(); - let trimmed_first_line = first_line.trim_start(); - let max_offset = first_line.len() - trimmed_first_line.len(); - - for line_nb in self.range.start.line..self.range.end.line + 1 { - let line = self.source_file_content.lines().nth(line_nb - 1).unwrap(); - let (trimmed_line, offset) = try_trim_max_offset(line, max_offset); - let mut higlight_length = trimmed_line.len(); - - if self.range.start.line == self.range.end.line { - higlight_length = self.range.end.character - self.range.start.character; - } else if line_nb == self.range.start.line { - higlight_length = trimmed_line.len() - (self.range.start.character - offset); - } else if line_nb == self.range.end.line { - higlight_length = trimmed_line.len() - (self.range.end.character - offset) + 1; - } - - formatted = format!( - "{}{}{}| {}\n | {}{}\n", - formatted, - line_nb, - compute_format_line_padding(line_nb), - trimmed_line, - " ".repeat(if line_nb == self.range.start.line { - self.range.start.character - offset - } else { - 0 - }), - "^".repeat(higlight_length) - ); - } - formatted - } -} - -impl fmt::Display for LintDiag { - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - write!( - f, - "\n{}: {}\n --> {}:{}:{}\n |\n{}", - self.severity, - self.message, - self.uri, - self.range.start.line, - self.range.start.character, - self.format_highlighted_lines() - ) - } -} + +mod severity; +pub use severity::Severity; +mod position; +pub use position::Position; +mod range; +pub use range::Range; +mod lint_diag; +pub use lint_diag::LintDiag; +mod file_diags; +pub use file_diags::FileDiags; + +pub type LintResult = Result; + + + + + + //////////////////////////////////////////////////////////// /////////////////// RELATED TYPES: ///////////////////////// //////////////////////////////////////////////////////////// -impl fmt::Display for Severity { - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - let severity = match self { - Severity::ERROR => "error".to_string().red(), - Severity::WARNING => "warning".to_string().yellow(), - Severity::INFO => "info".to_string().blue(), - Severity::HINT => "hint".to_string().green(), - }; - write!(f, "{}", severity) - } -} - -impl PartialEq for Position { - fn eq(&self, other: &Self) -> bool { - self.line == other.line && self.character == other.character - } -} - -#[derive(Clone, Serialize, Deserialize, Debug)] -pub struct Position { - pub line: usize, - pub character: usize, -} - -#[derive(PartialEq, Eq, Clone, Copy, Serialize, Deserialize, Debug)] -pub enum Severity { - /// Reports an error. - ERROR = 1, - /// Reports a warning. - WARNING = 2, - /// Reports an information. - INFO = 3, - /// Reports a hint. - HINT = 4, -} - -#[derive(Clone, Serialize, Deserialize, Debug)] -pub struct Range { - pub start: Position, - pub end: Position, -} - -impl Range { - // Compute the number of characters between the start and end of the range - pub fn compute_length(&self, content: &str) -> usize { - if self.start.line == self.end.line { - self.end.character - self.start.character - } else { - let mut length = 0; - let mut line = self.start.line; - let mut character = self.start.character; - while line < self.end.line { - let line_content = content.lines().nth(line - 1).unwrap(); - length += line_content.len() + 1 - character; - line += 1; - character = 0; - } - length += self.end.character - character; - length - } - } -} - -#[derive(Clone, Serialize, Deserialize, Debug)] -pub enum NumberOrString { - Number(i32), - String(String), -} - -type Uri = String; + + + + + + + + + + + + + diff --git a/toolchains/solidity/core/crates/linter-lib/src/types/file_diags.rs b/toolchains/solidity/core/crates/linter-lib/src/types/file_diags.rs new file mode 100644 index 00000000..89cdbf00 --- /dev/null +++ b/toolchains/solidity/core/crates/linter-lib/src/types/file_diags.rs @@ -0,0 +1,100 @@ +use std::fmt; +use serde::{Serialize, Deserialize}; +use super::LintDiag; + +#[derive(Clone, Debug, Serialize, Deserialize)] +pub struct FileDiags { + #[serde(skip_serializing_if = "String::is_empty", rename = "sourceFileContent")] + pub source_file_content: String, + pub diags: Vec, +} + +impl FileDiags { + pub fn new(source_file_content: String, diags: Vec) -> Self { + FileDiags { + source_file_content, + diags, + } + } + + fn format_highlighted_lines(&self, idx: usize) -> String { + let mut formatted = " |\n".to_string(); + let diag = &self.diags[idx]; + let first_line = self + .source_file_content + .lines() + .nth(diag.range.start.line - 1) + .unwrap(); + let trimmed_first_line = first_line.trim_start(); + let max_offset = first_line.len() - trimmed_first_line.len(); + + for line_nb in diag.range.start.line..diag.range.end.line + 1 { + let line = self.source_file_content.lines().nth(line_nb - 1).unwrap(); + let (trimmed_line, offset) = try_trim_max_offset(line, max_offset); + let mut higlight_length = trimmed_line.len(); + + if diag.range.start.line == diag.range.end.line { + higlight_length = diag.range.end.character - diag.range.start.character; + } else if line_nb == diag.range.start.line { + higlight_length = trimmed_line.len() - (diag.range.start.character - offset); + } else if line_nb == diag.range.end.line { + higlight_length = trimmed_line.len() - (diag.range.end.character - offset) + 1; + } + + formatted = format!( + "{}{}{}| {}\n | {}{}\n", + formatted, + line_nb, + compute_format_line_padding(line_nb), + trimmed_line, + " ".repeat(if line_nb == diag.range.start.line { + diag.range.start.character - offset + } else { + 0 + }), + "^".repeat(higlight_length) + ); + } + formatted + } +} + +impl fmt::Display for FileDiags { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + for (idx, diag) in self.diags.iter().enumerate() { + write!( + f, + "{}\n{}", + diag, + self.format_highlighted_lines(idx) + )?; + } + Ok(()) + } +} + +fn compute_format_line_padding(line: usize) -> String { + let padding: String; + if line > 99 { + padding = " ".repeat(0); + } else if line > 9 { + padding = " ".to_string(); + } else { + padding = " ".repeat(2); + } + padding +} + +fn try_trim_max_offset(line: &str, max_offset: usize) -> (&str, usize) { + let mut offset: usize = 0; + + for (i, c) in line.chars().enumerate() { + if i >= max_offset { + break; + } + if c.is_whitespace() { + offset += 1; + } + } + (&line[offset..], offset) +} \ No newline at end of file diff --git a/toolchains/solidity/core/crates/linter-lib/src/types/lint_diag.rs b/toolchains/solidity/core/crates/linter-lib/src/types/lint_diag.rs new file mode 100644 index 00000000..df25a1fe --- /dev/null +++ b/toolchains/solidity/core/crates/linter-lib/src/types/lint_diag.rs @@ -0,0 +1,50 @@ +use std::fmt; +use serde::{Serialize, Deserialize}; +use super::{Range, Severity}; + +#[derive(Clone, Serialize, Deserialize, Debug)] +pub struct LintDiag { + /// The range at which the message applies. + pub range: Range, + + /// The diagnostic's severity. + pub severity: Severity, + + #[serde(skip_serializing_if = "Option::is_none")] + /// The diagnostic's code. Can be omitted. + pub code: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + /// A human-readable string describing the source of this + /// diagnostic, e.g. 'typescript' or 'super lint'. + pub source: Option, + + /// The diagnostic's message. + pub message: String, + + pub id: String, + + pub uri: Uri, +} + +impl<'a> fmt::Display for LintDiag { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + write!( + f, + "\n{}: {}\n --> {}:{}:{}", + self.severity, + self.message, + self.uri, + self.range.start.line, + self.range.start.character, + ) + } +} + +#[derive(Clone, Serialize, Deserialize, Debug)] +pub enum NumberOrString { + Number(i32), + String(String), +} + +type Uri = String; \ No newline at end of file diff --git a/toolchains/solidity/core/crates/linter-lib/src/types/position.rs b/toolchains/solidity/core/crates/linter-lib/src/types/position.rs new file mode 100644 index 00000000..060194f6 --- /dev/null +++ b/toolchains/solidity/core/crates/linter-lib/src/types/position.rs @@ -0,0 +1,13 @@ +use serde::{Serialize, Deserialize}; + +#[derive(Clone, Serialize, Deserialize, Debug)] +pub struct Position { + pub line: usize, + pub character: usize, +} + +impl PartialEq for Position { + fn eq(&self, other: &Self) -> bool { + self.line == other.line && self.character == other.character + } +} \ No newline at end of file diff --git a/toolchains/solidity/core/crates/linter-lib/src/types/range.rs b/toolchains/solidity/core/crates/linter-lib/src/types/range.rs new file mode 100644 index 00000000..93aec2b0 --- /dev/null +++ b/toolchains/solidity/core/crates/linter-lib/src/types/range.rs @@ -0,0 +1,29 @@ +use serde::{Serialize, Deserialize}; +use super::Position; + +#[derive(Clone, Serialize, Deserialize, Debug)] +pub struct Range { + pub start: Position, + pub end: Position, +} + +impl Range { + // Compute the number of characters between the start and end of the range + pub fn compute_length(&self, content: &str) -> usize { + if self.start.line == self.end.line { + self.end.character - self.start.character + } else { + let mut length = 0; + let mut line = self.start.line; + let mut character = self.start.character; + while line < self.end.line { + let line_content = content.lines().nth(line - 1).unwrap(); + length += line_content.len() + 1 - character; + line += 1; + character = 0; + } + length += self.end.character - character; + length + } + } +} \ No newline at end of file diff --git a/toolchains/solidity/core/crates/linter-lib/src/types/severity.rs b/toolchains/solidity/core/crates/linter-lib/src/types/severity.rs new file mode 100644 index 00000000..1fd8a989 --- /dev/null +++ b/toolchains/solidity/core/crates/linter-lib/src/types/severity.rs @@ -0,0 +1,27 @@ +use std::fmt; +use colored::Colorize; +use serde::{Serialize, Deserialize}; + +#[derive(PartialEq, Eq, Clone, Copy, Serialize, Deserialize, Debug)] +pub enum Severity { + /// Reports an error. + ERROR = 1, + /// Reports a warning. + WARNING = 2, + /// Reports an information. + INFO = 3, + /// Reports a hint. + HINT = 4, +} + +impl fmt::Display for Severity { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + let severity = match self { + Severity::ERROR => "error".to_string().red(), + Severity::WARNING => "warning".to_string().yellow(), + Severity::INFO => "info".to_string().blue(), + Severity::HINT => "hint".to_string().green(), + }; + write!(f, "{}", severity) + } +} \ No newline at end of file diff --git a/toolchains/solidity/core/crates/linter-lib/tests/linter.rs b/toolchains/solidity/core/crates/linter-lib/tests/linter.rs index 0025ad8c..9afcc9a8 100644 --- a/toolchains/solidity/core/crates/linter-lib/tests/linter.rs +++ b/toolchains/solidity/core/crates/linter-lib/tests/linter.rs @@ -63,14 +63,14 @@ fn test_linter(config: &str, source: &str, expected_findings: &Vec) { match result { Ok(diags) => { let mut found; - for (_, diag) in diags.iter().enumerate() { + for (_, diag) in diags.diags.iter().enumerate() { found = false; for (_, expected_finding) in expected_findings.iter().enumerate() { if (diag.range.start == expected_finding.start) && (diag.range.end == expected_finding.end) && (diag.id == expected_finding.id) { - found_findings.push(expected_finding.clone()); + found_findings.push(expected_finding); found = true; break; } @@ -91,7 +91,7 @@ fn test_linter(config: &str, source: &str, expected_findings: &Vec) { } } if found == false { - not_found_findings.push(expected_finding.clone()); + not_found_findings.push(expected_finding); } } if not_needed_findings.len() > 0 { diff --git a/toolchains/solidity/core/crates/linter-server/Cargo.toml b/toolchains/solidity/core/crates/linter-server/Cargo.toml index d45dd078..69e4a87c 100644 --- a/toolchains/solidity/core/crates/linter-server/Cargo.toml +++ b/toolchains/solidity/core/crates/linter-server/Cargo.toml @@ -11,5 +11,5 @@ crate-type = ["cdylib", "rlib"] [dependencies] osmium-libs-lsp-handler = { path = "../../../../../libs/lsp-handler", version = "0.0.2" } -solidhunter-lib = { path = "../linter-lib", version = "0.0.4" } +solidhunter-lib = { path = "../linter-lib", version = "0.1.0" } js-sys = "0.3.64" \ No newline at end of file diff --git a/toolchains/solidity/core/crates/linter-server/src/lib.rs b/toolchains/solidity/core/crates/linter-server/src/lib.rs index 356f7d20..f1e12844 100644 --- a/toolchains/solidity/core/crates/linter-server/src/lib.rs +++ b/toolchains/solidity/core/crates/linter-server/src/lib.rs @@ -84,7 +84,7 @@ impl Handler for Backend { let diags_res = linter.parse_content(&filepath, ¶ms.text_document.text); if let Ok(diags) = diags_res { - let diags = diags + let diags = diags.diags .iter() .map(|d| diagnostic_from_lintdiag(d.clone())) .collect(); @@ -115,7 +115,7 @@ impl Handler for Backend { let diags_res = linter.parse_content(&filepath, ¶ms.content_changes[0].text); if let Ok(diags) = diags_res { - let diags = diags + let diags = diags.diags .iter() .map(|d| diagnostic_from_lintdiag(d.clone())) .collect(); From ba826ef57fdbf2b5c7a3314a658de5aabca8d018 Mon Sep 17 00:00:00 2001 From: 0xMemoryGrinder <35138272+0xMemoryGrinder@users.noreply.github.com> Date: Sat, 4 Nov 2023 01:04:42 -0400 Subject: [PATCH 284/325] chore: deleted remove-me --- remove-me-3ce10a5cfd484331b1db.txt | 1 - 1 file changed, 1 deletion(-) delete mode 100644 remove-me-3ce10a5cfd484331b1db.txt diff --git a/remove-me-3ce10a5cfd484331b1db.txt b/remove-me-3ce10a5cfd484331b1db.txt deleted file mode 100644 index 31f505a8..00000000 --- a/remove-me-3ce10a5cfd484331b1db.txt +++ /dev/null @@ -1 +0,0 @@ -3ce10a5cfd484331b1db From b5456e0a9194eba1e3674c6d03baf5578258956d Mon Sep 17 00:00:00 2001 From: 0xMemoryGrinder <35138272+0xMemoryGrinder@users.noreply.github.com> Date: Sat, 4 Nov 2023 01:12:46 -0400 Subject: [PATCH 285/325] style: ran lint and format --- libs/ast-extractor/Cargo.lock | 2 +- libs/lsp-handler/Cargo.lock | 2 +- .../src/rules/best_practises/custom_errors.rs | 1 - .../rules/best_practises/explicit_types.rs | 1 - .../best_practises/function_max_lines.rs | 1 - .../rules/best_practises/max_line_length.rs | 1 - .../rules/best_practises/max_states_count.rs | 1 - .../src/rules/best_practises/no_console.rs | 1 - .../rules/best_practises/no_empty_block.rs | 1 - .../rules/best_practises/no_global_import.rs | 1 - .../best_practises/one_contract_per_file.rs | 1 - .../rules/best_practises/payable_fallback.rs | 1 - .../src/rules/best_practises/reason_string.rs | 1 - .../src/rules/naming/const_name_snakecase.rs | 1 - .../rules/naming/contract_name_camelcase.rs | 1 - .../src/rules/naming/event_name_camelcase.rs | 1 - .../rules/naming/foundry_test_functions.rs | 1 - .../src/rules/naming/func_name_mixedcase.rs | 1 - .../rules/naming/func_param_name_mixedcase.rs | 1 - .../rules/naming/modifier_name_mixedcase.rs | 1 - .../rules/naming/named_parameters_mapping.rs | 1 - .../naming/private_vars_leading_underscore.rs | 1 - .../src/rules/naming/use_forbidden_name.rs | 1 - .../src/rules/naming/var_name_mixedcase.rs | 1 - .../src/rules/order/import_on_top.rs | 1 - .../linter-lib/src/rules/order/ordering.rs | 1 - .../rules/order/visibility_modifier_order.rs | 1 - .../src/rules/security/avoid_tx_origin.rs | 1 - .../src/rules/security/func_visibility.rs | 1 - .../src/rules/security/no_inline_assembly.rs | 1 - .../src/rules/security/not_rely_on_time.rs | 1 - .../src/rules/security/state_visibility.rs | 1 - .../core/crates/linter-lib/src/types.rs | 20 ------------------- .../crates/linter-lib/src/types/file_diags.rs | 13 ++++-------- .../crates/linter-lib/src/types/lint_diag.rs | 8 ++++---- .../crates/linter-lib/src/types/position.rs | 4 ++-- .../core/crates/linter-lib/src/types/range.rs | 4 ++-- .../crates/linter-lib/src/types/severity.rs | 6 +++--- .../core/crates/linter-server/src/lib.rs | 6 ++++-- 39 files changed, 21 insertions(+), 74 deletions(-) diff --git a/libs/ast-extractor/Cargo.lock b/libs/ast-extractor/Cargo.lock index 4aa7d141..34b91cd2 100644 --- a/libs/ast-extractor/Cargo.lock +++ b/libs/ast-extractor/Cargo.lock @@ -4,7 +4,7 @@ version = 3 [[package]] name = "osmium-libs-solidity-ast-extractor" -version = "0.1.0" +version = "0.1.1" dependencies = [ "proc-macro2", "quote", diff --git a/libs/lsp-handler/Cargo.lock b/libs/lsp-handler/Cargo.lock index 9d748164..e7a64d41 100644 --- a/libs/lsp-handler/Cargo.lock +++ b/libs/lsp-handler/Cargo.lock @@ -81,7 +81,7 @@ checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d" [[package]] name = "osmium-libs-lsp-handler" -version = "0.0.1" +version = "0.0.2" dependencies = [ "js-sys", "lsp-types", diff --git a/toolchains/solidity/core/crates/linter-lib/src/rules/best_practises/custom_errors.rs b/toolchains/solidity/core/crates/linter-lib/src/rules/best_practises/custom_errors.rs index b4ec9a2c..c6957c57 100644 --- a/toolchains/solidity/core/crates/linter-lib/src/rules/best_practises/custom_errors.rs +++ b/toolchains/solidity/core/crates/linter-lib/src/rules/best_practises/custom_errors.rs @@ -37,7 +37,6 @@ impl CustomErrors { code: None, source: None, uri: file.path.clone(), - } } } diff --git a/toolchains/solidity/core/crates/linter-lib/src/rules/best_practises/explicit_types.rs b/toolchains/solidity/core/crates/linter-lib/src/rules/best_practises/explicit_types.rs index 0c413d0d..cf614918 100644 --- a/toolchains/solidity/core/crates/linter-lib/src/rules/best_practises/explicit_types.rs +++ b/toolchains/solidity/core/crates/linter-lib/src/rules/best_practises/explicit_types.rs @@ -85,7 +85,6 @@ impl ExplicitTypes { code: None, source: None, uri: file.path.clone(), - } } } diff --git a/toolchains/solidity/core/crates/linter-lib/src/rules/best_practises/function_max_lines.rs b/toolchains/solidity/core/crates/linter-lib/src/rules/best_practises/function_max_lines.rs index 1467b8a7..a704c0de 100644 --- a/toolchains/solidity/core/crates/linter-lib/src/rules/best_practises/function_max_lines.rs +++ b/toolchains/solidity/core/crates/linter-lib/src/rules/best_practises/function_max_lines.rs @@ -43,7 +43,6 @@ impl RuleType for FunctionMaxLines { self.number_max_lines ), uri: _file.path.clone(), - }); } } diff --git a/toolchains/solidity/core/crates/linter-lib/src/rules/best_practises/max_line_length.rs b/toolchains/solidity/core/crates/linter-lib/src/rules/best_practises/max_line_length.rs index 2f93ecfc..751f19a5 100644 --- a/toolchains/solidity/core/crates/linter-lib/src/rules/best_practises/max_line_length.rs +++ b/toolchains/solidity/core/crates/linter-lib/src/rules/best_practises/max_line_length.rs @@ -37,7 +37,6 @@ impl MaxLineLength { code: None, source: None, uri: file.path.clone(), - } } } diff --git a/toolchains/solidity/core/crates/linter-lib/src/rules/best_practises/max_states_count.rs b/toolchains/solidity/core/crates/linter-lib/src/rules/best_practises/max_states_count.rs index d1c83e68..984798f5 100644 --- a/toolchains/solidity/core/crates/linter-lib/src/rules/best_practises/max_states_count.rs +++ b/toolchains/solidity/core/crates/linter-lib/src/rules/best_practises/max_states_count.rs @@ -42,7 +42,6 @@ impl MaxStatesCount { code: None, source: None, uri: file.path.clone(), - } } } diff --git a/toolchains/solidity/core/crates/linter-lib/src/rules/best_practises/no_console.rs b/toolchains/solidity/core/crates/linter-lib/src/rules/best_practises/no_console.rs index b3c15693..c0ecbb32 100644 --- a/toolchains/solidity/core/crates/linter-lib/src/rules/best_practises/no_console.rs +++ b/toolchains/solidity/core/crates/linter-lib/src/rules/best_practises/no_console.rs @@ -38,7 +38,6 @@ impl NoConsole { code: None, source: None, uri: file.path.clone(), - } } } diff --git a/toolchains/solidity/core/crates/linter-lib/src/rules/best_practises/no_empty_block.rs b/toolchains/solidity/core/crates/linter-lib/src/rules/best_practises/no_empty_block.rs index 942839d1..b667614c 100644 --- a/toolchains/solidity/core/crates/linter-lib/src/rules/best_practises/no_empty_block.rs +++ b/toolchains/solidity/core/crates/linter-lib/src/rules/best_practises/no_empty_block.rs @@ -30,7 +30,6 @@ impl RuleType for NoEmptyBlock { source: None, message: DEFAULT_MESSAGE.to_string(), uri: _file.path.clone(), - }); } res diff --git a/toolchains/solidity/core/crates/linter-lib/src/rules/best_practises/no_global_import.rs b/toolchains/solidity/core/crates/linter-lib/src/rules/best_practises/no_global_import.rs index a205ede8..9ce99f5f 100644 --- a/toolchains/solidity/core/crates/linter-lib/src/rules/best_practises/no_global_import.rs +++ b/toolchains/solidity/core/crates/linter-lib/src/rules/best_practises/no_global_import.rs @@ -29,7 +29,6 @@ impl RuleType for NoGlobalImport { source: None, message: DEFAULT_MESSAGE.to_string(), uri: _file.path.clone(), - }); } res diff --git a/toolchains/solidity/core/crates/linter-lib/src/rules/best_practises/one_contract_per_file.rs b/toolchains/solidity/core/crates/linter-lib/src/rules/best_practises/one_contract_per_file.rs index ca6869bd..516f1db6 100644 --- a/toolchains/solidity/core/crates/linter-lib/src/rules/best_practises/one_contract_per_file.rs +++ b/toolchains/solidity/core/crates/linter-lib/src/rules/best_practises/one_contract_per_file.rs @@ -34,7 +34,6 @@ impl OneContractPerFile { code: None, source: None, uri: file.path.clone(), - } } } diff --git a/toolchains/solidity/core/crates/linter-lib/src/rules/best_practises/payable_fallback.rs b/toolchains/solidity/core/crates/linter-lib/src/rules/best_practises/payable_fallback.rs index d3c4bca0..8d798e06 100644 --- a/toolchains/solidity/core/crates/linter-lib/src/rules/best_practises/payable_fallback.rs +++ b/toolchains/solidity/core/crates/linter-lib/src/rules/best_practises/payable_fallback.rs @@ -32,7 +32,6 @@ impl RuleType for PayableFallback { source: None, message: DEFAULT_MESSAGE.to_string(), uri: file.path.clone(), - }); } res diff --git a/toolchains/solidity/core/crates/linter-lib/src/rules/best_practises/reason_string.rs b/toolchains/solidity/core/crates/linter-lib/src/rules/best_practises/reason_string.rs index 62ae27cb..fb6ca252 100644 --- a/toolchains/solidity/core/crates/linter-lib/src/rules/best_practises/reason_string.rs +++ b/toolchains/solidity/core/crates/linter-lib/src/rules/best_practises/reason_string.rs @@ -40,7 +40,6 @@ impl ReasonString { code: None, source: None, uri: file.path.clone(), - } } } diff --git a/toolchains/solidity/core/crates/linter-lib/src/rules/naming/const_name_snakecase.rs b/toolchains/solidity/core/crates/linter-lib/src/rules/naming/const_name_snakecase.rs index e53c884d..5f3c66ed 100644 --- a/toolchains/solidity/core/crates/linter-lib/src/rules/naming/const_name_snakecase.rs +++ b/toolchains/solidity/core/crates/linter-lib/src/rules/naming/const_name_snakecase.rs @@ -34,7 +34,6 @@ impl ConstNameSnakeCase { code: None, source: None, uri: file.path.clone(), - } } } diff --git a/toolchains/solidity/core/crates/linter-lib/src/rules/naming/contract_name_camelcase.rs b/toolchains/solidity/core/crates/linter-lib/src/rules/naming/contract_name_camelcase.rs index 13b68599..e5871e2f 100644 --- a/toolchains/solidity/core/crates/linter-lib/src/rules/naming/contract_name_camelcase.rs +++ b/toolchains/solidity/core/crates/linter-lib/src/rules/naming/contract_name_camelcase.rs @@ -34,7 +34,6 @@ impl ContractNameCamelCase { code: None, source: None, uri: file.path.clone(), - } } } diff --git a/toolchains/solidity/core/crates/linter-lib/src/rules/naming/event_name_camelcase.rs b/toolchains/solidity/core/crates/linter-lib/src/rules/naming/event_name_camelcase.rs index 84cd6d82..840226e2 100644 --- a/toolchains/solidity/core/crates/linter-lib/src/rules/naming/event_name_camelcase.rs +++ b/toolchains/solidity/core/crates/linter-lib/src/rules/naming/event_name_camelcase.rs @@ -34,7 +34,6 @@ impl EventNameCamelCase { code: None, source: None, uri: file.path.clone(), - } } } diff --git a/toolchains/solidity/core/crates/linter-lib/src/rules/naming/foundry_test_functions.rs b/toolchains/solidity/core/crates/linter-lib/src/rules/naming/foundry_test_functions.rs index 014eca89..51128bda 100644 --- a/toolchains/solidity/core/crates/linter-lib/src/rules/naming/foundry_test_functions.rs +++ b/toolchains/solidity/core/crates/linter-lib/src/rules/naming/foundry_test_functions.rs @@ -43,7 +43,6 @@ impl FoundryTestFunctions { code: None, source: None, uri: file.path.clone(), - } } } diff --git a/toolchains/solidity/core/crates/linter-lib/src/rules/naming/func_name_mixedcase.rs b/toolchains/solidity/core/crates/linter-lib/src/rules/naming/func_name_mixedcase.rs index 1b621956..0c24dc78 100644 --- a/toolchains/solidity/core/crates/linter-lib/src/rules/naming/func_name_mixedcase.rs +++ b/toolchains/solidity/core/crates/linter-lib/src/rules/naming/func_name_mixedcase.rs @@ -34,7 +34,6 @@ impl FuncNameMixedCase { code: None, source: None, uri: file.path.clone(), - } } } diff --git a/toolchains/solidity/core/crates/linter-lib/src/rules/naming/func_param_name_mixedcase.rs b/toolchains/solidity/core/crates/linter-lib/src/rules/naming/func_param_name_mixedcase.rs index 631b08c5..54d88752 100644 --- a/toolchains/solidity/core/crates/linter-lib/src/rules/naming/func_param_name_mixedcase.rs +++ b/toolchains/solidity/core/crates/linter-lib/src/rules/naming/func_param_name_mixedcase.rs @@ -33,7 +33,6 @@ impl FuncParamNameMixedCase { code: None, source: None, uri: file.path.clone(), - } } } diff --git a/toolchains/solidity/core/crates/linter-lib/src/rules/naming/modifier_name_mixedcase.rs b/toolchains/solidity/core/crates/linter-lib/src/rules/naming/modifier_name_mixedcase.rs index 529e712f..48fcd0aa 100644 --- a/toolchains/solidity/core/crates/linter-lib/src/rules/naming/modifier_name_mixedcase.rs +++ b/toolchains/solidity/core/crates/linter-lib/src/rules/naming/modifier_name_mixedcase.rs @@ -34,7 +34,6 @@ impl ModifierNameMixedcase { code: None, source: None, uri: file.path.clone(), - } } } diff --git a/toolchains/solidity/core/crates/linter-lib/src/rules/naming/named_parameters_mapping.rs b/toolchains/solidity/core/crates/linter-lib/src/rules/naming/named_parameters_mapping.rs index ba5d2cad..78a59639 100644 --- a/toolchains/solidity/core/crates/linter-lib/src/rules/naming/named_parameters_mapping.rs +++ b/toolchains/solidity/core/crates/linter-lib/src/rules/naming/named_parameters_mapping.rs @@ -58,7 +58,6 @@ impl NamedParametersMapping { code: None, source: None, uri: file.path.clone(), - } } } diff --git a/toolchains/solidity/core/crates/linter-lib/src/rules/naming/private_vars_leading_underscore.rs b/toolchains/solidity/core/crates/linter-lib/src/rules/naming/private_vars_leading_underscore.rs index 23a4d657..c2eb25bc 100644 --- a/toolchains/solidity/core/crates/linter-lib/src/rules/naming/private_vars_leading_underscore.rs +++ b/toolchains/solidity/core/crates/linter-lib/src/rules/naming/private_vars_leading_underscore.rs @@ -44,7 +44,6 @@ impl PrivateVarsLeadingUnderscore { code: None, source: None, uri: file.path.clone(), - } } } diff --git a/toolchains/solidity/core/crates/linter-lib/src/rules/naming/use_forbidden_name.rs b/toolchains/solidity/core/crates/linter-lib/src/rules/naming/use_forbidden_name.rs index 94490f2f..94781d9b 100644 --- a/toolchains/solidity/core/crates/linter-lib/src/rules/naming/use_forbidden_name.rs +++ b/toolchains/solidity/core/crates/linter-lib/src/rules/naming/use_forbidden_name.rs @@ -33,7 +33,6 @@ impl UseForbiddenName { code: None, source: None, uri: file.path.clone(), - } } } diff --git a/toolchains/solidity/core/crates/linter-lib/src/rules/naming/var_name_mixedcase.rs b/toolchains/solidity/core/crates/linter-lib/src/rules/naming/var_name_mixedcase.rs index 8a69e693..9fc95ed1 100644 --- a/toolchains/solidity/core/crates/linter-lib/src/rules/naming/var_name_mixedcase.rs +++ b/toolchains/solidity/core/crates/linter-lib/src/rules/naming/var_name_mixedcase.rs @@ -34,7 +34,6 @@ impl VarNameMixedCase { code: None, source: None, uri: file.path.clone(), - } } } diff --git a/toolchains/solidity/core/crates/linter-lib/src/rules/order/import_on_top.rs b/toolchains/solidity/core/crates/linter-lib/src/rules/order/import_on_top.rs index b858a93f..2518db39 100644 --- a/toolchains/solidity/core/crates/linter-lib/src/rules/order/import_on_top.rs +++ b/toolchains/solidity/core/crates/linter-lib/src/rules/order/import_on_top.rs @@ -35,7 +35,6 @@ impl ImportOnTop { code: None, source: None, uri: file.path.clone(), - } } } diff --git a/toolchains/solidity/core/crates/linter-lib/src/rules/order/ordering.rs b/toolchains/solidity/core/crates/linter-lib/src/rules/order/ordering.rs index ba0a32de..60afa75a 100644 --- a/toolchains/solidity/core/crates/linter-lib/src/rules/order/ordering.rs +++ b/toolchains/solidity/core/crates/linter-lib/src/rules/order/ordering.rs @@ -298,7 +298,6 @@ impl OrderingVisitor { code: None, source: None, uri: file.path.clone(), - } } diff --git a/toolchains/solidity/core/crates/linter-lib/src/rules/order/visibility_modifier_order.rs b/toolchains/solidity/core/crates/linter-lib/src/rules/order/visibility_modifier_order.rs index 23a35f4b..feff35a4 100644 --- a/toolchains/solidity/core/crates/linter-lib/src/rules/order/visibility_modifier_order.rs +++ b/toolchains/solidity/core/crates/linter-lib/src/rules/order/visibility_modifier_order.rs @@ -32,7 +32,6 @@ impl RuleType for VisibilityModiferOrder { source: None, message: DEFAULT_MESSAGE.to_string(), uri: _file.path.clone(), - }); } res diff --git a/toolchains/solidity/core/crates/linter-lib/src/rules/security/avoid_tx_origin.rs b/toolchains/solidity/core/crates/linter-lib/src/rules/security/avoid_tx_origin.rs index 804e7d71..8186ca48 100644 --- a/toolchains/solidity/core/crates/linter-lib/src/rules/security/avoid_tx_origin.rs +++ b/toolchains/solidity/core/crates/linter-lib/src/rules/security/avoid_tx_origin.rs @@ -50,7 +50,6 @@ impl AvoidTxOrigin { code: None, source: None, uri: file.path.clone(), - } } } diff --git a/toolchains/solidity/core/crates/linter-lib/src/rules/security/func_visibility.rs b/toolchains/solidity/core/crates/linter-lib/src/rules/security/func_visibility.rs index 2e9ce6be..b6348fc1 100644 --- a/toolchains/solidity/core/crates/linter-lib/src/rules/security/func_visibility.rs +++ b/toolchains/solidity/core/crates/linter-lib/src/rules/security/func_visibility.rs @@ -42,7 +42,6 @@ impl FuncVisibility { code: None, source: None, uri: file.path.clone(), - } } } diff --git a/toolchains/solidity/core/crates/linter-lib/src/rules/security/no_inline_assembly.rs b/toolchains/solidity/core/crates/linter-lib/src/rules/security/no_inline_assembly.rs index 817636c3..c6f717e9 100644 --- a/toolchains/solidity/core/crates/linter-lib/src/rules/security/no_inline_assembly.rs +++ b/toolchains/solidity/core/crates/linter-lib/src/rules/security/no_inline_assembly.rs @@ -33,7 +33,6 @@ impl NoInlineAssembly { code: None, source: None, uri: file.path.clone(), - } } } diff --git a/toolchains/solidity/core/crates/linter-lib/src/rules/security/not_rely_on_time.rs b/toolchains/solidity/core/crates/linter-lib/src/rules/security/not_rely_on_time.rs index b1260f94..413a57ee 100644 --- a/toolchains/solidity/core/crates/linter-lib/src/rules/security/not_rely_on_time.rs +++ b/toolchains/solidity/core/crates/linter-lib/src/rules/security/not_rely_on_time.rs @@ -33,7 +33,6 @@ impl NotRelyOnTime { code: None, source: None, uri: file.path.clone(), - } } } diff --git a/toolchains/solidity/core/crates/linter-lib/src/rules/security/state_visibility.rs b/toolchains/solidity/core/crates/linter-lib/src/rules/security/state_visibility.rs index 1f6c1617..9efbf4a6 100644 --- a/toolchains/solidity/core/crates/linter-lib/src/rules/security/state_visibility.rs +++ b/toolchains/solidity/core/crates/linter-lib/src/rules/security/state_visibility.rs @@ -33,7 +33,6 @@ impl StateVisibility { code: None, source: None, uri: file.path.clone(), - } } } diff --git a/toolchains/solidity/core/crates/linter-lib/src/types.rs b/toolchains/solidity/core/crates/linter-lib/src/types.rs index 17e2a17d..c1a6a7af 100644 --- a/toolchains/solidity/core/crates/linter-lib/src/types.rs +++ b/toolchains/solidity/core/crates/linter-lib/src/types.rs @@ -13,26 +13,6 @@ pub use file_diags::FileDiags; pub type LintResult = Result; - - - - - - //////////////////////////////////////////////////////////// /////////////////// RELATED TYPES: ///////////////////////// //////////////////////////////////////////////////////////// - - - - - - - - - - - - - - diff --git a/toolchains/solidity/core/crates/linter-lib/src/types/file_diags.rs b/toolchains/solidity/core/crates/linter-lib/src/types/file_diags.rs index 89cdbf00..3118048d 100644 --- a/toolchains/solidity/core/crates/linter-lib/src/types/file_diags.rs +++ b/toolchains/solidity/core/crates/linter-lib/src/types/file_diags.rs @@ -1,6 +1,6 @@ -use std::fmt; -use serde::{Serialize, Deserialize}; use super::LintDiag; +use serde::{Deserialize, Serialize}; +use std::fmt; #[derive(Clone, Debug, Serialize, Deserialize)] pub struct FileDiags { @@ -62,12 +62,7 @@ impl FileDiags { impl fmt::Display for FileDiags { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { for (idx, diag) in self.diags.iter().enumerate() { - write!( - f, - "{}\n{}", - diag, - self.format_highlighted_lines(idx) - )?; + write!(f, "{}\n{}", diag, self.format_highlighted_lines(idx))?; } Ok(()) } @@ -97,4 +92,4 @@ fn try_trim_max_offset(line: &str, max_offset: usize) -> (&str, usize) { } } (&line[offset..], offset) -} \ No newline at end of file +} diff --git a/toolchains/solidity/core/crates/linter-lib/src/types/lint_diag.rs b/toolchains/solidity/core/crates/linter-lib/src/types/lint_diag.rs index df25a1fe..2ad491a5 100644 --- a/toolchains/solidity/core/crates/linter-lib/src/types/lint_diag.rs +++ b/toolchains/solidity/core/crates/linter-lib/src/types/lint_diag.rs @@ -1,6 +1,6 @@ -use std::fmt; -use serde::{Serialize, Deserialize}; use super::{Range, Severity}; +use serde::{Deserialize, Serialize}; +use std::fmt; #[derive(Clone, Serialize, Deserialize, Debug)] pub struct LintDiag { @@ -27,7 +27,7 @@ pub struct LintDiag { pub uri: Uri, } -impl<'a> fmt::Display for LintDiag { +impl fmt::Display for LintDiag { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { write!( f, @@ -47,4 +47,4 @@ pub enum NumberOrString { String(String), } -type Uri = String; \ No newline at end of file +type Uri = String; diff --git a/toolchains/solidity/core/crates/linter-lib/src/types/position.rs b/toolchains/solidity/core/crates/linter-lib/src/types/position.rs index 060194f6..90eeae51 100644 --- a/toolchains/solidity/core/crates/linter-lib/src/types/position.rs +++ b/toolchains/solidity/core/crates/linter-lib/src/types/position.rs @@ -1,4 +1,4 @@ -use serde::{Serialize, Deserialize}; +use serde::{Deserialize, Serialize}; #[derive(Clone, Serialize, Deserialize, Debug)] pub struct Position { @@ -10,4 +10,4 @@ impl PartialEq for Position { fn eq(&self, other: &Self) -> bool { self.line == other.line && self.character == other.character } -} \ No newline at end of file +} diff --git a/toolchains/solidity/core/crates/linter-lib/src/types/range.rs b/toolchains/solidity/core/crates/linter-lib/src/types/range.rs index 93aec2b0..c8ec69ab 100644 --- a/toolchains/solidity/core/crates/linter-lib/src/types/range.rs +++ b/toolchains/solidity/core/crates/linter-lib/src/types/range.rs @@ -1,5 +1,5 @@ -use serde::{Serialize, Deserialize}; use super::Position; +use serde::{Deserialize, Serialize}; #[derive(Clone, Serialize, Deserialize, Debug)] pub struct Range { @@ -26,4 +26,4 @@ impl Range { length } } -} \ No newline at end of file +} diff --git a/toolchains/solidity/core/crates/linter-lib/src/types/severity.rs b/toolchains/solidity/core/crates/linter-lib/src/types/severity.rs index 1fd8a989..949947f5 100644 --- a/toolchains/solidity/core/crates/linter-lib/src/types/severity.rs +++ b/toolchains/solidity/core/crates/linter-lib/src/types/severity.rs @@ -1,6 +1,6 @@ -use std::fmt; use colored::Colorize; -use serde::{Serialize, Deserialize}; +use serde::{Deserialize, Serialize}; +use std::fmt; #[derive(PartialEq, Eq, Clone, Copy, Serialize, Deserialize, Debug)] pub enum Severity { @@ -24,4 +24,4 @@ impl fmt::Display for Severity { }; write!(f, "{}", severity) } -} \ No newline at end of file +} diff --git a/toolchains/solidity/core/crates/linter-server/src/lib.rs b/toolchains/solidity/core/crates/linter-server/src/lib.rs index f1e12844..9adf3568 100644 --- a/toolchains/solidity/core/crates/linter-server/src/lib.rs +++ b/toolchains/solidity/core/crates/linter-server/src/lib.rs @@ -84,7 +84,8 @@ impl Handler for Backend { let diags_res = linter.parse_content(&filepath, ¶ms.text_document.text); if let Ok(diags) = diags_res { - let diags = diags.diags + let diags = diags + .diags .iter() .map(|d| diagnostic_from_lintdiag(d.clone())) .collect(); @@ -115,7 +116,8 @@ impl Handler for Backend { let diags_res = linter.parse_content(&filepath, ¶ms.content_changes[0].text); if let Ok(diags) = diags_res { - let diags = diags.diags + let diags = diags + .diags .iter() .map(|d| diagnostic_from_lintdiag(d.clone())) .collect(); From 6d1b3e08a8ae6e605479ac5d33f8456c4fe96bbf Mon Sep 17 00:00:00 2001 From: 0xMemoryGrinder <35138272+0xMemoryGrinder@users.noreply.github.com> Date: Sun, 5 Nov 2023 23:12:00 -0500 Subject: [PATCH 286/325] style(solidity/linter-lib): renamed redundant variable name --- toolchains/solidity/core/crates/linter-lib/tests/linter.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/toolchains/solidity/core/crates/linter-lib/tests/linter.rs b/toolchains/solidity/core/crates/linter-lib/tests/linter.rs index 9afcc9a8..cfc7bde1 100644 --- a/toolchains/solidity/core/crates/linter-lib/tests/linter.rs +++ b/toolchains/solidity/core/crates/linter-lib/tests/linter.rs @@ -61,9 +61,9 @@ fn test_linter(config: &str, source: &str, expected_findings: &Vec) { let mut not_found = false; match result { - Ok(diags) => { + Ok(file_diags) => { let mut found; - for (_, diag) in diags.diags.iter().enumerate() { + for (_, diag) in file_diags.diags.iter().enumerate() { found = false; for (_, expected_finding) in expected_findings.iter().enumerate() { if (diag.range.start == expected_finding.start) From 55442b99081677845ea9fec1c9f79c68595ddb35 Mon Sep 17 00:00:00 2001 From: 0xMemoryGrinder <35138272+0xMemoryGrinder@users.noreply.github.com> Date: Mon, 6 Nov 2023 13:01:12 -0500 Subject: [PATCH 287/325] feat(libs/lsp-handler): added correct logging in handler --- libs/lsp-handler/Cargo.lock | 2 +- libs/lsp-handler/Cargo.toml | 2 +- libs/lsp-handler/src/handler.rs | 125 +++++++++--------- toolchains/solidity/core/Cargo.lock | 2 +- .../solidity/core/crates/extension/Cargo.toml | 2 +- .../core/crates/linter-server/Cargo.toml | 2 +- 6 files changed, 66 insertions(+), 69 deletions(-) diff --git a/libs/lsp-handler/Cargo.lock b/libs/lsp-handler/Cargo.lock index e7a64d41..a8840653 100644 --- a/libs/lsp-handler/Cargo.lock +++ b/libs/lsp-handler/Cargo.lock @@ -81,7 +81,7 @@ checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d" [[package]] name = "osmium-libs-lsp-handler" -version = "0.0.2" +version = "0.0.3" dependencies = [ "js-sys", "lsp-types", diff --git a/libs/lsp-handler/Cargo.toml b/libs/lsp-handler/Cargo.toml index 6bb65123..b912090b 100644 --- a/libs/lsp-handler/Cargo.toml +++ b/libs/lsp-handler/Cargo.toml @@ -3,7 +3,7 @@ name = "osmium-libs-lsp-handler" description = "Dispatch LSP messages to all hooked handlers" license = "GPL-3.0-or-later" repository = "https://github.com/astrodevs-labs/osmium" -version = "0.0.2" +version = "0.0.3" edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/libs/lsp-handler/src/handler.rs b/libs/lsp-handler/src/handler.rs index 5f879336..75eaaea4 100644 --- a/libs/lsp-handler/src/handler.rs +++ b/libs/lsp-handler/src/handler.rs @@ -1,5 +1,6 @@ use crate::jsonrpc::{Error, Result}; +use crate::helpers::log; use lsp_types::request::{ GotoDeclarationParams, GotoDeclarationResponse, GotoImplementationParams, GotoImplementationResponse, GotoTypeDefinitionParams, GotoTypeDefinitionResponse, @@ -58,7 +59,7 @@ pub trait Handler { /// client. It doesn't necessarily mean that its content is presented in an editor. fn did_open(&self, params: DidOpenTextDocumentParams) { let _ = params; - eprintln!("Got a textDocument/didOpen notification, but it is not implemented"); + log("Got a textDocument/didOpen notification, but it is not implemented"); } /// The [`textDocument/didChange`] notification is sent from the client to the server to signal @@ -70,7 +71,7 @@ pub trait Handler { /// document for the server to interpret. fn did_change(&self, params: DidChangeTextDocumentParams) { let _ = params; - eprintln!("Got a textDocument/didChange notification, but it is not implemented"); + log("Got a textDocument/didChange notification, but it is not implemented"); } /// The [`textDocument/willSave`] notification is sent from the client to the server before the @@ -79,7 +80,7 @@ pub trait Handler { /// [`textDocument/willSave`]: https://microsoft.github.io/language-server-protocol/specification#textDocument_willSave fn will_save(&self, params: WillSaveTextDocumentParams) { let _ = params; - eprintln!("Got a textDocument/willSave notification, but it is not implemented"); + log("Got a textDocument/willSave notification, but it is not implemented"); } /// The [`textDocument/willSaveWaitUntil`] request is sent from the client to the server before @@ -97,7 +98,7 @@ pub trait Handler { params: WillSaveTextDocumentParams, ) -> Result>> { let _ = params; - eprintln!("Got a textDocument/willSaveWaitUntil request, but it is not implemented"); + log("Got a textDocument/willSaveWaitUntil request, but it is not implemented"); Err(Error::method_not_found()) } @@ -107,7 +108,7 @@ pub trait Handler { /// [`textDocument/didSave`]: https://microsoft.github.io/language-server-protocol/specification#textDocument_didSave fn did_save(&self, params: DidSaveTextDocumentParams) { let _ = params; - eprintln!("Got a textDocument/didSave notification, but it is not implemented"); + log("Got a textDocument/didSave notification, but it is not implemented"); } /// The [`textDocument/didClose`] notification is sent from the client to the server when the @@ -119,7 +120,7 @@ pub trait Handler { /// URI is a file URI, the truth now exists on disk). fn did_close(&self, params: DidCloseTextDocumentParams) { let _ = params; - eprintln!("Got a textDocument/didClose notification, but it is not implemented"); + log("Got a textDocument/didClose notification, but it is not implemented"); } // Language Features @@ -146,7 +147,7 @@ pub trait Handler { params: GotoDeclarationParams, ) -> Result> { let _ = params; - eprintln!("Got a textDocument/declaration request, but it is not implemented"); + log("Got a textDocument/declaration request, but it is not implemented"); Err(Error::method_not_found()) } @@ -170,7 +171,7 @@ pub trait Handler { params: GotoDefinitionParams, ) -> Result> { let _ = params; - eprintln!("Got a textDocument/definition request, but it is not implemented"); + log("Got a textDocument/definition request, but it is not implemented"); Err(Error::method_not_found()) } @@ -196,7 +197,7 @@ pub trait Handler { params: GotoTypeDefinitionParams, ) -> Result> { let _ = params; - eprintln!("Got a textDocument/typeDefinition request, but it is not implemented"); + log("Got a textDocument/typeDefinition request, but it is not implemented"); Err(Error::method_not_found()) } @@ -222,7 +223,7 @@ pub trait Handler { params: GotoImplementationParams, ) -> Result> { let _ = params; - eprintln!("Got a textDocument/implementation request, but it is not implemented"); + log("Got a textDocument/implementation request, but it is not implemented"); Err(Error::method_not_found()) } @@ -233,7 +234,7 @@ pub trait Handler { fn references(&self, params: ReferenceParams) -> Result>> { let _ = params; - eprintln!("Got a textDocument/references request, but it is not implemented"); + log("Got a textDocument/references request, but it is not implemented"); Err(Error::method_not_found()) } @@ -260,7 +261,7 @@ pub trait Handler { params: CallHierarchyPrepareParams, ) -> Result>> { let _ = params; - eprintln!("Got a textDocument/prepareCallHierarchy request, but it is not implemented"); + log("Got a textDocument/prepareCallHierarchy request, but it is not implemented"); Err(Error::method_not_found()) } @@ -281,7 +282,7 @@ pub trait Handler { params: CallHierarchyIncomingCallsParams, ) -> Result>> { let _ = params; - eprintln!("Got a callHierarchy/incomingCalls request, but it is not implemented"); + log("Got a callHierarchy/incomingCalls request, but it is not implemented"); Err(Error::method_not_found()) } @@ -302,7 +303,7 @@ pub trait Handler { params: CallHierarchyOutgoingCallsParams, ) -> Result>> { let _ = params; - eprintln!("Got a callHierarchy/outgoingCalls request, but it is not implemented"); + log("Got a callHierarchy/outgoingCalls request, but it is not implemented"); Err(Error::method_not_found()) } @@ -327,7 +328,7 @@ pub trait Handler { params: TypeHierarchyPrepareParams, ) -> Result>> { let _ = params; - eprintln!("Got a textDocument/prepareTypeHierarchy request, but it is not implemented"); + log("Got a textDocument/prepareTypeHierarchy request, but it is not implemented"); Err(Error::method_not_found()) } @@ -347,7 +348,7 @@ pub trait Handler { params: TypeHierarchySupertypesParams, ) -> Result>> { let _ = params; - eprintln!("Got a typeHierarchy/supertypes request, but it is not implemented"); + log("Got a typeHierarchy/supertypes request, but it is not implemented"); Err(Error::method_not_found()) } @@ -367,7 +368,7 @@ pub trait Handler { params: TypeHierarchySubtypesParams, ) -> Result>> { let _ = params; - eprintln!("Got a typeHierarchy/subtypes request, but it is not implemented"); + log("Got a typeHierarchy/subtypes request, but it is not implemented"); Err(Error::method_not_found()) } @@ -386,7 +387,7 @@ pub trait Handler { params: DocumentHighlightParams, ) -> Result>> { let _ = params; - eprintln!("Got a textDocument/documentHighlight request, but it is not implemented"); + log("Got a textDocument/documentHighlight request, but it is not implemented"); Err(Error::method_not_found()) } @@ -409,7 +410,7 @@ pub trait Handler { /// ``` fn document_link(&self, params: DocumentLinkParams) -> Result>> { let _ = params; - eprintln!("Got a textDocument/documentLink request, but it is not implemented"); + log("Got a textDocument/documentLink request, but it is not implemented"); Err(Error::method_not_found()) } @@ -422,7 +423,7 @@ pub trait Handler { /// resource, like another text document or a web site. fn document_link_resolve(&self, params: DocumentLink) -> Result { let _ = params; - eprintln!("Got a documentLink/resolve request, but it is not implemented"); + log("Got a documentLink/resolve request, but it is not implemented"); Err(Error::method_not_found()) } @@ -435,7 +436,7 @@ pub trait Handler { /// documentation for the symbol at the given text document position. fn hover(&self, params: HoverParams) -> Result> { let _ = params; - eprintln!("Got a textDocument/hover request, but it is not implemented"); + log("Got a textDocument/hover request, but it is not implemented"); Err(Error::method_not_found()) } @@ -446,7 +447,7 @@ pub trait Handler { fn code_lens(&self, params: CodeLensParams) -> Result>> { let _ = params; - eprintln!("Got a textDocument/codeLens request, but it is not implemented"); + log("Got a textDocument/codeLens request, but it is not implemented"); Err(Error::method_not_found()) } @@ -457,7 +458,7 @@ pub trait Handler { fn code_lens_resolve(&self, params: CodeLens) -> Result { let _ = params; - eprintln!("Got a codeLens/resolve request, but it is not implemented"); + log("Got a codeLens/resolve request, but it is not implemented"); Err(Error::method_not_found()) } @@ -472,7 +473,7 @@ pub trait Handler { fn folding_range(&self, params: FoldingRangeParams) -> Result>> { let _ = params; - eprintln!("Got a textDocument/foldingRange request, but it is not implemented"); + log("Got a textDocument/foldingRange request, but it is not implemented"); Err(Error::method_not_found()) } @@ -491,7 +492,7 @@ pub trait Handler { fn selection_range(&self, params: SelectionRangeParams) -> Result>> { let _ = params; - eprintln!("Got a textDocument/selectionRange request, but it is not implemented"); + log("Got a textDocument/selectionRange request, but it is not implemented"); Err(Error::method_not_found()) } @@ -513,7 +514,7 @@ pub trait Handler { params: DocumentSymbolParams, ) -> Result> { let _ = params; - eprintln!("Got a textDocument/documentSymbol request, but it is not implemented"); + log("Got a textDocument/documentSymbol request, but it is not implemented"); Err(Error::method_not_found()) } @@ -538,7 +539,7 @@ pub trait Handler { params: SemanticTokensParams, ) -> Result> { let _ = params; - eprintln!("Got a textDocument/semanticTokens/full request, but it is not implemented"); + log("Got a textDocument/semanticTokens/full request, but it is not implemented"); Err(Error::method_not_found()) } @@ -559,9 +560,7 @@ pub trait Handler { params: SemanticTokensDeltaParams, ) -> Result> { let _ = params; - eprintln!( - "Got a textDocument/semanticTokens/full/delta request, but it is not implemented" - ); + log("Got a textDocument/semanticTokens/full/delta request, but it is not implemented"); Err(Error::method_not_found()) } @@ -587,7 +586,7 @@ pub trait Handler { params: SemanticTokensRangeParams, ) -> Result> { let _ = params; - eprintln!("Got a textDocument/semanticTokens/range request, but it is not implemented"); + log("Got a textDocument/semanticTokens/range request, but it is not implemented"); Err(Error::method_not_found()) } @@ -603,7 +602,7 @@ pub trait Handler { fn inline_value(&self, params: InlineValueParams) -> Result>> { let _ = params; - eprintln!("Got a textDocument/inlineValue request, but it is not implemented"); + log("Got a textDocument/inlineValue request, but it is not implemented"); Err(Error::method_not_found()) } @@ -619,7 +618,7 @@ pub trait Handler { fn inlay_hint(&self, params: InlayHintParams) -> Result>> { let _ = params; - eprintln!("Got a textDocument/inlayHint request, but it is not implemented"); + log("Got a textDocument/inlayHint request, but it is not implemented"); Err(Error::method_not_found()) } @@ -648,7 +647,7 @@ pub trait Handler { fn inlay_hint_resolve(&self, params: InlayHint) -> Result { let _ = params; - eprintln!("Got a inlayHint/resolve request, but it is not implemented"); + log("Got a inlayHint/resolve request, but it is not implemented"); Err(Error::method_not_found()) } @@ -678,7 +677,7 @@ pub trait Handler { fn moniker(&self, params: MonikerParams) -> Result>> { let _ = params; - eprintln!("Got a textDocument/moniker request, but it is not implemented"); + log("Got a textDocument/moniker request, but it is not implemented"); Err(Error::method_not_found()) } @@ -703,7 +702,7 @@ pub trait Handler { fn completion(&self, params: CompletionParams) -> Result> { let _ = params; - eprintln!("Got a textDocument/completion request, but it is not implemented"); + log("Got a textDocument/completion request, but it is not implemented"); Err(Error::method_not_found()) } @@ -714,7 +713,7 @@ pub trait Handler { fn completion_resolve(&self, params: CompletionItem) -> Result { let _ = params; - eprintln!("Got a completionItem/resolve request, but it is not implemented"); + log("Got a completionItem/resolve request, but it is not implemented"); Err(Error::method_not_found()) } @@ -738,7 +737,7 @@ pub trait Handler { params: DocumentDiagnosticParams, ) -> Result { let _ = params; - eprintln!("Got a textDocument/diagnostic request, but it is not implemented"); + log("Got a textDocument/diagnostic request, but it is not implemented"); Err(Error::method_not_found()) } @@ -776,7 +775,7 @@ pub trait Handler { params: WorkspaceDiagnosticParams, ) -> Result { let _ = params; - eprintln!("Got a workspace/diagnostic request, but it is not implemented"); + log("Got a workspace/diagnostic request, but it is not implemented"); Err(Error::method_not_found()) } @@ -787,7 +786,7 @@ pub trait Handler { fn signature_help(&self, params: SignatureHelpParams) -> Result> { let _ = params; - eprintln!("Got a textDocument/signatureHelp request, but it is not implemented"); + log("Got a textDocument/signatureHelp request, but it is not implemented"); Err(Error::method_not_found()) } @@ -847,7 +846,7 @@ pub trait Handler { fn code_action(&self, params: CodeActionParams) -> Result> { let _ = params; - eprintln!("Got a textDocument/codeAction request, but it is not implemented"); + log("Got a textDocument/codeAction request, but it is not implemented"); Err(Error::method_not_found()) } @@ -865,7 +864,7 @@ pub trait Handler { fn code_action_resolve(&self, params: CodeAction) -> Result { let _ = params; - eprintln!("Got a codeAction/resolve request, but it is not implemented"); + log("Got a codeAction/resolve request, but it is not implemented"); Err(Error::method_not_found()) } @@ -886,7 +885,7 @@ pub trait Handler { fn document_color(&self, params: DocumentColorParams) -> Result> { let _ = params; - eprintln!("Got a textDocument/documentColor request, but it is not implemented"); + log("Got a textDocument/documentColor request, but it is not implemented"); Err(Error::method_not_found()) } @@ -912,7 +911,7 @@ pub trait Handler { params: ColorPresentationParams, ) -> Result> { let _ = params; - eprintln!("Got a textDocument/colorPresentation request, but it is not implemented"); + log("Got a textDocument/colorPresentation request, but it is not implemented"); Err(Error::method_not_found()) } @@ -923,7 +922,7 @@ pub trait Handler { fn formatting(&self, params: DocumentFormattingParams) -> Result>> { let _ = params; - eprintln!("Got a textDocument/formatting request, but it is not implemented"); + log("Got a textDocument/formatting request, but it is not implemented"); Err(Error::method_not_found()) } @@ -937,7 +936,7 @@ pub trait Handler { params: DocumentRangeFormattingParams, ) -> Result>> { let _ = params; - eprintln!("Got a textDocument/rangeFormatting request, but it is not implemented"); + log("Got a textDocument/rangeFormatting request, but it is not implemented"); Err(Error::method_not_found()) } @@ -951,7 +950,7 @@ pub trait Handler { params: DocumentOnTypeFormattingParams, ) -> Result>> { let _ = params; - eprintln!("Got a textDocument/onTypeFormatting request, but it is not implemented"); + log("Got a textDocument/onTypeFormatting request, but it is not implemented"); Err(Error::method_not_found()) } @@ -963,7 +962,7 @@ pub trait Handler { fn rename(&self, params: RenameParams) -> Result> { let _ = params; - eprintln!("Got a textDocument/rename request, but it is not implemented"); + log("Got a textDocument/rename request, but it is not implemented"); Err(Error::method_not_found()) } @@ -981,7 +980,7 @@ pub trait Handler { params: TextDocumentPositionParams, ) -> Result> { let _ = params; - eprintln!("Got a textDocument/prepareRename request, but it is not implemented"); + log("Got a textDocument/prepareRename request, but it is not implemented"); Err(Error::method_not_found()) } @@ -1006,7 +1005,7 @@ pub trait Handler { params: LinkedEditingRangeParams, ) -> Result> { let _ = params; - eprintln!("Got a textDocument/linkedEditingRange request, but it is not implemented"); + log("Got a textDocument/linkedEditingRange request, but it is not implemented"); Err(Error::method_not_found()) } @@ -1031,7 +1030,7 @@ pub trait Handler { fn symbol(&self, params: WorkspaceSymbolParams) -> Result>> { let _ = params; - eprintln!("Got a workspace/symbol request, but it is not implemented"); + log("Got a workspace/symbol request, but it is not implemented"); Err(Error::method_not_found()) } @@ -1048,7 +1047,7 @@ pub trait Handler { fn symbol_resolve(&self, params: WorkspaceSymbol) -> Result { let _ = params; - eprintln!("Got a workspaceSymbol/resolve request, but it is not implemented"); + log("Got a workspaceSymbol/resolve request, but it is not implemented"); Err(Error::method_not_found()) } @@ -1059,7 +1058,7 @@ pub trait Handler { fn did_change_configuration(&self, params: DidChangeConfigurationParams) { let _ = params; - eprintln!("Got a workspace/didChangeConfiguration notification, but it is not implemented"); + log("Got a workspace/didChangeConfiguration notification, but it is not implemented"); } /// The [`workspace/didChangeWorkspaceFolders`] notification is sent from the client to the @@ -1078,9 +1077,7 @@ pub trait Handler { fn did_change_workspace_folders(&self, params: DidChangeWorkspaceFoldersParams) { let _ = params; - eprintln!( - "Got a workspace/didChangeWorkspaceFolders notification, but it is not implemented" - ); + log("Got a workspace/didChangeWorkspaceFolders notification, but it is not implemented"); } /// The [`workspace/willCreateFiles`] request is sent from the client to the server before @@ -1099,7 +1096,7 @@ pub trait Handler { fn will_create_files(&self, params: CreateFilesParams) -> Result> { let _ = params; - eprintln!("Got a workspace/willCreateFiles request, but it is not implemented"); + log("Got a workspace/willCreateFiles request, but it is not implemented"); Err(Error::method_not_found()) } @@ -1110,7 +1107,7 @@ pub trait Handler { fn did_create_files(&self, params: CreateFilesParams) { let _ = params; - eprintln!("Got a workspace/didCreateFiles notification, but it is not implemented"); + log("Got a workspace/didCreateFiles notification, but it is not implemented"); } /// The [`workspace/willRenameFiles`] request is sent from the client to the server before @@ -1129,7 +1126,7 @@ pub trait Handler { fn will_rename_files(&self, params: RenameFilesParams) -> Result> { let _ = params; - eprintln!("Got a workspace/willRenameFiles request, but it is not implemented"); + log("Got a workspace/willRenameFiles request, but it is not implemented"); Err(Error::method_not_found()) } @@ -1140,7 +1137,7 @@ pub trait Handler { fn did_rename_files(&self, params: RenameFilesParams) { let _ = params; - eprintln!("Got a workspace/didRenameFiles notification, but it is not implemented"); + log("Got a workspace/didRenameFiles notification, but it is not implemented"); } /// The [`workspace/willDeleteFiles`] request is sent from the client to the server before @@ -1160,7 +1157,7 @@ pub trait Handler { fn will_delete_files(&self, params: DeleteFilesParams) -> Result> { let _ = params; - eprintln!("Got a workspace/willDeleteFiles request, but it is not implemented"); + log("Got a workspace/willDeleteFiles request, but it is not implemented"); Err(Error::method_not_found()) } @@ -1171,7 +1168,7 @@ pub trait Handler { fn did_delete_files(&self, params: DeleteFilesParams) { let _ = params; - eprintln!("Got a workspace/didDeleteFiles notification, but it is not implemented"); + log("Got a workspace/didDeleteFiles notification, but it is not implemented"); } /// The [`workspace/didChangeWatchedFiles`] notification is sent from the client to the server @@ -1185,7 +1182,7 @@ pub trait Handler { fn did_change_watched_files(&self, params: DidChangeWatchedFilesParams) { let _ = params; - eprintln!("Got a workspace/didChangeWatchedFiles notification, but it is not implemented"); + log("Got a workspace/didChangeWatchedFiles notification, but it is not implemented"); } /// The [`workspace/executeCommand`] request is sent from the client to the server to trigger @@ -1198,7 +1195,7 @@ pub trait Handler { fn execute_command(&self, params: ExecuteCommandParams) -> Result> { let _ = params; - eprintln!("Got a workspace/executeCommand request, but it is not implemented"); + log("Got a workspace/executeCommand request, but it is not implemented"); Err(Error::method_not_found()) } diff --git a/toolchains/solidity/core/Cargo.lock b/toolchains/solidity/core/Cargo.lock index fc5dc822..1a4c3452 100644 --- a/toolchains/solidity/core/Cargo.lock +++ b/toolchains/solidity/core/Cargo.lock @@ -289,7 +289,7 @@ checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d" [[package]] name = "osmium-libs-lsp-handler" -version = "0.0.2" +version = "0.0.3" dependencies = [ "js-sys", "lsp-types", diff --git a/toolchains/solidity/core/crates/extension/Cargo.toml b/toolchains/solidity/core/crates/extension/Cargo.toml index abb885af..fd209f81 100644 --- a/toolchains/solidity/core/crates/extension/Cargo.toml +++ b/toolchains/solidity/core/crates/extension/Cargo.toml @@ -11,6 +11,6 @@ crate-type = ["cdylib", "rlib"] [dependencies] wasm-bindgen = "0.2.87" -osmium-libs-lsp-handler = { path = "../../../../../libs/lsp-handler", version = "0.0.2" } +osmium-libs-lsp-handler = { path = "../../../../../libs/lsp-handler", version = "0.0.3" } linter-server = { path= "../linter-server"} js-sys = "0.3.64" \ No newline at end of file diff --git a/toolchains/solidity/core/crates/linter-server/Cargo.toml b/toolchains/solidity/core/crates/linter-server/Cargo.toml index 69e4a87c..5158efd1 100644 --- a/toolchains/solidity/core/crates/linter-server/Cargo.toml +++ b/toolchains/solidity/core/crates/linter-server/Cargo.toml @@ -10,6 +10,6 @@ crate-type = ["cdylib", "rlib"] # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -osmium-libs-lsp-handler = { path = "../../../../../libs/lsp-handler", version = "0.0.2" } +osmium-libs-lsp-handler = { path = "../../../../../libs/lsp-handler", version = "0.0.3" } solidhunter-lib = { path = "../linter-lib", version = "0.1.0" } js-sys = "0.3.64" \ No newline at end of file From e2edb9294b37ea14cf584e96a053dd593dc14e14 Mon Sep 17 00:00:00 2001 From: 0xMemoryGrinder <35138272+0xMemoryGrinder@users.noreply.github.com> Date: Mon, 6 Nov 2023 13:09:31 -0500 Subject: [PATCH 288/325] refactor(libs/ast-extractor): removed temporary file for references which is not used --- libs/ast-extractor/Cargo.lock | 2 +- libs/ast-extractor/Cargo.toml | 2 +- libs/ast-extractor/src/retriever.rs | 3 - .../src/retriever/finder/find_node.rs | 91 ------------------- toolchains/solidity/core/Cargo.lock | 2 +- .../core/crates/linter-lib/Cargo.toml | 2 +- 6 files changed, 4 insertions(+), 98 deletions(-) delete mode 100644 libs/ast-extractor/src/retriever/finder/find_node.rs diff --git a/libs/ast-extractor/Cargo.lock b/libs/ast-extractor/Cargo.lock index 34b91cd2..0c54fe6f 100644 --- a/libs/ast-extractor/Cargo.lock +++ b/libs/ast-extractor/Cargo.lock @@ -4,7 +4,7 @@ version = 3 [[package]] name = "osmium-libs-solidity-ast-extractor" -version = "0.1.1" +version = "0.1.2" dependencies = [ "proc-macro2", "quote", diff --git a/libs/ast-extractor/Cargo.toml b/libs/ast-extractor/Cargo.toml index f924ba26..bac9c97f 100644 --- a/libs/ast-extractor/Cargo.toml +++ b/libs/ast-extractor/Cargo.toml @@ -3,7 +3,7 @@ name = "osmium-libs-solidity-ast-extractor" description = "Extracts the AST from a Solidity file" license = "GPL-3.0-or-later" repository = "https://github.com/astrodevs-labs/osmium" -version = "0.1.1" +version = "0.1.2" edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/libs/ast-extractor/src/retriever.rs b/libs/ast-extractor/src/retriever.rs index fff25843..ef3af863 100644 --- a/libs/ast-extractor/src/retriever.rs +++ b/libs/ast-extractor/src/retriever.rs @@ -34,9 +34,7 @@ pub use r#struct::*; mod udt; pub use udt::*; -mod finder; mod using; - pub use using::*; mod stmts; @@ -44,4 +42,3 @@ pub use stmts::*; mod block; pub use block::*; -pub use finder::*; diff --git a/libs/ast-extractor/src/retriever/finder/find_node.rs b/libs/ast-extractor/src/retriever/finder/find_node.rs deleted file mode 100644 index 9a137c41..00000000 --- a/libs/ast-extractor/src/retriever/finder/find_node.rs +++ /dev/null @@ -1,91 +0,0 @@ -/** - * find_node.rs - * Enum for all possible ast types that can be found - * author: 0xMemoryGrinder - */ -use syn_solidity::{ - EventParameter, Expr, ExprCall, ExprNew, ItemContract, ItemEnum, ItemError, ItemEvent, - ItemFunction, Modifier, SolIdent, Type, VariableDeclaration, VariableDefinition, Variant, -}; - -#[derive(Debug)] -pub enum FoundNode { - // Contracts - ContractDefName(ItemContract), - ContractDefInheritance(ItemContract, Modifier), - ContractInstantiation(ItemContract, Option, ExprNew), - - // Functions - FunctionDefName(ItemContract, ItemFunction), - FunctionDefParameterName( - ItemContract, - ItemFunction, - VariableDeclaration, - Option, - ), - - // Properties/Variables/Constants - PropertyDefName(ItemContract, VariableDefinition, SolIdent), - ConstantVariableDefName(VariableDefinition, SolIdent), - VariableDefName( - Option, - Option, - VariableDeclaration, - Option, - ), - - // Types and Identifiers - TypeUsage( - Option, - Option, - Option, - Type, - ), - IdentUsageCall(Option, Option, ExprCall), - IdentUsageName( - Option, - Option, - Option, - SolIdent, - ), - - // Structs - StructDefName(Option, SolIdent), - StructDefPropertyName(Option, VariableDeclaration, Option), - - // Enum - EnumDefName(Option, ItemEnum, SolIdent), - EnumDefValue(Option, ItemEnum, Variant, SolIdent), - - // Errors - ErrorDefName(Option, ItemError, SolIdent), - ErrorDefParameter(Option, ItemError, VariableDeclaration), - - // Events - EventDefName(ItemContract, ItemEvent, SolIdent), - EventDefParameter(ItemContract, ItemEvent, EventParameter), - // Contracts - //ContractScope(ItemContract, Option, SolPath), - - // Functions - //FunctionDefParameterType(ItemContract, ItemFunction, VariableDeclaration, Type), - - // Properties - //PropertyDefType(ItemContract, VariableDefinition, Type), - - // Variables - //VariableDefType(File,ItemContract, VarDeclDecl, VariableDeclaration, Type), - - // Structs - //StructUsageName(ItemContract, Option, Expr, Type), - //StructUsageProperty(ItemContract, Option, Expr, SolIdent, Type), - - // Errors - //ErrorUsageName(ItemContract, Option, ExprCall, SolIdent), - - // Events - //EventUsageName(ItemContract, Option, Expr, SolIdent), - - //TODO type cast - // TODO super ast node -} diff --git a/toolchains/solidity/core/Cargo.lock b/toolchains/solidity/core/Cargo.lock index 1a4c3452..d88e5ff9 100644 --- a/toolchains/solidity/core/Cargo.lock +++ b/toolchains/solidity/core/Cargo.lock @@ -303,7 +303,7 @@ dependencies = [ [[package]] name = "osmium-libs-solidity-ast-extractor" -version = "0.1.1" +version = "0.1.2" dependencies = [ "proc-macro2", "quote", diff --git a/toolchains/solidity/core/crates/linter-lib/Cargo.toml b/toolchains/solidity/core/crates/linter-lib/Cargo.toml index eb013ffb..ec4349f3 100644 --- a/toolchains/solidity/core/crates/linter-lib/Cargo.toml +++ b/toolchains/solidity/core/crates/linter-lib/Cargo.toml @@ -18,5 +18,5 @@ serde_json = "1.0.89" anyhow = "1.0" glob = "0.3.0" thiserror = "1.0" -osmium-libs-solidity-ast-extractor = { path = "../../../../../libs/ast-extractor", version = "0.1.1" } +osmium-libs-solidity-ast-extractor = { path = "../../../../../libs/ast-extractor", version = "0.1.2" } regex = "1.9.6" From 254fa5ed009dfe9a07dd01012be1634c80cb149c Mon Sep 17 00:00:00 2001 From: 0xMemoryGrinder <35138272+0xMemoryGrinder@users.noreply.github.com> Date: Mon, 6 Nov 2023 13:29:09 -0500 Subject: [PATCH 289/325] fix(cd): added tag prefix for extension versionning --- .github/workflows/cd.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index 7ff642a3..938c9ac2 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -151,8 +151,8 @@ jobs: - name: Set tag run: | - git tag ${{ steps.tag.outputs.result }} - git push origin ${{ steps.tag.outputs.result }} + git tag "${{ matrix.workspace.name }}-${{ steps.tag.outputs.result }}" + git push origin "${{ matrix.workspace.name }}-${{ steps.tag.outputs.result }}" - name: Install dependencies run: | From f6d6dc30a04af222aeb3324b898fb6ce4fc55b8e Mon Sep 17 00:00:00 2001 From: Astrodevs CI Date: Wed, 25 Oct 2023 19:13:28 +0000 Subject: [PATCH 290/325] chore: create branch feature/185-ignore-linting-file-staging --- remove-me-bfa9fe2ae6eb4793aaed.txt | 1 + 1 file changed, 1 insertion(+) create mode 100644 remove-me-bfa9fe2ae6eb4793aaed.txt diff --git a/remove-me-bfa9fe2ae6eb4793aaed.txt b/remove-me-bfa9fe2ae6eb4793aaed.txt new file mode 100644 index 00000000..4bcb0534 --- /dev/null +++ b/remove-me-bfa9fe2ae6eb4793aaed.txt @@ -0,0 +1 @@ +bfa9fe2ae6eb4793aaed From c9eab23a94507bea8a379c46229454876810ef2e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A9o=20Maringer?= Date: Thu, 2 Nov 2023 14:37:04 +0000 Subject: [PATCH 291/325] feat(solidity/linter): initialize function for solidhunter ignore --- .../core/crates/linter-lib/src/ignore.rs | 29 +++++++++++++++++++ .../core/crates/linter-lib/src/lib.rs | 1 + .../core/crates/linter-lib/src/linter.rs | 17 +++++++++-- 3 files changed, 45 insertions(+), 2 deletions(-) create mode 100644 toolchains/solidity/core/crates/linter-lib/src/ignore.rs diff --git a/toolchains/solidity/core/crates/linter-lib/src/ignore.rs b/toolchains/solidity/core/crates/linter-lib/src/ignore.rs new file mode 100644 index 00000000..a2eca0ca --- /dev/null +++ b/toolchains/solidity/core/crates/linter-lib/src/ignore.rs @@ -0,0 +1,29 @@ +use glob::glob; +use crate::errors::SolidHunterError; + +fn parse_line (line: &str) -> Vec { + let mut files = Vec::new(); + + if let Ok(entries) = glob(line) { + for entry in entries.flatten() { + files.push(entry.into_os_string().into_string().unwrap()) + } + } + + files +} + +pub fn get_ignored_files (filepath: &str) -> Result, SolidHunterError> { + let mut ignored_files = Vec::new(); + + if !std::path::Path::new(filepath).is_file() { + return Ok(ignored_files); + } + + let file = std::fs::read_to_string(filepath)?; + + for line in file.lines() { + ignored_files.append(&mut parse_line(line)) + } + Ok(ignored_files) +} \ No newline at end of file diff --git a/toolchains/solidity/core/crates/linter-lib/src/lib.rs b/toolchains/solidity/core/crates/linter-lib/src/lib.rs index 5e557edc..a069316a 100644 --- a/toolchains/solidity/core/crates/linter-lib/src/lib.rs +++ b/toolchains/solidity/core/crates/linter-lib/src/lib.rs @@ -2,3 +2,4 @@ pub mod errors; pub mod linter; pub mod rules; pub mod types; +mod ignore; diff --git a/toolchains/solidity/core/crates/linter-lib/src/linter.rs b/toolchains/solidity/core/crates/linter-lib/src/linter.rs index 35d53a57..4894053d 100644 --- a/toolchains/solidity/core/crates/linter-lib/src/linter.rs +++ b/toolchains/solidity/core/crates/linter-lib/src/linter.rs @@ -8,6 +8,7 @@ use std::fs; use glob::glob; use std::path::Path; +use crate::ignore::get_ignored_files; #[derive(Debug, Clone)] pub struct SolidFile { @@ -20,6 +21,7 @@ pub struct SolidLinter { files: Vec, rule_factory: RuleFactory, rules: Vec>, + ignored_files: Vec, } impl Default for SolidLinter { @@ -34,6 +36,7 @@ impl SolidLinter { files: Vec::new(), rule_factory: RuleFactory::default(), rules: vec![], + ignored_files: Vec::new(), } } @@ -43,6 +46,7 @@ impl SolidLinter { files: Vec::new(), rule_factory: RuleFactory::default(), rules: Vec::new(), + ignored_files: Vec::new(), }; for rule in default_rules { @@ -60,6 +64,14 @@ impl SolidLinter { Ok(()) } + pub fn initialize_ignore_file(&mut self, filepath: &str) ->Result<(), SolidHunterError> { + let ignored_files = get_ignored_files(filepath)?; + for file in ignored_files { + self.ignored_files.push(file.to_string()) + } + Ok(()) + } + fn _file_exists(&self, path: &str) -> bool { for file in &self.files { if file.path == path { @@ -92,8 +104,9 @@ impl SolidLinter { } } - pub fn parse_file(&mut self, filepath: &str) -> LintResult { - let content = fs::read_to_string(filepath)?; + pub fn parse_file(&mut self, filepath: String) -> LintResult { + println!("Parsing content: {}", filepath); + let content = fs::read_to_string(filepath.clone())?; self.parse_content(filepath, content.as_str()) } From f459475323e7ef8e787ad0f2c161f9dd0fa1dbf6 Mon Sep 17 00:00:00 2001 From: Enzo Bonato Date: Thu, 2 Nov 2023 16:26:40 +0100 Subject: [PATCH 292/325] feat(solidity/linter): Adding new argument in main cli --- toolchains/solidity/core/crates/linter-cli/.gitignore | 1 + toolchains/solidity/core/crates/linter-cli/readme.md | 1 + toolchains/solidity/core/crates/linter-cli/src/main.rs | 9 +++++++++ 3 files changed, 11 insertions(+) create mode 100644 toolchains/solidity/core/crates/linter-cli/.gitignore diff --git a/toolchains/solidity/core/crates/linter-cli/.gitignore b/toolchains/solidity/core/crates/linter-cli/.gitignore new file mode 100644 index 00000000..95f496a3 --- /dev/null +++ b/toolchains/solidity/core/crates/linter-cli/.gitignore @@ -0,0 +1 @@ +.solidhunter.json \ No newline at end of file diff --git a/toolchains/solidity/core/crates/linter-cli/readme.md b/toolchains/solidity/core/crates/linter-cli/readme.md index f262277f..c9b65a1d 100644 --- a/toolchains/solidity/core/crates/linter-cli/readme.md +++ b/toolchains/solidity/core/crates/linter-cli/readme.md @@ -31,6 +31,7 @@ Options: -i, --init Initialize rules file -h, --help Print help information -V, --version Print version information + -g, --ignore Specify ignore file ``` ## Configuration diff --git a/toolchains/solidity/core/crates/linter-cli/src/main.rs b/toolchains/solidity/core/crates/linter-cli/src/main.rs index 92df48c8..f970366b 100644 --- a/toolchains/solidity/core/crates/linter-cli/src/main.rs +++ b/toolchains/solidity/core/crates/linter-cli/src/main.rs @@ -51,6 +51,14 @@ struct Args { help = "Initialize rules file" )] init: bool, + + #[arg( + short = 'g', + long = "ignore", + default_value = ".solidhunterignore", + help = "Specify ignore file" + )] + ignore_file: String, } fn print_result(results: Vec) { @@ -86,6 +94,7 @@ fn main() -> Result<(), SolidHunterError> { println!("Exclude path: {:?}", args.ignore_path); println!("Using rules file: {}", args.rules_file); println!("Verbose output: {}", args.verbose); + println!("Ignore file output: {}", args.ignore_file); } if args.init { From 697ac1334a49ede51f6c2c3131ed44675f04b2eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A9o=20Maringer?= Date: Thu, 2 Nov 2023 16:16:24 +0000 Subject: [PATCH 293/325] feat(solidity/linter): load solidhunter ignore by default and tests --- remove-me-bfa9fe2ae6eb4793aaed.txt | 1 - .../core/crates/linter-lib/src/ignore.rs | 24 ++++++++++++------- .../core/crates/linter-lib/src/linter.rs | 10 +++++--- .../SolidhunterIgnore/.solidhunter.json | 8 +++++++ .../SolidhunterIgnore/.solidhunterignore | 1 + .../testdata/SolidhunterIgnore/file.sol | 10 ++++++++ .../testdata/SolidhunterIgnore/findings.csv | 0 .../testdata/SolidhunterIgnore/test.sol | 0 .../core/crates/linter-lib/tests/linter.rs | 9 +++++-- 9 files changed, 48 insertions(+), 15 deletions(-) delete mode 100644 remove-me-bfa9fe2ae6eb4793aaed.txt create mode 100644 toolchains/solidity/core/crates/linter-lib/testdata/SolidhunterIgnore/.solidhunter.json create mode 100644 toolchains/solidity/core/crates/linter-lib/testdata/SolidhunterIgnore/.solidhunterignore create mode 100644 toolchains/solidity/core/crates/linter-lib/testdata/SolidhunterIgnore/file.sol create mode 100644 toolchains/solidity/core/crates/linter-lib/testdata/SolidhunterIgnore/findings.csv create mode 100644 toolchains/solidity/core/crates/linter-lib/testdata/SolidhunterIgnore/test.sol diff --git a/remove-me-bfa9fe2ae6eb4793aaed.txt b/remove-me-bfa9fe2ae6eb4793aaed.txt deleted file mode 100644 index 4bcb0534..00000000 --- a/remove-me-bfa9fe2ae6eb4793aaed.txt +++ /dev/null @@ -1 +0,0 @@ -bfa9fe2ae6eb4793aaed diff --git a/toolchains/solidity/core/crates/linter-lib/src/ignore.rs b/toolchains/solidity/core/crates/linter-lib/src/ignore.rs index a2eca0ca..e91d9701 100644 --- a/toolchains/solidity/core/crates/linter-lib/src/ignore.rs +++ b/toolchains/solidity/core/crates/linter-lib/src/ignore.rs @@ -1,29 +1,35 @@ +use std::path::Path; use glob::glob; use crate::errors::SolidHunterError; -fn parse_line (line: &str) -> Vec { +fn parse_line(line: &str, path: &Path) -> Vec { let mut files = Vec::new(); - - if let Ok(entries) = glob(line) { - for entry in entries.flatten() { - files.push(entry.into_os_string().into_string().unwrap()) + let line = line.replace("./", ""); + if let Some(parent) = path.parent() { + if let Some(filepath) = parent.join(line).to_str() { + if let Ok(entries) = glob(filepath) { + for entry in entries.flatten() { + files.push(entry.into_os_string().into_string().unwrap()) + } + } } } files } -pub fn get_ignored_files (filepath: &str) -> Result, SolidHunterError> { +pub fn get_ignored_files(filepath: &str) -> Result, SolidHunterError> { let mut ignored_files = Vec::new(); + let path = Path::new(filepath); - if !std::path::Path::new(filepath).is_file() { + if !path.is_file() { return Ok(ignored_files); } - let file = std::fs::read_to_string(filepath)?; + let file = std::fs::read_to_string(path)?; for line in file.lines() { - ignored_files.append(&mut parse_line(line)) + ignored_files.append(&mut parse_line(line, path)) } Ok(ignored_files) } \ No newline at end of file diff --git a/toolchains/solidity/core/crates/linter-lib/src/linter.rs b/toolchains/solidity/core/crates/linter-lib/src/linter.rs index 4894053d..6a9065dc 100644 --- a/toolchains/solidity/core/crates/linter-lib/src/linter.rs +++ b/toolchains/solidity/core/crates/linter-lib/src/linter.rs @@ -64,7 +64,7 @@ impl SolidLinter { Ok(()) } - pub fn initialize_ignore_file(&mut self, filepath: &str) ->Result<(), SolidHunterError> { + pub fn initialize_ignore_file(&mut self, filepath: &str) -> Result<(), SolidHunterError> { let ignored_files = get_ignored_files(filepath)?; for file in ignored_files { self.ignored_files.push(file.to_string()) @@ -105,7 +105,9 @@ impl SolidLinter { } pub fn parse_file(&mut self, filepath: String) -> LintResult { - println!("Parsing content: {}", filepath); + if self.ignored_files.contains(&filepath) { + return Ok(Vec::new()); + } let content = fs::read_to_string(filepath.clone())?; self.parse_content(filepath, content.as_str()) } @@ -127,7 +129,9 @@ impl SolidLinter { let mut result: Vec = Vec::new(); if let Ok(entries) = glob(&(folder.to_owned() + "/**/*.sol")) { for entry in entries.flatten() { - result.push(self.parse_file(&entry.into_os_string().into_string().unwrap())); + if !self.ignored_files.contains(&entry.clone().into_os_string().into_string().unwrap()) { + result.push(self.parse_file(entry.into_os_string().into_string().unwrap())); + } } } result diff --git a/toolchains/solidity/core/crates/linter-lib/testdata/SolidhunterIgnore/.solidhunter.json b/toolchains/solidity/core/crates/linter-lib/testdata/SolidhunterIgnore/.solidhunter.json new file mode 100644 index 00000000..96de8e57 --- /dev/null +++ b/toolchains/solidity/core/crates/linter-lib/testdata/SolidhunterIgnore/.solidhunter.json @@ -0,0 +1,8 @@ +{ + "name": "solidhunter", "rules": [ + { + "id": "avoid-tx-origin", + "severity": "WARNING" + } + ] +} \ No newline at end of file diff --git a/toolchains/solidity/core/crates/linter-lib/testdata/SolidhunterIgnore/.solidhunterignore b/toolchains/solidity/core/crates/linter-lib/testdata/SolidhunterIgnore/.solidhunterignore new file mode 100644 index 00000000..ef17dd66 --- /dev/null +++ b/toolchains/solidity/core/crates/linter-lib/testdata/SolidhunterIgnore/.solidhunterignore @@ -0,0 +1 @@ +*.sol diff --git a/toolchains/solidity/core/crates/linter-lib/testdata/SolidhunterIgnore/file.sol b/toolchains/solidity/core/crates/linter-lib/testdata/SolidhunterIgnore/file.sol new file mode 100644 index 00000000..97291c3b --- /dev/null +++ b/toolchains/solidity/core/crates/linter-lib/testdata/SolidhunterIgnore/file.sol @@ -0,0 +1,10 @@ +pragma solidity 0.8.0; + +contract Test { + function awesome() public returns (address) { + return tx.origin; + } + function notAwesome() public returns (address) { + return msg.sender; + } +} \ No newline at end of file diff --git a/toolchains/solidity/core/crates/linter-lib/testdata/SolidhunterIgnore/findings.csv b/toolchains/solidity/core/crates/linter-lib/testdata/SolidhunterIgnore/findings.csv new file mode 100644 index 00000000..e69de29b diff --git a/toolchains/solidity/core/crates/linter-lib/testdata/SolidhunterIgnore/test.sol b/toolchains/solidity/core/crates/linter-lib/testdata/SolidhunterIgnore/test.sol new file mode 100644 index 00000000..e69de29b diff --git a/toolchains/solidity/core/crates/linter-lib/tests/linter.rs b/toolchains/solidity/core/crates/linter-lib/tests/linter.rs index cfc7bde1..a6202916 100644 --- a/toolchains/solidity/core/crates/linter-lib/tests/linter.rs +++ b/toolchains/solidity/core/crates/linter-lib/tests/linter.rs @@ -11,6 +11,7 @@ struct Finding { fn test_directory(base_name: &str) { let mut source = String::new(); let mut config = String::new(); + let mut ignore = String::new(); let mut expected_findings: Vec = Vec::new(); for path in fs::read_dir( @@ -27,6 +28,8 @@ fn test_directory(base_name: &str) { source = path.to_str().unwrap().to_string(); } else if filename == ".solidhunter.json" { config = path.to_str().unwrap().to_string(); + } else if filename == ".solidhunterignore" { + ignore = path.to_str().unwrap().to_string(); } else if filename == "findings.csv" { for line in fs::read_to_string(path).unwrap().lines() { let splitted_line: Vec<&str> = line.split(':').collect(); @@ -46,12 +49,13 @@ fn test_directory(base_name: &str) { } } - test_linter(&config, &source, &expected_findings); + test_linter(&config, &source, &expected_findings, &ignore ); } -fn test_linter(config: &str, source: &str, expected_findings: &Vec) { +fn test_linter(config: &str, source: &str, expected_findings: &Vec, ignore: &str) { let mut linter: SolidLinter = SolidLinter::new(); let _ = linter.initialize_rules(&String::from(config)); + let _ = linter.initialize_ignore_file(&String::from(ignore)); let result = linter.parse_file(source); let mut found_findings: Vec<&Finding> = Vec::new(); @@ -172,4 +176,5 @@ test_directories! { PrivateVarsLeadingUnderscore, FoundryTestFunctions, AvoidTxOrigin, + SolidhunterIgnore } From 826c32e1bd1e1d09eb3da8dd29bcb6a14f168868 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A9o=20Maringer?= Date: Fri, 3 Nov 2023 10:09:09 +0000 Subject: [PATCH 294/325] feat(solidity/cli): initialize ignore file if set --- toolchains/solidity/core/crates/linter-cli/src/main.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/toolchains/solidity/core/crates/linter-cli/src/main.rs b/toolchains/solidity/core/crates/linter-cli/src/main.rs index f970366b..6837690d 100644 --- a/toolchains/solidity/core/crates/linter-cli/src/main.rs +++ b/toolchains/solidity/core/crates/linter-cli/src/main.rs @@ -107,6 +107,7 @@ fn main() -> Result<(), SolidHunterError> { if !args.path.is_empty() { let mut linter: SolidLinter = SolidLinter::new(); linter.initialize_rules(&args.rules_file)?; + linter.initialize_ignore_file(&args.ignore_file)?; let result = linter.parse_path(&args.path); if !args.to_json { From 72237b5e6b0019130078b4eb83b2eb9b4905e126 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A9o=20Maringer?= Date: Fri, 3 Nov 2023 10:10:00 +0000 Subject: [PATCH 295/325] feat(solidity/linter): remove useless condition --- toolchains/solidity/core/crates/linter-lib/src/linter.rs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/toolchains/solidity/core/crates/linter-lib/src/linter.rs b/toolchains/solidity/core/crates/linter-lib/src/linter.rs index 6a9065dc..4c128fce 100644 --- a/toolchains/solidity/core/crates/linter-lib/src/linter.rs +++ b/toolchains/solidity/core/crates/linter-lib/src/linter.rs @@ -129,9 +129,7 @@ impl SolidLinter { let mut result: Vec = Vec::new(); if let Ok(entries) = glob(&(folder.to_owned() + "/**/*.sol")) { for entry in entries.flatten() { - if !self.ignored_files.contains(&entry.clone().into_os_string().into_string().unwrap()) { - result.push(self.parse_file(entry.into_os_string().into_string().unwrap())); - } + result.push(self.parse_file(entry.into_os_string().into_string().unwrap())); } } result From 0d05c092f89598754c484f1cd429ccb6608bc60a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A9o=20Maringer?= Date: Fri, 3 Nov 2023 10:16:47 +0000 Subject: [PATCH 296/325] feat(solidity/linter): format --- toolchains/solidity/core/crates/linter-lib/src/ignore.rs | 6 +++--- toolchains/solidity/core/crates/linter-lib/src/lib.rs | 2 +- toolchains/solidity/core/crates/linter-lib/src/linter.rs | 2 +- toolchains/solidity/core/crates/linter-lib/tests/linter.rs | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/toolchains/solidity/core/crates/linter-lib/src/ignore.rs b/toolchains/solidity/core/crates/linter-lib/src/ignore.rs index e91d9701..e8e09eb3 100644 --- a/toolchains/solidity/core/crates/linter-lib/src/ignore.rs +++ b/toolchains/solidity/core/crates/linter-lib/src/ignore.rs @@ -1,6 +1,6 @@ -use std::path::Path; -use glob::glob; use crate::errors::SolidHunterError; +use glob::glob; +use std::path::Path; fn parse_line(line: &str, path: &Path) -> Vec { let mut files = Vec::new(); @@ -32,4 +32,4 @@ pub fn get_ignored_files(filepath: &str) -> Result, SolidHunterError ignored_files.append(&mut parse_line(line, path)) } Ok(ignored_files) -} \ No newline at end of file +} diff --git a/toolchains/solidity/core/crates/linter-lib/src/lib.rs b/toolchains/solidity/core/crates/linter-lib/src/lib.rs index a069316a..fe1e58d0 100644 --- a/toolchains/solidity/core/crates/linter-lib/src/lib.rs +++ b/toolchains/solidity/core/crates/linter-lib/src/lib.rs @@ -1,5 +1,5 @@ pub mod errors; +mod ignore; pub mod linter; pub mod rules; pub mod types; -mod ignore; diff --git a/toolchains/solidity/core/crates/linter-lib/src/linter.rs b/toolchains/solidity/core/crates/linter-lib/src/linter.rs index 4c128fce..c4170576 100644 --- a/toolchains/solidity/core/crates/linter-lib/src/linter.rs +++ b/toolchains/solidity/core/crates/linter-lib/src/linter.rs @@ -6,9 +6,9 @@ use crate::rules::types::*; use crate::types::*; use std::fs; +use crate::ignore::get_ignored_files; use glob::glob; use std::path::Path; -use crate::ignore::get_ignored_files; #[derive(Debug, Clone)] pub struct SolidFile { diff --git a/toolchains/solidity/core/crates/linter-lib/tests/linter.rs b/toolchains/solidity/core/crates/linter-lib/tests/linter.rs index a6202916..6dbaecee 100644 --- a/toolchains/solidity/core/crates/linter-lib/tests/linter.rs +++ b/toolchains/solidity/core/crates/linter-lib/tests/linter.rs @@ -49,7 +49,7 @@ fn test_directory(base_name: &str) { } } - test_linter(&config, &source, &expected_findings, &ignore ); + test_linter(&config, &source, &expected_findings, &ignore); } fn test_linter(config: &str, source: &str, expected_findings: &Vec, ignore: &str) { From c4d8e7a552f109664652629fc610ffb02d453550 Mon Sep 17 00:00:00 2001 From: 0xMemoryGrinder <35138272+0xMemoryGrinder@users.noreply.github.com> Date: Mon, 6 Nov 2023 20:23:09 -0500 Subject: [PATCH 297/325] feat(solidity/linter-cli): made exclude argument a list of files --- .../core/crates/linter-cli/src/main.rs | 22 +++++++---------- .../core/crates/linter-lib/src/linter.rs | 24 +++++++++---------- 2 files changed, 20 insertions(+), 26 deletions(-) diff --git a/toolchains/solidity/core/crates/linter-cli/src/main.rs b/toolchains/solidity/core/crates/linter-cli/src/main.rs index 6837690d..7ffc02df 100644 --- a/toolchains/solidity/core/crates/linter-cli/src/main.rs +++ b/toolchains/solidity/core/crates/linter-cli/src/main.rs @@ -13,12 +13,6 @@ struct Args { help = "Path to the project to lint" )] path: String, - #[arg( - short = 'e', - long = "exclude", - help = "Exclude part of the project path" - )] - ignore_path: Vec, #[arg( short = 'r', @@ -53,12 +47,11 @@ struct Args { init: bool, #[arg( - short = 'g', - long = "ignore", - default_value = ".solidhunterignore", - help = "Specify ignore file" + short = 'e', + long = "exclude", + help = "Specify excluded files", )] - ignore_file: String, + exclude: Option>, } fn print_result(results: Vec) { @@ -91,10 +84,9 @@ fn main() -> Result<(), SolidHunterError> { if args.verbose { println!("Verbose output enabled"); println!("Project path: {:?}", args.path); - println!("Exclude path: {:?}", args.ignore_path); println!("Using rules file: {}", args.rules_file); println!("Verbose output: {}", args.verbose); - println!("Ignore file output: {}", args.ignore_file); + println!("Excluded files: {:?}", args.exclude); } if args.init { @@ -107,7 +99,9 @@ fn main() -> Result<(), SolidHunterError> { if !args.path.is_empty() { let mut linter: SolidLinter = SolidLinter::new(); linter.initialize_rules(&args.rules_file)?; - linter.initialize_ignore_file(&args.ignore_file)?; + if let Some(excluded) = &args.exclude { + linter.initialize_excluded_files(excluded, &args.path)?; + } let result = linter.parse_path(&args.path); if !args.to_json { diff --git a/toolchains/solidity/core/crates/linter-lib/src/linter.rs b/toolchains/solidity/core/crates/linter-lib/src/linter.rs index c4170576..151a5315 100644 --- a/toolchains/solidity/core/crates/linter-lib/src/linter.rs +++ b/toolchains/solidity/core/crates/linter-lib/src/linter.rs @@ -21,7 +21,7 @@ pub struct SolidLinter { files: Vec, rule_factory: RuleFactory, rules: Vec>, - ignored_files: Vec, + excluded_files: Vec, } impl Default for SolidLinter { @@ -36,7 +36,7 @@ impl SolidLinter { files: Vec::new(), rule_factory: RuleFactory::default(), rules: vec![], - ignored_files: Vec::new(), + excluded_files: Vec::new(), } } @@ -46,7 +46,7 @@ impl SolidLinter { files: Vec::new(), rule_factory: RuleFactory::default(), rules: Vec::new(), - ignored_files: Vec::new(), + excluded_files: Vec::new(), }; for rule in default_rules { @@ -64,11 +64,11 @@ impl SolidLinter { Ok(()) } - pub fn initialize_ignore_file(&mut self, filepath: &str) -> Result<(), SolidHunterError> { - let ignored_files = get_ignored_files(filepath)?; - for file in ignored_files { - self.ignored_files.push(file.to_string()) + pub fn initialize_excluded_files(&mut self, excluded_filepaths: &Vec, filepath: &String) -> Result<(), SolidHunterError> { + for path in excluded_filepaths { + self.excluded_files.push(path.clone()) } + // TODO: find recursively all .solidhunterignore files from the filepath Ok(()) } @@ -105,11 +105,11 @@ impl SolidLinter { } pub fn parse_file(&mut self, filepath: String) -> LintResult { - if self.ignored_files.contains(&filepath) { - return Ok(Vec::new()); - } let content = fs::read_to_string(filepath.clone())?; - self.parse_content(filepath, content.as_str()) + if self.excluded_files.contains(&filepath) { + return Ok(FileDiags::new(content, Vec::new())); + } + self.parse_content(&filepath, content.as_str()) } pub fn parse_content(&mut self, filepath: &str, content: &str) -> LintResult { @@ -136,7 +136,7 @@ impl SolidLinter { } pub fn parse_path(&mut self, path: &str) -> Vec { if Path::new(&path).is_file() { - vec![self.parse_file(path)] + vec![self.parse_file(path.to_string())] } else { self.parse_folder(path) } From d18f8a9aea2599121d2467e11e6cb8c4aa3d87be Mon Sep 17 00:00:00 2001 From: 0xMemoryGrinder <35138272+0xMemoryGrinder@users.noreply.github.com> Date: Mon, 6 Nov 2023 20:35:16 -0500 Subject: [PATCH 298/325] feat(solidity/linter): made linter takes multiple paths to lint --- .../core/crates/linter-cli/src/main.rs | 35 +++++++++++-------- .../core/crates/linter-lib/src/linter.rs | 2 +- 2 files changed, 21 insertions(+), 16 deletions(-) diff --git a/toolchains/solidity/core/crates/linter-cli/src/main.rs b/toolchains/solidity/core/crates/linter-cli/src/main.rs index 7ffc02df..5d3da83b 100644 --- a/toolchains/solidity/core/crates/linter-cli/src/main.rs +++ b/toolchains/solidity/core/crates/linter-cli/src/main.rs @@ -8,11 +8,9 @@ use solidhunter_lib::types::LintResult; #[command(author, version, about, long_about = None)] struct Args { #[arg( - required = false, - default_value = ".", - help = "Path to the project to lint" + help = "Paths to the projects to lint" )] - path: String, + paths: Vec, #[arg( short = 'r', @@ -68,7 +66,7 @@ fn print_result(results: Vec) { } fn main() -> Result<(), SolidHunterError> { - let args = Args::parse(); + let mut args = Args::parse(); if !args.to_json { println!(); @@ -83,7 +81,7 @@ fn main() -> Result<(), SolidHunterError> { if args.verbose { println!("Verbose output enabled"); - println!("Project path: {:?}", args.path); + println!("Project path: {:?}", args.paths); println!("Using rules file: {}", args.rules_file); println!("Verbose output: {}", args.verbose); println!("Excluded files: {:?}", args.exclude); @@ -96,18 +94,25 @@ fn main() -> Result<(), SolidHunterError> { return Ok(()); } - if !args.path.is_empty() { - let mut linter: SolidLinter = SolidLinter::new(); - linter.initialize_rules(&args.rules_file)?; - if let Some(excluded) = &args.exclude { - linter.initialize_excluded_files(excluded, &args.path)?; - } + if args.paths.is_empty() { + args.paths.push(String::from(".")); + } - let result = linter.parse_path(&args.path); + let mut linter: SolidLinter = SolidLinter::new(); + linter.initialize_rules(&args.rules_file)?; + if let Some(excluded) = &args.exclude { + linter.initialize_excluded_files(excluded, &args.paths)?; + } + let mut results = vec![]; + for path in &args.paths { + let result = linter.parse_path(path); + results.push(result); + } + for path_result in results { if !args.to_json { - print_result(result); + print_result(path_result); } else { - for res in result { + for res in path_result { match res { Ok(diags) => { let json = serde_json::to_string_pretty(&diags); diff --git a/toolchains/solidity/core/crates/linter-lib/src/linter.rs b/toolchains/solidity/core/crates/linter-lib/src/linter.rs index 151a5315..11d88dc0 100644 --- a/toolchains/solidity/core/crates/linter-lib/src/linter.rs +++ b/toolchains/solidity/core/crates/linter-lib/src/linter.rs @@ -64,7 +64,7 @@ impl SolidLinter { Ok(()) } - pub fn initialize_excluded_files(&mut self, excluded_filepaths: &Vec, filepath: &String) -> Result<(), SolidHunterError> { + pub fn initialize_excluded_files(&mut self, excluded_filepaths: &Vec, filepaths: &Vec) -> Result<(), SolidHunterError> { for path in excluded_filepaths { self.excluded_files.push(path.clone()) } From 12e52bee5a413c5e01cf415bb25bf4988e4a96c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A9o=20Maringer?= Date: Wed, 8 Nov 2023 23:07:09 +0000 Subject: [PATCH 299/325] feat(solidity/linter): ignore files from every .solidhunterignore recursivly --- .../core/crates/linter-cli/src/main.rs | 5 +-- .../core/crates/linter-lib/src/ignore.rs | 44 +++++++++++++++---- .../core/crates/linter-lib/src/linter.rs | 13 +++--- .../core/crates/linter-lib/tests/linter.rs | 4 +- 4 files changed, 48 insertions(+), 18 deletions(-) diff --git a/toolchains/solidity/core/crates/linter-cli/src/main.rs b/toolchains/solidity/core/crates/linter-cli/src/main.rs index 5d3da83b..79d18542 100644 --- a/toolchains/solidity/core/crates/linter-cli/src/main.rs +++ b/toolchains/solidity/core/crates/linter-cli/src/main.rs @@ -100,9 +100,8 @@ fn main() -> Result<(), SolidHunterError> { let mut linter: SolidLinter = SolidLinter::new(); linter.initialize_rules(&args.rules_file)?; - if let Some(excluded) = &args.exclude { - linter.initialize_excluded_files(excluded, &args.paths)?; - } + linter.initialize_excluded_files(args.exclude.as_ref(), &args.paths)?; + let mut results = vec![]; for path in &args.paths { let result = linter.parse_path(path); diff --git a/toolchains/solidity/core/crates/linter-lib/src/ignore.rs b/toolchains/solidity/core/crates/linter-lib/src/ignore.rs index e8e09eb3..ab5aca66 100644 --- a/toolchains/solidity/core/crates/linter-lib/src/ignore.rs +++ b/toolchains/solidity/core/crates/linter-lib/src/ignore.rs @@ -18,18 +18,46 @@ fn parse_line(line: &str, path: &Path) -> Vec { files } -pub fn get_ignored_files(filepath: &str) -> Result, SolidHunterError> { - let mut ignored_files = Vec::new(); - let path = Path::new(filepath); +fn parse_solihunterignore(filepath: &String) -> Result, SolidHunterError> { + let mut excluded_files = Vec::new(); + let content = std::fs::read_to_string(filepath)?; - if !path.is_file() { - return Ok(ignored_files); + for line in content.lines() { + excluded_files.append(&mut parse_line(line, Path::new(filepath))); } - let file = std::fs::read_to_string(path)?; + Ok(excluded_files) +} + +fn get_solidhunterignore_paths(filepath: &String) -> Result, SolidHunterError> { + let mut ignored_files = Vec::new(); - for line in file.lines() { - ignored_files.append(&mut parse_line(line, path)) + if let Ok(entries) = glob(&format!("{}/**/.solidhunterignore", filepath)) { + for entry in entries.flatten() { + ignored_files.push(entry.into_os_string().into_string().unwrap()) + } } + Ok(ignored_files) } + +pub fn get_excluded_files(filepaths: &Vec) -> Result, SolidHunterError> { + let mut excluded_files = Vec::new(); + + for filepath in filepaths { + let path = Path::new(filepath); + + if path.is_file() { + continue; + } + + let solidhunterignore_paths = get_solidhunterignore_paths(&filepath)?; + + for solidhunterignore_path in solidhunterignore_paths { + if let Ok(mut excluded) = parse_solihunterignore(&solidhunterignore_path) { + excluded_files.append(&mut excluded); + } + } + } + Ok(excluded_files) +} diff --git a/toolchains/solidity/core/crates/linter-lib/src/linter.rs b/toolchains/solidity/core/crates/linter-lib/src/linter.rs index 11d88dc0..8e842b72 100644 --- a/toolchains/solidity/core/crates/linter-lib/src/linter.rs +++ b/toolchains/solidity/core/crates/linter-lib/src/linter.rs @@ -6,7 +6,7 @@ use crate::rules::types::*; use crate::types::*; use std::fs; -use crate::ignore::get_ignored_files; +use crate::ignore::get_excluded_files; use glob::glob; use std::path::Path; @@ -64,11 +64,14 @@ impl SolidLinter { Ok(()) } - pub fn initialize_excluded_files(&mut self, excluded_filepaths: &Vec, filepaths: &Vec) -> Result<(), SolidHunterError> { - for path in excluded_filepaths { - self.excluded_files.push(path.clone()) + pub fn initialize_excluded_files(&mut self, excluded_filepaths: Option<&Vec>, filepaths: &Vec) -> Result<(), SolidHunterError> { + if let Some(excluded) = excluded_filepaths { + for path in excluded { + self.excluded_files.push(path.clone()) + } } - // TODO: find recursively all .solidhunterignore files from the filepath + self.excluded_files.append(&mut get_excluded_files(filepaths)?); + Ok(()) } diff --git a/toolchains/solidity/core/crates/linter-lib/tests/linter.rs b/toolchains/solidity/core/crates/linter-lib/tests/linter.rs index 6dbaecee..2f79afe9 100644 --- a/toolchains/solidity/core/crates/linter-lib/tests/linter.rs +++ b/toolchains/solidity/core/crates/linter-lib/tests/linter.rs @@ -55,9 +55,9 @@ fn test_directory(base_name: &str) { fn test_linter(config: &str, source: &str, expected_findings: &Vec, ignore: &str) { let mut linter: SolidLinter = SolidLinter::new(); let _ = linter.initialize_rules(&String::from(config)); - let _ = linter.initialize_ignore_file(&String::from(ignore)); + //let _ = linter.initialize_excluded_files(&String::from(ignore)); - let result = linter.parse_file(source); + let result = linter.parse_file(source.to_string()); let mut found_findings: Vec<&Finding> = Vec::new(); let mut not_found_findings: Vec<&Finding> = Vec::new(); let mut not_needed_findings: Vec<&LintDiag> = Vec::new(); From f5c771f635f865f7978dc2db84cf40aa882192d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A9o=20Maringer?= Date: Thu, 9 Nov 2023 03:44:21 +0000 Subject: [PATCH 300/325] feat(solidity/linter): starting SolidhunterIgnore test --- .../SolidhunterIgnore/.solidhunterignore | 1 - .../testdata/SolidhunterIgnore/file.sol | 10 ------ .../testdata/SolidhunterIgnore/findings.csv | 0 .../testdata/SolidhunterIgnore/test.sol | 5 +++ .../testdata/SolidhunterIgnore/test/test.sol | 5 +++ .../test/test/.solidhunterignore | 1 + .../SolidhunterIgnore/test/test/test.sol | 5 +++ .../SolidhunterIgnore/test/test/test2.sol | 5 +++ .../testdata/SolidhunterIgnore/test/test2.sol | 5 +++ .../test/test2/.solidhunterignore | 1 + .../SolidhunterIgnore/test/test2/test.sol | 5 +++ .../SolidhunterIgnore/test/test2/test2.sol | 5 +++ .../core/crates/linter-lib/tests/linter.rs | 35 ++++++++++++++++--- 13 files changed, 68 insertions(+), 15 deletions(-) delete mode 100644 toolchains/solidity/core/crates/linter-lib/testdata/SolidhunterIgnore/file.sol delete mode 100644 toolchains/solidity/core/crates/linter-lib/testdata/SolidhunterIgnore/findings.csv create mode 100644 toolchains/solidity/core/crates/linter-lib/testdata/SolidhunterIgnore/test/test.sol create mode 100644 toolchains/solidity/core/crates/linter-lib/testdata/SolidhunterIgnore/test/test/.solidhunterignore create mode 100644 toolchains/solidity/core/crates/linter-lib/testdata/SolidhunterIgnore/test/test/test.sol create mode 100644 toolchains/solidity/core/crates/linter-lib/testdata/SolidhunterIgnore/test/test/test2.sol create mode 100644 toolchains/solidity/core/crates/linter-lib/testdata/SolidhunterIgnore/test/test2.sol create mode 100644 toolchains/solidity/core/crates/linter-lib/testdata/SolidhunterIgnore/test/test2/.solidhunterignore create mode 100644 toolchains/solidity/core/crates/linter-lib/testdata/SolidhunterIgnore/test/test2/test.sol create mode 100644 toolchains/solidity/core/crates/linter-lib/testdata/SolidhunterIgnore/test/test2/test2.sol diff --git a/toolchains/solidity/core/crates/linter-lib/testdata/SolidhunterIgnore/.solidhunterignore b/toolchains/solidity/core/crates/linter-lib/testdata/SolidhunterIgnore/.solidhunterignore index ef17dd66..e69de29b 100644 --- a/toolchains/solidity/core/crates/linter-lib/testdata/SolidhunterIgnore/.solidhunterignore +++ b/toolchains/solidity/core/crates/linter-lib/testdata/SolidhunterIgnore/.solidhunterignore @@ -1 +0,0 @@ -*.sol diff --git a/toolchains/solidity/core/crates/linter-lib/testdata/SolidhunterIgnore/file.sol b/toolchains/solidity/core/crates/linter-lib/testdata/SolidhunterIgnore/file.sol deleted file mode 100644 index 97291c3b..00000000 --- a/toolchains/solidity/core/crates/linter-lib/testdata/SolidhunterIgnore/file.sol +++ /dev/null @@ -1,10 +0,0 @@ -pragma solidity 0.8.0; - -contract Test { - function awesome() public returns (address) { - return tx.origin; - } - function notAwesome() public returns (address) { - return msg.sender; - } -} \ No newline at end of file diff --git a/toolchains/solidity/core/crates/linter-lib/testdata/SolidhunterIgnore/findings.csv b/toolchains/solidity/core/crates/linter-lib/testdata/SolidhunterIgnore/findings.csv deleted file mode 100644 index e69de29b..00000000 diff --git a/toolchains/solidity/core/crates/linter-lib/testdata/SolidhunterIgnore/test.sol b/toolchains/solidity/core/crates/linter-lib/testdata/SolidhunterIgnore/test.sol index e69de29b..7a9f640f 100644 --- a/toolchains/solidity/core/crates/linter-lib/testdata/SolidhunterIgnore/test.sol +++ b/toolchains/solidity/core/crates/linter-lib/testdata/SolidhunterIgnore/test.sol @@ -0,0 +1,5 @@ +pragma solidity 0.8.0; + +contract Test { + string public constant symbol = "TEST"; +} \ No newline at end of file diff --git a/toolchains/solidity/core/crates/linter-lib/testdata/SolidhunterIgnore/test/test.sol b/toolchains/solidity/core/crates/linter-lib/testdata/SolidhunterIgnore/test/test.sol new file mode 100644 index 00000000..7a9f640f --- /dev/null +++ b/toolchains/solidity/core/crates/linter-lib/testdata/SolidhunterIgnore/test/test.sol @@ -0,0 +1,5 @@ +pragma solidity 0.8.0; + +contract Test { + string public constant symbol = "TEST"; +} \ No newline at end of file diff --git a/toolchains/solidity/core/crates/linter-lib/testdata/SolidhunterIgnore/test/test/.solidhunterignore b/toolchains/solidity/core/crates/linter-lib/testdata/SolidhunterIgnore/test/test/.solidhunterignore new file mode 100644 index 00000000..6ebc0949 --- /dev/null +++ b/toolchains/solidity/core/crates/linter-lib/testdata/SolidhunterIgnore/test/test/.solidhunterignore @@ -0,0 +1 @@ +test2.sol diff --git a/toolchains/solidity/core/crates/linter-lib/testdata/SolidhunterIgnore/test/test/test.sol b/toolchains/solidity/core/crates/linter-lib/testdata/SolidhunterIgnore/test/test/test.sol new file mode 100644 index 00000000..7a9f640f --- /dev/null +++ b/toolchains/solidity/core/crates/linter-lib/testdata/SolidhunterIgnore/test/test/test.sol @@ -0,0 +1,5 @@ +pragma solidity 0.8.0; + +contract Test { + string public constant symbol = "TEST"; +} \ No newline at end of file diff --git a/toolchains/solidity/core/crates/linter-lib/testdata/SolidhunterIgnore/test/test/test2.sol b/toolchains/solidity/core/crates/linter-lib/testdata/SolidhunterIgnore/test/test/test2.sol new file mode 100644 index 00000000..7a9f640f --- /dev/null +++ b/toolchains/solidity/core/crates/linter-lib/testdata/SolidhunterIgnore/test/test/test2.sol @@ -0,0 +1,5 @@ +pragma solidity 0.8.0; + +contract Test { + string public constant symbol = "TEST"; +} \ No newline at end of file diff --git a/toolchains/solidity/core/crates/linter-lib/testdata/SolidhunterIgnore/test/test2.sol b/toolchains/solidity/core/crates/linter-lib/testdata/SolidhunterIgnore/test/test2.sol new file mode 100644 index 00000000..7a9f640f --- /dev/null +++ b/toolchains/solidity/core/crates/linter-lib/testdata/SolidhunterIgnore/test/test2.sol @@ -0,0 +1,5 @@ +pragma solidity 0.8.0; + +contract Test { + string public constant symbol = "TEST"; +} \ No newline at end of file diff --git a/toolchains/solidity/core/crates/linter-lib/testdata/SolidhunterIgnore/test/test2/.solidhunterignore b/toolchains/solidity/core/crates/linter-lib/testdata/SolidhunterIgnore/test/test2/.solidhunterignore new file mode 100644 index 00000000..ef17dd66 --- /dev/null +++ b/toolchains/solidity/core/crates/linter-lib/testdata/SolidhunterIgnore/test/test2/.solidhunterignore @@ -0,0 +1 @@ +*.sol diff --git a/toolchains/solidity/core/crates/linter-lib/testdata/SolidhunterIgnore/test/test2/test.sol b/toolchains/solidity/core/crates/linter-lib/testdata/SolidhunterIgnore/test/test2/test.sol new file mode 100644 index 00000000..7a9f640f --- /dev/null +++ b/toolchains/solidity/core/crates/linter-lib/testdata/SolidhunterIgnore/test/test2/test.sol @@ -0,0 +1,5 @@ +pragma solidity 0.8.0; + +contract Test { + string public constant symbol = "TEST"; +} \ No newline at end of file diff --git a/toolchains/solidity/core/crates/linter-lib/testdata/SolidhunterIgnore/test/test2/test2.sol b/toolchains/solidity/core/crates/linter-lib/testdata/SolidhunterIgnore/test/test2/test2.sol new file mode 100644 index 00000000..7a9f640f --- /dev/null +++ b/toolchains/solidity/core/crates/linter-lib/testdata/SolidhunterIgnore/test/test2/test2.sol @@ -0,0 +1,5 @@ +pragma solidity 0.8.0; + +contract Test { + string public constant symbol = "TEST"; +} \ No newline at end of file diff --git a/toolchains/solidity/core/crates/linter-lib/tests/linter.rs b/toolchains/solidity/core/crates/linter-lib/tests/linter.rs index 2f79afe9..c7918769 100644 --- a/toolchains/solidity/core/crates/linter-lib/tests/linter.rs +++ b/toolchains/solidity/core/crates/linter-lib/tests/linter.rs @@ -19,7 +19,7 @@ fn test_directory(base_name: &str) { .join("testdata") .join(base_name), ) - .unwrap() + .unwrap() { let path = path.unwrap().path(); @@ -55,7 +55,6 @@ fn test_directory(base_name: &str) { fn test_linter(config: &str, source: &str, expected_findings: &Vec, ignore: &str) { let mut linter: SolidLinter = SolidLinter::new(); let _ = linter.initialize_rules(&String::from(config)); - //let _ = linter.initialize_excluded_files(&String::from(ignore)); let result = linter.parse_file(source.to_string()); let mut found_findings: Vec<&Finding> = Vec::new(); @@ -175,6 +174,34 @@ test_directories! { Ordering, PrivateVarsLeadingUnderscore, FoundryTestFunctions, - AvoidTxOrigin, - SolidhunterIgnore + AvoidTxOrigin } + +#[allow(non_snake_case)] +#[test] +fn SolidhunterIgnore() { + let path = PathBuf::from(env!("CARGO_MANIFEST_DIR")) + .join("testdata") + .join("SolidhunterIgnore"); + let mut linter: SolidLinter = SolidLinter::new(); + let _ = linter.initialize_rules(&String::from( + path.join(".solidhunter.json").to_str().unwrap(), + )); + println!( + "{:?} {:?}", + &String::from( + path.join(".solidhunter.json").to_str().unwrap(), + ), + path.to_str().unwrap() + ); + //let _ = linter.initialize_excluded_files( + // Some(&vec![]), + // &vec![path.to_str().unwrap().to_string()], + //); + + let result = linter.parse_path(path.to_str().unwrap()); + + for test in result { + println!("{:?}", test.unwrap()) + } +} \ No newline at end of file From bf11d09c3e38769baaf5ec617ef5ca1464601cfd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A9o=20Maringer?= Date: Thu, 9 Nov 2023 14:30:23 +0000 Subject: [PATCH 301/325] feat(solidity/linter): test for solidhunterignore --- .../SolidhunterIgnore/.solidhunter.json | 8 +++---- .../SolidhunterIgnore/.solidhunterignore | 1 + .../test/test/.solidhunterignore | 2 +- .../core/crates/linter-lib/tests/linter.rs | 24 +++++++++---------- 4 files changed, 18 insertions(+), 17 deletions(-) diff --git a/toolchains/solidity/core/crates/linter-lib/testdata/SolidhunterIgnore/.solidhunter.json b/toolchains/solidity/core/crates/linter-lib/testdata/SolidhunterIgnore/.solidhunter.json index 96de8e57..6a555ad0 100644 --- a/toolchains/solidity/core/crates/linter-lib/testdata/SolidhunterIgnore/.solidhunter.json +++ b/toolchains/solidity/core/crates/linter-lib/testdata/SolidhunterIgnore/.solidhunter.json @@ -1,8 +1,8 @@ { "name": "solidhunter", "rules": [ - { - "id": "avoid-tx-origin", - "severity": "WARNING" - } + { + "id": "const-name-snakecase", + "severity": "WARNING" + } ] } \ No newline at end of file diff --git a/toolchains/solidity/core/crates/linter-lib/testdata/SolidhunterIgnore/.solidhunterignore b/toolchains/solidity/core/crates/linter-lib/testdata/SolidhunterIgnore/.solidhunterignore index e69de29b..03d0e9b8 100644 --- a/toolchains/solidity/core/crates/linter-lib/testdata/SolidhunterIgnore/.solidhunterignore +++ b/toolchains/solidity/core/crates/linter-lib/testdata/SolidhunterIgnore/.solidhunterignore @@ -0,0 +1 @@ +test/test.sol \ No newline at end of file diff --git a/toolchains/solidity/core/crates/linter-lib/testdata/SolidhunterIgnore/test/test/.solidhunterignore b/toolchains/solidity/core/crates/linter-lib/testdata/SolidhunterIgnore/test/test/.solidhunterignore index 6ebc0949..6a7b8139 100644 --- a/toolchains/solidity/core/crates/linter-lib/testdata/SolidhunterIgnore/test/test/.solidhunterignore +++ b/toolchains/solidity/core/crates/linter-lib/testdata/SolidhunterIgnore/test/test/.solidhunterignore @@ -1 +1 @@ -test2.sol +./test2.sol diff --git a/toolchains/solidity/core/crates/linter-lib/tests/linter.rs b/toolchains/solidity/core/crates/linter-lib/tests/linter.rs index c7918769..4d162021 100644 --- a/toolchains/solidity/core/crates/linter-lib/tests/linter.rs +++ b/toolchains/solidity/core/crates/linter-lib/tests/linter.rs @@ -187,21 +187,21 @@ fn SolidhunterIgnore() { let _ = linter.initialize_rules(&String::from( path.join(".solidhunter.json").to_str().unwrap(), )); - println!( - "{:?} {:?}", - &String::from( - path.join(".solidhunter.json").to_str().unwrap(), - ), - path.to_str().unwrap() + let _ = linter.initialize_excluded_files( + Some(&vec![]), + &vec![path.to_str().unwrap().to_string()], ); - //let _ = linter.initialize_excluded_files( - // Some(&vec![]), - // &vec![path.to_str().unwrap().to_string()], - //); let result = linter.parse_path(path.to_str().unwrap()); - for test in result { - println!("{:?}", test.unwrap()) + let mut diags_number = 0; + + for lint_result in result { + match lint_result { + Ok(lint_result) => diags_number += lint_result.diags.len(), + Err(e) => println!("{}", e) + } } + + assert_eq!(diags_number, 3, "Invalid number of diagnostics"); } \ No newline at end of file From a6cb9a08115936d5dadf536b486a08dc90b004f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A9o=20Maringer?= Date: Thu, 9 Nov 2023 14:44:13 +0000 Subject: [PATCH 302/325] feat(solidity/linter): version --- toolchains/solidity/core/Cargo.toml | 4 ++-- toolchains/solidity/core/crates/linter-cli/Cargo.toml | 4 ++-- toolchains/solidity/core/crates/linter-lib/Cargo.toml | 2 +- toolchains/solidity/core/crates/linter-server/Cargo.toml | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/toolchains/solidity/core/Cargo.toml b/toolchains/solidity/core/Cargo.toml index 0f8f6933..23f0a5f8 100644 --- a/toolchains/solidity/core/Cargo.toml +++ b/toolchains/solidity/core/Cargo.toml @@ -16,6 +16,6 @@ rustdoc-args = ["--cfg", "docsrs"] [workspace.dependencies] # workspace crates extension = { version = "0.1.0", path = "crates/extension", default-features = false } -solidhunter = { version = "0.1.0", path = "crates/solidhunter", default-features = false } -linter-cli = { version = "0.1.0", path = "crates/linter-cli", default-features = false } +solidhunter = { version = "0.2.1", path = "crates/solidhunter", default-features = false } +linter-cli = { version = "0.2.0", path = "crates/linter-cli", default-features = false } linter-server = { version = "0.1.0", path = "crates/linter-server", default-features = false } \ No newline at end of file diff --git a/toolchains/solidity/core/crates/linter-cli/Cargo.toml b/toolchains/solidity/core/crates/linter-cli/Cargo.toml index f9d3501a..23d8805d 100644 --- a/toolchains/solidity/core/crates/linter-cli/Cargo.toml +++ b/toolchains/solidity/core/crates/linter-cli/Cargo.toml @@ -2,14 +2,14 @@ name = "solidhunter" description = "Fast solidity linter cli" repository = "https://github.com/astrodevs-labs/osmium" -version = "0.1.1" +version = "0.2.1" edition = "2021" license = "GPL-3.0-or-later" authors = ["AstroDevs-Labs"] # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -solidhunter-lib = { path = "../linter-lib", version = "0.1.0" } +solidhunter-lib = { path = "../linter-lib", version = "0.2.0" } clap = { version = "4.0.29", features = ["derive"] } colored = "2" serde = { version = "1.0.149", features = ["derive"] } diff --git a/toolchains/solidity/core/crates/linter-lib/Cargo.toml b/toolchains/solidity/core/crates/linter-lib/Cargo.toml index ec4349f3..e3468157 100644 --- a/toolchains/solidity/core/crates/linter-lib/Cargo.toml +++ b/toolchains/solidity/core/crates/linter-lib/Cargo.toml @@ -2,7 +2,7 @@ name = "solidhunter-lib" description = "Solidhunter/Osmium solidity linter library" repository = "https://github.com/astrodevs-labs/osmium" -version = "0.1.0" +version = "0.2.0" edition = "2021" authors = ["Astrodevs Labs"] license = "GPL-3.0-or-later" diff --git a/toolchains/solidity/core/crates/linter-server/Cargo.toml b/toolchains/solidity/core/crates/linter-server/Cargo.toml index 5158efd1..2aae3a68 100644 --- a/toolchains/solidity/core/crates/linter-server/Cargo.toml +++ b/toolchains/solidity/core/crates/linter-server/Cargo.toml @@ -11,5 +11,5 @@ crate-type = ["cdylib", "rlib"] [dependencies] osmium-libs-lsp-handler = { path = "../../../../../libs/lsp-handler", version = "0.0.3" } -solidhunter-lib = { path = "../linter-lib", version = "0.1.0" } +solidhunter-lib = { path = "../linter-lib", version = "0.2.0" } js-sys = "0.3.64" \ No newline at end of file From c2562733b2af197187eb5f57319dcb4bde5a79bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A9o=20Maringer?= Date: Fri, 10 Nov 2023 17:38:26 +0000 Subject: [PATCH 303/325] feat(solidity/linter): fix linting and format --- toolchains/solidity/core/Cargo.lock | 4 ++-- .../core/crates/linter-cli/src/main.rs | 10 ++-------- .../core/crates/linter-lib/src/ignore.rs | 4 ++-- .../core/crates/linter-lib/src/linter.rs | 9 +++++++-- .../core/crates/linter-lib/tests/linter.rs | 19 +++++++------------ 5 files changed, 20 insertions(+), 26 deletions(-) diff --git a/toolchains/solidity/core/Cargo.lock b/toolchains/solidity/core/Cargo.lock index d88e5ff9..ed6b7f31 100644 --- a/toolchains/solidity/core/Cargo.lock +++ b/toolchains/solidity/core/Cargo.lock @@ -451,7 +451,7 @@ dependencies = [ [[package]] name = "solidhunter" -version = "0.1.1" +version = "0.2.1" dependencies = [ "clap", "colored", @@ -462,7 +462,7 @@ dependencies = [ [[package]] name = "solidhunter-lib" -version = "0.1.0" +version = "0.2.0" dependencies = [ "anyhow", "clap", diff --git a/toolchains/solidity/core/crates/linter-cli/src/main.rs b/toolchains/solidity/core/crates/linter-cli/src/main.rs index 79d18542..dd3f4281 100644 --- a/toolchains/solidity/core/crates/linter-cli/src/main.rs +++ b/toolchains/solidity/core/crates/linter-cli/src/main.rs @@ -7,9 +7,7 @@ use solidhunter_lib::types::LintResult; #[derive(Parser, Debug)] #[command(author, version, about, long_about = None)] struct Args { - #[arg( - help = "Paths to the projects to lint" - )] + #[arg(help = "Paths to the projects to lint")] paths: Vec, #[arg( @@ -44,11 +42,7 @@ struct Args { )] init: bool, - #[arg( - short = 'e', - long = "exclude", - help = "Specify excluded files", - )] + #[arg(short = 'e', long = "exclude", help = "Specify excluded files")] exclude: Option>, } diff --git a/toolchains/solidity/core/crates/linter-lib/src/ignore.rs b/toolchains/solidity/core/crates/linter-lib/src/ignore.rs index ab5aca66..7cdc8f02 100644 --- a/toolchains/solidity/core/crates/linter-lib/src/ignore.rs +++ b/toolchains/solidity/core/crates/linter-lib/src/ignore.rs @@ -34,7 +34,7 @@ fn get_solidhunterignore_paths(filepath: &String) -> Result, SolidHu if let Ok(entries) = glob(&format!("{}/**/.solidhunterignore", filepath)) { for entry in entries.flatten() { - ignored_files.push(entry.into_os_string().into_string().unwrap()) + ignored_files.push(entry.into_os_string().into_string().unwrap()) } } @@ -51,7 +51,7 @@ pub fn get_excluded_files(filepaths: &Vec) -> Result, SolidH continue; } - let solidhunterignore_paths = get_solidhunterignore_paths(&filepath)?; + let solidhunterignore_paths = get_solidhunterignore_paths(filepath)?; for solidhunterignore_path in solidhunterignore_paths { if let Ok(mut excluded) = parse_solihunterignore(&solidhunterignore_path) { diff --git a/toolchains/solidity/core/crates/linter-lib/src/linter.rs b/toolchains/solidity/core/crates/linter-lib/src/linter.rs index 8e842b72..da50f1f9 100644 --- a/toolchains/solidity/core/crates/linter-lib/src/linter.rs +++ b/toolchains/solidity/core/crates/linter-lib/src/linter.rs @@ -64,13 +64,18 @@ impl SolidLinter { Ok(()) } - pub fn initialize_excluded_files(&mut self, excluded_filepaths: Option<&Vec>, filepaths: &Vec) -> Result<(), SolidHunterError> { + pub fn initialize_excluded_files( + &mut self, + excluded_filepaths: Option<&Vec>, + filepaths: &Vec, + ) -> Result<(), SolidHunterError> { if let Some(excluded) = excluded_filepaths { for path in excluded { self.excluded_files.push(path.clone()) } } - self.excluded_files.append(&mut get_excluded_files(filepaths)?); + self.excluded_files + .append(&mut get_excluded_files(filepaths)?); Ok(()) } diff --git a/toolchains/solidity/core/crates/linter-lib/tests/linter.rs b/toolchains/solidity/core/crates/linter-lib/tests/linter.rs index 4d162021..05bf0d4e 100644 --- a/toolchains/solidity/core/crates/linter-lib/tests/linter.rs +++ b/toolchains/solidity/core/crates/linter-lib/tests/linter.rs @@ -11,7 +11,6 @@ struct Finding { fn test_directory(base_name: &str) { let mut source = String::new(); let mut config = String::new(); - let mut ignore = String::new(); let mut expected_findings: Vec = Vec::new(); for path in fs::read_dir( @@ -19,7 +18,7 @@ fn test_directory(base_name: &str) { .join("testdata") .join(base_name), ) - .unwrap() + .unwrap() { let path = path.unwrap().path(); @@ -28,8 +27,6 @@ fn test_directory(base_name: &str) { source = path.to_str().unwrap().to_string(); } else if filename == ".solidhunter.json" { config = path.to_str().unwrap().to_string(); - } else if filename == ".solidhunterignore" { - ignore = path.to_str().unwrap().to_string(); } else if filename == "findings.csv" { for line in fs::read_to_string(path).unwrap().lines() { let splitted_line: Vec<&str> = line.split(':').collect(); @@ -49,10 +46,10 @@ fn test_directory(base_name: &str) { } } - test_linter(&config, &source, &expected_findings, &ignore); + test_linter(&config, &source, &expected_findings); } -fn test_linter(config: &str, source: &str, expected_findings: &Vec, ignore: &str) { +fn test_linter(config: &str, source: &str, expected_findings: &Vec) { let mut linter: SolidLinter = SolidLinter::new(); let _ = linter.initialize_rules(&String::from(config)); @@ -187,10 +184,8 @@ fn SolidhunterIgnore() { let _ = linter.initialize_rules(&String::from( path.join(".solidhunter.json").to_str().unwrap(), )); - let _ = linter.initialize_excluded_files( - Some(&vec![]), - &vec![path.to_str().unwrap().to_string()], - ); + let _ = + linter.initialize_excluded_files(Some(&vec![]), &vec![path.to_str().unwrap().to_string()]); let result = linter.parse_path(path.to_str().unwrap()); @@ -199,9 +194,9 @@ fn SolidhunterIgnore() { for lint_result in result { match lint_result { Ok(lint_result) => diags_number += lint_result.diags.len(), - Err(e) => println!("{}", e) + Err(e) => println!("{}", e), } } assert_eq!(diags_number, 3, "Invalid number of diagnostics"); -} \ No newline at end of file +} From e701300d9b30ea3ff7bc43eb64d11342e9b24637 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A9o=20Maringer?= Date: Fri, 10 Nov 2023 17:41:59 +0000 Subject: [PATCH 304/325] feat(solidity/linter): change linter-server crate version --- toolchains/solidity/core/Cargo.lock | 2 +- toolchains/solidity/core/crates/linter-server/Cargo.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/toolchains/solidity/core/Cargo.lock b/toolchains/solidity/core/Cargo.lock index ed6b7f31..cfe81d74 100644 --- a/toolchains/solidity/core/Cargo.lock +++ b/toolchains/solidity/core/Cargo.lock @@ -243,7 +243,7 @@ checksum = "a08173bc88b7955d1b3145aa561539096c421ac8debde8cbc3612ec635fee29b" [[package]] name = "linter-server" -version = "0.0.2" +version = "0.1.2" dependencies = [ "js-sys", "osmium-libs-lsp-handler", diff --git a/toolchains/solidity/core/crates/linter-server/Cargo.toml b/toolchains/solidity/core/crates/linter-server/Cargo.toml index 2aae3a68..91e79196 100644 --- a/toolchains/solidity/core/crates/linter-server/Cargo.toml +++ b/toolchains/solidity/core/crates/linter-server/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "linter-server" license = "GPL-3.0-or-later" -version = "0.0.2" +version = "0.1.2" edition = "2021" [lib] From 7a528992b2d3107293debc1a18ef3f4a99e2e6dd Mon Sep 17 00:00:00 2001 From: Astrodevs CI Date: Wed, 22 Nov 2023 04:45:05 +0000 Subject: [PATCH 305/325] chore: create branch chore/208-binary-architecture-staging --- remove-me-edda686584d045e895e0.txt | 1 + 1 file changed, 1 insertion(+) create mode 100644 remove-me-edda686584d045e895e0.txt diff --git a/remove-me-edda686584d045e895e0.txt b/remove-me-edda686584d045e895e0.txt new file mode 100644 index 00000000..40297de5 --- /dev/null +++ b/remove-me-edda686584d045e895e0.txt @@ -0,0 +1 @@ +edda686584d045e895e0 From 5f53e5ca2bc9c384bb7b353a2c1f2e5f1e0a086b Mon Sep 17 00:00:00 2001 From: Astrodevs CI Date: Wed, 22 Nov 2023 04:45:17 +0000 Subject: [PATCH 306/325] chore: create branch chore/208-binary-architecture/209-translate-core-to-binaries-staging --- remove-me-455152676f41420e9498.txt | 1 + 1 file changed, 1 insertion(+) create mode 100644 remove-me-455152676f41420e9498.txt diff --git a/remove-me-455152676f41420e9498.txt b/remove-me-455152676f41420e9498.txt new file mode 100644 index 00000000..163f1033 --- /dev/null +++ b/remove-me-455152676f41420e9498.txt @@ -0,0 +1 @@ +455152676f41420e9498 From b56d89858e980d83b1a089abbe3cac064b923fac Mon Sep 17 00:00:00 2001 From: 0xMemoryGrinder <35138272+0xMemoryGrinder@users.noreply.github.com> Date: Wed, 22 Nov 2023 00:47:26 -0500 Subject: [PATCH 307/325] refactor(solidity/core): made linter-server a standalone binary with its own lsp server --- libs/lsp-server-wrapper/Cargo.toml | 2 +- libs/lsp-server-wrapper/package.json | 3 +- toolchains/solidity/core/Cargo.lock | 163 ++++------------ .../core/crates/linter-server/Cargo.toml | 8 +- .../core/crates/linter-server/src/lib.rs | 181 ------------------ .../core/crates/linter-server/src/main.rs | 137 +++++++++++++ toolchains/solidity/core/package.json | 2 +- 7 files changed, 182 insertions(+), 314 deletions(-) delete mode 100644 toolchains/solidity/core/crates/linter-server/src/lib.rs create mode 100644 toolchains/solidity/core/crates/linter-server/src/main.rs diff --git a/libs/lsp-server-wrapper/Cargo.toml b/libs/lsp-server-wrapper/Cargo.toml index 3a3c52eb..932d73b7 100644 --- a/libs/lsp-server-wrapper/Cargo.toml +++ b/libs/lsp-server-wrapper/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "lsp-server-wrapper" +name = "osmium-libs-lsp-server-wrapper" license = "GPL-3.0-or-later" version = "0.1.0" edition = "2021" diff --git a/libs/lsp-server-wrapper/package.json b/libs/lsp-server-wrapper/package.json index ab9edb4e..faf7a687 100644 --- a/libs/lsp-server-wrapper/package.json +++ b/libs/lsp-server-wrapper/package.json @@ -4,6 +4,7 @@ "build": "cargo build --release", "format": "cargo fmt --check --all", "test": "cargo test", - "lint": "cargo clippy --all-targets --all-features -- -D warnings" + "lint": "cargo clippy --all-targets --all-features -- -D warnings", + "publish": "cargo package && cargo publish" } } diff --git a/toolchains/solidity/core/Cargo.lock b/toolchains/solidity/core/Cargo.lock index cfe81d74..35073396 100644 --- a/toolchains/solidity/core/Cargo.lock +++ b/toolchains/solidity/core/Cargo.lock @@ -77,12 +77,6 @@ version = "2.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "327762f6e5a765692301e5bb513e0d9fef63be86bbc14528052b1cd3e6f03e07" -[[package]] -name = "bumpalo" -version = "3.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f30e7476521f6f8af1a1c4c0b8cc94f0bee37d91763d0ca2665f299b6cd8aec" - [[package]] name = "cfg-if" version = "1.0.0" @@ -146,6 +140,25 @@ dependencies = [ "windows-sys", ] +[[package]] +name = "crossbeam-channel" +version = "0.5.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a33c2bf77f2df06183c3aa30d1e96c0695a313d4f9c453cc3762a6db39f99200" +dependencies = [ + "cfg-if", + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-utils" +version = "0.8.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a22b2d63d4d1dc0b7f1b6b2747dd0088008a9be28b6ddf0b1e7d335e3037294" +dependencies = [ + "cfg-if", +] + [[package]] name = "errno" version = "0.3.5" @@ -156,16 +169,6 @@ dependencies = [ "windows-sys", ] -[[package]] -name = "extension" -version = "0.1.0" -dependencies = [ - "js-sys", - "linter-server", - "osmium-libs-lsp-handler", - "wasm-bindgen", -] - [[package]] name = "form_urlencoded" version = "1.2.0" @@ -220,15 +223,6 @@ version = "1.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "af150ab688ff2122fcef229be89cb50dd66af9e01a4ff320cc137eecc9bacc38" -[[package]] -name = "js-sys" -version = "0.3.65" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54c0c35952f67de54bb584e9fd912b3023117cbafc0a77d8f3dee1fb5f572fe8" -dependencies = [ - "wasm-bindgen", -] - [[package]] name = "lazy_static" version = "1.4.0" @@ -245,8 +239,7 @@ checksum = "a08173bc88b7955d1b3145aa561539096c421ac8debde8cbc3612ec635fee29b" name = "linter-server" version = "0.1.2" dependencies = [ - "js-sys", - "osmium-libs-lsp-handler", + "osmium-libs-lsp-server-wrapper", "solidhunter-lib", ] @@ -262,6 +255,18 @@ version = "0.4.20" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" +[[package]] +name = "lsp-server" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b52dccdf3302eefab8c8a1273047f0a3c3dca4b527c8458d00c09484c8371928" +dependencies = [ + "crossbeam-channel", + "log", + "serde", + "serde_json", +] + [[package]] name = "lsp-types" version = "0.94.1" @@ -288,17 +293,14 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d" [[package]] -name = "osmium-libs-lsp-handler" -version = "0.0.3" +name = "osmium-libs-lsp-server-wrapper" +version = "0.1.0" dependencies = [ - "js-sys", + "lsp-server", "lsp-types", "serde", - "serde-wasm-bindgen", "serde_json", "tracing", - "wasm-bindgen", - "wasm-bindgen-futures", ] [[package]] @@ -398,29 +400,18 @@ checksum = "1ad4cc8da4ef723ed60bced201181d83791ad433213d8c24efffda1eec85d741" [[package]] name = "serde" -version = "1.0.190" +version = "1.0.193" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91d3c334ca1ee894a2c6f6ad698fe8c435b76d504b13d436f0685d648d6d96f7" +checksum = "25dd9975e68d0cb5aa1120c288333fc98731bd1dd12f561e468ea4728c042b89" dependencies = [ "serde_derive", ] -[[package]] -name = "serde-wasm-bindgen" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17ba92964781421b6cef36bf0d7da26d201e96d84e1b10e7ae6ed416e516906d" -dependencies = [ - "js-sys", - "serde", - "wasm-bindgen", -] - [[package]] name = "serde_derive" -version = "1.0.190" +version = "1.0.193" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67c5609f394e5c2bd7fc51efda478004ea80ef42fee983d5c67a65e34f32c0e3" +checksum = "43576ca501357b9b071ac53cdc7da8ef0cbd9493d8df094cd821777ea6e894d3" dependencies = [ "proc-macro2", "quote", @@ -609,82 +600,6 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a" -[[package]] -name = "wasm-bindgen" -version = "0.2.88" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7daec296f25a1bae309c0cd5c29c4b260e510e6d813c286b19eaadf409d40fce" -dependencies = [ - "cfg-if", - "wasm-bindgen-macro", -] - -[[package]] -name = "wasm-bindgen-backend" -version = "0.2.88" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e397f4664c0e4e428e8313a469aaa58310d302159845980fd23b0f22a847f217" -dependencies = [ - "bumpalo", - "log", - "once_cell", - "proc-macro2", - "quote", - "syn", - "wasm-bindgen-shared", -] - -[[package]] -name = "wasm-bindgen-futures" -version = "0.4.38" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9afec9963e3d0994cac82455b2b3502b81a7f40f9a0d32181f7528d9f4b43e02" -dependencies = [ - "cfg-if", - "js-sys", - "wasm-bindgen", - "web-sys", -] - -[[package]] -name = "wasm-bindgen-macro" -version = "0.2.88" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5961017b3b08ad5f3fe39f1e79877f8ee7c23c5e5fd5eb80de95abc41f1f16b2" -dependencies = [ - "quote", - "wasm-bindgen-macro-support", -] - -[[package]] -name = "wasm-bindgen-macro-support" -version = "0.2.88" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c5353b8dab669f5e10f5bd76df26a9360c748f054f862ff5f3f8aae0c7fb3907" -dependencies = [ - "proc-macro2", - "quote", - "syn", - "wasm-bindgen-backend", - "wasm-bindgen-shared", -] - -[[package]] -name = "wasm-bindgen-shared" -version = "0.2.88" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d046c5d029ba91a1ed14da14dca44b68bf2f124cfbaf741c54151fdb3e0750b" - -[[package]] -name = "web-sys" -version = "0.3.65" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5db499c5f66323272151db0e666cd34f78617522fb0c1604d31a27c50c206a85" -dependencies = [ - "js-sys", - "wasm-bindgen", -] - [[package]] name = "windows-sys" version = "0.48.0" diff --git a/toolchains/solidity/core/crates/linter-server/Cargo.toml b/toolchains/solidity/core/crates/linter-server/Cargo.toml index 91e79196..6d299bd5 100644 --- a/toolchains/solidity/core/crates/linter-server/Cargo.toml +++ b/toolchains/solidity/core/crates/linter-server/Cargo.toml @@ -4,12 +4,8 @@ license = "GPL-3.0-or-later" version = "0.1.2" edition = "2021" -[lib] -crate-type = ["cdylib", "rlib"] - # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -osmium-libs-lsp-handler = { path = "../../../../../libs/lsp-handler", version = "0.0.3" } -solidhunter-lib = { path = "../linter-lib", version = "0.2.0" } -js-sys = "0.3.64" \ No newline at end of file +osmium-libs-lsp-server-wrapper = { path = "../../../../../libs/lsp-server-wrapper", version = "0.1.0" } +solidhunter-lib = { path = "../linter-lib", version = "0.2.0" } \ No newline at end of file diff --git a/toolchains/solidity/core/crates/linter-server/src/lib.rs b/toolchains/solidity/core/crates/linter-server/src/lib.rs deleted file mode 100644 index 9adf3568..00000000 --- a/toolchains/solidity/core/crates/linter-server/src/lib.rs +++ /dev/null @@ -1,181 +0,0 @@ -use std::cell::RefCell; - -use osmium_libs_lsp_handler::{ - lsp_types::{ - Diagnostic, DiagnosticSeverity, DidChangeTextDocumentParams, DidChangeWatchedFilesParams, - DidOpenTextDocumentParams, InitializeParams, InitializeResult, InitializedParams, - MessageType, Position, Range, ServerCapabilities, TextDocumentSyncCapability, - TextDocumentSyncKind, Url, - }, - Connection, Handler, Result, -}; -use solidhunter_lib::{linter::SolidLinter, types::LintDiag}; - -struct Backend { - connection: Connection, - config_file_path: String, - linter: RefCell>, -} - -impl Handler for Backend { - fn initialize(&self, _: InitializeParams) -> Result { - eprintln!("starting example main loop"); - Ok(InitializeResult { - server_info: None, - capabilities: ServerCapabilities { - text_document_sync: Some(TextDocumentSyncCapability::Kind( - TextDocumentSyncKind::FULL, - )), - ..ServerCapabilities::default() - }, - }) - } - - fn initialized(&self, _: InitializedParams) { - eprintln!( - "Initializing server with config file: {:?}", - self.config_file_path - ); - self.connection - .log_message(MessageType::INFO, "Server initialized!"); - - if std::path::Path::new(&self.config_file_path).is_file() { - let mut linter = SolidLinter::new(); - let res = linter.initialize_rules(&self.config_file_path); - if let Err(e) = res { - eprintln!("Error initializing rules: {:?}", e); - self.linter - .borrow_mut() - .replace(SolidLinter::new_fileless()); - return; - } - self.linter.replace(Some(linter)); - } else { - self.linter - .borrow_mut() - .replace(SolidLinter::new_fileless()); - } - - self.connection - .log_message(MessageType::INFO, "Linter initialized!"); - } - - fn shutdown(&self) -> Result<()> { - self.connection - .log_message(MessageType::INFO, "Server shutdown!"); - Ok(()) - } - - fn did_open(&self, params: DidOpenTextDocumentParams) { - self.connection.log_message( - MessageType::INFO, - format!("file opened!: {:}", params.text_document.uri), - ); - - let filepath = filepath_from_uri(¶ms.text_document.uri); - let mut linter = self.linter.borrow_mut(); - let linter = match linter.as_mut() { - Some(l) => l, - None => { - eprintln!("Linter cannot be ran due to previous errors"); - return; - } - }; - let diags_res = linter.parse_content(&filepath, ¶ms.text_document.text); - - if let Ok(diags) = diags_res { - let diags = diags - .diags - .iter() - .map(|d| diagnostic_from_lintdiag(d.clone())) - .collect(); - eprintln!("diags: {:#?}", diags); - self.connection - .publish_diagnostics(params.text_document.uri.clone(), diags, None); - } else if let Err(e) = diags_res { - self.connection - .log_message(MessageType::ERROR, e.to_string()); - } - } - - fn did_change(&self, params: DidChangeTextDocumentParams) { - self.connection.log_message( - MessageType::INFO, - format!("file changed!: {:}", params.text_document.uri), - ); - - let filepath = filepath_from_uri(¶ms.text_document.uri); - let mut linter = self.linter.borrow_mut(); - let linter = match linter.as_mut() { - Some(l) => l, - None => { - eprintln!("Linter cannot be ran due to previous errors"); - return; - } - }; - let diags_res = linter.parse_content(&filepath, ¶ms.content_changes[0].text); - - if let Ok(diags) = diags_res { - let diags = diags - .diags - .iter() - .map(|d| diagnostic_from_lintdiag(d.clone())) - .collect(); - eprintln!("diags: {:#?}", diags); - self.connection - .publish_diagnostics(params.text_document.uri.clone(), diags, None); - } else if let Err(e) = diags_res { - self.connection - .log_message(MessageType::ERROR, e.to_string()); - } - } - - fn did_change_watched_files(&self, _: DidChangeWatchedFilesParams) { - self.connection - .log_message(MessageType::INFO, "configuration file changed!"); - - if std::path::Path::new(&self.config_file_path).is_file() { - let mut linter = SolidLinter::new(); - let res = linter.initialize_rules(&self.config_file_path); - if res.is_ok() { - self.linter.replace(Some(linter)); - } - } - } -} - -pub fn filepath_from_uri(uri: &Url) -> String { - let path = uri.path(); - path.to_string() -} - -fn diagnostic_from_lintdiag(diag: LintDiag) -> Diagnostic { - Diagnostic { - range: Range { - start: Position { - line: diag.range.start.line as u32 - 1, - character: diag.range.start.character as u32, - }, - end: Position { - line: diag.range.end.line as u32 - 1, - character: diag.range.end.character as u32, - }, - }, - severity: Some(DiagnosticSeverity::WARNING), - code: None, - code_description: None, - source: Some("osmium-solidity-linter".to_string()), - message: diag.message, - related_information: None, - tags: None, - data: None, - } -} - -pub fn create_linter(connection: Connection) -> Box { - Box::new(Backend { - connection, - config_file_path: ".solidhunter.json".to_string(), - linter: RefCell::new(None), - }) -} diff --git a/toolchains/solidity/core/crates/linter-server/src/main.rs b/toolchains/solidity/core/crates/linter-server/src/main.rs new file mode 100644 index 00000000..2f97ac03 --- /dev/null +++ b/toolchains/solidity/core/crates/linter-server/src/main.rs @@ -0,0 +1,137 @@ + +use std::{cell::RefCell, rc::Rc}; +use osmium_libs_lsp_server_wrapper::{ + lsp_types::*, + Result, + Client, + LanguageServer, + LspStdioServer}; +use solidhunter_lib::{linter::SolidLinter, types::LintDiag}; + +struct Backend { + connection: Rc>, + linter: RefCell>, +} + +impl LanguageServer for Backend { + fn initialize(&self, _: InitializeParams) -> Result { + eprintln!("starting example main loop"); + Ok(InitializeResult { + server_info: None, + capabilities: ServerCapabilities { + text_document_sync: Some(TextDocumentSyncCapability::Kind( + TextDocumentSyncKind::FULL, + )), + ..ServerCapabilities::default() + }, + }) + } + + fn initialized(&self, _: InitializedParams) { + self.connection.borrow_mut() + .log_message(MessageType::INFO, "Server initialized!"); + + self.linter + .borrow_mut() + .replace(SolidLinter::new_fileless()); + + self.connection.borrow_mut() + .log_message(MessageType::INFO, "Linter initialized!"); + } + + fn shutdown(&self) -> Result<()> { + self.connection.borrow_mut() + .log_message(MessageType::INFO, "Server shutdown!"); + Ok(()) + } + + fn did_open(&self, params: DidOpenTextDocumentParams) { + self.connection.borrow_mut().log_message( + MessageType::INFO, + format!("file opened!: {:}", params.text_document.uri), + ); + + self.lint(params.text_document.uri, params.text_document.text); + } + + fn did_change(&self, params: DidChangeTextDocumentParams) { + self.connection.borrow_mut().log_message( + MessageType::INFO, + format!("file changed!: {:}", params.text_document.uri), + ); + + self.lint(params.text_document.uri, params.content_changes[0].text.clone()); + } +} + +impl Backend { + pub fn new(connection: Rc>) -> Self { + Self { + connection, + linter: RefCell::new(None), + } + } + + pub fn lint(&self, uri: Url, text: String) { + let filepath = filepath_from_uri(&uri); + let mut linter = self.linter.borrow_mut(); + let linter = match linter.as_mut() { + Some(l) => l, + None => { + eprintln!("Linter cannot be ran due to previous errors"); + return; + } + }; + let diags_res = linter.parse_content(&filepath, &text); + + if let Ok(diags) = diags_res { + let diags = diags + .diags + .iter() + .map(|d| diagnostic_from_lintdiag(d.clone())) + .collect(); + eprintln!("diags: {:#?}", diags); + self.connection.borrow_mut() + .publish_diagnostics(uri.clone(), diags, None); + } else if let Err(e) = diags_res { + self.connection.borrow_mut() + .log_message(MessageType::ERROR, e.to_string()); + } + } +} + +pub fn filepath_from_uri(uri: &Url) -> String { + let path = uri.path(); + path.to_string() +} + +fn diagnostic_from_lintdiag(diag: LintDiag) -> Diagnostic { + Diagnostic { + range: Range { + start: Position { + line: diag.range.start.line as u32 - 1, + character: diag.range.start.character as u32, + }, + end: Position { + line: diag.range.end.line as u32 - 1, + character: diag.range.end.character as u32, + }, + }, + severity: Some(DiagnosticSeverity::WARNING), + code: None, + code_description: None, + source: Some("osmium-solidity-linter".to_string()), + message: diag.message, + related_information: None, + tags: None, + data: None, + } +} + +fn main() -> std::result::Result<(), usize> { + let server = LspStdioServer::new(); + LspStdioServer::serve(server, |connection| Backend::new(connection)).map_err(|err| { + eprintln!("Error: {:?}", err); + 1 + }) +} \ No newline at end of file diff --git a/toolchains/solidity/core/package.json b/toolchains/solidity/core/package.json index 8f4c0931..2821ca76 100644 --- a/toolchains/solidity/core/package.json +++ b/toolchains/solidity/core/package.json @@ -3,7 +3,7 @@ "version": "0.0.2", "license": "MIT", "scripts": { - "core:build": "cd crates/extension && make && cd ../..", + "core:build": "cargo build --workspace --release && cp target/release/linter-server ../extension/dist", "core:lint": "cargo clippy -- -D warnings", "core:format": "cargo fmt --check --all", "core:test": "cargo test --workspace", From cd274a9310a8edec1ae2b2affceed14c54339912 Mon Sep 17 00:00:00 2001 From: 0xMemoryGrinder <35138272+0xMemoryGrinder@users.noreply.github.com> Date: Wed, 22 Nov 2023 00:53:24 -0500 Subject: [PATCH 308/325] refactor(solidity/extension): now launch the lsp server binary instead of the typescript bridge --- toolchains/solidity/extension/dist/.gitignore | 2 + toolchains/solidity/extension/package.json | 2 +- .../extension/src/{client.ts => extension.ts} | 10 ++-- toolchains/solidity/extension/src/server.ts | 52 ------------------- .../solidity/extension/webpack.config.js | 3 +- 5 files changed, 9 insertions(+), 60 deletions(-) create mode 100644 toolchains/solidity/extension/dist/.gitignore rename toolchains/solidity/extension/src/{client.ts => extension.ts} (90%) delete mode 100644 toolchains/solidity/extension/src/server.ts diff --git a/toolchains/solidity/extension/dist/.gitignore b/toolchains/solidity/extension/dist/.gitignore new file mode 100644 index 00000000..c96a04f0 --- /dev/null +++ b/toolchains/solidity/extension/dist/.gitignore @@ -0,0 +1,2 @@ +* +!.gitignore \ No newline at end of file diff --git a/toolchains/solidity/extension/package.json b/toolchains/solidity/extension/package.json index f8fb7ae1..71c11596 100644 --- a/toolchains/solidity/extension/package.json +++ b/toolchains/solidity/extension/package.json @@ -18,7 +18,7 @@ "activationEvents": [ "onLanguage:solidity" ], - "main": "./dist/client.js", + "main": "./dist/extension.js", "contributes": { "commands": [ { diff --git a/toolchains/solidity/extension/src/client.ts b/toolchains/solidity/extension/src/extension.ts similarity index 90% rename from toolchains/solidity/extension/src/client.ts rename to toolchains/solidity/extension/src/extension.ts index 2c44efdd..2d021566 100644 --- a/toolchains/solidity/extension/src/client.ts +++ b/toolchains/solidity/extension/src/extension.ts @@ -18,17 +18,17 @@ let client: LanguageClient; export async function activate(context: ExtensionContext) { // The server is implemented in node - const serverModule = context.asAbsolutePath( - path.join('dist', 'server.js') + const serverBinary = context.asAbsolutePath( + path.join('dist', 'linter-server') ); // If the extension is launched in debug mode then the debug server options are used // Otherwise the run options are used const serverOptions: ServerOptions = { - run: { module: serverModule, transport: TransportKind.ipc }, + run: { command: serverBinary, transport: TransportKind.stdio }, debug: { - module: serverModule, - transport: TransportKind.ipc, + command: serverBinary, + transport: TransportKind.stdio, } }; diff --git a/toolchains/solidity/extension/src/server.ts b/toolchains/solidity/extension/src/server.ts deleted file mode 100644 index cbe766e2..00000000 --- a/toolchains/solidity/extension/src/server.ts +++ /dev/null @@ -1,52 +0,0 @@ -/* -------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - * ------------------------------------------------------------------------------------------ */ -import { - createConnection, - TextDocuments, - Diagnostic, - DiagnosticSeverity, - ProposedFeatures, - InitializeParams, - DidChangeConfigurationNotification, - CompletionItem, - CompletionItemKind, - TextDocumentPositionParams, - TextDocumentSyncKind, - InitializeResult -} from 'vscode-languageserver/node'; -import {create_extension} from '../dist'; - -// Create a connection for the server, using Node's IPC as a transport. -// Also include all preview / proposed LSP features. -const connection = createConnection(ProposedFeatures.all); - - - - -const sendRequest = (method: string, params: any) => { - return connection.sendRequest(method, params); -}; - -const sendNotification = (method: string, params: any) => { - connection.sendNotification(method, params); -}; - -const extension = create_extension(sendRequest, sendNotification); - -connection.onInitialize((params: InitializeParams) => { - return extension.onRequest('initialize', params); -}); - -connection.onRequest((method: string, params: any) => { - connection.console.log(`onRequest: ${method}`); - - return extension.onRequest(method, params); -}); - -connection.onNotification((method: string, params: any) => { - extension.onNotification(method, params); -}); - -connection.listen(); diff --git a/toolchains/solidity/extension/webpack.config.js b/toolchains/solidity/extension/webpack.config.js index c5d42b7f..ac2e9abb 100644 --- a/toolchains/solidity/extension/webpack.config.js +++ b/toolchains/solidity/extension/webpack.config.js @@ -13,8 +13,7 @@ const extensionConfig = { mode: 'none', // this leaves the source code as close as possible to the original (when packaging we set this to 'production') entry: { - client: './src/client.ts', // the entry point of this extension, 📖 -> https://webpack.js.org/configuration/entry-context/ - server: './src/server.ts', + extension: './src/extension.ts', // the entry point of this extension, 📖 -> https://webpack.js.org/configuration/entry-context/ }, output: { // the bundle is stored in the 'dist' folder (check package.json), 📖 -> https://webpack.js.org/configuration/output/ From b057b024088e624c7e5275f8059203c357dc05a9 Mon Sep 17 00:00:00 2001 From: 0xMemoryGrinder <35138272+0xMemoryGrinder@users.noreply.github.com> Date: Wed, 22 Nov 2023 00:53:57 -0500 Subject: [PATCH 309/325] refactor(solidity/core): removed now useless extension entrypoint crate --- .../solidity/core/crates/extension/Cargo.toml | 16 ---------------- .../solidity/core/crates/extension/Makefile | 2 -- .../solidity/core/crates/extension/src/lib.rs | 16 ---------------- 3 files changed, 34 deletions(-) delete mode 100644 toolchains/solidity/core/crates/extension/Cargo.toml delete mode 100644 toolchains/solidity/core/crates/extension/Makefile delete mode 100644 toolchains/solidity/core/crates/extension/src/lib.rs diff --git a/toolchains/solidity/core/crates/extension/Cargo.toml b/toolchains/solidity/core/crates/extension/Cargo.toml deleted file mode 100644 index fd209f81..00000000 --- a/toolchains/solidity/core/crates/extension/Cargo.toml +++ /dev/null @@ -1,16 +0,0 @@ -[package] -name = "extension" -version = "0.1.0" -license = "GPL-3.0-or-later" -edition = "2021" - -[lib] -crate-type = ["cdylib", "rlib"] - -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html - -[dependencies] -wasm-bindgen = "0.2.87" -osmium-libs-lsp-handler = { path = "../../../../../libs/lsp-handler", version = "0.0.3" } -linter-server = { path= "../linter-server"} -js-sys = "0.3.64" \ No newline at end of file diff --git a/toolchains/solidity/core/crates/extension/Makefile b/toolchains/solidity/core/crates/extension/Makefile deleted file mode 100644 index 2d6c7ff0..00000000 --- a/toolchains/solidity/core/crates/extension/Makefile +++ /dev/null @@ -1,2 +0,0 @@ -build: - wasm-pack build --target nodejs --dev --out-dir ../../../extension/dist \ No newline at end of file diff --git a/toolchains/solidity/core/crates/extension/src/lib.rs b/toolchains/solidity/core/crates/extension/src/lib.rs deleted file mode 100644 index f41ca686..00000000 --- a/toolchains/solidity/core/crates/extension/src/lib.rs +++ /dev/null @@ -1,16 +0,0 @@ -use linter_server::create_linter; -use osmium_libs_lsp_handler::{Connection, Dispatcher}; -use wasm_bindgen::prelude::*; - -#[wasm_bindgen] -pub fn create_extension( - send_request: js_sys::Function, - send_notification: js_sys::Function, -) -> Dispatcher { - let creators = vec![create_linter]; - - let connection = Connection::new(send_request, send_notification); - let mut dispatcher = Dispatcher::new(connection); - dispatcher.setup(creators); - dispatcher -} From d4f0080c52fb53fa0b65011d504e5cf7f8a0304e Mon Sep 17 00:00:00 2001 From: 0xMemoryGrinder <35138272+0xMemoryGrinder@users.noreply.github.com> Date: Wed, 22 Nov 2023 01:01:55 -0500 Subject: [PATCH 310/325] choresolidity/core/linter-server): ran lint and format --- .../core/crates/linter-server/src/main.rs | 34 +++++++++++-------- 1 file changed, 19 insertions(+), 15 deletions(-) diff --git a/toolchains/solidity/core/crates/linter-server/src/main.rs b/toolchains/solidity/core/crates/linter-server/src/main.rs index 2f97ac03..28f0932b 100644 --- a/toolchains/solidity/core/crates/linter-server/src/main.rs +++ b/toolchains/solidity/core/crates/linter-server/src/main.rs @@ -1,12 +1,8 @@ - -use std::{cell::RefCell, rc::Rc}; use osmium_libs_lsp_server_wrapper::{ - lsp_types::*, - Result, - Client, - LanguageServer, - LspStdioServer}; + lsp_types::*, Client, LanguageServer, LspStdioServer, Result, +}; use solidhunter_lib::{linter::SolidLinter, types::LintDiag}; +use std::{cell::RefCell, rc::Rc}; struct Backend { connection: Rc>, @@ -28,19 +24,22 @@ impl LanguageServer for Backend { } fn initialized(&self, _: InitializedParams) { - self.connection.borrow_mut() + self.connection + .borrow_mut() .log_message(MessageType::INFO, "Server initialized!"); self.linter .borrow_mut() .replace(SolidLinter::new_fileless()); - self.connection.borrow_mut() + self.connection + .borrow_mut() .log_message(MessageType::INFO, "Linter initialized!"); } fn shutdown(&self) -> Result<()> { - self.connection.borrow_mut() + self.connection + .borrow_mut() .log_message(MessageType::INFO, "Server shutdown!"); Ok(()) } @@ -60,7 +59,10 @@ impl LanguageServer for Backend { format!("file changed!: {:}", params.text_document.uri), ); - self.lint(params.text_document.uri, params.content_changes[0].text.clone()); + self.lint( + params.text_document.uri, + params.content_changes[0].text.clone(), + ); } } @@ -91,10 +93,12 @@ impl Backend { .map(|d| diagnostic_from_lintdiag(d.clone())) .collect(); eprintln!("diags: {:#?}", diags); - self.connection.borrow_mut() + self.connection + .borrow_mut() .publish_diagnostics(uri.clone(), diags, None); } else if let Err(e) = diags_res { - self.connection.borrow_mut() + self.connection + .borrow_mut() .log_message(MessageType::ERROR, e.to_string()); } } @@ -130,8 +134,8 @@ fn diagnostic_from_lintdiag(diag: LintDiag) -> Diagnostic { fn main() -> std::result::Result<(), usize> { let server = LspStdioServer::new(); - LspStdioServer::serve(server, |connection| Backend::new(connection)).map_err(|err| { + LspStdioServer::serve(server, Backend::new).map_err(|err| { eprintln!("Error: {:?}", err); 1 }) -} \ No newline at end of file +} From 23e4608ea16411e0e764a75fd970bf19c5fc8bfd Mon Sep 17 00:00:00 2001 From: 0xMemoryGrinder <35138272+0xMemoryGrinder@users.noreply.github.com> Date: Wed, 22 Nov 2023 14:34:55 -0500 Subject: [PATCH 311/325] chore(solidity/core/linter-server): increased version for architecture change --- toolchains/solidity/core/Cargo.lock | 2 +- toolchains/solidity/core/crates/linter-server/Cargo.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/toolchains/solidity/core/Cargo.lock b/toolchains/solidity/core/Cargo.lock index 35073396..481a071b 100644 --- a/toolchains/solidity/core/Cargo.lock +++ b/toolchains/solidity/core/Cargo.lock @@ -237,7 +237,7 @@ checksum = "a08173bc88b7955d1b3145aa561539096c421ac8debde8cbc3612ec635fee29b" [[package]] name = "linter-server" -version = "0.1.2" +version = "0.2.0" dependencies = [ "osmium-libs-lsp-server-wrapper", "solidhunter-lib", diff --git a/toolchains/solidity/core/crates/linter-server/Cargo.toml b/toolchains/solidity/core/crates/linter-server/Cargo.toml index 6d299bd5..ce4305b0 100644 --- a/toolchains/solidity/core/crates/linter-server/Cargo.toml +++ b/toolchains/solidity/core/crates/linter-server/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "linter-server" license = "GPL-3.0-or-later" -version = "0.1.2" +version = "0.2.0" edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html From 8aba511ae9e4f3fbad72d2389fe459d2c93da339 Mon Sep 17 00:00:00 2001 From: 0xMemoryGrinder <35138272+0xMemoryGrinder@users.noreply.github.com> Date: Wed, 22 Nov 2023 14:36:10 -0500 Subject: [PATCH 312/325] chore: deleted remove-me --- remove-me-455152676f41420e9498.txt | 1 - 1 file changed, 1 deletion(-) delete mode 100644 remove-me-455152676f41420e9498.txt diff --git a/remove-me-455152676f41420e9498.txt b/remove-me-455152676f41420e9498.txt deleted file mode 100644 index 163f1033..00000000 --- a/remove-me-455152676f41420e9498.txt +++ /dev/null @@ -1 +0,0 @@ -455152676f41420e9498 From bac43a91b1b04c6523a9ddda968cabc77f0f3417 Mon Sep 17 00:00:00 2001 From: Astrodevs CI Date: Wed, 22 Nov 2023 06:03:10 +0000 Subject: [PATCH 313/325] chore: create branch chore/208-binary-architecture/210-multi-platform-ci-cd-staging --- remove-me-ca872238ea5642859a1c.txt | 1 + 1 file changed, 1 insertion(+) create mode 100644 remove-me-ca872238ea5642859a1c.txt diff --git a/remove-me-ca872238ea5642859a1c.txt b/remove-me-ca872238ea5642859a1c.txt new file mode 100644 index 00000000..f1ec0db0 --- /dev/null +++ b/remove-me-ca872238ea5642859a1c.txt @@ -0,0 +1 @@ +ca872238ea5642859a1c From 5550172e8e6a18b31ed45890566579aa83e250c8 Mon Sep 17 00:00:00 2001 From: 0xMemoryGrinder <35138272+0xMemoryGrinder@users.noreply.github.com> Date: Wed, 22 Nov 2023 01:56:19 -0500 Subject: [PATCH 314/325] refactor(ci): reworked ci to handle multi-platform builds --- .github/workflows/ci.yml | 63 ++++++++++++++++++++++++++++++++++++---- 1 file changed, 57 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 197954f6..2d017f8f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -103,12 +103,37 @@ jobs: - run: yarn workspace ${{ matrix.workspace.name }} run format build: - runs-on: ubuntu-latest + runs-on: ${{ matrix.os }} needs: flatten-deps strategy: fail-fast: false matrix: workspace: ${{ fromJson(needs.flatten-deps.outputs.dependencies) }} + include: + - os: windows-latest + target: x86_64-pc-windows-msvc + code-target: win32-x64 + - os: windows-latest + target: i686-pc-windows-msvc + - os: windows-latest + target: aarch64-pc-windows-msvc + code-target: win32-arm64 + - os: ubuntu-20.04 + target: x86_64-unknown-linux-gnu + code-target: linux-x64 + container: ubuntu:18.04 + - os: ubuntu-20.04 + target: aarch64-unknown-linux-gnu + code-target: linux-arm64 + - os: ubuntu-20.04 + target: arm-unknown-linux-gnueabihf + code-target: linux-armhf + - os: macos-11 + target: x86_64-apple-darwin + code-target: darwin-x64 + - os: macos-11 + target: aarch64-apple-darwin + code-target: darwin-arm64 steps: - uses: actions/checkout@v3 - uses: actions/setup-node@v3 @@ -119,9 +144,6 @@ jobs: corepack enable corepack prepare yarn@stable --activate - - name: install - run: cargo install wasm-pack - - name: Get yarn cache directory path id: yarn-cache-dir-path run: echo "dir=$(yarn config get cacheFolder)" >> $GITHUB_OUTPUT @@ -136,14 +158,41 @@ jobs: if: steps.yarn-cache.outputs.cache-hit != 'true' - run: yarn workspace ${{ matrix.workspace.name }} run build + env: + CARGO_BUILD_TARGET: ${{ matrix.target }} test: - runs-on: ubuntu-latest + runs-on: ${{ matrix.os }} needs: flatten-deps strategy: fail-fast: false matrix: workspace: ${{ fromJson(needs.flatten-deps.outputs.dependencies) }} + include: + - os: windows-latest + target: x86_64-pc-windows-msvc + code-target: win32-x64 + - os: windows-latest + target: i686-pc-windows-msvc + - os: windows-latest + target: aarch64-pc-windows-msvc + code-target: win32-arm64 + - os: ubuntu-20.04 + target: x86_64-unknown-linux-gnu + code-target: linux-x64 + container: ubuntu:18.04 + - os: ubuntu-20.04 + target: aarch64-unknown-linux-gnu + code-target: linux-arm64 + - os: ubuntu-20.04 + target: arm-unknown-linux-gnueabihf + code-target: linux-armhf + - os: macos-11 + target: x86_64-apple-darwin + code-target: darwin-x64 + - os: macos-11 + target: aarch64-apple-darwin + code-target: darwin-arm64 steps: - uses: actions/checkout@v3 - uses: actions/setup-node@v3 @@ -167,4 +216,6 @@ jobs: - run: yarn install --frozen-lockfile if: steps.yarn-cache.outputs.cache-hit != 'true' - - run: yarn workspace ${{ matrix.workspace.name }} run test \ No newline at end of file + - run: yarn workspace ${{ matrix.workspace.name }} run test + env: + CARGO_BUILD_TARGET: ${{ matrix.target }} \ No newline at end of file From a293028c88bb9e8e7b8646a625f0cdc5915b26ba Mon Sep 17 00:00:00 2001 From: 0xMemoryGrinder <35138272+0xMemoryGrinder@users.noreply.github.com> Date: Wed, 22 Nov 2023 01:56:38 -0500 Subject: [PATCH 315/325] refactor(cd): attempt to handle multi-platform deployment --- .github/workflows/cd.yml | 267 +++++++++++++++++++++++++++++++++++---- 1 file changed, 239 insertions(+), 28 deletions(-) diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index 938c9ac2..caedffc3 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -64,20 +64,20 @@ jobs: env: CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} - publish: + compute-version: if : ${{ needs.setup.outputs.extensions != '[]' }} - runs-on: ubuntu-latest - needs: - - setup - - publish-libraries strategy: fail-fast: false matrix: workspace: ${{ fromJson(needs.setup.outputs.extensions)}} + runs-on: ubuntu-latest + needs: + - setup steps: - uses: actions/checkout@v3 with: fetch-depth: 0 + - uses: actions/setup-node@v3 with: node-version: '18.16.1' @@ -142,7 +142,6 @@ jobs: script: | const fs = require('fs') console.log("Change type is : ", "${{ steps.find-new-version.outputs.version_type}}") - if (fs.existsSync('.unstable') && "${{ steps.find-new-version.outputs.version_type}}" == "patch") { const patch = parseInt('${{steps.find-new-version.outputs.patch}}', 10); return "${{steps.find-new-version.outputs.major}}.${{steps.find-new-version.outputs.minor}}." + (patch + 1).toString(); @@ -153,38 +152,250 @@ jobs: run: | git tag "${{ matrix.workspace.name }}-${{ steps.tag.outputs.result }}" git push origin "${{ matrix.workspace.name }}-${{ steps.tag.outputs.result }}" - + + publish: + if : ${{ needs.setup.outputs.extensions != '[]' }} + needs: + - setup + - publish-libraries + - compute-version + strategy: + fail-fast: false + matrix: + workspace: ${{ fromJson(needs.setup.outputs.extensions)}} + include: + - os: windows-latest + target: x86_64-pc-windows-msvc + code-target: win32-x64 + - os: windows-latest + target: i686-pc-windows-msvc + - os: windows-latest + target: aarch64-pc-windows-msvc + code-target: win32-arm64 + - os: ubuntu-20.04 + target: x86_64-unknown-linux-gnu + code-target: linux-x64 + container: ubuntu:18.04 + - os: ubuntu-20.04 + target: aarch64-unknown-linux-gnu + code-target: linux-arm64 + - os: ubuntu-20.04 + target: arm-unknown-linux-gnueabihf + code-target: linux-armhf + - os: macos-11 + target: x86_64-apple-darwin + code-target: darwin-x64 + - os: macos-11 + target: aarch64-apple-darwin + code-target: darwin-arm64 + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + - uses: actions/setup-node@v3 + with: + node-version: '18.16.1' + + - id: setup-yarn + # Install yarn 3 & workspace-tools + run: | + corepack enable + corepack prepare yarn@stable --activate + yarn -v + + - name: Get workspace path + id: workspace-path + run: | + echo "workspace-path=$(yarn workspaces info ${{ matrix.workspace.name }} --json | jq -r '.data[0].location')" >> $GITHUB_OUTPUT + + - name: Get tag prefix + id: get-tag-prefix + uses: actions/github-script@v6 + with: + result-encoding: string + script: | + const workspace = "${{ matrix.workspace.name }}"; + const language = workspace.split('-')[1]; + return language; + + - name: Retrieve version + id: retrieve-version + uses: "WyriHaximus/github-action-get-previous-tag@v1" + with: + prefix: "${{ steps.get-tag-prefix.outputs.result }}-" + + - name: Extract semver + uses: actions/github-script@v6 + id: tag + with: + result-encoding: string + script: | + const tag = '${{ steps.retrieve-version.outputs.tag }}'; + const semver = tag.split('-')[1]; + return semver; - name: Install dependencies run: | yarn install --immutable - cargo install wasm-pack - name: Build run: | yarn workspace ${{ matrix.workspace.name }} build + env: + CARGO_BUILD_TARGET: ${{ matrix.target }} - name: Publish - run: yarn workspace ${{ matrix.workspace.name }} run publish ${{ github.ref_name == 'dev' && '--pre-release' || '' }} ${{ steps.tag.outputs.result }} + run: yarn workspace ${{ matrix.workspace.name }} run publish ${{ github.ref_name == 'dev' && '--pre-release' || '' }} --target ${{matrix.code-target}} ${{ steps.tag.outputs.result }} env: VSCE_PAT: ${{ secrets.VSCE_PAT }} CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} - - #- name: Run latest-tag - # uses: EndBug/latest-tag@latest - # with: - # # You can change the name of the tag or branch with this input. - # # Default: 'latest' - # ref: ${{ steps.tag.outputs.result }} - # - # # If a description is provided, the action will use it to create an annotated tag. If none is given, the action will create a lightweight tag. - # # Default: '' - # description: Description for the tag - - # - name: Create GitHub release - # uses: Roang-zero1/github-create-release-action@v3 - # with: - # created_tag: ${{ steps.find-new-version.outputs.version_tag }} - # release_title: ${{ steps.find-new-version.outputs.version_tag }} - # env: - # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} +# publish: +# if : ${{ needs.setup.outputs.extensions != '[]' }} +# runs-on: ${{ matrix.os }} +# needs: +# - setup +# - publish-libraries +# strategy: +# fail-fast: false +# matrix: +# workspace: ${{ fromJson(needs.setup.outputs.extensions)}} +# include: +# - os: windows-latest +# target: x86_64-pc-windows-msvc +# code-target: win32-x64 +# - os: windows-latest +# target: i686-pc-windows-msvc +# - os: windows-latest +# target: aarch64-pc-windows-msvc +# code-target: win32-arm64 +# - os: ubuntu-20.04 +# target: x86_64-unknown-linux-gnu +# code-target: linux-x64 +# container: ubuntu:18.04 +# - os: ubuntu-20.04 +# target: aarch64-unknown-linux-gnu +# code-target: linux-arm64 +# - os: ubuntu-20.04 +# target: arm-unknown-linux-gnueabihf +# code-target: linux-armhf +# - os: macos-11 +# target: x86_64-apple-darwin +# code-target: darwin-x64 +# - os: macos-11 +# target: aarch64-apple-darwin +# code-target: darwin-arm64 +# steps: +# - uses: actions/checkout@v3 +# with: +# fetch-depth: 0 +# - uses: actions/setup-node@v3 +# with: +# node-version: '18.16.1' +# +# - id: setup-yarn +# # Install yarn 3 & workspace-tools +# run: | +# corepack enable +# corepack prepare yarn@stable --activate +# yarn -v +# +# - name: Get workspace path +# id: workspace-path +# run: | +# echo "workspace-path=$(yarn workspaces info ${{ matrix.workspace.name }} --json | jq -r '.data[0].location')" >> $GITHUB_OUTPUT +# +# - name: Check .unstable +# id: check-unstable +# run: | +# cd ${{ steps.workspace-path.outputs.workspace-path }} +# if [ -f ".unstable" ]; then +# echo "is-unstable=true" >> $GITHUB_OUTPUT +# else +# echo "is-unstable=false" >> $GITHUB_OUTPUT +# fi +# +# - name: Get tag prefix +# id: get-tag-prefix +# uses: actions/github-script@v6 +# with: +# result-encoding: string +# script: | +# const workspace = "${{ matrix.workspace.name }}"; +# const language = workspace.split('-')[1]; +# return language; +# +# - uses: paulhatch/semantic-version@d43966692519e4a5d4423b3da1b4b903c58c8f6b +# id: find-new-version +# with: +# # The prefix to use to identify tags +# tag_prefix: "${{ steps.get-tag-prefix.outputs.result }}-" +# # A string which, if present in a git commit, indicates that a change represents a +# # major (breaking) change, supports regular expressions wrapped with '/' +# major_pattern: "!:" +# # Same as above except indicating a minor change, supports regular expressions wrapped with '/' +# minor_pattern: "/feat\\(?/" +# # A string to determine the format of the version output +# version_format: "${major}.${minor}.${patch}" +# # If this is set to true, *every* commit will be treated as a new version. +# bump_each_commit: false +# # If true, the body of commits will also be searched for major/minor patterns to determine the version type. +# search_commit_body: false +# # Prevents pre-v1.0.0 version from automatically incrementing the major version. +# # If enabled, when the major version is 0, major releases will be treated as minor and minor as patch. Note that the version_type output is unchanged. +# enable_prerelease_mode: ${{ steps.check-unstable.outputs.is-unstable }} +# +# - name: Normalize version +# uses: actions/github-script@v6 +# id: tag +# with: +# result-encoding: string +# script: | +# const fs = require('fs') +# console.log("Change type is : ", "${{ steps.find-new-version.outputs.version_type}}") +# +# if (fs.existsSync('.unstable') && "${{ steps.find-new-version.outputs.version_type}}" == "patch") { +# const patch = parseInt('${{steps.find-new-version.outputs.patch}}', 10); +# return "${{steps.find-new-version.outputs.major}}.${{steps.find-new-version.outputs.minor}}." + (patch + 1).toString(); +# } else +# return "${{steps.find-new-version.outputs.major}}.${{steps.find-new-version.outputs.minor}}.${{steps.find-new-version.outputs.patch}}" +# +# - name: Set tag +# run: | +# git tag "${{ matrix.workspace.name }}-${{ steps.tag.outputs.result }}" +# git push origin "${{ matrix.workspace.name }}-${{ steps.tag.outputs.result }}" +# +# - name: Install dependencies +# run: | +# yarn install --immutable +# +# - name: Build +# run: | +# yarn workspace ${{ matrix.workspace.name }} build +# +# - name: Publish +# run: yarn workspace ${{ matrix.workspace.name }} run publish ${{ github.ref_name == 'dev' && '--pre-release' || '' }} ${{ steps.tag.outputs.result }} +# env: +# VSCE_PAT: ${{ secrets.VSCE_PAT }} +# CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} +# +# +# #- name: Run latest-tag +# # uses: EndBug/latest-tag@latest +# # with: +# # # You can change the name of the tag or branch with this input. +# # # Default: 'latest' +# # ref: ${{ steps.tag.outputs.result }} +# # +# # # If a description is provided, the action will use it to create an annotated tag. If none is given, the action will create a lightweight tag. +# # # Default: '' +# # description: Description for the tag +# +# # - name: Create GitHub release +# # uses: Roang-zero1/github-create-release-action@v3 +# # with: +# # created_tag: ${{ steps.find-new-version.outputs.version_tag }} +# # release_title: ${{ steps.find-new-version.outputs.version_tag }} +# # env: +# # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} +# \ No newline at end of file From e50005b91e6b268b10e28aa9c8e6ddcccda17f6d Mon Sep 17 00:00:00 2001 From: 0xMemoryGrinder <35138272+0xMemoryGrinder@users.noreply.github.com> Date: Wed, 22 Nov 2023 14:25:31 -0500 Subject: [PATCH 316/325] fix(ci-cd): abstracted workspace specific pipeline in a separate jobs --- .github/workflows/build.yml | 91 ++++++++++++++ .github/workflows/cd.yml | 90 +------------- .github/workflows/ci.yml | 113 ++---------------- .github/workflows/publish-extension.yml | 111 +++++++++++++++++ .github/workflows/test.yml | 90 ++++++++++++++ toolchains/solidity/core/package.json | 2 +- toolchains/solidity/core/scripts/copy-core.js | 30 +++++ toolchains/solidity/extension/package.json | 2 +- 8 files changed, 337 insertions(+), 192 deletions(-) create mode 100644 .github/workflows/build.yml create mode 100644 .github/workflows/publish-extension.yml create mode 100644 .github/workflows/test.yml create mode 100644 toolchains/solidity/core/scripts/copy-core.js diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 00000000..5aaba19b --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,91 @@ +on: + workflow_call: + inputs: + workspace: + required: true + type: string + description: "yarn workspace name" + command: + required: true + type: string + description: "yarn command to run" + workflow_dispatch: + inputs: + workspace: + required: true + type: string + description: "yarn workspace name" + command: + required: true + type: string + description: "yarn command to run" + +jobs: + build: + strategy: + fail-fast: false + matrix: + include: + - os: windows-latest + target: x86_64-pc-windows-msvc + code-target: win32-x64 + - os: windows-latest + target: i686-pc-windows-msvc + - os: windows-latest + target: aarch64-pc-windows-msvc + code-target: win32-arm64 + - os: ubuntu-20.04 + target: x86_64-unknown-linux-gnu + code-target: linux-x64 + #container: ubuntu:18.04 + #- os: ubuntu-20.04 + # target: aarch64-unknown-linux-gnu + # code-target: linux-arm64 + #- os: ubuntu-20.04 + # target: arm-unknown-linux-gnueabihf + # code-target: linux-armhf + - os: macos-11 + target: x86_64-apple-darwin + code-target: darwin-x64 + - os: macos-11 + target: aarch64-apple-darwin + code-target: darwin-arm64 + runs-on: ${{ matrix.os }} + #container: ${{ matrix.container }} + + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + + - name: Setup yarn + id: setup-yarn + run: | + corepack enable + corepack prepare yarn@stable --activate + yarn set version stable + yarn -v + + - name: Setup rust + uses: actions-rs/toolchain@v1 + with: + toolchain: stable + target: ${{ matrix.target }} + override: true + + - name: Get yarn cache directory path + id: yarn-cache-dir-path + run: echo "dir=$(yarn config get cacheFolder)" >> $GITHUB_OUTPUT + - uses: actions/cache@v3 + id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`) + with: + path: ${{ steps.yarn-cache-dir-path.outputs.dir }} + key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} + restore-keys: | + ${{ runner.os }}-yarn- + - run: yarn install --frozen-lockfile + if: steps.yarn-cache.outputs.cache-hit != 'true' + + - run: yarn workspace ${{ inputs.workspace }} run ${{ inputs.command }} + env: + CARGO_BUILD_TARGET: ${{ matrix.target }} + \ No newline at end of file diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index caedffc3..886ad5a3 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -163,92 +163,10 @@ jobs: fail-fast: false matrix: workspace: ${{ fromJson(needs.setup.outputs.extensions)}} - include: - - os: windows-latest - target: x86_64-pc-windows-msvc - code-target: win32-x64 - - os: windows-latest - target: i686-pc-windows-msvc - - os: windows-latest - target: aarch64-pc-windows-msvc - code-target: win32-arm64 - - os: ubuntu-20.04 - target: x86_64-unknown-linux-gnu - code-target: linux-x64 - container: ubuntu:18.04 - - os: ubuntu-20.04 - target: aarch64-unknown-linux-gnu - code-target: linux-arm64 - - os: ubuntu-20.04 - target: arm-unknown-linux-gnueabihf - code-target: linux-armhf - - os: macos-11 - target: x86_64-apple-darwin - code-target: darwin-x64 - - os: macos-11 - target: aarch64-apple-darwin - code-target: darwin-arm64 - runs-on: ${{ matrix.os }} - steps: - - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - uses: actions/setup-node@v3 - with: - node-version: '18.16.1' - - - id: setup-yarn - # Install yarn 3 & workspace-tools - run: | - corepack enable - corepack prepare yarn@stable --activate - yarn -v - - - name: Get workspace path - id: workspace-path - run: | - echo "workspace-path=$(yarn workspaces info ${{ matrix.workspace.name }} --json | jq -r '.data[0].location')" >> $GITHUB_OUTPUT - - - name: Get tag prefix - id: get-tag-prefix - uses: actions/github-script@v6 - with: - result-encoding: string - script: | - const workspace = "${{ matrix.workspace.name }}"; - const language = workspace.split('-')[1]; - return language; - - - name: Retrieve version - id: retrieve-version - uses: "WyriHaximus/github-action-get-previous-tag@v1" - with: - prefix: "${{ steps.get-tag-prefix.outputs.result }}-" - - - name: Extract semver - uses: actions/github-script@v6 - id: tag - with: - result-encoding: string - script: | - const tag = '${{ steps.retrieve-version.outputs.tag }}'; - const semver = tag.split('-')[1]; - return semver; - - name: Install dependencies - run: | - yarn install --immutable - - - name: Build - run: | - yarn workspace ${{ matrix.workspace.name }} build - env: - CARGO_BUILD_TARGET: ${{ matrix.target }} - - - name: Publish - run: yarn workspace ${{ matrix.workspace.name }} run publish ${{ github.ref_name == 'dev' && '--pre-release' || '' }} --target ${{matrix.code-target}} ${{ steps.tag.outputs.result }} - env: - VSCE_PAT: ${{ secrets.VSCE_PAT }} - CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} + uses: ./.github/workflows/publish-extension.yml + with: + workspace: ${{ matrix.workspace.name }} + # publish: # if : ${{ needs.setup.outputs.extensions != '[]' }} diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2d017f8f..f9b241c3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -103,119 +103,24 @@ jobs: - run: yarn workspace ${{ matrix.workspace.name }} run format build: - runs-on: ${{ matrix.os }} needs: flatten-deps strategy: fail-fast: false matrix: workspace: ${{ fromJson(needs.flatten-deps.outputs.dependencies) }} - include: - - os: windows-latest - target: x86_64-pc-windows-msvc - code-target: win32-x64 - - os: windows-latest - target: i686-pc-windows-msvc - - os: windows-latest - target: aarch64-pc-windows-msvc - code-target: win32-arm64 - - os: ubuntu-20.04 - target: x86_64-unknown-linux-gnu - code-target: linux-x64 - container: ubuntu:18.04 - - os: ubuntu-20.04 - target: aarch64-unknown-linux-gnu - code-target: linux-arm64 - - os: ubuntu-20.04 - target: arm-unknown-linux-gnueabihf - code-target: linux-armhf - - os: macos-11 - target: x86_64-apple-darwin - code-target: darwin-x64 - - os: macos-11 - target: aarch64-apple-darwin - code-target: darwin-arm64 - steps: - - uses: actions/checkout@v3 - - uses: actions/setup-node@v3 - - - name: Setup yarn - id: setup-yarn - run: | - corepack enable - corepack prepare yarn@stable --activate - - - name: Get yarn cache directory path - id: yarn-cache-dir-path - run: echo "dir=$(yarn config get cacheFolder)" >> $GITHUB_OUTPUT - - uses: actions/cache@v3 - id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`) - with: - path: ${{ steps.yarn-cache-dir-path.outputs.dir }} - key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} - restore-keys: | - ${{ runner.os }}-yarn- - - run: yarn install --frozen-lockfile - if: steps.yarn-cache.outputs.cache-hit != 'true' - - - run: yarn workspace ${{ matrix.workspace.name }} run build - env: - CARGO_BUILD_TARGET: ${{ matrix.target }} + uses: ./.github/workflows/build.yml + with: + workspace: ${{ matrix.workspace.name }} + command: build + test: - runs-on: ${{ matrix.os }} needs: flatten-deps strategy: fail-fast: false matrix: workspace: ${{ fromJson(needs.flatten-deps.outputs.dependencies) }} - include: - - os: windows-latest - target: x86_64-pc-windows-msvc - code-target: win32-x64 - - os: windows-latest - target: i686-pc-windows-msvc - - os: windows-latest - target: aarch64-pc-windows-msvc - code-target: win32-arm64 - - os: ubuntu-20.04 - target: x86_64-unknown-linux-gnu - code-target: linux-x64 - container: ubuntu:18.04 - - os: ubuntu-20.04 - target: aarch64-unknown-linux-gnu - code-target: linux-arm64 - - os: ubuntu-20.04 - target: arm-unknown-linux-gnueabihf - code-target: linux-armhf - - os: macos-11 - target: x86_64-apple-darwin - code-target: darwin-x64 - - os: macos-11 - target: aarch64-apple-darwin - code-target: darwin-arm64 - steps: - - uses: actions/checkout@v3 - - uses: actions/setup-node@v3 - - - name: Setup yarn - id: setup-yarn - run: | - corepack enable - corepack prepare yarn@stable --activate - - - name: Get yarn cache directory path - id: yarn-cache-dir-path - run: echo "dir=$(yarn config get cacheFolder)" >> $GITHUB_OUTPUT - - uses: actions/cache@v3 - id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`) - with: - path: ${{ steps.yarn-cache-dir-path.outputs.dir }} - key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} - restore-keys: | - ${{ runner.os }}-yarn- - - run: yarn install --frozen-lockfile - if: steps.yarn-cache.outputs.cache-hit != 'true' - - - run: yarn workspace ${{ matrix.workspace.name }} run test - env: - CARGO_BUILD_TARGET: ${{ matrix.target }} \ No newline at end of file + uses: ./.github/workflows/test.yml + with: + workspace: ${{ matrix.workspace.name }} + command: test \ No newline at end of file diff --git a/.github/workflows/publish-extension.yml b/.github/workflows/publish-extension.yml new file mode 100644 index 00000000..00f0257d --- /dev/null +++ b/.github/workflows/publish-extension.yml @@ -0,0 +1,111 @@ +on: + workflow_call: + inputs: + workspace: + required: true + type: string + description: "yarn workspace name" + workflow_dispatch: + inputs: + workspace: + required: true + type: string + description: "yarn workspace name" + +jobs: + build: + strategy: + fail-fast: false + matrix: + include: + - os: windows-latest + target: x86_64-pc-windows-msvc + code-target: win32-x64 + - os: windows-latest + target: i686-pc-windows-msvc + - os: windows-latest + target: aarch64-pc-windows-msvc + code-target: win32-arm64 + - os: ubuntu-20.04 + target: x86_64-unknown-linux-gnu + code-target: linux-x64 + #container: ubuntu:18.04 + #- os: ubuntu-20.04 + # target: aarch64-unknown-linux-gnu + # code-target: linux-arm64 + #- os: ubuntu-20.04 + # target: arm-unknown-linux-gnueabihf + # code-target: linux-armhf + - os: macos-11 + target: x86_64-apple-darwin + code-target: darwin-x64 + - os: macos-11 + target: aarch64-apple-darwin + code-target: darwin-arm64 + runs-on: ${{ matrix.os }} + #container: ${{ matrix.container }} + + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + fetch-tags: true + - uses: actions/setup-node@v3 + with: + node-version: '18.16.1' + + - id: setup-yarn + # Install yarn 3 & workspace-tools + run: | + corepack enable + corepack prepare yarn@stable --activate + yarn -v + + - name: Setup rust + uses: actions-rs/toolchain@v1 + with: + toolchain: stable + target: ${{ matrix.target }} + override: true + + - name: Get tag prefix + id: get-tag-prefix + uses: actions/github-script@v6 + with: + result-encoding: string + script: | + const workspace = "${{ inputs.workspace }}"; + const language = workspace.split('-')[1]; + return language; + + - name: Retrieve version + id: retrieve-version + uses: "WyriHaximus/github-action-get-previous-tag@v1" + with: + prefix: "${{ steps.get-tag-prefix.outputs.result }}-" + + - name: Extract semver + uses: actions/github-script@v6 + id: tag + with: + result-encoding: string + script: | + const tag = '${{ steps.retrieve-version.outputs.tag }}'; + const semver = tag.split('-')[1]; + return semver; + - name: Install dependencies + run: | + yarn install --immutable + + - name: Build + run: | + yarn workspace ${{ inputs.workspace }} build + env: + CARGO_BUILD_TARGET: ${{ matrix.target }} + + - name: Publish + run: yarn workspace ${{ inputs.workspace }} run publish ${{ github.ref_name == 'dev' && '--pre-release' || '' }} --target ${{matrix.code-target}} ${{ steps.tag.outputs.result }} + env: + VSCE_PAT: ${{ secrets.VSCE_PAT }} + CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} + \ No newline at end of file diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 00000000..52c8b2ec --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,90 @@ +on: + workflow_call: + inputs: + workspace: + required: true + type: string + description: "yarn workspace name" + command: + required: true + type: string + description: "yarn command to run" + workflow_dispatch: + inputs: + workspace: + required: true + type: string + description: "yarn workspace name" + command: + required: true + type: string + description: "yarn command to run" + +jobs: + build: + strategy: + fail-fast: false + matrix: + include: + - os: windows-latest + target: x86_64-pc-windows-msvc + code-target: win32-x64 + - os: windows-latest + target: i686-pc-windows-msvc + #- os: windows-latest + # target: aarch64-pc-windows-msvc + # code-target: win32-arm64 + - os: ubuntu-20.04 + target: x86_64-unknown-linux-gnu + code-target: linux-x64 + #container: ubuntu:18.04 + #- os: ubuntu-20.04 + # target: aarch64-unknown-linux-gnu + # code-target: linux-arm64 + #- os: ubuntu-20.04 + # target: arm-unknown-linux-gnueabihf + # code-target: linux-armhf + - os: macos-11 + target: x86_64-apple-darwin + code-target: darwin-x64 + #- os: macos-11 + # target: aarch64-apple-darwin + # code-target: darwin-arm64 + runs-on: ${{ matrix.os }} + #container: ${{ matrix.container }} + + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + + - name: Setup yarn + id: setup-yarn + run: | + corepack enable + corepack prepare yarn@stable --activate + yarn set version stable + yarn -v + + - name: Setup rust + uses: actions-rs/toolchain@v1 + with: + toolchain: stable + target: ${{ matrix.target }} + override: true + + - name: Get yarn cache directory path + id: yarn-cache-dir-path + run: echo "dir=$(yarn config get cacheFolder)" >> $GITHUB_OUTPUT + - uses: actions/cache@v3 + id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`) + with: + path: ${{ steps.yarn-cache-dir-path.outputs.dir }} + key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} + restore-keys: | + ${{ runner.os }}-yarn- + - run: yarn install --frozen-lockfile + if: steps.yarn-cache.outputs.cache-hit != 'true' + + - run: yarn workspace ${{ inputs.workspace }} run ${{ inputs.command }} + env: + CARGO_BUILD_TARGET: ${{ matrix.target }} \ No newline at end of file diff --git a/toolchains/solidity/core/package.json b/toolchains/solidity/core/package.json index 2821ca76..d9dc450b 100644 --- a/toolchains/solidity/core/package.json +++ b/toolchains/solidity/core/package.json @@ -3,7 +3,7 @@ "version": "0.0.2", "license": "MIT", "scripts": { - "core:build": "cargo build --workspace --release && cp target/release/linter-server ../extension/dist", + "core:build": "cargo build --workspace --release && node scripts/copy-core.js", "core:lint": "cargo clippy -- -D warnings", "core:format": "cargo fmt --check --all", "core:test": "cargo test --workspace", diff --git a/toolchains/solidity/core/scripts/copy-core.js b/toolchains/solidity/core/scripts/copy-core.js new file mode 100644 index 00000000..386df391 --- /dev/null +++ b/toolchains/solidity/core/scripts/copy-core.js @@ -0,0 +1,30 @@ +const fs = require('fs'); + +const targetFolder = 'target'; +const outputFolder = __dirname + '/../../extension/dist'; + +fs.readdir('target', { withFileTypes: true }, (err, dirs) => { + if (err) { + console.error(err); + return; + } + + const directories = dirs.filter(file => file.isDirectory()).map(file => file.name); + const targetDirectories = directories.filter(directory => directory !== 'tmp' && directory !== 'debug'); + const dir = targetDirectories[0]; + fs.readdir(`target/${dir}`, { withFileTypes: true }, (err, entries) => { + if (err) { + console.error(err); + return; + } + const files = entries.filter(file => file.isFile()).map(file => file.name); + const serverBinaries = files.filter(file => file.endsWith('-server')); + serverBinaries.forEach(binary => { + fs.copyFile(`target/${dir}/${binary}`, `${outputFolder}/${binary}`, (err) => { + if (err) { + console.error(err); + } + }); + }); + }); +}); diff --git a/toolchains/solidity/extension/package.json b/toolchains/solidity/extension/package.json index 71c11596..c4875980 100644 --- a/toolchains/solidity/extension/package.json +++ b/toolchains/solidity/extension/package.json @@ -2,7 +2,7 @@ "name": "osmium-solidity-extension", "displayName": "Osmium Solidity", "description": "", - "version": "0.0.1", + "version": "0.2.0", "publisher": "OsmiumToolchains", "repository": { "type": "git", From 52b2f14b52bb77d3b241a244bd182a2c66d8c956 Mon Sep 17 00:00:00 2001 From: 0xMemoryGrinder <35138272+0xMemoryGrinder@users.noreply.github.com> Date: Wed, 22 Nov 2023 14:50:55 -0500 Subject: [PATCH 317/325] chore: deleted remove-me --- remove-me-ca872238ea5642859a1c.txt | 1 - 1 file changed, 1 deletion(-) delete mode 100644 remove-me-ca872238ea5642859a1c.txt diff --git a/remove-me-ca872238ea5642859a1c.txt b/remove-me-ca872238ea5642859a1c.txt deleted file mode 100644 index f1ec0db0..00000000 --- a/remove-me-ca872238ea5642859a1c.txt +++ /dev/null @@ -1 +0,0 @@ -ca872238ea5642859a1c From f3f9375b8404e691a207712cdcfd5be0b3aeffb1 Mon Sep 17 00:00:00 2001 From: 0xMemoryGrinder <35138272+0xMemoryGrinder@users.noreply.github.com> Date: Wed, 22 Nov 2023 14:53:08 -0500 Subject: [PATCH 318/325] chore(cd): deleted useless comment --- .github/workflows/cd.yml | 153 +-------------------------------------- 1 file changed, 1 insertion(+), 152 deletions(-) diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index 886ad5a3..fa01f103 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -165,155 +165,4 @@ jobs: workspace: ${{ fromJson(needs.setup.outputs.extensions)}} uses: ./.github/workflows/publish-extension.yml with: - workspace: ${{ matrix.workspace.name }} - - -# publish: -# if : ${{ needs.setup.outputs.extensions != '[]' }} -# runs-on: ${{ matrix.os }} -# needs: -# - setup -# - publish-libraries -# strategy: -# fail-fast: false -# matrix: -# workspace: ${{ fromJson(needs.setup.outputs.extensions)}} -# include: -# - os: windows-latest -# target: x86_64-pc-windows-msvc -# code-target: win32-x64 -# - os: windows-latest -# target: i686-pc-windows-msvc -# - os: windows-latest -# target: aarch64-pc-windows-msvc -# code-target: win32-arm64 -# - os: ubuntu-20.04 -# target: x86_64-unknown-linux-gnu -# code-target: linux-x64 -# container: ubuntu:18.04 -# - os: ubuntu-20.04 -# target: aarch64-unknown-linux-gnu -# code-target: linux-arm64 -# - os: ubuntu-20.04 -# target: arm-unknown-linux-gnueabihf -# code-target: linux-armhf -# - os: macos-11 -# target: x86_64-apple-darwin -# code-target: darwin-x64 -# - os: macos-11 -# target: aarch64-apple-darwin -# code-target: darwin-arm64 -# steps: -# - uses: actions/checkout@v3 -# with: -# fetch-depth: 0 -# - uses: actions/setup-node@v3 -# with: -# node-version: '18.16.1' -# -# - id: setup-yarn -# # Install yarn 3 & workspace-tools -# run: | -# corepack enable -# corepack prepare yarn@stable --activate -# yarn -v -# -# - name: Get workspace path -# id: workspace-path -# run: | -# echo "workspace-path=$(yarn workspaces info ${{ matrix.workspace.name }} --json | jq -r '.data[0].location')" >> $GITHUB_OUTPUT -# -# - name: Check .unstable -# id: check-unstable -# run: | -# cd ${{ steps.workspace-path.outputs.workspace-path }} -# if [ -f ".unstable" ]; then -# echo "is-unstable=true" >> $GITHUB_OUTPUT -# else -# echo "is-unstable=false" >> $GITHUB_OUTPUT -# fi -# -# - name: Get tag prefix -# id: get-tag-prefix -# uses: actions/github-script@v6 -# with: -# result-encoding: string -# script: | -# const workspace = "${{ matrix.workspace.name }}"; -# const language = workspace.split('-')[1]; -# return language; -# -# - uses: paulhatch/semantic-version@d43966692519e4a5d4423b3da1b4b903c58c8f6b -# id: find-new-version -# with: -# # The prefix to use to identify tags -# tag_prefix: "${{ steps.get-tag-prefix.outputs.result }}-" -# # A string which, if present in a git commit, indicates that a change represents a -# # major (breaking) change, supports regular expressions wrapped with '/' -# major_pattern: "!:" -# # Same as above except indicating a minor change, supports regular expressions wrapped with '/' -# minor_pattern: "/feat\\(?/" -# # A string to determine the format of the version output -# version_format: "${major}.${minor}.${patch}" -# # If this is set to true, *every* commit will be treated as a new version. -# bump_each_commit: false -# # If true, the body of commits will also be searched for major/minor patterns to determine the version type. -# search_commit_body: false -# # Prevents pre-v1.0.0 version from automatically incrementing the major version. -# # If enabled, when the major version is 0, major releases will be treated as minor and minor as patch. Note that the version_type output is unchanged. -# enable_prerelease_mode: ${{ steps.check-unstable.outputs.is-unstable }} -# -# - name: Normalize version -# uses: actions/github-script@v6 -# id: tag -# with: -# result-encoding: string -# script: | -# const fs = require('fs') -# console.log("Change type is : ", "${{ steps.find-new-version.outputs.version_type}}") -# -# if (fs.existsSync('.unstable') && "${{ steps.find-new-version.outputs.version_type}}" == "patch") { -# const patch = parseInt('${{steps.find-new-version.outputs.patch}}', 10); -# return "${{steps.find-new-version.outputs.major}}.${{steps.find-new-version.outputs.minor}}." + (patch + 1).toString(); -# } else -# return "${{steps.find-new-version.outputs.major}}.${{steps.find-new-version.outputs.minor}}.${{steps.find-new-version.outputs.patch}}" -# -# - name: Set tag -# run: | -# git tag "${{ matrix.workspace.name }}-${{ steps.tag.outputs.result }}" -# git push origin "${{ matrix.workspace.name }}-${{ steps.tag.outputs.result }}" -# -# - name: Install dependencies -# run: | -# yarn install --immutable -# -# - name: Build -# run: | -# yarn workspace ${{ matrix.workspace.name }} build -# -# - name: Publish -# run: yarn workspace ${{ matrix.workspace.name }} run publish ${{ github.ref_name == 'dev' && '--pre-release' || '' }} ${{ steps.tag.outputs.result }} -# env: -# VSCE_PAT: ${{ secrets.VSCE_PAT }} -# CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} -# -# -# #- name: Run latest-tag -# # uses: EndBug/latest-tag@latest -# # with: -# # # You can change the name of the tag or branch with this input. -# # # Default: 'latest' -# # ref: ${{ steps.tag.outputs.result }} -# # -# # # If a description is provided, the action will use it to create an annotated tag. If none is given, the action will create a lightweight tag. -# # # Default: '' -# # description: Description for the tag -# -# # - name: Create GitHub release -# # uses: Roang-zero1/github-create-release-action@v3 -# # with: -# # created_tag: ${{ steps.find-new-version.outputs.version_tag }} -# # release_title: ${{ steps.find-new-version.outputs.version_tag }} -# # env: -# # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} -# \ No newline at end of file + workspace: ${{ matrix.workspace.name }} \ No newline at end of file From beb79d55c37f4612552c5fb0c9b5f29edcfab2fc Mon Sep 17 00:00:00 2001 From: 0xMemoryGrinder <35138272+0xMemoryGrinder@users.noreply.github.com> Date: Wed, 22 Nov 2023 15:01:47 -0500 Subject: [PATCH 319/325] chore: deleted remove-me --- remove-me-edda686584d045e895e0.txt | 1 - 1 file changed, 1 deletion(-) delete mode 100644 remove-me-edda686584d045e895e0.txt diff --git a/remove-me-edda686584d045e895e0.txt b/remove-me-edda686584d045e895e0.txt deleted file mode 100644 index 40297de5..00000000 --- a/remove-me-edda686584d045e895e0.txt +++ /dev/null @@ -1 +0,0 @@ -edda686584d045e895e0 From 1115d5c807adf609280fa82189aa6b17cc56ef41 Mon Sep 17 00:00:00 2001 From: 0xMemoryGrinder <35138272+0xMemoryGrinder@users.noreply.github.com> Date: Wed, 22 Nov 2023 16:12:32 -0500 Subject: [PATCH 320/325] chore(libs/lsp-server-wrapper): added missing metadata fields for publish --- libs/lsp-server-wrapper/Cargo.toml | 1 + libs/lsp-server-wrapper/LICENSE.txt | 675 ++++++++++++++++++++++++++++ 2 files changed, 676 insertions(+) create mode 100644 libs/lsp-server-wrapper/LICENSE.txt diff --git a/libs/lsp-server-wrapper/Cargo.toml b/libs/lsp-server-wrapper/Cargo.toml index 932d73b7..1e31054a 100644 --- a/libs/lsp-server-wrapper/Cargo.toml +++ b/libs/lsp-server-wrapper/Cargo.toml @@ -1,5 +1,6 @@ [package] name = "osmium-libs-lsp-server-wrapper" +description = "A wrapper around the LSP server crate with a tower-lsp like API" license = "GPL-3.0-or-later" version = "0.1.0" edition = "2021" diff --git a/libs/lsp-server-wrapper/LICENSE.txt b/libs/lsp-server-wrapper/LICENSE.txt new file mode 100644 index 00000000..5dc6b429 --- /dev/null +++ b/libs/lsp-server-wrapper/LICENSE.txt @@ -0,0 +1,675 @@ + + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + {project} Copyright (C) {year} {fullname} + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +. + + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +. From e761293aeb4f52e87740afc5b9b3cc5affe16411 Mon Sep 17 00:00:00 2001 From: 0xMemoryGrinder <35138272+0xMemoryGrinder@users.noreply.github.com> Date: Wed, 22 Nov 2023 16:45:47 -0500 Subject: [PATCH 321/325] fix(cd): added missing secrets in pipeline --- .github/workflows/cd.yml | 6 +++++- .github/workflows/publish-extension.yml | 5 +++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index fa01f103..ed8e465e 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -30,6 +30,7 @@ jobs: publish-libraries: if : ${{ needs.setup.outputs.libraries != '[]' }} runs-on: ubuntu-latest + continue-on-error: true needs: setup strategy: fail-fast: false @@ -165,4 +166,7 @@ jobs: workspace: ${{ fromJson(needs.setup.outputs.extensions)}} uses: ./.github/workflows/publish-extension.yml with: - workspace: ${{ matrix.workspace.name }} \ No newline at end of file + workspace: ${{ matrix.workspace.name }} + secrets: + CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} + VSCE_PAT: ${{ secrets.VSCE_PAT }} \ No newline at end of file diff --git a/.github/workflows/publish-extension.yml b/.github/workflows/publish-extension.yml index 00f0257d..517401f6 100644 --- a/.github/workflows/publish-extension.yml +++ b/.github/workflows/publish-extension.yml @@ -5,6 +5,11 @@ on: required: true type: string description: "yarn workspace name" + secrets: + CARGO_REGISTRY_TOKEN: + required: true + VSCE_PAT: + required: true workflow_dispatch: inputs: workspace: From 09bc83807e57aba08998b9d7a25383b3df8e4a5f Mon Sep 17 00:00:00 2001 From: 0xMemoryGrinder <35138272+0xMemoryGrinder@users.noreply.github.com> Date: Wed, 22 Nov 2023 17:11:41 -0500 Subject: [PATCH 322/325] fix(cd): segregated core and extension publish --- .github/workflows/cd.yml | 43 +++++++++++++++++++++++-- .github/workflows/publish-extension.yml | 6 +++- 2 files changed, 46 insertions(+), 3 deletions(-) diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index ed8e465e..2d0ea7a6 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -54,7 +54,6 @@ jobs: - name: Install dependencies run: | yarn install --immutable - cargo install wasm-pack - name: Build run: | @@ -154,7 +153,47 @@ jobs: git tag "${{ matrix.workspace.name }}-${{ steps.tag.outputs.result }}" git push origin "${{ matrix.workspace.name }}-${{ steps.tag.outputs.result }}" - publish: + publish-core: + if: ${{ needs.setup.outputs.extensions != '[]' }} + needs: + - setup + - publish-libraries + - compute-version + strategy: + fail-fast: false + matrix: + workspace: ${{ fromJson(needs.setup.outputs.extensions)}} + runs-on: ubuntu-latest + continue-on-error: true + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + - uses: actions/setup-node@v3 + with: + node-version: '18.16.1' + + - id: setup-yarn + # Install yarn 3 & workspace-tools + run: | + corepack enable + corepack prepare yarn@stable --activate + yarn -v + + - name: Install dependencies + run: | + yarn install --immutable + + - name: Build + run: | + yarn workspace ${{ matrix.workspace.name }} core:build + + - name: Publish + run: yarn workspace ${{ matrix.workspace.name }} run core:publish + env: + CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} + + publish-extensions: if : ${{ needs.setup.outputs.extensions != '[]' }} needs: - setup diff --git a/.github/workflows/publish-extension.yml b/.github/workflows/publish-extension.yml index 517401f6..d1409f00 100644 --- a/.github/workflows/publish-extension.yml +++ b/.github/workflows/publish-extension.yml @@ -55,6 +55,10 @@ jobs: with: fetch-depth: 0 fetch-tags: true + + - name: Get tags + run: git fetch --tags origin + - uses: actions/setup-node@v3 with: node-version: '18.16.1' @@ -109,7 +113,7 @@ jobs: CARGO_BUILD_TARGET: ${{ matrix.target }} - name: Publish - run: yarn workspace ${{ inputs.workspace }} run publish ${{ github.ref_name == 'dev' && '--pre-release' || '' }} --target ${{matrix.code-target}} ${{ steps.tag.outputs.result }} + run: yarn workspace ${{ inputs.workspace }} run extension:publish ${{ github.ref_name == 'dev' && '--pre-release' || '' }} --target ${{matrix.code-target}} ${{ steps.tag.outputs.result }} env: VSCE_PAT: ${{ secrets.VSCE_PAT }} CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} From 56cff773f6737f269c0cf71197995315234de7e6 Mon Sep 17 00:00:00 2001 From: 0xMemoryGrinder <35138272+0xMemoryGrinder@users.noreply.github.com> Date: Wed, 22 Nov 2023 17:44:18 -0500 Subject: [PATCH 323/325] fix(cd): correct tag prefixing --- .github/workflows/cd.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index 2d0ea7a6..9fd553ad 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -150,8 +150,8 @@ jobs: - name: Set tag run: | - git tag "${{ matrix.workspace.name }}-${{ steps.tag.outputs.result }}" - git push origin "${{ matrix.workspace.name }}-${{ steps.tag.outputs.result }}" + git tag "${{ steps.get-tag-prefix.outputs.result }}-${{ steps.tag.outputs.result }}" + git push origin "${{ steps.get-tag-prefix.outputs.result }}-${{ steps.tag.outputs.result }}" publish-core: if: ${{ needs.setup.outputs.extensions != '[]' }} From 95b6f343eb14e48630fcae4e3bfa70d69a664f39 Mon Sep 17 00:00:00 2001 From: 0xMemoryGrinder <35138272+0xMemoryGrinder@users.noreply.github.com> Date: Wed, 22 Nov 2023 18:06:50 -0500 Subject: [PATCH 324/325] fix(cd): bad vsce argument position --- .github/workflows/publish-extension.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/publish-extension.yml b/.github/workflows/publish-extension.yml index d1409f00..df9d1ea4 100644 --- a/.github/workflows/publish-extension.yml +++ b/.github/workflows/publish-extension.yml @@ -113,7 +113,7 @@ jobs: CARGO_BUILD_TARGET: ${{ matrix.target }} - name: Publish - run: yarn workspace ${{ inputs.workspace }} run extension:publish ${{ github.ref_name == 'dev' && '--pre-release' || '' }} --target ${{matrix.code-target}} ${{ steps.tag.outputs.result }} + run: yarn workspace ${{ inputs.workspace }} run extension:publish ${{ github.ref_name == 'dev' && '--pre-release' || '' }} ${{ steps.tag.outputs.result }} --target ${{matrix.code-target}} env: VSCE_PAT: ${{ secrets.VSCE_PAT }} CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} From 8f25dad88eaef2e547ee2e4ccb39ff030c014e1e Mon Sep 17 00:00:00 2001 From: 0xMemoryGrinder <35138272+0xMemoryGrinder@users.noreply.github.com> Date: Wed, 22 Nov 2023 18:18:00 -0500 Subject: [PATCH 325/325] fix(cd): added missing code-target --- .github/workflows/publish-extension.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/publish-extension.yml b/.github/workflows/publish-extension.yml index df9d1ea4..f686961c 100644 --- a/.github/workflows/publish-extension.yml +++ b/.github/workflows/publish-extension.yml @@ -28,6 +28,7 @@ jobs: code-target: win32-x64 - os: windows-latest target: i686-pc-windows-msvc + code-target: win32-ia32 - os: windows-latest target: aarch64-pc-windows-msvc code-target: win32-arm64