Skip to content

Commit

Permalink
Merge pull request #112 from hpi-swa-teaching/91b-if-this-is-gonna-wo…
Browse files Browse the repository at this point in the history
…rk-we-just-wasted-five-hours

Add linting tests
  • Loading branch information
strawberriesandcheese committed Jul 16, 2020
2 parents a6dbada + 75c232e commit 6b09c71
Show file tree
Hide file tree
Showing 249 changed files with 1,398 additions and 203 deletions.
27 changes: 27 additions & 0 deletions .github/workflows/linter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@

# This is a basic workflow to help you get started with Actions

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@1.1.0
with:
smalltalk-version: Squeak64-5.3
- name: Test ChangesBrowser
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 : 'ChangesReloaded',
#directory : 'packages',
#load : 'Tests',
#platforms : [ #squeak ]
}
],
#testing : {
#classes : [ #CRLinter ]
}
}
7 changes: 5 additions & 2 deletions .smalltalk.ston
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
SmalltalkCISpec {
#preLoading : 'scripts/preLoading.st',
#loading : [
SCIMetacelloLoadSpec {
#baseline : 'ChangesReloaded',
Expand All @@ -8,9 +9,11 @@ SmalltalkCISpec {
}
],
#testing : {
#exclude : {
#classes : [ #CRLinter ]
},
#coverage : {
#packages : [ 'ChangesReloaded-Core.*' ]
},
#packages : [ 'ChangesReloaded-Tests.*' ]
}
}
}
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ language: smalltalk
sudo: false

smalltalk:
- Squeak-trunk
- Squeak64-5.3
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,42 @@ baseline: spec

<baseline>
spec for: #common do: [
spec
package: 'ChangesReloaded-Core';
package: 'ChangesReloaded-Tests' with: [ spec requires: #('ChangesReloaded-Core') ].


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:master/packages'];
package: 'SwaLint-Core' with: [
spec
file: 'SwaLint-Core-cypress.1';
repository: 'github://hpi-swa-teaching/SwaLint:master/packages';
requires: #('RefactoringBrowser' 'SwaLint-Preferences')];
package: 'SwaLint-PlugIns' with: [
spec
file: 'SwaLint-PlugIns-cypress.1';
repository: 'github://hpi-swa-teaching/SwaLint:master/packages';
requires: 'SwaLint-Core'];

postLoadDoIt: #postLoad;

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

spec
group: 'default' with: #('ChangesReloaded-Core');
group: 'Tests' with: #('ChangesReloaded-Tests')]
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:" : "gf 6/1/2020 13:44" } }
"baseline:" : "mg 7/4/2020 19:49",
"postLoad" : "uh 6/8/2020 14:19" } }
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
button-actions
switchToSimpleView

"Open the CRBrowser, which offers a simpler view for the changes."
CRBrowser open.
self changed: #close

self changed: #close.
^ CRBrowser open
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
"searchImageStates" : "MT 7/6/2017 13:32",
"showAllChangesAndResetFilter" : "MT 8/3/2017 17:33",
"showFilterMenu" : "MT 8/3/2017 17:31",
"switchToSimpleView" : "mg 5/11/2020 17:54",
"switchToSimpleView" : "gf 6/27/2020 15:42",
"testMode" : "MT 7/6/2017 13:32",
"testMode:" : "MT 8/3/2017 17:30",
"toggleShowClassCommentChanges" : "MT 8/3/2017 17:33",
Expand Down
7 changes: 4 additions & 3 deletions packages/Changes-Tests.package/.squot-contents
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
#serializer : #SquotCypressCodeSerializer,
#objectClassName : #PackageInfo
SquotTrackedObjectMetadata {
#objectClassName : #PackageInfo,
#objectsReplacedByNames : true,
#serializer : #SquotCypressCodeSerializer
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
overwriting
upTo: delimiter
| returnString |
returnString := ''.
[(self position < self string size) and: (self peek ~~ delimiter)] whileTrue: [ returnString := returnString , self next].
self position: self position + 1.
^ returnString
| returnString |
returnString := ''.
[(self position < self string size) and: (self peek ~~ delimiter)] whileTrue: [ returnString := returnString , self next].
self position: self position + 1.
^ returnString
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@
"skipSeparators" : "FS 6/22/2016 15:03",
"string" : "FS 6/17/2016 13:10",
"string:" : "PG 7/6/2016 20:41",
"upTo:" : "PG 6/28/2016 12:22" } }
"upTo:" : "gf 6/24/2020 16:41" } }
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
constants
changeListName

