Skip to content

chore: use spaces instead tabs #1184

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Conversation

joshka
Copy link
Contributor

@joshka joshka commented Jun 20, 2025

https://www.youtube.com/watch\?v\=V7PLxL8jIl8

This brings things more in line with pretty much every rust project out there. Hard tabs are used in around 0.1% of rust projects:

@joshka joshka requested a review from orhun as a code owner June 20, 2025 23:35
@codecov-commenter
Copy link

codecov-commenter commented Jun 20, 2025

Codecov Report

Attention: Patch coverage is 41.47609% with 1126 lines in your changes missing coverage. Please review.

Project coverage is 42.28%. Comparing base (871c3c9) to head (541aa64).

Files with missing lines Patch % Lines
git-cliff/src/lib.rs 0.00% 426 Missing ⚠️
git-cliff-core/src/changelog.rs 53.43% 163 Missing ⚠️
git-cliff-core/src/remote/mod.rs 30.07% 100 Missing ⚠️
git-cliff-core/src/repo.rs 67.62% 80 Missing ⚠️
git-cliff/src/logger.rs 0.00% 73 Missing ⚠️
git-cliff-core/src/config.rs 51.81% 40 Missing ⚠️
git-cliff-core/src/remote/bitbucket.rs 27.46% 37 Missing ⚠️
git-cliff-core/src/remote/gitlab.rs 35.19% 35 Missing ⚠️
git-cliff-core/src/remote/gitea.rs 31.12% 31 Missing ⚠️
git-cliff-core/src/remote/github.rs 32.61% 31 Missing ⚠️
... and 10 more
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1184      +/-   ##
==========================================
- Coverage   42.35%   42.28%   -0.06%     
==========================================
  Files          21       21              
  Lines        1991     1994       +3     
==========================================
  Hits          843      843              
- Misses       1148     1151       +3     
Flag Coverage Δ
unit-tests 42.28% <41.48%> (-0.06%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Comment on lines -4 to -5
hard_tabs = true
tab_spaces = 4
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is the main change. Everything else is automatic formatting.

Copy link
Contributor Author

@joshka joshka Jun 20, 2025

Choose a reason for hiding this comment

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

https://docs.github.com/en/repositories/working-with-files/using-files/viewing-and-understanding-files#ignore-commits-in-the-blame-view

Note that this PR should be either merged without squash or rebased (and this file updated to correct the hash of the commit that ends up being there).

@orhun
Copy link
Owner

orhun commented Jun 22, 2025

I was thinking of creating a patch release for these formatting changes after I'm done with the current reviews. Otherwise it might be a bit annoying to rebase this on other PRs.

I always forget to do this though...

@joshka
Copy link
Contributor Author

joshka commented Jun 22, 2025

I was thinking of creating a patch release for these formatting changes after I'm done with the current reviews. Otherwise it might be a bit annoying to rebase this on other PRs.

I always forget to do this though...

Fixing PRs should fairly simple:

git checkout main -- rustfmt.toml
cargo +nightly fmt
git commit -am 'formatting
git push

If you're squashing merges then this shouldn't really be too much of a problem

Copy link
Contributor Author

@joshka joshka left a comment

Choose a reason for hiding this comment

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

To actually apply this, I'd suggest grabbing rustfmt.toml, discarding everything else and rerunning cargo +nightly fmt

git reset --hard main
git reset fdf857422158338c9ec461270b1aabd31a375049 rustfmt.toml
cargo +nightly fmt
git commit -aC fdf857422158338c9ec461270b1aabd31a375049
git push
git reset 541aa64f4e60738b0ff24895b358c3f05a4b841e .git-blame-ignore-revs
# edit the file with the correct hash

@@ -1,8 +1,6 @@
edition = "2024"
max_width = 85
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'd recommend upping this to 100 (and adding comment_width=100)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'd also recommend dropping struct_field_align_threshold - it looks ugly as sin. Particularly for the clap config as the indentation is all over the place.

@orhun
Copy link
Owner

orhun commented Jun 22, 2025

yes pls do itt

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants