[PATCH] [Kimchi 0/2] Makefile changes - whitespace check and others

From: Daniel Henrique Barboza <dhbarboza82@gmail.com> This patch set implements enhancements in the Makefile.am, such as whitespace check and allowing ChangeLog to run in a submodule checkout of Kimchi. Daniel Henrique Barboza (2): Makefile.am targets enhancements Whitespace fixes in existing code Makefile.am | 24 ++++++++++++++++++------ configure.ac | 3 ++- kimchi.conf | 1 - ui/css/src/modules/_network.scss | 12 ++++++------ ui/js/src/kimchi.network_add_main.js | 4 ++-- ui/pages/guest-edit.html.tmpl | 2 +- 6 files changed, 29 insertions(+), 17 deletions(-) -- 2.5.0

From: Daniel Henrique Barboza <dhbarboza82@gmail.com> - check-local: Added '.git' dir check in pyflakes to avoid an error/warning when running check-local in a git submodule tree. Added whitespace check too. - ChangeLog and VERSION: these targets will now run properly when running in a git submodule tree. Signed-off-by: Daniel Henrique Barboza <dhbarboza82@gmail.com> --- Makefile.am | 24 ++++++++++++++++++------ configure.ac | 3 ++- 2 files changed, 20 insertions(+), 7 deletions(-) diff --git a/Makefile.am b/Makefile.am index da3a660..8ee88f3 100644 --- a/Makefile.am +++ b/Makefile.am @@ -59,13 +59,25 @@ I18N_FILES = ./i18n.py \ check-local: contrib/check_i18n.py $(I18N_FILES) - find . -path './.git' -prune -type f -o \ - -name '*.py' -o -name '*.py.in' | xargs $(PYFLAKES) | \ - while read LINE; do echo "$$LINE"; false; done - + @if [ -d '.git' ]; then \ + find . -path './.git' -prune -o \ + -name '*.py' -o -name '*.py.in' | \ + xargs $(PYFLAKES) | \ + while read LINE; do echo "$$LINE"; false; done \ + else \ + find . -name '*.py' -o -name '*.py.in' | \ + xargs $(PYFLAKES) | \ + while read LINE; do echo "$$LINE"; false; done \ + fi $(PEP8) --version $(PEP8) --filename '*.py,*.py.in' --exclude="$(PEP8_BLACKLIST)" . ./check_ui_code_errors.sh + @if $(GIT) rev-parse &> /dev/null ; then \ + echo "Whitespace verification ..."; \ + git grep --cached -Il '' | grep -v '^ui/spice-html5/' | \ + xargs egrep '.* +$$' \ + && echo "ERROR: Whitespaces found" || echo "Ok"; \ + fi # Link built mo files in the source tree to enable use of translations from # within the source tree @@ -132,7 +144,7 @@ suse-rpm: contrib/kimchi.spec.suse $(MAKE) rpm ChangeLog: - @if test -d .git; then \ + @if $(GIT) rev-parse &> /dev/null ; then \ $(top_srcdir)/build-aux/genChangelog --release > $@; \ fi @@ -160,7 +172,7 @@ uninstall-local: $(RM) -rf $(DESTDIR)/$(localstatedir)/lib/kimchi VERSION: - @if test -d .git; then \ + @if $(GIT) rev-parse &> /dev/null ; then \ git describe --abbrev=0 --always > $@; \ fi diff --git a/configure.ac b/configure.ac index 3d698bb..57737a9 100644 --- a/configure.ac +++ b/configure.ac @@ -1,7 +1,7 @@ # # Kimchi # -# Copyright IBM Corp, 2013-2015 +# Copyright IBM Corp, 2013-2016 # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public @@ -35,6 +35,7 @@ AC_CONFIG_AUX_DIR([build-aux]) AM_INIT_AUTOMAKE([-Wno-portability]) AM_PATH_PYTHON([2.6]) AC_PATH_PROG([PEP8], [pep8], [/usr/bin/pep8]) +AC_PATH_PROG([GIT], [git], [/usr/bin/git]) AC_PYTHON_MODULE([unittest]) AC_SUBST([HAVE_PYMOD_UNITTEST]) AC_SUBST([PYTHON_VERSION]) -- 2.5.0

