From 3a7d1c4b0c122a49bdcae7162d6ec700e777d6d0 Mon Sep 17 00:00:00 2001 From: ehennestad Date: Mon, 28 Oct 2024 22:12:21 +0100 Subject: [PATCH] Format whitespace --- tools/+ommtools/installMatBox.m | 2 +- tools/+ommtools/projectdir.m | 2 +- tools/hooks/pre_commit.m | 2 +- tools/tasks/packageToolbox.m | 2 +- tools/tests/oneOffs/organizationWithOneId.m | 8 ++++---- tools/tests/oneOffs/organizationWithTwoIds.m | 8 ++++---- tools/tests/oneOffs/personArray.m | 1 - tools/tests/oneOffs/personWithOneAffiliation.m | 5 +---- tools/tests/oneOffs/personWithTwoAffiliations.m | 5 +---- .../propertyValueListWithNestedEmbeddings.m | 3 +-- tools/tests/testDocLinks.m | 4 +--- tools/tests/unitTests/ControlledInstanceTest.m | 3 +-- tools/tests/unitTests/testInstanceSaveLoad.m | 2 +- tools/tests/unitTests/testLinkedCategory.m | 16 ++++++---------- 14 files changed, 24 insertions(+), 39 deletions(-) diff --git a/tools/+ommtools/installMatBox.m b/tools/+ommtools/installMatBox.m index 3eb002b5..391a8966 100644 --- a/tools/+ommtools/installMatBox.m +++ b/tools/+ommtools/installMatBox.m @@ -52,7 +52,7 @@ function installFromCommit() % Move to installation location [~, repoFolderName] = fileparts(unzippedFolder); - %targetFolder = fullfile(userpath, "Add-Ons"); + % targetFolder = fullfile(userpath, "Add-Ons"); targetFolder = fullfile(matlab.internal.addons.util.retrieveAddOnsInstallationFolder(), 'Toolboxes', 'Additional Software'); targetFolder = fullfile(targetFolder, repoFolderName); if isfolder(targetFolder); rmdir(targetFolder, "s"); end diff --git a/tools/+ommtools/projectdir.m b/tools/+ommtools/projectdir.m index 8036fa4d..4a7e4e4c 100644 --- a/tools/+ommtools/projectdir.m +++ b/tools/+ommtools/projectdir.m @@ -5,4 +5,4 @@ L = dir(rootFolder); assert(all(contains( {'code', 'tools'}, {L.name})), ... 'Expected project root directory to contain "code" and "tools" folder.'); -end \ No newline at end of file +end diff --git a/tools/hooks/pre_commit.m b/tools/hooks/pre_commit.m index b20cc8b8..e489835f 100644 --- a/tools/hooks/pre_commit.m +++ b/tools/hooks/pre_commit.m @@ -10,7 +10,7 @@ end try - %ommtools.stylecheckToolbox %todo... + % ommtools.stylecheckToolbox %todo... catch %#ok failed = [failed, "stylecheck"]; end diff --git a/tools/tasks/packageToolbox.m b/tools/tasks/packageToolbox.m index 22d695f9..f48c3593 100644 --- a/tools/tasks/packageToolbox.m +++ b/tools/tasks/packageToolbox.m @@ -8,7 +8,7 @@ function packageToolbox(releaseType, versionString) projectRootDirectory = ommtools.projectdir(); % Not sure if this is needed: - run(fullfile(projectRootDirectory, 'code', 'startup.m')) + run(fullfile(projectRootDirectory, 'code', 'startup.m')) % Specify toolbox path folders toolboxPathFolders = [... diff --git a/tools/tests/oneOffs/organizationWithOneId.m b/tools/tests/oneOffs/organizationWithOneId.m index 8095221b..a3aa06d0 100644 --- a/tools/tests/oneOffs/organizationWithOneId.m +++ b/tools/tests/oneOffs/organizationWithOneId.m @@ -1,10 +1,10 @@ function org = organizationWithOneId() % organizationWithOneId - test creation of a organization with one digital ID -% -% = organizationWithOneId() % -% Creates an example Organization object. If the procedure fails, an error is -% generated. +% o = organizationWithOneId() +% +% Creates an example Organization object. If the procedure fails, an error is +% generated. % ror = openminds.core.RORID('identifier','https://ror.org/01xtthb56'); diff --git a/tools/tests/oneOffs/organizationWithTwoIds.m b/tools/tests/oneOffs/organizationWithTwoIds.m index ee9df7ca..72a42dba 100644 --- a/tools/tests/oneOffs/organizationWithTwoIds.m +++ b/tools/tests/oneOffs/organizationWithTwoIds.m @@ -1,10 +1,10 @@ function org = organizationWithTwoIds() % organizationWithTwoIds - test creation of a organization with two digital IDs -% -% o = organizationWithTwoIds() % -% Creates an example Organization object. If the procedure fails, an error is -% generated. +% o = organizationWithTwoIds() +% +% Creates an example Organization object. If the procedure fails, an error is +% generated. % ror = openminds.core.RORID('identifier','https://ror.org/01xtthb56'); diff --git a/tools/tests/oneOffs/personArray.m b/tools/tests/oneOffs/personArray.m index 3c32baad..171ca8f4 100644 --- a/tools/tests/oneOffs/personArray.m +++ b/tools/tests/oneOffs/personArray.m @@ -3,7 +3,6 @@ filePath = fullfile(openminds.internal.rootpath, "livescripts", "data", "spacecraft_crew_members.csv"); crewMembers = readtable(filePath, "TextType", "String"); - contacts = dictionary; for email = crewMembers.email' diff --git a/tools/tests/oneOffs/personWithOneAffiliation.m b/tools/tests/oneOffs/personWithOneAffiliation.m index 022beb0f..2ecc309e 100644 --- a/tools/tests/oneOffs/personWithOneAffiliation.m +++ b/tools/tests/oneOffs/personWithOneAffiliation.m @@ -1,6 +1,6 @@ function p = personWithOneAffiliation() % personWithOneAffiliation - test creation of a person object in openMINDS -% +% % p = personWithOneAffiliation() % % Creates an example Person object. If the procedure fails, an error is @@ -22,6 +22,3 @@ p = openminds.core.Person('familyName','Smith','givenName','John D.',... 'alternateName', "js", 'affiliation',af,'digitalIdentifier',orcid,... 'contactInformation',contact); - - - diff --git a/tools/tests/oneOffs/personWithTwoAffiliations.m b/tools/tests/oneOffs/personWithTwoAffiliations.m index bf9bd7a6..2a47f15d 100644 --- a/tools/tests/oneOffs/personWithTwoAffiliations.m +++ b/tools/tests/oneOffs/personWithTwoAffiliations.m @@ -1,6 +1,6 @@ function p = personWithTwoAffiliations() % personWithTwoAffiliations - test creation of a person object in openMINDS -% +% % p = personWithTwoAffiliations() % % Creates an example Person object. If the procedure fails, an error is @@ -28,6 +28,3 @@ p = openminds.core.Person('familyName','Smith','givenName','John D.',... 'affiliation',af,'digitalIdentifier',orcid,... 'contactInformation',contact); - - - diff --git a/tools/tests/oneOffs/propertyValueListWithNestedEmbeddings.m b/tools/tests/oneOffs/propertyValueListWithNestedEmbeddings.m index 4e8502b2..ccd9eb2f 100644 --- a/tools/tests/oneOffs/propertyValueListWithNestedEmbeddings.m +++ b/tools/tests/oneOffs/propertyValueListWithNestedEmbeddings.m @@ -6,7 +6,6 @@ % Create a QuantitativeValue - stringValue = openminds.core.research.StringProperty('name', 'MyParameter', 'value', 'A'); ageUnit = openminds.controlledterms.UnitOfMeasurement('day'); @@ -17,4 +16,4 @@ pvl = openminds.core.research.PropertyValueList('propertyValuePair', {stringValue, numberValue}); disp(pvl) -end \ No newline at end of file +end diff --git a/tools/tests/testDocLinks.m b/tools/tests/testDocLinks.m index 4ef156ae..0eb02bd5 100644 --- a/tools/tests/testDocLinks.m +++ b/tools/tests/testDocLinks.m @@ -1,6 +1,6 @@ function result = testDocLinks() % testDocLinks - Run test for openMINDS Read The Docs links - projectDirectory = ommtools.getProjectRootDir(); + projectDirectory = ommtools.getProjectRootDir(); addpath( fullfile(projectDirectory, 'code') ); addpath( fullfile(projectDirectory, 'code', 'internal') ); @@ -12,5 +12,3 @@ testCase = testReadTheDocLinks(); result = run(testCase); end - - diff --git a/tools/tests/unitTests/ControlledInstanceTest.m b/tools/tests/unitTests/ControlledInstanceTest.m index 97ff4310..c659db28 100644 --- a/tools/tests/unitTests/ControlledInstanceTest.m +++ b/tools/tests/unitTests/ControlledInstanceTest.m @@ -18,7 +18,6 @@ function testGetControlledInstanceLocal(testCase, instanceSpecification, version expectedIdUriPrefix = sprintf("%s/instances", openminds.constant.BaseURI(versionNumber)); testCase.assertTrue(contains(jsonStr.at_id, expectedIdUriPrefix)); - end function testGetControlledInstanceRemote(testCase, instanceSpecification, versionNumber) @@ -26,7 +25,7 @@ function testGetControlledInstanceRemote(testCase, instanceSpecification, versio instanceSpecification{:}, versionNumber, "FileSource", "github"); expectedIdUriPrefix = sprintf("%s/instances", openminds.constant.BaseURI(versionNumber)); - testCase.assertTrue(contains(jsonStr.at_id, expectedIdUriPrefix)); + testCase.assertTrue(contains(jsonStr.at_id, expectedIdUriPrefix)); end end end diff --git a/tools/tests/unitTests/testInstanceSaveLoad.m b/tools/tests/unitTests/testInstanceSaveLoad.m index 956db2e4..fdc78720 100644 --- a/tools/tests/unitTests/testInstanceSaveLoad.m +++ b/tools/tests/unitTests/testInstanceSaveLoad.m @@ -3,7 +3,7 @@ % Automatically generate a test case for each schema type properties (TestParameter) - SchemaType = cellstr( enumeration('openminds.enum.Types') ); + SchemaType = cellstr( enumeration('openminds.enum.Types') ); end properties diff --git a/tools/tests/unitTests/testLinkedCategory.m b/tools/tests/unitTests/testLinkedCategory.m index fade1718..7394c853 100644 --- a/tools/tests/unitTests/testLinkedCategory.m +++ b/tools/tests/unitTests/testLinkedCategory.m @@ -5,11 +5,10 @@ % %  [ ] Test hetereogeneous linked types. % [ ] Test multiple nested linked categories. - %  [ ] Test assigning of properties to linked categories + % [ ] Test assigning of properties to linked categories %   % HOMOGENEOUS - properties % DatasetWithOnePersonAuthor - A dataset instance with a single % author which is of type Person @@ -20,7 +19,6 @@ DatasetWithTwoPersonAuthor end - methods(TestClassSetup) % Shared setup for the entire test class @@ -77,9 +75,9 @@ function testRetrievePropertyOfNestedScalarHomogeneousType(testCase) testCase.assertClass(organizationName, "string") % Alternative: This does not work. - %thisAuthor = ds.author; - %thisOrganizationName = thisAuthor.affiliation.memberOf.fullName; - end + % thisAuthor = ds.author; + % thisOrganizationName = thisAuthor.affiliation.memberOf.fullName; + end function testRetrievePropertyOfNestedNonScalarHomogeneousType(testCase) % Get dataset for testing @@ -93,7 +91,7 @@ function testRetrievePropertyOfNestedNonScalarHomogeneousType(testCase) S = ds.author.affiliation; % Assert length of this is 3 testCase.assertLength(S, 3) - end + end function testRetrieveNonScalarHomogeneousType(testCase) % Test the retrieval of a linked type property which is a linked @@ -155,7 +153,5 @@ function testRetreivePropertyOfScalarLinkedCategoryType(testCase) 'Failed to retrieve property from author') end end - end - -end \ No newline at end of file +end