Skip to content

Remove the resolved TODO from Sources::Local - #3146

Merged
pocke merged 1 commit into
masterfrom
remove-stale-local-source-todo
Sep 7, 2026
Merged

Remove the resolved TODO from Sources::Local#3146
pocke merged 1 commit into
masterfrom
remove-stale-local-source-todo

Conversation

@pocke

@pocke pocke commented Sep 7, 2026

Copy link
Copy Markdown
Member

Sources::Local#initialize carries a TODO asking to resolve a relative source path from the directory of rbs_collection.yaml. That was done three and a half years ago and the comment was left behind. This deletes it.

Where the TODO came from

The comment arrived in 61dd0e4, a force-push of #854 dated 2022-02-11, where the constructor looked like this:

def initialize(source_entry)
  # TODO: resolve relative path from dir of rbs_collection.yaml
  @path = Pathname(source_entry['path'])
end

The path really was taken as written and resolved against the working directory, so the TODO described the code accurately at the time.

Where it was answered

86f4ec5, pushed to the same PR on 2023-02-08, added the base_directory: keyword to Sources.from_config_entry and changed the body to base_directory / path:

def initialize(path:, base_directory:)
  # TODO: resolve relative path from dir of rbs_collection.yaml
  @path = base_directory / path
end

Config#sources passes @config_path.dirname and Lockfile.from_lockfile passes lockfile_path.dirname, so from that commit on a relative path has been resolved from the directory holding the configuration, which is what the TODO asked for. Only the code was updated; the comment stayed.

#854 ran from 2021-12-23 to 2023-02-17 and its commits were squashed into 718997e, so the TODO and the change that answered it landed in the same commit. That is why the leftover is not visible from git log -L on the file.

Alternatives considered

#3124 removes the same comment, but also changes @full_path to (base_directory / path).expand_path. That is a separate change with its own behaviour: it only matters when base_directory is relative, which the rbs CLI never produces, since config_path is either an absolute path from Config.find_config_path or the expanded argument of --collection. It can be reached by callers that build a Lockfile with a relative path, such as Steep. Keeping the two apart lets this one land as the pure comment deletion it is, and leaves the expand_path question to be decided on its own merits with a test.

Close #3124

#854

🤖 Generated with Claude Code

https://claude.ai/code/session_01HSq3kKMB8ULhZrnL5urD7y

`Sources::Local#initialize` carries a TODO asking to resolve a relative
source path from the directory of `rbs_collection.yaml`. That was done
three and a half years ago and the comment was left behind.

The TODO arrived in 61dd0e4, a force-push of #854 dated 2022-02-11,
where the constructor was:

    def initialize(source_entry)
      # TODO: resolve relative path from dir of rbs_collection.yaml
      @path = Pathname(source_entry['path'])
    end

There the path really was taken as written and resolved against the
working directory, so the TODO described the code accurately.

86f4ec5, pushed to the same PR on 2023-02-08, added the
`base_directory:` keyword to `Sources.from_config_entry` and changed the
body to `base_directory / path`. `Config#sources` passes
`@config_path.dirname` and `Lockfile.from_lockfile` passes
`lockfile_path.dirname`, so from that point a relative path has been
resolved from the directory holding the configuration -- exactly what
the TODO asked for. Only the code was updated; the comment stayed.

#854 ran from 2021-12-23 to 2023-02-17 and its commits were squashed
into 718997e, so the TODO and the change that answered it landed in one
commit and the leftover was invisible in the history.

Close #3124

#854

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HSq3kKMB8ULhZrnL5urD7y
@pocke
pocke enabled auto-merge September 7, 2026 09:44
@pocke
pocke added this pull request to the merge queue Sep 7, 2026
Merged via the queue into master with commit 3eafd6f Sep 7, 2026
24 checks passed
@pocke
pocke deleted the remove-stale-local-source-todo branch September 7, 2026 09:50
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