diff --git a/.arclint b/.arclint --- a/.arclint +++ b/.arclint @@ -242,6 +242,12 @@ "(^src/wallet/rpc*.*\\.(h|c|cpp)$)" ], "exclude": "(^src/rpc/server.cpp)" + }, + "lint-markdown": { + "type": "lint-markdown", + "include": [ + "(\\.md$)" + ] } } } diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md --- a/.github/ISSUE_TEMPLATE.md +++ b/.github/ISSUE_TEMPLATE.md @@ -4,7 +4,7 @@ General bitcoin questions and/or support requests and are best directed to the [Bitcoin StackExchange](https://bitcoin.stackexchange.com). -For reporting security issues, please see [DISCLOSURE_POLICY](DISCLOSURE_POLICY.md). +For reporting security issues, please see [DISCLOSURE_POLICY](/DISCLOSURE_POLICY.md). ### Describe the issue diff --git a/arcanist/.phutil_module_cache b/arcanist/.phutil_module_cache --- a/arcanist/.phutil_module_cache +++ b/arcanist/.phutil_module_cache @@ -1 +1 @@ -{"__symbol_cache_version__":11,"ae5b7d3d6b8cf9598ce4abaf0cd56b21":{"have":{"class":{"ExtendedConfigurationDrivenLintEngine":19}},"need":{"function":{"newv":159,"pht":933},"class":{"ArcanistLintEngine":65,"ArcanistConfigurationDrivenLintEngine":171,"PhutilConsole":866},"class\/interface":{"ILintOnce":634}},"xmap":{"ExtendedConfigurationDrivenLintEngine":["ArcanistLintEngine"]}},"9780c82e3cf1cde0c46662563f00444f":{"have":{"class":{"ArcanistBitcoinABCConfiguration":13}},"need":{"function":{"pht":242},"class":{"ArcanistConfiguration":53,"ArcanistLintWorkflow":1652},"class\/interface":{"ArcanistWorkflow":385,"ArcanistNoEffectException":1371}},"xmap":{"ArcanistBitcoinABCConfiguration":["ArcanistConfiguration"]}},"7357e5ebbf0ab68606496d64ce336b2d":{"have":{"class":{"ArcanistLandBotWorkflow":91}},"need":{"function":{"phutil_console_format":265,"pht":1577,"execx":2181},"class":{"ArcanistWorkflow":123,"ArcanistUsageException":2251}},"xmap":{"ArcanistLandBotWorkflow":["ArcanistWorkflow"]}},"9285ad9415f8ebe564f7119e5a72c559":{"have":{"class":{"FormatStringLinter":146}},"need":{"function":{"pht":377,"csprintf":1492,"id":1872},"class":{"ArcanistExternalLinter":173,"ArcanistLintMessage":1879,"Filesystem":827,"ArcanistLinter":1956,"ArcanistLintSeverity":2044}},"xmap":{"FormatStringLinter":["ArcanistExternalLinter"]}},"2cbb6e7228d81557f777ad648704f343":{"have":{"class":{"IncludeQuotesLinter":100}},"need":{"function":{"pht":306},"class":{"ArcanistLinter":128,"ArcanistLintSeverity":663,"Filesystem":964}},"xmap":{"IncludeQuotesLinter":["ArcanistLinter"]}},"377eb7a4b08b962d2987624c96b99e5d":{"have":{"class":{"LocaleDependenceLinter":160}},"need":{"function":{"pht":5445},"class":{"ArcanistLinter":191,"ArcanistLintSeverity":5948,"Filesystem":6194}},"xmap":{"LocaleDependenceLinter":["ArcanistLinter"]}},"39694cf756ce58681ea84a028f3e007f":{"have":{"class":{"IncludeGuardLinter":98}},"need":{"function":{"pht":443},"class":{"ArcanistLinter":125,"ArcanistLintSeverity":796,"Filesystem":1162}},"xmap":{"IncludeGuardLinter":["ArcanistLinter"]}},"85936cbfc0decd1aae05001717b359da":{"have":{"class":{"LogLinter":116}},"need":{"function":{"pht":297},"class":{"ArcanistLinter":134,"ArcanistLintSeverity":580,"Filesystem":875}},"xmap":{"LogLinter":["ArcanistLinter"]}},"9c6223f7b59509a61f43d02842cc4bbc":{"have":{"class":{"CppVoidParameterLinter":119}},"need":{"function":{"pht":333},"class":{"ArcanistLinter":150,"ArcanistLintSeverity":648,"Filesystem":895}},"xmap":{"CppVoidParameterLinter":["ArcanistLinter"]}},"6f2f22dd0f259fb2eaa284b4fab3bc29":{"have":{"class":{"PythonFormatLinter":123}},"need":{"function":{"pht":353,"id":1838},"class":{"ArcanistExternalLinter":150,"ArcanistLintMessage":1845,"Filesystem":776,"ArcanistLinter":1970,"ArcanistLintSeverity":2053}},"xmap":{"PythonFormatLinter":["ArcanistExternalLinter"]}},"454160ed72e88797129d84ee589de304":{"have":{"class":{"PythonShebangLinter":87}},"need":{"function":{"pht":290},"class":{"ArcanistLinter":115,"ArcanistLintSeverity":614,"Filesystem":854}},"xmap":{"PythonShebangLinter":["ArcanistLinter"]}},"38f0c676bff5192a344464142caaa253":{"have":{"class":{"CHeaderLinter":99}},"need":{"function":{"pht":611},"class":{"ArcanistLinter":121,"ArcanistLintSeverity":1060,"Filesystem":1307}},"xmap":{"CHeaderLinter":["ArcanistLinter"]}},"146347e1ef63e514a6634ada8de5b5c9":{"have":{"class":{"Qt5Linter":70}},"need":{"function":{"pht":258},"class":{"ArcanistLinter":88,"ArcanistLintSeverity":609,"Filesystem":836}},"xmap":{"Qt5Linter":["ArcanistLinter"]}},"26838a30f2792da86e8de3acf18a0ea2":{"have":{"class":{"CppCheckLinter":92}},"need":{"function":{"pht":6052,"execx":6412},"class":{"ArcanistExternalLinter":115,"ArcanistLintMessage":8880,"Filesystem":8002,"ArcanistLintSeverity":9189}},"xmap":{"CppCheckLinter":["ArcanistExternalLinter"]}},"09a933fbbf135320585be52750d93831":{"have":{"class":{"StdintLinter":90}},"need":{"function":{"pht":280},"class":{"ArcanistLinter":111,"ArcanistLintSeverity":589,"Filesystem":897}},"xmap":{"StdintLinter":["ArcanistLinter"]}},"729e2f379c278258d8040e156ba9da29":{"have":{"class":{"ShellLocaleLinter":107}},"need":{"function":{"pht":382},"class":{"ArcanistLinter":133,"ArcanistLintSeverity":734,"Filesystem":1044}},"xmap":{"ShellLocaleLinter":["ArcanistLinter"]}},"5ea58c19df0397ed8ee0f463d90d6c72":{"have":{"class":{"BoostDependenciesLinter":145}},"need":{"function":{"pht":330,"id":1440},"class":{"GlobalExternalLinter":177,"ArcanistLintMessage":1447,"Filesystem":609,"ArcanistLinter":1524,"ArcanistLintSeverity":1624}},"xmap":{"BoostDependenciesLinter":["GlobalExternalLinter"]}},"4c4adcac26dddfa5e350b85a40097755":{"have":{"class":{"BashShebangLinter":82}},"need":{"function":{"pht":281},"class":{"ArcanistLinter":108,"ArcanistLintSeverity":597,"Filesystem":837}},"xmap":{"BashShebangLinter":["ArcanistLinter"]}},"c9e595b23560664866ed4d6f2cbdb117":{"have":{"class":{"WhitespaceLinter":59}},"need":{"function":{"pht":258},"class":{"ArcanistLinter":84,"ArcanistLintSeverity":545,"Filesystem":791}},"xmap":{"WhitespaceLinter":["ArcanistLinter"]}},"e4678dca551a849892aff414d3c4e24e":{"have":{"class":{"DoxygenLinter":91}},"need":{"function":{"pht":382},"class":{"ArcanistLinter":113,"ArcanistLintSeverity":695,"Filesystem":943}},"xmap":{"DoxygenLinter":["ArcanistLinter"]}},"3cd6909c95569e2564deabbd1ec38bbb":{"have":{"class":{"FileNameLinter":103}},"need":{"function":{"pht":382},"class":{"ArcanistLinter":126,"ArcanistLintSeverity":737,"Filesystem":1160}},"xmap":{"FileNameLinter":["ArcanistLinter"]}},"2e11dd9ad67e594f863bc46ac59ea37e":{"have":{"class":{"GlobalExternalLinter":199}},"need":{"class":{"ArcanistExternalLinter":228},"interface":{"ILintOnce":262}},"xmap":{"GlobalExternalLinter":["ArcanistExternalLinter","ILintOnce"]}},"2809b09d2021203b43c57da33d1fe8bf":{"have":{"class":{"AssertWithSideEffectsLinter":210}},"need":{"function":{"pht":439},"class":{"ArcanistLinter":246,"ArcanistLintSeverity":926,"Filesystem":1170}},"xmap":{"AssertWithSideEffectsLinter":["ArcanistLinter"]}},"b2403124ec3e8be6cb4d10bf0f6c4134":{"have":{"interface":{"ILintOnce":69}},"need":[],"xmap":[]},"90a8b110dc475955f15bb81d37268cb5":{"have":{"class":{"AutoPEP8FormatLinter":75}},"need":{"function":{"pht":297,"execx":769,"id":1903},"class":{"ArcanistExternalLinter":104,"ArcanistLintMessage":1910,"Filesystem":1754,"ArcanistLinter":2017,"ArcanistLintSeverity":2095}},"xmap":{"AutoPEP8FormatLinter":["ArcanistExternalLinter"]}},"9bb48ec0fe2e9ced8e27d42540d0571c":{"have":{"class":{"CheckDocLinter":106}},"need":{"function":{"pht":321,"id":1845},"class":{"GlobalExternalLinter":129,"ArcanistLintMessage":1852,"Filesystem":729,"ArcanistLinter":1900,"ArcanistLintSeverity":1986}},"xmap":{"CheckDocLinter":["GlobalExternalLinter"]}},"fbb3938ab9b412d7505335d9f7ed183d":{"have":{"class":{"ShellCheckLinter":95}},"need":{"function":{"pht":921,"execx":1443,"id":2414},"class":{"ArcanistExternalLinter":120,"ArcanistLintMessage":2421,"ArcanistLintSeverity":646,"ArcanistLinter":2469}},"xmap":{"ShellCheckLinter":["ArcanistExternalLinter"]}},"63d19a8745cb2e1200cc26488dc7ad25":{"have":{"class":{"CheckRpcMappingsLinter":131}},"need":{"function":{"pht":310,"id":1386},"class":{"GlobalExternalLinter":162,"ArcanistLintMessage":1393,"Filesystem":573,"ArcanistLinter":1443,"ArcanistLintSeverity":1544}},"xmap":{"CheckRpcMappingsLinter":["GlobalExternalLinter"]}},"24f5f28d739120159e375f587d3a68e4":{"have":{"class":{"ClangFormatLinter":79}},"need":{"function":{"pht":302,"execx":781,"id":2235},"class":{"ArcanistExternalLinter":105,"ArcanistLintMessage":2242,"Filesystem":2086,"ArcanistLinter":2349,"ArcanistLintSeverity":2427}},"xmap":{"ClangFormatLinter":["ArcanistExternalLinter"]}},"e6c7c36001803d09d667e83285bd04e7":{"have":{"class":{"YamllintLinter":77}},"need":{"function":{"pht":399,"execx":907,"id":1711},"class":{"ArcanistExternalLinter":100,"ArcanistLintMessage":1718,"ArcanistLintSeverity":184,"ArcanistLinter":1766}},"xmap":{"YamllintLinter":["ArcanistExternalLinter"]}},"2f99c841a569f2029d13ea030dee007c":{"have":{"class":{"TestsLinter":103}},"need":{"function":{"pht":318,"id":2638},"class":{"ArcanistExternalLinter":123,"ArcanistLintMessage":2645,"Filesystem":776,"ArcanistLinter":2693,"ArcanistLintSeverity":2801}},"xmap":{"TestsLinter":["ArcanistExternalLinter"]}},"b4005bc083930dd85220bffb4c5f8bdd":{"have":{"class":{"PythonFileEncodingLinter":111}},"need":{"function":{"pht":321},"class":{"ArcanistLinter":144,"ArcanistLintSeverity":685,"Filesystem":990}},"xmap":{"PythonFileEncodingLinter":["ArcanistLinter"]}},"f151089cf79fdb8257b2272ed4782d88":{"have":{"class":{"IncludeSourceLinter":99}},"need":{"function":{"pht":391},"class":{"ArcanistLinter":127,"ArcanistLintSeverity":699,"Filesystem":938}},"xmap":{"IncludeSourceLinter":["ArcanistLinter"]}},"0dfd2c03e84436342a043927cde96305":{"have":{"class":{"CheckNonFatalOverAssertInRpc":268}},"need":{"function":{"pht":582},"class":{"ArcanistLinter":305,"ArcanistLintSeverity":863,"Filesystem":1144}},"xmap":{"CheckNonFatalOverAssertInRpc":["ArcanistLinter"]}}} \ No newline at end of file +{"__symbol_cache_version__":11,"7357e5ebbf0ab68606496d64ce336b2d":{"have":{"class":{"ArcanistLandBotWorkflow":91}},"need":{"function":{"phutil_console_format":265,"pht":1577,"execx":2181},"class":{"ArcanistWorkflow":123,"ArcanistUsageException":2251}},"xmap":{"ArcanistLandBotWorkflow":["ArcanistWorkflow"]}},"ae5b7d3d6b8cf9598ce4abaf0cd56b21":{"have":{"class":{"ExtendedConfigurationDrivenLintEngine":19}},"need":{"function":{"newv":159,"pht":933},"class":{"ArcanistLintEngine":65,"ArcanistConfigurationDrivenLintEngine":171,"PhutilConsole":866},"class\/interface":{"ILintOnce":634}},"xmap":{"ExtendedConfigurationDrivenLintEngine":["ArcanistLintEngine"]}},"90a8b110dc475955f15bb81d37268cb5":{"have":{"class":{"AutoPEP8FormatLinter":75}},"need":{"function":{"pht":297,"execx":769,"id":1903},"class":{"ArcanistExternalLinter":104,"ArcanistLintMessage":1910,"Filesystem":1754,"ArcanistLinter":2017,"ArcanistLintSeverity":2095}},"xmap":{"AutoPEP8FormatLinter":["ArcanistExternalLinter"]}},"5ea58c19df0397ed8ee0f463d90d6c72":{"have":{"class":{"BoostDependenciesLinter":145}},"need":{"function":{"pht":330,"id":1440},"class":{"GlobalExternalLinter":177,"ArcanistLintMessage":1447,"Filesystem":609,"ArcanistLinter":1524,"ArcanistLintSeverity":1624}},"xmap":{"BoostDependenciesLinter":["GlobalExternalLinter"]}},"c9e595b23560664866ed4d6f2cbdb117":{"have":{"class":{"WhitespaceLinter":59}},"need":{"function":{"pht":258},"class":{"ArcanistLinter":84,"ArcanistLintSeverity":545,"Filesystem":791}},"xmap":{"WhitespaceLinter":["ArcanistLinter"]}},"6f2f22dd0f259fb2eaa284b4fab3bc29":{"have":{"class":{"PythonFormatLinter":123}},"need":{"function":{"pht":353,"id":1838},"class":{"ArcanistExternalLinter":150,"ArcanistLintMessage":1845,"Filesystem":776,"ArcanistLinter":1970,"ArcanistLintSeverity":2053}},"xmap":{"PythonFormatLinter":["ArcanistExternalLinter"]}},"e4678dca551a849892aff414d3c4e24e":{"have":{"class":{"DoxygenLinter":91}},"need":{"function":{"pht":382},"class":{"ArcanistLinter":113,"ArcanistLintSeverity":695,"Filesystem":943}},"xmap":{"DoxygenLinter":["ArcanistLinter"]}},"4c4adcac26dddfa5e350b85a40097755":{"have":{"class":{"BashShebangLinter":82}},"need":{"function":{"pht":281},"class":{"ArcanistLinter":108,"ArcanistLintSeverity":597,"Filesystem":837}},"xmap":{"BashShebangLinter":["ArcanistLinter"]}},"f151089cf79fdb8257b2272ed4782d88":{"have":{"class":{"IncludeSourceLinter":99}},"need":{"function":{"pht":391},"class":{"ArcanistLinter":127,"ArcanistLintSeverity":699,"Filesystem":938}},"xmap":{"IncludeSourceLinter":["ArcanistLinter"]}},"b2403124ec3e8be6cb4d10bf0f6c4134":{"have":{"interface":{"ILintOnce":69}},"need":[],"xmap":[]},"63d19a8745cb2e1200cc26488dc7ad25":{"have":{"class":{"CheckRpcMappingsLinter":131}},"need":{"function":{"pht":310,"id":1386},"class":{"GlobalExternalLinter":162,"ArcanistLintMessage":1393,"Filesystem":573,"ArcanistLinter":1443,"ArcanistLintSeverity":1544}},"xmap":{"CheckRpcMappingsLinter":["GlobalExternalLinter"]}},"9285ad9415f8ebe564f7119e5a72c559":{"have":{"class":{"FormatStringLinter":146}},"need":{"function":{"pht":377,"csprintf":1492,"id":1872},"class":{"ArcanistExternalLinter":173,"ArcanistLintMessage":1879,"Filesystem":827,"ArcanistLinter":1956,"ArcanistLintSeverity":2044}},"xmap":{"FormatStringLinter":["ArcanistExternalLinter"]}},"0dfd2c03e84436342a043927cde96305":{"have":{"class":{"CheckNonFatalOverAssertInRpc":268}},"need":{"function":{"pht":582},"class":{"ArcanistLinter":305,"ArcanistLintSeverity":863,"Filesystem":1144}},"xmap":{"CheckNonFatalOverAssertInRpc":["ArcanistLinter"]}},"85936cbfc0decd1aae05001717b359da":{"have":{"class":{"LogLinter":116}},"need":{"function":{"pht":297},"class":{"ArcanistLinter":134,"ArcanistLintSeverity":580,"Filesystem":875}},"xmap":{"LogLinter":["ArcanistLinter"]}},"26838a30f2792da86e8de3acf18a0ea2":{"have":{"class":{"CppCheckLinter":92}},"need":{"function":{"pht":6052,"execx":6412},"class":{"ArcanistExternalLinter":115,"ArcanistLintMessage":8880,"Filesystem":8002,"ArcanistLintSeverity":9189}},"xmap":{"CppCheckLinter":["ArcanistExternalLinter"]}},"729e2f379c278258d8040e156ba9da29":{"have":{"class":{"ShellLocaleLinter":107}},"need":{"function":{"pht":382},"class":{"ArcanistLinter":133,"ArcanistLintSeverity":734,"Filesystem":1044}},"xmap":{"ShellLocaleLinter":["ArcanistLinter"]}},"09a933fbbf135320585be52750d93831":{"have":{"class":{"StdintLinter":90}},"need":{"function":{"pht":280},"class":{"ArcanistLinter":111,"ArcanistLintSeverity":589,"Filesystem":897}},"xmap":{"StdintLinter":["ArcanistLinter"]}},"2cbb6e7228d81557f777ad648704f343":{"have":{"class":{"IncludeQuotesLinter":100}},"need":{"function":{"pht":306},"class":{"ArcanistLinter":128,"ArcanistLintSeverity":663,"Filesystem":964}},"xmap":{"IncludeQuotesLinter":["ArcanistLinter"]}},"38f0c676bff5192a344464142caaa253":{"have":{"class":{"CHeaderLinter":99}},"need":{"function":{"pht":611},"class":{"ArcanistLinter":121,"ArcanistLintSeverity":1060,"Filesystem":1307}},"xmap":{"CHeaderLinter":["ArcanistLinter"]}},"3cd6909c95569e2564deabbd1ec38bbb":{"have":{"class":{"FileNameLinter":103}},"need":{"function":{"pht":382},"class":{"ArcanistLinter":126,"ArcanistLintSeverity":737,"Filesystem":1160}},"xmap":{"FileNameLinter":["ArcanistLinter"]}},"2e11dd9ad67e594f863bc46ac59ea37e":{"have":{"class":{"GlobalExternalLinter":199}},"need":{"class":{"ArcanistExternalLinter":228},"interface":{"ILintOnce":262}},"xmap":{"GlobalExternalLinter":["ArcanistExternalLinter","ILintOnce"]}},"146347e1ef63e514a6634ada8de5b5c9":{"have":{"class":{"Qt5Linter":70}},"need":{"function":{"pht":258},"class":{"ArcanistLinter":88,"ArcanistLintSeverity":609,"Filesystem":836}},"xmap":{"Qt5Linter":["ArcanistLinter"]}},"2f99c841a569f2029d13ea030dee007c":{"have":{"class":{"TestsLinter":103}},"need":{"function":{"pht":318,"id":2638},"class":{"ArcanistExternalLinter":123,"ArcanistLintMessage":2645,"Filesystem":776,"ArcanistLinter":2693,"ArcanistLintSeverity":2801}},"xmap":{"TestsLinter":["ArcanistExternalLinter"]}},"24f5f28d739120159e375f587d3a68e4":{"have":{"class":{"ClangFormatLinter":79}},"need":{"function":{"pht":302,"execx":781,"id":2235},"class":{"ArcanistExternalLinter":105,"ArcanistLintMessage":2242,"Filesystem":2086,"ArcanistLinter":2349,"ArcanistLintSeverity":2427}},"xmap":{"ClangFormatLinter":["ArcanistExternalLinter"]}},"fbb3938ab9b412d7505335d9f7ed183d":{"have":{"class":{"ShellCheckLinter":95}},"need":{"function":{"pht":921,"execx":1443,"id":2414},"class":{"ArcanistExternalLinter":120,"ArcanistLintMessage":2421,"ArcanistLintSeverity":646,"ArcanistLinter":2469}},"xmap":{"ShellCheckLinter":["ArcanistExternalLinter"]}},"e6c7c36001803d09d667e83285bd04e7":{"have":{"class":{"YamllintLinter":77}},"need":{"function":{"pht":399,"execx":907,"id":1711},"class":{"ArcanistExternalLinter":100,"ArcanistLintMessage":1718,"ArcanistLintSeverity":184,"ArcanistLinter":1766}},"xmap":{"YamllintLinter":["ArcanistExternalLinter"]}},"39694cf756ce58681ea84a028f3e007f":{"have":{"class":{"IncludeGuardLinter":98}},"need":{"function":{"pht":443},"class":{"ArcanistLinter":125,"ArcanistLintSeverity":796,"Filesystem":1162}},"xmap":{"IncludeGuardLinter":["ArcanistLinter"]}},"9c6223f7b59509a61f43d02842cc4bbc":{"have":{"class":{"CppVoidParameterLinter":119}},"need":{"function":{"pht":333},"class":{"ArcanistLinter":150,"ArcanistLintSeverity":648,"Filesystem":895}},"xmap":{"CppVoidParameterLinter":["ArcanistLinter"]}},"454160ed72e88797129d84ee589de304":{"have":{"class":{"PythonShebangLinter":87}},"need":{"function":{"pht":290},"class":{"ArcanistLinter":115,"ArcanistLintSeverity":614,"Filesystem":854}},"xmap":{"PythonShebangLinter":["ArcanistLinter"]}},"9bb48ec0fe2e9ced8e27d42540d0571c":{"have":{"class":{"CheckDocLinter":106}},"need":{"function":{"pht":321,"id":1845},"class":{"GlobalExternalLinter":129,"ArcanistLintMessage":1852,"Filesystem":729,"ArcanistLinter":1900,"ArcanistLintSeverity":1986}},"xmap":{"CheckDocLinter":["GlobalExternalLinter"]}},"b4005bc083930dd85220bffb4c5f8bdd":{"have":{"class":{"PythonFileEncodingLinter":111}},"need":{"function":{"pht":321},"class":{"ArcanistLinter":144,"ArcanistLintSeverity":685,"Filesystem":990}},"xmap":{"PythonFileEncodingLinter":["ArcanistLinter"]}},"377eb7a4b08b962d2987624c96b99e5d":{"have":{"class":{"LocaleDependenceLinter":160}},"need":{"function":{"pht":5445},"class":{"ArcanistLinter":191,"ArcanistLintSeverity":5948,"Filesystem":6194}},"xmap":{"LocaleDependenceLinter":["ArcanistLinter"]}},"2809b09d2021203b43c57da33d1fe8bf":{"have":{"class":{"AssertWithSideEffectsLinter":210}},"need":{"function":{"pht":439},"class":{"ArcanistLinter":246,"ArcanistLintSeverity":926,"Filesystem":1170}},"xmap":{"AssertWithSideEffectsLinter":["ArcanistLinter"]}},"9780c82e3cf1cde0c46662563f00444f":{"have":{"class":{"ArcanistBitcoinABCConfiguration":13}},"need":{"function":{"pht":242},"class":{"ArcanistConfiguration":53,"ArcanistLintWorkflow":1652},"class\/interface":{"ArcanistWorkflow":385,"ArcanistNoEffectException":1371}},"xmap":{"ArcanistBitcoinABCConfiguration":["ArcanistConfiguration"]}},"5eecb9a1ee2fe5e65cd50ae6bff09ad5":{"have":{"function":{"startsWith":16},"class":{"MarkdownLinter":171}},"need":{"function":{"pht":361},"class":{"ArcanistLinter":194,"ArcanistLintSeverity":652,"Filesystem":1503}},"xmap":{"MarkdownLinter":["ArcanistLinter"]}}} \ No newline at end of file diff --git a/arcanist/__phutil_library_map__.php b/arcanist/__phutil_library_map__.php --- a/arcanist/__phutil_library_map__.php +++ b/arcanist/__phutil_library_map__.php @@ -33,6 +33,7 @@ 'IncludeSourceLinter' => 'linter/IncludeSourceLinter.php', 'LocaleDependenceLinter' => 'linter/LocaleDependenceLinter.php', 'LogLinter' => 'linter/LogLinter.php', + 'MarkdownLinter' => 'linter/MarkdownLinter.php', 'PythonFileEncodingLinter' => 'linter/PythonFileEncodingLinter.php', 'PythonFormatLinter' => 'linter/PythonFormatLinter.php', 'PythonShebangLinter' => 'linter/PythonShebangLinter.php', @@ -44,7 +45,9 @@ 'WhitespaceLinter' => 'linter/WhitespaceLinter.php', 'YamllintLinter' => 'linter/YamllintLinter.php', ), - 'function' => array(), + 'function' => array( + 'startsWith' => 'linter/MarkdownLinter.php', + ), 'xmap' => array( 'ArcanistBitcoinABCConfiguration' => 'ArcanistConfiguration', 'ArcanistLandBotWorkflow' => 'ArcanistWorkflow', @@ -72,6 +75,7 @@ 'IncludeSourceLinter' => 'ArcanistLinter', 'LocaleDependenceLinter' => 'ArcanistLinter', 'LogLinter' => 'ArcanistLinter', + 'MarkdownLinter' => 'ArcanistLinter', 'PythonFileEncodingLinter' => 'ArcanistLinter', 'PythonFormatLinter' => 'ArcanistExternalLinter', 'PythonShebangLinter' => 'ArcanistLinter', diff --git a/arcanist/linter/MarkdownLinter.php b/arcanist/linter/MarkdownLinter.php new file mode 100644 --- /dev/null +++ b/arcanist/linter/MarkdownLinter.php @@ -0,0 +1,95 @@ + ArcanistLintSeverity::SEVERITY_ERROR); + } + + public function getLintNameMap() { + return array( + self::DEAD_LINK_FOUND => pht('Dead link')); + } + + private function isValidLink($currentPath, $link) { + /* + * File anchors are not tested and always considered valid. + * TODO: check that anchors have a corresponding section. + */ + if ($link[0] === '#') { + return true; + } + + /* + * External URLs (starting with scheme://) are considered valid if the URL + * syntax is valid. + */ + if (preg_match('#^[^:]+://#', $link)) { + return filter_var($link, FILTER_VALIDATE_URL); + } + + /* For mailto: links, check the address syntax is valid */ + if (startsWith($link, 'mailto:')) { + return filter_var(substr($link, 7), FILTER_VALIDATE_EMAIL); + } + + if ($link[0] === '/') { + $linkPath = Filesystem::resolvePath( + substr($link, 1), $this->getProjectRoot()); + } else { + $linkPath = Filesystem::resolvePath($link, + pathinfo($currentPath, PATHINFO_DIRNAME)); + } + + return file_exists($linkPath); + } + + public function lintPath($path) { + $path = Filesystem::resolvePath($path, $this->getProjectRoot()); + $fileContent = Filesystem::readFile($path); + + /* Check for broken links (typos in URL of missing target file) */ + $pattern = '/\[[^\]]+\]\(([^)]+\.[^ "#)]+)#?[^)]*\)/'; + if (preg_match_all($pattern, $fileContent, $matches, PREG_OFFSET_CAPTURE)) { + foreach ($matches[1] as $match) { + list($link, $offset) = $match; + + if (!$this->isValidLink($path, trim($link))) { + $this->raiseLintAtOffset( + $offset, + self::DEAD_LINK_FOUND, + pht( + 'The link is invalid, check for syntax error or missing target'), + $link, + null); + } + } + } + } +} diff --git a/contrib/README.md b/contrib/README.md --- a/contrib/README.md +++ b/contrib/README.md @@ -34,7 +34,7 @@ ### [MacDeploy](/contrib/macdeploy) ### Scripts and notes for Mac builds. -### [Gitian-build](/contrib/gitian-build.sh) ### +### [Gitian-build](/contrib/gitian-build.py) ### Script for running full Gitian builds. Test and Verify Tools diff --git a/contrib/teamcity/README.md b/contrib/teamcity/README.md --- a/contrib/teamcity/README.md +++ b/contrib/teamcity/README.md @@ -81,4 +81,4 @@ ## Install necessary build dependencies for bitcoin-abc -See [build-unix.md](doc/build-unix.md) +See [build-unix.md](/doc/build-unix.md) diff --git a/doc/README.md b/doc/README.md --- a/doc/README.md +++ b/doc/README.md @@ -87,7 +87,6 @@ - [Source Code Documentation (External Link)](https://dev.visucore.com/bitcoin/doxygen/) - [Translation Process](translation_process.md) - [Translation Strings Policy](translation_strings_policy.md) -- [Travis CI](travis-ci.md) - [Unauthenticated REST Interface](REST-interface.md) - [Shared Libraries](shared-libraries.md) - [BIPS](bips.md) diff --git a/doc/developer-notes.md b/doc/developer-notes.md --- a/doc/developer-notes.md +++ b/doc/developer-notes.md @@ -268,7 +268,7 @@ Valgrind is a programming tool for memory debugging, memory leak detection, and profiling. The repo contains a Valgrind suppressions file -([`valgrind.supp`](contrib/valgrind.supp)) +([`valgrind.supp`](/contrib/valgrind.supp)) which includes known Valgrind warnings in our dependencies that cannot be fixed in-tree. Example use: diff --git a/doc/functional-tests.md b/doc/functional-tests.md --- a/doc/functional-tests.md +++ b/doc/functional-tests.md @@ -233,9 +233,9 @@ #### Example test -The [example_test.py](example_test.py) is a heavily commented example of a test -case that uses both the RPC and P2P interfaces. If you are writing your first -test, copy that file and modify to fit your needs. +The [example_test.py](/test/functional/example_test.py) is a heavily commented +example of a test case that uses both the RPC and P2P interfaces. If you are +writing your first test, copy that file and modify to fit your needs. #### Coverage @@ -322,26 +322,26 @@ ### test-framework modules -#### [test_framework/authproxy.py](test_framework/authproxy.py) +#### [test_framework/authproxy.py](/test/functional/test_framework/authproxy.py) Taken from the [python-bitcoinrpc repository](https://github.com/jgarzik/python-bitcoinrpc). -#### [test_framework/test_framework.py](test_framework/test_framework.py) +#### [test_framework/test_framework.py](/test/functional/test_framework/test_framework.py) Base class for functional tests. -#### [test_framework/util.py](test_framework/util.py) +#### [test_framework/util.py](/test/functional/test_framework/util.py) Generally useful functions. -#### [test_framework/mininode.py](test_framework/mininode.py) +#### [test_framework/mininode.py](/test/functional/test_framework/mininode.py) Basic code to support P2P connectivity to a bitcoind. -#### [test_framework/script.py](test_framework/script.py) +#### [test_framework/script.py](/test/functional/test_framework/script.py) Utilities for manipulating transaction scripts (originally from python-bitcoinlib) -#### [test_framework/key.py](test_framework/key.py) +#### [test_framework/key.py](/test/functional/test_framework/key.py) Wrapper around OpenSSL EC_Key (originally from python-bitcoinlib) -#### [test_framework/bignum.py](test_framework/bignum.py) +#### [test_framework/bignum.py](/test/functional/test_framework/bignum.py) Helpers for script.py -#### [test_framework/blocktools.py](test_framework/blocktools.py) +#### [test_framework/blocktools.py](/test/functional/test_framework/blocktools.py) Helper functions for creating blocks and transactions. diff --git a/doc/release-process.md b/doc/release-process.md --- a/doc/release-process.md +++ b/doc/release-process.md @@ -11,9 +11,9 @@ - Any known issues or limitations should be documented in release notes 2. Update the documents / code which needs to be updated every release - - Check that [release-notes.md](doc/release-notes.md) is complete, and fill in any missing items. + - Check that [release-notes.md](/doc/release-notes.md) is complete, and fill in any missing items. - Verify the following were updated by automation since the last release: - - Seeds (see [README](contrib/seeds/README.md)) + - Seeds (see [README](/contrib/seeds/README.md)) - Chainparams were updated, such as assume-valid, chainwork, and disk size expectations. 3. Verify tests passed