Repository navigation
·
2 commits
to master
since this release
Immutable
release. Only release title and notes can be modified.
This 1.0.0 release does not contain any breaking changes, but it does contain many bug fixes. Going forward, this project will follow semver versioning.
- When the
preciousconfig is in a subdirectory of a larger git project, it was inconsistent about what files it would consider. If given specific files or the--allflag, it only looked at files in or below the directory containing its config file. However, when given any flag which was git-related, including--git,--staged,--staged-with-stash, and--git-diff-from,precioussaw changed files outside of this tree, which caused it to fail. Nowpreciousonly looks at changed files under the project root, which is the directory containing the precious config file. This also makes top-levelexcludepatterns anchored with a leading/work in these modes. - The
invoke.per-file-or-dir,invoke.per-file-or-once, andinvoke.per-dir-or-onceoptions are now checked against the same rules as the two plaininvokemodes they can turn into. Before, none of the checks for nonsensical combinations applied to them. For example, a command withinvoke.per-dir-or-once = 2andworking-dir = "dir"was accepted. When it ran once, it only ran in the first file's directory, butpreciousreported every file as passing. This is a breaking change for any config with one of these combinations, which will now fail to load. - Fixed a bug where a command with
type = "both"treated thelint-failure-exit-codesok exit codes even when tidying. This meant that if the command exited with those codes when tidying, it was treated as successful. Now only theok-exit-codesare ok when tidying, as the documentation says. If your tidier exits with one of these codes on a normal exit, add that code to itsok-exit-codes. - Fixed a bug where the
--staged-with-stashmode popped the stash right after finding the files to check, before running any commands. Commands saw your unstaged changes, and a tidier could rewrite them. The stash is now popped after every command has run. - Fixed a bug where the
--staged-with-stashmode would pop a stash that already existed whenpreciousran. When there were no unstaged changes,gitmade no new stash, butpreciousstill rangit stash popat the end, which applied and dropped your most recent stash. - Fixed a bug where a tidy command that runs once per directory was always reported as having tidied files, even when it changed no files. This affected commands with
invoke = "per-dir", and commands withinvoke.per-file-or-dir = nwhen the number of files was at or above the threshold. These commands now correctly report whether or not they've changed files. - Fixed a bug where
working_dir.chdir_toandworking-dir.chdir_towere rejected with a config parse error. Only thechdir-tospelling of this key was accepted. The underscore spelling stopped working in 0.10.0, even though the underscore names for config keys are meant to keep working. - Fixed the
golangci-lintcommand in the config generated byprecious config initfor Go, and inexamples/golang/precious.toml. The command wasgolangci-lint run -c --allow-parallel-runners. The-cflag takes a config file path, sogolangci-linttried to load a config file named--allow-parallel-runnersand exited with an error. The-cflag has been removed. - The
.golangci.ymlfile generated byprecious config initfor Go is now in thegolangci-lintv2 format. The old file was in the v1 format, which v2 refuses to load. - Fixed the
perltidycommand inexamples/perl/precious.toml. It used$PRECIOUS-ROOTinstead of$PRECIOUS_ROOTfor the path to the profile, soperltidycould not find its profile and every run failed. The config generated byprecious config initwas already correct. - The
prettier-yamlcommand in the config generated byprecious config initnow includes**/*.yamlfiles as well as**/*.ymlfiles. Before, files with a.yamlextension were never linted or tidied, even though finding one is enough for--autoto turn on the YAML component. - The
perlimportscommand in the config generated byprecious config initfor Perl, and inexamples/perl/precious.toml, now setslint-failure-exit-codes = 1. Before, a file that failedperlimports --lintwas reported as an unexpected exit code error and not as a lint failure. - The
podcheckercommand in the config generated byprecious config initfor Perl, and inexamples/perl/precious.toml, now ignores the stderr output thatpodcheckerprints when it finds POD errors. Before, a file with POD errors was reported as an unexpected stderr error and not as a lint failure. - Fixed a bug on Windows where
preciouscould run a different executable than the one it found in yourPATH. Windows looks in its system directories before it looks inPATH. This meant thatcmd = ["bash", ...]could run the WSL launcher inC:\Windows\System32even when Git'sbashcame first inPATH. Nowpreciousalways runs the executable that it finds inPATH. - A relative path to an executable in
cmd, likecmd = ["./node_modules/.bin/eslint"], is now always looked up relative to the project root. Before, it was looked up relative to the directory thatpreciouswas run in, so the command could not be found when you ranpreciousfrom a subdirectory. The configs generated byprecious config initfor TypeScript, Markdown, and YAML all use paths like this. An executable with no directory in it, likeeslint, is still looked up in yourPATH. - Fixed a bug where
--staged-with-stashstashed unstaged changes in the middle of a cherry-pick or revert. The stash made git forget that the cherry-pick or revert was in progress, sogit cherry-pick --continuefailed and a plaingit commitlost the original commit message. Nowpreciousskips the stash in these cases, like it already did for a merge. - Fixed a bug where the
--git,--staged,--staged-with-stash, and--git-diff-fromflags skipped files that were renamed. A file that was moved and then edited was never linted or tidied under its new name. - Fixed a bug where the
--git,--staged,--staged-with-stash, and--git-diff-fromflags failed whengit diffprinted a warning. For example, withcore.autocrlfturned on, git warns that "LF will be replaced by CRLF", andprecioustreated this as an error. Nowpreciousonly looks at the exit code fromgit diff. - Fixed a bug where a file with a name that is not valid UTF-8 made
preciousfail even when the file was excluded. Nowpreciousonly reports an error for a non-UTF-8 file name when the file is not excluded. - Fixed the exit code when a command fails to run properly. This covers a command that returns an exit code that is not listed as ok, prints to stderr unexpectedly, or cannot be executed. In these cases
preciousexited with1, the same as for a lint failure, even though the docs said it would not. Nowpreciousexits with43, in both lint and tidy mode. If you have scripts that check for an exit code of1fromprecious tidy, you will need to update them. - Fixed a bug where a tidy command with
invoke = "per-dir"failed when the directory had any file with a name that is not valid UTF-8, even a file that the command does not include. Nowpreciousonly reports an error for a non-UTF-8 file name when the file matches the command'sincludeandexcluderules, and that error shows the raw bytes of the name. - A value of
0forinvoke.per-file-or-dir,invoke.per-file-or-once, orinvoke.per-dir-or-onceis now a config error. Before, the first two madepreciouspanic when it ran the command, and the third was accepted and always ran the command once. - When
preciouswalks the project to find files, it now skips anything that is not a regular file, like a socket, a FIFO, or a broken symlink. Before, these were passed to commands like any other file. A tidy command that matched one madepreciouspanic, or fail with an error that said the path did not exist. If you pass one of these paths by name on the command line, a tidy command now fails with an error that says the path is not a regular file or a directory. - A command with an empty
cmd, likecmd = []orcmd = "", is now a config error. Before,cmd = []madepreciouspanic when it ran the command, andcmd = ""failed with an error about an executable that could not be found. - The
--commandflag now runs the named command whatever its labels are, unless--labelis also passed. Before,--commandon its own still only looked at commands with thedefaultlabel. So a command withlabelsthat did not includedefaultcould not be run by name alone, andprecioussaid that no commands matched the name. - The
check-go-mod.shscript thatprecious config init --component gocreates now prints the output fromgo mod tidywhen that command fails, and exits with2. Before, the script exited with1and printed nothing, sopreciousreported a lint failure with no explanation. - Running
precious config init --autoin a directory with no files thatpreciousknows how to generate config for is now an error. Before, it wrote an emptyprecious.tomland exited with0, and every later run ofpreciousfailed with an error about a missingcommandsfield. - The config that
precious config init --component shellgenerates no longer hasexclude = ["target"]. That is the Rust build directory, and it has nothing to do with shell scripts. It madepreciousskip every directory namedtargetfor all commands. - Running
precious config init --autono longer looks at files under the.git,.hg, and.svndirectories. Before, a git branch or tag with a name likerelease/notes.mdorv1.plmade it generate config for Markdown or Perl, even when the project had no files of that type. - When the paths given on the command line overlap, each file is now only handled once. Before, a command like
precious tidy . src/a.txtorprecious lint a.txt a.txtpassed the same file to a command more than once, and ran a per-file command on that file more than once. - Fixed a bug with a negated
excludepattern for a file inside an excluded directory, likeexclude = ["vendor", "!vendor/keep.txt"]. When the directory was given on the command line, as inprecious lint vendor, the file was not found andprecioussaid that the path was excluded. The file was found with--allor when a parent directory was given. - A submodule with a new commit is no longer passed to commands when running with
--git,--staged,--staged-with-stash, or--git-diff-from. Git reports the submodule as one changed path, andprecioustreated that directory as if it were a file. - When exactly one command failed, the summary line that
preciousprinted had a NUL character in it, right after the word "Error". This made tools likegreptreat the output as binary. - When a command's
envsetsPATH,preciousnow uses thatPATHto find the command's executable. Before, it looked in its ownPATH, so a command whose executable was only in thePATHfromenvfailed with an error that said the executable could not be found. - When a command is killed by a signal, the error that
preciousprints now includes the command's stdout and stderr. Before, that output was thrown away. - When a command fails because it printed something unexpected to stderr, the error that
preciousprints now includes the command's stdout as well as its stderr. - Fixed the error message for an executable that cannot be found. It was missing the closing parenthesis after the
PATHvalue. - Fixed the shortened command that
preciousshows in its--verboseoutput for a command that setspath-flag. It could end with a flag that had no path after it, and it reported the wrong number of paths left out. - Fixed a false warning in the
--verboseoutput. When a command could not be started,preciouslogged "Got a disconnected error receiving message from main thread" next to the real error. - Fixed the
dev/bin/check-go-mod.shscript thatprecious config initgenerates for Go projects. It used the output ofgo mod tidy -vas aprintfformat string, so a%or a backslash in that output could garble what the script printed. - Fixed the help output and the errors for bad command line arguments. The help had an empty
Usage:line, and errors like "unexpected argument found" did not say which argument was wrong. - Fixed the path in the
::error file=...annotation thatpreciousprints when it runs in GitHub Actions. The path was relative to the directory with thepreciousconfig file. When that was not the root of the repo, the annotation pointed at the wrong file. The path is now relative toGITHUB_WORKSPACE. - The
::errorannotation thatpreciousprints when it runs in GitHub Actions now escapes special characters in the file path and the command name. Before, a path that contained a character like,,:or%gave an annotation that pointed at the wrong file. - The
::errorannotation thatpreciousprints when it runs in GitHub Actions no longer names a file when the command was not given file paths, for example withpath-args = "none". Before, if only one file matched the command, the annotation was put on that file, even though the failure could have been in any file. - Fixed the paths that
preciouspasses to a command whenworking-dir.chdir-tois a symlink or contains... The paths were not relative to the directory that the command really ran in, so the command could not find the files. - When the working directory for a command does not exist, for example because of a bad
working-dir.chdir-tovalue, the error now names that directory. Before, the error only named the command, so it looked like the executable was missing. - Errors in a command's config are now reported no matter which commands are selected to run. Before, some checks only ran for commands that matched the mode (
lintortidy), the--commandflag, and the--labelflag. This meant thatprecious lintwould not report a tidy command with a badinvoke,working-dir, andpath-argscombination. The same was true for a badignore-stderrregex, a badincludeorexcludeglob, and the checks onlint-flagsandtidy-flags. - The config that
precious config init --component perlgenerates now usesignore-stderr = ".*"forperlimports. Before, it used the deprecatedexpect-stderr = true. The two do the same thing. - When
preciousis run with--alland finds no files, the error no longer always says that everything was excluded in the precious config. It only says that when anexcludein the config dropped a file. Otherwise it says that no files were found, and that the directory may be empty or an ignore file such as.gitignoremay exclude everything.