Skip to content
Snippets Groups Projects
  • hyukjinkwon's avatar
    0e31e28d
    [MINOR][PYTHON] Ignore pep8 on test scripts generated in tests in work directory · 0e31e28d
    hyukjinkwon authored
    ## What changes were proposed in this pull request?
    
    Currently, if we run `./python/run-tests.py` and they are aborted without cleaning up this directory, it fails pep8 check due to some Python scripts generated. For example, https://github.com/apache/spark/blob/7387126f83dc0489eb1df734bfeba705709b7861/python/pyspark/tests.py#L1955-L1968
    
    ```
    PEP8 checks failed.
    ./work/app-20170531190857-0000/0/test.py:5:55: W292 no newline at end of file
    ./work/app-20170531190909-0000/0/test.py:5:55: W292 no newline at end of file
    ./work/app-20170531190924-0000/0/test.py:3:1: E302 expected 2 blank lines, found 1
    ./work/app-20170531190924-0000/0/test.py:7:52: W292 no newline at end of file
    ./work/app-20170531191016-0000/0/test.py:5:55: W292 no newline at end of file
    ./work/app-20170531191030-0000/0/test.py:5:55: W292 no newline at end of file
    ./work/app-20170531191045-0000/0/test.py:3:1: E302 expected 2 blank lines, found 1
    ./work/app-20170531191045-0000/0/test.py:7:52: W292 no newline at end of file
    ```
    
    For me, it is sometimes a bit annoying. This PR proposes to exclude these (assuming we want to skip per https://github.com/apache/spark/blob/master/.gitignore#L73).
    
    Also, it moves other pep8 configurations in the script into ini configuration file in pep8.
    
    ## How was this patch tested?
    
    Manually tested via `./dev/lint-python`.
    
    Author: hyukjinkwon <gurwls223@gmail.com>
    
    Closes #18161 from HyukjinKwon/work-exclude-pep8.
    0e31e28d
    History
    [MINOR][PYTHON] Ignore pep8 on test scripts generated in tests in work directory
    hyukjinkwon authored
    ## What changes were proposed in this pull request?
    
    Currently, if we run `./python/run-tests.py` and they are aborted without cleaning up this directory, it fails pep8 check due to some Python scripts generated. For example, https://github.com/apache/spark/blob/7387126f83dc0489eb1df734bfeba705709b7861/python/pyspark/tests.py#L1955-L1968
    
    ```
    PEP8 checks failed.
    ./work/app-20170531190857-0000/0/test.py:5:55: W292 no newline at end of file
    ./work/app-20170531190909-0000/0/test.py:5:55: W292 no newline at end of file
    ./work/app-20170531190924-0000/0/test.py:3:1: E302 expected 2 blank lines, found 1
    ./work/app-20170531190924-0000/0/test.py:7:52: W292 no newline at end of file
    ./work/app-20170531191016-0000/0/test.py:5:55: W292 no newline at end of file
    ./work/app-20170531191030-0000/0/test.py:5:55: W292 no newline at end of file
    ./work/app-20170531191045-0000/0/test.py:3:1: E302 expected 2 blank lines, found 1
    ./work/app-20170531191045-0000/0/test.py:7:52: W292 no newline at end of file
    ```
    
    For me, it is sometimes a bit annoying. This PR proposes to exclude these (assuming we want to skip per https://github.com/apache/spark/blob/master/.gitignore#L73).
    
    Also, it moves other pep8 configurations in the script into ini configuration file in pep8.
    
    ## How was this patch tested?
    
    Manually tested via `./dev/lint-python`.
    
    Author: hyukjinkwon <gurwls223@gmail.com>
    
    Closes #18161 from HyukjinKwon/work-exclude-pep8.