bitter-ability-32190
12/22/2023, 5:18 PMbitter-ability-32190
12/22/2023, 5:20 PMregister.py, declare
INCLUDE_IN_PANTSBUILD_DOCS = True.
E.g.
# src/python/pants/backend/python/lint/black/register.py
# Copyright 2019 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
"""Autoformatter for Python.
See <https://www.pantsbuild.org/docs/python-linters-and-formatters> and
<https://black.readthedocs.io/en/stable/>.
"""
from pants.backend.python.lint.black import rules as black_rules
from pants.backend.python.lint.black import skip_field, subsystem
INCLUDE_IN_PANTSBUILD_DOCS = True
def rules():
return (*black_rules.rules(), *skip_field.rules(), *subsystem.rules())
We'd just use a dead-simple grep to find the relevant register.py files with that exact match (more bikeshedding on the special string) and convert them todotted module names.curved-television-6568
12/22/2023, 6:00 PMbitter-ability-32190
12/22/2023, 6:01 PMcurved-television-6568
12/22/2023, 6:02 PMbitter-ability-32190
12/22/2023, 6:04 PMcurved-television-6568
12/22/2023, 6:04 PMcurved-television-6568
12/22/2023, 6:06 PMcurved-television-6568
12/22/2023, 6:07 PMbitter-ability-32190
12/22/2023, 6:07 PMBUILD file that lists backends to ship with.
Then we kick the can to that static listcurved-television-6568
12/22/2023, 6:08 PMcurved-television-6568
12/22/2023, 6:09 PMbitter-ability-32190
12/22/2023, 6:11 PMsrc/python/pants/bin/BUILDbitter-ability-32190
12/22/2023, 6:12 PMcurved-television-6568
12/22/2023, 6:16 PMbitter-ability-32190
12/22/2023, 6:16 PMcurved-television-6568
12/22/2023, 6:17 PMcurved-television-6568
12/22/2023, 6:18 PMwide-midnight-78598
12/22/2023, 6:54 PMbitter-ability-32190
12/22/2023, 7:00 PMbitter-ability-32190
12/22/2023, 7:01 PMsrc/python/pants/bin/BUILD or find all register.py filescurved-television-6568
12/22/2023, 7:09 PMcurved-television-6568
12/22/2023, 7:10 PMcurved-television-6568
12/22/2023, 7:10 PMbitter-ability-32190
12/22/2023, 7:24 PMcurved-television-6568
12/22/2023, 7:30 PMbitter-ability-32190
12/22/2023, 7:31 PMbitter-ability-32190
12/22/2023, 7:32 PMbitter-ability-32190
12/22/2023, 7:38 PM- name: Get the backends list
# NB: We need to know what backends are in this release. The easiest way to do that is to find
# all the `register.py` files in the release. We can't just grep the repo, as some backends
# might not be included in the release. So the easiest thing to do is download a wheel
# (we download the smallest one, which is Mac 11) and scrape the backends from it.
run: |
curl -L <https://github.com/pantsbuild/pants/releases/download/release_${{> inputs.version }}/pantsbuild.pants-${{ inputs.version }}-cp39-cp39-macosx_11_0_arm64.whl -o pants.whl
unzip -l pants.whl \
| grep register.py \
| awk '{print $4}' \
| sed 's#/register.py##' \
| sed 's#/#.#g' \
| xargs -I{} echo "\"{}\", " \
| tr '\n' ' ' \
>> backends.txtcurved-television-6568
12/22/2023, 7:39 PMbitter-ability-32190
12/22/2023, 7:39 PMcurved-television-6568
12/22/2023, 7:39 PMcurved-television-6568
12/22/2023, 7:48 PM⯠pants backends --help-advanced | sed -e '/^[^[]/d' -e 's/\[.*\(pants[^ ]*\) .*/\1/'bitter-ability-32190
12/22/2023, 7:49 PMcurved-television-6568
12/22/2023, 7:50 PMbitter-ability-32190
12/22/2023, 7:50 PMcurved-television-6568
12/22/2023, 7:51 PMcurved-television-6568
12/22/2023, 7:52 PMbitter-ability-32190
12/22/2023, 7:53 PMpants help-advanced backends \
| tr '*' ' ' \
| grep pants\.backend | awk '{print $3}' \
| xargs -I{} echo "\"{}\", " \
| tr '\n' ' ' \
>> backends.txt
Already looks bettercurved-television-6568
12/22/2023, 7:54 PMpants help-all in json.. just a jq query awaybitter-ability-32190
12/22/2023, 7:54 PMcurved-television-6568
12/22/2023, 7:54 PMcurved-television-6568
12/22/2023, 7:54 PMbitter-ability-32190
12/22/2023, 7:54 PMbitter-ability-32190
12/22/2023, 7:55 PMcurved-television-6568
12/22/2023, 7:55 PMbitter-ability-32190
12/22/2023, 7:55 PMcurved-television-6568
12/22/2023, 7:55 PMbitter-ability-32190
12/22/2023, 7:56 PMcurved-television-6568
12/22/2023, 7:56 PMcurved-television-6568
12/22/2023, 7:56 PMbitter-ability-32190
12/22/2023, 7:56 PMcurved-television-6568
12/22/2023, 7:57 PM"pants.backend.shell.lint.shfmt": {
"description": "",
"enabled": true,
"name": "pants.backend.shell.lint.shfmt",
"provider": "pants"
},
"pants.backend.tools.preamble": {
"description": "",
"enabled": false,
"name": "pants.backend.tools.preamble",
"provider": "pants"
},bitter-ability-32190
12/22/2023, 7:57 PMcurved-television-6568
12/22/2023, 7:57 PMcurved-television-6568
12/22/2023, 7:58 PMbitter-ability-32190
12/22/2023, 7:58 PMcurved-television-6568
12/22/2023, 7:58 PMcurved-television-6568
12/22/2023, 7:58 PMbitter-ability-32190
12/22/2023, 7:58 PMcurved-television-6568
12/22/2023, 7:58 PMcurved-television-6568
12/22/2023, 8:00 PMbitter-ability-32190
12/22/2023, 8:00 PMbitter-ability-32190
01/02/2024, 8:37 PMPANTS_VERSION=2.20.0.dev2 pants help-all > 2.20.x.help-all.json
only has one hit for add-trailing.
I suspect it's a two-pass approahc because the backends ARE in the name_to_backend_help_info key. So we need to get that first, then use that list to re-run with them all enabledcurved-television-6568
01/02/2024, 8:41 PMbitter-ability-32190
01/02/2024, 8:41 PMadd-trailing-comma looks like:
"pants.backend.experimental.python.lint.add_trailing_comma": {
"description": "Autoformatter to automatically add trailing commas to calls and literals.\n\nSee <https://github.com/asottile/add-trailing-comma> for details.",
"enabled": false,
"name": "pants.backend.experimental.python.lint.add_trailing_comma",
"provider": "pants"
},bitter-ability-32190
01/02/2024, 8:42 PMhelp-all sectionscurved-television-6568
01/02/2024, 8:42 PMcurved-television-6568
01/02/2024, 8:43 PMbitter-ability-32190
01/02/2024, 8:43 PMbitter-ability-32190
01/02/2024, 8:43 PMcurved-television-6568
01/02/2024, 8:44 PMbitter-ability-32190
01/02/2024, 8:55 PM