Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lint workflow failing on PR without code changes #18

Open
technicalpickles opened this issue Nov 30, 2023 · 1 comment
Open

lint workflow failing on PR without code changes #18

technicalpickles opened this issue Nov 30, 2023 · 1 comment

Comments

@technicalpickles
Copy link
Contributor

ie on #17, this is failing

error: useless use of `vec!`
  --> src/ownership/file_generator.rs:26:9
   |
26 | /         vec![
27 | |             "# STOP! - DO NOT EDIT THIS FILE MANUALLY",
28 | |             "# This file was automatically generated by \"bin/codeownership validate\".",
29 | |             "#",
...  |
35 | |             "",
36 | |         ]
   | |_________^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_vec
   = note: `-D clippy::useless-vec` implied by `-D warnings`
   = help: to override `-D warnings` add `#[allow(clippy::useless_vec)]`
help: you can use an array directly
   |
26 ~         ["# STOP! - DO NOT EDIT THIS FILE MANUALLY",
27 +             "# This file was automatically generated by \"bin/codeownership validate\".",
28 +             "#",
29 +             "# CODEOWNERS is used for GitHub to suggest code/file owners to various GitHub",
30 +             "# teams. This is useful when developers create Pull Requests since the",
31 +             "# code/file owner is notified. Reference GitHub docs for more details:",
32 +             "# https://help.github.com/en/articles/about-code-owners",
33 +             "",
34 +             ""]
   |

error: use of `or_insert` to construct default value
   --> src/ownership/validator.rs:158:45
    |
158 |                         let sources = entry.or_insert(Vec::new());
    |                                             ^^^^^^^^^^^^^^^^^^^^^ help: try: `or_default()`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_or_default
    = note: `-D clippy::unwrap-or-default` implied by `-D warnings`
    = help: to override `-D warnings` add `#[allow(clippy::unwrap_or_default)]`

error: use of `unwrap_or` to construct default value
   --> src/project.rs:227:79
    |
227 |                     owned_gems: deserializer.ruby.map(|ruby| ruby.owned_gems).unwrap_or(Vec::new()),
    |                                                                               ^^^^^^^^^^^^^^^^^^^^^ help: try: `unwrap_or_default()`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_or_default

error: could not compile `codeowners` (bin "codeowners") due to 3 previous errors
Error: Process completed with exit code 101.

Maybe some of the workflows need to be pinned to specific versions? 🤔

@ethankhall
Copy link

ethankhall commented Dec 1, 2023

We should add a rust-toolchain.toml to pin to a version of rust, so that builds will "just work" and not rely on local machine versions of rust installed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants