On 12/8/22 13:45, Scott Kostyshak wrote:
pylint claims that our lyx_2_4.py has several unused variables. I'm not
familiar with pylint so I don't know if it commonly gives false
positives.

Does anyone want to take a look to see if any of the unused variables
suggest a bug?

It so easy to do this in Python, since you dot't normally get these kinds of warnings.


Perhaps it doesn't make sense to clean up lyx_2_4.py (except for looking
for bugs), but what would you think about adding an agreed-upon set of
pylint warnings to our test suite for lyx_2_5.py?

I don't think it could hurt.


Here is the list of unused-variable warnings:

$ pylint lyx_2_4.py | grep unused-variable
lyx_2_4.py:364:16: W0612: Unused variable 'xval2' (unused-variable)
lyx_2_4.py:561:8: W0612: Unused variable 'preamble' (unused-variable)

Removed those.


lyx_2_4.py:836:16: W0612: Unused variable 'k' (unused-variable)

This is a weird one. Jürgen should have a look. Probably it's harmless. Basically, it's the loop variable, and it's not actually being used in the loop, just to control the number of iterations. So it might just be a style thing more than a substance thing.


lyx_2_4.py:846:12: W0612: Unused variable 'lines' (unused-variable)
lyx_2_4.py:847:16: W0612: Unused variable 'row' (unused-variable)

Same oddity here.


lyx_2_4.py:966:4: W0612: Unused variable 'bibresources' (unused-variable)
lyx_2_4.py:1645:4: W0612: Unused variable 'bibresources' (unused-variable)
lyx_2_4.py:2718:4: W0612: Unused variable 'ft' (unused-variable)
lyx_2_4.py:2731:4: W0612: Unused variable 'ft' (unused-variable)

Removed.


lyx_2_4.py:2790:4: W0612: Unused variable 'NonTeXFonts' (unused-variable)

This one looks suspicious to me. Günter?


lyx_2_4.py:3069:20: W0612: Unused variable 'ttopts' (unused-variable)

This one looks VERY suspcious. Jürgen?


lyx_2_4.py:3313:8: W0612: Unused variable 'num' (unused-variable)
lyx_2_4.py:3796:8: W0612: Unused variable 'j' (unused-variable)
lyx_2_4.py:3877:8: W0612: Unused variable 'j' (unused-variable)
lyx_2_4.py:3905:8: W0612: Unused variable 'preamble' (unused-variable)
lyx_2_4.py:4130:16: W0612: Unused variable 'k' (unused-variable)

Same oddity mentioned above.


lyx_2_4.py:4142:12: W0612: Unused variable 'lines' (unused-variable)

Removed.


lyx_2_4.py:4143:16: W0612: Unused variable 'row' (unused-variable)
lyx_2_4.py:4303:12: W0612: Unused variable 'lines' (unused-variable)
lyx_2_4.py:4304:16: W0612: Unused variable 'row' (unused-variable)
lyx_2_4.py:4305:20: W0612: Unused variable 'col' (unused-variable)

All of these are the same oddity mentioned above.


lyx_2_4.py:4559:4: W0612: Unused variable 'plural' (unused-variable)
lyx_2_4.py:4559:13: W0612: Unused variable 'caps' (unused-variable)
lyx_2_4.py:4559:20: W0612: Unused variable 'noprefix' (unused-variable)

Fixed.


lyx_2_4.py:4632:8: W0612: Unused variable 'start' (unused-variable)

Removed.

Riki


--
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel

Reply via email to