Skip to content

Commit 022e79a

Browse files
authored
Merge pull request #221 from i10416/tidy/minor-cleanup
tidy: minor cleanup
2 parents af26b6d + e0b4b77 commit 022e79a

File tree

9 files changed

+81
-81
lines changed

9 files changed

+81
-81
lines changed

.github/workflows/ci.yml

+19-19
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
name: SLinC CI
22
on:
33
pull_request:
4-
push:
4+
push:
55
branches:
66
- "master"
77

88

9-
jobs:
9+
jobs:
1010
format-check:
1111
runs-on: ubuntu-latest
1212
steps:
13-
- uses: actions/checkout@v3
13+
- uses: actions/checkout@v3
1414
- uses: coursier/cache-action@v6
1515
- uses: coursier/[email protected]
1616
with:
@@ -25,61 +25,61 @@ jobs:
2525
- run: mkdir reports
2626
- name: Core tests
2727
run: sbt coverage test
28-
28+
2929
- run: |
3030
sbt coverageReport
3131
mkdir -p reports
3232
cp target/scala-3.3.1/scoverage-report/scoverage.xml reports/scoverage.xml
3333
# - run: |
3434
# ./mill core.scoverage.xmlReport
3535
# cp out/core/scoverage/xmlReport.dest/scoverage.xml reports/core-coverage.xml
36-
# env:
36+
# env:
3737
# JAVA_HOME: ${{ env.JAVA_HOME_17_X64}}
3838

3939

40-
40+
4141
# - name: Java 17 Implementation test
4242
# run: |
4343
# ./mill j17.compile
4444
# ./mill j17.test
45-
# env:
45+
# env:
4646
# JAVA_HOME: ${{ env.JAVA_HOME_17_X64}}
4747

4848
# - run: |
4949
# ./mill j17.scoverage.xmlReport
5050
# cp out/j17/scoverage/xmlReport.dest/scoverage.xml reports/java17-coverage.xml
5151

52-
# env:
52+
# env:
5353
# JAVA_HOME: ${{ env.JAVA_HOME_17_X64}}
5454

5555
# - name: Java 19 Implementation test
5656
# run: |
5757
# ./mill j19.compile
58-
# ./mill j19.test
58+
# ./mill j19.test
5959

6060
# - run: |
61-
# ./mill j19.scoverage.xmlReport
61+
# ./mill j19.scoverage.xmlReport
6262
# cp out/j19/scoverage/xmlReport.dest/scoverage.xml reports/java19-coverage.xml
6363

64-
# - name: Runtime 17 implementation tests
65-
# run: ./mill runtime.test
66-
# env:
64+
# - name: Runtime 17 implementation tests
65+
# run: ./mill runtime.test
66+
# env:
6767
# JAVA_HOME: ${{ env.JAVA_HOME_17_X64 }}
6868

6969
# - run: |
70-
# ./mill runtime.scoverage.xmlReport
70+
# ./mill runtime.scoverage.xmlReport
7171
# cp out/runtime/scoverage/xmlReport.dest/scoverage.xml reports/java-17-runtime-coverage.xml
7272

73-
# env:
73+
# env:
7474
# JAVA_HOME: ${{ env.JAVA_HOME_17_X64 }}
75-
76-
# - name: Runtime 19 implementation tests
75+
76+
# - name: Runtime 19 implementation tests
7777
# run: ./mill runtime.test
7878
# - run: |
7979
# ./mill runtime.scoverage.xmlReport
8080
# cp out/runtime/scoverage/xmlReport.dest/scoverage.xml reports/java-19-runtime-coverage.xml
8181

8282
- name: Upload coverage to Codecov
83-
uses: codecov/codecov-action@v3
83+
uses: codecov/codecov-action@v3
8484
with:
85-
directory: reports
85+
directory: reports

.github/workflows/publish-docs.yml

+14-14
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
name: Publish Docs
2-
on:
2+
on:
33
workflow_dispatch
4-
4+
55
jobs:
6-
build:
6+
build:
77
runs-on: ubuntu-latest
88
steps:
99
- uses: actions/checkout@v3
10-
with:
10+
with:
1111
lfs: true
12-
- uses: coursier/cache-action@v6
12+
- uses: coursier/cache-action@v6
1313
- uses: actions/setup-java@v3
1414
with:
1515
distribution: 'temurin'
@@ -18,20 +18,20 @@ jobs:
1818
run: sbt doc
1919
- name: Upload GitHub Pages artifact
2020
uses: actions/upload-pages-artifact@v3
21-
with:
21+
with:
2222
path: target/scala-3.3.1/api
23-
deploy:
24-
needs: build
23+
deploy:
24+
needs: build
2525
permissions:
26-
pages: write
27-
id-token: write
28-
environment:
26+
pages: write
27+
id-token: write
28+
environment:
2929
name: github-pages
3030
url: ${{ steps.deployment.outputs.page_url }}
3131

