~ubuntu-branches/ubuntu/precise/empathy/precise-proposed-201205180810

« back to all changes in this revision

Viewing changes to telepathy-yell/tools/check-c-style.sh

  • Committer: Bazaar Package Importer
  • Author(s): Brian Curtis, Brian Curtis, Ken VanDine
  • Date: 2011-06-01 10:35:24 UTC
  • mfrom: (1.1.70 upstream) (6.3.44 experimental)
  • Revision ID: james.westby@ubuntu.com-20110601103524-wx3wgp71394730jt
Tags: 3.1.1-1ubuntu1
[ Brian Curtis ]
* Merge with Debian experimental, remaining Ubuntu changes:
* debian/control:
  - Drop geoclue/mapping build-depends (they are in Universe)
  - Add Vcz-Bzr link
  - Add Suggests on telepathy-idle
  - Bump telepathy-butterfly, telepathy-haze to recommends
  - Don't recommend the freedesktop sound theme we have an ubuntu one
  - Add build depend for libunity-dev
* debian/rules:
  - Use autoreconf.mk
  - Disable map and location
* debian/empathy.install:
  - Install message indicator configuration
* debian/indicators/empathy:
  - Message indicator configuration
* debian/patches/01_lpi.patch:
  - Add Launchpad integration
* debian/patches/10_use_notify_osd_icons.patch:
  - Use the notify-osd image for new messages
* debian/patches/34_start_raised_execpt_in_session.patch
  - If not started with the session, we should always raise
* debian/patches/36_chat_window_default_size.patch:
  - Make the default chat window size larger
* debian/patches/37_facebook_default.patch:
  - Make facebook the default chat account type
* debian/patches/38_lp_569289.patch
  - Set freenode as default IRC network for new IRC accounts 
* debian/patches/41_unity_launcher_progress.patch
  - Display file transfer progress in the unity launcher

[ Ken VanDine ]
* debian/control
  - build depend on libgcr-3-dev instead of libgcr-dev
  - dropped build depends for libindicate, we will use telepathy-indicator
  - Depend on dconf-gsettings-backend | gsettings-backend
  - Added a Recommends for telepathy-indicator
* +debian/empathy.gsettings-override
  - Added an override for notifications-focus
* debian/patches/series
  - commented out 23_idomessagedialog_for_voip_and_ft.patch, until ido has 
    been ported to gtk3

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#!/bin/sh
2
 
fail=0
3
 
 
4
 
( . "${tools_dir}"/check-misc.sh ) || fail=$?
5
 
 
6
 
if grep -n '^ *GError *\*[[:alpha:]_][[:alnum:]_]* *;' "$@"
7
 
then
8
 
  echo "^^^ The above files contain uninitialized GError*s - they should be"
9
 
  echo "    initialized to NULL"
10
 
  fail=1
11
 
fi
12
 
 
13
 
# The first regex finds function calls like foo() (as opposed to foo ()).
14
 
#   It attempts to ignore string constants (may cause false negatives).
15
 
# The second and third ignore block comments (gtkdoc uses foo() as markup).
16
 
# The fourth ignores cpp so you can
17
 
#   #define foo(bar) (_real_foo (__FUNC__, bar)) (cpp insists on foo() style).
18
 
if grep -n '^[^"]*[[:lower:]](' "$@" \
19
 
  | grep -v '^[-[:alnum:]_./]*:[[:digit:]]*: *\*' \
20
 
  | grep -v '^[-[:alnum:]_./]*:[[:digit:]]*: */\*' \
21
 
  | grep -v '^[-[:alnum:]_./]*:[[:digit:]]*: *#'
22
 
then
23
 
  echo "^^^ Our coding style is to use function calls like foo (), not foo()"
24
 
  fail=1
25
 
fi
26
 
 
27
 
if grep -En '[(][[:alnum:]_]+ ?\*[)][(]?[[:alpha:]_]' "$@"; then
28
 
  echo "^^^ Our coding style is to have a space between a cast and the "
29
 
  echo "    thing being cast"
30
 
  fail=1
31
 
fi
32
 
 
33
 
# this only spots casts
34
 
if grep -En '[(][[:alnum:]_]+\*+[)]' "$@"; then
35
 
  echo "^^^ Our coding style is to have a space before the * of pointer types"
36
 
  echo "    (regex 1)"
37
 
  fail=1
38
 
fi
39
 
# ... and this only spots variable declarations and function return types
40
 
if grep -En '^ *(static |const |)* *[[:alnum:]_]+\*+([[:alnum:]_]|;|$)' \
41
 
    "$@"; then
42
 
  echo "^^^ Our coding style is to have a space before the * of pointer types"
43
 
  echo "    (regex 2)"
44
 
  fail=1
45
 
fi
46
 
 
47
 
if test -n "$CHECK_FOR_LONG_LINES"
48
 
then
49
 
  if egrep -n '.{80,}' "$@"
50
 
  then
51
 
    echo "^^^ The above files contain long lines"
52
 
    fail=1
53
 
  fi
54
 
fi
55
 
 
56
 
exit $fail