Skip to content

Commit 1e51751

Browse files
simonmarfacebook-github-bot
authored andcommitted
Enable -Werror for developing & CI (#556)
Summary: For consistency with internal Meta CI Pull Request resolved: #556 Reviewed By: phlalx Differential Revision: D78210353 Pulled By: pepeiborra fbshipit-source-id: 72c8856127e524ce9ced56b3a3074f64012c17a7
1 parent 5a9069e commit 1e51751

8 files changed

Lines changed: 15 additions & 7 deletions

File tree

cabal.project

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@ allow-newer: haskeline:base
2323
-- https://github.com/TomMD/entropy/issues/75
2424
constraints: entropy < 0.4.1.9
2525

26+
-- develop with -Werror on, for consistency with internal Meta CI.
27+
program-options
28+
ghc-options: -Werror -Wwarn=dodgy-imports
29+
2630
package fb-util
2731
flags: +folly
2832

glean.cabal.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ common fb-haskell
4949
TypeFamilies
5050
TypeSynonymInstances
5151
NondecreasingIndentation
52+
TypeOperators
5253

5354
ghc-options: -Wall -Wno-orphans -Wno-name-shadowing
5455
if flag(opt)

glean/db/Glean/Query/Transform.hs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
1010
{-# LANGUAGE DerivingStrategies #-}
1111
{-# LANGUAGE RecursiveDo #-}
12+
{-# LANGUAGE CPP #-}
1213
module Glean.Query.Transform
1314
( transformationsFor
1415
, transformResultsBack

glean/db/Glean/Query/Typecheck/Unify.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ module Glean.Query.Typecheck.Unify (
1313
zonkVars,
1414
) where
1515

16-
import Control.Monad.Except
16+
import Control.Monad
1717
import Control.Monad.State
1818
import qualified Data.IntMap as IntMap
1919
import qualified Data.Map as Map

glean/glass/Glean/Glass/Path.hs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@
88

99
module Glean.Glass.Path where
1010

11-
import qualified Data.Text as Text
12-
1311
import Glean.Glass.Base ( SymbolRepoPath(..), GleanPath(GleanPath) )
1412
import qualified Glean.Glass.Types as Glass
1513

glean/glass/Glean/Glass/RepoMapping.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ module Glean.Glass.RepoMapping
1313
, allGleanRepos
1414
, supportsCxxDeclarationSources
1515
, mirrorConfig
16-
, Mirror(Mirror)
16+
, Mirror(..)
1717
) where
1818

1919
import Data.Set (Set)

glean/lang/clang/tests/Glean/Clang/Test.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ driverWith deriveToo =
3939
driver' = driverFromIndexer indexer'
4040
baseIndexer = indexerWith deriveToo
4141
isSrcFile file = takeExtension file `elem` [".c", ".cpp", ".m", ".mm"]
42-
withCompileCommandsFor opts params f = do
42+
withCompileCommandsFor _opts params f = do
4343
srcFiles <- map (indexerRoot params </>) . filter isSrcFile <$>
4444
listDirectory (indexerRoot params)
4545
writeFile (indexerOutput params </> "compile_commands.json") $

glean/test/regression/Glean/Regression/Snapshot/Options.hs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,15 @@ module Glean.Regression.Snapshot.Options
1414
, optionsWith
1515
) where
1616

17-
import Control.Monad (unless)
1817
import qualified Options.Applicative as O
1918
import System.Directory
2019
import System.FilePath
20+
21+
#if !defined(OSS)
22+
import Control.Monad (unless)
2123
import System.Process (readProcess)
2224
import Data.List (isPrefixOf, isSuffixOf)
25+
#endif
2326

2427
data Config = Config
2528
{ cfgProjectRoot :: FilePath
@@ -92,6 +95,7 @@ optionsWith other = O.info (O.helper <*> ((,) <$> parser <*> other)) O.fullDesc
9295
cfgReplace = replace
9396
}
9497

98+
#if !defined(OSS)
9599
-- | Simple heuristics to get the path of the source files
96100
-- from the buck-out path. Will take a path like
97101
--
@@ -143,4 +147,4 @@ sourcePath path = do
143147
if x == y
144148
then go xs ys
145149
else go (x:xs) ys
146-
150+
#endif

0 commit comments

Comments
 (0)