Skip to content

Tm1 provider - #36

Open
onefloid wants to merge 2 commits into
mainfrom
tm1-provider
Open

Tm1 provider#36
onefloid wants to merge 2 commits into
mainfrom
tm1-provider

Conversation

@onefloid

Copy link
Copy Markdown
Member

No description provided.

`--select` could only replace the whole rule set. Two new selectors adjust
it instead:

    linti processes/ --extend-select D110 --ignore F220

Same patterns as --select, repeatable and comma-separated. --exclude-rule
wins over everything, --select replaces, --extend-select adds; both selects
override `enabled: false`.

Selectors that cannot take effect now warn instead of failing silently: a
typo (F22O) points at `linti explain`, and P900 — the parser's nesting cap,
which has no rule to add or drop — points at `max_nesting_depth`. Parsed
once per run via RuleSelection, since lint_files builds a rule set per file.

Assited by: Claude Code
Read-only TM1 provider behind a new `linti tm1` command group.

- `pip install "linti[tm1]"` — TM1py/keyring optional; the provider is
  duck-typed and works without them installed.
- Passwords in the system keyring (`linti tm1 login`), resolved via
  env var → keyring → TTY prompt. No `--password` flag.
- Profiles in a per-user `connections.yaml` that cannot hold secrets.
- Generated-statements block and CRLF stripped, so no F270 noise and
  line numbers match the process editor.
- No write-back yet: `--auto-fix` is refused with an explanation.

Also fixes `from linti import *`, which raised AttributeError.

Assisted by: Claude Code
@onefloid

Copy link
Copy Markdown
Member Author

Reviewed main...HEAD (2 commits: --extend-select/--exclude-rule selectors, and the read-only TM1 provider + linti tm1 command group). Full suite passes (1484 tests). The selector precedence logic in rule_factory.py checked out — exclude → select → extend_select → enabled is implemented exactly as documented, enabled is genuinely dead after the gate, and all call sites were migrated to RuleSelection. decode_procedure's prefix/newline invariant holds across the edge cases I traced (leading blanks, repeated marker pairs, unterminated BEGIN, no trailing newline, empty input).

Findings:

src/linti/tm1/connections.py:70 — Secret-key guard is case-sensitive and covers only 5 exact names. Password:/PASSWORD:/pwd: falls through to pydantic's extra_forbidden error, which renders input_value='hunter2'; that string becomes the ConnectionsError message and _load_profile echoes it to stderr. Directly defeats the guarantee stated in the module docstring; the existing test only covers lowercase password.
src/linti/provider/tm1.py:77 — source_end_line is one past the last content line whenever the procedure ends with a newline (i.e. always, for TM1). Diverges from ti.py/pa_code.py/ti_regions.py, so is_end_of_procedure never fires on the real last line and e.g. nA = 1; nB = 2; on the final line gets an F320 from the server that the identical .ti file does not. tests/test_tm1_provider.py:84 currently pins the wrong value.
src/linti/cli/tm1_cli.py:220 — server_version(tm1) makes a live REST call inside a try that only catches TM1ConnectionError; a 403/timeout on /Configuration/ProductVersion aborts linti tm1 login with a raw traceback after authentication succeeded.
src/linti/tm1/connections.py:170 — cls(**raw) raises TypeError (not ValueError) on non-string top-level YAML keys (on:, 2024:), escaping the handler and the ConnectionsError contract. model_validate(raw) would fix it.
src/linti/tm1/connections.py:40 — decode_b64 is a boolean flag, not a secret; listing it in _SECRET_FIELDS produces a misleading "linti never stores secrets on disk … run linti tm1 login" message.
README.md:636 — precedence list item 3 reads --extend-select / --extend-select (duplicated flag name).
One process note outside the finding list: pyproject.toml is still at 0.7.0 despite two features, and CLAUDE.md asks for a version bump after a feature.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant