XAMPPRocky / tokei

Count your code, quickly.
Other
11.35k stars 542 forks source link

Build warnings #1141

Open qtfkwk opened 3 months ago

qtfkwk commented 3 months ago
warning: method `is_not_line_ending_whitespace` is never used
 --> src/utils/ext.rs:5:8
  |
3 | pub(crate) trait AsciiExt {
  |                  -------- method in this trait
4 |     fn is_whitespace(&self) -> bool;
5 |     fn is_not_line_ending_whitespace(&self) -> bool;
  |        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  |
  = note: `#[warn(dead_code)]` on by default

warning: constant `FALLBACK_ROW_LEN` is never used
 --> src/consts.rs:3:11
  |
3 | pub const FALLBACK_ROW_LEN: usize = 81;
  |           ^^^^^^^^^^^^^^^^

warning: constant `LANGUAGE_COLUMN_WIDTH` is never used
 --> src/consts.rs:6:11
  |
6 | pub const LANGUAGE_COLUMN_WIDTH: usize = 10;
  |           ^^^^^^^^^^^^^^^^^^^^^

warning: constant `PATH_COLUMN_WIDTH` is never used
 --> src/consts.rs:7:11
  |
7 | pub const PATH_COLUMN_WIDTH: usize = 80;
  |           ^^^^^^^^^^^^^^^^^

warning: constant `FILES_COLUMN_WIDTH` is never used
 --> src/consts.rs:8:11
  |
8 | pub const FILES_COLUMN_WIDTH: usize = 8;
  |           ^^^^^^^^^^^^^^^^^^

warning: `tokei` (lib) generated 5 warnings
warning: field `verbose` is never read
  --> src/cli.rs:55:9
   |
38 | pub struct Cli {
   |            --- field in this struct
...
55 |     pub verbose: u64,
   |         ^^^^^^^
   |
   = note: `Cli` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis
   = note: `#[warn(dead_code)]` on by default

warning: associated function `all` is never used
   --> src/cli_utils.rs:114:12
    |
104 | impl NumberFormatStyle {
    | ---------------------- associated function in this implementation
...
114 |     pub fn all() -> &'static [&'static str] {
    |            ^^^

warning: `tokei` (bin "tokei") generated 2 warnings

Originally posted by @0323pin in https://github.com/XAMPPRocky/tokei/issues/1138#issuecomment-2299339915

qtfkwk commented 3 months ago

Summary of fixes:

qtfkwk commented 3 months ago

PR: https://github.com/XAMPPRocky/tokei/pull/1142

qtfkwk commented 3 months ago
  • Added empty json feature and included in all

Had to roll back the first item due to that fix causing build issues in checks.

AFAICT prior recent releases v13.0.0-alpha{1,2} also produced these warnings so it is not related to #1137, #1138, or subsequent PRs.

Unsure if/how @XAMPPRocky et al want to address those?

qtfkwk commented 3 months ago

Just realized @0323pin's build warnings do not include the following, which is also observed, and my reason for trying to add a json feature.

Pending release of v13.0.0-alpha.4, this issue can be closed, and this build warning (really there are 9 of these, but this is the first one) can be addressed in a new issue.

warning: unexpected `cfg` condition value: `json`
   --> src/input.rs:24:23
    |
24  |                   #[cfg(feature = $feature)] extern crate $krate;
    |                         ^^^^^^^^^^^^^^^^^^
...
149 | / supported_formats!(
150 | |     (cbor, "cbor", Cbor [serde_cbor, hex]) =>
151 | |         |input| {
152 | |             hex::FromHex::from_hex(input)
...   |
164 | |         serde_yaml::to_string,
165 | | );
    | |_- in this macro invocation
    |
    = note: expected values for `feature` are: `all`, `cbor`, `default`, `hex`, `serde_cbor`, `serde_yaml`, and `yaml`
    = help: consider adding `json` as a feature in `Cargo.toml`
    = note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg/cargo-specifics.html> for more information about checking conditional configuration
    = note: `#[warn(unexpected_cfgs)]` on by default
    = note: this warning originates in the macro `supported_formats` (in Nightly builds, run with -Z macro-backtrace for more info)
0323pin commented 3 months ago

I think this can be closed now. Built alpha5 a few hours ago without any of these.

Actually, merged the update into the main branch

Just curious ... when should we expect a "real" release?

XAMPPRocky commented 3 months ago

Just curious ... when should we expect a "real" release?

When I've decided it is ready, I'd kindly remind you that this is a project maintained by me in my spare time, on top of a job and other projects as well having a life outside of programming. Unless I'm paid directly to maintain and regularly release new versions, don't "expect" a release, it will arrive when it means to.

0323pin commented 3 months ago

@XAMPPRocky I didn't mean it like that. Believe me, I'm maintaining a large number of packages for NetBSD (among which, this one) on my free time so, I know the feeling.