lint: Convert lint-python-utf8-encoding.sh to Python #24916

pull Kvaciral wants to merge 1 commits into bitcoin:master from Kvaciral:lint-python-utf8-encoding-port changing 2 files +73 −28
  1. Kvaciral commented at 0:13 am on April 19, 2022: contributor
    A port of test/lint/lint-python-utf8-encoding.sh to a Python-script as part of the request of #24783. Checked for output-consistency.
  2. Kvaciral force-pushed on Apr 19, 2022
  3. DrahtBot added the label Tests on Apr 19, 2022
  4. Kvaciral force-pushed on Apr 19, 2022
  5. in test/lint/lint-python-utf8-encoding.py:20 in 1d5222411a outdated
    15+
    16+def check_fileopens():
    17+    fileopens = list()
    18+
    19+    try:
    20+        fileopens = check_output(["git", "grep", r" open(", "--", "*.py", ":(exclude)src/crc32c/"], universal_newlines=True, encoding="utf8").splitlines()
    


    anibilthare commented at 8:11 am on April 19, 2022:
    0        fileopens = check_output(["git", "grep", r" open(", "*.py", ":(exclude)src/crc32c/"], universal_newlines=True, encoding="utf8").splitlines()
    

    I’m wondering if we can do this because they give the same output (locally tested).


    laanwj commented at 11:08 am on April 19, 2022:
    It’s not strictly necessary here but adding the -- is “safe”. It’s good to add just in case file arguments are added later that might conflict with option arguments.

    anibilthare commented at 2:21 pm on April 19, 2022:
    Sounds reasonable.

    laanwj commented at 3:57 pm on April 21, 2022:
    Please unify the excludes in one place at the top, like you did for the other PRs.
  6. anibilthare commented at 10:25 am on April 19, 2022: none

    Tested ACK! To test I set the encoding parameter to something other than (ascii|utf8|utf-8) with the python files that used open and check_output with universal_newlines=True.

    (One thing to note is that, with bad styling, CI will fail even with encoding set to (ascii|utf8|utf-8). E.G. more than one leading or trailing spaces like encoding=" utf8")

  7. Kvaciral force-pushed on Apr 21, 2022
  8. lint: Convert lint-python-utf8-encoding.sh to Python 035eef4be6
  9. Kvaciral force-pushed on Apr 21, 2022
  10. laanwj commented at 3:58 pm on April 25, 2022: member
    Thanks for addressing my comment. Code review ACK 035eef4be6071a060260907001363a0d12f1f2d2
  11. laanwj merged this on Apr 25, 2022
  12. laanwj closed this on Apr 25, 2022

  13. sidhujag referenced this in commit 03867261ad on Apr 26, 2022
  14. DrahtBot locked this on Apr 25, 2023

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