8000 Enable Linting of Elm files by DamianReeves · Pull Request #565 · finos/morphir-scala · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Enable Linting of Elm files #565

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 41 commits into from
Apr 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
1260066
Enable Linting of Elm files
DamianReeves Apr 1, 2024
e2aa005
Setup tools for linting job
DamianReeves Apr 1, 2024
d7b2b1a
setup lint via moon
DamianReeves Apr 1, 2024
6247003
Working on compilation and formatting of elm code
DamianReeves Apr 2, 2024
9168045
Place parenthesis around body of Test.concat
DamianReeves Apr 2, 2024
10b16a7
Fix compilation errors
DamianReeves Apr 2, 2024
94ba6eb
Fixing elm compilation issues
DamianReeves Apr 2, 2024
cfe1c03
Move files into the correct folders for elm compilation to work
DamianReeves Apr 2, 2024
ee08ced
Fix Elm compilation errors
DamianReeves Apr 2, 2024
104b825
Rename elm file as according to Elm rules
DamianReeves Apr 2, 2024
c1463fb
Working through more Elm compilation errors
DamianReeves Apr 2, 2024
09b22ff
Add shelm
DamianReeves Apr 2, 2024
69385c0
Remove elm-format installation via packages.json
DamianReeves Apr 2, 2024
508da60
Add bun lock file update
DamianReeves Apr 2, 2024
685a93d
Delete EllieStuff and fix some errors
DamianReeves Apr 2, 2024
9a1f02b
Delete invalid Elm code from the destructureHeadTailTest
DamianReeves Apr 2, 2024
e3d3299
Change TupleTests to use elm/core's Tuple module
DamianReeves Apr 2, 2024
47d3665
Use elm/core aliases for integerDivide and power... use number naming…
DamianReeves Apr 2, 2024
50b2d87
Fix issue where RecordType was defined twiced
DamianReeves Apr 2, 2024
0527e54
Remove un-needed test template file
DamianReeves Apr 2, 2024
cdcbcb7
Fix more errors
DamianReeves Apr 2, 2024
a48c5eb
Fix compilation error
DamianReeves Apr 2, 2024
d0d7e16
Remove non-compiling code in the destructureLiteralTest
DamianReeves Apr 2, 2024
7a89055
Remove test for Decimal.toFloat as its not possible with Elm
DamianReeves Apr 3, 2024
f74e8f4
Properly typed Int64 add and subtract tests
DamianReeves Apr 3, 2024
441ed5f
Delete invalid Destructure test
DamianReeves Apr 3, 2024
339eff9
Fixing compilation of StringTests
DamianReeves Apr 3, 2024
f274b4d
Fixing non-compiling String tests
DamianReeves Apr 3, 2024
1d8ea60
Fixing non-compiling StringTests
DamianReeves Apr 3, 2024
bcce1c1
Delete duplicate test definition
DamianReeves Apr 3, 2024
d60bccf
Fix compilation warning for MaybeTests
DamianReeves Apr 3, 2024
2184e32
Fix compilation issues
DamianReeves Apr 3, 2024
1f2466d
Upgrade to use latest moon 1.23.3
DamianReeves Apr 3, 2024
7fa27f5
Update node to the latest LTS version 20.10.0
DamianReeves Apr 3, 2024
181be32
Fix caching issue with the scala-lint task
DamianReeves Apr 3, 2024
e26e7e2
Properly format unformatted Elm files
DamianReeves Apr 3, 2024
9fd30a5
Fix broken test
DamianReeves Apr 3, 2024
07dfa2b
Ensure we run elm-tooling install as a postInstall step
DamianReeves Apr 3, 2024
89c126c
Properly format Scala file
DamianReeves Apr 3, 2024
8746413
Updating tasks
DamianReeves Apr 3, 2024
f80bb58
In order not to cache full root directory make noop commands take no …
DamianReeves Apr 3, 2024
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
10 changes: 9 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,16 @@ jobs:
java-version: "17"
- name: Cache scala dependencies
uses: coursier/cache-action@v6
- name: Setup proto and moon toolchains
uses: moonrepo/setup-toolchain@v0.3.1
with:
auto-install: true

- name: Install tooling
run: |
./build.sh install
- name: Lint code
run: ./mill __.checkFormat
run: ./build.sh lint

test-js:
runs-on: ubuntu-latest
Expand Down
16 changes: 16 additions & 0 deletions .moon/tasks.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,24 @@
$schema: "https://moonrepo.dev/schemas/tasks.json"
tasks:
build:
inputs: []
deps:
- target: "~:morphir-elm-build"
optional: true
- target: "~:elm-library-build"
optional: true
fmt:
inputs: []
deps:
- target: "~:elm-format"
optional: true
- target: "~:scala-format"
optional: true

lint:
inputs: []
deps:
- target: "~:elm-lint"
optional: true
- target: "~:scala-lint"
optional: true
19 changes: 6 additions & 13 deletions .moon/tasks/tag-elm.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,15 @@
fileGroups:
elmSources:
- "src/**/*.elm"
- "src"
tasks:
lint-elm-sources:
elm-lint:
command: |
elm-format @files(elmSources) --validate
elm-format @dirs(elmSources) @files(elmSources) --validate --yes
inputs:
- "@globs(elmSources)"
lint:
deps:
- "~:lint-elm-sources"
- "@files(elmSources)"

