Skip to content

Commit

Permalink
elm-review fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Leif Battermann committed Nov 23, 2021
1 parent 95003be commit f0b0f2c
Show file tree
Hide file tree
Showing 21 changed files with 21 additions and 78 deletions.
11 changes: 5 additions & 6 deletions elm.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
"direct": {
"NoRedInk/elm-json-decode-pipeline": "1.0.0",
"carwow/elm-slider": "11.1.6",
"drathier/elm-test-tables": "3.0.0",
"elm/browser": "1.0.2",
"elm/core": "1.0.5",
"elm/html": "1.0.0",
Expand All @@ -22,7 +21,6 @@
"elm-community/maybe-extra": "5.2.0",
"elm-community/random-extra": "3.2.0",
"elm-community/result-extra": "2.4.0",
"elm-explorations/test": "1.2.2",
"grotsev/elm-debouncer": "1.0.0",
"krisajenkins/remotedata": "6.0.1",
"myrho/elm-round": "1.0.4",
Expand All @@ -39,9 +37,10 @@
}
},
"test-dependencies": {
"direct": {},
"indirect": {
"elm/regex": "1.0.0"
}
"direct": {
"drathier/elm-test-tables": "3.0.0",
"elm-explorations/test": "1.2.2"
},
"indirect": {}
}
}
3 changes: 0 additions & 3 deletions src/Api.elm
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@ import Maybe.Extra
import Model exposing (ApiResponse, Msg(..))
import Poker.Card as Card exposing (Card)
import Poker.HandOrCombo as HandOrCombo exposing (HandOrCombo)
import Poker.Position exposing (Position(..))
import Poker.Suit exposing (Suit(..))
import Ports exposing (SharingType(..))
import Process
import RemoteData
import Task
Expand Down
2 changes: 1 addition & 1 deletion src/Form.elm
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import List.Extra
import Maybe.Extra
import Poker.Board as Board
import Poker.Card as Card exposing (Card)
import Poker.CardRemoval as CardRemoval exposing (numberOfCombos)
import Poker.CardRemoval as CardRemoval
import Poker.HandOrCombo as HandOrCombo exposing (HandOrCombo)
import Poker.Position as Position exposing (Position(..))
import Result.Extra
Expand Down
7 changes: 1 addition & 6 deletions src/Form/Field.elm
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module Form.Field exposing (Field, Validated, apply, clear, rewrite, setEdited, setValue)
module Form.Field exposing (Field, Validated, apply, clear, rewrite, setValue)


type alias Error =
Expand Down Expand Up @@ -32,11 +32,6 @@ setValue f value field =
{ field | value = value, validated = f value, edited = String.isEmpty value |> not }


setEdited : Field a -> Field a
setEdited field =
{ field | edited = True }


clear : a -> Field a -> Field a
clear default field =
{ field | edited = False, value = "", validated = Ok default }
Expand Down
27 changes: 3 additions & 24 deletions src/Model.elm
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,10 @@ module Model exposing
, ResultLine
, SharingPopoverStates
, SimulationResult
, allRangesExcept
, board
, init
, initialPopoverStates
, initialRangeSlider
, initialSharingPopoverStates
, popoverState
, range
, urlParser
)

Expand All @@ -32,9 +28,9 @@ import Poker.Card exposing (Card)
import Poker.Combo exposing (Combo)
import Poker.Hand exposing (Hand)
import Poker.HandOrCombo exposing (HandOrCombo)
import Poker.Position as Position exposing (Position(..))
import Poker.Suit as Suit exposing (Suit(..))
import Ports exposing (CopiedToClipboardMsg, SharingType(..))
import Poker.Position exposing (Position(..))
import Poker.Suit as Suit exposing (Suit)
import Ports exposing (CopiedToClipboardMsg, SharingType)
import RemoteData exposing (WebData)
import Url exposing (Url)
import Url.Parser as UrlParser exposing ((<?>), Parser)
Expand Down Expand Up @@ -331,20 +327,3 @@ popoverState position model =

