Skip to content

Commit 2b95128

Browse files
committed
Fix name-conventions warnings
1 parent b68c7b4 commit 2b95128

File tree

5 files changed

+28
-28
lines changed

5 files changed

+28
-28
lines changed

haskell/experimental/private/module.bzl

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -140,23 +140,23 @@ def _build_haskell_module(
140140
"""
141141

142142
version = getattr(ctx.attr, "version", None)
143-
moduleAttr = module[HaskellModuleInfo].attr
143+
module_attr = module[HaskellModuleInfo].attr
144144

145145
# Collect dependencies
146-
src = moduleAttr.src.files.to_list()[0]
147-
extra_srcs = [f for t in moduleAttr.extra_srcs + ctx.attr.extra_srcs for f in t.files.to_list()]
146+
src = module_attr.src.files.to_list()[0]
147+
extra_srcs = [f for t in module_attr.extra_srcs + ctx.attr.extra_srcs for f in t.files.to_list()]
148148

149149
user_ghcopts = []
150150
user_ghcopts += haskell_library_expand_make_variables("ghcopts", ctx, ctx.attr.ghcopts)
151151

152152
module_extra_attrs = [
153-
[moduleAttr.src],
154-
moduleAttr.extra_srcs,
155-
moduleAttr.plugins,
156-
moduleAttr.tools,
153+
[module_attr.src],
154+
module_attr.extra_srcs,
155+
module_attr.plugins,
156+
module_attr.tools,
157157
]
158158

159-
user_compile_flags = expand_make_variables("ghcopts", ctx, moduleAttr.ghcopts, module_extra_attrs)
159+
user_compile_flags = expand_make_variables("ghcopts", ctx, module_attr.ghcopts, module_extra_attrs)
160160
user_ghcopts += user_compile_flags
161161

162162
import_dir = None
@@ -168,13 +168,13 @@ def _build_haskell_module(
168168
import_dir = idir
169169

170170
# Note [Plugin order]
171-
plugin_decl = reversed(ctx.attr.plugins + moduleAttr.plugins)
171+
plugin_decl = reversed(ctx.attr.plugins + module_attr.plugins)
172172
plugin_dep_info = gather_dep_info(
173-
moduleAttr.name,
173+
module_attr.name,
174174
[dep for plugin in plugin_decl for dep in plugin[GhcPluginInfo].deps],
175175
)
176176
plugins = [resolve_plugin_tools(ctx, plugin[GhcPluginInfo]) for plugin in plugin_decl]
177-
(preprocessors_inputs, preprocessors_input_manifests) = ctx.resolve_tools(tools = ctx.attr.tools + moduleAttr.tools)
177+
(preprocessors_inputs, preprocessors_input_manifests) = ctx.resolve_tools(tools = ctx.attr.tools + module_attr.tools)
178178

179179
# TODO[AH] Support additional outputs such as `.hie`.
180180

@@ -185,14 +185,14 @@ def _build_haskell_module(
185185
main_function = getattr(ctx.attr, "main_function", None)
186186

187187
if main_function:
188-
if moduleAttr.module_name:
189-
guess_module_name = moduleAttr.module_name
188+
if module_attr.module_name:
189+
guess_module_name = module_attr.module_name
190190
else:
191191
guess_module_name = get_module_path_from_target(module).replace("/", ".")
192192

193193
main_file = getattr(ctx.attr, "main_file", None)
194194
main_function_module = infer_main_module(main_function)
195-
if (moduleAttr.src == main_file or main_function_module == guess_module_name):
195+
if (module_attr.src == main_file or main_function_module == guess_module_name):
196196
args.add_all(["-main-is", ctx.attr.main_function])
197197

198198
args.add_all([

haskell/ghc_bindist.bzl

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -131,25 +131,25 @@ def _ghc_bindist_impl(ctx):
131131
# the raw distribution.
132132
unpack_dir = "bindist_unpacked" if os != "windows" else ""
133133

134-
stripPrefix = "ghc-" + version
134+
strip_prefix = "ghc-" + version
135135
if GHC_BINDIST_STRIP_PREFIX.get(version) != None and GHC_BINDIST_STRIP_PREFIX[version].get(target) != None:
136-
stripPrefix = GHC_BINDIST_STRIP_PREFIX[version][target]
136+
strip_prefix = GHC_BINDIST_STRIP_PREFIX[version][target]
137137
else:
138138
arch_suffix = {"arm64": "aarch64", "amd64": "x86_64"}.get(arch)
139139

140140
if os == "windows" and version_tuple >= (9, 0, 1):
141-
stripPrefix += "-{}-unknown-mingw32".format(arch_suffix)
141+
strip_prefix += "-{}-unknown-mingw32".format(arch_suffix)
142142
elif os == "darwin" and version_tuple >= (9, 0, 2):
143-
stripPrefix += "-{}-apple-darwin".format(arch_suffix)
143+
strip_prefix += "-{}-apple-darwin".format(arch_suffix)
144144
elif os == "linux" and version_tuple >= (9, 4, 1):
145-
stripPrefix += "-{}-unknown-linux".format(arch_suffix)
145+
strip_prefix += "-{}-unknown-linux".format(arch_suffix)
146146

147147
ctx.download_and_extract(
148148
url = url,
149149
output = unpack_dir,
150150
sha256 = sha256,
151151
type = "tar.xz",
152-
stripPrefix = stripPrefix,
152+
stripPrefix = strip_prefix,
153153
)
154154

155155
if os == "windows":

haskell/private/context.bzl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ load("@bazel_skylib//lib:paths.bzl", "paths")
44
load("//haskell:providers.bzl", "all_dependencies_package_ids")
55
load(":private/path_utils.bzl", "join_path_list")
66

7-
HaskellContext = provider()
7+
HaskellContext = provider() # buildifier: disable=name-conventions
88

99
def append_to_path(env, is_windows, path_list):
1010
if path_list:

haskell/private/haskell_impl.bzl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -752,8 +752,8 @@ def haskell_library_impl(ctx):
752752
#
753753
# TODO Get rid of this by computing a CcInfo in haskell_import
754754
# instead. Currently blocked on upstream.
755-
HaskellImportHack = provider()
756-
HaskellToolchainLibraries = provider()
755+
HaskellImportHack = provider() # buildifier: disable=name-conventions
756+
HaskellToolchainLibraries = provider() # buildifier: disable=name-conventions
757757

758758
def haskell_toolchain_library_impl(ctx):
759759
hs = haskell_context(ctx)

haskell/repl.bzl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -267,12 +267,12 @@ def _create_HaskellReplCollectInfo(target, dep_labels, dep_package_ids, dep_pack
267267
java_deps = depset(transitive = java_deps_list)
268268

269269
# TODO[GL]: add tests for CcInfo deps in narrowed_deps
270-
ccInfoDeps = [
270+
cc_info_deps = [
271271
dep
272272
for dep in getattr(ctx.rule.attr, "deps", []) + getattr(ctx.rule.attr, "narrowed_deps", [])
273273
if CcInfo in dep and not HaskellInfo in dep
274274
]
275-
ccSharedLibraryInfoDeps = [
275+
cc_shared_library_info_deps = [
276276
dep
277277
for dep in getattr(ctx.rule.attr, "deps", []) + getattr(ctx.rule.attr, "narrowed_deps", [])
278278
if CcSharedLibraryInfo in dep and not HaskellInfo in dep
@@ -286,17 +286,17 @@ def _create_HaskellReplCollectInfo(target, dep_labels, dep_package_ids, dep_pack
286286
boot_files = hs_info.boot_files,
287287
module_names = hs_info.module_names,
288288
import_dirs = set.to_depset(hs_info.import_dirs),
289-
cc_libraries_info = deps_HaskellCcLibrariesInfo(ccInfoDeps + ccSharedLibraryInfoDeps),
289+
cc_libraries_info = deps_HaskellCcLibrariesInfo(cc_info_deps + cc_shared_library_info_deps),
290290
cc_info = cc_common.merge_cc_infos(cc_infos = [
291291
# Collect pure C library dependencies, no Haskell dependencies.
292292
dep[CcInfo]
293-
for dep in ccInfoDeps
293+
for dep in cc_info_deps
294294
]),
295295
cc_shared_library_infos = [merge_cc_shared_library_infos(
296296
owner = ctx.label,
297297
cc_shared_library_infos = [
298298
dep[CcSharedLibraryInfo]
299-
for dep in ccSharedLibraryInfoDeps
299+
for dep in cc_shared_library_info_deps
300300
],
301301
)],
302302
compiler_flags = hs_info.user_compile_flags,

0 commit comments

Comments
 (0)