Skip to content

Commit

Permalink
Re-enable pylint CI checker
Browse files Browse the repository at this point in the history
Update code to conform to the newer version of pylint available in
ubuntu-22.04, with few exceptions:
    - disabled `consider-using-f-string`
    - disabled `import-outside-toplevel` for `main()` in
      `jerry_client.py`
    - disabled `consider-using-with` for the logfile of `TestSuite` in
      `test262-harness.py` as using `with` is not practical in that case

Update test262-harness.py to use argparse instead of the now deprecated
optparse

Rename variables in jerry_client_main.py that redefined python builtins
or shadowed variables from an outer scope

Add minimum python versions to the macos CI jobs: without it the default
python version did not support the `with` statement for
`subprocess.Popen` used in `build.py`

JerryScript-DCO-1.0-Signed-off-by: Máté Tokodi matet@inf.u-szeged.hu
  • Loading branch information
matetokodi committed Sep 22, 2023
1 parent a588e49 commit 8474bbe
Show file tree
Hide file tree
Showing 21 changed files with 261 additions and 261 deletions.
13 changes: 10 additions & 3 deletions .github/workflows/gh-actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ jobs:
python-version: '3.10'
- run: sudo apt update
# TODO: update checkers to current versions available in ubuntu 22.04
# - run: sudo apt install doxygen clang-format-10 cppcheck pylint python-serial
# - run: sudo apt install doxygen clang-format-10 cppcheck python-serial
- run: sudo apt install pylint
- run: $RUNNER --check-signed-off=gh-actions
if: ${{ always() }}
# - run: $RUNNER --check-doxygen
Expand All @@ -28,8 +29,8 @@ jobs:
if: ${{ always() }}
# - run: $RUNNER --check-strings
# if: ${{ always() }}
# - run: $RUNNER --check-pylint
# if: ${{ always() }}
- run: $RUNNER --check-pylint
if: ${{ always() }}
# - run: $RUNNER --check-cppcheck
# if: ${{ always() }}

Expand All @@ -56,13 +57,19 @@ jobs:
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v4
with:
python-version: '>=3.0'
- run: $RUNNER -q --jerry-tests
- run: $RUNNER -q --unittests

OSX_x86-64_Build_Correctness_Unit_Tests_Debug:
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v4
with:
python-version: '>=3.0'
- run: $RUNNER -q --jerry-tests --build-debug
- run: $RUNNER -q --unittests --build-debug

Expand Down
8 changes: 4 additions & 4 deletions jerry-debugger/jerry_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ def do_next(self, args):
if res_type == result.END:
self.quit = True
return
elif res_type == result.TEXT:
if res_type == result.TEXT:
write(result.get_text())
elif res_type == result.PROMPT:
break
Expand Down Expand Up @@ -262,7 +262,7 @@ def src_check_args(args):
print("Error: Non-negative integer number expected: %s" % (val_errno))
return -1

# pylint: disable=too-many-branches,too-many-locals,too-many-statements
# pylint: disable=too-many-branches,too-many-locals,too-many-statements,import-outside-toplevel
def main():
args = jerry_client_main.arguments_parse()

Expand Down Expand Up @@ -325,7 +325,7 @@ def main():

if res_type == result.END:
break
elif res_type == result.PROMPT:
if res_type == result.PROMPT:
prompt.cmdloop()
elif res_type == result.TEXT:
write(result.get_text())
Expand All @@ -339,7 +339,7 @@ def main():
MSG = str(error_msg)
if ERRNO == 111:
sys.exit("Failed to connect to the JerryScript debugger.")
elif ERRNO == 32 or ERRNO == 104:
elif ERRNO in (32, 104):
sys.exit("Connection closed.")
else:
sys.exit("Failed to connect to the JerryScript debugger.\nError: %s" % (MSG))
Loading

0 comments on commit 8474bbe

Please sign in to comment.