From fd89de1794b2681ed4b86cbde40a713ecb0ee14c Mon Sep 17 00:00:00 2001 From: Pranav Gaddamadugu <23022326+d0cd@users.noreply.github.com> Date: Wed, 4 Sep 2024 11:30:21 -0700 Subject: [PATCH] Add directory for linter --- Cargo.lock | 5 ++ Cargo.toml | 165 +++++++++++++++++++++------------------- utils/linter/Cargo.toml | 20 +++++ utils/linter/src/lib.rs | 15 ++++ 4 files changed, 125 insertions(+), 80 deletions(-) create mode 100644 utils/linter/Cargo.toml create mode 100644 utils/linter/src/lib.rs diff --git a/Cargo.lock b/Cargo.lock index 3e5a1da4d7..9d48320414 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1633,6 +1633,7 @@ dependencies = [ "leo-ast", "leo-compiler", "leo-errors", + "leo-linter", "leo-package", "leo-parser", "leo-retriever", @@ -1659,6 +1660,10 @@ dependencies = [ "walkdir", ] +[[package]] +name = "leo-linter" +version = "2.1.0" + [[package]] name = "leo-package" version = "2.1.0" diff --git a/Cargo.toml b/Cargo.toml index 6627aac315..d1d224a3c1 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -40,6 +40,7 @@ members = [ "leo/package", "tests/test-framework", "utils/disassembler", + "utils/linter", "utils/retriever" ] @@ -65,117 +66,121 @@ num-format = "0.4.4" text-tables = "0.3.1" ureq = "2.10.1" - [dependencies.leo-ast] - path = "./compiler/ast" - version = "2.1.0" +[dependencies.leo-ast] +path = "./compiler/ast" +version = "2.1.0" - [dependencies.leo-compiler] - path = "./compiler/compiler" - version = "2.1.0" +[dependencies.leo-compiler] +path = "./compiler/compiler" +version = "2.1.0" - [dependencies.leo-errors] - path = "./errors" - version = "2.1.0" +[dependencies.leo-errors] +path = "./errors" +version = "2.1.0" - [dependencies.leo-package] - path = "./leo/package" - version = "2.1.0" +[dependencies.leo-linter] +path = "./utils/linter" +version = "2.1.0" - [dependencies.leo-parser] - path = "./compiler/parser" - version = "2.1.0" +[dependencies.leo-package] +path = "./leo/package" +version = "2.1.0" - [dependencies.leo-span] - path = "./compiler/span" - version = "2.1.0" +[dependencies.leo-parser] +path = "./compiler/parser" +version = "2.1.0" + +[dependencies.leo-span] +path = "./compiler/span" +version = "2.1.0" - [dependencies.leo-retriever] - path = "./utils/retriever" - version = "2.1.0" +[dependencies.leo-retriever] +path = "./utils/retriever" +version = "2.1.0" - [dependencies.aleo-std] - version = "0.1.24" - default-features = false +[dependencies.aleo-std] +version = "0.1.24" +default-features = false - [dependencies.backtrace] - version = "0.3.73" +[dependencies.backtrace] +version = "0.3.73" - [dependencies.clap] - version = "4.5" - features = [ "derive", "env", "color", "unstable-styles" ] +[dependencies.clap] +version = "4.5" +features = [ "derive", "env", "color", "unstable-styles" ] - [dependencies.color-backtrace] - version = "0.6.1" +[dependencies.color-backtrace] +version = "0.6.1" - [dependencies.colored] - version = "2.0" +[dependencies.colored] +version = "2.0" - [dependencies.console] - version = "0.15.8" +[dependencies.console] +version = "0.15.8" - [dependencies.dirs] - version = "5.0.0" +[dependencies.dirs] +version = "5.0.0" - [dependencies.dotenvy] - version = "0.15.7" +[dependencies.dotenvy] +version = "0.15.7" - [dependencies.indexmap] - version = "1.9" - features = [ "serde" ] +[dependencies.indexmap] +version = "1.9" +features = [ "serde" ] - [dependencies.lazy_static] - version = "1.5.0" +[dependencies.lazy_static] +version = "1.5.0" - [dependencies.rand] - version = "0.8" +[dependencies.rand] +version = "0.8" - [dependencies.rand_chacha] - version = "0.3.0" - default-features = false +[dependencies.rand_chacha] +version = "0.3.0" +default-features = false - [dependencies.rand_core] - version = "0.6.4" +[dependencies.rand_core] +version = "0.6.4" - [dependencies.reqwest] - version = "0.12.5" - features = [ "blocking", "json", "multipart" ] +[dependencies.reqwest] +version = "0.12.5" +features = [ "blocking", "json", "multipart" ] - [dependencies.self_update] - version = "0.41.0" - features = [ "archive-zip", "compression-zip-deflate" ] +[dependencies.self_update] +version = "0.41.0" +features = [ "archive-zip", "compression-zip-deflate" ] - [dependencies.serde] - version = "1.0" - features = [ "derive" ] +[dependencies.serde] +version = "1.0" +features = [ "derive" ] - [dependencies.serde_json] - version = "1.0" +[dependencies.serde_json] +version = "1.0" - [dependencies.serial_test] - version = "3.1.1" +[dependencies.serial_test] +version = "3.1.1" - [dependencies.snarkvm] - workspace = true - features = [ "circuit", "console" ] +[dependencies.snarkvm] +workspace = true +features = [ "circuit", "console" ] - [dependencies.sys-info] - version = "0.9.1" +[dependencies.sys-info] +version = "0.9.1" - [dependencies.toml] - version = "0.8" +[dependencies.toml] +version = "0.8" - [dependencies.tracing] - version = "0.1" +[dependencies.tracing] +version = "0.1" - [dependencies.tracing-subscriber] - version = "0.3.18" - features = [ "fmt" ] +[dependencies.tracing-subscriber] +version = "0.3.18" +features = [ "fmt" ] - [dependencies.crossterm] - version = "0.28.1" +[dependencies.crossterm] +version = "0.28.1" - [dependencies.rpassword] - version = "7.3.1" +[dependencies.rpassword] +version = "7.3.1" [target."cfg(windows)".dependencies.ansi_term] version = "0.12.1" diff --git a/utils/linter/Cargo.toml b/utils/linter/Cargo.toml new file mode 100644 index 0000000000..ce303feec4 --- /dev/null +++ b/utils/linter/Cargo.toml @@ -0,0 +1,20 @@ +[package] +name = "leo-linter" +version = "2.1.0" +authors = [ "The Aleo Team " ] +description = "A linter for the Leo programming language" +homepage = "https://aleo.org" +repository = "https://github.com/AleoHQ/leo" +keywords = [ + "aleo", + "cryptography", + "leo", + "programming-language", + "zero-knowledge" +] +categories = [ "compilers", "cryptography", "web-programming" ] +include = [ "Cargo.toml", "src", "README.md", "LICENSE.md" ] +license = "GPL-3.0" +edition = "2021" +rust-version = "1.69" + diff --git a/utils/linter/src/lib.rs b/utils/linter/src/lib.rs new file mode 100644 index 0000000000..1e22630f3e --- /dev/null +++ b/utils/linter/src/lib.rs @@ -0,0 +1,15 @@ +// Copyright (C) 2019-2023 Aleo Systems Inc. +// This file is part of the Leo library. + +// The Leo library 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. + +// The Leo library 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 the Leo library. If not, see .