Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[vconone] Notice people to update year #14592

Open
dayo09 opened this issue Jan 24, 2025 · 0 comments
Open

[vconone] Notice people to update year #14592

dayo09 opened this issue Jan 24, 2025 · 0 comments

Comments

@dayo09
Copy link
Contributor

dayo09 commented Jan 24, 2025

What?

vconone is a library that helps printing out version information with copyright.
It's copyright year should be manually updated.
However, it's very hard to notice this job.

Therefore, I suggest comparing vconone year and system clock's year in unittest.

int get_current_year(void)
{
  auto now = std::chrono::system_clock::now();
  std::time_t current_time = std::chrono::system_clock::to_time_t(now);
  std::tm *timeinfo = std::localtime(&current_time);

  int year = timeinfo->tm_year + 1900;
  return year;
}
  • pros
    • We can precisely give out our copyright information.
  • cons
    • Unit test can result in failure (false-negative) if the machine's system clock is wrong.
    • On the first day of the year, we may confront CI failure without noticing.
      • Maybe we can make give it a term for 1 month or so. (ex. Fail the test if it's not fixed until Feb of the next year)

DRAFT: #14588

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant