Skip to content

Commit 85a8798

Browse files
committed
added prettier
1 parent 69953a1 commit 85a8798

File tree

14 files changed

+884
-633
lines changed

14 files changed

+884
-633
lines changed

.prettierrc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"endOfLine": "auto",
3+
"semi": true,
4+
"tabWidth": 4,
5+
"trailingComma": "es5",
6+
"printWidth": 120
7+
}

.vscode/settings.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{
2+
"editor.formatOnSave": true,
23
"cSpell.words": [
34
"datafactory",
45
"dataset",
@@ -15,4 +16,4 @@
1516
"tenantid",
1617
"vsts"
1718
]
18-
}
19+
}

delete-adf-items/v2/deleteadfitems.ts

Lines changed: 157 additions & 116 deletions
Large diffs are not rendered by default.

delete-adf-items/v2/models/azureModels.ts

Lines changed: 40 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
11
/*
22
* Azure Pipelines Azure Datafactory Delete Items Task
3-
*
3+
*
44
* Copyright (c) 2020 Jan Pieter Posthuma / DataScenarios
5-
*
5+
*
66
* All rights reserved.
7-
*
7+
*
88
* MIT License.
9-
*
9+
*
1010
* Permission is hereby granted, free of charge, to any person obtaining a copy
1111
* of this software and associated documentation files (the "Software"), to deal
1212
* in the Software without restriction, including without limitation the rights
1313
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
1414
* copies of the Software, and to permit persons to whom the Software is
1515
* furnished to do so, subject to the following conditions:
16-
*
16+
*
1717
* The above copyright notice and this permission notice shall be included in
1818
* all copies or substantial portions of the Software.
19-
*
19+
*
2020
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
2121
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
2222
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
@@ -26,10 +26,9 @@
2626
* THE SOFTWARE.
2727
*/
2828

29-
import * as task from 'azure-pipelines-task-lib/task';
29+
import * as task from "azure-pipelines-task-lib/task";
3030