32-
runs-on: ubuntu-latest
32+
runs-on: ubuntu-latest
3333
steps:
34-
- name: Deploy to GitHub Pages
35-
id: deployment
34+
- name: Deploy to GitHub Pages
35+
id: deployment
3636
uses: actions/deploy-pages@v4
3737

.github/workflows/release.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ on:
66
jobs:
77
publish:
88
runs-on: ubuntu-latest
9-
steps:
9+
steps:
1010
- uses: actions/checkout@v3
1111
- uses: coursier/cache-action@v6
1212
- name: Get Secrets
@@ -18,10 +18,10 @@ jobs:
1818
e5a2f416-de5c-4f2d-bc09-b060011d760b > SONATYPE_PASSWORD
1919
44adbbc1-df7f-432f-8034-b060011d5d94 > SONATYPE_USERNAME
2020
88fba8d9-e11a-4d8c-bfbd-b06001410130 > PGP_PASSPHRASE
21-
- name: Get JVMs
21+
- name: Get JVMs
2222
uses: actions/setup-java@v4
23-
with:
23+
with:
2424
distribution: 'temurin'
2525
java-version: 17
2626
cache: sbt
27-
- run: sbt ci-release
27+
- run: sbt ci-release

docs/_docs/contributing/contributing.md

+21-21
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ The code in this repository is primarily divided into four top-level directories
55
* `j17/`: Java 17 specific parts of the Slinc implementation
66
* `j19/`: Java 19 specific parts of the Slinc implementation
77
* `runtime/`: The complete Slinc project, with Java 17 and 19 implementations combined and the correct implementation chosen at runtime by your system.
8-
8+
99
## Developing Slinc
10-
Slinc is a somewhat involved project to program for. With implementations targeting Java 17 and Java 19, one needs access to both JDKs to develop and run the j17 and j19 projects.
10+
Slinc is a somewhat involved project to program for. With implementations targeting Java 17 and Java 19, one needs access to both JDKs to develop and run the j17 and j19 projects.
1111

1212
### Sdkman
1313

@@ -19,7 +19,7 @@ Once you have sdkman installed, you can use the following commands to install an
1919
* Install: `sdk i java 19-tem`
2020
* Use: `sdk u java 19-tem`
2121
* Default: `sdk d java 19-tem`
22-
22+
2323
#### Java 17
2424
* Install: `sdk i java 17.0.4.1-tem`
2525
* Use: `sdk u java 17.0.4.1-tem`
@@ -29,25 +29,25 @@ Once you have sdkman installed, you can use the following commands to install an
2929

3030
`Use` will set the JDK visible for a certain terminal instance. This is useful if you want to build the entire project. Use will only effect the JDK choice for the terminal it's invoked in, and will not affect the user default JVM.
3131

32-
`Default` will set the JDK that's visible for all programs launched after the command has been invoked. This is useful for reloading your code editor to work on a different java implementation for Slinc.
32+
`Default` will set the JDK that's visible for all programs launched after the command has been invoked. This is useful for reloading your code editor to work on a different java implementation for Slinc.
3333

3434
### Editor
35-
When developing Slinc, it's suggested to use [VSCode](https://code.visualstudio.com/) along with the [Metals](https://marketplace.visualstudio.com/items?itemName=scalameta.metals) extension. Slinc is heavily dependent on compile-time programming, and VSCode+Metals works very well with this development model. One can use other editors, but it's probably mandatory to use Metals.
35+
When developing Slinc, it's suggested to use [VSCode](https://code.visualstudio.com/) along with the [Metals](https://marketplace.visualstudio.com/items?itemName=scalameta.metals) extension. Slinc is heavily dependent on compile-time programming, and VSCode+Metals works very well with this development model. One can use other editors, but it's probably mandatory to use Metals.
3636

37-
Using metals, one can import the build definition from mill. If one encounters an issue with the import failing for no discernable reason, try deleting the `out` directory and trying again. There is a problem with this project and mill failing to generate bloop configurations. If one encounters errors when viewing a code base that do not resolve themselves, it's suggested to try closing VSCode, killing all Java processes, and deleting .metals, .bloop, and out. Generally, this will fix all issues.
37+
Using metals, one can import the build definition from mill. If one encounters an issue with the import failing for no discernable reason, try deleting the `out` directory and trying again. There is a problem with this project and mill failing to generate bloop configurations. If one encounters errors when viewing a code base that do not resolve themselves, it's suggested to try closing VSCode, killing all Java processes, and deleting .metals, .bloop, and out. Generally, this will fix all issues.
3838

