-
-
Notifications
You must be signed in to change notification settings - Fork 620
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
Added clippy check. #65
Conversation
@imsnif not too bad, right? |
.github/workflows/rust.yml
Outdated
with: | ||
toolchain: stable | ||
components: clippy | ||
- uses: actions-rs/clippy@master |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@imsnif This version needs to be changed asap.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, I'm not sure I understand?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The master tag as it's not versioned.
But from what I see it's not really being developed actively
src/terminal_pane/scroll.rs
Outdated
while let Some((current_index, current_line)) = indices_and_canonical_lines.next() { | ||
if current_index == canonical_line_cursor_position { | ||
y += current_line.wrapped_fragments.len() - line_wrap_cursor_position; | ||
break; | ||
} else { | ||
y += current_line.wrapped_fragments.len(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems much nicer
src/screen.rs
Outdated
@@ -67,6 +67,7 @@ pub enum ScreenInstruction { | |||
ClearScroll, | |||
CloseFocusedPane, | |||
ToggleActiveTerminalFullscreen, | |||
#[allow(dead_code)] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure about adding warning suppressions (similarly for the other allow directives)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I feel the same... @5c077m4n - could you share the reasoning here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah, oops - didn't realize this was already changed
@5c077m4n - looking good! I'm fine with everything here. What else needs to be done? Do you also want to take care of some of the warnings we've got? |
Also, could you merge from main? There are some changes there that might need to run through these tests |
@@ -142,7 +142,7 @@ impl Screen { | |||
let pid = new_pids.next().unwrap(); // if this crashes it means we got less pids than there are panes in this layout | |||
let mut new_terminal = TerminalPane::new( | |||
*pid, | |||
self.full_screen_ws.clone(), | |||
self.full_screen_ws, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@imsnif clippy really does not like the .clone()
here, is it necessary?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is Copy
, so no need for sure. It's probably a leftover from a refactor.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
😎
@5c077m4n - so is this ready? |
src/utils/logging.rs
Outdated
fn atomic_create_file(file_name: &str) { | ||
let _ = fs::OpenOptions::new().create(true).open(file_name); | ||
fn atomic_create_file(file_name: &str) -> io::Result<fs::File> { | ||
fs::OpenOptions::new().create(true).open(file_name) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@5c077m4n - the previous way was actually intentional. This is "atomic" create file, meaning that it's okay for it to fail if the file already exists.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reverted. Sorry 🤦
This is nearly done, there are just a couple of more minor changes that you might want to look at yourself @imsnif (like |
So... is this ready for review or not? |
Yep, now it is |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Really great work on this! I imagine this was not trivial.
I left some general comments. I'm looking into the stdin error (it might be the cause of some of our troubles). But until then (and on top of my comments in the code): why is the build not failing? It has two errors and several warnings. Shouldn't it be red?
_ => {} | ||
if let Some(&25) = params.get(0) { | ||
self.scroll.show_cursor(); | ||
self.mark_for_rerender(); | ||
}; | ||
} | ||
} else if c == 'r' { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@5c077m4n - I can't comment on the lines below directly for some reason, but can we disable this clippy check? The one with the errors about the identical ifs. I would really like to leave it like this for now. The comments are super important and this block is generally very much in-flux as we keep reverse-engineering the VT100 protocol.
src/utils/logging.rs
Outdated
} | ||
|
||
pub fn delete_log_file() -> io::Result<()> { | ||
pub fn _delete_log_file() -> io::Result<()> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The functions in this file are general utility functions. Can we add exceptions for them so that we don't have to prefix them with underscores? It would just be confusing and annoying while debugging :)
@imsnif the tests are not failing because this clippy github actions is not really being developed, I've looked some other possibility but this still looks better |
So... I guess this solution doesn't do the job for us? If we can't see the failures on PRs, then this essentially will not be part of our CI. Or am I missing something?
Cool - so can we add them? |
Also (if we're going forward with this) we should either address the warnings or have them not appear inside the code-browsing. Because it's hard to review PRs with them. |
Sure, I'll do what you asked tonight/tomorrow morning @imsnif |
Awesome. But just to stress: we need some sort of failure in our CI for this to be meaningful. I don't mind it even being a hack, like a test-case running clippy or whatever :) |
😎 |
@imsnif after some research I found that there are three possibilities to clippy check in the ci:
|
I see... thanks for all the research! Does number 3 still check PRs and fail the build though? |
Yep, that's what's configured for now |
Alright, so maybe it can be a good compromise? |
Great :) in that case this branch is ready for your review @imsnif |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work as always. Thanks for doing this! I think we will all appreciate it :)
No description provided.