Skip to content

cleanup: Engine._LOG_MAX_LINES is defined once and read nowhere #80

Description

@LeyckerS

This issue is reserved for someone who has never had a pull request merged on GitHub before. If you have contributed before, please leave it — the roadmap has plenty of other work.

You are deleting one line. The point is to walk you through the process once.

The problem

moon_engine.py defines a constant on the Engine class:

    _LOG_MAX_LINES = 2000

Nothing reads it. Searching the whole repository — every .py and every .js file — finds exactly one occurrence, which is the definition itself.

It is left over from an earlier design. The log ring is bounded by collections.deque(maxlen=6000) in __init__, which is the limit that actually applies, so this constant is not even the real number. Leaving it there suggests a cap that does not exist.

The change

File: moon_engine.py

Delete the line _LOG_MAX_LINES = 2000 and the blank line that follows it, so that _get() is followed directly by log().

Please do not reformat or touch anything else in the file — a pull request that changes things the issue did not ask for gets sent back, even when the extra changes are harmless.

How to check you were right

Before you delete it, confirm for yourself that nothing uses it. From the repository folder:

grep -rn "_LOG_MAX_LINES" .

You should see exactly one line of output. Say in your pull request that you ran this and what it showed — checking the claim rather than trusting the issue is exactly the habit that matters here, and it has caught mistakes in my own issues before.

How to do it, step by step

  1. Click Fork at the top right of this repository.
  2. In your copy, open moon_engine.py and click the pencil icon to edit.
  3. Find _LOG_MAX_LINES = 2000, delete that line and the empty line under it.
  4. Under Commit changes, write something like cleanup: drop the unused _LOG_MAX_LINES constant, then Propose changes.
  5. Click Create pull request, write Closes #80, and submit.

CI will byte-compile the file and run the test suite automatically. If something goes red, say so here — that is normal and it is not a problem.

Before you start

Comment here saying you are taking it. Then go ahead; no need to wait for a reply.

Metadata

Metadata

Assignees

Labels

first-timers-onlyReserved for someone who has never contributed to open source beforehelp wantedExtra attention is needed

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions