Skip to content

fix(cmd): CLI Config Relative Imports#279

Merged
jshlbrd merged 2 commits intomainfrom
jshlbrd/fix/cli-relative-imports
Nov 27, 2024
Merged

fix(cmd): CLI Config Relative Imports#279
jshlbrd merged 2 commits intomainfrom
jshlbrd/fix/cli-relative-imports

Conversation

@jshlbrd
Copy link
Contributor

@jshlbrd jshlbrd commented Nov 26, 2024

Description

Closes #275 by supporting relative imports.

Motivation and Context

This fixes the relative import problem by switching the directory to each config (jsonnet, libsonnet) file's directory during every test or vet call.

How Has This Been Tested?

Tested with an internal repo that has 10s to 100s of config files containing relative imports (substation test -R, substation vet -R).

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.

@jshlbrd jshlbrd assigned jshlbrd and jtan-brex and unassigned jshlbrd Nov 26, 2024
@jshlbrd jshlbrd marked this pull request as ready for review November 26, 2024 17:12
@jshlbrd jshlbrd requested a review from a team as a code owner November 26, 2024 17:12
Copy link
Contributor

@jtan-brex jtan-brex left a comment

Choose a reason for hiding this comment

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

Tested and work as expected! left two comments about adding default case in switch filepath.Ext(path) for both test and vet CLI

@jshlbrd jshlbrd merged commit 3b18bfe into main Nov 27, 2024
@jshlbrd jshlbrd deleted the jshlbrd/fix/cli-relative-imports branch November 27, 2024 15:18
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.

Regression in CLI Tool Testing Subcommand

2 participants