Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: default config overwrite #719

Merged
merged 1 commit into from
Dec 17, 2024

Conversation

nemanja-m
Copy link
Contributor

This PR fixes #718.

After the v1.61.4 release, the user-specified config is overwritten by default values

This commit introduced a bug:

c8498c2#diff-19e19f16fa5018b7ad46fc960cdbe0138b0029dac020b42c798a9ff9b8203493R14


Initial configuration is updated with command line args:

https://github.com/air-verse/air/blob/master/main.go#L97

but, when defaultConfig is used in

https://github.com/air-verse/air/blob/master/runner/flag.go#L9-L17

all command line values are set to default, effectively overwriting everything from user-specified .air.toml.

This PR ensures that only command-line arguments that differ from default values overwrite the config. This is safe since the initial config is based on the default and the user’s .air.toml.

Copy link

@PThorpe92 PThorpe92 left a comment

Choose a reason for hiding this comment

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

haha you beat me to it. LGTM 👍

@xiantang
Copy link
Collaborator

im checking

Copy link

codecov bot commented Dec 17, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Files with missing lines Coverage Δ
runner/config.go 76.47% <100.00%> (+0.19%) ⬆️
runner/flag.go 100.00% <ø> (ø)

... and 1 file with indirect coverage changes

@xiantang xiantang merged commit 0232344 into air-verse:master Dec 17, 2024
8 checks passed
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.

Config file not working?
5 participants