Conversation
There was a problem hiding this comment.
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
lislibrary (Lis,Entry, Git status support) plus a new CLI binary atcli/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 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}; |
| if reverse { cmp.reverse() } else { cmp } | ||
| }); | ||
| } | ||
|
|
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 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!(); | ||
| } |
| } else { | ||
| " " | ||
| } | ||
| } |
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"] } | ||
|
|
| csv = "1.3" | ||
| terminal_size = "0.4" | ||
| unicode-width = "0.2" | ||
| colored = "2.1" |
…fic imports in entry.rs
Coverage Report for CI Build 25584588814Coverage increased (+66.7%) to 66.667%Details
Uncovered Changes
Coverage RegressionsNo coverage regressions found. Coverage Stats
💛 - Coveralls |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implement by gemini.