39-
When developing for Slinc, choose an implementation to focus on, and choose the appropriate JDK for it. Switch with the appropriate `default` command on sdkman, kill all java processes, and afterwards open the project with VSCode. The corresponding `j` project should be having no missing definition errors after this process. Switching between JDK versions follows the same process.
39+
When developing for Slinc, choose an implementation to focus on, and choose the appropriate JDK for it. Switch with the appropriate `default` command on sdkman, kill all java processes, and afterwards open the project with VSCode. The corresponding `j` project should be having no missing definition errors after this process. Switching between JDK versions follows the same process.
4040

41-
## Compiling
41+
## Compiling
4242

43-
The following commands compile the Slinc projecs:
43+
The following commands compile the Slinc projects:
4444

4545
* core: `./mill core.compile`
4646
* j17: `./mill j17.compile`
4747
* j19: `./mill j19.compile`
4848
* runtime: `./mill runtime.compile`
4949

50-
Compiling the entire project would normally be done by running `./mill _.compile`, but considering the different project have different JDK requirements, the full compilation takes the form of
50+
Compiling the entire project would normally be done by running `./mill _.compile`, but considering the different project have different JDK requirements, the full compilation takes the form of
5151

5252
```bash
5353
sdk u java 17.0.4.1-tem && \
@@ -78,7 +78,7 @@ Testing code is generally stored in the `core` project under `core/test/src`. Ja
7878
Tests in Slinc use munit and scalacheck. One can read how to use munit with scalacheck [here](https://scalameta.org/munit/docs/integrations/scalacheck.html) and how to use scalacheck [here](https://github.com/typelevel/scalacheck/blob/main/doc/UserGuide.md).
7979

8080

81-
In order to develop a new test suite for Slinc, add the implementation to `core/test/src`. If the test suite is testing an implementation in `core` then one can define it in the normal way specified by the munit documentation. However, if it's meant to be a test of Slinc implementations, it should be defined in a generic fashion like so:
81+
In order to develop a new test suite for Slinc, add the implementation to `core/test/src`. If the test suite is testing an implementation in `core` then one can define it in the normal way specified by the munit documentation. However, if it's meant to be a test of Slinc implementations, it should be defined in a generic fashion like so:
8282

8383
```scala
8484
package fr.hammons.slinc
@@ -87,7 +87,7 @@ import munit.ScalaCheckSuite
8787

8888
trait MyTestSuite(slinc: Slinc) extends ScalaCheckSuite:
8989
import slinc.{*,given}
90-
test("myTest") {
90+
test("myTest") {
9191
assertEquals(4,4)
9292
}
9393
```
@@ -104,9 +104,9 @@ If one's test suite concerns JIT compilation, one can use `noJit` and `immediate
104104

105105
### Troubleshooting tests
106106

107-
Sometimes when running a freshly written test, or testing freshly written code, one might encounter a situation where the test suite will stop testing early, or never stop running.
107+
Sometimes when running a freshly written test, or testing freshly written code, one might encounter a situation where the test suite will stop testing early, or never stop running.
108108

109-
Generally, the test suite will stop running early when some part of the Slinc runtime fails to initialize properly. One can easily detect if this is the case by moving some test code out of the test section into the root of the suite.
109+
Generally, the test suite will stop running early when some part of the Slinc runtime fails to initialize properly. One can easily detect if this is the case by moving some test code out of the test section into the root of the suite.
110110

111111
Observe the following example:
112112

@@ -125,7 +125,7 @@ trait MySuite(s: Slinc) extends ScalacheckSuite:
125125
import s.{*,given}
126126
sizeOf[Int]
127127
4.as[SizeT]
128-
128+
129129
test("myTest") {
130130
assertEquals(sizeOf[Int], 4.as[SizeT])
131131
}
@@ -141,18 +141,18 @@ trait MySuite(s: Slinc) extends ScalacheckSuite:
141141

142142
property("myProperty") {
143143
forAll{
144-
(i: Int) =>
144+
(i: Int) =>
145145
Scope.confined{
146146
val ptr = Ptr.blank[CInt]
147147

148-
!ptr = i
148+
!ptr = i
149149
assertEquals(!ptr, i)
150150
}
151151
}
152152
}
153153
```
154154

155-
should be changed to
155+
should be changed to
156156

157157
```scala
158158
trait MySuite(s: Slinc) extends ScalacheckSuite:
@@ -164,13 +164,13 @@ trait MySuite(s: Slinc) extends ScalacheckSuite:
164164

165165
property("myProperty") {
166166
forAll{
167-
(i: Int) =>
167+
(i: Int) =>
168168
Scope.confined{
169169
val ptr = Ptr.blank[CInt]
170170

171-
!ptr = i
171+
!ptr = i
172172
assertEquals(!ptr, i)
173173
}
174174
}
175175
}
176-
```
176+
```

0 commit comments

Comments
 (0)