^ 'change list'
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
utils
getHistoryListFrom: anOrderedCollectionOfChangeRecords

| history |
history := Dictionary new.
(anOrderedCollectionOfChangeRecords
select: [:each | each isMethod])
do: [:each |
| changeListItem historyItem historyItemKey |
changeListItem := CRChangeListItem new changeRecord: each.
historyItemKey := each methodClassName , each methodSelector.
historyItem := history
at: historyItemKey
ifAbsentPut: [CRHistoryListItem
newWithSelector: (each methodSelector)
andClass: (each methodClass)].
historyItem addItem: changeListItem].
^ history asSortedCollection sort: [:a :b | a > b]
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
constants
historyListName

^ 'history list'
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
instance-creation
newWith: aMultiByteFileStream

^ self basicNew initializeWith: aMultiByteFileStream
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
instance-creation
open

^ ToolBuilder open: self new
^ self openWith: (SourceFiles second)
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
instance-creation
openWith: aMultiByteFileStream

^ ToolBuilder open: (self newWith: aMultiByteFileStream)
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
utils
retrieveChangeRecordsFrom: aMultiByteFileStream

| changesFileCopy start end |
changesFileCopy := aMultiByteFileStream readOnlyCopy.
changesFileCopy setConverterForCode.
end := changesFileCopy size.
start := 0 max: (end - self numberOfBytesToLoadChangesFrom).

^ ChangeList new
scanFile: changesFileCopy from: start to: end;
changeList
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
building
toolbuilder
buildButtonPanelSpecWith: aBuilder

^ aBuilder pluggablePanelSpec new
model: self;
layout: #horizontal;
children: (self buildButtonSpecsWith: aBuilder)
model: self;
layout: #horizontal;
children: (self buildButtonSpecsWith: aBuilder);
yourself
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
building
toolbuilder
buildButtonSpecsWith: aBuilder

^ (self buttons
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
building
toolbuilder
buildHistoryListSpecWith: aBuilder

^ aBuilder pluggableListSpec new
name: self class historyListName;
model: self;
list: #historyDescriptions;
getIndex: #historyListSelectionIndex;
setIndex: #historyListSelectionIndex:;
menu: #setUpHistoryListMenuMorph:
menu: #setUpHistoryListMenuMorph:;
yourself
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
building
toolbuilder
buildSingleSelectionChangeListSpecWith: aBuilder

^ aBuilder pluggableListSpec new
name: self class changeListName;
model: self;
list: #displayedChangeDescriptions;
getIndex: #changeListSelectionIndex;
setIndex: #changeListSelectionIndex:
setIndex: #changeListSelectionIndex:;
yourself
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
building
toolbuilder
buildWith: aBuilder

^ aBuilder build: (aBuilder pluggableWindowSpec new
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
building
toolbuilder
buttonHeight

^ 50
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
building
toolbuilder
buttons

^ #(('Switch to detailed view' #switchToDetailedView 'Switch to a more detailed version of this window with more functionality')
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
building
toolbuilder
buttonsFrame

^ LayoutFrame new
leftFraction: 0 offset: 0;
topFraction: 0 offset: 0;
rightFraction: 1 offset: 0;
bottomFraction: 0 offset: self buttonHeight
bottomFraction: 0 offset: self buttonHeight;
yourself
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
building
toolbuilder
changeListFrame

^ LayoutFrame new
leftFraction: 0.5 offset: 0;
topFraction: 0 offset: self buttonHeight;
rightFraction: 1 offset: 0;
bottomFraction: 1 - self codePaneFraction offset: 0
bottomFraction: 1 - self codePaneFraction offset: 0;
yourself
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
building
toolbuilder
codePaneFraction

^ 0.45
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
building
toolbuilder
codePaneFrame

^ LayoutFrame new
leftFraction: 0 offset: 0;
topFraction: 1 - self codePaneFraction offset: 0;
rightFraction: 1 offset: 0;
bottomFraction: 1 offset: 0
bottomFraction: 1 offset: 0;
yourself
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
building
toolbuilder
extent

^ 500@500
^ 500 @ 500

This file was deleted.

Loading

0 comments on commit 6b09c71

Please sign in to comment.