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

contextfile loading wip #3

Merged
merged 1 commit into from
May 19, 2021
Merged

contextfile loading wip #3

merged 1 commit into from
May 19, 2021

Conversation

davidmdm
Copy link
Collaborator

No description provided.

@davidmdm davidmdm requested a review from silphid May 19, 2021 03:35
Copy link
Owner

@silphid silphid left a comment

Choose a reason for hiding this comment

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

Good work! Voir commentaires, mais je merge quand même maintenant!

}

// parseContextFile unmarshals the contextFile data and resolves any parent contextfiles
func parseContextFile(data []byte) (*Contexts, error) {
Copy link
Owner

Choose a reason for hiding this comment

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

Pourquoi *Contexts plutôt que simplement Contexts? Je préfère n'utiliser les pointeurs que lorsque c'est utile ou nécessaire.


if errors.Is(err, os.ErrNotExist) {
if wd == "/" {
return nil, fmt.Errorf("failed to find a .yeyrc in directory hierarchy")
Copy link
Owner

Choose a reason for hiding this comment

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

Faut juste garder en tête que, présentement, si l'utilisateur ne travaille pas dans un sous-répertoire de son HOME, on ne regardera jamais pour un fichier ~/.yeyrc.yaml. Faudrait éventuellement rajouter que si on atteint le root ici, on regarde directement à ~/.yeyrc.yaml (au pire, on va déjà avoir regardé là si on était parti d'un sous-répertoire de HOME, mais au moins on le manquera pas dans le cas inverse).

@silphid silphid merged commit cd47b5d into master May 19, 2021
@silphid silphid deleted the contextfile-loading branch May 19, 2021 11:49
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.

2 participants