late-advantage-75311
09/29/2023, 4:52 PMpants lintbroad-processor-92400
09/30/2023, 12:45 AMBUILD files to allow more functionality to be specified there, but it seems you're approaching it from the perspective of "make plugins simpler/more stable" which seems like a reasonable one too. π€
Do you have an idea about how it might work to have an in-repo executable that runs as the linter/formatter? (For example's sake, let's say a pex_binary that is checking .md files)broad-processor-92400
09/30/2023, 12:46 AMlate-advantage-75311
09/30/2023, 1:12 AMlate-advantage-75311
10/04/2023, 7:44 PMlate-advantage-75311
10/04/2023, 7:46 PMconfs = [
ByoLinter(
options_scope='byo_markdownlint',
name="MarkdownLint",
help="A markdown linter based on your installed markdown lint.",
executable=SystemBinaryExecutable("markdownlint", tools=["node"]),
file_glob_include=["**/*.md"],
file_glob_exclude=["README.md"],
),
ByoLinter(
options_scope='byo_flake8',
name="byo_Flake8",
help="byo flake8",
executable=PythonToolExecutable(
main=ConsoleScript("flake8"),
requirements=["flake8>=5.0.4,<7"],
resolve="byo_flake8",
),
file_glob_include=["**/*.py"],
file_glob_exclude=[],
),
]
and it activates the tools for linting:
$ pants_from_sources lint ::
...
β byo_flake8 succeeded.
β byo_markdownlint succeeded.
The pex one requires you separately set up the resolve for the tool.bitter-ability-32190
10/04/2023, 8:09 PMbitter-ability-32190
10/04/2023, 8:10 PMlate-advantage-75311
10/04/2023, 9:31 PMbitter-ability-32190
10/04/2023, 10:38 PMlate-advantage-75311
10/05/2023, 1:45 AMlate-advantage-75311
10/05/2023, 2:21 PMfmt . I cleaned up the implementation POC so that it is clear that it is all doable in new code.
I'll step aside from the effort for a bit, and wait till I can get a read on whether others think this kind of thing would be worth its weight, or is even a good direction. I am not entirely sure myself. There seem like there may be more pressing issues that our users are facing than a lighter-weight mechanism for adding linters/formatters.bitter-ability-32190
10/05/2023, 2:42 PMbitter-ability-32190
10/05/2023, 2:43 PMwide-midnight-78598
10/05/2023, 2:43 PMlate-advantage-75311
10/05/2023, 6:12 PMwide-midnight-78598
10/05/2023, 7:06 PMbitter-ability-32190
10/06/2023, 2:26 PMcareful-address-89803
10/08/2023, 7:46 PMlate-advantage-75311
10/09/2023, 12:49 AMcareful-address-89803
10/09/2023, 5:07 AMlate-advantage-75311
10/09/2023, 10:03 AM.md files or .yaml or anything else that doesn't already have a natural target aside from file . I was targeting a user who wouldn't need to know about fieldsets (and how they are not the same as targets and all that!).
I didn't realize that dependency inference comes up during these kinds of tasks. I was studying the implementation of shellcheck, flake8, yamlllint and black (for fmt). My impression was that dep inference and target dependencies in general are needed mostly for check . But that lint, fmt, fix generally are expected to operate on each source file in isolation (they may need lint configuration files).bitter-ability-32190
10/09/2023, 11:48 AMbitter-ability-32190
10/09/2023, 2:30 PMlate-advantage-75311
10/11/2023, 4:40 PMlate-advantage-75311
10/12/2023, 4:16 PMbitter-ability-32190
10/12/2023, 4:18 PMlate-advantage-75311
10/12/2023, 4:30 PMlate-advantage-75311
10/12/2023, 4:36 PMlate-advantage-75311
10/12/2023, 4:37 PMbitter-ability-32190
10/12/2023, 4:38 PMlate-advantage-75311
10/12/2023, 4:40 PMlate-advantage-75311
10/13/2023, 3:06 PMbitter-ability-32190
10/13/2023, 3:07 PMlate-advantage-75311
10/13/2023, 3:17 PMcurved-manchester-66006
10/16/2023, 4:22 PMpre-commit checks into pants. Many of them are hardly more than oneliners like end-of-file-fixer and check-executables-have-shebangs and not so much a self contained tool.bitter-ability-32190
10/16/2023, 4:23 PMbitter-ability-32190
10/16/2023, 4:23 PMcurved-manchester-66006
10/16/2023, 4:32 PMbitter-ability-32190
10/16/2023, 4:33 PMlate-advantage-75311
10/16/2023, 4:42 PMcurved-manchester-66006
10/16/2023, 4:43 PMlate-advantage-75311
10/17/2023, 4:58 PMlate-advantage-75311
10/26/2023, 9:29 PMpants.toml. Usable runnables include any adhoc-tool compatible runnable. https://github.com/pantsbuild/pants/issues/17729#issuecomment-1781916499late-advantage-75311
10/26/2023, 9:34 PMbitter-ability-32190
10/27/2023, 2:30 PM