style: switch to nixfmt rfc style, format tree

Signed-off-by: Christina Sørensen <christina@cafkafk.com>
This commit is contained in:
Christina Sørensen 2024-09-26 05:28:35 +02:00
parent 27232c4f9b
commit cb15b12984
11 changed files with 121 additions and 122 deletions

View file

@ -9,7 +9,6 @@ updates:
directory: "/" # Location of package manifests
schedule:
interval: "weekly"
- package-ecosystem: "github-actions"
# Workflow files stored in the
# default location of `.github/workflows`

View file

@ -3,20 +3,18 @@ on:
schedule:
- cron: '0 0 * * *'
push:
branches: [ main ]
branches: [main]
paths:
- 'deb.asc'
- '.github/workflows/apt.yml'
pull_request:
branches: [ main ]
branches: [main]
paths:
- 'deb.asc'
- '.github/workflows/apt.yml'
concurrency:
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }}
cancel-in-progress: true
jobs:
apt_installation:
runs-on: ubuntu-latest

View file

@ -1,15 +1,12 @@
name: Conventional Commits
on:
push:
branches: [ main ]
branches: [main]
pull_request:
branches: [ main ]
branches: [main]
concurrency:
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }}
cancel-in-progress: true
jobs:
conventional-commits:
runs-on: ubuntu-latest

View file

@ -1,7 +1,7 @@
on:
workflow_dispatch:
pull_request:
branches: [ main ]
branches: [main]
paths:
- '.github/workflows/flake.yml'
- 'src/**'
@ -20,11 +20,9 @@ on:
- "flake.*"
- "*.nix"
- "*.rs"
concurrency:
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }}
cancel-in-progress: true
jobs:
flake-checker:
name: Flake Checker
@ -33,7 +31,6 @@ jobs:
- uses: actions/checkout@v4
- name: Check Nix flake inputs
uses: DeterminateSystems/flake-checker-action@v9
check:
name: Check Nix Flake
runs-on: ubuntu-22.04
@ -45,10 +42,8 @@ jobs:
uses: DeterminateSystems/magic-nix-cache-action@main
- name: Nix Flake Check
run: nix flake check --all-systems -L
build:
name: Build Nix package
# if cross compilation is desired add 'aarch64-linux', 'x86_64-darwin' and 'aarch64-darwin' and fix the flake to support cross compilation.
strategy:
matrix:

View file

@ -1,13 +1,10 @@
name: No Merge Commits
on:
pull_request:
branches: [ main ]
branches: [main]
concurrency:
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }}
cancel-in-progress: true
jobs:
no-merge-commits:
runs-on: ubuntu-latest

View file

@ -1,50 +1,46 @@
name: Unit tests (BSD)
on:
push:
branches: [ main ]
branches: [main]
paths:
- '.github/workflows/unit-tests-bsd.yml'
- 'src/**'
- 'Cargo.*'
- build.rs
pull_request:
branches: [ main ]
branches: [main]
paths:
- '.github/workflows/unit-tests-bsd.yml'
- 'src/**'
- 'Cargo.*'
- build.rs
concurrency:
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }}
cancel-in-progress: true
jobs:
unit-tests-freebsd:
runs-on: ubuntu-22.04
timeout-minutes: 20
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Compile
uses: vmactions/freebsd-vm@v1
with:
release: '14.1'
usesh: true
prepare: |
pkg install -y rust git
cargo install cargo-hack
git config --global --add safe.directory /home/runner/work/eza/eza
run: |
set -e
export CARGO_TERM_COLOR="always"
export RUSTFLAGS="--deny warnings"
cargo fmt --check
cargo clippy -- -D warnings
cargo hack test
runs-on: ubuntu-22.04
timeout-minutes: 20
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Compile
uses: vmactions/freebsd-vm@v1
with:
release: '14.1'
usesh: true
prepare: |
pkg install -y rust git
cargo install cargo-hack
git config --global --add safe.directory /home/runner/work/eza/eza
run: |
set -e
export CARGO_TERM_COLOR="always"
export RUSTFLAGS="--deny warnings"
cargo fmt --check
cargo clippy -- -D warnings
cargo hack test
unit-tests-netbsd:
runs-on: ubuntu-22.04
timeout-minutes: 20
@ -72,27 +68,26 @@ jobs:
cargo fmt --check
cargo clippy -- -D warnings
cargo hack test
unit-tests-openbsd:
runs-on: ubuntu-22.04
timeout-minutes: 20
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Compile
uses: vmactions/openbsd-vm@v1
with:
release: '7.4'
usesh: true
prepare: |
pkg_add rust rust-rustfmt rust-clippy git
cargo install cargo-hack
git config --global --add safe.directory /home/runner/work/eza/eza
run: |
set -e
export CARGO_TERM_COLOR="always"
export RUSTFLAGS="--deny warnings"
cargo fmt --check
cargo clippy -- -D warnings
cargo hack test
runs-on: ubuntu-22.04
timeout-minutes: 20
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Compile
uses: vmactions/openbsd-vm@v1
with:
release: '7.4'
usesh: true
prepare: |
pkg_add rust rust-rustfmt rust-clippy git
cargo install cargo-hack
git config --global --add safe.directory /home/runner/work/eza/eza
run: |
set -e
export CARGO_TERM_COLOR="always"
export RUSTFLAGS="--deny warnings"
cargo fmt --check
cargo clippy -- -D warnings
cargo hack test

