• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

elixir-gettext / gettext / d27c40cda6726d556247cfa226805c16d994d23f-PR-437
93%
main: 93%

Build:
Build:
LAST BUILD BRANCH: extract-from-attributes
DEFAULT BRANCH: main
Ran 16 Jun 2026 05:09AM UTC
Jobs 1
Files 18
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

16 Jun 2026 05:09AM UTC coverage: 92.848% (+0.2%) from 92.693%
d27c40cda6726d556247cfa226805c16d994d23f-PR-437

Pull #437

github

oliver-kriska
Add recompile-free extraction via persisted module attributes

mix gettext.extract discovers messages by force-recompiling the whole
project, because extraction happens during gettext macro expansion and
the results only live in the extractor agent for that single
compilation. On large projects this dominates extraction time.

Implement the design proposed by @maennchen in #373: during normal
compilation, when the current Mix environment is included in the new
:extraction_environments configuration (default [:dev]), the gettext
macros persist each message into an accumulated, persisted
@__gettext_messages__ attribute of the calling module, and backends
persist a @__gettext_backend_module__ marker. A new experimental
--from-attributes flag on mix gettext.extract runs a normal incremental
compile, reads the persisted entries back from the compiled BEAM files
with :beam_lib (without loading modules), feeds them into the existing
extractor agent, and reuses the unchanged Gettext.Extractor.pot_files/2
merge logic.

Staleness needs no bookkeeping: changed files are recompiled by the
incremental compile and get fresh attributes, and deleted files' beams
are pruned by the compiler. --check-up-to-date composes with the new
flag and gets the same speedup. Environments not listed in
:extraction_environments (such as :prod) persist nothing, so release
artifacts are unaffected. If the scan finds no persisted messages or
backends at all, the task raises with instructions instead of silently
producing empty output. Malformed attribute entries are skipped rather
than aborting the scan.

The force-recompile path is untouched and remains the default. Old-path
and new-path POT output is byte-identical, covered by tests including
macro-generated messages, plural/context/comment/noop variants,
_with_backend macros, cross-module reference merging, custom :priv
backends, and umbrella projects.
Pull Request #437: Add recompile-free extraction via persisted module attributes

61 of 65 new or added lines in 4 files covered. (93.85%)

6 existing lines in 1 file now uncovered.

701 of 755 relevant lines covered (92.85%)

32.82 hits per line

Uncovered Changes

Lines Coverage ∆ File
4
92.97
-1.65% lib/gettext/extractor.ex

Coverage Regressions

Lines Coverage ∆ File
6
92.97
-1.65% lib/gettext/extractor.ex
Jobs
ID Job ID Ran Files Coverage
1 d27c40cda6726d556247cfa226805c16d994d23f-PR-437.1 16 Jun 2026 05:09AM UTC 18
92.85
GitHub Action Run
Source Files on build d27c40cda6726d556247cfa226805c16d994d23f-PR-437
  • Tree
  • List 18
  • Changed 4
  • Source Changed 0
  • Coverage Changed 4
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Pull Request #437
  • PR Base - main (#3CF00655...)
  • Delete
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc