Skip to content

Gemini#13

Open
tamada wants to merge 14 commits intomainfrom
gemini
Open

Gemini#13
tamada wants to merge 14 commits intomainfrom
gemini

Conversation

@tamada
Copy link
Copy Markdown
Owner

@tamada tamada commented May 8, 2026

Implement by gemini.

@tamada tamada added this to the v1.0.0 milestone May 8, 2026
@tamada tamada requested a review from Copilot May 8, 2026 23:11
@tamada tamada self-assigned this May 8, 2026
@tamada tamada added the enhancement New feature or request label May 8, 2026
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR turns lis into a usable library + CLI for listing directory entries, adding Git-status integration, sorting, multiple output formats, and updated docs/examples.

Changes:

  • Added a new lis library (Lis, Entry, Git status support) plus a new CLI binary at cli/main.rs.
  • Added CLI display + argument parsing with support for long/plain output, formats (csv/json/yaml), icons, sorting, and recursion.
  • Added documentation (README + CLI README), examples, and basic unit/integration tests.

Reviewed changes

Copilot reviewed 15 out of 15 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
tests/integration_test.rs Adds integration tests around listing behavior (current dir, src, recursive).
src/main.rs Removes the placeholder binary entry point.
src/lib.rs Introduces the Lis library API and directory walking logic.
src/git.rs Adds Git status collection via git2.
src/entry.rs Defines Entry metadata + sorting utilities and some unit tests.
README.md Documents library + CLI capabilities and basic usage.
examples/basic.rs Adds a minimal library usage example.
examples/complex.rs Adds an advanced example (recursive + sorting).
cli/README.md Adds CLI usage docs and examples.
cli/main.rs Implements the CLI entry point, formatting selection, and CSV/JSON/YAML output.
cli/display.rs Implements plain/column/long display, LS_COLORS styling, and icons.
cli/args.rs Implements CLI argument parsing and tests for defaults/custom parsing.
Cargo.toml Adds dependencies and defines the lis binary at cli/main.rs.
.github/workflows/update-version.yaml Updates the checkout action version used in the version update workflow.
.github/workflows/publish.yaml Adds inline documentation comments and updates the checkout action version in the publish workflow.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/entry.rs
Comment on lines +1 to +7
use chrono::{DateTime, Local};
use clap::ValueEnum;
use nix::sys::stat::Mode;
use serde::{Deserialize, Serialize};
use std::fs;
use std::os::unix::fs::{MetadataExt, PermissionsExt};
use std::path::{Path, PathBuf};
Comment thread src/entry.rs
if reverse { cmp.reverse() } else { cmp }
});
}

Comment thread src/lib.rs
Comment on lines +83 to +88
let abs_path = fs::canonicalize(path).unwrap_or_else(|_| path.to_path_buf());
let git_status = git_statuses
.get(&abs_path)
.cloned()
.unwrap_or_else(|| " ".to_string());

Comment thread cli/display.rs
Comment on lines +62 to +74
fn print_columns(names: &[String], max_width: usize, term_width: usize) {
let cols = (term_width / max_width).max(1);
let rows = (names.len() as f64 / cols as f64).ceil() as usize;

for r in 0..rows {
for c in 0..cols {
let i = c * rows + r;
if i < names.len() {
print!("{:<width$}", names[i], width = max_width);
}
}
println!();
}
Comment thread src/git.rs
} else {
" "
}
}
Comment thread Cargo.toml
Comment on lines +7 to +22
clap = { version = "4.5", features = ["derive"] }
chrono = "0.4"
humansize = "2.1"
uzers = "0.12"
git2 = "0.19"
ignore = "0.4"
lscolors = "0.19"
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
serde_yaml = "0.9"
csv = "1.3"
terminal_size = "0.4"
unicode-width = "0.2"
colored = "2.1"
nix = { version = "0.29", features = ["fs", "user"] }

Comment thread Cargo.toml
csv = "1.3"
terminal_size = "0.4"
unicode-width = "0.2"
colored = "2.1"
@coveralls
Copy link
Copy Markdown

Coverage Report for CI Build 25584588814

Coverage increased (+66.7%) to 66.667%

Details

  • Coverage increased (+66.7%) from the base build.
  • Patch coverage: 127 uncovered changes across 5 files (254 of 381 lines covered, 66.67%).
  • No coverage regressions found.

Uncovered Changes

File Changed Covered %
cli/display.rs 96 21 21.88%
cli/main.rs 29 0 0.0%
src/git.rs 30 10 33.33%
src/entry.rs 120 118 98.33%
src/lib.rs 82 81 98.78%

Coverage Regressions

No coverage regressions found.


Coverage Stats

Coverage Status
Relevant Lines: 381
Covered Lines: 254
Line Coverage: 66.67%
Coverage Strength: 7.63 hits per line

💛 - Coveralls

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants