Skip to content

Update header file tab settings - #65741

Merged
gregsfortytwo merged 3 commits into
ceph:mainfrom
edwinzrodriguez:ceph-clang-format-h
Oct 8, 2025
Merged

gregsfortytwo merged 3 commits into
ceph:mainfrom
edwinzrodriguez:ceph-clang-format-h

Conversation

@edwinzrodriguez

Copy link
Copy Markdown
Contributor

Update vim and emacs indent settings in header files

Contribution Guidelines

  • To sign and title your commits, please refer to Submitting Patches to Ceph.

  • If you are submitting a fix for a stable branch (e.g. "quincy"), please refer to Submitting Patches to Ceph - Backports for the proper workflow.

  • When filling out the below checklist, you may click boxes directly in the GitHub web UI. When entering or editing the entire PR message in the GitHub web UI editor, you may also select a checklist item by adding an x between the brackets: [x]. Spaces and capitalization matter when checking off items this way.

Checklist

  • Tracker (select at least one)
    • References tracker ticket
    • Very recent bug; references commit where it was introduced
    • New feature (ticket optional)
    • Doc update (no ticket needed)
    • Code cleanup (no ticket needed)
  • Component impact
    • Affects Dashboard, opened tracker ticket
    • Affects Orchestrator, opened tracker ticket
    • No impact that needs to be tracked
  • Documentation (select at least one)
    • Updates relevant documentation
    • No doc update is appropriate
  • Tests (select at least one)
Show available Jenkins commands

You must only issue one Jenkins command per-comment. Jenkins does not understand
comments with more than one command.

@anthonyeleven

Copy link
Copy Markdown
Contributor

Warning Only the first 1000 files are currently being shown. To see more, switch back to the classic page.

This is a first for me!

@anthonyeleven anthonyeleven left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I usually wouldn't approve a code PR, but as this doesn't change actual code I think it's legit for me to do so.

nits: Multiple files where either the vim or the gnumacs lines are missing. Multiple files where there isn't a blank line after the editor config lines: most files have a blank line, so that seems to be the desired pattern. One instance of a leading blank line.

Comment thread .clang-format Outdated

# The intended impact here is to allow up to 96 characters, but break at 80 if
# 96 is exceeded.
ColumnLimit: 80

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

THANK YOU THANK YOU THANK YOU

Comment thread .clang-format Outdated

# Do not align trailing comments across multiple lines. Note that this only applies
# to the single-line comment style using "//". Block inlines are always left alone.
AlignTrailingComments: false

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

aww :(

Comment thread src/include/byteorder.h
@@ -1,4 +1,4 @@
// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:nil -*-

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this probably should have

// vim: ts=8 sw=2 expandtab added to match the other files.

Though of course any emacs >> any vi ;)

Comment thread src/include/uuid.h
@@ -1,4 +1,4 @@
// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:nil -*-

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ditto

// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
// vim: ts=8 sw=2 smarttab
// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:nil -*-
// vim: ts=8 sw=2 expandtab
#ifndef CEPH_CLS_LOG_TYPES_H

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Insert blank line

Comment thread src/common/hex.h
@@ -1,6 +1,6 @@

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For conformity this blank line should probably be removed unless it's part of the spell.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Given this was supposed to be a straight mechanical change to the editor settings from being out of sync with .clang_format, I don't want to require blank line fixes or too much else on top of it.

@anthonyeleven anthonyeleven Oct 1, 2025 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re blank lines, fair enough. There are a number of files with missing lines, though, which would seem to be congruent with the goal. I also am unsure that the editor config is interpreted for files with an initial blank line.

Comment thread src/common/Initialize.h
@@ -1,4 +1,4 @@
// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:nil -*-

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add vim line?

Comment thread src/include/blobhash.h
@@ -1,4 +1,4 @@
// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:nil -*-

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add vim line?

Comment thread src/mds/StrayManager.h Outdated
@@ -1,4 +1,4 @@
// vim: ts=8 sw=2 smarttab
// vim: ts=8 sw=2 expandtab

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add emacs line please.

