From 801ef3bfc34f628216dae6199ad690661c772eca Mon Sep 17 00:00:00 2001 From: Patrick Thomson Date: Tue, 23 Jun 2020 09:45:10 -0400 Subject: [PATCH] use the same GHC warnings everywhere --- build/common.bzl | 1 + semantic-analysis/BUILD.bazel | 6 +++++- semantic-ast/BUILD.bazel | 6 +++++- semantic-codeql/BUILD.bazel | 5 +++++ semantic-core/BUILD.bazel | 5 +++++ semantic-go/BUILD.bazel | 5 +++++ semantic-java/BUILD.bazel | 5 +++++ semantic-php/BUILD.bazel | 5 +++++ semantic-python/BUILD.bazel | 5 +++++ semantic-ruby/BUILD.bazel | 5 +++++ semantic-scope-graph/BUILD.bazel | 7 +++++-- semantic-source/BUILD.bazel | 6 +++++- semantic-tags/BUILD.bazel | 5 +++++ semantic-tsx/BUILD.bazel | 5 +++++ semantic-typescript/BUILD.bazel | 5 +++++ 15 files changed, 71 insertions(+), 5 deletions(-) diff --git a/build/common.bzl b/build/common.bzl index 36840654f..b04715f17 100644 --- a/build/common.bzl +++ b/build/common.bzl @@ -1,6 +1,7 @@ # This file lets us share warnings and such across the project STANDARD_GHC_WARNINGS = [ + "-O0", "-Weverything", "-Wno-missing-local-signatures", "-Wno-missing-import-lists", diff --git a/semantic-analysis/BUILD.bazel b/semantic-analysis/BUILD.bazel index 664697c05..8a33986e8 100644 --- a/semantic-analysis/BUILD.bazel +++ b/semantic-analysis/BUILD.bazel @@ -13,6 +13,10 @@ load( "haskell_cabal_binary", "haskell_cabal_library", ) +load( + "//:build/common.bzl", + "STANDARD_GHC_WARNINGS", +) # haskell_toolchain_library can access builtin GHC packages # and assign them a bazel target name, so that they @@ -23,7 +27,7 @@ haskell_toolchain_library(name = "base") haskell_library( name = "lib", srcs = glob(["src/**/*.hs"]), - compiler_flags = ["-XOverloadedStrings"], + compiler_flags = STANDARD_GHC_WARNINGS + ["-XOverloadedStrings"], src_strip_prefix = "src", deps = [ ":base", diff --git a/semantic-ast/BUILD.bazel b/semantic-ast/BUILD.bazel index 033a0e9b9..3d09d295b 100644 --- a/semantic-ast/BUILD.bazel +++ b/semantic-ast/BUILD.bazel @@ -13,6 +13,10 @@ load( "haskell_cabal_binary", "haskell_cabal_library", ) +load( + "//:build/common.bzl", + "STANDARD_GHC_WARNINGS", +) # haskell_toolchain_library can access builtin GHC packages # and assign them a bazel target name, so that they @@ -23,7 +27,7 @@ haskell_toolchain_library(name = "base") haskell_library( name = "lib", srcs = glob(["src/**/*.hs"]), - compiler_flags = ["-XOverloadedStrings"], + compiler_flags = STANDARD_GHC_WARNINGS + ["-XOverloadedStrings"], src_strip_prefix = "src", deps = [ ":base", diff --git a/semantic-codeql/BUILD.bazel b/semantic-codeql/BUILD.bazel index db7a37bda..e2b37897e 100644 --- a/semantic-codeql/BUILD.bazel +++ b/semantic-codeql/BUILD.bazel @@ -13,6 +13,10 @@ load( "haskell_cabal_binary", "haskell_cabal_library", ) +load( + "//:build/common.bzl", + "STANDARD_GHC_WARNINGS", +) # haskell_toolchain_library can access builtin GHC packages # and assign them a bazel target name, so that they @@ -23,6 +27,7 @@ haskell_toolchain_library(name = "base") haskell_library( name = "lib", srcs = glob(["src/**/*.hs"]), + compiler_flags = STANDARD_GHC_WARNINGS, extra_srcs = ["//vendor:codeql-node-types.json"], deps = [ ":base", diff --git a/semantic-core/BUILD.bazel b/semantic-core/BUILD.bazel index 710ba9019..5420c98b1 100644 --- a/semantic-core/BUILD.bazel +++ b/semantic-core/BUILD.bazel @@ -13,6 +13,10 @@ load( "haskell_cabal_binary", "haskell_cabal_library", ) +load( + "//:build/common.bzl", + "STANDARD_GHC_WARNINGS", +) # haskell_toolchain_library can access builtin GHC packages # and assign them a bazel target name, so that they @@ -23,6 +27,7 @@ haskell_toolchain_library(name = "base") haskell_library( name = "lib", srcs = glob(["src/**/*.hs"]), + compiler_flags = STANDARD_GHC_WARNINGS, src_strip_prefix = "src", deps = [ ":base", diff --git a/semantic-go/BUILD.bazel b/semantic-go/BUILD.bazel index 5dcc49c74..9ad538ff9 100644 --- a/semantic-go/BUILD.bazel +++ b/semantic-go/BUILD.bazel @@ -13,6 +13,10 @@ load( "haskell_cabal_binary", "haskell_cabal_library", ) +load( + "//:build/common.bzl", + "STANDARD_GHC_WARNINGS", +) # haskell_toolchain_library can access builtin GHC packages # and assign them a bazel target name, so that they @@ -23,6 +27,7 @@ haskell_toolchain_library(name = "base") haskell_library( name = "lib", srcs = glob(["src/**/*.hs"]), + compiler_flags = STANDARD_GHC_WARNINGS, extra_srcs = ["//vendor:go-node-types.json"], deps = [ ":base", diff --git a/semantic-java/BUILD.bazel b/semantic-java/BUILD.bazel index 6214e56f8..8a3dc495b 100644 --- a/semantic-java/BUILD.bazel +++ b/semantic-java/BUILD.bazel @@ -13,6 +13,10 @@ load( "haskell_cabal_binary", "haskell_cabal_library", ) +load( + "//:build/common.bzl", + "STANDARD_GHC_WARNINGS", +) # haskell_toolchain_library can access builtin GHC packages # and assign them a bazel target name, so that they @@ -23,6 +27,7 @@ haskell_toolchain_library(name = "base") haskell_library( name = "lib", srcs = glob(["src/**/*.hs"]), + compiler_flags = STANDARD_GHC_WARNINGS, extra_srcs = ["//vendor:java-node-types.json"], deps = [ ":base", diff --git a/semantic-php/BUILD.bazel b/semantic-php/BUILD.bazel index 25696b7b2..4b2d80cb8 100644 --- a/semantic-php/BUILD.bazel +++ b/semantic-php/BUILD.bazel @@ -13,6 +13,10 @@ load( "haskell_cabal_binary", "haskell_cabal_library", ) +load( + "//:build/common.bzl", + "STANDARD_GHC_WARNINGS", +) # haskell_toolchain_library can access builtin GHC packages # and assign them a bazel target name, so that they @@ -23,6 +27,7 @@ haskell_toolchain_library(name = "base") haskell_library( name = "lib", srcs = glob(["src/**/*.hs"]), + compiler_flags = STANDARD_GHC_WARNINGS, extra_srcs = ["//vendor:php-node-types.json"], deps = [ ":base", diff --git a/semantic-python/BUILD.bazel b/semantic-python/BUILD.bazel index e27f6acec..0ae8d2dd3 100644 --- a/semantic-python/BUILD.bazel +++ b/semantic-python/BUILD.bazel @@ -13,6 +13,10 @@ load( "haskell_cabal_binary", "haskell_cabal_library", ) +load( + "//:build/common.bzl", + "STANDARD_GHC_WARNINGS", +) # haskell_toolchain_library can access builtin GHC packages # and assign them a bazel target name, so that they @@ -23,6 +27,7 @@ haskell_toolchain_library(name = "base") haskell_library( name = "lib", srcs = glob(["src/**/*.hs"]), + compiler_flags = STANDARD_GHC_WARNINGS, extra_srcs = ["//vendor:python-node-types.json"], deps = [ ":base", diff --git a/semantic-ruby/BUILD.bazel b/semantic-ruby/BUILD.bazel index 14baa1497..2cb7e4f44 100644 --- a/semantic-ruby/BUILD.bazel +++ b/semantic-ruby/BUILD.bazel @@ -13,6 +13,10 @@ load( "haskell_cabal_binary", "haskell_cabal_library", ) +load( + "//:build/common.bzl", + "STANDARD_GHC_WARNINGS", +) # haskell_toolchain_library can access builtin GHC packages # and assign them a bazel target name, so that they @@ -23,6 +27,7 @@ haskell_toolchain_library(name = "base") haskell_library( name = "lib", srcs = glob(["src/**/*.hs"]), + compiler_flags = STANDARD_GHC_WARNINGS, extra_srcs = ["//vendor:ruby-node-types.json"], src_strip_prefix = "src", deps = [ diff --git a/semantic-scope-graph/BUILD.bazel b/semantic-scope-graph/BUILD.bazel index 8dc7ee786..fc78465bf 100644 --- a/semantic-scope-graph/BUILD.bazel +++ b/semantic-scope-graph/BUILD.bazel @@ -13,6 +13,10 @@ load( "haskell_cabal_binary", "haskell_cabal_library", ) +load( + "//:build/common.bzl", + "STANDARD_GHC_WARNINGS", +) # haskell_toolchain_library can access builtin GHC packages # and assign them a bazel target name, so that they @@ -23,8 +27,7 @@ haskell_toolchain_library(name = "base") haskell_library( name = "lib", srcs = glob(["src/**/*.hs"]), - compiler_flags = ["-XOverloadedStrings"], - src_strip_prefix = "src", + compiler_flags = STANDARD_GHC_WARNINGS + ["-XOverloadedStrings"], deps = [ ":base", "//semantic-analysis:lib", diff --git a/semantic-source/BUILD.bazel b/semantic-source/BUILD.bazel index 40012c481..e229d01a8 100644 --- a/semantic-source/BUILD.bazel +++ b/semantic-source/BUILD.bazel @@ -18,6 +18,10 @@ load( "haskell_doctest", "haskell_doctest_toolchain", ) +load( + "//:build/common.bzl", + "STANDARD_GHC_WARNINGS", +) # haskell_toolchain_library can access builtin GHC packages # and assign them a bazel target name, so that they @@ -27,7 +31,7 @@ haskell_toolchain_library(name = "base") haskell_library( name = "lib", srcs = glob(["src/**/*.hs"]), - compiler_flags = ["-XOverloadedStrings"], + compiler_flags = STANDARD_GHC_WARNINGS + ["-XOverloadedStrings"], src_strip_prefix = "src", deps = [ ":base", diff --git a/semantic-tags/BUILD.bazel b/semantic-tags/BUILD.bazel index 7870a937c..1bea86540 100644 --- a/semantic-tags/BUILD.bazel +++ b/semantic-tags/BUILD.bazel @@ -13,6 +13,10 @@ load( "haskell_cabal_binary", "haskell_cabal_library", ) +load( + "//:build/common.bzl", + "STANDARD_GHC_WARNINGS", +) # haskell_toolchain_library can access builtin GHC packages # and assign them a bazel target name, so that they @@ -23,6 +27,7 @@ haskell_toolchain_library(name = "base") haskell_library( name = "lib", srcs = glob(["src/**/*.hs"]), + compiler_flags = STANDARD_GHC_WARNINGS, src_strip_prefix = "src", deps = [ ":base", diff --git a/semantic-tsx/BUILD.bazel b/semantic-tsx/BUILD.bazel index aefd8abd5..d1eb760f8 100644 --- a/semantic-tsx/BUILD.bazel +++ b/semantic-tsx/BUILD.bazel @@ -13,6 +13,10 @@ load( "haskell_cabal_binary", "haskell_cabal_library", ) +load( + "//:build/common.bzl", + "STANDARD_GHC_WARNINGS", +) # haskell_toolchain_library can access builtin GHC packages # and assign them a bazel target name, so that they @@ -23,6 +27,7 @@ haskell_toolchain_library(name = "base") haskell_library( name = "lib", srcs = glob(["src/**/*.hs"]), + compiler_flags = STANDARD_GHC_WARNINGS, extra_srcs = ["//vendor:tsx-node-types.json"], deps = [ ":base", diff --git a/semantic-typescript/BUILD.bazel b/semantic-typescript/BUILD.bazel index 9df9d605e..738455186 100644 --- a/semantic-typescript/BUILD.bazel +++ b/semantic-typescript/BUILD.bazel @@ -13,6 +13,10 @@ load( "haskell_cabal_binary", "haskell_cabal_library", ) +load( + "//:build/common.bzl", + "STANDARD_GHC_WARNINGS", +) # haskell_toolchain_library can access builtin GHC packages # and assign them a bazel target name, so that they @@ -23,6 +27,7 @@ haskell_toolchain_library(name = "base") haskell_library( name = "lib", srcs = glob(["src/**/*.hs"]), + compiler_flags = STANDARD_GHC_WARNINGS, extra_srcs = ["//vendor:tsx-node-types.json"], deps = [ ":base",