3131
export class AzureModels {
32-
3332
private connectedServiceName: string;
3433
private subscriptionId: string;
3534
private subscriptionName: string;
@@ -42,25 +41,41 @@ export class AzureModels {
4241
constructor(connectedServiceName: string) {
4342
try {
4443
this.connectedServiceName = connectedServiceName;
45-
if (this.connectedServiceName==='local') { // local debug
46-
this.subscriptionId = task.getInput('subscriptionid', true);
47-
this.subscriptionName = task.getInput('subscriptionname', true);
48-
this.servicePrincipalClientId = task.getInput('serviceprincipalid', true);
49-
this.servicePrincipalKey = task.getInput('serviceprincipalkey', true);
50-
this.environmentAuthorityUrl = task.getInput('environmentAuthorityUrl', true);
51-
this.tenantId = task.getInput('tenantid', true);
52-
this.url = task.getInput('connectedServiceNameUrl', true);
44+
if (this.connectedServiceName === "local") {
45+
// local debug
46+
this.subscriptionId = task.getInput("subscriptionid", true);
47+
this.subscriptionName = task.getInput("subscriptionname", true);
48+
this.servicePrincipalClientId = task.getInput("serviceprincipalid", true);
49+
this.servicePrincipalKey = task.getInput("serviceprincipalkey", true);
50+
this.environmentAuthorityUrl = task.getInput("environmentAuthorityUrl", true);
51+
this.tenantId = task.getInput("tenantid", true);
52+
this.url = task.getInput("connectedServiceNameUrl", true);
5353
} else {
54-
this.subscriptionId = task.getEndpointDataParameter(this.connectedServiceName, 'subscriptionid', true);
55-
this.subscriptionName = task.getEndpointDataParameter(this.connectedServiceName, 'subscriptionname', true);
56-
this.servicePrincipalClientId = task.getEndpointAuthorizationParameter(this.connectedServiceName, 'serviceprincipalid', true);
57-
this.servicePrincipalKey = task.getEndpointAuthorizationParameter(this.connectedServiceName, 'serviceprincipalkey', true);
58-
this.environmentAuthorityUrl = task.getEndpointDataParameter(this.connectedServiceName, 'environmentAuthorityUrl', true);
59-
this.tenantId = task.getEndpointAuthorizationParameter(this.connectedServiceName, 'tenantid', false);
54+
this.subscriptionId = task.getEndpointDataParameter(this.connectedServiceName, "subscriptionid", true);
55+
this.subscriptionName = task.getEndpointDataParameter(
56+
this.connectedServiceName,
57+
"subscriptionname",
58+
true
59+
);
60+
this.servicePrincipalClientId = task.getEndpointAuthorizationParameter(
61+
this.connectedServiceName,
62+
"serviceprincipalid",
63+
true
64+
);
65+
this.servicePrincipalKey = task.getEndpointAuthorizationParameter(
66+
this.connectedServiceName,
67+
"serviceprincipalkey",
68+
true
69+
);
70+
this.environmentAuthorityUrl = task.getEndpointDataParameter(
71+
this.connectedServiceName,
72+
"environmentAuthorityUrl",
73+
true
74+
);
75+
this.tenantId = task.getEndpointAuthorizationParameter(this.connectedServiceName, "tenantid", false);
6076
this.url = task.getEndpointUrl(this.connectedServiceName, true);
6177
}
62-
}
63-
catch(err) {
78+
} catch (err) {
6479
throw new Error(task.loc("AzureModels_ConstructorFailed", err.message));
6580
}
6681
}
@@ -92,4 +107,4 @@ export class AzureModels {
92107
public getUrl(): string {
93108
return this.url;
94109
}
95-
}
110+
}

delete-adf-items/v2/models/taskParameters.ts

Lines changed: 26 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
11
/*
22
* Azure Pipelines Azure Datafactory Delete Items Task
3-
*
3+
*
44
* Copyright (c) 2020 Jan Pieter Posthuma / DataScenarios
5-
*
5+
*
66
* All rights reserved.
7-
*
7+
*
88
* MIT License.
9-
*
9+
*
1010
* Permission is hereby granted, free of charge, to any person obtaining a copy
1111
* of this software and associated documentation files (the "Software"), to deal
1212
* in the Software without restriction, including without limitation the rights
1313
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
1414
* copies of the Software, and to permit persons to whom the Software is
1515
* furnished to do so, subject to the following conditions:
16-
*
16+
*
1717
* The above copyright notice and this permission notice shall be included in
1818
* all copies or substantial portions of the Software.
19-
*
19+
*
2020
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
2121
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
2222
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
@@ -26,15 +26,14 @@
2626
* THE SOFTWARE.
2727
*/
2828

29-
import * as task from 'azure-pipelines-task-lib/task';
29+
import * as task from "azure-pipelines-task-lib/task";
3030

3131
export enum SortingDirection {
3232
Ascending,
33-
Descending
33+
Descending,
3434
}
3535

3636
export class TaskParameters {
37-
3837
private connectedServiceName: string;
3938
private resourceGroupName: string;
4039
private datafactoryName: string;
@@ -51,31 +50,30 @@ export class TaskParameters {
5150

5251
constructor() {
5352
try {
54-
this.connectedServiceName = task.getInput('ConnectedServiceName', true);
55-
this.resourceGroupName = task.getInput('ResourceGroupName', true);
56-
this.datafactoryName = task.getInput('DatafactoryName', true);
53+
this.connectedServiceName = task.getInput("ConnectedServiceName", true);
54+
this.resourceGroupName = task.getInput("ResourceGroupName", true);
55+
this.datafactoryName = task.getInput("DatafactoryName", true);
5756

58-
this.serviceFilter = task.getInput('ServiceFilter', false);
59-
this.pipelineFilter = task.getInput('PipelineFilter', false);
60-
this.dataflowFilter = task.getInput('DataflowFilter', false);
61-
this.datasetFilter = task.getInput('DatasetFilter', false);
62-
this.triggerFilter = task.getInput('TriggerFilter', false);
57+
this.serviceFilter = task.getInput("ServiceFilter", false);
58+
this.pipelineFilter = task.getInput("PipelineFilter", false);
59+
this.dataflowFilter = task.getInput("DataflowFilter", false);
60+
this.datasetFilter = task.getInput("DatasetFilter", false);
61+
this.triggerFilter = task.getInput("TriggerFilter", false);
6362

64-
this.continue = task.getBoolInput('Continue', false);
65-
this.throttle = Number.parseInt(task.getInput('Throttle', false));
66-
this.throttle = (this.throttle === NaN ? 5 : this.throttle);
63+
this.continue = task.getBoolInput("Continue", false);
64+
this.throttle = Number.parseInt(task.getInput("Throttle", false));
65+
this.throttle = this.throttle === NaN ? 5 : this.throttle;
6766

68-
let sorting = task.getInput('Sorting', true);
67+
let sorting = task.getInput("Sorting", true);
6968
switch (sorting.toLowerCase()) {
70-
case 'ascending':
71-
this.sorting = SortingDirection.Ascending
69+
case "ascending":
70+
this.sorting = SortingDirection.Ascending;
7271
break;
73-
case 'descending':
74-
this.sorting = SortingDirection.Descending
72+
case "descending":
73+
this.sorting = SortingDirection.Descending;
7574
break;
7675
}
77-
}
78-
catch (err) {
76+
} catch (err) {
7977
throw new Error(task.loc("TaskParameters_ConstructorFailed", err.message));
8078
}
8179
}
@@ -87,7 +85,7 @@ export class TaskParameters {
8785
public get ResourceGroupName(): string {
8886
return this.resourceGroupName;
8987
}
90-
88+
9189
public get DatafactoryName(): string {
9290
return this.datafactoryName;
9391
}

0 commit comments

Comments
 (0)