Skip to content

Conversation

@thejchap
Copy link
Contributor

@thejchap thejchap commented May 14, 2025

Summary

astral-sh/ty#217

  • Adds a --config-file CLI option which overrides discovered configuration files
  • Introduces MetaOptions (not very sold on the name...) that encapsulates both options passed by the CLI, as well as the config file override, which influences how ProjectMetadata gets discovered/created (which the CLI options then get applied to).
  • Ensure the config file passed by this arg is watched for changes

Test Plan

  • Snapshot test
  • Updated file watching tests to accept MetaOptions and tested watching for changes on the provided config file override
  • Manual e2e testing

@thejchap thejchap force-pushed the feature/config-file branch from 040f0c5 to f622e7a Compare May 14, 2025 01:58
@github-actions
Copy link
Contributor

github-actions bot commented May 14, 2025

mypy_primer results

No ecosystem changes detected ✅

@AlexWaygood AlexWaygood added cli Related to the command-line interface ty Multi-file analysis & type inference labels May 14, 2025
@sharkdp sharkdp requested review from sharkdp and removed request for sharkdp May 14, 2025 06:35
@thejchap thejchap force-pushed the feature/config-file branch 2 times, most recently from 53f8bc2 to 93d17a1 Compare May 17, 2025 00:07
@thejchap thejchap force-pushed the feature/config-file branch from 93d17a1 to a1c04ab Compare May 17, 2025 00:16
@thejchap thejchap changed the title [ty] Add --config-file [ty] Add --config-file CLI arg May 17, 2025
@thejchap thejchap force-pushed the feature/config-file branch 2 times, most recently from 940bf59 to 88a623b Compare May 17, 2025 00:40
@thejchap
Copy link
Contributor Author

@MichaReiser still needs tests but ready for some feedback on the direction

@thejchap thejchap marked this pull request as ready for review May 17, 2025 00:43
Copy link
Member

@MichaReiser MichaReiser left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The direction looks great to me and it's a nice scoped change. This is turning out great

@AlexWaygood AlexWaygood removed their request for review May 17, 2025 15:29
@thejchap thejchap force-pushed the feature/config-file branch from 88a623b to f452fa0 Compare May 18, 2025 17:57
@carljm carljm removed their request for review May 18, 2025 17:59
@MichaReiser
Copy link
Member

@thejchap let me know when this is ready for review (a bit hard to tell because it was already ready for review).

@thejchap thejchap marked this pull request as draft May 18, 2025 18:26
@thejchap
Copy link
Contributor Author

@MichaReiser converted back to draft, sorry about that - will mark ready for review once i get tests in

for the future - what's the preferred workflow for this type of situation? (ie. looking for feedback on in-progress pr, but pr isn't quite "merge ready")

@MichaReiser
Copy link
Member

No worries. The way you asked for early feedback was great

for the future - what's the preferred workflow for this type of situation? (ie. looking for feedback on in-progress pr, but pr isn't quite "merge ready")

I tend to only look at PRs that are ready for review unless I get tagged. What I find most useful is if the PRs is put back into draft mode if you plan on making more changes before getting a review. This makes it very clear to me that the PR is ready for review when you change its status again.

@thejchap thejchap force-pushed the feature/config-file branch from f452fa0 to 75a9e5e Compare May 22, 2025 04:47
@thejchap thejchap force-pushed the feature/config-file branch 3 times, most recently from 7a25e54 to fc9b208 Compare May 23, 2025 05:37
@thejchap thejchap marked this pull request as ready for review May 23, 2025 05:42
@thejchap
Copy link
Contributor Author

@MichaReiser ready for review

@sharkdp sharkdp removed their request for review May 23, 2025 07:22
Copy link
Member

@MichaReiser MichaReiser left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is excellent work. Thank you! I've a few small nit comments but this is otherwise good to go)

@thejchap thejchap force-pushed the feature/config-file branch 4 times, most recently from cc3ad4d to 555ce85 Compare May 26, 2025 16:19
@github-actions
Copy link
Contributor

github-actions bot commented May 26, 2025

ruff-ecosystem results

Linter (stable)

✅ ecosystem check detected no linter changes.

Linter (preview)

✅ ecosystem check detected no linter changes.

@thejchap thejchap force-pushed the feature/config-file branch 3 times, most recently from 767f0ee to 3b73405 Compare May 27, 2025 02:14
@thejchap thejchap force-pushed the feature/config-file branch from 3b73405 to 991e829 Compare May 27, 2025 02:17
@MichaReiser MichaReiser merged commit 8d5655a into astral-sh:main May 27, 2025
35 checks passed
carljm added a commit to MatthewMckee4/ruff that referenced this pull request May 28, 2025
* main: (246 commits)
  [ty] Simplify signature types, use them in `CallableType` (astral-sh#18344)
  [ty] Support ephemeral uv virtual environments (astral-sh#18335)
  Add a `ViolationMetadata::rule` method (astral-sh#18234)
  Return `DiagnosticGuard` from `Checker::report_diagnostic` (astral-sh#18232)
  [flake8_use_pathlib]: Replace os.symlink with Path.symlink_to (PTH211) (astral-sh#18337)
  [ty] Support cancellation and retry in the server (astral-sh#18273)
  [ty] Synthetic function-like callables (astral-sh#18242)
  [ty] Support publishing diagnostics in the server (astral-sh#18309)
  Add Autofix for ISC003 (astral-sh#18256)
  [`pyupgrade`]: new rule UP050 (`useless-class-metaclass-type`) (astral-sh#18334)
  [pycodestyle] Make `E712` suggestion not assume a context (astral-sh#18328)
  put similar dunder-call tests next to each other (astral-sh#18343)
  [ty] Derive `PartialOrd, Ord` for `KnownInstanceType` (astral-sh#18340)
  [ty] Simplify `Type::try_bool()` (astral-sh#18342)
  [ty] Simplify `Type::normalized` slightly (astral-sh#18339)
  [ty] Move arviz off the list of selected primer projects (astral-sh#18336)
  [ty] Add --config-file CLI arg (astral-sh#18083)
  [ty] Tell the user why we inferred a certain Python version when reporting version-specific syntax errors (astral-sh#18295)
  [ty] Implement implicit inheritance from `Generic[]` for PEP-695 generic classes (astral-sh#18283)
  [ty] Add hint if async context manager is used in non-async with statement (astral-sh#18299)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cli Related to the command-line interface ty Multi-file analysis & type inference

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants