Closed Bug 1591977 Opened 5 years ago Closed 5 years ago

"TypeError: run_rustfmt() missing 1 required positional argument: 'log'" when running mach lint -l rustfmt --fix

Categories

(Developer Infrastructure :: Lint and Formatting, defect)

All
macOS
defect
Not set
normal

Tracking

(firefox72 fixed)

RESOLVED FIXED
mozilla72
Tracking Status
firefox72 --- fixed

People

(Reporter: mstange, Assigned: ahal)

References

(Regression)

Details

(Keywords: regression)

Attachments

(2 files)

I wanted to see what would happen if I rust-formatted gfx/wr/webrender but got an error:

mozilla mstange$ hg diff
diff --git a/tools/lint/rustfmt.yml b/tools/lint/rustfmt.yml
--- a/tools/lint/rustfmt.yml
+++ b/tools/lint/rustfmt.yml
@@ -1,13 +1,14 @@
 ---
 rust:
     description: Reformat rust
     include:
         - js/src/wasm/cranelift/
+        - gfx/wr/webrender/
         - testing/geckodriver/
         - testing/mozbase/rust/
         - testing/webdriver/
     extensions:
         - rs
     support-files:
         - 'tools/lint/rust/**'
     type: external
mozilla mstange$ ./mach lint -l rustfmt gfx/wr/webrender/
✖ 0 problems (0 errors, 4356 warnings)
mozilla mstange$ hg ci -m "Add gfx/wr/webrender to the rustfmt lint list."
mozilla mstange$ ./mach lint -l rustfmt gfx/wr/webrender/ --fix
Traceback (most recent call last):
  File "/Users/mstange/code/mozilla/python/mozlint/mozlint/roller.py", line 55, in _run_worker
    res = func(paths, config, **lintargs) or []
  File "/Users/mstange/code/mozilla/python/mozlint/mozlint/types.py", line 54, in __call__
    return self._lint(paths, config, **lintargs)
  File "/Users/mstange/code/mozilla/python/mozlint/mozlint/types.py", line 139, in _lint
    return func(files, config, **lintargs)
  File "/Users/mstange/code/mozilla/tools/lint/rust/__init__.py", line 158, in lint
    run_rustfmt(config, files, fix=True)
TypeError: run_rustfmt() missing 1 required positional argument: 'log'
A failure occurred in the rust linter.
✖ 1 problem (0 errors, 0 warnings, 1 failure)

Thanks for reporting!

Assignee: nobody → ahal
Status: NEW → ASSIGNED
Regressed by: 1554657
Keywords: regression

This matches the behaviour of the other linters.

Depends on D50822

Also fyi, you can run ./mach lint --warnings to see the warnings (which includes diffs).

Cool! Thanks for the quick fix!

Pushed by ahalberstadt@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/edfae1797e9b [lint.rustfmt] Fix error when running 'mach lint -l rustfmt --fix', r=sylvestre https://hg.mozilla.org/integration/autoland/rev/8b5ad87bc066 [lint.rustfmt] Don't print issues if --fix is passed in, r=sylvestre
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla72
Has Regression Range: --- → yes
Product: Firefox Build System → Developer Infrastructure
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: