Skip to content

Conversation

@T-X
Copy link
Contributor

@T-X T-X commented Apr 9, 2025

In preparation to make the editorconfig-checker happy this performs the following style changes:

For one thing, use SPDX headers. editorconfig-checker does not like the spaces in these C files. For another, use tabs instead of spaces in various C files.


Still ToDo, to make editorconfig-checker succeed:

  • ebtables-tiny
  • miniz.c
  • multi-line function arguments which use final spaces for alignment:
    • packages/gluon/admin/autoupdater/src/manifest.c
    • packages/gluon/net/respondd/src/respondd.c
    • packages/gluon/net/wgpeerselector/files/usr/bin/wgpeerselector
  • README.md and COPYING files

@T-X
Copy link
Contributor Author

T-X commented Apr 9, 2025

Please double-check especially the SPDX changes, was quite a bit of manual work.

@neocturne
Copy link
Member

Doing any work in ebtables-tiny is probably not worth the effort, as we're going to drop it after the next release anyways (as soon as nftables is ready, which I intend to take care of)

@neocturne neocturne self-assigned this Apr 9, 2025
@T-X T-X force-pushed the pr-style-spdx-tabs branch 2 times, most recently from 33950e5 to f77fa1b Compare April 11, 2025 00:40
This migrates most of the packages to SPDX license headers.
Also in preparation to make the "editorconfig-checker" linter
happy, which doesn't like the spaces.

Signed-off-by: Linus Lüssing <linus.luessing@c0d3.blue>
@T-X T-X force-pushed the pr-style-spdx-tabs branch from f77fa1b to 435df91 Compare April 11, 2025 00:43
@T-X
Copy link
Contributor Author

T-X commented Apr 11, 2025

Changelog v2:

  • made // SPDX-License-Identifier: ... the first line
  • changed /* SPDX... to // SPDX...

@T-X
Copy link
Contributor Author

T-X commented Apr 16, 2025

Changelog v3:

  • adding .editorconfig, .editorconfig-checker.json and editorconfig-checker action

This for one thing converts spaces to tabs in C code. For another
changes multi-line comments to the Linux kernel style where
editorconfig-checker would complain.

Signed-off-by: Linus Lüssing <linus.luessing@c0d3.blue>
@T-X T-X force-pushed the pr-style-spdx-tabs branch from 6ebc68e to e30ca2c Compare April 24, 2025 08:02
@T-X
Copy link
Contributor Author

T-X commented Apr 24, 2025

Changelog v4:

  • reverting/removing change to /usr/bin/wgpeerselector: with editorconfig-checker's "SpacesAfterTabs=true" since v3 it is actually happy about it; keeping it as is as @neocturne suggested, to have alignment independent of tab size there

T-X added 2 commits April 28, 2025 15:19
The .editorconfig file is a 1:1 copy from the main Gluon repository.

For the .editorconfig-checker.json the following customizations were
applied:

1) Changing SpacesAfterTabs from false to true: To allow the common Linux
kernel coding style which prefers tabs and then using spaces for a final
alignment. This silences the following three outputs:

```
admin/autoupdater/src/manifest.c:
        33-34: Wrong indentation type(spaces instead of tabs)
net/respondd/src/respondd.c:
        430: Wrong indentation type(spaces instead of tabs)
        518: Wrong indentation type(spaces instead of tabs)
net/wgpeerselector/files/usr/bin/wgpeerselector:
        199: Wrong indentation type(spaces instead of tabs)
        291: Wrong indentation type(spaces instead of tabs)
```

2) Excluding net/ebtables-tiny and net/respondd/src/miniz.c. These are
basically code copies from another project. Keep their alignment to what
their upstream has. Also ebtables-tiny will be removed soon anyway with
the switch to nftables.

3) Excluding README.md files: editorconfig-checker complains especially
about their inline code blocks. I don't see an easy way to fix that, so
exclude README.md files for now.

Signed-off-by: Linus Lüssing <linus.luessing@c0d3.blue>
Check editorconfig-checker from the Github CI. Basically from this
example workflow, with minor adjustments:

https://github.com/editorconfig-checker/action-editorconfig-checker?tab=readme-ov-file#example-workflow

Signed-off-by: Linus Lüssing <linus.luessing@c0d3.blue>
@T-X T-X force-pushed the pr-style-spdx-tabs branch from e30ca2c to f83a6a7 Compare April 28, 2025 13:20
@T-X
Copy link
Contributor Author

T-X commented Apr 28, 2025

Changelog v5:

  • removed empty sections in .editorconfig as they don't do anything
  • removed checks for non-existent directories in the .editorconfig, which are only present in the main Gluon repository

@neocturne neocturne merged commit 4e1ae8f into freifunk-gluon:main Apr 28, 2025
3 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.

2 participants