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

Added preloading configuration and tree parsing + refactor Doctor file #920

Merged
merged 3 commits into from
Aug 3, 2020

Conversation

piotradamczyk5
Copy link
Contributor

@piotradamczyk5 piotradamczyk5 commented Jul 30, 2020

Fixes #911 by adding preloading configuration and tree parsing + refactor Doctor file

Test Plan

How do we know the code works?

Running command firebase test android|ios doctor or flank android|ios doctor will show issue when cannot parse
.yml configuration (invalid example in root task).
Previously doctor validates only basic .yml parsing, now it pre-load configuration and validate tree to catch more errors

Checklist

  • Documented
  • Unit tested
  • release_notes.md updated

@piotradamczyk5 piotradamczyk5 self-assigned this Jul 30, 2020
@piotradamczyk5 piotradamczyk5 marked this pull request as ready for review July 31, 2020 14:57
@piotradamczyk5 piotradamczyk5 changed the title Added preload configuration to detekt .yml issues by Doctor Added preloading configuration and tree parsing + refactor Doctor file Jul 31, 2020
if (!data.toFile().exists()) return "Skipping yaml validation. No file at path $data"
return validateYaml(args, loadFile(data))
}
fun validateYaml(args: IArgs.ICompanion, data: Path): String {
Copy link
Contributor

@adamfilipow92 adamfilipow92 Aug 3, 2020

Choose a reason for hiding this comment

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

This is the only a proposal
WDYT?

fun validateYaml(args: IArgs.ICompanion, data: Path) =
    if (!data.toFile().exists()) "Skipping yaml validation. No file at path $data"
    else validateYaml(args, loadFile(data)) + preloadConfiguration(data, args is AndroidArgsCompanion)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure, updated 👍

@bootstraponline
Copy link
Contributor

This is awesome! Great idea to preload the entire config.

@piotradamczyk5 piotradamczyk5 force-pushed the #911-added-more-validation-to-doctor branch from 9973baa to 5dd7bea Compare August 3, 2020 14:32
Copy link
Contributor

@adamfilipow92 adamfilipow92 left a comment

Choose a reason for hiding this comment

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

Great work 👍

@piotradamczyk5 piotradamczyk5 merged commit 8076cdd into master Aug 3, 2020
@piotradamczyk5 piotradamczyk5 deleted the #911-added-more-validation-to-doctor branch August 3, 2020 15:23
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.

Flank Doctor doesn't catch invalid yaml
3 participants