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

Avoid reporting balenarc parsing errors #2094

Merged
1 commit merged into from
Nov 11, 2020
Merged

Avoid reporting balenarc parsing errors #2094

1 commit merged into from
Nov 11, 2020

Conversation

srlowe
Copy link
Contributor

@srlowe srlowe commented Nov 11, 2020

Change-type: patch
Connects-to: #1100
Signed-off-by: Scott Lowe scott@balena.io

@srlowe srlowe requested a review from a team as a code owner November 11, 2020 15:36
lib/errors.ts Outdated
@@ -156,6 +156,7 @@ const EXPECTED_ERROR_REGEXES = [
/must also be provided when using/, // oclif parser (depends-on)
/^Expected an integer/, // oclif parser (flags.integer)
/^Flag .* expects a value/, // oclif parser
/^Error parsing config file.*.balenarc.yml/,
Copy link
Contributor

Choose a reason for hiding this comment

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

The two dots in the substring .balenarc.yml are interpreted in the regex sense of "any character" and I guess this was not intentional, although it works. Note that:

  • The homedir configuration file is named _balenarc.yml on Windows and .balenarc.yml on Linux/macOS.
  • A file named balenarc.yml (without a _ or . as prefixes) on the current working directory takes precedence over the homedir configuration file (documentation).

The regex works anyway because .*. means the same as .*, but I think it would be more... "canonical" to write:

/^Error parsing config file.*balenarc\.yml/,

Change-type: patch
Connects-to: #1100
Signed-off-by: Scott Lowe <scott@balena.io>
@ghost ghost merged commit 54dc37d into master Nov 11, 2020
@ghost ghost deleted the expect-invalid-yaml branch November 11, 2020 17:23
This pull request was closed.
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.

None yet

2 participants