[travis] Fail when documentation is outdated #7280

pull MarcoFalke wants to merge 2 commits into bitcoin:master from MarcoFalke:MarcoFalke-2015-travisDoc changing 3 files +52 −0
  1. MarcoFalke commented at 1:07 am on January 4, 2016: member

    This checks if all command line args are documented in the help message.

    Example output:

    0$ qa/pull-tester/check-doc.py 
    1Args used        : 144
    2Args documented  : 133
    3Args undocumented: 15
    4set(['-uacomment', '-nodebug', '-rpcssl', '-rpccookiefile', '-checkblockindex', '-benchmark', '-help', '-version', '-h', '-checkmempool', '-mocktime', '-maptxfee', '-tor', '-socks', '-debugnet'])
    5Args unknown     : 4
    6set(['-zmqpubrawblock', '-zmqpubhashtx', '-zmqpubrawtx', '-zmqpubhashblock'])
    7$ echo $?
    815
    
  2. dcousens commented at 1:08 am on January 4, 2016: contributor
    concept ACK
  3. jonasschnelli commented at 8:04 am on January 4, 2016: contributor

    Nice! We just need to be clear: this would mean, we extend the CI/pull-tester from functional code testing to style/documentation quality assurance.

    IMO, this is something we should do.

    utACK fa0f5100493572ea7abd2b0a9d98c697adc31014.

  4. in qa/pull-tester/check-doc.py: in fa0f510049 outdated
    0@@ -0,0 +1,39 @@
    1+#!/usr/bin/env python
    2+'''
    



    fanquake commented at 8:08 am on January 4, 2016:

    Concept ACK

    On Monday, 4 January 2016, Jonas Schnelli notifications@github.com wrote:

    In qa/pull-tester/check-doc.py #7280 (review):

    @@ -0,0 +1,39 @@ +#!/usr/bin/env python +’''

    nit: add copyright header ( https://github.com/MarcoFalke/bitcoin/blob/MarcoFalke-2015-travisDoc/qa/pull-tester/rpc-tests.py#L2 )

    — Reply to this email directly or view it on GitHub https://github.com/bitcoin/bitcoin/pull/7280/files#r48710140.

  5. jonasschnelli added the label Tests on Jan 4, 2016
  6. in qa/pull-tester/check-doc.py: in fa0f510049 outdated
    15+CMD_GREP_DOCS = r"egrep -r -I 'HelpMessageOpt\(\"\-[^\"=]+?(=|\")' %s" % (CMD_ROOT_DIR)
    16+REGEX_ARG = re.compile(r'(?:map(?:Multi)?Args(?:\.count\(|\[)|Get(?:Bool)?Arg\()\"(\-[^\"]+?)\"')
    17+REGEX_DOC = re.compile(r'HelpMessageOpt\(\"(\-[^\"=]+?)(?:=|\")')
    18+
    19+def main():
    20+  used = check_output(CMD_GREP_ARGS, shell=True)
    


    laanwj commented at 8:25 am on January 4, 2016:
    I’d prefer to never use any of the subprocess commands with shell=True, using a shell can easily lead to security issues.

    MarcoFalke commented at 9:49 am on January 4, 2016:
    I agree that shell=True should never be used. But I am just too lazy to translate the pipe into python. The CMD_s are hardcoded, so shell injection is rather unlikely to happen.
  7. laanwj commented at 8:26 am on January 4, 2016: member
    Concept ACK It’s quite ugly to do this as long as there is no organization to the argument parsing, but as long as the risk of false positives is low it’s good to add the check.
  8. MarcoFalke force-pushed on Jan 4, 2016
  9. [travis] Fail when documentation is outdated fada0c90b6
  10. MarcoFalke force-pushed on Jan 4, 2016
  11. MarcoFalke commented at 6:25 pm on January 4, 2016: member
    Moved check-doc.py to devtools and addressed nit by @jonasschnelli
  12. laanwj commented at 7:58 am on January 7, 2016: member

    Travis:

    0/home/travis/build.sh: line 45: contrib/devtools/check-doc.py: No such file or directory
    
  13. MarcoFalke force-pushed on Jan 7, 2016
  14. [travis] Run contrib/devtools/check-doc.py early faeda0e677
  15. MarcoFalke force-pushed on Jan 18, 2016
  16. MarcoFalke commented at 1:13 pm on January 18, 2016: member
    Documentation was added in master, so travis should pass now.
  17. laanwj merged this on Jan 19, 2016
  18. laanwj closed this on Jan 19, 2016

  19. laanwj referenced this in commit 668906fcf2 on Jan 19, 2016
  20. MarcoFalke deleted the branch on Jan 19, 2016
  21. codablock referenced this in commit e2945e276e on Sep 16, 2017
  22. codablock referenced this in commit 5e66469e7c on Sep 19, 2017
  23. codablock referenced this in commit 3f3fb48b32 on Dec 9, 2017
  24. codablock referenced this in commit 42997ee8dc on Dec 9, 2017
  25. DrahtBot locked this on Sep 8, 2021

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2024-07-05 22:12 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me