[all-commits] [llvm/llvm-project] 7894e6: [clang-format] Ignore imports in comments for Jav...

nataliakokoromyti via All-commits all-commits at lists.llvm.org
Sat Mar 14 01:08:18 PDT 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 7894e636f31a30b303b51292c4bf53931d1e82f7
      https://github.com/llvm/llvm-project/commit/7894e636f31a30b303b51292c4bf53931d1e82f7
  Author: nataliakokoromyti <nataliakokoromyti at gmail.com>
  Date:   2026-03-14 (Sat, 14 Mar 2026)

  Changed paths:
    M clang/lib/Format/Format.cpp
    M clang/unittests/Format/SortImportsTestJava.cpp

  Log Message:
  -----------
  [clang-format]  Ignore imports in comments for Java import sorting (#177326)

Java source files can contain apparent import statements inside block
comments (e.g., showing a code example). These can get mixed up with
real import statements when run through clang-format.

This patch tracks block comments (/* ... */) so that we skip lines that
are inside them.

Fixes #176771

---------

Co-authored-by: Natalia Kokoromyti <knatalia at yost-cm-01-imme.stanford.edu>
Co-authored-by: owenca <owenpiano at gmail.com>



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list