Skip to content

Commit

Permalink
Merge 0f9d842 into a318748
Browse files Browse the repository at this point in the history
  • Loading branch information
Zyranix committed Jun 14, 2021
2 parents a318748 + 0f9d842 commit 2281149
Show file tree
Hide file tree
Showing 143 changed files with 804 additions and 21 deletions.
34 changes: 34 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# This is a basic workflow to help you get started with Actions

name: CI

# Controls when the action will run. Triggers the workflow on push or pull request events on every branch
on: [push, pull_request]

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
strategy:
matrix:
# Select platform(s)
os: [ubuntu-latest, macos-latest, windows-latest]
# Select compatible Smalltalk image(s)
smalltalk: [Squeak64-trunk, Squeak64-5.3, Squeak64-5.2, Squeak64-5.1]
# The type of runner that the job will run on
runs-on: ${{ matrix.os }}
name: ${{ matrix.smalltalk }} on ${{ matrix.os }}
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
- name: Setup smalltalkCI
uses: hpi-swa/setup-smalltalkCI@v1
with:
smalltalk-version: ${{ matrix.smalltalk }}
- name: Test MorphicAPIExplorer
run: smalltalkci -s ${{ matrix.smalltalk }}
shell: bash
timeout-minutes: 15
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
24 changes: 24 additions & 0 deletions .github/workflows/linter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Linter

# Controls when the action will run. Triggers the workflow on push or pull request events on every branch
on: [push, pull_request]

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: ubuntu-latest
name: Squeak64-5.3 on ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
- name: Setup smalltalkCI
uses: hpi-swa/setup-smalltalkCI@v1
with:
smalltalk-version: Squeak64-5.3
- name: Test MorphicAPIExplorer
run: smalltalkci -s Squeak64-5.3 .linter.ston
shell: bash
timeout-minutes: 15
14 changes: 14 additions & 0 deletions .linter.ston
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
SmalltalkCISpec {
#preLoading : 'scripts/preLoading.st',
#loading : [
SCIMetacelloLoadSpec {
#baseline : 'MorphicAPIExplorer',
#directory : 'packages',
#load : 'tests',
#platforms : [ #squeak ]
}
],
#testing : {
#classes : [ #MEXLinter ]
}
}
13 changes: 11 additions & 2 deletions .smalltalk.ston
Original file line number Diff line number Diff line change
@@ -1,10 +1,19 @@
SmalltalkCISpec {
#preLoading : 'scripts/preLoading.st',
#loading : [
SCIMetacelloLoadSpec {
#baseline : 'MorphicAPIExplorer',
#platforms : [ #squeak ],
#directory : 'packages',
#load : [ 'tests' ]
#load : 'tests'
}
]
],
#testing : {
#exclude : {
#classes : [ #MEXLinter ]
},
#coverage : {
#packages : [ 'MorphicAPIExplorer-Core.*' ]
}
}
}
9 changes: 0 additions & 9 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# MorphicAPIExplorer [![Build Status](https://travis-ci.org/hpi-swa-teaching/MorphicAPIExplorer.svg?branch=master)](https://travis-ci.org/hpi-swa-teaching/MorphicAPIExplorer)
# MorphicAPIExplorer ![Build Status](https://github.com/hpi-swa-teaching/MorphicAPIExplorer/workflows/CI/badge.svg?branch=dev)

