Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: linter errors
Browse files Browse the repository at this point in the history
10ko committed Dec 17, 2019
1 parent 6f930fb commit 7528d2d
Showing 2 changed files with 19 additions and 7 deletions.
18 changes: 11 additions & 7 deletions garden-service/src/analytics/analytics.ts
Original file line number Diff line number Diff line change
@@ -201,6 +201,16 @@ export class AnalyticsHandler {
// Subscribe to the TaskGraph events
this.garden.events.onAny((name, payload) => this.processEvent(name, payload))

this.projectMetadata = await this.generateProjectMetadata()

return this
}

hasOptedIn(): boolean {
return this.globalConfig.optedIn || false
}

private async generateProjectMetadata() {
// Generate the project metadata
const configGraph = await this.garden.getConfigGraph(this.log)
const modules = await configGraph.getModules()
@@ -211,19 +221,13 @@ export class AnalyticsHandler {
const tests = modules.map((m) => m.testConfigs)
const numberOfTests = ([] as TestConfig[]).concat(...tests).length

this.projectMetadata = {
return {
numberOfModules: modules.length,
modulesTypes,
numberOfTasks: tasks.length,
numberOfServices: services.length,
numberOfTests,
}

return this
}

hasOptedIn(): boolean {
return this.globalConfig.optedIn || false
}

private getBasicAnalyticsProperties(): AnalyticsEventProperties {
8 changes: 8 additions & 0 deletions garden-service/src/config/validation.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
/*
* Copyright (C) 2018 Garden Technologies, Inc. <[email protected]>
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/

import Joi from "@hapi/joi"
import { ConfigurationError, LocalConfigError } from "../exceptions"
import chalk from "chalk"

0 comments on commit 7528d2d

Please sign in to comment.