cr_checker should reject copyright year ranges

Open Beginner friendly
#82 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
72/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
python
Domain
tooling

Research direction

Start with the cr_checker copyright check in this repo, the code behind the copyright pre-commit hook, and find where it accepts a year range. The reproduction uses docs/requirements/stakeholder/index.rst in eclipse-score/score, which can serve as a test input. Done when a header with 2024-2026 is rejected, a single year such as 2024 still passes, and the existing tests pass.

Written by the indexing model from the issue text.

Description

S-CORE copyright headers use a single four-digit year. The current cr_checker accepts a fully written year range such as 2024-2026, so the copyright hook lets that format through.

The Eclipse Project Handbook addresses year ranges directly. It says, “Specify the year that the content was initially created in the copyright statement.” The handbook defines {year} in the header template as the year of creation. Legal Documentation FAQ, questions 2 and 3 · Copyright Headers

Reproduction
  1. Configure the copyright pre-commit hook from eclipse-score/tools at commit 407601e138e2dcda317f8cfbd8026a71d762ee8c.
  2. In eclipse-score/score, use Copyright (c) 2024-2026 Contributors to the Eclipse Foundation in the otherwise valid RST header of docs/requirements/stakeholder/index.rst.
  3. Run pre-commit run copyright --files docs/requirements/stakeholder/index.rst.

The hook reports Passed and leaves the range in place.

Expected behavior

Flag year ranges such as 2024-2026 as invalid. A single four-digit year such as 2024 should pass.

The Score-side correction uses the single year 2024. eclipse-score/score#3528

Dominant language
Python
Stars
1
Forks
5
Avg merge
23h 38m
Merged PRs (30d)
13

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from eclipse-score/tools

All issues in eclipse-score/tools

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.