Skip to content

Commit d466bc2

Browse files
committed
change if( to if (
1 parent c74b0de commit d466bc2

File tree

8 files changed

+14
-14
lines changed

8 files changed

+14
-14
lines changed

src/blocks/mrc_class_method_def.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ const CLASS_METHOD_DEF = {
214214
mrcRenameParameter: function (this: ClassMethodDefBlock, oldName: string, newName: string) {
215215
let nextBlock = this.getInputTargetBlock('STACK');
216216

217-
if(nextBlock){
217+
if (nextBlock){
218218
findConnectedBlocksOfType(nextBlock, MRC_GET_PARAMETER_BLOCK_NAME).forEach((block) => {
219219
if (block.getFieldValue('PARAMETER_NAME') === oldName) {
220220
block.setFieldValue(newName, 'PARAMETER_NAME');

src/blocks/mrc_get_parameter.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ const GET_PARAMETER_BLOCK = {
6666

6767
if (blockEvent.type === Blockly.Events.BLOCK_MOVE) {
6868
let parent = blockBlock.getRootBlock();
69-
if( parent.type === MRC_CLASS_METHOD_DEF) {
69+
if ( parent.type === MRC_CLASS_METHOD_DEF) {
7070
// It is a class method definition, so we see if this variable is in it.
7171
const classMethodDefBlock = parent as ClassMethodDefBlock;
7272
for (const parameter of classMethodDefBlock.mrcParameters) {

src/blocks/setup_custom_blocks.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ export const setup = function(forBlock: any) {
4545
customBlocks.forEach(block => {
4646
block.setup();
4747
const maybeBlock = block as { pythonFromBlock?: any; BLOCK_NAME?: string };
48-
if(maybeBlock.pythonFromBlock && maybeBlock.BLOCK_NAME) {
48+
if (maybeBlock.pythonFromBlock && maybeBlock.BLOCK_NAME) {
4949
forBlock[maybeBlock.BLOCK_NAME] = maybeBlock.pythonFromBlock;
5050
}
5151
});

src/blocks/utils/change_framework.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ export function registerCallback(blockType : string, blockEvents : string[], fun
3737
export function getParentOfType(block : Blockly.Block | null, type : string) : Blockly.Block | null{
3838
let parentBlock = block?.getParent();
3939
while(parentBlock){
40-
if(parentBlock.type == type){
40+
if (parentBlock.type == type){
4141
return parentBlock;
4242
}
4343
parentBlock = parentBlock.getParent();
@@ -50,14 +50,14 @@ function changeListener(e: Blockly.Events.Abstract){
5050
let eventBlockBase = (e as Blockly.Events.BlockBase);
5151
let workspace = Blockly.Workspace.getById(eventBlockBase.workspaceId!)
5252
let block = (workspace?.getBlockById(eventBlockBase.blockId!)! as Blockly.BlockSvg)
53-
if(!block){
53+
if (!block){
5454
return;
5555
}
5656
let callbackInfo = registeredCallbacks.get(block.type);
57-
if(!callbackInfo){
57+
if (!callbackInfo){
5858
return;
5959
}
60-
if(callbackInfo[0].includes(e.type)){
60+
if (callbackInfo[0].includes(e.type)){
6161
callbackInfo[1](block, eventBlockBase);
6262
}
6363
}

src/blocks/utils/connection_checker.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,17 +42,17 @@ export class MethodConnectionChecker extends Blockly.ConnectionChecker {
4242

4343
if (!checkArrayOne || !checkArrayTwo) {
4444
// if either one has mrc_component, they must match
45-
if((checkArrayOne && (checkArrayOne.indexOf(COMPONENT_OUTPUT) != -1)) ||
45+
if ((checkArrayOne && (checkArrayOne.indexOf(COMPONENT_OUTPUT) != -1)) ||
4646
(checkArrayTwo && (checkArrayTwo.indexOf(COMPONENT_OUTPUT) != -1))){
4747
return false;
4848
}
4949
// if either one has mrc_mechanism, they must match
50-
if((checkArrayOne && (checkArrayOne.indexOf(MECHANISM_OUTPUT) != -1)) ||
50+
if ((checkArrayOne && (checkArrayOne.indexOf(MECHANISM_OUTPUT) != -1)) ||
5151
(checkArrayTwo && (checkArrayTwo.indexOf(MECHANISM_OUTPUT) != -1))){
5252
return false;
5353
}
5454
// if either one has mrc_event, they must match
55-
if((checkArrayOne && (checkArrayOne.indexOf(EVENT_OUTPUT) != -1)) ||
55+
if ((checkArrayOne && (checkArrayOne.indexOf(EVENT_OUTPUT) != -1)) ||
5656
(checkArrayTwo && (checkArrayTwo.indexOf(EVENT_OUTPUT) != -1))){
5757
return false;
5858
}

src/blocks/utils/python.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -262,10 +262,10 @@ export function getLegalName(proposedName: string, existingNames: string[]){
262262
while (existingNames.includes(newName)){
263263
const match = /(.*?)(\d+)$/.exec(newName)
264264

265-
if(match){
265+
if (match) {
266266
let lastNumber = +match[2]
267267
newName = match[1] + (lastNumber + 1)
268-
}else{
268+
} else {
269269
newName += "2"
270270
}
271271
}

src/editor/extended_python_generator.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ export class ExtendedPythonGenerator extends PythonGenerator {
198198
const annotations = this.details?.annotations(className);
199199
const import_annotations = this.details?.imports();
200200

201-
if(import_annotations){
201+
if (import_annotations){
202202
this.definitions_['import_annotations'] = import_annotations;
203203
}
204204

src/toolbox/toolbox_tests.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ class ToolboxTestData {
4545
this.blocklyWorkspace = new Blockly.Workspace();
4646
this.blocklyWorkspace.MAX_UNDO = 0;
4747
this.jsonBlocks = [];
48-
if(contents){
48+
if (contents){
4949
this.collectBlocks(contents);
5050
}
5151
this.index = 0;

0 commit comments

Comments
 (0)