Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
614efc5a
Commit
614efc5a
authored
Nov 19, 2021
by
Peter Leitzen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Parallelize `rake gettext:lint` to improve runtime
parent
4e36caa5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
1 deletion
+4
-1
lib/tasks/gettext.rake
lib/tasks/gettext.rake
+4
-1
No files found.
lib/tasks/gettext.rake
View file @
614efc5a
...
@@ -58,6 +58,7 @@ namespace :gettext do
...
@@ -58,6 +58,7 @@ namespace :gettext do
task
lint: :environment
do
task
lint: :environment
do
require
'simple_po_parser'
require
'simple_po_parser'
require
'gitlab/utils'
require
'gitlab/utils'
require
'parallel'
FastGettext
.
silence_errors
FastGettext
.
silence_errors
files
=
Dir
.
glob
(
Rails
.
root
.
join
(
'locale/*/gitlab.po'
))
files
=
Dir
.
glob
(
Rails
.
root
.
join
(
'locale/*/gitlab.po'
))
...
@@ -70,7 +71,9 @@ namespace :gettext do
...
@@ -70,7 +71,9 @@ namespace :gettext do
linters
.
unshift
(
Gitlab
::
I18n
::
PoLinter
.
new
(
po_path:
pot_file_path
))
linters
.
unshift
(
Gitlab
::
I18n
::
PoLinter
.
new
(
po_path:
pot_file_path
))
failed_linters
=
linters
.
select
{
|
linter
|
linter
.
errors
.
any?
}
failed_linters
=
Parallel
.
map
(
linters
,
progress:
'Linting po files'
)
{
|
linter
|
linter
if
linter
.
errors
.
any?
}
.
compact
if
failed_linters
.
empty?
if
failed_linters
.
empty?
puts
'All PO files are valid.'
puts
'All PO files are valid.'
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment