File: apply-gsv-coding-style-no-backup.sh

package info (click to toggle)
libgedit-gtksourceview 299.5.0-1
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 7,536 kB
  • sloc: ansic: 48,501; xml: 2,620; perl: 206; sh: 51; yacc: 45; makefile: 35; cobol: 20; objc: 19; javascript: 16; fortran: 14; python: 13; cpp: 8; ml: 3
file content (27 lines) | stat: -rwxr-xr-x 1,004 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/usr/bin/env bash

# Attention, this script modifies the input file directly without doing a
# backup first! Ensure that your changes are saved in a git commit before
# running this script.
#
# The script can modify only one file, to run the script on multiple files GNU
# Parallel is recommended:
# ls *.c | parallel ./apply-gsv-coding-style-no-backup.sh
#
# You need gcu-lineup-parameters from:
# https://github.com/swilmet/gnome-c-utils
#
# Aligning function prototypes is not working yet, so avoid headers, only *.c
# files can be processed.
#
# The uncrustify config file is not perfect, some options can be tuned over
# time when using this script and seeing a problem (or the source code can be
# changed to avoid the problem).
#
# This script has not (yet) been run on the GtkSourceView *.c files, it can
# serve more as a guideline, especially for new files.

input_file=$1

uncrustify --replace --no-backup -c gtksourceview-uncrustify.cfg $input_file
gcu-lineup-parameters --tabs $input_file