On (10/08/15 19:31), Pavel Reichl wrote:
On 08/10/2015 03:00 PM, Lukas Slebodnik wrote:
>On (10/08/15 14:54), Pavel Reichl wrote:
>>On 08/10/2015 02:52 PM, Lukas Slebodnik wrote:
>>>On (10/08/15 14:44), Pavel Reichl wrote:
>>>>Hello,
>>>>
>>>>please see trivial patch attached. I noticed some whitespace in source
file,
>>>>so I did some grepping and decided to remove it as we already were almost
100
>>>>% trailing whitespace free.
>>>>
>>>I would prefer if you could write a test.
>>>So it will be checked as a part of "make check"
>>Yes, I already put on my todo list, but I consider it as independent task.
>Yes,
>
>but patch is not very useful without the test.
>Because we can still accidentally add trailing white spaces.
>
>I would rather wait until you write the test then we can push them
>together.
>
>Conditional NACK
>
>LS
>_________
Please see updated patch set attached.
From 108b0f676b5b57df2559eaa106527ce005921eef Mon Sep 17 00:00:00
2001
From: Pavel Reichl <preichl(a)redhat.com>
Date: Mon, 10 Aug 2015 13:06:37 -0400
Subject: [PATCH 1/2] Remove trailing whitespace
---
README | 2 +-
po/ca.po | 2 +-
We should not manually edit translation
files.
Please and exception for these files.
src/conf_macros.m4 | 4 ++--
src/external/glib.m4 | 4 ++--
src/external/pkg.m4 | 6 +++---
src/man/sssd.conf.5.xml | 8 ++++----
src/sss_client/ssh/sss_ssh_client.c | 6 +++---
src/tests/pyhbac-test.py | 1 -
src/util/dlinklist.h | 8 ++++----
src/util/signal.c | 8 ++++----
10 files changed, 24 insertions(+), 25 deletions(-)
diff --git a/README b/README
index ed08970cee4652626067b628b3a17f3370a73e56..189f66fe5b20c85728ac2640d734e3b490e23817
100644
--- a/README
+++ b/README
@@ -9,7 +9,7 @@
an NSS and PAM interface toward the system and a pluggable backend system
to connect to multiple different account sources.
- More information about SSSD can be found on its project page -
+ More information about SSSD can be found on its project page -
<
http://fedorahosted.org/sssd/>
Building and installation
diff --git a/po/ca.po b/po/ca.po
index 9acddec2cd545f70cd63325d2a20912ca7684418..9d55fc5333bf5d151295ab7df0808ce77d1c27d4
100644
--- a/po/ca.po
+++ b/po/ca.po
@@ -1,7 +1,7 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR Red Hat, Inc.
# This file is distributed under the same license as the PACKAGE package.
-#
+#
# Translators:
# muzzol <muzzol(a)gmail.com>, 2012
# muzzol <muzzol(a)gmail.com>, 2012
diff --git a/src/conf_macros.m4 b/src/conf_macros.m4
index c6ce00059094aa0359f6af9efefe7c7438c1e28f..cd731e605b153f69931d3cb0764f10801a596f96
100644
--- a/src/conf_macros.m4
+++ b/src/conf_macros.m4
@@ -596,11 +596,11 @@ AC_DEFUN([WITH_UNICODE_LIB],
if test x"$with_unicode_lib" != x; then
unicode_lib=$with_unicode_lib
fi
-
+
if test x"$unicode_lib" != x"libunistring" -a
x"$unicode_lib" != x"glib2"; then
AC_MSG_ERROR([Unsupported unicode library])
fi
-
+
AM_CONDITIONAL([WITH_LIBUNISTRING], test x"$unicode_lib" =
x"libunistring")
AM_CONDITIONAL([WITH_GLIB], test x"$unicode_lib" = x"glib2")
])
diff --git a/src/external/glib.m4 b/src/external/glib.m4
index 8cec763263cd86d4ff1c45a7a3e2afe12954fe1c..3db25136b685bb6be05d1e9b648f032eaeaa1ec5
100644
--- a/src/external/glib.m4
+++ b/src/external/glib.m4
@@ -3,9 +3,9 @@ PKG_CHECK_MODULES([GLIB2],[glib-2.0])
if test x$has_glib2 != xno; then
SAFE_LIBS="$LIBS"
LIBS="$GLIB2_LIBS"
-
+
AC_CHECK_FUNC([g_utf8_validate],
AC_DEFINE([HAVE_G_UTF8_VALIDATE], [1],
[Define if g_utf8_validate exists]))
LIBS="$SAFE_LIBS"
-fi
\ No newline at end of file
+fi
diff --git a/src/external/pkg.m4 b/src/external/pkg.m4
index a8b3d06c8192229aab14cdc643a8be8f789376fd..568127f104de92fc81fa9b9ccf2fbd2d470840a1
100644
--- a/src/external/pkg.m4
+++ b/src/external/pkg.m4
@@ -1,5 +1,5 @@
# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*-
-#
+#
# Copyright © 2004 Scott James Remnant <scott(a)netsplit.com>.
#
# This program is free software; you can redistribute it and/or modify
@@ -38,7 +38,7 @@ if test -n "$PKG_CONFIG"; then
AC_MSG_RESULT([no])
PKG_CONFIG=""
fi
-
+
fi[]dnl
])# PKG_PROG_PKG_CONFIG
@@ -119,7 +119,7 @@ if test $pkg_failed = yes; then
_PKG_SHORT_ERRORS_SUPPORTED
if test $_pkg_short_errors_supported = yes; then
$1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors
"$2"`
- else
+ else
$1[]_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$2"`
fi
# Put the nasty error message in config.log where it belongs
diff --git a/src/man/sssd.conf.5.xml b/src/man/sssd.conf.5.xml
index 3f57862c61be662f4c06caa2022d3b49460ee7e1..b858347f8f51cfb512a740fa0f31027d7b7ecebd
100644
--- a/src/man/sssd.conf.5.xml
+++ b/src/man/sssd.conf.5.xml
@@ -1304,7 +1304,7 @@ pam_account_expired_message = Account expired, please call help
desk.
</para>
</listitem>
</varlistentry>
-
+
<varlistentry>
<term>entry_cache_user_timeout (integer)</term>
<listitem>
@@ -1317,7 +1317,7 @@ pam_account_expired_message = Account expired, please call help
desk.
</para>
</listitem>
</varlistentry>
-
+
<varlistentry>
<term>entry_cache_group_timeout (integer)</term>
<listitem>
@@ -1330,7 +1330,7 @@ pam_account_expired_message = Account expired, please call help
desk.
</para>
</listitem>
</varlistentry>
-
+
<varlistentry>
<term>entry_cache_netgroup_timeout (integer)</term>
<listitem>
@@ -1343,7 +1343,7 @@ pam_account_expired_message = Account expired, please call help
desk.
</para>
</listitem>
</varlistentry>
-
+
<varlistentry>
<term>entry_cache_service_timeout (integer)</term>
<listitem>
diff --git a/src/sss_client/ssh/sss_ssh_client.c b/src/sss_client/ssh/sss_ssh_client.c
index 245a0205685abfa553f6264942e97b3d556262bb..a24c5195da7a60d2fe2349e6826f2f70cfb9068a
100644
--- a/src/sss_client/ssh/sss_ssh_client.c
+++ b/src/sss_client/ssh/sss_ssh_client.c
@@ -69,7 +69,7 @@ int set_locale(void)
}
/* SSH public key request:
- *
+ *
* header:
* 0..3: flags (unsigned int, must be combination of SSS_SSH_REQ_* flags)
* 4..7: name length (unsigned int)
@@ -80,9 +80,9 @@ int set_locale(void)
* domain (ony included if flags & SSS_SSH_REQ_DOMAIN):
* 0..3: domain length (unsigned int, 0 means default domain)
* 4..X: domain (null-terminated UTF-8 string)
- *
+ *
* SSH public key reply:
- *
+ *
* header:
* 0..3: number of results (unsigned int)
* 4..7: reserved (unsigned int, must be 0)
diff --git a/src/tests/pyhbac-test.py b/src/tests/pyhbac-test.py
index 83958d7bffcccea375c79166ee7dfca6f9956cff..9d8fd1a333bf54ecf21d14d3b6293f7294a0d53e
100755
--- a/src/tests/pyhbac-test.py
+++ b/src/tests/pyhbac-test.py
@@ -137,7 +137,6 @@ class PyHbacRuleElementTest(unittest.TestCase):
el.names = ['foo']
el.groups = ['bar, baz']
self.assertEquals(el.__repr__(), u'<category 1 names [foo] groups [bar,
baz]>')
-
class PyHbacRuleTest(unittest.TestCase):
def testRuleGetSetName(self):
diff --git a/src/util/dlinklist.h b/src/util/dlinklist.h
index 413084888b8dbdb9faef4b0011d030766b8a2965..ef09661f4be4d6e973173887f7790f214bf0f1dd
100644
--- a/src/util/dlinklist.h
+++ b/src/util/dlinklist.h
@@ -1,18 +1,18 @@
-/*
+/*
Unix SMB/CIFS implementation.
some simple double linked list macros
Copyright (C) Andrew Tridgell 1998
-
+
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
-
+
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
-
+
You should have received a copy of the GNU General Public License
along with this program. If not, see <
http://www.gnu.org/licenses/>.
*/
diff --git a/src/util/signal.c b/src/util/signal.c
index bb8f8bef7681c0140671a3076a950a773f991b66..8acdccaeb11ee171050db3aec4095459d9574a2c
100644
--- a/src/util/signal.c
+++ b/src/util/signal.c
@@ -1,19 +1,19 @@
-/*
+/*
Unix SMB/CIFS implementation.
signal handling functions
Copyright (C) Andrew Tridgell 1998
-
+
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
-
+
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
-
+
You should have received a copy of the GNU General Public License
along with this program. If not, see <
http://www.gnu.org/licenses/>.
*/
--
2.4.3
From fed22f881311c3809bfc32b1aa45c04b4362f20a Mon Sep 17 00:00:00
2001
From: Pavel Reichl <preichl(a)redhat.com>
Date: Mon, 10 Aug 2015 13:05:37 -0400
Subject: [PATCH 2/2] TESTS: trailing whitespace test
---
Makefile.am | 8 +++++++-
src/tests/whitespace_test.sh | 11 +++++++++++
2 files changed, 18 insertions(+), 1 deletion(-)
create mode 100755 src/tests/whitespace_test.sh
Trivial test should be part of bug fix.
So we will not forget to backport it.
It make sense to have a test in separate patch for big features
which are tracked by upstream ticket.
diff --git a/Makefile.am b/Makefile.am
index 8b64317d6dce9a1ee8614916395b9afd9f11f382..b5af3e665d3bad32d01911ee1a50c348c1256a84
100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -264,6 +264,9 @@ if HAVE_CMOCKA
check_PROGRAMS += dummy-child
endif # HAVE_CMOCKA
+CODE_STYLE_TESTS = src/tests/whitespace_test.sh \
+ $(NULL)
+
PYTHON_TESTS =
if BUILD_PYTHON2_BINDINGS
@@ -283,7 +286,9 @@ TEST_EXTENSIONS = .sh
TESTS = \
$(PYTHON_TESTS) \
$(non_interactive_cmocka_based_tests) \
- $(non_interactive_check_based_tests)
+ $(non_interactive_check_based_tests) \
+ $(CODE_STYLE_TESTS) \
+ $(NULL)
sssdlib_LTLIBRARIES = \
libsss_ldap.la \
@@ -366,6 +371,7 @@ dist_noinst_SCRIPTS = \
src/tests/pysss_murmur-test.py2.sh \
src/tests/pysss_murmur-test.py3.sh \
src/tests/python-test.py \
+ src/tests/whitespace_test.sh \
src/tests/krb5_proxy_check_test_data.conf \
$(NULL)
diff --git a/src/tests/whitespace_test.sh b/src/tests/whitespace_test.sh
new file mode 100755
index 0000000000000000000000000000000000000000..33e695b470e40a0b93f7320a2f4a77503e0b78e8
--- /dev/null
+++ b/src/tests/whitespace_test.sh
@@ -0,0 +1,11 @@
+#!/bin/sh
+
+N=$(git grep -n -I -P '^.*[ ]+$' -- $(git rev-parse --show-toplevel) | wc -l)
+
+if [ "$N" -ne 0 ]; then
+ echo "Trailing whitespace found:"
+ git grep -n -I -P '^.*[ ]+$' -- $(git rev-parse --show-toplevel)
+ exit 1
+fi
+
+exit 0
Please ask Nikolai for review of bash script.
LS