Make levenshtein distance case insensitive.
When typing in a single character shortcut as a capital, it always
returns `b` as the suggestion as every one-letter abbreviation
is a lev distance 1 away from the capitalized one.
By making the levenshtein distance case insensitive, the case-mismatched
one-letter abbriviation (e.g. `C` to `c`) will be suggested, rather
than `b`
When typing in a single character shortcut as a capital, it always
returns `b` as the suggestion as every one-letter abbreviation
is a lev distance 1 away from the capitalized one.
By making the levenshtein distance case insensitive, the case-mismatched
one-letter abbriviation (e.g. `C` to `c`) will be suggested, rather
than `b`
[docs] Adds basic CI yaml for GitHub Actions
Currently there is no documentation for GitHub Actions, so I have attempted to add an Actions Workflow that is equivalent to the other CI snippets in the file. You can view a successful run of this Action in my repo for experimenting with this here: https://github.com/SamMorrowDrums/rust-action-test/actions/runs/1593666172
The Rust code I tested it with is just the boilerplate from `cargo init`.
Add function for parsing already-read manifest
This makes the function formerly known as `do_read_manifest` public
under the name `read_manifest_from_str` so that Cargo-as-a-library users
can parse a manifest without re-reading a `Cargo.toml` file they have
already read from disk themselves.
This makes the function formerly known as `do_read_manifest` public
under the name `read_manifest_from_str` so that Cargo-as-a-library users
can parse a manifest without re-reading a `Cargo.toml` file they have
already read from disk themselves.
Detect filesystem loop during walking the projects
Resolves#9528
~~This PR also adds a new dependency `same-file` but since it's already a
dependency of `cargo-util`, so nothing added actually.~~
Use `walkdir` to detect filesystem loop and gain performance boost!
Don't document libs with doc=false
The `doc=false` setting was not being checked in the `[lib]` table when determining dependencies to document. This changes it so that that setting is honored.
Support `term.quiet` configuration
Fixes#10128
This follows the existing support for `--verbose` and `term.verbose`.
I've renamed the related tests to be a bit clearer now there are more cases, and the existing quiet tests now prove that they hide the cargo log.
I'm unsure whether I'm supposed to regenerate the documentation as part of this?
Display alias target on 'cargo help <alias>`
```
Previously, `cargo help <alias>` resolved the alias and displayed the
help for the targeted subcommand. For example, if `br` were aliased to
`build --release`, `cargo help br` would display the manpage for
cargo-build.
With this patch, it will print "'br' is aliased to 'build --release'".
```
Addresses issue #10138.
This is my first patch to Cargo. I attempted to follow the style of the surrounding code. Please let me know if any changes are required: happy to make them. In particular, I wasn't sure if any tests exist for this path.
delete --host command and message
close https://github.com/rust-lang/cargo/issues/10121
The warning for this command has been around for a long time, and it seems safe to delete it now.
According to Alex's words in the issue, I think he supports deletion. I'm sorry if I misunderstood it and feel free to close it.
Improve I/O error message for fingerprint of build script
It is a bit rough but I don't think there is a network I/O error
in `pkg_fingerprint`. Checking only `io::Error` type should be fine.
Resolves#9881
Explicitly mark aliases in `cargo list`.
This I think makes it a little clearer that these are aliases, and matches the form used for built-in aliases.
Don't emit "executable" JSON field for non-executables.
The "executable" field of JSON artifact messages was accidentally filled (with the path to `index.html`) when documenting a binary target. This fixes it so that it is null.
Closes#10149
Fix some profile documentation.
The `test` and `bench` sections had wrong information about which profile is used. This also has some changes to try to format and clarify selection a little.
Document lib before bin.
This changes it so that documenting a library is required to finish before documenting a binary. The issue is that the binary may have intra-doc links to the library. If they are documented concurrently, then the links will sometimes fail (since it is a race). Or, if doing `cargo doc --bins`, then the library docs wouldn't exist at all.
Note that in the tests this introduces some more name collisions if you just run `cargo doc --bins` and there is a colliding library/binary name. There is some risk that someone might be trying to run the commands separately to get around the collision error, but I think it is unlikely.
Sync cargo-the-cli version with rustc.
People occasionally get confused when cargo's version does not match the version of rustc. This happens in a variety of scenarios:
* Point releases.
* Beta releases (cargo is missing the .1 .2, etc.)
* Nightly releases when cargo's version has not yet been bumped.
This changes it so that cargo-the-cli will always report the same version as rustc (assuming they were built with rustbuild). The git information remains the same (reports cargo's last commit sha).
Closes#10122