From 8a69ae9f544ffa4b7b2c6b11fdeefd55e424eed4 Mon Sep 17 00:00:00 2001 From: Roberto Di Remigio Date: Fri, 18 Aug 2017 19:30:58 +0200 Subject: [PATCH 1/5] Use 4 points in splineInterpolation We also check if we are either end of the sorted array of input parameters, so that we don't fall off of it when interpolating. --- src/utils/MathUtils.hpp | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/src/utils/MathUtils.hpp b/src/utils/MathUtils.hpp index bf157e505..d646f42ae 100644 --- a/src/utils/MathUtils.hpp +++ b/src/utils/MathUtils.hpp @@ -292,14 +292,26 @@ inline double splineInterpolation(const double point, const std::vector & grid, const std::vector & function) { // Find nearest points on grid to the arbitrary point given - size_t index = std::distance(grid.begin(), - std::lower_bound(grid.begin(), grid.end(), point)) - - 1; + int index = + std::distance(grid.begin(), std::lower_bound(grid.begin(), grid.end(), point)); + + int imax = grid.size() - 1; + if (index <= 0) + index = 1; + if (index >= imax - 1) + index = imax - 2; // Parameters for the interpolating spline - Eigen::Vector3d x, y; - x << grid[index - 1], grid[index], grid[index + 1]; - y << function[index - 1], function[index], function[index + 1]; + Eigen::Vector4d x = (Eigen::Vector4d() << grid[index - 1], + grid[index], + grid[index + 1], + grid[index + 2]) + .finished(); + Eigen::Vector4d y = (Eigen::Vector4d() << function[index - 1], + function[index], + function[index + 1], + function[index + 2]) + .finished(); SplineFunction s(x, y); return s(point); From 67ce90209e945b6f927ab1db5b3a1b17d3abea66 Mon Sep 17 00:00:00 2001 From: Roberto Di Remigio Date: Fri, 18 Aug 2017 19:32:11 +0200 Subject: [PATCH 2/5] Use Runge-Kutta-Fehlberg 7(8) integrator Runge-Kutta-Fehlberg 7(8) replaces the Bulirsch-Stoer integrator. RKF78 is non-adaptive and is cheaper than BS. It is possible to use more spherical harmonics in the expansion of the Green's function radial part. --- CHANGELOG.md | 2 ++ src/green/InterfacesImpl.hpp | 12 +++++----- src/green/SphericalDiffuse.cpp | 6 ++--- .../bi_operators/bi_operators_collocation.cpp | 6 ++--- .../tanhsphericaldiffuse_D_collocation.npy | Bin 8272 -> 8272 bytes .../tanhsphericaldiffuse_S_collocation.npy | Bin 8272 -> 8272 bytes tests/green/green_spherical_diffuse.cpp | 22 +++++++++--------- tests/iefpcm/iefpcm_diffuse-gepol-point.cpp | 14 +++++++---- 8 files changed, 34 insertions(+), 28 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 372201d46..94719b0d4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,6 +20,8 @@ - The uppercased contents of the `.pcm` input file are written to a temporary file, instead of overwriting the user provided file. The temporary file is removed after it has been parsed. Fixes #91 as noted by @ilfreddy. +- Use Runge-Kutta-Fehlberg 7(8) ODE solver to integrate the radial equation + in the spherical diffuse Green's function class. ## [Version 1.1.10] - 2017-03-27 diff --git a/src/green/InterfacesImpl.hpp b/src/green/InterfacesImpl.hpp index 233fbc434..b07c22eb1 100644 --- a/src/green/InterfacesImpl.hpp +++ b/src/green/InterfacesImpl.hpp @@ -225,15 +225,15 @@ template class Zeta __final { */ void compute(const ProfileEvaluator & eval, const IntegratorParameters & parms) { namespace odeint = boost::numeric::odeint; - odeint::bulirsch_stoer_dense_out stepper( - parms.eps_abs_, parms.eps_rel_, parms.factor_x_, parms.factor_dxdt_); + odeint::runge_kutta_fehlberg78 stepper; + ODESystem system(eval, L_); // Holds the initial conditions StateVariable init_zeta(2); // Set initial conditions init_zeta[0] = L_ * std::log(r_0_); init_zeta[1] = L_ / r_0_; - odeint::integrate_adaptive( + odeint::integrate_const( stepper, system, init_zeta, @@ -329,8 +329,8 @@ template class Omega __final { */ void compute(const ProfileEvaluator & eval, const IntegratorParameters & parms) { namespace odeint = boost::numeric::odeint; - odeint::bulirsch_stoer_dense_out stepper( - parms.eps_abs_, parms.eps_rel_, parms.factor_x_, parms.factor_dxdt_); + odeint::runge_kutta_fehlberg78 stepper; + ODESystem system(eval, L_); // Holds the initial conditions StateVariable init_omega(2); @@ -338,7 +338,7 @@ template class Omega __final { init_omega[0] = -(L_ + 1) * std::log(r_infinity_); init_omega[1] = -(L_ + 1) / r_infinity_; // Notice that we integrate BACKWARDS, so we pass -step to integrate_adaptive - boost::numeric::odeint::integrate_adaptive( + odeint::integrate_const( stepper, system, init_omega, diff --git a/src/green/SphericalDiffuse.cpp b/src/green/SphericalDiffuse.cpp index c8ba76694..c65c781b4 100644 --- a/src/green/SphericalDiffuse.cpp +++ b/src/green/SphericalDiffuse.cpp @@ -39,9 +39,9 @@ #include "GreenData.hpp" #include "GreensFunction.hpp" #include "cavity/Element.hpp" -#include "utils/MathUtils.hpp" #include "dielectric_profile/ProfileTypes.hpp" #include "utils/ForId.hpp" +#include "utils/MathUtils.hpp" namespace pcm { namespace green { @@ -272,10 +272,10 @@ void SphericalDiffuse::initSphericalDiffuse() { double eps_rel_ = 1.0e-06; /*! Relative tolerance level */ double factor_x_ = 0.0; /*! Weight of the state */ double factor_dxdt_ = 0.0; /*! Weight of the state derivative */ - double r_0_ = 0.5; /*! Lower bound of the integration interval */ + double r_0_ = 0.1; /*! Lower bound of the integration interval */ double r_infinity_ = this->profile_.center() + 200.0; /*! Upper bound of the integration interval */ - double observer_step_ = 1.0e-03; /*! Time step between observer calls */ + double observer_step_ = 1.0e-02; /*! Time step between observer calls */ IntegratorParameters params_(eps_abs_, eps_rel_, factor_x_, diff --git a/tests/bi_operators/bi_operators_collocation.cpp b/tests/bi_operators/bi_operators_collocation.cpp index 636c2b3b6..d905efd90 100644 --- a/tests/bi_operators/bi_operators_collocation.cpp +++ b/tests/bi_operators/bi_operators_collocation.cpp @@ -24,17 +24,17 @@ #include "catch.hpp" #include -#include #include +#include #include #include +#include "TestingMolecules.hpp" +#include "bi_operators/Collocation.hpp" #include "cavity/Element.hpp" #include "cavity/GePolCavity.hpp" -#include "bi_operators/Collocation.hpp" #include "green/SphericalDiffuse.hpp" -#include "TestingMolecules.hpp" #include "green/UniformDielectric.hpp" #include "green/Vacuum.hpp" #include "utils/MathUtils.hpp" diff --git a/tests/bi_operators/tanhsphericaldiffuse_D_collocation.npy b/tests/bi_operators/tanhsphericaldiffuse_D_collocation.npy index 99ee729f6ac1284ec1d9c251b97be787463a06a1..2995dabc2a26bd05b04659110bea1c002341cbbc 100644 GIT binary patch literal 8272 zcmc)PO^B6s7zOajP2;$b2y_-1ccEOh5p|};q%OoDFvx6dN(b=+XG92^;g03Nkeav* z6r+Nug-+>|7+TEMcUG=igo_XoQbd?mxl^$qz4!k9iz6{h+dRA<&w0-|&vX8I?elGe zZ*AZ8T*n(7ll9?|@dJ(ehFX2o!Tx$rt$uK{ak#Pn!@Z-8;gKiz-)(#}^7!`nq5Wec zk1tpD_4d^IdRO(-KB@Vy>#vu#?OyTn&8q+8-4AvT|59rAtN-3uy>_;mdw=rG^LNfw z{nKlQW{&?*>b{AG1DglVSGPXhdH>kp)pGxG&mYy#?_I7Y7I$9y_}44d_N6mNj&`1_ zYHPl!jqdrb+Wgw0^QTW-s8;S+zj48}snV~{cd}pK*u55x{@*6wnOZnLQ*ga^gm_t+;j8qvqf+EKtDco;)$Q<=@WnG<^z8C!-EeG zzV}lneV)Tlf9OshQos50VeI-p&H3Y#Jn?hidvtg{_jPODDjoRiQ~7vk$Ajj6(L?8h ziPk>x&wcOZbNbckp+(Jon7h5TIse%&T6>R@ zk~8-%Rj%{B^8DMr=AL)A>+G@vt-buQ^Vr2#zAycWll}VObhP{Pem*zntUJGI<$~Y* zSM9HTupg>?*gJb}9_C{o;My1ap0I5&ROLfAGj)f^Wd*NFdutk&-rP; z?SuVL<-@$-tM=c%z*X%}?zK77i$C7*lRsR0fWP;XCw_GE0Z!>}|Gg=FpdWtn#19_) zkLt8nz2x5@|S16Oe6ru>#b0wQ`!Ub&1N&e< zRQbrgHfMV68(ymY!{2@LPX2h)fj`}equ=}X%C+;sHJ^M3KE3G!{q&{}^wWi3>hnB( z;txLf;ftSKt8lVk9~}Me=Xc8U_+7~d=L7v}=9@mcGr#V8FQ4P5nxpeU-c&h}k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u{DHUcp8E0U zi`3b_KZq}J;qMYpzt|7>!t}Siz4inC=8Mke3x7xl{N;!GnEk^e^V5khocV*lAfNG9 z`r4VlGjHaXPktzW?geN2K|bhxS%1DqetPjGq+gT2>8XEo)<6E#AM>W(5^uiJpAG+i zU>?i|v>$Tr)#u+g)x|$$PV3(XIoHnojd$`W{2P8hs3+@8f2yz4Ti1tg>cAiTRq9K9 z>-q}s@ISsV{axzUzt|7@UFwef^pi)Osh@cBYCiFYbV&Z*lll3@JVO5A=S2SISIB4l zC11Wr{)}_Z_{<~TK1j45)FUsHzscY9wih7%SM2Y4?)16zx53}~B~Bm3r*AyR-{!%5 zK>H!*+L^!29sd=d)c$jyPR{gEZ}Lz-f56rS_fsXXUKXrB=e@F-X)7Q@Yoxa73|D5wV_xTO-Bmaqq@?^X?dBo@S Lyq|l)*?#yNc;TyA diff --git a/tests/bi_operators/tanhsphericaldiffuse_S_collocation.npy b/tests/bi_operators/tanhsphericaldiffuse_S_collocation.npy index ddb27c3c397fe3bb41fc4f8a642daa138dde04b6..a900a46747844d5a280159a469c939156cc8d814 100644 GIT binary patch literal 8272 zcmZA1ONh;39LDi6ks@IwO>xxJ8JQKONv8j9Qe$L6E}My&GneFc#^jc3nPOpqqFiF5 zG?HSWq=bbe(UeO~cFHVWig6z`pR;&o^EChW|32^YeSYu%oL#fNW9_CXb!~MA%iWcM zu4;Kjsl2kMrQBR9_w20hsczZPxwG0``Tu-fb+9t=c%W~~uFAx}P0N-xmzFJE+*~?T z@;Bq_(A=?E7q1i>4mR$;(lA)lc@M4+KfZjdIQ)0+?6;@8i&qD}G;V#gt)_jyOZ!IK z`-(X??|sp;0}p*TGCJ1T zzN>c6^F8ZwP~3Zt^nO}Cv$wXNFCY8O(LO%*d+xnlH)o1l5Bk5B&MaLw$cZQ~f^h zp}2jY{PGCc?`xDW0J)t7nkr}}VT%!$g4 z!+a@T`Q_%H`T63|hxaq5eBReX^5e}O@bk}{^2x>DdGg`S9`NJl@4WQSp7m?Le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;aK9Psn4nq$t7fBNQ!(|OOnFFu^d?fbFkcvb%& zQaAPKxksgM&+)4Efu8EV^zR-V^yMLcIq_j$@-;{I$=iFC5Bp$0RJq|WUlq4~vnMJZ z{`tm{{`uyQf9F$2PR=JMKJVq^9{PAQ2YZ4yb1-MT{PBwqx12o7hadj<<sifZy-@d!O^;(;Ur@j`O&EA2^)%?EA{!^SwRCtNQ<7&+)4E zfge6q{yaN}!+U;Ie)%^~^OKYF@|3T<-D_X$smc!y^Hp)%2m7JQ&Aj+haq#bV9O<8L z9Q-?SLtNGK05mG=RL`v zIV6APko>sifZy-@=X<_Yb2L9XDsJBg4(Db*V3tJ(*9j#u^nfgk=<{ygV7 z@A=`IU;fNfKIW)To|&_IahR`)Ti*6W<-@+2pNc2H3wt6r{`tm{{^{c2-+4Yg^XI%A z=;+6rIhZrv^vNGR`tGBTH*>Hjxasq6-t;qP`Rdn4C;L-JKYmpX$?qQe$&XtO$)7pk z=UX+$oFD(G&xiB4eIIXIf!Jg3Pk6-@q=RL`vIpC+S;z<8|L@_u!_VeV(&lA07Sn9IxvC13z?C`Z&y2#Vv1pqVi#$=3|d= z%Uk~D%!ht`bh2L`9sTyrdlk2Rupg@2@MaF?j5mGq$FH0`%ZFb%@W(%H`ufe=`Q*gs zJ$?7l$D29W6a1(m$U#_}8b(G4s=p6QAF4=X?CB9Prz7ys8}dz^nTH gJUfTmdp=d%zCZo?=w!b>I{NeXd~eV3s{TLx1B{`+d;kCd diff --git a/tests/green/green_spherical_diffuse.cpp b/tests/green/green_spherical_diffuse.cpp index ba55ea854..81480a5b2 100644 --- a/tests/green/green_spherical_diffuse.cpp +++ b/tests/green/green_spherical_diffuse.cpp @@ -43,7 +43,7 @@ using dielectric_profile::OneLayerTanh; SCENARIO("Evaluation of the spherical diffuse Green's function and its derivatives", "[green][green_spherical_diffuse]") { GIVEN("A permittivity profile modelled by the hyperbolic tangent function") { - int maxL = 3; + int maxL = 10; // High dielectric constant inside double eps1 = 80.0; // Low dielectric constant outside @@ -79,7 +79,7 @@ SCENARIO("Evaluation of the spherical diffuse Green's function and its derivativ REQUIRE(value == Approx(gf_value)); } AND_THEN("the value of the Green's function outside the droplet is") { - double value = 0.50004567416494572; + double value = 0.49987476890456245; double gf_value = gf.kernelS(source2, probe2); INFO("ref_value = " << std::setprecision( std::numeric_limits::digits10) @@ -103,7 +103,7 @@ SCENARIO("Evaluation of the spherical diffuse Green's function and its derivativ } AND_THEN("the value of the Green's function directional derivative wrt the " "probe point outside the droplet is") { - double derProbe = -0.29005549287308696; + double derProbe = -0.289952813654903441; double gf_derProbe = gf.derivativeProbe(probeNormal2, source2, probe2); INFO("ref_derProbe = " << std::setprecision(std::numeric_limits::digits10) @@ -127,7 +127,7 @@ SCENARIO("Evaluation of the spherical diffuse Green's function and its derivativ } AND_THEN("the value of the Green's function directional derivative wrt the " "source point outside the droplet is") { - double derSource = 0.28879776627577236; + double derSource = 0.288676184370117994; double gf_derSource = gf.derivativeSource(sourceNormal2, source2, probe2); INFO("ref_derSource = " << std::setprecision(std::numeric_limits::digits10) @@ -155,7 +155,7 @@ SCENARIO("Evaluation of the spherical diffuse Green's function and its derivativ REQUIRE(value == Approx(gf_value)); } AND_THEN("the value of the Green's function outside the droplet is") { - double value = 0.5000329900631173; + double value = 0.499902162204405809; double gf_value = gf.kernelS(source2, probe2); INFO("ref_value = " << std::setprecision( std::numeric_limits::digits10) @@ -179,7 +179,7 @@ SCENARIO("Evaluation of the spherical diffuse Green's function and its derivativ } AND_THEN("the value of the Green's function directional derivative wrt the " "probe point outside the droplet is") { - double derProbe = -0.289999709125188243; + double derProbe = -0.289953098676354326; double gf_derProbe = gf.derivativeProbe(probeNormal2, source2, probe2); INFO("ref_derProbe = " << std::setprecision(std::numeric_limits::digits10) @@ -203,7 +203,7 @@ SCENARIO("Evaluation of the spherical diffuse Green's function and its derivativ } AND_THEN("the value of the Green's function directional derivative wrt the " "source point outside the droplet is") { - double derSource = 0.288657584958107449; + double derSource = 0.288675899050294671; double gf_derSource = gf.derivativeSource(sourceNormal2, source2, probe2); INFO("ref_derSource = " << std::setprecision(std::numeric_limits::digits10) @@ -254,7 +254,7 @@ SCENARIO("Evaluation of the spherical diffuse Green's function and its derivativ REQUIRE(value == Approx(gf_value)); } AND_THEN("the value of the Green's function outside the droplet is") { - double value = 0.49991229576650942; + double value = 0.499874677668854961; double gf_value = gf.kernelS(source2, probe2); INFO("ref_value = " << std::setprecision( std::numeric_limits::digits10) @@ -278,7 +278,7 @@ SCENARIO("Evaluation of the spherical diffuse Green's function and its derivativ } AND_THEN("the value of the Green's function directional derivative wrt the " "probe point outside the droplet is") { - double derProbe = -0.28997553534915177; + double derProbe = -0.289951551978862021; double gf_derProbe = gf.derivativeProbe(probeNormal2, source2, probe2); INFO("ref_derProbe = " << std::setprecision(std::numeric_limits::digits10) @@ -302,7 +302,7 @@ SCENARIO("Evaluation of the spherical diffuse Green's function and its derivativ } AND_THEN("the value of the Green's function directional derivative wrt the " "source point outside the droplet is") { - double derSource = 0.28871292628573908; + double derSource = 0.288674990983894819; double gf_derSource = gf.derivativeSource(sourceNormal2, source2, probe2); INFO("ref_derSource = " << std::setprecision(std::numeric_limits::digits10) @@ -379,7 +379,7 @@ SCENARIO("Evaluation of the spherical diffuse Green's function and its derivativ } AND_THEN("the value of the Green's function directional derivative wrt the " "source point outside the droplet is") { - double derSource = 0.28869402146192158; + double derSource = 0.288675321960529807; double gf_derSource = gf.derivativeSource(sourceNormal2, source2, probe2); INFO("ref_derSource = " << std::setprecision(std::numeric_limits::digits10) diff --git a/tests/iefpcm/iefpcm_diffuse-gepol-point.cpp b/tests/iefpcm/iefpcm_diffuse-gepol-point.cpp index e782ce728..81b791bbc 100644 --- a/tests/iefpcm/iefpcm_diffuse-gepol-point.cpp +++ b/tests/iefpcm/iefpcm_diffuse-gepol-point.cpp @@ -28,12 +28,13 @@ #include #include "bi_operators/Collocation.hpp" -#include "green/DerivativeTypes.hpp" #include "cavity/GePolCavity.hpp" -#include "utils/Molecule.hpp" +#include "green/DerivativeTypes.hpp" +#include "green/SphericalDiffuse.hpp" #include "green/Vacuum.hpp" #include "solver/IEFSolver.hpp" -#include "green/SphericalDiffuse.hpp" +#include "utils/Molecule.hpp" + #include "TestingMolecules.hpp" using namespace pcm; @@ -74,7 +75,9 @@ SCENARIO("Test solver for the IEFPCM for a point charge in a spherical diffuse " double minRadius = 100.0; GePolCavity cavity(point, area, probeRadius, minRadius); - SphericalDiffuse<> gf_o(eps1, eps2, width, center, Eigen::Vector3d::Zero(), 3); + int maxL = 5; + SphericalDiffuse<> gf_o( + eps1, eps2, width, center, Eigen::Vector3d::Zero(), maxL); IEFSolver solver(symm); solver.buildSystemMatrix(cavity, gf_i, gf_o, op); int size = cavity.size(); @@ -105,7 +108,8 @@ SCENARIO("Test solver for the IEFPCM for a point charge in a spherical diffuse " double minRadius = 100.0; GePolCavity cavity(point, area, probeRadius, minRadius); - SphericalDiffuse<> gf_o(eps1, eps2, width, center, origin, 3); + int maxL = 5; + SphericalDiffuse<> gf_o(eps1, eps2, width, center, origin, maxL); IEFSolver solver(symm); solver.buildSystemMatrix(cavity, gf_i, gf_o, op); From 191ef676903066d8ad75fabfaf3b3730b757aed4 Mon Sep 17 00:00:00 2001 From: Roberto Di Remigio Date: Sat, 26 Aug 2017 13:52:52 +0200 Subject: [PATCH 3/5] Force use of clang-format-3.9 on Travis --- .travis.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.travis.yml b/.travis.yml index cf54e03d1..ed4b11da3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -141,6 +141,9 @@ before_script: script: - | if [[ "${RUN_DANGER}" = true ]]; then + `type -P clang-format` --version + `type -P clang-format-3.9` --version + alias clang-format=`type -P clang-format-3.9` bundle exec danger fi - python setup.py --cxx=${CXX_COMPILER} --cc=${C_COMPILER} --fc=${Fortran_COMPILER} --type=${BUILD_TYPE} --cmake-options='-Hprojects/CMake' ${STATIC} ${COVERAGE} From 04a47bfd10a2a44764bfe0dea9b7ba5b10d1bbde Mon Sep 17 00:00:00 2001 From: Roberto Di Remigio Date: Sat, 26 Aug 2017 13:59:29 +0200 Subject: [PATCH 4/5] Troubleshoot clang-format version issue --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index ed4b11da3..77390c547 100644 --- a/.travis.yml +++ b/.travis.yml @@ -144,6 +144,7 @@ script: `type -P clang-format` --version `type -P clang-format-3.9` --version alias clang-format=`type -P clang-format-3.9` + clang-format --version bundle exec danger fi - python setup.py --cxx=${CXX_COMPILER} --cc=${C_COMPILER} --fc=${Fortran_COMPILER} --type=${BUILD_TYPE} --cmake-options='-Hprojects/CMake' ${STATIC} ${COVERAGE} From f97627335a3a5d87a77b09bfc1c0d48bf9531539 Mon Sep 17 00:00:00 2001 From: Roberto Di Remigio Date: Sat, 26 Aug 2017 14:14:26 +0200 Subject: [PATCH 5/5] Update gems for Danger --- .travis.yml | 4 ---- Dangerfile | 4 +++- Gemfile | 2 +- Gemfile.lock | 7 ++++--- 4 files changed, 8 insertions(+), 9 deletions(-) diff --git a/.travis.yml b/.travis.yml index 77390c547..cf54e03d1 100644 --- a/.travis.yml +++ b/.travis.yml @@ -141,10 +141,6 @@ before_script: script: - | if [[ "${RUN_DANGER}" = true ]]; then - `type -P clang-format` --version - `type -P clang-format-3.9` --version - alias clang-format=`type -P clang-format-3.9` - clang-format --version bundle exec danger fi - python setup.py --cxx=${CXX_COMPILER} --cc=${C_COMPILER} --fc=${Fortran_COMPILER} --type=${BUILD_TYPE} --cmake-options='-Hprojects/CMake' ${STATIC} ${COVERAGE} diff --git a/Dangerfile b/Dangerfile index 47abf1709..4b7c51cf7 100644 --- a/Dangerfile +++ b/Dangerfile @@ -20,7 +20,9 @@ end commit_lint.check disable: [:subject_cap, :subject_period] # Check code style with clang-format -code_style_validation.check file_extensions: ['.hpp', '.cpp', '.h'], ignore_file_patterns: [/^external\//] +code_style_validation.check validator: 'clang-format-3.9', + file_extensions: ['.hpp', '.cpp', '.h'], + ignore_file_patterns: [/^external\//] # ------------------------------------------------------------------------------ # What changed? diff --git a/Gemfile b/Gemfile index 5a2c20523..4a89badb8 100644 --- a/Gemfile +++ b/Gemfile @@ -4,4 +4,4 @@ source "https://rubygems.org" gem "danger" gem "danger-commit_lint" gem "danger-lgtm" -gem 'danger-code_style_validation', '0.1.0' , :git => 'https://github.com/flix-tech/danger-code_style_validation.git' +gem 'danger-code_style_validation', :git => 'https://github.com/robertodr/danger-code_style_validation.git', :branch => 'pass-exe' diff --git a/Gemfile.lock b/Gemfile.lock index 53654267c..98a4d2107 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,6 +1,7 @@ GIT - remote: https://github.com/flix-tech/danger-code_style_validation.git - revision: 05925775fa1ba9cd3eda09437c8c7efba31ef59e + remote: https://github.com/robertodr/danger-code_style_validation.git + revision: 49cb68348ff8e5440cdeb3512f85a2c602a9db83 + branch: pass-exe specs: danger-code_style_validation (0.1.0) danger-plugin-api (~> 1.0) @@ -59,7 +60,7 @@ PLATFORMS DEPENDENCIES danger - danger-code_style_validation (= 0.1.0)! + danger-code_style_validation! danger-commit_lint danger-lgtm