BB ->
model.popoverStateBb


board : Model -> List Card
board model =
model.form |> Form.board


range : Position -> Model -> List HandOrCombo
range position model =
model.form |> Form.range position


allRangesExcept : Position -> Model -> List (List HandOrCombo)
allRangesExcept position model =
Position.all
|> List.filter ((/=) position)
|> List.map (\p -> range p model)
2 changes: 1 addition & 1 deletion src/Subscriptions.elm
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import Json.Decode as Decode
import Keyboard
import Model exposing (Model, Msg(..))
import Poker.Position exposing (Position(..))
import Ports exposing (SharingType(..))
import Ports


subscriptions : Model -> Sub Msg
Expand Down
2 changes: 1 addition & 1 deletion src/Update.elm
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import Poker.Combo as Combo
import Poker.Hand as Hand exposing (Hand)
import Poker.HandOrCombo as HandOrCombo
import Poker.Position as Position exposing (Position(..))
import Poker.Suit as Suit exposing (Suit(..))
import Poker.Suit as Suit
import Ports exposing (SharingType(..))
import Random
import RemoteData exposing (WebData)
Expand Down
3 changes: 0 additions & 3 deletions src/View.elm
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,8 @@ import Html.Attributes
import Html.Events
import Kofi
import Model exposing (Model, Msg(..), ResultLine)
import Poker.Card as Card
import Poker.Position exposing (Position(..))
import Poker.Ranges as Ranges
import Poker.Suit exposing (Suit(..))
import Ports exposing (SharingType(..))
import RemoteData
import Result.Extra
import Round
Expand Down
5 changes: 1 addition & 4 deletions src/Views/Board.elm
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,8 @@ module Views.Board exposing (view)
import Bootstrap.Utilities.Flex as Flex
import Html exposing (Html)
import Html.Attributes
import Model exposing (Msg(..))
import Model exposing (Msg)
import Poker.Card exposing (Card)
import Poker.Position exposing (Position(..))
import Poker.Suit exposing (Suit(..))
import Ports exposing (SharingType(..))
import Views.Card exposing (SelectState(..))


Expand Down
1 change: 0 additions & 1 deletion src/Views/Card.elm
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import Model exposing (Msg(..))
import Poker.Card exposing (Card)
import Poker.Rank as Rank
import Poker.Suit exposing (Suit(..))
import Ports exposing (SharingType(..))
import Svg
import Svg.Attributes
import Views.Icons
Expand Down
4 changes: 1 addition & 3 deletions src/Views/Modal/Board.elm
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,8 @@ import Html exposing (Html)
import Html.Attributes
import Model exposing (Model, Msg(..))
import Poker.Card exposing (Card)
import Poker.Position exposing (Position(..))
import Poker.Rank as Rank
import Poker.Suit as Suit exposing (Suit(..))
import Ports exposing (SharingType(..))
import Poker.Suit as Suit
import Views.Card exposing (SelectState(..))


Expand Down
6 changes: 2 additions & 4 deletions src/Views/Modal/Range.elm
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ module Views.Modal.Range exposing (SelectState(..), view)
import Bootstrap.Alt.Modal as Modal
import Bootstrap.Button as Button
import Bootstrap.Dropdown as Dropdown
import Bootstrap.Form as Form
import Bootstrap.Grid as Grid
import Bootstrap.Utilities.Flex as Flex
import Bootstrap.Utilities.Size as Size
Expand All @@ -16,10 +15,9 @@ import Html.Attributes
import Html.Events
import Model exposing (Model, Msg(..))
import Poker.Hand as Hand exposing (Hand)
import Poker.Position as Position exposing (Position(..))
import Poker.Position as Position
import Poker.Ranges as Ranges
import Poker.Suit as Suit exposing (Suit(..))
import Ports exposing (SharingType(..))
import Poker.Suit as Suit exposing (Suit)
import Round
import Svg
import Svg.Attributes
Expand Down
16 changes: 4 additions & 12 deletions src/Views/RangePercentageCardRemoval.elm
Original file line number Diff line number Diff line change
@@ -1,17 +1,14 @@
module Views.RangePercentageCardRemoval exposing (view, viewUnblocked, viewWithCardRemoval)
module Views.RangePercentageCardRemoval exposing (view, viewWithCardRemoval)

