Skip to content

feat(CLI): Support per-user config #60

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

Merged
merged 1 commit into from
Apr 25, 2022
Merged

feat(CLI): Support per-user config #60

merged 1 commit into from
Apr 25, 2022

Conversation

gaocegege
Copy link
Member

A config file ~/.midi/config.MIDI is introduced

vscode(plugins = [
    "ms-vscode.cpptools-1.7.1",
    "github.copilot-1.12.5517"
])

You can define some MIDI statements and it works for all environments

Fix #22

Signed-off-by: Ce Gao [email protected]

@gaocegege gaocegege requested a review from VoVAllen April 25, 2022 06:18
Copy link
Member

@VoVAllen VoVAllen left a comment

Choose a reason for hiding this comment

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

LGTM

@@ -64,6 +66,11 @@ func (b generalBuilder) GPUEnabled() bool {

func (b generalBuilder) Build(ctx context.Context) error {
interpreter := starlark.NewInterpreter()
// Evaluate config first.
if _, err := interpreter.ExecFile(b.configFilePath); err != nil {
Copy link
Member

Choose a reason for hiding this comment

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

So ~/.midi/config.MIDI will be executed after the midi file in the project?

Copy link
Member Author

Choose a reason for hiding this comment

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

The behavior now is to eval the config first, then the build.MIDI. I am not sure if it is expected, actually

@@ -64,6 +66,11 @@ func (b generalBuilder) GPUEnabled() bool {

func (b generalBuilder) Build(ctx context.Context) error {
interpreter := starlark.NewInterpreter()
// Evaluate config first.
if _, err := interpreter.ExecFile(b.configFilePath); err != nil {
Copy link
Member

Choose a reason for hiding this comment

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

And where's the default file name?

Copy link
Member Author

Choose a reason for hiding this comment

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

@gaocegege gaocegege merged commit d1581a8 into main Apr 25, 2022
@gaocegege gaocegege deleted the config branch April 25, 2022 07:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Archived in project
Development

Successfully merging this pull request may close these issues.

feat(lang): Support per-user config and runtime override
2 participants