mirror of
https://github.com/github/semantic.git
synced 2024-11-28 01:47:01 +03:00
Merge pull request #1164 from github/it's-probably-a-fire-storm
Clean up scripts & dependencies
This commit is contained in:
commit
a051efe7e8
@ -82,10 +82,8 @@ library
|
||||
, FDoc.NatExample
|
||||
build-depends: base >= 4.8 && < 5
|
||||
, aeson
|
||||
, aeson-pretty
|
||||
, ansi-terminal
|
||||
, array
|
||||
, async-pool
|
||||
, async
|
||||
, bifunctors
|
||||
, bytestring
|
||||
@ -93,7 +91,6 @@ library
|
||||
, comonad
|
||||
, containers
|
||||
, directory
|
||||
, dlist
|
||||
, effects
|
||||
, filepath
|
||||
, free
|
||||
@ -107,36 +104,28 @@ library
|
||||
, mtl
|
||||
, optparse-applicative
|
||||
, parallel
|
||||
, pointed
|
||||
, protolude
|
||||
, recursion-schemes
|
||||
, regex-compat
|
||||
, semigroups
|
||||
, split
|
||||
, template-haskell
|
||||
, text >= 1.2.1.3
|
||||
, these
|
||||
, haskell-tree-sitter
|
||||
, vector
|
||||
, wl-pprint-text
|
||||
, c
|
||||
, go
|
||||
, ruby
|
||||
, typescript
|
||||
, python
|
||||
, network
|
||||
, clock
|
||||
, yaml
|
||||
, unordered-containers
|
||||
default-language: Haskell2010
|
||||
default-extensions: DeriveFunctor, DeriveFoldable, DeriveTraversable, DeriveGeneric, FlexibleContexts, FlexibleInstances, OverloadedStrings, NoImplicitPrelude, RecordWildCards, StrictData
|
||||
ghc-options: -Wall -fno-warn-name-shadowing -O2 -j
|
||||
ghc-options: -Wall -fno-warn-name-shadowing -O -j
|
||||
ghc-prof-options: -fprof-auto
|
||||
|
||||
executable semantic
|
||||
hs-source-dirs: app
|
||||
main-is: Main.hs
|
||||
ghc-options: -threaded -rtsopts "-with-rtsopts=-N -A4m -n2m" -static -j -O2
|
||||
ghc-options: -threaded -rtsopts "-with-rtsopts=-N -A4m -n2m" -static -j -O
|
||||
cc-options: -DU_STATIC_IMPLEMENTATION=1
|
||||
cpp-options: -DU_STATIC_IMPLEMENTATION=1
|
||||
build-depends: base
|
||||
@ -171,7 +160,6 @@ test-suite test
|
||||
, base
|
||||
, bifunctors
|
||||
, bytestring
|
||||
, deepseq
|
||||
, filepath
|
||||
, Glob
|
||||
, haskell-tree-sitter
|
||||
@ -181,16 +169,12 @@ test-suite test
|
||||
, HUnit
|
||||
, leancheck
|
||||
, mtl
|
||||
, network
|
||||
, protolude
|
||||
, containers
|
||||
, recursion-schemes >= 4.1
|
||||
, regex-compat
|
||||
, semantic-diff
|
||||
, text >= 1.2.1.3
|
||||
, unordered-containers
|
||||
, these
|
||||
, vector
|
||||
ghc-options: -threaded -rtsopts -with-rtsopts=-N -j
|
||||
default-language: Haskell2010
|
||||
default-extensions: DeriveFunctor, DeriveGeneric, FlexibleContexts, FlexibleInstances, OverloadedStrings, NoImplicitPrelude, RecordWildCards
|
||||
|
@ -40,12 +40,8 @@ parseFilePath path = do
|
||||
-- the filesystem or Git. The tests, however, will still leverage reading files.
|
||||
readFile :: FilePath -> IO SourceBlob
|
||||
readFile path = do
|
||||
source <- (Just <$> readFileToUnicode path) `catch` (const (pure Nothing) :: IOException -> IO (Maybe Source))
|
||||
source <- (Just . Source <$> B.readFile path) `catch` (const (pure Nothing) :: IOException -> IO (Maybe Source))
|
||||
pure $ fromMaybe (emptySourceBlob path) (sourceBlob path (languageForFilePath path) <$> source)
|
||||
where
|
||||
-- | Read a file, convert it's contents unicode and return it wrapped in Source.
|
||||
readFileToUnicode :: FilePath -> IO Source
|
||||
readFileToUnicode path = Source <$> B.readFile path
|
||||
|
||||
-- | Returns a Maybe Language based on the FilePath's extension.
|
||||
languageForFilePath :: FilePath -> Maybe Language
|
||||
|
Loading…
Reference in New Issue
Block a user