View file

@ -1,59 +1,47 @@
name: Unit tests
on:
push:
branches: [ main ]
branches: [main]
paths:
- '.github/workflows/unit-tests.yml'
- 'src/**'
- 'Cargo.*'
- build.rs
pull_request:
branches: [ main ]
branches: [main]
paths:
- '.github/workflows/unit-tests.yml'
- 'src/**'
- 'Cargo.*'
- build.rs
concurrency:
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }}
cancel-in-progress: true
env:
CARGO_TERM_COLOR: always
RUSTFLAGS: --deny warnings
jobs:
unit-tests:
runs-on: ${{ matrix.os }}
continue-on-error: ${{ matrix.rust == 'nightly' }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
rust: [1.70.0, stable, beta, nightly]
steps:
- name: Checkout repository
uses: actions/checkout@v4
- run: rustup toolchain install ${{ matrix.rust }} --profile minimal
- uses: Swatinem/rust-cache@v2
- name: Install cargo-hack
uses: nick-fields/retry@v3
with:
timeout_minutes: 5
max_attempts: 5
command: cargo install cargo-hack
- name: Run rustfmt checks
run: cargo fmt --check
- name: Run clippy lints
run: cargo clippy -- -D warnings
- name: Run unit tests
run: cargo hack test

View file

@ -1,9 +1,7 @@
name: Publish to Winget
on:
release:
types: [released]
jobs:
publish:
runs-on: ubuntu-latest

View file

@ -32,16 +32,13 @@ perms:
foreground: Red
other_execute:
foreground: Green
filenames:
# Just change the icon glyph
Cargo.toml: {icon: {glyph: 🦀}}
Cargo.lock: {icon: {glyph: 🦀}}
extensions:
# Change the filename color and icon
# NOTE: not all unicode glyphs support color changes
rs: {filename: {foreground: Red}, icon: {glyph: 🦀}}
# Change the icon glyph and color
nix: {icon: {glyph: ❄, style: {foreground: White}}}

View file

@ -4,15 +4,13 @@ binary: eza
gen_binary: target/debug/eza
args: tests/test_dir
commands:
# Meta options
? - null
? - null # Meta options
- --help
:
? - -v
- --version
:
# Display Options
? - -1
? - -1 # Display Options
- --oneline
:
? - -l
@ -65,8 +63,10 @@ commands:
- never
? - null
- --no-quotes
:
? - null
- --hyperlink
:
? - null
- --absolute
: values:
@ -81,14 +81,16 @@ commands:
- 200
? - null
- --smart-group
# Filtering and Sorting Options
? - -a
:
? - -a # Filtering and Sorting Options
- --all
:
? - -A
- --almost-all
:
? - -d
- --list-dirs
:
? - -L
- --level
: prefix: --tree
@ -100,6 +102,7 @@ commands:
- 5
? - -r
- --reverse
:
? - -s
- --sort
: short: -s
@ -129,42 +132,54 @@ commands:
- type
? - null
- --group-directories-first
:
? - -D
- --only-dirs
:
? - -f
- --only-files
:
? - -f
- --only-files
? # TODO: add more globs
- -I
:
? - -I # TODO: add more globs
- --ignore-glob
: prefix: -l
values:
- "*.toml"
? - null
- --git-ignore
# Long View Options
? - -b
:
? - -b # Long View Options
- --binary
:
? - -B
- --bytes
:
? - -g
- --group
:
? - -h
- --header
:
? - -H
- --links
:
? - -i
- --inode
:
? - -m
- --modified
:
? - -M
- --mounts
:
? - -n
- --numeric
:
? - -S
- --blocksize
:
? - -t
- --time
: prefix: -l
@ -175,10 +190,13 @@ commands:
#- created
? - -u
- --accessed
:
? - -U
- --created
:
? - null
- --changed
:
? - null
- --time-style
: long: time-style
@ -190,21 +208,31 @@ commands:
- relative
? - null
- --total-size
:
? - null
- --no-permissions
:
? - -o
- --octal-permissions
:
? - null
- --no-filesize
:
? - null
- --no-user
:
? - null
- --git
:
? - null
- --no-git
:
? - null
- --git-repos
:
? - -@
- --extended
:
? - -Z
- --context
:

View file

@ -1,7 +1,7 @@
{
projectRootFile = "Cargo.toml";
programs = {
alejandra.enable = true; # nix
nixfmt.enable = true; # nix
statix.enable = true; # nix static analysis
deadnix.enable = true; # find dead nix code
rustfmt.enable = true; # rust
@ -11,10 +11,17 @@
};
settings = {
formatter = {
shellcheck.includes = ["*.sh" "./completions/bash/eza"];
rustfmt.excludes = ["src/options/flags.rs"];
taplo.excludes = ["tests/ptests/*.toml"];
yamlfmt.excludes = ["./powertest.yaml"];
shellcheck = {
includes = [
"*.sh"
"./completions/bash/eza"
];
excludes = [ ".envrc" ];
};
rustfmt.excludes = [ "src/options/flags.rs" ];
taplo.excludes = [ "tests/ptests/*.toml" ];
yamlfmt.excludes = [ "./powertest.yaml" ];
};
};
}