代码会说话之一个脚本帮你检查项目 996 状态

Mark24
·

马上要进新组了,一看他们的仓库眼泪留下来

项目地址 Mark24Code/check_996


Check 996

帮助你检查项目 996 状态. 😎

Usage: check_996.rb [options]
    -s, --start WORK_START_TIME      start job time e.g. 10:00:00
    -e, --end WORK_END_TIME          end job time  e.g. 18:00:00
    -g, --git-log GIT_LOG_CMD        use git log command, default is `git log --all`
    -f, --filter FILTER              time range filter  e.g. last_[day|week|month|year] last_5_[day|week|month|year]   '2022-01-01 08:10:00,2022-10-01 08:10:00'
    -v, --version                    version

使用说明

依赖项目

  • 确保你有 ruby 2.7+
  • 如果有 curl 可以帮助远程执行

步骤一:

终端,进入你想统计的 git 仓库

cd </path/to/your/git_repo>

步骤二

终端使用如下命令

  • curl support
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Mark24Code/check_996/main/check_996.rb)"

更多建议:

脚本下载在本地可以直接使用参数,远程执行也可以使用参数,使用 -- 分隔参数:

 <script>  -- -s 10:30 -e 19:30

例如自定义理论上的工作时间:

ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Mark24Code/check_996/main/check_996.rb)" -- -s 10:30 -e 19:30

额外参数说明

过滤器

如果我不想对全量 git 进行计算,只关心一段时间,可以使用 -f 参数

提供人性化语义化参数

-f, --filter FILTER              time range filter  e.g. last_[day|week|month|year] last_5_[day|week|month|year]   '2022-01-01 08:10:00,2022-10-01 08:10:00'

例如

-f last_week
-f last_month
-f last_25_days
-f '2022-01-01 08:10:00,2022-10-01 08:10:00'

统计方式

默认使用 git log --all 会在当前分支进入可触达分支,也可以自己定义, 但是检查必须是 git log xxxx

-g, --git-log GIT_LOG_CMD        use git log command, default is `git log --all`
社区准则 博客 联系 社区 状态
主题