feat: add --skip-modifiers flag (#68) #151
clippy
45 warnings
Details
Results
Message level | Amount |
---|---|
Internal compiler error | 0 |
Error | 0 |
Warning | 45 |
Note | 0 |
Help | 0 |
Versions
- rustc 1.78.0 (9b00956e5 2024-04-29)
- cargo 1.78.0 (54d8815d0 2024-03-26)
- clippy 0.1.78 (9b00956 2024-04-29)
Annotations
Check warning on line 14 in src/syntax/mod.rs
github-actions / clippy
docs for function returning `Result` missing `# Errors` section
warning: docs for function returning `Result` missing `# Errors` section
--> src/syntax/mod.rs:14:1
|
14 | pub fn parse(text: &str) -> crate::error::Result<ast::Ast> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_errors_doc
Check warning on line 26 in src/syntax/visitor.rs
github-actions / clippy
docs for function returning `Result` missing `# Errors` section
warning: docs for function returning `Result` missing `# Errors` section
--> src/syntax/visitor.rs:23:5
|
23 | / fn visit_description(
24 | | &mut self,
25 | | description: &ast::Description,
26 | | ) -> Result<Self::Output, Self::Error>;
| |___________________________________________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_errors_doc
Check warning on line 21 in src/syntax/visitor.rs
github-actions / clippy
docs for function returning `Result` missing `# Errors` section
warning: docs for function returning `Result` missing `# Errors` section
--> src/syntax/visitor.rs:21:5
|
21 | fn visit_action(&mut self, action: &ast::Action) -> Result<Self::Output, Self::Error>;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_errors_doc
Check warning on line 19 in src/syntax/visitor.rs
github-actions / clippy
docs for function returning `Result` missing `# Errors` section
warning: docs for function returning `Result` missing `# Errors` section
--> src/syntax/visitor.rs:19:5
|
19 | fn visit_condition(&mut self, condition: &ast::Condition) -> Result<Self::Output, Self::Error>;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_errors_doc
Check warning on line 17 in src/syntax/visitor.rs
github-actions / clippy
docs for function returning `Result` missing `# Errors` section
warning: docs for function returning `Result` missing `# Errors` section
--> src/syntax/visitor.rs:17:5
|
17 | fn visit_root(&mut self, root: &ast::Root) -> Result<Self::Output, Self::Error>;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_errors_doc
Check warning on line 162 in src/syntax/tokenizer.rs
github-actions / clippy
docs for function returning `Result` missing `# Errors` section
warning: docs for function returning `Result` missing `# Errors` section
--> src/syntax/tokenizer.rs:162:5
|
162 | pub fn tokenize(&mut self, text: &str) -> Result<Vec<Token>> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_errors_doc
Check warning on line 128 in src/syntax/semantics.rs
github-actions / clippy
docs for function returning `Result` missing `# Errors` section
warning: docs for function returning `Result` missing `# Errors` section
--> src/syntax/semantics.rs:128:5
|
128 | pub fn analyze(&mut self, ast: &ast::Ast) -> Result<()> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_errors_doc
Check warning on line 128 in src/syntax/semantics.rs
github-actions / clippy
docs for function which may panic missing `# Panics` section
warning: docs for function which may panic missing `# Panics` section
--> src/syntax/semantics.rs:128:5
|
128 | pub fn analyze(&mut self, ast: &ast::Ast) -> Result<()> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
note: first possible panic found here
--> src/syntax/semantics.rs:129:9
|
129 | / match ast {
130 | | Ast::Root(root) => self.visit_root(root),
131 | | Ast::Condition(condition) => self.visit_condition(condition),
132 | | Ast::Action(action) => self.visit_action(action),
... |
136 | | // be stored in `self.errors`.
137 | | .unwrap();
| |_________________^
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_panics_doc
Check warning on line 139 in src/syntax/parser.rs
github-actions / clippy
docs for function returning `Result` missing `# Errors` section
warning: docs for function returning `Result` missing `# Errors` section
--> src/syntax/parser.rs:139:5
|
139 | pub fn parse(&mut self, text: &str, tokens: &[Token]) -> Result<Ast> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_errors_doc
Check warning on line 141 in src/scaffold/mod.rs
github-actions / clippy
docs for function returning `Result` missing `# Errors` section
warning: docs for function returning `Result` missing `# Errors` section
--> src/scaffold/mod.rs:141:1
|
141 | pub fn scaffold(text: &str, cfg: &Config) -> crate::error::Result<String> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_errors_doc
Check warning on line 141 in src/scaffold/mod.rs
github-actions / clippy
docs for function which may panic missing `# Panics` section
warning: docs for function which may panic missing `# Panics` section
--> src/scaffold/mod.rs:141:1
|
141 | pub fn scaffold(text: &str, cfg: &Config) -> crate::error::Result<String> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
note: first possible panic found here
--> src/scaffold/mod.rs:145:21
|
145 | let formatted = fmt(&source).expect("should format the emitted solidity code");
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_panics_doc
Check warning on line 51 in src/scaffold/mod.rs
github-actions / clippy
more than 3 bools in a struct
warning: more than 3 bools in a struct
--> src/scaffold/mod.rs:24:1
|
24 | / pub struct Scaffold {
25 | | /// The set of tree files to generate from.
26 | | ///
27 | | /// Each Solidity file will be named after its matching
... |
50 | | pub skip_modifiers: bool,
51 | | }
| |_^
|
= help: consider using a state machine or refactoring bools into two-variant enums
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#struct_excessive_bools
= note: `#[warn(clippy::struct_excessive_bools)]` implied by `#[warn(clippy::pedantic)]`
Check warning on line 41 in src/scaffold/modifiers.rs
github-actions / clippy
docs for function which may panic missing `# Panics` section
warning: docs for function which may panic missing `# Panics` section
--> src/scaffold/modifiers.rs:41:5
|
41 | pub fn discover(&mut self, ast: &Ast) -> &IndexMap<String, String> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
note: first possible panic found here
--> src/scaffold/modifiers.rs:44:17
|
44 | self.visit_root(root).unwrap();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_panics_doc
= note: `#[warn(clippy::missing_panics_doc)]` implied by `#[warn(clippy::pedantic)]`
Check warning on line 83 in src/scaffold/emitter.rs
github-actions / clippy
unused `self` argument
warning: unused `self` argument
--> src/scaffold/emitter.rs:83:29
|
83 | fn emit_contract_header(&self, contract: &hir::ContractDefinition) -> String {
| ^^^^^
|
= help: consider refactoring to an associated function
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unused_self
= note: `#[warn(clippy::unused_self)]` implied by `#[warn(clippy::pedantic)]`
Check warning on line 40 in src/hir/mod.rs
github-actions / clippy
item name ends with its containing module's name
warning: item name ends with its containing module's name
--> src/hir/mod.rs:40:8
|
40 | pub fn translate_tree_to_hir(tree: &str, cfg: &Config) -> error::Result<Hir> {
| ^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#module_name_repetitions
= note: `#[warn(clippy::module_name_repetitions)]` implied by `#[warn(clippy::pedantic)]`
Check warning on line 40 in src/hir/mod.rs
github-actions / clippy
docs for function returning `Result` missing `# Errors` section
warning: docs for function returning `Result` missing `# Errors` section
--> src/hir/mod.rs:40:1
|
40 | pub fn translate_tree_to_hir(tree: &str, cfg: &Config) -> error::Result<Hir> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_errors_doc
Check warning on line 20 in src/hir/mod.rs
github-actions / clippy
docs for function returning `Result` missing `# Errors` section
warning: docs for function returning `Result` missing `# Errors` section
--> src/hir/mod.rs:20:1
|
20 | pub fn translate(text: &str, cfg: &Config) -> anyhow::Result<Hir> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_errors_doc
Check warning on line 75 in src/hir/visitor.rs
github-actions / clippy
docs for function returning `Result` missing `# Errors` section
warning: docs for function returning `Result` missing `# Errors` section
--> src/hir/visitor.rs:72:5
|
72 | / fn visit_statement(
73 | | &mut self,
74 | | statement: &hir::Statement,
75 | | ) -> Result<Self::StatementOutput, Self::Error>;
| |____________________________________________________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_errors_doc
Check warning on line 63 in src/hir/visitor.rs
github-actions / clippy
docs for function returning `Result` missing `# Errors` section
warning: docs for function returning `Result` missing `# Errors` section
--> src/hir/visitor.rs:62:5
|
62 | / fn visit_comment(&mut self, comment: &hir::Comment)
63 | | -> Result<Self::CommentOutput, Self::Error>;
| |____________________________________________________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_errors_doc
Check warning on line 53 in src/hir/visitor.rs
github-actions / clippy
docs for function returning `Result` missing `# Errors` section
warning: docs for function returning `Result` missing `# Errors` section
--> src/hir/visitor.rs:50:5
|
50 | / fn visit_function(
51 | | &mut self,
52 | | function: &hir::FunctionDefinition,
53 | | ) -> Result<Self::FunctionDefinitionOutput, Self::Error>;
| |_____________________________________________________________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_errors_doc
Check warning on line 42 in src/hir/visitor.rs
github-actions / clippy
docs for function returning `Result` missing `# Errors` section
warning: docs for function returning `Result` missing `# Errors` section
--> src/hir/visitor.rs:39:5
|
39 | / fn visit_contract(
40 | | &mut self,
41 | | contract: &hir::ContractDefinition,
42 | | ) -> Result<Self::ContractDefinitionOutput, Self::Error>;
| |_____________________________________________________________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_errors_doc
Check warning on line 31 in src/hir/visitor.rs
github-actions / clippy
docs for function returning `Result` missing `# Errors` section
warning: docs for function returning `Result` missing `# Errors` section
--> src/hir/visitor.rs:31:5
|
31 | fn visit_root(&mut self, root: &hir::Root) -> Result<Self::RootOutput, Self::Error>;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_errors_doc
Check warning on line 109 in src/hir/combiner.rs
github-actions / clippy
docs for function returning `Result` missing `# Errors` section
warning: docs for function returning `Result` missing `# Errors` section
--> src/hir/combiner.rs:109:5
|
109 | pub fn combine(self, text: &str, hirs: Vec<Hir>) -> Result<Hir> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_errors_doc
Check warning on line 66 in src/config.rs
github-actions / clippy
docs for function returning `Result` missing `# Errors` section
warning: docs for function returning `Result` missing `# Errors` section
--> src/config.rs:66:1
|
66 | pub fn run() -> anyhow::Result<()> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_errors_doc
= note: `#[warn(clippy::missing_errors_doc)]` implied by `#[warn(clippy::pedantic)]`
Check warning on line 61 in src/config.rs
github-actions / clippy
calling `Scaffold::default()` is more clear than this expression
warning: calling `Scaffold::default()` is more clear than this expression
--> src/config.rs:61:24
|
61 | Self::Scaffold(Default::default())
| ^^^^^^^^^^^^^^^^^^ help: try: `Scaffold::default()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_trait_access