Correct script for listing of cop rules with offenses
The intent of `:\d+\d+:` is probably to match `:35:7` from a log line like below: ``` lib/backup/tasks/task.rb:35:7: C: [Correctable] Style/EndlessMethod: Avoid endless method definitions. ``` Take the [raw_job_output.log] from https://gitlab.com/gitlab-org/gitlab/-/merge_requests/179410 for example: Before fix (incorrect): ``` $ grep --perl-regexp -o ":\d+\d+: \w: \[\S+\] ([\w/]+)" raw_job_output.log | awk '{print $4}' | sort | uniq -c 10 Layout/TrailingWhitespace 2 Style/SuperArguments ``` After fix (correct): ``` $ grep --perl-regexp -o ":\d+:\d+: \w: \[\S+\] ([\w/]+)" raw_job_output.log | awk '{print $4}' | sort | uniq -c 30 Layout/EmptyLinesAroundMethodBody 10 Layout/TrailingWhitespace 70 Style/EndlessMethod 14 Style/SuperArguments ``` [raw_job_output.log]: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/179410#raw_job_outputlog
想要评论请 注册 或 登录