## Usage
When you cloned the repository from GitHub or installed the SAR archive you can simply open up a Workspace and type
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,39 @@ baseline: spec
for: #'common'
do: [
spec
"requirements for SwaLint"
project: 'RefactoringBrowser' with: [
spec
className: 'ConfigurationOfRefactoringBrowser';
versionString: #'stable';
loads: #('Core' );
repository: 'http://www.squeaksource.com/MetacelloRepository' ];
"SwaLint setup"
package: 'SwaLint-Preferences' with: [
spec
file: 'SwaLint-Preferences-cypress.1';
repository: 'github://hpi-swa-teaching/SwaLint:main/packages'];
package: 'SwaLint-Core' with: [
spec
file: 'SwaLint-Core-cypress.1';
repository: 'github://hpi-swa-teaching/SwaLint:main/packages';
requires: #('RefactoringBrowser' 'SwaLint-Preferences')];
package: 'SwaLint-PlugIns' with: [
spec
file: 'SwaLint-PlugIns-cypress.1';
repository: 'github://hpi-swa-teaching/SwaLint:main/packages';
requires: 'SwaLint-Core'];

postLoadDoIt: #postLoad;

"MorphicAPIExplorer setup"
package: 'MorphicAPIExplorer-Core';
package: 'MorphicAPIExplorer-Tests' with: [spec requires: #('MorphicAPIExplorer-Core')];
package: 'MorphicAPIExplorer-Tests' with: [
spec
requires: #('MorphicAPIExplorer-Core' 'SwaLint-Core' 'SwaLint-PlugIns')];
yourself.

spec
group: 'default' with: #('MorphicAPIExplorer-Core');
group: 'tests' with: #('MorphicAPIExplorer-Tests')];
yourself
yourself
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
baseline
postLoad

(Smalltalk globals at: #SwaLint) perform: #install
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@
"class" : {
},
"instance" : {
"baseline:" : "pre 4/10/2019 16:41" } }
"baseline:" : "pre 4/10/2019 16:41",
"postLoad" : " 6/14/2021 12:22:11" } }
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
creation
splitMethodOnParameters

^ self name findTokens: #:
^ self name findTokens: $:
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"parameterOf:" : "jb 7/18/2019 18:21",
"parameters" : "lk 6/21/2019 18:18",
"parameters:" : "lk 6/21/2019 18:18",
"splitMethodOnParameters" : "jb 7/18/2019 17:46",
"splitMethodOnParameters" : "SC 6/14/2021 17:53",
"subItems" : "TB 6/1/2021 17:54",
"subMethods" : "FFN 5/20/2019 15:21",
"subMethods:" : "FFN 5/20/2019 16:06" } }
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ fillMorphBox

| button gap iconMorph |
gap := 0.
self defaultMorphs keysInOrder do: [:each |
self defaultMorphs keysSortedSafely do: [:each |
iconMorph := (self evaluateMethodsForMorph: each).
button := SimpleButtonMorph new
label: '';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"defaultMorphs:" : "SH 5/20/2021 13:30",
"evaluateCode:" : "jb 7/24/2019 14:09",
"evaluateMethodsForMorph:" : "SH 5/20/2021 17:28",
"fillMorphBox" : "TB 6/7/2021 12:10",
"fillMorphBox" : "SC 6/14/2021 17:08",
"getSelectionFor:" : "FFN 6/19/2019 16:18",
"initialize" : "SH 5/20/2021 14:13",
"methodList" : "FFN 6/5/2019 23:02",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
I'm the class that is used to test the package 'MorphicAPIExplorer-Core' with the linting rules provided by SwaLint and in accordance with the coding standards. Apart from being your typical linter class for squeak, I don't offer any other functionality.

Instance Variables
classes: A Collection of classes that are supposed to be checked by the linting rules
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
packages
mexCorePackage

^ self namedPackage: 'MorphicAPIExplorer-Core'
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
packages
mexTestsPackage

^ self namedPackage: 'MorphicAPIExplorer-Tests'
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
packages
namedPackage: aString

^ PackageOrganizer default packageNamed: aString ifAbsent: [self error: aString , ' package is missing']
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
testing-utils
assertAll: aCollectionOfNumbers areBelowThreshold: aNumber

self assert: (aCollectionOfNumbers allSatisfy: [:each | each < aNumber])
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
testing-utils
assertAll: aCollectionOfObjects areEqualTo: anObject

self assert: (aCollectionOfObjects allSatisfy: [:each | each = anObject])
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
testing-utils
assertAll: aCollectionOfNumbers areOverThreshold: aNumber

self assert: (aCollectionOfNumbers allSatisfy: [:each | each > aNumber])
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
testing-utils
assertAllAreFalse: aCollectionOfBooleans

self assertAll: aCollectionOfBooleans areEqualTo: false
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
testing-utils
assertAllAreZero: aCollectionOfNumbers

self assertAll: aCollectionOfNumbers areEqualTo: 0
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
test-for-disharmonies
brokenTestBrainMethod
"wrong SL Type"

self assertAllAreFalse: (self runLinterRule: #brainMethod:)
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
test-for-disharmonies
brokenTestDispersedCoupling
"wrong SL Type"

self assertAllAreFalse: (self runLinterRule: #dispersedCoupling:)
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
test-for-disharmonies
brokenTestFeatureEnvy
"wrong SL Type"

self assertAllAreFalse: (self runLinterRule: #featureEnvy:)
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
test-unnecessary-code
brokenTestInstanceVariablesNotReadAndWritten
"literally broken"

self assertAllAreZero: (self runLinterRule: #smallLintOnlyReadOrWrittenVariable)
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
test-for-disharmonies
brokenTestIntensiveCoupling
"wrong SL Type"

self assertAllAreFalse: (self runLinterRule: #intensiveCoupling:)
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
test-for-spelling
brokenTestLiteralValues
"literally inherently broken"

self assertAllAreZero: (self runLinterRule: #smallLintLiteralValuesSpelling)
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
test-for-spelling
brokenTestMethodSelectors
"literally inherently broken"

self assertAllAreZero: (self runLinterRule: #smallLintMethodSelectorsSpelling)
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
test-for-coding-styles
brokenTestNamespaceSimulation
"wrong SL Type"

self assertAllAreZero: (self runLinterRule: #namespaceSimulation:)
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
test-for-disharmonies
brokenTestShotgunSurgery
"wrong SL Type"

self assertAllAreFalse: (self runLinterRule: #shotgunSurgery:)
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
test-for-disharmonies
brokenTestSignificantDuplication
"wrong SL Type"

self assertAllAreFalse: (self runLinterRule: #significantDuplication:)
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
test-for-disharmonies
brokenTestTraditionBreaker
"literally doesn't work"

self assertAllAreFalse: (self runLinterRule: #traditionBreaker:)
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
test-for-miscellaneous
brokenVariableIsOnlyAssignedALiteralValue

self assertAllAreZero: (self runLinterRule: #smallLintVariableAssignedLiteral)
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
accessing
classes: aCollection

classes := aCollection
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
accessing
classes

^ classes
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
test-for-spelling
defaultTimeout

^ 30 "seconds"
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
test-for-spelling
dontTestClassComments
"triggers even when we can't find any spelling mistakes so we're taking it out"

self assertAllAreZero: (self runLinterRule: #smallLintClassCommentsSpelling)
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
test-for-miscellaneous
dontTestExcessiveNumberOfArguments
"This triggers for the buildButtonWith:label:action:help:enabled: method, which does have many names, but only because buttons have so many properties."

self assertAllAreZero: (self runLinterRule: #smallLintExcessiveArguments)
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
test-for-miscellaneous
dontTestExcessiveNumberOfMethods
"Turns out, the CRLinter has quite a big number of statements."

self assertAllAreZero: (self runLinterRule: #smallLintExcessiveMethods)
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
test-for-intention-revealing
dontTestLawOfDemeter
"Incorrectly triggers when chaining multiple collection protocol methods."

self assertAllAreZero: (self runLinterRule: #lawOfDemeterRule:)
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
test-for-coding-styles
dontTestLongMethods
"this one sucks because we can't really do something about it"

self assertAllAreZero: (self runLinterRule: #longMethods:)
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
test-for-coding-styles
dontTestLongMethodsOnlyStatements
"Some methods, like testSetItemSelectionAtTo have more than 10 statements and that's fine."

self assertAllAreZero: (self runLinterRule: #longMethod:)
Loading

0 comments on commit 2281149

Please sign in to comment.