bitter-ability-32190
03/23/2022, 2:55 PM09:51:09.16 [ERROR] 1 Exception encountered:
AttributeError: 'builtins.Digest' object has no attribute 'digest'
FATAL: exception not rethrown
Aborted (core dumped)
You've upgraded to a version past https://github.com/pantsbuild/pants/pull/14865
Upgrading is easy, input
and output
are now Snapshot
in FmtResult
. The PR includes multiple examples of how to fix your formatter plugin.bitter-ability-32190
03/23/2022, 2:55 PMbitter-ability-32190
03/23/2022, 2:58 PMhundreds-father-404
03/24/2022, 1:49 AMbitter-ability-32190
03/27/2022, 10:01 PMwide-midnight-78598
03/28/2022, 1:46 PMbitter-ability-32190
03/28/2022, 1:46 PMwide-midnight-78598
03/28/2022, 1:48 PMLintResults
?wide-midnight-78598
03/28/2022, 1:49 PMbitter-ability-32190
03/28/2022, 1:51 PMblack
with --check
? Still goes away. All formatters will be linters implicitly. Reasons:
⢠On the "success-ish" case the process would have the same input, therefore can be re-used for lint
(Running ./pants fmt lint
is now faster)
⢠The output is now consistent for all formatters across `fmt`/`lint`. It simply prints a list of files that either changed, or would be changed. (Inconsistent output was extremely annoying IMO).
⦠`stdout`/`stderr` is still logged as debug
⢠This also allows us to onboard formatters without "lint"-ing capabilitywide-midnight-78598
03/28/2022, 1:52 PM./pants lint ::
- internally, Pants will now run that plugin's formatter, and then compare diffs?wide-midnight-78598
03/28/2022, 1:53 PMbitter-ability-32190
03/28/2022, 1:53 PMwide-midnight-78598
03/28/2022, 1:53 PMbitter-ability-32190
03/28/2022, 1:55 PMI saw a note about read-only filesystems ...It'll need to be addressed, but my approach would just be to give a fallback message about the formatter failing to format a file, which implies a file would fail lint anyways. E.g.
black attempted to write to disk but failed. Please run ./pants fmt to fix formatting.
wide-midnight-78598
03/28/2022, 1:55 PMwide-midnight-78598
03/28/2022, 1:57 PMbitter-ability-32190
03/28/2022, 1:58 PMwide-midnight-78598
03/28/2022, 1:59 PMccache
stuff in-memory, and yep - definitely blazes past when I'm building embedded filesystems