lcompilers / lpython

Python compiler
https://lpython.org/
Other
1.5k stars 163 forks source link

style suggestion in integration tests #2478

Closed rebcabin closed 8 months ago

rebcabin commented 9 months ago
[ 50%] Linking C executable test_builtin
[ 51%] Linking C executable test_builtin_abs
[ 51%] Linking C executable elemental_13
[ 51%] Built target test_os
[ 51%] Built target elemental_12
style suggestion: Could have used '**' instead of 'pow'
  --> /Users/brian/Dropbox/Mac/Documents/GitHub/lpython/integration_tests/test_builtin_pow.py:11:16
   |
11 |     assert i32(pow(a, b)) == 32
   |                ^^^^^^^^^ '**' could be used instead

Note: Please report unclear or confusing messages as bugs at
https://github.com/lcompilers/lpython/issues.
[ 52%] Generating test_builtin_len.o
[ 52%] Generating test_builtin_str.o
[ 52%] Built target test_builtin
certik commented 9 months ago

Yes. We are testing that pow(a, b) works here. We could disable the style suggestions for this particular test.

rebcabin commented 8 months ago

Seems like a good first issue for someone wanting to learn the test machinery.

certik commented 8 months ago

The idea from #2518 to use # noqa seems like a good idea, since there is prior art in Python to use this to silence warnings. We have to enhance the parser and then in AST->ASR use this information from AST to not give the warning. I think ASR doesn't need to know about this at all.

advikkabra commented 8 months ago

Sorry, I missed this comment before opening a PR. It can work as a temporary fix till the # noqa is implemented.