From e6993ec26103753413760fe61a71dfed207a1ec4 Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Mon, 25 Sep 2023 15:20:46 +0200 Subject: [PATCH 1/2] Remove the usage of MCClassTraitDefinition MCClassTraitDefinition is dedundant with MCTraitDefinition and creates bugs. For example, it will remove the class slots of loaded code. In order to fix this bug, we can just remove it and rely on MCTraitDefinition. This goes with: https://github.com/pharo-project/pharo/pull/14766 --- .../instance/basicNewTraitDefinitionFrom..st | 18 ------------- .../instance/newTraitDefinitionFrom..st | 25 ++++++++----------- .../class/definitionOrders.st | 3 +-- .../monticello.meta/categories.st | 7 +----- 4 files changed, 13 insertions(+), 40 deletions(-) delete mode 100644 MonticelloTonel-Core.package/TonelParser.class/instance/basicNewTraitDefinitionFrom..st diff --git a/MonticelloTonel-Core.package/TonelParser.class/instance/basicNewTraitDefinitionFrom..st b/MonticelloTonel-Core.package/TonelParser.class/instance/basicNewTraitDefinitionFrom..st deleted file mode 100644 index abd6e70..0000000 --- a/MonticelloTonel-Core.package/TonelParser.class/instance/basicNewTraitDefinitionFrom..st +++ /dev/null @@ -1,18 +0,0 @@ -private - factory -basicNewTraitDefinitionFrom: anArray - - | metadata definition | - metadata := anArray sixth. - definition := (MCTraitDefinition named: (metadata at: #name)) - comment: (anArray second ifNil: [ '' ]); - yourself. - - metadata - at: #traits ifPresent: [ :composition | definition traitComposition: composition ]; - at: #classTraits ifPresent: [ :composition | definition classTraitComposition: composition ]; - at: #instVars ifPresent: [ :ivar | definition instVarNames: ivar ]; - at: #classInstVars ifPresent: [ :classIVar | definition classInstVarNames: classIVar ]. - - self addPackageInfoTo: definition from: metadata. - - ^ definition \ No newline at end of file diff --git a/MonticelloTonel-Core.package/TonelParser.class/instance/newTraitDefinitionFrom..st b/MonticelloTonel-Core.package/TonelParser.class/instance/newTraitDefinitionFrom..st index 72d3c47..f265a7a 100644 --- a/MonticelloTonel-Core.package/TonelParser.class/instance/newTraitDefinitionFrom..st +++ b/MonticelloTonel-Core.package/TonelParser.class/instance/newTraitDefinitionFrom..st @@ -1,18 +1,15 @@ private - factory newTraitDefinitionFrom: anArray - | metadata traitDefs | + | metadata definition | metadata := anArray sixth. - traitDefs := { (self basicNewTraitDefinitionFrom: anArray) }. - - traitDefs first hasClassTraitComposition ifTrue: [ - | definition | - definition := (MCClassTraitDefinition baseTraitName: (metadata at: #name)) - classTraitComposition: (metadata at: #classTraits); - yourself. - - self addPackageInfoTo: definition from: metadata. - - traitDefs := traitDefs copyWith: definition ]. - - ^ traitDefs \ No newline at end of file + definition := (MCTraitDefinition named: (metadata at: #name)) + comment: (anArray second ifNil: [ '' ]); + yourself. + metadata + at: #traits ifPresent: [ :composition | definition traitComposition: composition ]; + at: #classTraits ifPresent: [ :composition | definition classTraitComposition: composition ]; + at: #instVars ifPresent: [ :ivar | definition instVarNames: ivar ]; + at: #classInstVars ifPresent: [ :classIVar | definition classInstVarNames: classIVar ]. + self addPackageInfoTo: definition from: metadata. + ^ definition \ No newline at end of file diff --git a/MonticelloTonel-Core.package/TonelReader.class/class/definitionOrders.st b/MonticelloTonel-Core.package/TonelReader.class/class/definitionOrders.st index 6be8c4c..711ae1d 100644 --- a/MonticelloTonel-Core.package/TonelReader.class/class/definitionOrders.st +++ b/MonticelloTonel-Core.package/TonelReader.class/class/definitionOrders.st @@ -5,5 +5,4 @@ definitionOrders MCOrganizationDefinition. 0. MCMethodDefinition. 1. MCClassDefinition. 2. - MCTraitDefinition. 2. - MCClassTraitDefinition. 3 } \ No newline at end of file + MCTraitDefinition. 2} \ No newline at end of file diff --git a/MonticelloTonel-Core.package/monticello.meta/categories.st b/MonticelloTonel-Core.package/monticello.meta/categories.st index b6ec159..e24f4ff 100644 --- a/MonticelloTonel-Core.package/monticello.meta/categories.st +++ b/MonticelloTonel-Core.package/monticello.meta/categories.st @@ -1,6 +1 @@ -SystemOrganization addCategory: #'MonticelloTonel-Core'! -SystemOrganization addCategory: #'MonticelloTonel-Core-Base'! -SystemOrganization addCategory: #'MonticelloTonel-Core-Errors'! -SystemOrganization addCategory: #'MonticelloTonel-Core-Reading'! -SystemOrganization addCategory: #'MonticelloTonel-Core-Utilities'! -SystemOrganization addCategory: #'MonticelloTonel-Core-Writing'! +self packageOrganizer ensurePackage: #'MonticelloTonel-Core' withTags: #(#Base #Errors #Reading #Utilities #Writing)! From 6e1c8ec84331b2676aba01267c772cdbd6eff40c Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Mon, 25 Sep 2023 15:54:24 +0200 Subject: [PATCH 2/2] run CI on all branches --- .github/workflows/tonel.yml | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/.github/workflows/tonel.yml b/.github/workflows/tonel.yml index a73882c..fe85648 100644 --- a/.github/workflows/tonel.yml +++ b/.github/workflows/tonel.yml @@ -1,13 +1,6 @@ name: Tonel-dev -on: - push: - branches: [ master ] - pull_request: - branches: [ master ] - - # Allows you to run this workflow manually from the Actions tab - workflow_dispatch: +on: [ push, pull_request ] # A workflow run is made up of one or more jobs that can run sequentially or in parallel jobs: