@rtorcato/repo-tooling 3.5.0 → 3.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +1 -1
- package/dist/base/checks.js +15 -1
- package/dist/base/fixers.js +9 -1
- package/dist/base/git-hooks.js +43 -0
- package/dist/cli/commands/doctor.js +64 -8
- package/dist/cli/commands/fix-targets.js +38 -4
- package/dist/cli/commands/fix.js +19 -6
- package/dist/cli/index.js +30 -0
- package/dist/cli/utils/copy-preset.js +25 -0
- package/dist/languages/js/fixers.js +15 -15
- package/dist/languages/perl/checks.js +177 -0
- package/dist/languages/perl/ci.js +191 -0
- package/dist/languages/perl/fixers.js +93 -0
- package/dist/languages/perl/git-hooks.js +53 -0
- package/dist/languages/perl/gitignore.js +65 -0
- package/dist/languages/perl/sources.js +22 -0
- package/dist/languages/python/checks.js +234 -0
- package/dist/languages/python/ci.js +153 -0
- package/dist/languages/python/fixers.js +104 -0
- package/dist/languages/python/git-hooks.js +35 -0
- package/dist/languages/python/gitignore.js +55 -0
- package/dist/languages/registry.js +2 -2
- package/dist/languages/swift/fixers.js +2 -2
- package/dist/languages/swift/git-hooks.js +7 -35
- package/package.json +5 -1
- package/tooling/perl/perlcriticrc +35 -0
- package/tooling/perl/perltidyrc +23 -0
- package/tooling/python/mypy.ini +21 -0
- package/tooling/python/pytest.ini +15 -0
- package/tooling/python/ruff.toml +32 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rtorcato/repo-tooling",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.7.0",
|
|
4
4
|
"description": "One CLI to scaffold, audit and fix your repo's whole toolchain — linting, tests, commits, releases & CI.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"keywords": [
|
|
@@ -103,6 +103,10 @@
|
|
|
103
103
|
"tooling/mcp/mcp.json.example",
|
|
104
104
|
"tooling/swift/*.yml",
|
|
105
105
|
"tooling/swift/*.json",
|
|
106
|
+
"tooling/python/*.toml",
|
|
107
|
+
"tooling/python/*.ini",
|
|
108
|
+
"tooling/perl/perlcriticrc",
|
|
109
|
+
"tooling/perl/perltidyrc",
|
|
106
110
|
"tooling/github-actions/workflows/*.yml",
|
|
107
111
|
"README.md",
|
|
108
112
|
"AGENTS.md"
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# .perlcriticrc — @rtorcato/repo-tooling Perl preset
|
|
2
|
+
#
|
|
3
|
+
# Perl::Critic is the linter; perltidy (see .perltidyrc) is the formatter.
|
|
4
|
+
# They do not overlap: Perl::Critic never rewrites source, so unlike the
|
|
5
|
+
# SwiftLint/SwiftFormat and ruff/black pairings there is no second rewriting
|
|
6
|
+
# tool to fight — see src/languages/perl/checks.ts.
|
|
7
|
+
|
|
8
|
+
# Severity 3 ("harsh") and above. Severity 1 turns on the whole Perl Best
|
|
9
|
+
# Practices book, including rules modern code deliberately breaks; 4-5 catch
|
|
10
|
+
# so little they stop functioning as a gate.
|
|
11
|
+
severity = 3
|
|
12
|
+
|
|
13
|
+
# One violation per line with a file:line:column prefix, which both an editor
|
|
14
|
+
# and a CI log annotator can parse.
|
|
15
|
+
verbose = %f:%l:%c %m (%p, severity %s)\n
|
|
16
|
+
|
|
17
|
+
# --- Rule adjustments -------------------------------------------------------
|
|
18
|
+
|
|
19
|
+
# RequireVersionVar wants a $VERSION in every .pm. Distributions that carry the
|
|
20
|
+
# version in their metadata (Dist::Zilla) or in the main module alone would
|
|
21
|
+
# have to repeat it in every file to satisfy it.
|
|
22
|
+
[-Modules::RequireVersionVar]
|
|
23
|
+
|
|
24
|
+
# RequirePodSections enforces a fixed POD skeleton in every file, including
|
|
25
|
+
# private modules that have no public interface to document. The POD that
|
|
26
|
+
# matters is on the distribution's entry points, which this cannot tell apart.
|
|
27
|
+
[-Documentation::RequirePodSections]
|
|
28
|
+
|
|
29
|
+
# These modules enable strict and warnings for you, so requiring the explicit
|
|
30
|
+
# pragma alongside them is a false positive.
|
|
31
|
+
[TestingAndDebugging::RequireUseStrict]
|
|
32
|
+
equivalent_modules = Moose Moo Mojo::Base Test2::V0
|
|
33
|
+
|
|
34
|
+
[TestingAndDebugging::RequireUseWarnings]
|
|
35
|
+
equivalent_modules = Moose Moo Mojo::Base Test2::V0
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# .perltidyrc — @rtorcato/repo-tooling Perl preset
|
|
2
|
+
#
|
|
3
|
+
# perltidy is the formatter; Perl::Critic (see .perlcriticrc) is the linter.
|
|
4
|
+
#
|
|
5
|
+
# Order matters in this file: -pbp is a bundle that sets many options at once,
|
|
6
|
+
# so every deviation from it has to come afterwards to win.
|
|
7
|
+
|
|
8
|
+
# Perl Best Practices as the base: 4-column indents, no cuddled else,
|
|
9
|
+
# consistent operator spacing.
|
|
10
|
+
-pbp
|
|
11
|
+
|
|
12
|
+
# 100 columns rather than PBP's 78 — the same width the JavaScript and Swift
|
|
13
|
+
# presets in this distribution use, so a polyglot repo wraps consistently.
|
|
14
|
+
-l=100
|
|
15
|
+
|
|
16
|
+
# Keep up to two consecutive blank lines instead of collapsing to one:
|
|
17
|
+
# deliberate vertical grouping inside a long sub is worth preserving.
|
|
18
|
+
-mbl=2
|
|
19
|
+
|
|
20
|
+
# Deliberately NOT set here: -b (in-place edit) and -bext. They change what a
|
|
21
|
+
# bare `perltidy lib/Foo.pm` does for a human running it by hand — it would
|
|
22
|
+
# silently rewrite the file instead of producing Foo.pm.tdy. The pre-commit
|
|
23
|
+
# hook and the CI job pass those flags explicitly, where in-place is the point.
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
; mypy.ini — @rtorcato/repo-tooling Python preset
|
|
2
|
+
;
|
|
3
|
+
; Strict-by-default on your own code, lenient on third-party packages that ship
|
|
4
|
+
; no type information. Without the second half, a single untyped dependency
|
|
5
|
+
; turns every import into an error and the whole run gets ignored.
|
|
6
|
+
|
|
7
|
+
[mypy]
|
|
8
|
+
python_version = 3.10
|
|
9
|
+
strict = True
|
|
10
|
+
warn_unused_configs = True
|
|
11
|
+
warn_unreachable = True
|
|
12
|
+
show_error_codes = True
|
|
13
|
+
exclude = (^|/)(build|dist|\.venv)/
|
|
14
|
+
|
|
15
|
+
; Tests exercise deliberately-wrong inputs, so full strictness there costs more
|
|
16
|
+
; than it catches.
|
|
17
|
+
[mypy-tests.*]
|
|
18
|
+
disallow_untyped_defs = False
|
|
19
|
+
|
|
20
|
+
[mypy-tests.*.*]
|
|
21
|
+
disallow_untyped_defs = False
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
; pytest.ini — @rtorcato/repo-tooling Python preset
|
|
2
|
+
;
|
|
3
|
+
; A standalone file rather than [tool.pytest.ini_options] in pyproject.toml:
|
|
4
|
+
; pyproject is the project's own metadata, and merging a table into it needs a
|
|
5
|
+
; TOML round-tripper this CLI does not carry. pytest reads pytest.ini first.
|
|
6
|
+
|
|
7
|
+
[pytest]
|
|
8
|
+
testpaths = tests
|
|
9
|
+
; Fail on an unregistered marker or an unknown config key — both are typos that
|
|
10
|
+
; otherwise silently skip tests.
|
|
11
|
+
addopts = --strict-markers --strict-config
|
|
12
|
+
; A warning that nobody ever sees is a bug waiting for a major version bump.
|
|
13
|
+
filterwarnings =
|
|
14
|
+
error
|
|
15
|
+
ignore::DeprecationWarning:pkg_resources.*
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# ruff.toml — @rtorcato/repo-tooling Python preset
|
|
2
|
+
#
|
|
3
|
+
# Ruff is both the linter and the formatter here. Its formatter is
|
|
4
|
+
# black-compatible, so a separate black config would be a second rewriting
|
|
5
|
+
# formatter fighting the first — see src/languages/python/checks.ts.
|
|
6
|
+
|
|
7
|
+
line-length = 100
|
|
8
|
+
target-version = "py310"
|
|
9
|
+
|
|
10
|
+
exclude = [
|
|
11
|
+
".venv",
|
|
12
|
+
"build",
|
|
13
|
+
"dist",
|
|
14
|
+
]
|
|
15
|
+
|
|
16
|
+
[lint]
|
|
17
|
+
# E/W pycodestyle, F pyflakes, I isort, UP pyupgrade, B bugbear,
|
|
18
|
+
# SIM simplify, RUF ruff-specific. The set flake8 + isort + pyupgrade would
|
|
19
|
+
# have given you, minus the four extra dependencies.
|
|
20
|
+
select = ["E", "W", "F", "I", "UP", "B", "SIM", "RUF"]
|
|
21
|
+
|
|
22
|
+
# E501 is the formatter's job — leaving it on makes every long string a lint
|
|
23
|
+
# error the formatter is not allowed to fix.
|
|
24
|
+
ignore = ["E501"]
|
|
25
|
+
|
|
26
|
+
[lint.per-file-ignores]
|
|
27
|
+
# Test files legitimately shadow names and use bare asserts.
|
|
28
|
+
"tests/**" = ["S101"]
|
|
29
|
+
|
|
30
|
+
[format]
|
|
31
|
+
quote-style = "double"
|
|
32
|
+
indent-style = "space"
|