Skip to content
Merged
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 src/NixTree/Main.hs → app/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ module Main where

import Control.Concurrent.Async
import Control.Exception (evaluate)
import NixTree.App
import NixTree.BrickApp
import NixTree.PathStats
import qualified Options.Applicative as Opts
import qualified Options.Applicative.Help.Pretty as Opts
Expand Down
4 changes: 2 additions & 2 deletions src/NixTree/App.hs → app/NixTree/BrickApp.hs
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
module NixTree.App (run, helpText) where
module NixTree.BrickApp (run, helpText) where

import qualified Brick as B
import qualified Brick.BChan as B
import qualified Brick.Widgets.Border as B
import qualified Brick.Widgets.Center as B
import qualified Brick.Widgets.List as B
import Control.Concurrent
import Data.InvertedIndex
import qualified Data.List.NonEmpty as NE
import qualified Data.Map as Map
import qualified Data.Sequence as S
Expand All @@ -15,6 +14,7 @@ import qualified Data.Text as T
import qualified Graphics.Vty as V
import Lens.Micro (Traversal', _Just)
import qualified NixTree.Clipboard as Clipboard
import NixTree.Data.InvertedIndex
import NixTree.PathStats
import qualified System.Clock as Clock
import qualified System.HrfSize as HRF
Expand Down
File renamed without changes.
40 changes: 22 additions & 18 deletions nix-tree.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -38,46 +38,50 @@ common common-options
NumericUnderscores
MultiWayIf
TemplateHaskell
other-modules: NixTree.PathStats
NixTree.StorePath
NixTree.App
Data.InvertedIndex
NixTree.Clipboard
mixins: base hiding (Prelude)
, relude (Relude as Prelude)
build-depends: base
build-depends: base >=4.11 && < 5
, relude
, aeson
, brick >= 2.1
, bytestring
, containers
, clock
, filepath
, hrfsize
, text
, typed-process
, unordered-containers
, vty
, directory
, optparse-applicative
, microlens

library
import: common-options
hs-source-dirs: src
exposed-modules: NixTree.PathStats
NixTree.StorePath
NixTree.Data.InvertedIndex
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you think there's value removing some dependencies like brick from the library - if we're only exposing these three?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dropped, I also moved around dependencies

build-depends: aeson
, bytestring
, unordered-containers
, dot

executable nix-tree
import: common-options
ghc-options: -Wunused-packages -threaded -with-rtsopts=-N
main-is: NixTree/Main.hs
hs-source-dirs: src
main-is: Main.hs
hs-source-dirs: app
other-modules: NixTree.BrickApp
NixTree.Clipboard
default-language: Haskell2010
build-depends: base >= 4.11 && < 5
, terminal-progress-bar
build-depends: terminal-progress-bar
, async
, brick >= 2.1
, nix-tree

test-suite nix-tree-tests
import: common-options
type: exitcode-stdio-1.0
hs-source-dirs: test/ src/
other-modules: Test.Data.InvertedIndex
hs-source-dirs: test
other-modules: Test.NixTree.Data.InvertedIndex
main-is: Test.hs
build-depends: base >=4.11 && < 5
, hedgehog
build-depends: hedgehog
, nix-tree
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module Data.InvertedIndex
module NixTree.Data.InvertedIndex
( InvertedIndex,
iiFromList,
iiInsert,
Expand Down
4 changes: 2 additions & 2 deletions test/Test.hs
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ module Main where

import Hedgehog
import Hedgehog.Main
import qualified Test.Data.InvertedIndex
import qualified Test.NixTree.Data.InvertedIndex

main :: IO ()
main =
defaultMain . map checkParallel $
[Test.Data.InvertedIndex.tests]
[Test.NixTree.Data.InvertedIndex.tests]
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{-# LANGUAGE TemplateHaskell #-}

module Test.Data.InvertedIndex (tests) where
module Test.NixTree.Data.InvertedIndex (tests) where

import Data.InvertedIndex
import qualified Data.Map as Map
import qualified Data.Text as Text
import Hedgehog
import qualified Hedgehog.Gen as Gen
import qualified Hedgehog.Range as Range
import NixTree.Data.InvertedIndex

prop_inverted_index :: Property
prop_inverted_index = withDiscards 10000 . withTests 10000 . property $ do
Expand Down