Comment thread CodingStyle
to a single tab character, do so. The standard Emacs/Vim settings
header is:
Indent width is two spaces. Tabs are expanded to spaces.
The standard Emacs/Vim settings header is:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you. Tabs arguably are a relic of the typewriter days and storage is no longer so expensive that it's worth the hassle of tabification, especially when e.g. Ansible doesn't like them.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, for viewing changes in github is the fundamental motivator here and other tools that balk at the mixed tab/space layout

Comment thread src/cls/cephfs/cls_cephfs_client.h Outdated
// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
// vim: ts=8 sw=2 smarttab
// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:nil -*-
// vim: ts=8 sw=2 expandtab

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do some of these lines have ft=cpp but not others?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably copy/paste oops

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ack. I dont' know if it's important but I note for due diligence. Did you edit each file, or use a find/sed/awk loop?

@edwinzrodriguez

Copy link
Copy Markdown
Contributor Author

This change was simply grep/sed replacement across files and was not intended to fix any other issues - the change is large enough already :)

@edwinzrodriguez edwinzrodriguez mentioned this pull request Oct 1, 2025
4 of 14 tasks

@idryomov idryomov left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please drop "Add .clang-format configuration file" commit from this PR. .clang-format settings can continue to be discussed in #65049.

Comment thread CodingStyle
// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
// vim: ts=8 sw=2 smarttab ft=cpp
// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:nil -*-
// vim: ts=8 sw=2 sts=2 expandtab ft=cpp

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sts=2 isn't being added in the actual header file updates in the rest of the PR. Should it be dropped here?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point. I'll update the changes to add sts=2 to the modified header comments. The sts setting is needed to indent by 2 when using the tab key

@idryomov idryomov mentioned this pull request Oct 1, 2025
4 of 14 tasks
@edwinzrodriguez

Copy link
Copy Markdown
Contributor Author

The 3 changes to modify the header comments were made in changes rebased on top of the clang-format change at #65049

Yet these 3 show up as including everything from 65049
#65741
#65742
#65743

How do I have github do that?

@idryomov idryomov mentioned this pull request Oct 1, 2025
4 of 14 tasks
@edwinzrodriguez

Copy link
Copy Markdown
Contributor Author

jenkins test make check arm64

1 similar comment
@edwinzrodriguez

Copy link
Copy Markdown
Contributor Author

jenkins test make check arm64

@edwinzrodriguez

Copy link
Copy Markdown
Contributor Author

I added missing blank lines where needed after the editor block

@edwinzrodriguez

Copy link
Copy Markdown
Contributor Author

jenkins test make check arm64

1 similar comment
@edwinzrodriguez

Copy link
Copy Markdown
Contributor Author

jenkins test make check arm64

@gregsfortytwo

gregsfortytwo commented Oct 8, 2025 •

Copy link
Copy Markdown
Member

The 3 changes to modify the header comments were made in changes rebased on top of the clang-format change at #65049

Yet these 3 show up as including everything from 65049 #65741 #65742 #65743

How do I have github do that?

There's unfortunately not a way to have Github chain PRs, although I believe it will resolve sensibly — if you merged #65049, those patches would no longer show up in this PR as new additions.

@gregsfortytwo gregsfortytwo left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The config line change LGTM.

@gregsfortytwo
gregsfortytwo merged commit b564829 into ceph:main Oct 8, 2025
@github-actions

github-actions Bot commented Oct 8, 2025

Copy link
Copy Markdown

This is an automated message by src/script/redmine-upkeep.py.

I found one or more Fixes: tags in the commit messages in

git log b564829f19b30ee412e91a2db93842c7fc9b0289^..b564829f19b30ee412e91a2db93842c7fc9b0289

The referenced tickets are:

Those tickets do not reference this merged Pull Request. If this Pull Request merge resolves any of those tickets, please update the "Pull Request ID" field on each ticket. A future run of this script will appropriately update them.

Update Log: https://github.com/ceph/ceph/actions/runs/18360533637

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants