Skip to content

Commit

Permalink
chore: fix clippy error and add generic CI check
Browse files Browse the repository at this point in the history
  • Loading branch information
ForsakenHarmony committed Apr 24, 2024
1 parent db0eaf2 commit bce4d79
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 2 deletions.
25 changes: 25 additions & 0 deletions .github/workflows/test.yml
Expand Up @@ -455,6 +455,31 @@ jobs:
with:
command: check licenses

rust_clippy:
needs: [determine_jobs]
if: needs.determine_jobs.outputs.rust == 'true' ||
needs.determine_jobs.outputs.cargo_on_main == 'true' ||
needs.determine_jobs.outputs.cargo_only == 'true'
name: Rust clippy
runs-on:
- "self-hosted"
- "linux"
- "x64"
- "metal"
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Setup Turborepo Environment
uses: ./.github/actions/setup-turborepo-environment
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"

- name: Run cargo clippy
run: |
cargo clippy --workspace --all-targets --features rustls-tls \
-- --deny clippy::all --deny warnings --allow clippy::too_many_arguments
turborepo_rust_check:
needs: [determine_jobs]
# We test dependency changes only on main
Expand Down
2 changes: 1 addition & 1 deletion crates/turborepo-filewatch/src/hash_watcher.rs
Expand Up @@ -834,7 +834,7 @@ mod tests {
.unwrap();
repo.branch("test-branch", &current_commit, false).unwrap();
repo.set_head("refs/heads/test-branch").unwrap();
commit_all(&repo);
commit_all(repo);
}

#[tokio::test]
Expand Down
7 changes: 6 additions & 1 deletion crates/turborepo-vt100/src/entire_screen.rs
Expand Up @@ -19,6 +19,9 @@ impl<'a> EntireScreen<'a> {
self.max_lines = max_lines;
}

/// # Panics
///
/// Will panic if `height` or `max_lines` do not fit in a u16.
#[must_use]
pub fn cell(&self, row: u16, col: u16) -> Option<&crate::Cell> {
match self.max_lines {
Expand All @@ -27,7 +30,9 @@ impl<'a> EntireScreen<'a> {
// in this case we fuck ourselves :) HARD
let (height, _) = self.size();
// Skip over these
let lines_to_cut = (height - max_lines) as u16;
let lines_to_cut: u16 = (height - max_lines)
.try_into()
.expect("height and max_lines should fit in a u16");
self.screen
.grid()
.all_row(lines_to_cut + row)
Expand Down

0 comments on commit bce4d79

Please sign in to comment.