Skip to content

Commit

Permalink
formatting and lint fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
pinzon committed Feb 13, 2024
1 parent 39d9501 commit 2ae05f6
Show file tree
Hide file tree
Showing 13 changed files with 61 additions and 78 deletions.
8 changes: 4 additions & 4 deletions commands/help.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
async function run(context) {
async function run (context) {
// print out the help message of your plugin
context.print.info('When mplementing this provider, the resources will be created into LocalStack');
context.print.info('When mplementing this provider, the resources will be created into LocalStack')
}

module.exports = {
run,
};
run
}
8 changes: 4 additions & 4 deletions commands/version.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
async function run(context) {
async function run (context) {
// print out the version of your plugin package
context.print.info('version command to be implemented.');
context.print.info('version command to be implemented.')
}

module.exports = {
run,
};
run
}
8 changes: 3 additions & 5 deletions event-handlers/handle-InternalOnlyPostEnvRemove.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
const eventName = 'InternalOnlyPostEnvRemove';

async function run(context, args) {
async function run (context, args) {
}

module.exports = {
run,
};
run
}
8 changes: 3 additions & 5 deletions event-handlers/handle-PostCodegenModels.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
const eventName = 'PostCodegenModels';

async function run(context, args) {
async function run (context, args) {
}

module.exports = {
run,
};
run
}
8 changes: 3 additions & 5 deletions event-handlers/handle-PostEnvAdd.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
const eventName = 'PostEnvAdd';

async function run(context, args) {
async function run (context, args) {
}

module.exports = {
run,
};
run
}
8 changes: 3 additions & 5 deletions event-handlers/handle-PostInit.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
const eventName = 'PostInit';

async function run(context, args) {
async function run (context, args) {
}

module.exports = {
run,
};
run
}
8 changes: 3 additions & 5 deletions event-handlers/handle-PostPull.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
const eventName = 'PostPull';

async function run(context, args) {
async function run (context, args) {
}

module.exports = {
run,
};
run
}
8 changes: 3 additions & 5 deletions event-handlers/handle-PostPush.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
const eventName = 'PostPush';

async function run(context, args) {
async function run (context, args) {
}

module.exports = {
run,
};
run
}
8 changes: 3 additions & 5 deletions event-handlers/handle-PreCodegenModels.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
const eventName = 'PostPreCodegenModels';

async function run(context, args) {
async function run (context, args) {
}

module.exports = {
run,
};
run
}
29 changes: 14 additions & 15 deletions event-handlers/handle-PreInit.js
Original file line number Diff line number Diff line change
@@ -1,29 +1,28 @@
const eventName = 'PreInit';
const yesno = require('yesno');
const patches = require("../patches")
const yesno = require('yesno')
const patches = require('../patches')

async function run(context, args) {
async function run (context, args) {
const options = context.parameters.options
const inputValue = options['use-localstack']
let doPatch = false
if (inputValue == undefined){
if (inputValue === undefined) {
doPatch = await yesno({
question: 'Do you want to create the project in LocalStack? [y/N]',
defaultValue: "n"
});
}else if (['true', 'yes'].includes(inputValue.toLowerCase())){
question: 'Do you want to create the project in LocalStack? [y/N]',
defaultValue: 'n'
})
} else if (['true', 'yes'].includes(inputValue.toLowerCase())) {
doPatch = true
}else if (['false', 'no'].includes(inputValue.toLowerCase())){
} else if (['false', 'no'].includes(inputValue.toLowerCase())) {
doPatch = false
}else{
context.print.error(`ERROR: "${value}" is an invalid value for parameter --use-localstack. Please use true or false`)
} else {
context.print.error(`ERROR: "${inputValue}" is an invalid value for parameter --use-localstack. Please use true or false`)
}

if (doPatch == true){
if (doPatch === true) {
patches.patchEverything(context)
}
}

module.exports = {
run,
};
run
}
8 changes: 3 additions & 5 deletions event-handlers/handle-PrePull.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
const eventName = 'PostPull';

async function run(context, args) {
async function run (context, args) {
}

module.exports = {
run,
};
run
}
28 changes: 14 additions & 14 deletions event-handlers/handle-PrePush.js
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
const yesno = require('yesno');
const patches = require("../patches")
const yesno = require('yesno')
const patches = require('../patches')

async function run(context, args) {
async function run (context, args) {
const options = context.parameters.options
const inputValue = options['use-localstack']
let doPatch = false
if (inputValue == undefined){
if (inputValue === undefined) {
doPatch = await yesno({
question: 'Do you want to create the resource in LocalStack? [y/N]',
defaultValue: "n"
});
}else if (['true', 'yes'].includes(inputValue.toLowerCase())){
question: 'Do you want to create the resource in LocalStack? [y/N]',
defaultValue: 'n'
})
} else if (['true', 'yes'].includes(inputValue.toLowerCase())) {
doPatch = true
}else if (['false', 'no'].includes(inputValue.toLowerCase())){
} else if (['false', 'no'].includes(inputValue.toLowerCase())) {
doPatch = false
}else{
context.print.error(`ERROR: "${value}" is an invalid value for parameter --use-localstack. Please use true or false`)
} else {
context.print.error(`ERROR: "${inputValue}" is an invalid value for parameter --use-localstack. Please use true or false`)
}

if (doPatch == true){
if (doPatch === true) {
patches.patchEverything(context)
}
}

module.exports = {
run,
};
run
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"lint": "eslint *.js"
"lint": "eslint ."
},
"author": "",
"license": "Apache 2.0",
Expand Down

0 comments on commit 2ae05f6

Please sign in to comment.