Skip to content
GitLab
  • Menu
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • D devscripts
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Merge requests 9
    • Merge requests 9
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Releases
  • Activity
  • Graph
  • Jobs
  • Commits
Collapse sidebar
  • DebianDebian
  • devscripts
  • Merge requests
  • !273

Opening braces in functions

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Akbarkhon Variskhanov requested to merge KBar/devscripts:opening-braces-in-functions into master Aug 12, 2022
  • Overview 0
  • Commits 2
  • Pipelines 1
  • Changes 20

Very minor, trivial changes to some select shell scripts.

Place opening braces that were on a line of their own on the same line as function definitions, which is predominantly the case (numbers below).

# An AWK program that reports these inconsistencies in numbers.
awk '$1 ~ /^{/ { nl++ }; /[-_A-Za-z0-9] \(\) { ?/ { space++; line++ }; /[-_A-Za-z0-9]\(\) { ?/ { nospace++; line++ }; END { print "Opening brace on a line of its own:\t" nl; print "==========================================\nOpening brace on the same line:\t\t" line "\nWith whitespace before parentheses:\t" space; print "No whitespace before parentheses:\t" nospace }' *.sh
Opening brace on a line of its own:	35
==========================================
Opening brace on the same line:		114
With whitespace before parentheses:	50
No whitespace before parentheses:	64
Assignee
Assign to
Reviewer
Request review from
Time tracking
Source branch: opening-braces-in-functions