Skip to content
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

checksrc: disallow spaces before labels #11134

Closed
wants to merge 1 commit into from

Conversation

emanuele6
Copy link
Contributor

Out of 223 labels throughout the code base, 65 of those labels were not at the start of the line. Which means labels always at the start of the line is the favoured style overall with 158 instances.

Out of the 65 labels not at the start of the line:

  • 58 were indented with the same indentation level of the following line
  • 5 were indented with exactly one space
  • 1 was indented with one less indentation level of the following line
  • 1 was indented with the indentation level of the following line minus three space (probably unintentional)

@vszakats
Copy link
Member

vszakats commented May 18, 2023

I'd suggest extending the query to catch labels with underscores and digits:

if($prevl !~ /\?\z/ && $l =~ /^ +([A-Za-z_][A-Za-z0-9_]*):$/ && $1 ne 'default') {

vszakats added a commit to vszakats/libssh2 that referenced this pull request May 18, 2023
Also update two labels to match the rest of the source.

checksrc update credit: Emanuele Torre @emanuele6

Ref: curl/curl#11134
@emanuele6
Copy link
Contributor Author

Done 👍

scripts/checksrc.pl Outdated Show resolved Hide resolved
@emanuele6
Copy link
Contributor Author

Oops =)

@vszakats
Copy link
Member

Thanks! With this, checksrc detected a few more issues:
https://github.com/curl/curl/actions/runs/5014000427/jobs/8987756473?pr=11134#step:19:1349

vszakats added a commit to libssh2/libssh2 that referenced this pull request May 18, 2023
Also update two labels to match the rest of the source.

checksrc update credit: Emanuele Torre @emanuele6

Ref: curl/curl#11134

Closes #1042
Out of 415 labels throughout the code base, 86 of those labels were
not at the start of the line. Which means labels always at the start of
the line is the favoured style overall with 329 instances.

Out of the 86 labels not at the start of the line:
* 75 were indented with the same indentation level of the following line
* 8 were indented with exactly one space
* 2 were indented with one fewer indentation level then the following
  line
* 1 was indented with the indentation level of the following line minus
  three space (probably unintentional)

Co-Authored-By: Viktor Szakats
@bagder bagder closed this in f198d33 May 18, 2023
@bagder
Copy link
Member

bagder commented May 18, 2023

Thanks, both of you!

@emanuele6 emanuele6 deleted the spacelab branch May 18, 2023 18:48
lampmanyao pushed a commit to lampmanyao/libssh2 that referenced this pull request Jul 16, 2023
Also update two labels to match the rest of the source.

checksrc update credit: Emanuele Torre @emanuele6

Ref: curl/curl#11134

Closes libssh2#1042
bch pushed a commit to bch/curl that referenced this pull request Jul 19, 2023
Out of 415 labels throughout the code base, 86 of those labels were
not at the start of the line. Which means labels always at the start of
the line is the favoured style overall with 329 instances.

Out of the 86 labels not at the start of the line:
* 75 were indented with the same indentation level of the following line
* 8 were indented with exactly one space
* 2 were indented with one fewer indentation level then the following
  line
* 1 was indented with the indentation level of the following line minus
  three space (probably unintentional)

Co-Authored-By: Viktor Szakats

Closes curl#11134
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

None yet

3 participants