From 6606408ce964a632db04cfba01b181206a2b0c36 Mon Sep 17 00:00:00 2001 From: Roy Ivy III Date: Sun, 10 May 2020 21:14:58 -0500 Subject: [PATCH] refactor/polish ~ whitespace normalization (consistent indentation [either tabs *or* spaces], EOF EOLNs, no trailing whitespace) --- .gitignore | 2 +- Cargo.toml | 284 +++++++++--------- GNUmakefile | 188 ++++++------ Makefile.toml | 30 +- docs/GNUmakefile | 2 +- docs/make.bat | 20 +- src/uu/cut/.gitignore | 2 +- src/uu/expr/src/expr.rs | 8 +- src/uu/numfmt/src/numfmt.rs | 8 +- .../src/tokenize/num_format/num_format.rs | 2 +- 10 files changed, 273 insertions(+), 273 deletions(-) diff --git a/.gitignore b/.gitignore index 3eabba702..b1ac52506 100644 --- a/.gitignore +++ b/.gitignore @@ -11,4 +11,4 @@ target/ .idea Cargo.lock lib*.a -/docs/_build \ No newline at end of file +/docs/_build diff --git a/Cargo.toml b/Cargo.toml index 428c48bfe..bc1eeb23c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -24,109 +24,109 @@ test_unimplemented = [] ## (common/core and Tier1) feature sets # "feat_common_core" == baseline core set of utilities which can be built/run on most targets feat_common_core = [ - "base32", - "base64", - "basename", - "cat", - "cksum", - "comm", - "cp", - "cut", - "date", - "df", - "dircolors", - "dirname", - "echo", - "env", - "expand", - "expr", - "factor", - "false", - "fmt", - "fold", - "hashsum", - "head", - "join", - "link", - "ln", - "ls", - "mkdir", - "mktemp", - "more", - "mv", - "nl", - "od", - "paste", - "printenv", - "printf", - "ptx", - "pwd", - "readlink", - "realpath", - "relpath", - "rm", - "rmdir", - "seq", - "shred", - "shuf", - "sleep", - "sort", - "split", - "sum", - "tac", - "tail", - "tee", - "test", - "tr", - "true", - "truncate", - "tsort", - "unexpand", - "uniq", - "wc", - "yes", + "base32", + "base64", + "basename", + "cat", + "cksum", + "comm", + "cp", + "cut", + "date", + "df", + "dircolors", + "dirname", + "echo", + "env", + "expand", + "expr", + "factor", + "false", + "fmt", + "fold", + "hashsum", + "head", + "join", + "link", + "ln", + "ls", + "mkdir", + "mktemp", + "more", + "mv", + "nl", + "od", + "paste", + "printenv", + "printf", + "ptx", + "pwd", + "readlink", + "realpath", + "relpath", + "rm", + "rmdir", + "seq", + "shred", + "shuf", + "sleep", + "sort", + "split", + "sum", + "tac", + "tail", + "tee", + "test", + "tr", + "true", + "truncate", + "tsort", + "unexpand", + "uniq", + "wc", + "yes", ] # "feat_Tier1" == expanded set of utilities which can be built/run on the usual rust "Tier 1" target platforms (ref: ) feat_Tier1 = [ - "feat_common_core", - # - "arch", - "hostname", - "nproc", - "sync", - "touch", - "whoami", + "feat_common_core", + # + "arch", + "hostname", + "nproc", + "sync", + "touch", + "whoami", ] ## (primary platforms) feature sets # "feat_os_macos" == set of utilities which can be built/run on the MacOS platform feat_os_macos = [ - "feat_os_unix", ## == a modern/usual *nix platform + "feat_os_unix", ## == a modern/usual *nix platform ] # "feat_os_unix" == set of utilities which can be built/run on modern/usual *nix platforms feat_os_unix = [ - "feat_Tier1", - # - "feat_require_crate_cpp", - "feat_require_unix", - "feat_require_unix_utmpx", + "feat_Tier1", + # + "feat_require_crate_cpp", + "feat_require_unix", + "feat_require_unix_utmpx", ] # "feat_os_windows" == set of utilities which can be built/run on modern/usual windows platforms feat_os_windows = [ - "feat_Tier1", ## == "feat_os_windows_legacy" + "hostname" - ] + "feat_Tier1", ## == "feat_os_windows_legacy" + "hostname" +] ## (secondary platforms) feature sets # "feat_os_unix_gnueabihf" == set of utilities which can be built/run on the "arm-unknown-linux-gnueabihf" target (ARMv6 Linux [hardfloat]) feat_os_unix_gnueabihf = [ - "feat_Tier1", - # - "feat_require_unix", - "feat_require_unix_utmpx", + "feat_Tier1", + # + "feat_require_unix", + "feat_require_unix_utmpx", ] # "feat_os_unix_musl" == set of utilities which can be built/run on targets binding to the "musl" library (ref: ) feat_os_unix_musl = [ - "feat_Tier1", - # - "feat_require_unix", + "feat_Tier1", + # + "feat_require_unix", ] ## feature sets with requirements (restricting cross-platform availability) # @@ -134,81 +134,81 @@ feat_os_unix_musl = [ # # "feat_require_crate_cpp" == set of utilities requiring the `cpp` crate (which fail to compile on several platforms; as of 2020-04-23) feat_require_crate_cpp = [ - "stdbuf", + "stdbuf", ] # "feat_require_unix" == set of utilities requiring support which is only available on unix platforms (as of 2020-04-23) feat_require_unix = [ - "chgrp", - "chmod", - "chown", - "chroot", - "du", - "groups", - "hostid", - "id", - "install", - "kill", - "logname", - "mkfifo", - "mknod", - "nice", - "numfmt", - "nohup", - "pathchk", - "stat", - "timeout", - "tty", - "uname", - "unlink", + "chgrp", + "chmod", + "chown", + "chroot", + "du", + "groups", + "hostid", + "id", + "install", + "kill", + "logname", + "mkfifo", + "mknod", + "nice", + "numfmt", + "nohup", + "pathchk", + "stat", + "timeout", + "tty", + "uname", + "unlink", ] # "feat_require_unix_utmpx" == set of utilities requiring unix utmp/utmpx support # * ref: feat_require_unix_utmpx = [ - "pinky", - "uptime", - "users", - "who", + "pinky", + "uptime", + "users", + "who", ] ## (alternate/newer/smaller platforms) feature sets # "feat_os_unix_fuchsia" == set of utilities which can be built/run on the "Fuchsia" OS (refs: ; ) feat_os_unix_fuchsia = [ - "feat_common_core", - # - "feat_require_crate_cpp", - # - "chgrp", - "chmod", - "chown", - "du", - "groups", - "hostid", - "install", - "logname", - "mkfifo", - "mknod", - "nice", - "pathchk", - "tty", - "uname", - "unlink", + "feat_common_core", + # + "feat_require_crate_cpp", + # + "chgrp", + "chmod", + "chown", + "du", + "groups", + "hostid", + "install", + "logname", + "mkfifo", + "mknod", + "nice", + "pathchk", + "tty", + "uname", + "unlink", ] # "feat_os_unix_redox" == set of utilities which can be built/run on "Redox OS" (refs: ; ) feat_os_unix_redox = [ - "feat_common_core", - # - "uname", - "chmod", - "install", + "feat_common_core", + # + "uname", + "chmod", + "install", ] # "feat_os_windows_legacy" == slightly restricted set of utilities which can be built/run on early windows platforms (eg, "WinXP") feat_os_windows_legacy = [ - "feat_common_core", - # - "arch", - "nproc", - "sync", - "touch", - "whoami", + "feat_common_core", + # + "arch", + "nproc", + "sync", + "touch", + "whoami", ] [workspace] diff --git a/GNUmakefile b/GNUmakefile index 64ceaa5c2..1e24d9445 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -46,101 +46,101 @@ BUSYBOX_SRC := $(BUSYBOX_ROOT)/busybox-$(BUSYBOX_VER) # Possible programs PROGS := \ - base32 \ - base64 \ - basename \ - cat \ - cksum \ - comm \ - cp \ - cut \ - df \ - dircolors \ - dirname \ - echo \ - env \ - expand \ - expr \ - factor \ - false \ - fmt \ - fold \ - hashsum \ - head \ - join \ - link \ - ln \ - ls \ - mkdir \ - mktemp \ - more \ - mv \ - nl \ - numfmt \ - nproc \ - od \ - paste \ - printenv \ - printf \ - ptx \ - pwd \ - readlink \ - realpath \ - relpath \ - rm \ - rmdir \ - seq \ - shred \ - shuf \ - sleep \ - sort \ - split \ - sum \ - sync \ - tac \ - tail \ - tee \ - test \ - tr \ - true \ - truncate \ - tsort \ - unexpand \ - uniq \ - wc \ - whoami \ - yes + base32 \ + base64 \ + basename \ + cat \ + cksum \ + comm \ + cp \ + cut \ + df \ + dircolors \ + dirname \ + echo \ + env \ + expand \ + expr \ + factor \ + false \ + fmt \ + fold \ + hashsum \ + head \ + join \ + link \ + ln \ + ls \ + mkdir \ + mktemp \ + more \ + mv \ + nl \ + numfmt \ + nproc \ + od \ + paste \ + printenv \ + printf \ + ptx \ + pwd \ + readlink \ + realpath \ + relpath \ + rm \ + rmdir \ + seq \ + shred \ + shuf \ + sleep \ + sort \ + split \ + sum \ + sync \ + tac \ + tail \ + tee \ + test \ + tr \ + true \ + truncate \ + tsort \ + unexpand \ + uniq \ + wc \ + whoami \ + yes UNIX_PROGS := \ - arch \ - chgrp \ - chmod \ - chown \ - chroot \ - du \ - groups \ - hostid \ - hostname \ - id \ - install \ - kill \ - logname \ - mkfifo \ - mknod \ - nice \ - nohup \ - pathchk \ - pinky \ - stat \ - stdbuf \ - timeout \ - touch \ - tty \ - uname \ - unlink \ - uptime \ - users \ - who + arch \ + chgrp \ + chmod \ + chown \ + chroot \ + du \ + groups \ + hostid \ + hostname \ + id \ + install \ + kill \ + logname \ + mkfifo \ + mknod \ + nice \ + nohup \ + pathchk \ + pinky \ + stat \ + stdbuf \ + timeout \ + touch \ + tty \ + uname \ + unlink \ + uptime \ + users \ + who ifneq ($(OS),Windows_NT) PROGS := $(PROGS) $(UNIX_PROGS) @@ -229,7 +229,7 @@ endef # Output names EXES := \ - $(sort $(filter $(UTILS),$(filter-out $(SKIP_UTILS),$(PROGS)))) + $(sort $(filter $(UTILS),$(filter-out $(SKIP_UTILS),$(PROGS)))) INSTALLEES := ${EXES} ifeq (${MULTICALL}, y) diff --git a/Makefile.toml b/Makefile.toml index 9b1e496e1..fd301a925 100644 --- a/Makefile.toml +++ b/Makefile.toml @@ -36,7 +36,7 @@ set_env CARGO_MAKE_CARGO_BUILD_TEST_FLAGS "" # determine features env_features = get_env CARGO_FEATURES if is_empty "${env_features}" - env_features = get_env FEATURES + env_features = get_env FEATURES end_if if is_empty "${env_features}" if eq "${CARGO_MAKE_RUST_TARGET_OS}" "macos" @@ -61,7 +61,7 @@ end_if # set build flags from features if not is_empty "${features}" set_env CARGO_MAKE_VAR_BUILD_TEST_FEATURES "${features}" - set_env CARGO_MAKE_CARGO_BUILD_TEST_FLAGS "--features ${features}" + set_env CARGO_MAKE_CARGO_BUILD_TEST_FLAGS "--features ${features}" end_if # determine show-utils helper script show_utils = set "util/show-utils.sh" @@ -96,7 +96,7 @@ description = "## *DEFAULT* Build (debug-mode) and test project" category = "[project]" dependencies = [ "action-build-debug", - "test-terse", + "test-terse", ] ## @@ -106,8 +106,8 @@ description = "## Build (release-mode) project" category = "[project]" dependencies = [ "core::pre-build", - "action-build-release", - "core::post-build", + "action-build-release", + "core::post-build", ] [tasks.build-debug] @@ -122,8 +122,8 @@ description = "## Build (release-mode) project example(s); usage: `cargo make (b category = "[project]" dependencies = [ "core::pre-build", - "action-build-examples", - "core::post-build", + "action-build-examples", + "core::post-build", ] [tasks.build-features] @@ -131,8 +131,8 @@ description = "## Build (with features; release-mode) project; usage: `cargo mak category = "[project]" dependencies = [ "core::pre-build", - "action-build-features", - "core::post-build", + "action-build-features", + "core::post-build", ] [tasks.debug] @@ -185,8 +185,8 @@ description = "## Run project tests" category = "[project]" dependencies = [ "core::pre-test", - "core::test", - "core::post-test", + "core::test", + "core::post-test", ] [tasks.test-terse] @@ -194,8 +194,8 @@ description = "## Run project tests (with terse/summary output)" category = "[project]" dependencies = [ "core::pre-test", - "action-test_quiet", - "core::post-test", + "action-test_quiet", + "core::post-test", ] [tasks.uninstall] @@ -213,8 +213,8 @@ category = "[project]" dependencies = [ "core::pre-build", "action-determine-utils", - "action-build-utils", - "core::post-build", + "action-build-utils", + "core::post-build", ] [tasks.uutil] diff --git a/docs/GNUmakefile b/docs/GNUmakefile index 05cef70c1..894a53be0 100644 --- a/docs/GNUmakefile +++ b/docs/GNUmakefile @@ -17,4 +17,4 @@ help: # Catch-all target: route all unknown targets to Sphinx using the new # "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). %: GNUmakefile - @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) \ No newline at end of file + @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) diff --git a/docs/make.bat b/docs/make.bat index 0fb8a16c1..1e8ea10a0 100644 --- a/docs/make.bat +++ b/docs/make.bat @@ -5,7 +5,7 @@ pushd %~dp0 REM Command file for Sphinx documentation if "%SPHINXBUILD%" == "" ( - set SPHINXBUILD=sphinx-build + set SPHINXBUILD=sphinx-build ) set SOURCEDIR=. set BUILDDIR=_build @@ -15,15 +15,15 @@ if "%1" == "" goto help %SPHINXBUILD% >NUL 2>NUL if errorlevel 9009 ( - echo. - echo.The 'sphinx-build' command was not found. Make sure you have Sphinx - echo.installed, then set the SPHINXBUILD environment variable to point - echo.to the full path of the 'sphinx-build' executable. Alternatively you - echo.may add the Sphinx directory to PATH. - echo. - echo.If you don't have Sphinx installed, grab it from - echo.http://sphinx-doc.org/ - exit /b 1 + echo. + echo.The 'sphinx-build' command was not found. Make sure you have Sphinx + echo.installed, then set the SPHINXBUILD environment variable to point + echo.to the full path of the 'sphinx-build' executable. Alternatively you + echo.may add the Sphinx directory to PATH. + echo. + echo.If you don't have Sphinx installed, grab it from + echo.http://sphinx-doc.org/ + exit /b 1 ) %SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% diff --git a/src/uu/cut/.gitignore b/src/uu/cut/.gitignore index 1de565933..eb5a316cb 100644 --- a/src/uu/cut/.gitignore +++ b/src/uu/cut/.gitignore @@ -1 +1 @@ -target \ No newline at end of file +target diff --git a/src/uu/expr/src/expr.rs b/src/uu/expr/src/expr.rs index a3b61f1fd..e2039f918 100644 --- a/src/uu/expr/src/expr.rs +++ b/src/uu/expr/src/expr.rs @@ -128,10 +128,10 @@ Exit status is 0 if EXPRESSION is neither null nor 0, 1 if EXPRESSION is null or 0, 2 if EXPRESSION is syntactically invalid, and 3 if an error occurred. Environment variables: - * EXPR_DEBUG_TOKENS=1 dump expression's tokens - * EXPR_DEBUG_RPN=1 dump expression represented in reverse polish notation - * EXPR_DEBUG_SYA_STEP=1 dump each parser step - * EXPR_DEBUG_AST=1 dump expression represented abstract syntax tree"# + * EXPR_DEBUG_TOKENS=1 dump expression's tokens + * EXPR_DEBUG_RPN=1 dump expression represented in reverse polish notation + * EXPR_DEBUG_SYA_STEP=1 dump each parser step + * EXPR_DEBUG_AST=1 dump expression represented abstract syntax tree"# ); } diff --git a/src/uu/numfmt/src/numfmt.rs b/src/uu/numfmt/src/numfmt.rs index 8a639a37f..164e83ff0 100644 --- a/src/uu/numfmt/src/numfmt.rs +++ b/src/uu/numfmt/src/numfmt.rs @@ -331,19 +331,19 @@ pub fn uumain(args: Vec) -> i32 { auto accept optional single/two letter suffix: - 1K = 1000, 1Ki = 1024, 1M = 1000000, 1Mi = 1048576, + 1K = 1000, 1Ki = 1024, 1M = 1000000, 1Mi = 1048576, si accept optional single letter suffix: - 1K = 1000, 1M = 1000000, ... + 1K = 1000, 1M = 1000000, ... iec accept optional single letter suffix: - 1K = 1024, 1M = 1048576, ... + 1K = 1024, 1M = 1048576, ... iec-i accept optional two-letter suffix: - 1Ki = 1024, 1Mi = 1048576, ..." + 1Ki = 1024, 1Mi = 1048576, ..." ); return 0; diff --git a/src/uu/printf/src/tokenize/num_format/num_format.rs b/src/uu/printf/src/tokenize/num_format/num_format.rs index e84116bfc..8b3f245fe 100644 --- a/src/uu/printf/src/tokenize/num_format/num_format.rs +++ b/src/uu/printf/src/tokenize/num_format/num_format.rs @@ -245,7 +245,7 @@ pub fn num_format(field: &FormatField, in_str_opt: Option<&String>) -> Option