From: Daniel Henrique Barboza <dhbarboza82@gmail.com> Fixes to allow make check-local to pass after adding the whitespace verification. Signed-off-by: Daniel Henrique Barboza <dhbarboza82@gmail.com> --- kimchi.conf | 1 - ui/css/src/modules/_network.scss | 12 ++++++------ ui/js/src/kimchi.network_add_main.js | 4 ++-- ui/pages/guest-edit.html.tmpl | 2 +- 4 files changed, 9 insertions(+), 10 deletions(-) diff --git a/kimchi.conf b/kimchi.conf index 0ea916a..108ef9c 100644 --- a/kimchi.conf +++ b/kimchi.conf @@ -35,4 +35,3 @@ tools.nocache.on = False tools.staticdir.on = True tools.staticdir.dir = wok.config.PluginPaths('kimchi').ui_dir + '/pages/help' tools.nocache.on = True - diff --git a/ui/css/src/modules/_network.scss b/ui/css/src/modules/_network.scss index 52b2003..2da5213 100644 --- a/ui/css/src/modules/_network.scss +++ b/ui/css/src/modules/_network.scss @@ -1,7 +1,7 @@ // // Project Kimchi // -// Copyright IBM, Corp. 2015 +// Copyright IBM, Corp. 2015-2016 // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -41,7 +41,7 @@ #network-root-container { .wok-nw-loading-icon { - background: transparent url('#{$wok-icon-path}/spin5.svg') no-repeat 50% 50%; + background: transparent url('#{$wok-icon-path}/spin5.svg') no-repeat 50% 50%; @include animation(spin 3s infinite linear); height: 16px; width: 16px; @@ -73,7 +73,7 @@ .loading > .fa, .down .fa { display: none; - } + } } .wok-datagrid > .wok-datagrid-header, @@ -105,15 +105,15 @@ text-align: right; } - } + } .wok-datagrid > .wok-datagrid-body > .wok-datagrid-row > span { &.column-state { height: 53px; - vertical-align: middle; + vertical-align: middle; } - } + } } diff --git a/ui/js/src/kimchi.network_add_main.js b/ui/js/src/kimchi.network_add_main.js index 0087407..76d436f 100644 --- a/ui/js/src/kimchi.network_add_main.js +++ b/ui/js/src/kimchi.network_add_main.js @@ -1,7 +1,7 @@ /* * Project Kimchi * - * Copyright IBM, Corp. 2013-2015 + * Copyright IBM, Corp. 2013-2016 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -154,7 +154,7 @@ kimchi.setupNetworkFormEvent = function() { } else if (selectedType == 'macvtap') { kimchi.enableBridgeOptions(true); } - }); + }); }; kimchi.updateNetworkFormButton = function() { diff --git a/ui/pages/guest-edit.html.tmpl b/ui/pages/guest-edit.html.tmpl index 0c2994d..0ad635c 100644 --- a/ui/pages/guest-edit.html.tmpl +++ b/ui/pages/guest-edit.html.tmpl @@ -207,7 +207,7 @@ </span> <span class="cell column-mac"> <span id="label-mac-{id}" class="{viewMode}">{mac}</span> - <input class="form-control {editMode}" type="text" + <input class="form-control {editMode}" type="text" id="edit-mac-{id}" class="form-control" name="{mac}" value="{mac}" /> </span> <span class="cell column-ip"> -- 2.5.0

Reviewed-by: Paulo Vital <pvital@linux.vnet.ibm.com> On 01/27/2016 04:50 PM, dhbarboza82@gmail.com wrote:
From: Daniel Henrique Barboza <dhbarboza82@gmail.com>
This patch set implements enhancements in the Makefile.am, such as whitespace check and allowing ChangeLog to run in a submodule checkout of Kimchi.
Daniel Henrique Barboza (2): Makefile.am targets enhancements Whitespace fixes in existing code
Makefile.am | 24 ++++++++++++++++++------ configure.ac | 3 ++- kimchi.conf | 1 - ui/css/src/modules/_network.scss | 12 ++++++------ ui/js/src/kimchi.network_add_main.js | 4 ++-- ui/pages/guest-edit.html.tmpl | 2 +- 6 files changed, 29 insertions(+), 17 deletions(-)
participants (3)
-
Aline Manera
-
dhbarboza82@gmail.com
-
Paulo Vital