mirror of
https://github.com/uutils/coreutils.git
synced 2026-06-10 15:48:22 -07:00
chore: run pre-commit on all files (#10119)
This commit is contained in:
@@ -59,4 +59,4 @@ jobs:
|
||||
issue_number: issue_number,
|
||||
body: 'GNU testsuite comparison:\n```\n' + content + '```'
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,4 +3,3 @@ MD013: false
|
||||
# Disable 'Fenced code blocks should have a language specified'
|
||||
# Doesn't provide much in src/ to enforce it
|
||||
MD040: false
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ repos:
|
||||
- id: check-added-large-files
|
||||
- id: check-executables-have-shebangs
|
||||
- id: check-json
|
||||
exclude: '.vscode/cSpell\.json' # cSpell.json uses comments
|
||||
exclude: '\.vscode/(cSpell|extensions)\.json' # cSpell.json and extensions.json use comments
|
||||
- id: check-shebang-scripts-are-executable
|
||||
exclude: '.+\.rs' # would be triggered by #![some_attribute]
|
||||
- id: check-symlinks
|
||||
|
||||
Vendored
+2
-2
@@ -1,8 +1,8 @@
|
||||
// spell-checker:ignore (misc) matklad foxundermoon
|
||||
// spell-checker:ignore (misc) foxundermoon
|
||||
// see <http://go.microsoft.com/fwlink/?LinkId=827846> for the documentation about the extensions.json format
|
||||
// *
|
||||
// "foxundermoon.shell-format" ~ shell script formatting ; note: ENABLE "Use EditorConfig"
|
||||
// "matklad.rust-analyzer" ~ `rust` language support
|
||||
// "rust-lang.rust-analyzer" ~ `rust` language support
|
||||
// "streetsidesoftware.code-spell-checker" ~ `cspell` spell-checker support
|
||||
{
|
||||
"recommendations": [
|
||||
|
||||
@@ -119,7 +119,7 @@ cargo build --release --features windows
|
||||
cargo build --release --features unix
|
||||
```
|
||||
|
||||
To build SELinux-specific features, including `chcon` and `runcon`, ensure that `libselinux`
|
||||
To build SELinux-specific features, including `chcon` and `runcon`, ensure that `libselinux`
|
||||
and `libclang` are installed on your system. Then, run the following command:
|
||||
```
|
||||
cargo build --release --features unix,feat_selinux
|
||||
|
||||
@@ -28,4 +28,3 @@ uutils coreutils is a cross-platform reimplementation of the GNU coreutils in
|
||||
[Rust](http://www.rust-lang.org).
|
||||
|
||||
This package does not have its specific `README.md`.
|
||||
|
||||
|
||||
+1
-1
@@ -2,4 +2,4 @@ book
|
||||
src/utils
|
||||
src/SUMMARY.md
|
||||
src/platform_table.md
|
||||
tldr.zip
|
||||
tldr.zip
|
||||
|
||||
Regular → Executable
@@ -43,4 +43,4 @@
|
||||
}
|
||||
.counts {
|
||||
margin-right: 10px;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,4 +4,3 @@ dirname-after-help = Afficher chaque NOM avec son dernier composant non-slash et
|
||||
supprimés ; si NOM ne contient pas de '/', afficher '.' (signifiant le répertoire courant).
|
||||
dirname-missing-operand = opérande manquant
|
||||
dirname-zero-help = séparer la sortie avec NUL plutôt qu'avec un saut de ligne
|
||||
|
||||
|
||||
@@ -58,4 +58,3 @@ With Cargo Flamegraph you can easily make a flamegraph of `rm`:
|
||||
```shell
|
||||
cargo flamegraph --cmd coreutils -- rm [additional parameters]
|
||||
```
|
||||
|
||||
|
||||
@@ -12,4 +12,3 @@ sleep-error-missing-operand = opérande manquant
|
||||
|
||||
# Messages d'aide
|
||||
sleep-help-number = faire une pause de NOMBRE secondes
|
||||
|
||||
|
||||
@@ -63,4 +63,3 @@ hyperfine 'tr -d aeiou < mixed_input > /dev/null' './target/release/tr -d aeiou
|
||||
- Uses lookup tables instead of hash maps for O(1) operations
|
||||
- 32KB I/O buffers for improved throughput
|
||||
- Should be competitive with GNU `tr` for most operations
|
||||
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
# Benchmarking `tsort`
|
||||
<!-- spell-checker:ignore (words) randint tsort DAG uu_tsort GNU -->
|
||||
Much of what makes `tsort` fast is the efficiency of its algorithm and implementation for topological sorting.
|
||||
Our implementation of `tsort` also outputs a cycle whenever such ordering does not exist, just like GNU `tsort`.
|
||||
Much of what makes `tsort` fast is the efficiency of its algorithm and implementation for topological sorting.
|
||||
Our implementation of `tsort` also outputs a cycle whenever such ordering does not exist, just like GNU `tsort`.
|
||||
|
||||
## Strategies
|
||||
|
||||
To test `tsort`'s performance for its nominal use case, we need to test it with a DAG. One of the worst cases is when all nodes are just representing a succession of independent steps.
|
||||
We should also test cycle detection for good measure.
|
||||
To test `tsort`'s performance for its nominal use case, we need to test it with a DAG. One of the worst cases is when all nodes are just representing a succession of independent steps.
|
||||
We should also test cycle detection for good measure.
|
||||
|
||||
### Random acyclic graph (DAG)
|
||||
|
||||
@@ -25,16 +25,16 @@ for i in range(100*N):
|
||||
|
||||
### Random graph with cycles
|
||||
|
||||
The following will output a graph with multiples edges, it also allows some degree of tuning to test different cases.
|
||||
The following will output a graph with multiples edges, it also allows some degree of tuning to test different cases.
|
||||
|
||||
```python
|
||||
import random
|
||||
|
||||
# Parameters for the graph
|
||||
num_nodes = 100
|
||||
num_edges = 150
|
||||
cycle_percentage = 0.10
|
||||
max_cycle_size = 6
|
||||
num_nodes = 100
|
||||
num_edges = 150
|
||||
cycle_percentage = 0.10
|
||||
max_cycle_size = 6
|
||||
|
||||
num_cycles = int(num_edges * cycle_percentage)
|
||||
|
||||
@@ -52,7 +52,7 @@ for _ in range(num_cycles):
|
||||
```
|
||||
|
||||
## Running Benchmarks
|
||||
The above scripts will output the generated graphs to the standard output. They can therefore be used directly as tests. In order to run a Benchmark, the output should be redirected to a file.
|
||||
The above scripts will output the generated graphs to the standard output. They can therefore be used directly as tests. In order to run a Benchmark, the output should be redirected to a file.
|
||||
Use [`hyperfine`](https://github.com/sharkdp/hyperfine) to compare the performance of different `tsort` versions. For example, you can compare the performance of GNU `tsort` and another implementation with the following command:
|
||||
|
||||
```sh
|
||||
|
||||
@@ -1 +1 @@
|
||||
* -text diff
|
||||
* -text diff
|
||||
|
||||
Regular → Executable
Regular → Executable
Regular → Executable
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user