elm-format:
command: |
elm-format @files(elmSources) --yes
elm-format @dirs(elmSources) @files(elmSources) --yes
inputs:
- "@globs(elmSources)"

fmt:
deps:
- "~:elm-format"
- "@files(elmSources)"
2 changes: 1 addition & 1 deletion .moon/tasks/tag-morphir-elm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ tasks:
- "@files(morphirProjectFiles)"
- "@files(morphirElmArtifacts)"
- "package.json"
- "@globs(morphirElmSources)"
- "@files(morphirElmSources)"
outputs:
- "morphir-hashes.json"
- "morphir-ir.json"
1 change: 1 addition & 0 deletions .moon/workspace.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ projects:
globs:
- "examples/morphir-elm-projects/unit-test-framework/*"
sources:
morphir: "."
evaluator-tests: "examples/morphir-elm-projects/evaluator-tests"
examples/finance: "examples/morphir-elm-projects/finance"
sdks/morphir-unit-test: "morphir-elm/sdks/morphir-unit-test"
Expand Down
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
16.15.0
20.10.0
2 changes: 1 addition & 1 deletion .prototools
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
bun = "1.0.35"
moon = "1.23.1"
moon = "1.23.3"

[plugins]
moon = "source:https://raw.githubusercontent.com/moonrepo/moon/master/proto-plugin.toml"
9 changes: 6 additions & 3 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ subcommand=$_arg_command
leftovers=$_arg_leftovers

# Scala versions
default_scala_version="3.3.1"
default_scala_version="3.3.3"
scalaVersion=$_arg_scala_version
scalaVersions=(${_arg_scala_version[@]})

Expand Down Expand Up @@ -277,13 +277,16 @@ case "$subcommand" in
moon run :build --query "tag=[elm, morphir-elm]"
;;
"fmt")
./mill Alias/run fmt; moon run :fmt
moon run :fmt
;;
"format")
moon run :fmt
;;
"install")
bun install
;;
"lint")
./mill Alias/run checkfmt && moon run :lint
moon run :lint
;;
"run")
moon run "$leftovers"
Expand Down
Binary file modified bun.lockb
Binary file not shown.
64 changes: 54 additions & 10 deletions examples/morphir-elm-projects/evaluator-tests/elm.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,58 @@
{
"type": "package",
"name": "finos/morphir-evaluator-tests",
"summary": "Morphir Evaluator Tests",
"license": "Apache-2.0",
"version": "1.0.0",
"exposed-modules": [],
"elm-version": "0.19.0 <= v < 0.20.0",
"type": "application",
"source-directories": [
"src"
],
"elm-version": "0.19.1",
"dependencies": {
"elm/core": "1.0.0 <= v < 2.0.0",
"finos/morphir-elm": "21.0.1 <= v < 22.0.0"
"direct": {
"elm/core": "1.0.5",
"finos/morphir-elm": "21.0.1"
},
"indirect": {
"avh4/elm-color": "1.0.0",
"avh4/elm-fifo": "1.0.4",
"chain-partners/elm-bignum": "1.0.1",
"cmditch/elm-bigint": "1.0.1",
"cuducos/elm-format-number": "8.1.4",
"dillonkearns/elm-markdown": "7.0.1",
"dosarf/elm-tree-view": "3.0.0",
"elm/browser": "1.0.2",
"elm/bytes": "1.0.8",
"elm/html": "1.0.0",
"elm/json": "1.1.3",
"elm/parser": "1.1.0",
"elm/random": "1.0.0",
"elm/regex": "1.0.0",
"elm/svg": "1.0.1",
"elm/time": "1.0.0",
"elm/url": "1.0.0",
"elm/virtual-dom": "1.0.3",
"elm-community/graph": "6.0.0",
"elm-community/intdict": "3.0.0",
"elm-community/list-extra": "8.7.0",
"elm-community/maybe-extra": "5.3.0",
"elm-community/random-extra": "3.2.0",
"elm-explorations/markdown": "1.0.0",
"elm-explorations/test": "2.2.0",
"erlandsona/assoc-set": "1.1.2",
"fabhof/elm-ui-datepicker": "5.0.0",
"justinmimbs/date": "3.2.1",
"lattyware/elm-fontawesome": "6.0.0",
"matthewsj/elm-ordering": "2.0.0",
"mdgriffith/elm-ui": "1.1.8",
"miniBill/elm-unicode": "1.1.1",
"myrho/elm-round": "1.0.5",
"pzp1997/assoc-list": "1.0.0",
"rtfeldman/elm-hex": "1.0.0",
"rtfeldman/elm-iso8601-date-strings": "1.1.4",
"rundis/elm-bootstrap": "5.2.0",
"stil4m/elm-syntax": "7.3.2",
"stil4m/structured-writer": "1.0.3"
}
},
"test-dependencies": {}
"test-dependencies": {
"direct": {},
"indirect": {}
}
}
1 change: 1 addition & 0 deletions examples/morphir-elm-projects/evaluator-tests/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"morphir-elm": "^2.89.0"
},
"scripts": {
"postinstall": "elm-tooling install",
"format": "elm-format --yes .",
"make": "morphir-elm make"
}
Expand Down
Loading
0