{"id":13507598,"url":"https://github.com/parroty/excoveralls","last_synced_at":"2026-02-24T04:01:25.271Z","repository":{"id":10432044,"uuid":"12595601","full_name":"parroty/excoveralls","owner":"parroty","description":"Coverage report tool for Elixir with coveralls.io integration.","archived":false,"fork":false,"pushed_at":"2025-01-26T06:18:27.000Z","size":6895,"stargazers_count":861,"open_issues_count":75,"forks_count":183,"subscribers_count":9,"default_branch":"master","last_synced_at":"2026-02-10T19:18:31.740Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Elixir","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/parroty.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2013-09-04T16:09:36.000Z","updated_at":"2026-02-07T22:32:05.000Z","dependencies_parsed_at":"2023-02-13T22:16:00.969Z","dependency_job_id":"77f9cb86-c0e8-456e-92c8-a68b2809daf7","html_url":"https://github.com/parroty/excoveralls","commit_stats":{"total_commits":570,"total_committers":115,"mean_commits":4.956521739130435,"dds":"0.39473684210526316","last_synced_commit":"610c5382f0193a167ba7a1308e75d68e9eb51948"},"previous_names":[],"tags_count":92,"template":false,"template_full_name":null,"purl":"pkg:github/parroty/excoveralls","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/parroty%2Fexcoveralls","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/parroty%2Fexcoveralls/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/parroty%2Fexcoveralls/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/parroty%2Fexcoveralls/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/parroty","download_url":"https://codeload.github.com/parroty/excoveralls/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/parroty%2Fexcoveralls/sbom","scorecard":{"id":720853,"data":{"date":"2025-08-11","repo":{"name":"github.com/parroty/excoveralls","commit":"e9776c9a59c3067774f9af5e116ef76dbf8af6ab"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.9,"checks":[{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Code-Review","score":5,"reason":"Found 15/30 approved changesets -- score normalized to 5","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/tests.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/tests.yml:22: update your workflow using https://app.stepsecurity.io/secureworkflow/parroty/excoveralls/tests.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/tests.yml:23: update your workflow using https://app.stepsecurity.io/secureworkflow/parroty/excoveralls/tests.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/tests.yml:27: update your workflow using https://app.stepsecurity.io/secureworkflow/parroty/excoveralls/tests.yml/master?enable=pin","Info:   0 out of   2 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   1 third-party GitHubAction dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 16 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-22T11:19:10.348Z","repository_id":10432044,"created_at":"2025-08-22T11:19:10.348Z","updated_at":"2025-08-22T11:19:10.348Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29771038,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-24T04:01:02.180Z","status":"ssl_error","status_checked_at":"2026-02-24T03:59:49.901Z","response_time":75,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-01T02:00:36.787Z","updated_at":"2026-02-24T04:01:25.209Z","avatar_url":"https://github.com/parroty.png","language":"Elixir","funding_links":[],"categories":["Code Analysis"],"sub_categories":[],"readme":"ExCoveralls\n============\n\n[![Build Status](https://github.com/parroty/excoveralls/workflows/tests/badge.svg)](https://github.com/parroty/excoveralls/actions)\n[![Coverage Status](https://coveralls.io/repos/parroty/excoveralls/badge.svg?branch=master)](https://coveralls.io/r/parroty/excoveralls?branch=master)\n[![hex.pm version](https://img.shields.io/hexpm/v/excoveralls.svg)](https://hex.pm/packages/excoveralls)\n[![hex.pm downloads](https://img.shields.io/hexpm/dt/excoveralls.svg)](https://hex.pm/packages/excoveralls)\n[![hex.pm license](https://img.shields.io/hexpm/l/excoveralls.svg)](https://github.com/parroty/excoveralls/blob/master/LICENSE)\n[![Last Updated](https://img.shields.io/github/last-commit/parroty/excoveralls.svg)](https://github.com/parroty/excoveralls/commits/master)\n\nAn Elixir library that reports test coverage statistics, with the option to post to [coveralls.io](https://coveralls.io/) service.\nIt uses Erlang's [cover](http://www.erlang.org/doc/man/cover.html) to generate coverage information, and posts the test coverage results to coveralls.io through the JSON API.\n\nThe following are example projects.\n  - [coverage_sample](https://github.com/parroty/coverage_sample) is for Travis CI.\n  - [github_coverage_sample](https://github.com/mijailr/actions_sample) is for GitHub Actions.\n  - [circle_sample](https://github.com/parroty/circle_sample) is for CircleCI .\n  - [semaphore_sample](https://github.com/parroty/semaphore_sample) is for Semaphore CI.\n  - [excoveralls_umbrella](https://github.com/parroty/excoveralls_umbrella) is for umbrella project.\n  - [gitlab_sample](https://gitlab.com/parroty/gitlab_sample) is for GitLab CI (using GitLab CI feature instead of coveralls.io).\n  - [gitlab_parallel_sample](https://gitlab.com/parroty/excoveralls-demo) is for GitLab CI (with parallel option).\n  - [drone_sample](https://github.com/vorce/drone_sample) is for Drone CI.\n  - [excoveralls_post_sample](https://github.com/hirotnk/excoveralls_post_sample) is for coveralls.post usage example.\n\n# Settings\n### mix.exs\nAdd the following parameters.\n\n- `test_coverage: [tool: ExCoveralls]` for using ExCoveralls for coverage reporting.\n- `test_coverage: [tool: ExCoveralls, export: \"cov\"]` for exporting data to `cover/cov.coverdata`\n- `preferred_cli_env: [coveralls: :test]` for running `mix coveralls` in `:test` env by default\n    - It's an optional setting for skipping `MIX_ENV=test` part when executing `mix coveralls` tasks.\n- `test_coverage: [test_task: \"espec\"]` if you use Espec instead of default ExUnit.\n- `:excoveralls` in the deps function.\n- `Application.put_env(:excoveralls, :base_path, \"/bash/path\")` an optional config if you want to set the application root path explicitly. By default this is the directory that the mix.exs file is in.\n\n```elixir\ndef project do\n  [\n    app: :excoveralls,\n    version: \"1.0.0\",\n    elixir: \"~\u003e 1.0.0\",\n    deps: deps(),\n    test_coverage: [tool: ExCoveralls],\n    preferred_cli_env: [\n      coveralls: :test,\n      \"coveralls.detail\": :test,\n      \"coveralls.post\": :test,\n      \"coveralls.html\": :test,\n      \"coveralls.cobertura\": :test\n    ]\n    # if you want to use espec,\n    # test_coverage: [tool: ExCoveralls, test_task: \"espec\"]\n  ]\nend\n\ndefp deps do\n  [\n    {:excoveralls, \"~\u003e 0.18\", only: :test},\n  ]\nend\n```\n\n**Note on umbrella application**: If you want to use Excoveralls within an umbrella project, every `apps` must have\n`test_coverage: [tool: ExCoveralls]` in the `mix.exs` of each app.\n\n**Note:** If you're using earlier than `elixir v1.3`, `MIX_ENV=test` or `preferred_cli_env` may be required for running mix tasks. Refer to [PR#96](https://github.com/parroty/excoveralls/pull/96) for the details.\n\n# Usage\n## Mix Tasks\n- [ExCoveralls](#excoveralls)\n- [Settings](#settings)\n    - [mix.exs](#mixexs)\n- [Usage](#usage)\n  - [Mix Tasks](#mix-tasks)\n    - [[mix coveralls] Show coverage](#mix-coveralls-show-coverage)\n    - [[mix coveralls.travis] Post coverage from travis](#mix-coverallstravis-post-coverage-from-travis)\n      - [.travis.yml](#travisyml)\n    - [[mix coveralls.github] Post coverage from GitHub Actions](#mix-coverallsgithub-post-coverage-from-github-actions)\n      - [.github/workflows/example.yml](#githubworkflowsexampleyml)\n    - [[mix coveralls.circle] Post coverage from circle](#mix-coverallscircle-post-coverage-from-circle)\n      - [circle.yml](#circleyml)\n    - [[mix coveralls.semaphore] Post coverage from semaphore](#mix-coverallssemaphore-post-coverage-from-semaphore)\n      - [semaphore build instructions](#semaphore-build-instructions)\n    - [[mix coveralls.drone] Post coverage from drone](#mix-coverallsdrone-post-coverage-from-drone)\n      - [.drone.yml](#droneyml)\n    - [[mix coveralls.post] Post coverage from any host](#mix-coverallspost-post-coverage-from-any-host)\n    - [[mix coveralls.detail] Show coverage with detail](#mix-coverallsdetail-show-coverage-with-detail)\n    - [[mix coveralls.html] Show coverage as HTML report](#mix-coverallshtml-show-coverage-as-html-report)\n    - [[mix coveralls.json] Show coverage as JSON report](#mix-coverallsjson-show-coverage-as-json-report)\n    - [[mix coveralls.xml] Show coverage as XML report](#mix-coverallsxml-show-coverage-as-xml-report)\n    - [[mix coveralls.cobertura] Show coverage as Cobertura report](#mix-coverallscobertura-show-coverage-as-cobertura-report)\n    - [[mix coveralls.lcov] Show coverage as lcov report (Experimental)](#mix-coverallslcov-show-coverage-as-lcov-report-experimental)\n  - [coveralls.json](#coverallsjson)\n    - [Stop Words](#stop-words)\n    - [Exclude Files](#exclude-files)\n    - [Terminal Report Output](#terminal-report-output)\n    - [Coverage Options](#coverage-options)\n  - [Other Considerations](#other-considerations)\n    - [Ignore Lines](#ignore-lines)\n    - [Silence OTP Cover Warnings](#silence-otp-cover-warnings)\n    - [Merging Coverage Results](#merging-coverage-results)\n    - [Notes](#notes)\n    - [Todo](#todo)\n- [License](#license)\n\n### [mix coveralls] Show coverage\nRun the `MIX_ENV=test mix coveralls` command to show coverage information on localhost.\nThis task locally prints out the coverage information. It doesn't submit the results to the server.\n\n```Shell\n$ MIX_ENV=test mix coveralls\n...\n----------------\nCOV    FILE                                        LINES RELEVANT   MISSED\n100.0% lib/excoveralls/general.ex                     28        4        0\n 75.0% lib/excoveralls.ex                             54        8        2\n 94.7% lib/excoveralls/stats.ex                       70       19        1\n100.0% lib/excoveralls/poster.ex                      16        3        0\n 95.5% lib/excoveralls/local.ex                       79       22        1\n100.0% lib/excoveralls/travis.ex                      23        3        0\n100.0% lib/mix/tasks.ex                               44        8        0\n100.0% lib/excoveralls/cover.ex                       32        5        0\n[TOTAL]  94.4%\n----------------\n```\n\nSpecifying the `--help` option displays the options list for available tasks.\n\n```Shell\nUsage: mix coveralls \u003cOptions\u003e\n  Used to display coverage\n\n  \u003cOptions\u003e\n    -h (--help)         Show helps for excoveralls mix tasks\n\n    Common options across coveralls mix tasks\n\n    -o (--output-dir)   Write coverage information to output dir.\n    -u (--umbrella)     Show overall coverage for umbrella project.\n    -v (--verbose)      Show json string for posting.\n    --subdir            Git repo sub directory: This will be added to the the front of file path, use if your covered\n                        file paths reside within a subfolder of the git repo. Example: If your source file path is\n                        \"test.ex\", and your git repo root is one directory up making the file's relative path\n                        \"src/lib/test.ex\", then the sub directory should be: \"src/lib\" (from coveralls.io)\n    --rootdir           This will be stripped from the file path in order to resolve the relative path of this repo's\n                        files. It should be the path to your git repo's root on your CI build environment. This is not\n                        needed if your source file path is already relative. It's used to pull the source file from the\n                        github repo, so must be exact. Example: If your source file path is \"/home/runs/app/test.ex\",\n                        and your git repo resides in \"app\", then the root path should be: \"/home/runs/app/\" (from\n                        coveralls.io)\n    --flagname          Job flag name which will be shown in the Coveralls UI\n    --import-cover      Directory from where '.coverdata' files should be imported and their results added to the report.\n                        Coverdata is imported after tests are run.\n\nUsage: mix coveralls.detail [--filter file-name-pattern]\n  Used to display coverage with detail\n  [--filter file-name-pattern] can be used to limit the files to be displayed in detail.\n\nUsage: mix coveralls.travis [--pro]\n  Used to post coverage from Travis CI server.\n\nUsage: mix coveralls.github\n  Used to post coverage from [GitHub Actions](https://github.com/features/actions).\n\nUsage: mix coveralls.post \u003cOptions\u003e\n  Used to post coverage from local server using token.\n  The token should be specified in the argument or in COVERALLS_REPO_TOKEN\n  environment variable.\n\n  \u003cOptions\u003e\n    -t (--token)        Repository token ('REPO TOKEN' of coveralls.io)\n    -n (--name)         Service name ('VIA' column at coveralls.io page)\n    -b (--branch)       Branch name ('BRANCH' column at coveralls.io page)\n    -c (--committer)    Committer name ('COMMITTER' column at coveralls.io page)\n    -m (--message)      Commit message ('COMMIT' column at coveralls.io page)\n    -s (--sha)          Commit SHA (required when not using Travis)\n    --build             Service number ('BUILDS' column at coveralls.io page)\n    --parallel          coveralls.io 'parallel' option (See coveralls.io API Reference)\n```\n\n### [mix coveralls.travis] Post coverage from travis\nSpecify `mix coveralls.travis` as the build script in the `.travis.yml` and explicitly set the `MIX_ENV` environment to `TEST`.\nThis task submits the result to Coveralls when the build is executed on Travis CI.\n\n#### .travis.yml\n```yml\nlanguage: elixir\n\nelixir:\n  - 1.2.0\n\notp_release:\n  - 18.0\n\nenv:\n  - MIX_ENV=test\n\nscript: mix coveralls.travis\n```\n\nIf you're using [Travis Pro](https://travis-ci.com/) for a private\nproject, Use `coveralls.travis --pro` and ensure your coveralls.io\nrepo token is available via the `COVERALLS_REPO_TOKEN` environment\nvariable.\n\n### [mix coveralls.github] Post coverage from [GitHub Actions](https://github.com/features/actions)\nSpecify `mix coveralls.github` as the build script in the GitHub action YML file and explicitly set the `MIX_ENV` environment to `test` and add `GITHUB_TOKEN` with the value of `{{ secrets.GITHUB_TOKEN }}`, this is required because is used internally by coveralls.io to check the action and add statuses.\n\nThe value of `secrets.GITHUB_TOKEN` is added automatically inside every GitHub action, so you not need to assign that.\n\nThis task submits the result to Coveralls when the build is executed via GitHub actions and add statuses in the checks of github.\n\n#### .github/workflows/example.yml\n```yml\non: push\n\njobs:\n  test:\n    runs-on: ubuntu-latest\n    name: OTP ${{matrix.otp}} / Elixir ${{matrix.elixir}}\n    strategy:\n      matrix:\n        otp: [21.3.8.10, 22.1.7]\n        elixir: [1.8.2, 1.9.4]\n    env:\n      MIX_ENV: test\n      GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}\n    steps:\n      - uses: actions/checkout@v1.0.0\n      - uses: erlef/setup-beam@v1\n        with:\n          otp-version: ${{matrix.otp}}\n          elixir-version: ${{matrix.elixir}}\n      - run: mix deps.get\n      - run: mix coveralls.github\n```\n\n### [mix coveralls.circle] Post coverage from circle\nSpecify `mix coveralls.circle` in the `circle.yml`.\nThis task is for submitting the result to the coveralls server when Circle-CI build is executed.\n\n#### circle.yml\n```yml\ntest:\n  override:\n    - mix coveralls.circle\n```\n\nEnsure your coveralls.io repo token is available via the `COVERALLS_REPO_TOKEN` environment\nvariable.\n\n### [mix coveralls.semaphore] Post coverage from semaphore\nSpecify `mix coveralls.semaphore` in the build command prompt for instructions in semaphore.\nThis task is for submitting the result to the coveralls server when Semaphore-CI build is executed.\n\n#### semaphore build instructions\n```\nmix coveralls.semaphore\n```\n\nEnsure your coveralls.io repo token is available via the `COVERALLS_REPO_TOKEN` environment\nvariable.\n\n### [mix coveralls.drone] Post coverage from drone\nSpecify `mix coveralls.drone` in the `.drone.yml`.\nThis task is for submitting the result to the coveralls server when the Drone build is executed.\n\nYou will also need to add your coveralls repo token as a secret to the drone project:\n`drone secret add --repository=your-namespace/your-project --name=coveralls_repo_token --value=xyz`\n\n#### .drone.yml\n\n```yml\npipeline:\n  build:\n    secrets: [ coveralls_repo_token ]\n    commands:\n      - mix coveralls.drone\n```\n\n### [mix coveralls.post] Post coverage from any host\nAcquire the repository token of coveralls.io in advance, and run the `mix coveralls.post` command.\nIt is for submitting the result to coveralls server from any host.\n\nThe token can be specified as a mix task option (`--token`), or as an environment variable (`COVERALLS_REPO_TOKEN`).\n\n```Shell\nMIX_ENV=test mix coveralls.post --token [YOUR_TOKEN] --branch \"master\" --name \"local host\" --committer \"committer name\" --sha \"fd80a4c\" --message \"commit message\"\n....................................................................................................\n\nFinished in 6.3 seconds (0.7s on load, 5.6s on tests)\n100 tests, 0 failures\n\nRandomized with seed 800810\nSuccessfully uploaded the report to 'https://coveralls.io'.\n```\nFor the detailed option description, check [mix coveralls --help](#mix-coveralls-show-coverage) task.\n\n### [mix coveralls.detail] Show coverage with detail\nThis task displays coverage information at the source-code level with colored text.\nGreen indicates a tested line, and red indicates lines which are not tested.\nWhen reviewing many source files, pipe the output to the `less` program (with the `-R` option for color) to paginate the results.\n\n```Shell\n$ MIX_ENV=test mix coveralls.detail | less -R\n...\n----------------\nCOV    FILE                                        LINES RELEVANT   MISSED\n100.0% lib/excoveralls/general.ex                     28        4        0\n...\n[TOTAL]  94.4%\n\n--------lib/excoveralls.ex--------\ndefmodule ExCoveralls do\n  @moduledoc \"\"\"\n  Provides the entry point for coverage calculation and output.\n  This module method is called by Mix.Tasks.Test\n...\n```\n\nAlso, displayed source code can be filtered by specifying arguments (it will be matched against the FILE column value). The following example lists the source code only for general.ex.\n```Shell\n$ MIX_ENV=test mix coveralls.detail --filter general.ex\n...\n----------------\nCOV    FILE                                        LINES RELEVANT   MISSED\n100.0% lib/excoveralls/general.ex                     28        4        0\n...\n[TOTAL]  94.4%\n\n--------lib/excoveralls.ex--------\ndefmodule ExCoveralls do\n  @moduledoc \"\"\"\n  Provides the entry point for coverage calculation and output.\n  This module method is called by Mix.Tasks.Test\n...\n```\n\n### [mix coveralls.html] Show coverage as HTML report\nThis task displays coverage information at the source-code level formatted as an HTML page.\nThe report follows the format inspired by HTMLCov from the Mocha testing library in JS.\nOutput to the shell is the same as running the command `mix coveralls` (to suppress this output, add `\"print_summary\": false` to your project's `coveralls.json` file). In a similar manner to `mix coveralls.detail`, reported source code can be filtered by specifying arguments using the `--filter` flag.\n\n```Shell\n$ MIX_ENV=test mix coveralls.html\n```\n![HTML Report](./assets/html_report.jpg?raw=true \"HTML Report\")\n\nOutput reports are written to `cover/excoveralls.html` by default, however, the path can be specified by overwriting the `\"output_dir\"` coverage option.\nCustom reports can be created and utilized by defining `template_path` in `coveralls.json`. This directory should\ncontain an eex template named `coverage.html.eex`.\n\n### [mix coveralls.json] Show coverage as JSON report\nThis task displays coverage information at the source-code level formatted as a JSON document.\nThe report follows a format supported by several code coverage services, including Codecov and Code Climate.\nOutput to the shell is the same as running the command `mix coveralls` (to suppress this output, add `\"print_summary\": false` to your project's `coveralls.json` file). In a similar manner to `mix coveralls.detail`, reported source code can be filtered by specifying arguments using the `--filter` flag.\n\nUpload a coverage report to Codecov using their [bash uploader](https://docs.codecov.io/docs/about-the-codecov-bash-uploader)\nor to Code Climate using their [test-reporter](https://docs.codeclimate.com/docs/configuring-test-coverage).\n\nOutput reports are written to `cover/excoveralls.json` by default, however, the path can be specified by overwriting the `\"output_dir\"` coverage option. Additionally, the filename can be specified using the `export` option under `test_coverage` in your `mix.exs` i.e.\n\n`test_coverage: [tool: ExCoveralls, export: \"my_awesome_report\"]`\n\n*Note:* the .json extension will be added automatically to the export name. Defaults to `excoveralls` if not specified.\n\n### [mix coveralls.xml] Show coverage as XML report\nThis task displays coverage information at the source-code level formatted as a XML document.\nThe report follows a format supported by several code coverage services like SonarQube.\nOutput to the shell is the same as running the command `mix coveralls` (to suppress this output, add `\"print_summary\": false` to your project's `coveralls.json` file). In a similar manner to `mix coveralls.detail`, reported source code can be filtered by specifying arguments using the `--filter` flag.\n\nOutput reports are written to `cover/excoveralls.xml` by default, however, the path can be specified by overwriting the `\"output_dir\"` coverage option.\n\n### [mix coveralls.cobertura] Show coverage as Cobertura report\nThis task displays coverage information at the source-code level formatted as a [Cobertura](https://cobertura.github.io/cobertura/) document.\nThe report follows a format supported by [Gitlab](https://docs.gitlab.com/ee/ci/testing/test_coverage_visualization.html) code coverage visualization.\nOutput to the shell is the same as running the command `mix coveralls` (to suppress this output, add `\"print_summary\": false` to your project's `coveralls.json` file). In a similar manner to `mix coveralls.detail`, reported source code can be filtered by specifying arguments using the `--filter` flag.\n\nOutput reports are written to `cover/cobertura.xml` by default, however, the path can be specified by overwriting the `\"output_dir\"` coverage option.\n\n### [mix coveralls.lcov] Show coverage as lcov report (Experimental)\nThis task displays coverage information at the line level formatted as a lcov.\nThe report follows a format supported by several code coverage services like VSCode extension(`ryanluker.vscode-coverage-gutters`).\nOutput to the shell is the same as running the command `mix coveralls` (to suppress this output, add `\"print_summary\": false` to your project's `coveralls.json` file). In a similar manner to `mix coveralls.detail`, reported source code can be filtered by specifying arguments using the `--filter` flag.\n\nOutput reports are written to `cover/lcov.info` by default, however, the path can be specified by overwriting the `\"output_dir\"` coverage option.\n\n## coveralls.json\n`coveralls.json` provides settings for excoveralls.\n\nThe default `coveralls.json` file is stored in `deps/excoveralls/lib/conf`, and custom `coveralls.json` files can be placed in the mix project root. The custom definition is prioritized over the default one (if definitions in the custom file are not found, then the definitions in the default file are used).\n\n#### Stop Words\nStop words defined in `coveralls.json` will be excluded from the coverage calculation. Some kernel macros defined in Elixir are not considered \"covered\" by Erlang's cover library. It can be used for excluding these macros, or for any other reasons. The words are parsed as regular expression.\n\n#### Exclude Files\n\nIf you want to exclude/ignore files from the coverage calculation add the `skip_files` key in the `coveralls.json` file. `skip_files` takes an array of file paths, for example:\n\n```javascript\n{\n  \"skip_files\": [\n    \"folder_to_skip\",\n    \"folder/file_to_skip.ex\"\n  ]\n}\n```\n\nPath should contain a string that can be compiled to Elixir regex, you can test them running `Regex.compile(\"your_path\")` in your `iex` shell.\n\nNote that this doesn't work directly in an umbrella project. If you need to exclude files within an app, you should create a separate `coveralls.json` at the root of the app's folder and add a `skip_files` key to _that_ file. Paths should be relative to that file, not the umbrella project.\n\n#### Terminal Report Output\nWhen using in umbrella projects the default report may trim files names when viewing report in terminal.\n\nIf you want to change the column width used for file names add the `file_column_width` key to the `terminal_options` key in the `coveralls.json`, for example:\n\n```javascript\n{\n  \"terminal_options\": {\n    \"file_column_width\": 40\n  }\n}\n```\n\nIf you want to see only the total coverage without a table of each file, set the `print_files` option\nto `false`:\n\n```javascript\n{\n  \"terminal_options\": {\n    \"print_files\": false\n  }\n}\n```\n\n#### Coverage Options\n- `treat_no_relevant_lines_as_covered`\n  - By default, coverage for [files with no relevant lines] are displayed as 0% for aligning with coveralls.io behavior. But, if `treat_no_relevant_lines_as_covered` is set to `true`, it will be displayed as 100%.\n- `output_dir`\n  - The directory which the HTML report will output to. Defaulted to `cover/`.\n- `template_path`\n  - A custom path for html reports. This defaults to the htmlcov report in the excoveralls lib.\n- `minimum_coverage`\n  - When set to a number greater than 0, this setting causes the `mix coveralls` and `mix coveralls.html` tasks to exit with a status code of 1 if test coverage falls below the specified threshold (defaults to 0). This is useful to interrupt CI pipelines with strict code coverage rules. Should be expressed as a number between 0 and 100 signifying the minimum percentage of lines covered.\n- `html_filter_full_covered`\n  - A boolean, when `true` files with 100% coverage are not shown in the HTML report. Default to `false`.\n- `floor_coverage`\n  - A boolean, when `false` coverage values are ceiled instead of floored, this means that a project with some lines\n    that are not covered can still have a total 100% coverage. Default to `true`.\n\nExample configuration file:\n\n```javascript\n{\n  \"default_stop_words\": [\n    \"defmodule\",\n    \"defrecord\",\n    \"defimpl\",\n    \"def.+(.+\\/\\/.+).+do\"\n  ],\n\n  \"custom_stop_words\": [\n  ],\n\n  \"coverage_options\": {\n    \"treat_no_relevant_lines_as_covered\": true,\n    \"output_dir\": \"cover/\",\n    \"template_path\": \"custom/path/to/template/\",\n    \"minimum_coverage\": 90,\n    \"xml_base_dir\": \"custom/path/for/xml/reports/\",\n    \"html_filter_full_covered\": true\n  }\n}\n```\n\n## Other Considerations\n\n### Ignore Lines\n\nUse comments `coveralls-ignore-start` and `coveralls-ignore-stop` to ignore certain lines from code coverage calculation.\n\n```elixir\ndefmodule MyModule do\n  def covered do\n  end\n\n  # coveralls-ignore-start\n  def ignored do\n  end\n  # coveralls-ignore-stop\nend\n```\n\nUse comment `coveralls-ignore-next-line` to ignore only the next line.\n\n```elixir\ndefmodule MyModule do\n  def covered do\n    # coveralls-ignore-next-line\n    \"ignored\"\n    \"covered\"\n  end\nend\n```\n\n### Silence OTP Cover Warnings\nTo remove OTP warnings about modules or specific logging, you can copy the `cover.erl` file under `src/` of your Elixir project and modify it to remove the warnings, as a tentative solution.\n\n- Remove the 2 lines below to remove the \"WARNING: Module already imported from ...\" log\nhttps://github.com/erlang/otp/blob/131398b54cca5f1ae95ed268274936d2efde8c39/lib/tools/src/cover.erl#L1553-L1554\n\n- If you do not want the imported info cluttering your test output, replace the function in https://github.com/erlang/otp/blob/131398b54cca5f1ae95ed268274936d2efde8c39/lib/tools/src/cover.erl#L1520-L1525 with\n```\nimported_info(_Text,_Module,_Imported) -\u003e\n    ok.\n```\n\n### Merging Coverage Results\n\nExCoveralls can include `.coverdata` files in the result of the current test run through the `--import-cover` flag. This can be used to include coverage data from partitioned tests or integration tests that may run in a subprocess, for instance.\n\nCoverage data is generated when running `mix test --cover`, optionally with the `--export-coverage` flag to specify an output name.\n\n```shell\n$ mix test --only integration --cover --export-coverage integration-coverage\nExcluding tags: [:test]\nIncluding tags: [:integration]\n... test run omitted ...\n# Coverage data written to cover/integration-coverage.coverdata\n\n# Report coverage, do not run integration tests\n$ mix coveralls --exclude integration\nExcluding tags: [:integration]\n... test run omitted ...\n\n----------------\nCOV    FILE                                        LINES RELEVANT   MISSED\n...\n[TOTAL]  80.2% # \u003c-- This result does not include coverage from integration tests\n----------------\n\n# Report coverage, do not run integration tests, but include previously written coverdata\n$ mix coveralls --exclude integration --import-cover cover\nExcluding tags: [:integration]\n... test run omitted ...\n\n----------------\nCOV    FILE                                        LINES RELEVANT   MISSED\n...\n[TOTAL]  95.3% # \u003c-- This result now includes coverage from integration tests\n----------------\n```\n\nCoverage data is imported after tests are run.\n\nSee the `mix test` [Coverage documentation](https://hexdocs.pm/mix/Mix.Tasks.Test.html#module-coverage) for more information on `.coverdata`.\n\n### Configuring HTTP Options in ExCoveralls\n\nYou can customize the HTTP options used by [`:httpc`](https://www.erlang.org/doc/man/httpc.html) when posting results. The example below shows how to specify a custom `cacertfile`:\n\n```elixir\nconfig :excoveralls,\n  http_options: [\n    timeout: 10_000,\n    ssl: [\n      # Refer to the secure coding guide:\n      # https://erlef.github.io/security-wg/secure_coding_and_deployment_hardening/inets\n      verify: :verify_peer,\n      depth: 2,\n      customize_hostname_check: [\n        match_fun: :public_key.pkix_verify_hostname_match_fun(:https)\n      ],\n      cacertfile: to_charlist(System.fetch_env!(\"TEST_COVERAGE_CACERTFILE\"))\n    ]\n```\n\nBy default, ExCoveralls uses the `cacertfile` from [`castore`](https://hexdocs.pm/castore/api-reference.html) when the dependency is installed. If it's not available and you're running Erlang `25` or later, the system will attempt to use the OS certificates via [`:public_key.cacerts_load/0`](https://www.erlang.org/doc/man/public_key.html#cacerts_load-0).\n\n### Notes\n- If mock library is used, it will show some warnings during execution.\n    - https://github.com/eproxus/meck/pull/17\n- In case Erlang clashes at `mix coveralls`, executing `mix test` in advance might avoid the error.\n- When erlang version 17.3 is used, an error message `(MatchError) no match of right hand side value: \"\"` can be shown. Refer to issue #14 for the details.\n    - https://github.com/parroty/excoveralls/issues/14\n\n### Todo\n- It might not work well on projects which handle multiple project (Mix.Project) files.\n    - Needs improvement on file-path handling.\n\n# License\n\nThis source code is licensed under the MIT license. Copyright (c) 2013-present, parroty.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fparroty%2Fexcoveralls","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fparroty%2Fexcoveralls","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fparroty%2Fexcoveralls/lists"}