Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "DCal",
"name": "Forja",
"build": {
"dockerfile": "Dockerfile"
},
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,7 @@ jobs:
with:
jvm: ${{ matrix.jvm }}
- run: scala-cli test .
- name: "Run all formatters on a clean tree"
run: scala-cli run . --main-class scripts.rewrite_src_sc
- name: "Check: the tree did not change due to the formatters"
run: scala-cli run . --main-class scripts.check_no_diff_sc
1 change: 1 addition & 0 deletions langs/calc/CalcParser.scala
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ object CalcParser extends PassSeq:
object AddSubPass extends Pass:
val wellformed = prevWellformed.makeDerived:
Node.Top.removeCases(AddOp, SubOp)
Group.removeCases(AddOp, SubOp)
Expression.addCases(Add, Sub)
Add ::= fields(
Expression,
Expand Down
31 changes: 31 additions & 0 deletions scripts/check_no_diff.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
// Copyright 2024-2025 Forja Team
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package scripts

@main
def check_no_diff_sc(): Unit =
val result = os
.proc("git", "status", "--porcelain")
.call(cwd = os.pwd, mergeErrIntoOut = true)
val strippedOut = result.out.text().strip()

if strippedOut.isEmpty
then
println("ok: no diff detected")
sys.exit(0)
else
println("diff detected!")
strippedOut.linesIterator.foreach(println)
sys.exit(1)
Loading