diff --git a/.editorconfig b/.editorconfig index 5ffbbb1..ec7dee8 100644 --- a/.editorconfig +++ b/.editorconfig @@ -1,25 +1,17 @@ root = true [*] -indent_style = space +indent_style = tab indent_size = 4 end_of_line = lf charset = utf-8 trim_trailing_whitespace = true insert_final_newline = true -[lib/**/*.rs] -indent_style = tab - -[*.toml] -indent_size = 2 - -[*.yml] -indent_size = 2 - -[*.wat] -indent_size = 2 - -[*.md] +[*.{md,ronn}] +indent_style = space +indent_size = 4 + +[*.{cff,yml}] +indent_size = 2 indent_style = space -indent_size = 3 diff --git a/lib/.rustfmt.toml b/.rustfmt.toml similarity index 100% rename from lib/.rustfmt.toml rename to .rustfmt.toml diff --git a/Cargo.toml b/Cargo.toml index 337cf2a..6c45d62 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,7 +1,7 @@ [workspace] members = [ - "lib", - "cli", + "lib", + "cli", ] [profile.release] diff --git a/bin/sign b/bin/sign index ba8f587..6bb51ca 100755 --- a/bin/sign +++ b/bin/sign @@ -3,42 +3,41 @@ set -euo pipefail if ! which rsign >/dev/null; then - echo "Requires rsign2 tool: $ cargo install rsign2" - exit 2 + echo "Requires rsign2 tool: $ cargo install rsign2" + exit 2 fi missing="" for f in {B3,SHA512}SUMS{,.auto.minisig}; do - [[ ! -f "$f" ]] && missing="$missing $f" + [[ ! -f "$f" ]] && missing="$missing $f" done if [[ ! -z "$missing" ]]; then - echo "Usage: bin/sign [rsign options...]" - echo "You must first download the relevant sums and minisig files." - echo "Missing: $missing" - exit 1 + echo "Usage: bin/sign [rsign options...]" + echo "You must first download the relevant sums and minisig files." + echo "Missing: $missing" + exit 1 fi sigs="" for algo in B3 SHA512; do + echo "Verifying ${algo}SUMS.auto.minisig:" + rsign verify \ + -p "$(dirname $BASH_SOURCE)/../.github/workflows/release.pub" \ + -x "${algo}SUMS.auto.minisig" \ + "${algo}SUMS" - echo "Verifying ${algo}SUMS.auto.minisig:" - rsign verify \ - -p "$(dirname $BASH_SOURCE)/../.github/workflows/release.pub" \ - -x "${algo}SUMS.auto.minisig" \ - "${algo}SUMS" + version=$(grep -m1 -oP 'watchexec-[\d.]+' "${algo}SUMS" | cut -d- -f3) + ownsig="${algo}SUMS.$(whoami).minisig" + sigs="$sigs $ownsig" - version=$(grep -m1 -oP 'watchexec-[\d.]+' "${algo}SUMS" | cut -d- -f3) - ownsig="${algo}SUMS.$(whoami).minisig" - sigs="$sigs $ownsig" - - echo "Signing ${algo}SUMS with your key to $ownsig:" - rsign sign \ - -t "watchexec $version signed by maintainer: $(whoami)" \ - -c 'see README.md for signing information' \ - -x "$ownsig" \ - $@ \ - "${algo}SUMS" + echo "Signing ${algo}SUMS with your key to $ownsig:" + rsign sign \ + -t "watchexec $version signed by maintainer: $(whoami)" \ + -c 'see README.md for signing information' \ + -x "$ownsig" \ + $@ \ + "${algo}SUMS" done echo "Done; please upload $sigs to Github release $version!" diff --git a/cli/build.rs b/cli/build.rs index 52f8762..f1699a9 100644 --- a/cli/build.rs +++ b/cli/build.rs @@ -1,3 +1,3 @@ fn main() { - embed_resource::compile("watchexec-manifest.rc"); + embed_resource::compile("watchexec-manifest.rc"); } diff --git a/cli/tests/help.rs b/cli/tests/help.rs index 6e2463e..aacd67a 100644 --- a/cli/tests/help.rs +++ b/cli/tests/help.rs @@ -5,20 +5,20 @@ use insta::assert_snapshot; #[test] fn help() { - let output = Command::cargo_bin("watchexec") - .unwrap() - .arg("--help") - .output() - .unwrap(); + let output = Command::cargo_bin("watchexec") + .unwrap() + .arg("--help") + .output() + .unwrap(); - assert!(output.status.success(), "--help returns 0"); - assert_eq!(output.stderr, Vec::::new(), "--help stderr is empty"); - assert_snapshot!( - if cfg!(windows) { - "help_windows" - } else { - "help_unix" - }, - String::from_utf8(output.stdout).unwrap() - ); + assert!(output.status.success(), "--help returns 0"); + assert_eq!(output.stderr, Vec::::new(), "--help stderr is empty"); + assert_snapshot!( + if cfg!(windows) { + "help_windows" + } else { + "help_unix" + }, + String::from_utf8(output.stdout).unwrap() + ); } diff --git a/cli/watchexec.exe.manifest b/cli/watchexec.exe.manifest index 530a6ce..802b600 100644 --- a/cli/watchexec.exe.manifest +++ b/cli/watchexec.exe.manifest @@ -1,41 +1,41 @@ - + - - - - - - - - + + + + + + + + - - - - - - - - - - + + + + + + + + + + - - - true - UTF-8 - SegmentHeap - - + + + true + UTF-8 + SegmentHeap + + diff --git a/completions/zsh b/completions/zsh index d72113d..71afc80 100644 --- a/completions/zsh +++ b/completions/zsh @@ -9,31 +9,31 @@ local -a _comp_priv_prefix cmd="$words[1]" args=( - '(-c --clear)'{-c,--clear}'[Clear screen before executing command]' - '(-h --help)'{-h,--help}'[Prints help information]' - '--shell=[Change the wrapping shell, or set to none to disable]' - '--no-shell[Deprecated, use --shell=none]' - '-n[Shorthand for --shell=none]' - '--no-environment[Do not set WATCHEXEC_*_PATH environment variables for command]' - '--no-meta[Ignore metadata changes]' - '(-p --postpone)'{-p,--postpone}'[Wait until first change to execute command]' - '(-r --restart)'{-r,--restart}'[Restart the process if it''s still running]' - '(-W --watch-when-idle)'{-W,--watch-when-idle}'[Ignore events while the command is still running]' - '(-V --version)'{-V,--version}'[Prints version information]' - '(-v --verbose)'{-v,--verbose}'[Print debugging messages to stderr]' - '--changes-only[Print changed paths to stderr for pattern debugging]' - '(-d --debounce)'{-d+,--debounce=}'[Set the timeout between detected change and command execution, defaults to 100ms]:milliseconds' - '(-e --exts)'{-e+,--exts=}'[Comma-separated list of file extensions to watch (js,css,html)]:extensions' - '(-f --filter)'{-f+,--filter=}'[Ignore all modifications except those matching the pattern]:pattern' - '(-i --ignore)'{-i+,--ignore=}'[Ignore modifications to paths matching the pattern]:pattern' - '(-w --watch)'{-w+,--watch=}'[Watch a specific directory]:path:_path_files -/' - '(-s --signal)'{-s+,--signal=}'[Send signal to process upon changes, e.g. SIGHUP]:signal' - '--force-poll=[Forces polling mode]:interval' - '--no-ignore[Skip auto-loading of ignore files (.gitignore, .ignore, etc.) for filtering]' - '--no-default-ignore[Skip auto-ignoring of commonly ignored globs]' - '--no-vcs-ignore[Skip auto-loading of .gitignore files for filtering]' - '(-)1:command: _command_names -e' - '*::arguments:{ _comp_priv_prefix=( $cmd -n ${(kv)opt_args[-u]} ) ; _normal }' + '(-c --clear)'{-c,--clear}'[Clear screen before executing command]' + '(-h --help)'{-h,--help}'[Prints help information]' + '--shell=[Change the wrapping shell, or set to none to disable]' + '--no-shell[Deprecated, use --shell=none]' + '-n[Shorthand for --shell=none]' + '--no-environment[Do not set WATCHEXEC_*_PATH environment variables for command]' + '--no-meta[Ignore metadata changes]' + '(-p --postpone)'{-p,--postpone}'[Wait until first change to execute command]' + '(-r --restart)'{-r,--restart}'[Restart the process if it''s still running]' + '(-W --watch-when-idle)'{-W,--watch-when-idle}'[Ignore events while the command is still running]' + '(-V --version)'{-V,--version}'[Prints version information]' + '(-v --verbose)'{-v,--verbose}'[Print debugging messages to stderr]' + '--changes-only[Print changed paths to stderr for pattern debugging]' + '(-d --debounce)'{-d+,--debounce=}'[Set the timeout between detected change and command execution, defaults to 100ms]:milliseconds' + '(-e --exts)'{-e+,--exts=}'[Comma-separated list of file extensions to watch (js,css,html)]:extensions' + '(-f --filter)'{-f+,--filter=}'[Ignore all modifications except those matching the pattern]:pattern' + '(-i --ignore)'{-i+,--ignore=}'[Ignore modifications to paths matching the pattern]:pattern' + '(-w --watch)'{-w+,--watch=}'[Watch a specific directory]:path:_path_files -/' + '(-s --signal)'{-s+,--signal=}'[Send signal to process upon changes, e.g. SIGHUP]:signal' + '--force-poll=[Forces polling mode]:interval' + '--no-ignore[Skip auto-loading of ignore files (.gitignore, .ignore, etc.) for filtering]' + '--no-default-ignore[Skip auto-ignoring of commonly ignored globs]' + '--no-vcs-ignore[Skip auto-loading of .gitignore files for filtering]' + '(-)1:command: _command_names -e' + '*::arguments:{ _comp_priv_prefix=( $cmd -n ${(kv)opt_args[-u]} ) ; _normal }' ) _arguments -s -S $args