Skip to content

Bug 42728 - Change `./mach lint` so that it makes sense for running in tor-browser and related projects

Merge Info

Related Issues

Backporting

Timeline

  • Immediate: patchset needed as soon as possible
  • Next Minor Stable Release: patchset that needs to be verified in nightly before backport
  • Eventually: patchset that needs to be verified in alpha before backport
  • No Backport (preferred): patchset for the next major stable

Merging

  • Merge to tor-browser - !fixups to tor-browser-specific commits, new features, security backports
  • Merge to base-browser - !fixups to base-browser-specific commits, new features to be shared with mullvad-browser, and security backports
    • NOTE: if your changeset includes patches to both base-browser and tor-browser please clearly label in the change description which commits should be cherry-picked to base-browser after merging

Issue Tracking

Review

Change Description

The original request here was to change tb-dev script, but I tried something different.

I applied some changes to the ./mach lint CLI directly "deactiivating" linters that we currently don't care about.

I preferred this approach because in my workflow I prefer to use ./mach lint directly. It is more versatile than tb-dev without having to write any code.

While tb-dev only allows running linter for all changed-files in the current branch, ./mach lint allows running a subset of linters as desired for any combination of files we want. It can even be combined with tb-dev to run the linters only for changed files if we want... Untested, but something like ./mach lint $(./tools/torbrowser/tb-dev changed-files).

I can try to uplift this change as well, by making it less tor-project specific. Not sure why Mozilla would want it, but we never know 🤷 it can be made generic for sure. I guess if I plan to do that I should put this change in it's own commit.

If this seems fine, then I will send a separate MR to update the docs over on https://gitlab.torproject.org/tpo/applications/team/-/wikis/Development-Information/Tor-Browser/Contributing-to-Tor-Browser#linting

How Tested

N/A

Edited by brizental

Merge request reports