Skip to content

Commit

Permalink
Format files across the project using pre-commit. (iree-org#17534)
Browse files Browse the repository at this point in the history
Prep for switching our lint checks to use
[pre-commit](https://pre-commit.com/) - tracked in
iree-org#17430.

Formatting hooks applied in this PR:

* trailing-whitespace
* end-of-file-fixer
* check-yaml
* black
* clang-format
* markdownlint
* bazel_to_cmake
  • Loading branch information
ScottTodd authored May 31, 2024
1 parent 2f36f8b commit 62efaee
Show file tree
Hide file tree
Showing 145 changed files with 507 additions and 553 deletions.
48 changes: 24 additions & 24 deletions .bazel_to_cmake.cfg.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,35 +17,35 @@


class CustomBuildFileFunctions(bazel_to_cmake_converter.BuildFileFunctions):
def iree_compiler_cc_library(self, deps=[], **kwargs):
self.cc_library(deps=deps + ["//compiler/src:defs"], **kwargs)

def iree_compiler_cc_library(self, deps=[], **kwargs):
self.cc_library(deps=deps + ["//compiler/src:defs"], **kwargs)
def iree_runtime_cc_library(self, deps=[], **kwargs):
self.cc_library(deps=deps + ["//runtime/src:runtime_defines"], **kwargs)

def iree_runtime_cc_library(self, deps=[], **kwargs):
self.cc_library(deps=deps + ["//runtime/src:runtime_defines"], **kwargs)
def iree_runtime_cc_test(self, deps=[], **kwargs):
self.cc_test(deps=deps + ["//runtime/src:runtime_defines"], **kwargs)

def iree_runtime_cc_test(self, deps=[], **kwargs):
self.cc_test(deps=deps + ["//runtime/src:runtime_defines"], **kwargs)
def iree_compiler_cc_test(self, deps=[], **kwargs):
self.cc_test(deps=deps + ["//compiler/src:defs"], **kwargs)

def iree_compiler_cc_test(self, deps=[], **kwargs):
self.cc_test(deps=deps + ["//compiler/src:defs"], **kwargs)
def iree_runtime_cc_binary(self, deps=[], **kwargs):
self.cc_binary(deps=deps + ["//runtime/src:runtime_defines"], **kwargs)

def iree_runtime_cc_binary(self, deps=[], **kwargs):
self.cc_binary(deps=deps + ["//runtime/src:runtime_defines"], **kwargs)

def iree_compiler_cc_binary(self, deps=[], **kwargs):
self.cc_binary(deps=deps + ["//compiler/src:defs"], **kwargs)
def iree_compiler_cc_binary(self, deps=[], **kwargs):
self.cc_binary(deps=deps + ["//compiler/src:defs"], **kwargs)


class CustomTargetConverter(bazel_to_cmake_targets.TargetConverter):

def _initialize(self):
self._update_target_mappings({
"//compiler/src:defs": [],
"//runtime/src:runtime_defines": [],
})

def _convert_unmatched_target(self, target: str) -> str:
"""Converts unmatched targets in a repo specific way."""
# Default rewrite: prefix with "iree::", without pruning the path.
return ["iree::" + self._convert_to_cmake_path(target)]
def _initialize(self):
self._update_target_mappings(
{
"//compiler/src:defs": [],
"//runtime/src:runtime_defines": [],
}
)

def _convert_unmatched_target(self, target: str) -> str:
"""Converts unmatched targets in a repo specific way."""
# Default rewrite: prefix with "iree::", without pruning the path.
return ["iree::" + self._convert_to_cmake_path(target)]
4 changes: 4 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,7 @@
# IREE's runtime follows Google style while its compiler follows the
# LLVM/MLIR variable naming and formatting style.
BasedOnStyle: Google

---
Language: Json
DisableFormat: true
2 changes: 1 addition & 1 deletion .devcontainer/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,4 +122,4 @@ Once the container is started, you will be greeted by the container terminal
![dev container terminal](docs_data/dev_container_terminal.png)

**Once done, you are ready to start developing, building and contributing to
IREE πŸŽ‰πŸŽ‰πŸŽ‰.**
IREE πŸŽ‰πŸŽ‰πŸŽ‰.**
Loading

0 comments on commit 62efaee

Please sign in to comment.