Skip to content

Commit

Permalink
Enable end-of-file-fixer and trailing-whitespace hooks. (iree-org#17630)
Browse files Browse the repository at this point in the history
Progress on iree-org#17430. We've had
pre-commit enabled as blocking on PRs for about a week now and setup is
documented at
https://iree.dev/developers/general/contributing/#coding-style-guidelines,
so I'm comfortable enforcing these extra checks:

* `end-of-file-fixer` ensures that files end with a single `\n`
character, trimming extra newlines and inserting missing newlines
* `trailing-whitespace` ensures that lines in files do not contain
trailing whitespace

Together, both of these hooks enforce more consistency in file
formatting, making large scale changes easier and cleaner.
  • Loading branch information
ScottTodd authored Jun 10, 2024
1 parent f062b19 commit f4cfb55
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 8 deletions.
10 changes: 4 additions & 6 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,11 @@ repos:
# resulting in errors like `expected a single document in the stream`
exclude: "mkdocs.yml|.clang-format"

# TODO(scotttodd): enable once enough contributors are familiar with pre-commit
# - id: end-of-file-fixer
# exclude_types: ["image", "jupyter"]
- id: end-of-file-fixer
exclude_types: ["image", "jupyter"]

# TODO(scotttodd): enable once enough contributors are familiar with pre-commit
# - id: trailing-whitespace
# exclude_types: ["image", "jupyter"]
- id: trailing-whitespace
exclude_types: ["image", "jupyter"]

- repo: https://github.com/psf/black
rev: 23.3.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ func.func @fold_extract_slice_consumer_into_xfer_write(%arg0: vector<1x64x128xf1

// -----

// Test the case where we write out of bounds because large index
// Test the case where we write out of bounds because large index
func.func @fold_extract_slice_consumer_into_xfer_write_2(%arg0: vector<1x64x128xf16>, %arg1: index) -> tensor<1x?x128xf16> {
%c0 = arith.constant 0 : index
%c127 = arith.constant 127 : index
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,3 @@ module attributes { transform.with_named_sequence } {
// CHECK: tensor.parallel_insert_slice %[[MMA]] into %[[ITER_ARG]][0, 0, %[[IDS]]#0, %[[IDS]]#1]
// CHECK-SAME: [2, 2, 4, 1] [1, 1, 1, 1] : tensor<2x2x4x1xf32> into tensor<2x2x16x16xf32>
// CHECK: mapping = [#iree_gpu.lane_id<0>]

0 comments on commit f4cfb55

Please sign in to comment.