X2Cscope / pyx2cscope

python implementation of x2cscope
Other
1 stars 0 forks source link

TODO list for Team beta testing preparation #21

Closed MarkWendler closed 2 months ago

MarkWendler commented 4 months ago

Update links:

Update doc:

edras commented 4 months ago

Here are the initial tasks to fix documentation at https://github.com/X2Cscope/pyx2cscope/tree/fix-documentation branch. I replaced on that branch black and isort for ruff. Ruff is now checking docstring, linter, imports and docstring style. I included/replaced it on the requirements and quality files as well on the workflow at github actions (for this branch only).

To use it type on the terminal at the root folder: ruff check .

and to auto fix what is possible to auto fix: ruff check . --fix

If you run this command, there are actually 183 errors. I fixed already many one to reach this number :) My suggestion by now would be to split documentation fix task force as:

@edras /tests @MarkWendler variable.py and x2cscope.py @yashagarwal-314 /parser and /gui

we will still have examples folder and mchplnet submodule. I would remove mchplnet from ruff test on pyX2CScope once it is a submodule. In this case, only the examples folder will be missing. we may discuss this after this first task is done.

X2Cscope commented 3 months ago

We need to document subclasses and overrides as well: PEP 257:

The docstring for a class should summarize its behavior and list the public methods and instance variables. If the class is intended to be subclassed, and has an additional interface for subclasses, this interface should be listed separately (in the docstring). The class constructor should be documented in the docstring for its init method. Individual methods should be documented by their own docstring.

If a class subclasses another class and its behavior is mostly inherited from that class, its docstring should mention this and summarize the differences. Use the verb "override" to indicate that a subclass method replaces a superclass method and does not call the superclass method; use the verb "extend" to indicate that a subclass method calls the superclass method (in addition to its own behavior).

X2Cscope commented 3 months ago

My par tis done, but I hit some problems I could not work around.

"pyx2cscope\xc2scope.py:161:9: PLR0913 Too many arguments in function definition (6 > 5)" This requires some restructuring the implementation of scope functionalities. Also the documentation of the scope functionalities are very weak. Actually these would be the most important. Before I fix it we need to sync to agree on the proper way.

image

edras commented 3 months ago

My par tis done, but I hit some problems I could not work around.

"pyx2cscope\xc2scope.py:161:9: PLR0913 Too many arguments in function definition (6 > 5)" This requires some restructuring the implementation of scope functionalities. Also the documentation of the scope functionalities are very weak. Actually these would be the most important. Before I fix it we need to sync to agree on the proper way.

image

Specifically about this function, I would place a # noqa: PLR0913. This method needs to have the self argument, but this argument does not belong to the user interface. Other approach would be to create a dataclass for these arguments and pass like an object of type "TriggerSettings".