Skip to content

fix: only skip modifiers & not regular fns with -m flag (#82) #181

fix: only skip modifiers & not regular fns with -m flag (#82)

fix: only skip modifiers & not regular fns with -m flag (#82) #181

GitHub Actions / clippy succeeded Jul 27, 2024 in 1s

clippy

54 warnings

Details

Results

Message level Amount
Internal compiler error 0
Error 0
Warning 54
Note 0
Help 0

Versions

  • rustc 1.80.0 (051478957 2024-07-21)
  • cargo 1.80.0 (376290515 2024-07-16)
  • clippy 0.1.80 (0514789 2024-07-21)

Annotations

Check warning on line 53 in crates/bulloak/src/scaffold.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

more than 3 bools in a struct

warning: more than 3 bools in a struct
  --> crates/bulloak/src/scaffold.rs:21:1
   |
21 | / pub struct Scaffold {
22 | |     /// The set of tree files to generate from.
23 | |     ///
24 | |     /// Each Solidity file will be named after its matching
...  |
52 | |     pub skip_modifiers: bool,
53 | | }
   | |_^
   |
   = 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: `-W clippy::struct-excessive-bools` implied by `-W clippy::pedantic`
   = help: to override `-W clippy::pedantic` add `#[allow(clippy::struct_excessive_bools)]`

Check warning on line 40 in crates/bulloak/src/cli.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

struct update has no effect, all the fields in the struct have already been specified

warning: struct update has no effect, all the fields in the struct have already been specified
  --> crates/bulloak/src/cli.rs:40:19
   |
40 |                 ..Self::default()
   |                   ^^^^^^^^^^^^^^^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_update
   = note: `-W clippy::needless-update` implied by `-W clippy::all`
   = help: to override `-W clippy::all` add `#[allow(clippy::needless_update)]`

Check warning on line 28 in crates/bulloak/src/cli.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

calling `Scaffold::default()` is more clear than this expression

warning: calling `Scaffold::default()` is more clear than this expression
  --> crates/bulloak/src/cli.rs:28:24
   |
28 |         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
   = note: `-W clippy::default-trait-access` implied by `-W clippy::pedantic`
   = help: to override `-W clippy::pedantic` add `#[allow(clippy::default_trait_access)]`

Check warning on line 17 in crates/foundry/src/scaffold/mod.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

docs for function returning `Result` missing `# Errors` section

warning: docs for function returning `Result` missing `# Errors` section
  --> crates/foundry/src/scaffold/mod.rs:17:1
   |
17 | pub fn scaffold(text: &str, cfg: &Config) -> anyhow::Result<String> {
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_errors_doc

Check warning on line 17 in crates/foundry/src/scaffold/mod.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

docs for function which may panic missing `# Panics` section

warning: docs for function which may panic missing `# Panics` section
  --> crates/foundry/src/scaffold/mod.rs:17:1
   |
17 | pub fn scaffold(text: &str, cfg: &Config) -> anyhow::Result<String> {
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
note: first possible panic found here
  --> crates/foundry/src/scaffold/mod.rs:22:9
   |
22 |         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 38 in crates/foundry/src/scaffold/modifiers.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

docs for function which may panic missing `# Panics` section

warning: docs for function which may panic missing `# Panics` section
  --> crates/foundry/src/scaffold/modifiers.rs:38:5
   |
38 |     pub fn discover(&mut self, ast: &Ast) -> &IndexMap<String, String> {
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
note: first possible panic found here
  --> crates/foundry/src/scaffold/modifiers.rs:41:17
   |
41 |                 self.visit_root(root).unwrap();
   |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_panics_doc

Check warning on line 91 in crates/foundry/src/scaffold/emitter.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

unused `self` argument

warning: unused `self` argument
  --> crates/foundry/src/scaffold/emitter.rs:91:9
   |
91 |         &self,
   |         ^^^^^
   |
   = 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: `-W clippy::unused-self` implied by `-W clippy::pedantic`
   = help: to override `-W clippy::pedantic` add `#[allow(clippy::unused_self)]`

Check warning on line 26 in crates/foundry/src/hir/mod.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

docs for function returning `Result` missing `# Errors` section

warning: docs for function returning `Result` missing `# Errors` section
  --> crates/foundry/src/hir/mod.rs:26:1
   |
26 | 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 85 in crates/foundry/src/hir/visitor.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

docs for function returning `Result` missing `# Errors` section

warning: docs for function returning `Result` missing `# Errors` section
  --> crates/foundry/src/hir/visitor.rs:82:5
   |
82 | /     fn visit_statement(
83 | |         &mut self,
84 | |         statement: &hir::Statement,
85 | |     ) -> 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 73 in crates/foundry/src/hir/visitor.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

docs for function returning `Result` missing `# Errors` section

warning: docs for function returning `Result` missing `# Errors` section
  --> crates/foundry/src/hir/visitor.rs:70:5
   |
70 | /     fn visit_comment(
71 | |         &mut self,
72 | |         comment: &hir::Comment,
73 | |     ) -> 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 59 in crates/foundry/src/hir/visitor.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

docs for function returning `Result` missing `# Errors` section

warning: docs for function returning `Result` missing `# Errors` section
  --> crates/foundry/src/hir/visitor.rs:56:5
   |
56 | /     fn visit_function(
57 | |         &mut self,
58 | |         function: &hir::FunctionDefinition,
59 | |     ) -> 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 47 in crates/foundry/src/hir/visitor.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

docs for function returning `Result` missing `# Errors` section

warning: docs for function returning `Result` missing `# Errors` section
  --> crates/foundry/src/hir/visitor.rs:44:5
   |
44 | /     fn visit_contract(
45 | |         &mut self,
46 | |         contract: &hir::ContractDefinition,
47 | |     ) -> 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 35 in crates/foundry/src/hir/visitor.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

docs for function returning `Result` missing `# Errors` section

warning: docs for function returning `Result` missing `# Errors` section
  --> crates/foundry/src/hir/visitor.rs:32:5
   |
32 | /     fn visit_root(
33 | |         &mut self,
34 | |         root: &hir::Root,
35 | |     ) -> 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 103 in crates/foundry/src/hir/combiner.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

docs for function returning `Result` missing `# Errors` section

warning: docs for function returning `Result` missing `# Errors` section
   --> crates/foundry/src/hir/combiner.rs:99:5
    |
99  | /     pub fn combine(
100 | |         self,
101 | |         text: &str,
102 | |         hirs: impl Iterator<Item = Hir>,
103 | |     ) -> Result<Hir> {
    | |____________________^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_errors_doc

Check warning on line 308 in crates/foundry/src/check/violation.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

you seem to be trying to use `&Box<T>`. Consider using just `&T`

warning: you seem to be trying to use `&Box<T>`. Consider using just `&T`
   --> crates/foundry/src/check/violation.rs:308:19
    |
308 |     contract_sol: &Box<ContractDefinition>,
    |                   ^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `&ContractDefinition`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#borrowed_box
    = note: `-W clippy::borrowed-box` implied by `-W clippy::all`
    = help: to override `-W clippy::all` add `#[allow(clippy::borrowed_box)]`

Check warning on line 174 in crates/foundry/src/check/violation.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this method could have a `#[must_use]` attribute

warning: this method could have a `#[must_use]` attribute
   --> crates/foundry/src/check/violation.rs:174:5
    |
174 |     pub fn fix(&self, mut ctx: Context) -> Context {
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add the attribute: `#[must_use] pub fn fix(&self, mut ctx: Context) -> Context`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#must_use_candidate

Check warning on line 174 in crates/foundry/src/check/violation.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

docs for function which may panic missing `# Panics` section

warning: docs for function which may panic missing `# Panics` section
   --> crates/foundry/src/check/violation.rs:174:5
    |
174 |     pub fn fix(&self, mut ctx: Context) -> Context {
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
note: first possible panic found here
   --> crates/foundry/src/check/violation.rs:181:21
    |
181 |                     parse(&source).expect("should parse Solidity string");
    |                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_panics_doc
    = note: `-W clippy::missing-panics-doc` implied by `-W clippy::pedantic`
    = help: to override `-W clippy::pedantic` add `#[allow(clippy::missing_panics_doc)]`

Check warning on line 151 in crates/foundry/src/check/violation.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this method could have a `#[must_use]` attribute

warning: this method could have a `#[must_use]` attribute
   --> crates/foundry/src/check/violation.rs:151:5
    |
151 |     pub fn help(&self) -> Option<Cow<'static, str>> {
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add the attribute: `#[must_use] pub fn help(&self) -> Option<Cow<'static, str>>`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#must_use_candidate

Check warning on line 139 in crates/foundry/src/check/violation.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this method could have a `#[must_use]` attribute

warning: this method could have a `#[must_use]` attribute
   --> crates/foundry/src/check/violation.rs:139:5
    |
139 |     pub fn is_fixable(&self) -> bool {
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add the attribute: `#[must_use] pub fn is_fixable(&self) -> bool`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#must_use_candidate

Check warning on line 54 in crates/foundry/src/check/violation.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

item name starts with its containing module's name

warning: item name starts with its containing module's name
  --> crates/foundry/src/check/violation.rs:54:10
   |
54 | pub enum ViolationKind {
   |          ^^^^^^^^^^^^^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#module_name_repetitions
   = note: `-W clippy::module-name-repetitions` implied by `-W clippy::pedantic`
   = help: to override `-W clippy::pedantic` add `#[allow(clippy::module_name_repetitions)]`

Check warning on line 41 in crates/foundry/src/check/violation.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this method could have a `#[must_use]` attribute

warning: this method could have a `#[must_use]` attribute
  --> crates/foundry/src/check/violation.rs:41:5
   |
41 |     pub fn is_fixable(&self) -> bool {
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add the attribute: `#[must_use] pub fn is_fixable(&self) -> bool`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#must_use_candidate

Check warning on line 36 in crates/foundry/src/check/violation.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this method could have a `#[must_use]` attribute

warning: this method could have a `#[must_use]` attribute
  --> crates/foundry/src/check/violation.rs:36:5
   |
36 |     pub fn new(kind: ViolationKind, location: Location) -> Self {
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add the attribute: `#[must_use] pub fn new(kind: ViolationKind, location: Location) -> Self`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#must_use_candidate

Check warning on line 22 in crates/foundry/src/check/utils.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this function could have a `#[must_use]` attribute

warning: this function could have a `#[must_use]` attribute
  --> crates/foundry/src/check/utils.rs:22:1
   |
22 | pub fn offset_to_line(content: &str, start: usize) -> usize {
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add the attribute: `#[must_use] pub fn offset_to_line(content: &str, start: usize) -> usize`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#must_use_candidate

Check warning on line 4 in crates/foundry/src/check/utils.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this function could have a `#[must_use]` attribute

warning: this function could have a `#[must_use]` attribute
 --> crates/foundry/src/check/utils.rs:4:1
  |
4 | pub fn offset_to_line_column(content: &str, start: usize) -> (usize, usize) {
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add the attribute: `#[must_use] pub fn offset_to_line_column(content: &str, start: usize) -> (usize, usize)`
  |
  = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#must_use_candidate

Check warning on line 179 in crates/foundry/src/check/rules/structural_match.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

the loop variable `j` is only used to index `present_fn_indices`

warning: the loop variable `j` is only used to index `present_fn_indices`
   --> crates/foundry/src/check/rules/structural_match.rs:179:18
    |
179 |         for j in i + 1..present_fn_indices.len() {
    |                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop
    = note: `-W clippy::needless-range-loop` implied by `-W clippy::all`
    = help: to override `-W clippy::all` add `#[allow(clippy::needless_range_loop)]`
help: consider using an iterator
    |
179 |         for <item> in present_fn_indices.iter().skip(i + 1) {
    |             ~~~~~~    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~