From 14f7021f3ed831f7f07e86338ed2e3ad46417088 Mon Sep 17 00:00:00 2001 From: Christoph Groth <christoph.groth@cea.fr> Date: Sat, 3 Dec 2016 00:00:29 +0100 Subject: [PATCH] CI: check for other whitespace blunders as well --- .gitlab-ci.yml | 4 ++-- doc/source/pre/whatsnew/1.3.rst | 2 +- kwant/physics/tests/test_leads.py | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 8ce3bbbc..819e7b00 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -33,10 +33,10 @@ build package: untracked: true expire_in: 1 hour -check for whitespace: +check whitespace style: stage: build script: - - "! for f in `git ls-files | grep -v \\.diff$`; do file $f | grep -q ' text' && grep -l '[[:blank:]]$' $f; done | grep . >&2" + - "! for f in `git ls-files | grep -v \\.diff$`; do file $f | grep -q ' text' || continue; grep -q '[[:blank:]]$' $f && echo $f: trailing whitespace; tail -n1 $f | read -r _ || echo $f: no newline at end of file; tail -n1 $f | grep -q '^$' && echo $f: empty line at end of file; done | grep . >&2" allow_failure: true check for dependencies installed: diff --git a/doc/source/pre/whatsnew/1.3.rst b/doc/source/pre/whatsnew/1.3.rst index 2a343550..4607fbbf 100644 --- a/doc/source/pre/whatsnew/1.3.rst +++ b/doc/source/pre/whatsnew/1.3.rst @@ -61,4 +61,4 @@ namely time-reversal symmetry, particle-hole symmetry and chiral (or sublattice) symmetry. When one or more of these symmetries are present, and it can be useful to have leads with scattering states that reflect this. It is now possible to these discrete symmetries in Kwant, which then uses -them to construct scattering states that are accordingly symmetric. \ No newline at end of file +them to construct scattering states that are accordingly symmetric. diff --git a/kwant/physics/tests/test_leads.py b/kwant/physics/tests/test_leads.py index d8527959..b2a4c7cb 100644 --- a/kwant/physics/tests/test_leads.py +++ b/kwant/physics/tests/test_leads.py @@ -604,4 +604,4 @@ def test_PHS_TRIM(): assert_almost_equal(phs_modes[:, 1::2], p_mat.dot(phs_modes[:, ::2].conj()), err_msg='PHS broken at a TRIM in ' + sym) assert_almost_equal(phs_modes.T.conj().dot(phs_modes), np.eye(phs_modes.shape[1]), - err_msg='Modes are not orthonormal, TRIM PHS in ' + sym) \ No newline at end of file + err_msg='Modes are not orthonormal, TRIM PHS in ' + sym) -- GitLab