import Bootstrap.Form as Form
import Bootstrap.Progress as Progress
import Bootstrap.Utilities.Spacing as Spacing
import Form
import Html exposing (Html)
import Html.Attributes
import List.Extra
import Model exposing (Model, Msg(..))
import Poker.Combo as Combo exposing (Combo)
import Poker.Position exposing (Position(..))
import Poker.Suit exposing (Suit(..))
import Ports exposing (SharingType(..))
import Model exposing (Model, Msg)
import Poker.Combo as Combo
import Poker.Position exposing (Position)
import Round


Expand All @@ -24,11 +21,6 @@ viewWithCardRemoval edited position model =
[]


viewUnblocked : List Combo -> List Combo -> List (Html Msg)
viewUnblocked combos blockers =
view (combos |> List.Extra.count (\combo -> List.member combo blockers |> not))


view : Int -> List (Html Msg)
view numberOfCombos =
let
Expand Down
2 changes: 0 additions & 2 deletions src/Views/Result.elm
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,8 @@ import Bootstrap.Utilities.Spacing as Spacing
import Html
import Html.Attributes
import Model exposing (Msg(..), ResultLine, SharingPopoverStates, SimulationResult)
import Poker.Card as Card
import Poker.HandOrCombo as HandOrCombo
import Poker.Position as Position exposing (Position(..))
import Poker.Suit exposing (Suit(..))
import Ports exposing (SharingType(..))
import Round
import Views.Board
Expand Down
1 change: 0 additions & 1 deletion tests/Poker/CardRemovalTests.elm
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
module Poker.CardRemovalTests exposing (..)

import Expect
import Fuzz exposing (..)
import List.Extra
import Poker.Card as Card exposing (Card)
import Poker.CardRemoval as CardRemoval
Expand Down
1 change: 0 additions & 1 deletion tests/Poker/CardTests.elm
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
module Poker.CardTests exposing (..)

import Expect
import Fuzz exposing (..)
import List.Extra
import Parser
import Poker.Card as Card
Expand Down
1 change: 0 additions & 1 deletion tests/Poker/ComboTests.elm
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
module Poker.ComboTests exposing (..)

import Expect
import Fuzz exposing (..)
import List.Extra
import Parser
import Poker.Card exposing (Card)
Expand Down
1 change: 0 additions & 1 deletion tests/Poker/Fuzzer.elm
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import Poker.Combo as Combo exposing (Combo)
import Random
import Random.List
import Shrink
import Test exposing (..)


combos : Fuzzer (List Combo)
Expand Down
1 change: 0 additions & 1 deletion tests/Poker/HandOrComboTests.elm
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
module Poker.HandOrComboTests exposing (..)

import Expect
import Fuzz exposing (..)
import List.Extra
import Poker.Combo as Combo
import Poker.Fuzzer as Fuzzer
Expand Down
1 change: 0 additions & 1 deletion tests/Poker/HandTests.elm
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
module Poker.HandTests exposing (..)

import Expect
import Fuzz exposing (..)
import Maybe.Extra
import Parser
import Poker.Card exposing (Card)
Expand Down
2 changes: 1 addition & 1 deletion tests/Poker/RankTests.elm
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module Poker.RankTests exposing (..)
import Expect
import Fuzz exposing (..)
import Parser
import Poker.Rank as Rank exposing (Rank(..))
import Poker.Rank as Rank
import Result.Extra
import Test exposing (..)

Expand Down

0 comments on commit f0b0f2c

Please sign in to comment.