Skip to content

Conversation

pslldq
Copy link
Contributor

@pslldq pslldq commented Mar 20, 2025

Add an .editorconfig mostly trying to match the current styles used in the repository. Consistently indented inconsistent files and moved relevant source files to use spaces instead of tabs. Added necessary checking to the CI using editorconfig-checker. As it doesn't support "fancy indentations" (e.g. align arguments), the indentation check was disabled.

Fixes #1455

@codecov-commenter
Copy link

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

Attention: Patch coverage is 2.56410% with 76 lines in your changes missing coverage. Please review.

Project coverage is 65.56%. Comparing base (49acb50) to head (74d5be7).

Files with missing lines Patch % Lines
src/wayland/pool-buffer.c 0.00% 75 Missing ⚠️
src/wayland/wl.c 0.00% 1 Missing ⚠️

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1461   +/-   ##
=======================================
  Coverage   65.56%   65.56%           
=======================================
  Files          50       50           
  Lines        8910     8910           
  Branches     1042     1042           
=======================================
  Hits         5842     5842           
  Misses       3068     3068           
Flag Coverage Δ
unittests 65.56% <2.56%> (ø)

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.

@bynect
Copy link
Member

bynect commented Mar 20, 2025

I would rather prefer 4 space indentation in c files. @fwsmit would that be okay?

@fwsmit
Copy link
Member

fwsmit commented Mar 20, 2025

I don't have a problem with that. It's only that if you change it you will polute the git blame history with indent changes everywhere. So I would suggest leaving it. Any code that is indented so many times as to become an issue with 8 space indent should probably be rewritten anyways to have better code structure

@bynect
Copy link
Member

bynect commented Mar 20, 2025

I am inclined to agree. Ideally the indentation should be adjusted on future changes to those files as to prevent git history pollution. I am not sure its possible with an automated tool however

@pslldq
Copy link
Contributor Author

pslldq commented Mar 21, 2025

I am inclined to agree. Ideally the indentation should be adjusted on future changes to those files as to prevent git history pollution. I am not sure its possible with an automated tool however

For this (and C files) clang-format is the tool of choice. Although it needs a bunch of configuration, as it will reformat the whole code (where do braces go, case statement indented, max line length, etc.)

I would rather prefer 4 space indentation in c files. @fwsmit would that be okay?

ah ok, I'll update the PR to remove the 4 -> 8 indention changes the 3 or 4 c files, so that my indentation commit only affects files with mixed spaces.

@pslldq pslldq marked this pull request as draft March 21, 2025 07:39
Sven Püschel added 2 commits March 28, 2025 18:20
Remove trailing whitespaces, except for the generated wayland code.
dunst has a mix of indentation styles. Try to improve it by making it
consistent in files with mixed tab/space indentation styles.

While this also changes the generated manpages slightly, it makes it
more consistent accross the man page and probably won't be noticed by
the reader.
Sven Püschel added 2 commits March 28, 2025 23:13
Add an .editorconfig file to automatically configure supported editors.
This file was generated merely based on the existent styles and the
warnings caused while checking the code with the editorconfig-checker
tool.

As the editorconfig checker tool generates false positives when an
indentation is adjusted to match multiline arguments or similar
aesthetic adaptions, the corresponding check was disabled. This will
miss wrong indentation sizes (e.g. 4 instead of 8 spaces).
@pslldq pslldq marked this pull request as ready for review March 28, 2025 22:15
@pslldq
Copy link
Contributor Author

pslldq commented Mar 28, 2025

updated the PR to just reformat files with mixed spaces

@bynect
Copy link
Member

bynect commented Mar 30, 2025

this looks good. probably the way to go is to transition slowly to 4 spaces everywhere by removing the exceptions one by one going forward

@pslldq pslldq mentioned this pull request Mar 31, 2025
@pslldq
Copy link
Contributor Author

pslldq commented Mar 31, 2025

@bynect I'm more on the autoformatting side to get it consistent in one big commit (and make a bunch of other stuff equally formatted between source files). See #1464

@pslldq
Copy link
Contributor Author

pslldq commented Apr 14, 2025

Whats the plan to continue on this? I could also remove all whitespace fixups, as these are not checked by the editorconfig-checker (because enabling the check would cause false positives for all aligned indents in the C code).

@bynect
Copy link
Member

bynect commented Apr 14, 2025

For now I would prefer starting with this one. For autoformat we'll decide what to do then

@bynect bynect merged commit 1dcc520 into dunst-project:master Apr 14, 2025
24 checks passed
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.

Introduce .editorconfig
4 participants