diff --git a/arcanist/linter/IncludeGuardLinter.php b/arcanist/linter/IncludeGuardLinter.php --- a/arcanist/linter/IncludeGuardLinter.php +++ b/arcanist/linter/IncludeGuardLinter.php @@ -58,7 +58,8 @@ // Surround with prefix and suffix. $guard = self::GUARD_PREFIX.$guard.self::GUARD_SUFFIX; - if (preg_match_all('/#(?:ifndef|define) '.$guard.'/', $fileContent) != 2) { + if (preg_match_all('@#(?:ifndef|define|endif //) '.$guard.'@', + $fileContent) != 3) { return $this->raiseLintAtPath( self::INCLUDE_GUARD_INVALID, pht("Include guard is malformed or missing. Expected format:\n". diff --git a/src/amount.h b/src/amount.h --- a/src/amount.h +++ b/src/amount.h @@ -170,4 +170,4 @@ return nValue >= Amount::zero() && nValue <= MAX_MONEY; } -#endif // BITCOIN_AMOUNT_H +#endif // BITCOIN_AMOUNT_H diff --git a/src/cashaddrenc.h b/src/cashaddrenc.h --- a/src/cashaddrenc.h +++ b/src/cashaddrenc.h @@ -29,4 +29,4 @@ CTxDestination DecodeCashAddrDestination(const CashAddrContent &content); std::vector PackCashAddrContent(const CashAddrContent &content); -#endif +#endif // BITCOIN_CASHADDRENC_H diff --git a/src/config.h b/src/config.h --- a/src/config.h +++ b/src/config.h @@ -106,4 +106,4 @@ // Temporary woraround. const Config &GetConfig(); -#endif +#endif // BITCOIN_CONFIG_H diff --git a/src/feerate.h b/src/feerate.h --- a/src/feerate.h +++ b/src/feerate.h @@ -92,4 +92,4 @@ } }; -#endif // BITCOIN_FEERATE_H +#endif // BITCOIN_FEERATE_H diff --git a/src/httprpc.h b/src/httprpc.h --- a/src/httprpc.h +++ b/src/httprpc.h @@ -61,4 +61,4 @@ */ void StopREST(); -#endif +#endif // BITCOIN_HTTPRPC_H diff --git a/src/qt/test/bitcoinaddressvalidatortests.h b/src/qt/test/bitcoinaddressvalidatortests.h --- a/src/qt/test/bitcoinaddressvalidatortests.h +++ b/src/qt/test/bitcoinaddressvalidatortests.h @@ -15,4 +15,4 @@ void inputTests(); }; -#endif +#endif // BITCOIN_QT_TEST_BITCOINADDRESSVALIDATORTESTS_H diff --git a/src/rpc/mining.h b/src/rpc/mining.h --- a/src/rpc/mining.h +++ b/src/rpc/mining.h @@ -18,4 +18,4 @@ std::shared_ptr coinbaseScript, int nGenerate, uint64_t nMaxTries, bool keepScript); -#endif +#endif // BITCOIN_RPC_MINING_H diff --git a/src/scheduler.h b/src/scheduler.h --- a/src/scheduler.h +++ b/src/scheduler.h @@ -130,4 +130,4 @@ size_t CallbacksPending(); }; -#endif +#endif // BITCOIN_SCHEDULER_H diff --git a/src/seeder/bitcoin.h b/src/seeder/bitcoin.h --- a/src/seeder/bitcoin.h +++ b/src/seeder/bitcoin.h @@ -22,4 +22,4 @@ bool TestNode(const CService &cip, int &ban, int &client, std::string &clientSV, int &blocks, std::vector *vAddr); -#endif +#endif // BITCOIN_SEEDER_BITCOIN_H diff --git a/src/seeder/db.h b/src/seeder/db.h --- a/src/seeder/db.h +++ b/src/seeder/db.h @@ -445,4 +445,4 @@ } }; -#endif +#endif // BITCOIN_SEEDER_DB_H diff --git a/src/seeder/dns.h b/src/seeder/dns.h --- a/src/seeder/dns.h +++ b/src/seeder/dns.h @@ -26,4 +26,4 @@ int dnsserver(dns_opt_t *opt); -#endif +#endif // BITCOIN_SEEDER_DNS_H diff --git a/src/seeder/strlcpy.h b/src/seeder/strlcpy.h --- a/src/seeder/strlcpy.h +++ b/src/seeder/strlcpy.h @@ -77,4 +77,4 @@ return (dlen + (s - src)); /* count does not include NUL */ } -#endif +#endif // BITCOIN_SEEDER_STRLCPY_H diff --git a/src/seeder/util.h b/src/seeder/util.h --- a/src/seeder/util.h +++ b/src/seeder/util.h @@ -13,4 +13,4 @@ nanosleep(&wa, nullptr); } -#endif +#endif // BITCOIN_SEEDER_UTIL_H diff --git a/src/test/scriptnum10.h b/src/test/scriptnum10.h --- a/src/test/scriptnum10.h +++ b/src/test/scriptnum10.h @@ -192,4 +192,4 @@ int64_t m_value; }; -#endif // BITCOIN_TEST_BIGNUM_H +#endif // BITCOIN_TEST_SCRIPTNUM10_H diff --git a/src/test/test_bitcoin.h b/src/test/test_bitcoin.h --- a/src/test/test_bitcoin.h +++ b/src/test/test_bitcoin.h @@ -162,4 +162,4 @@ // BOOST_CHECK_* std::ostream &operator<<(std::ostream &os, const uint256 &num); -#endif +#endif // BITCOIN_TEST_TEST_BITCOIN_H diff --git a/src/torcontrol.h b/src/torcontrol.h --- a/src/torcontrol.h +++ b/src/torcontrol.h @@ -17,4 +17,4 @@ void InterruptTorControl(); void StopTorControl(); -#endif /* BITCOIN_TORCONTROL_H */ +#endif // BITCOIN_TORCONTROL_H diff --git a/src/warnings.h b/src/warnings.h --- a/src/warnings.h +++ b/src/warnings.h @@ -24,4 +24,4 @@ */ std::string GetWarnings(const std::string &strFor); -#endif // BITCOIN_WARNINGS_H +#endif // BITCOIN_WARNINGS_H