hauleth

hauleth

MixMachine - machine-readable output for Mix

Recently I have published new version of mix_unused and now there is new project that improves compilation of Elixir projects.

https://github.com/hauleth/mix_machine

This is a library that provides new Mix command - mix compile.machine that, in addition to compiling your project as it was done by “regular” mix compile, will produce report file (by default report.json) that will contain report in one of the two supported formats:

  • SARIF - this is default
  • CodeClimate

This is useful, as SARIF is format used by GitHub Code Scanning feature, which will produce reports available from the GitHub “Security” tab. CodeClimate is format used by GitLab for similar purposes.

This works by utilising the diagnostics produced by different compilers, so as long as your additional compilers support this feature, these will be included in these reports. Tools that for sure support this feature are @sasajuric boundary and mentioned earlier mix_unused.


Disclaimer - I haven’t yet tested the GitLab, and I do not know how to setup automatic CI for that, as GitLab do not support CI pipelines for remote projects in their public service and I do not want to pay for the self-hosted version to just test that. I will test it in my side projects hosted on the GitLab, but for now there is no automatic testing. So unfortunately GitLab support currently is a little bit second class.

Most Liked

axelson

axelson

Scenic Core Team

Created a PR!
https://github.com/hauleth/mix_machine/pull/10

axelson

axelson

Scenic Core Team

This looks great!

Do you have an example of how to use this with GitHub Actions?

hauleth

hauleth

Yeah, sure. I am still working on the documentation (PRs are welcome). The example is exactly in the same repo (just not properly documented) as it is used for testing whether the SARIF output is properly ingested by GitHub. Whole process is as simple as replacing mix compile with mix compile.machine and then using github/codeql-action/upload-sarif@v1:

    - name: Compile
      run: mix compile.machine
    - uses: github/codeql-action/upload-sarif@v1
      with:
        sarif_file: report.json

https://github.com/hauleth/mix_machine/blob/3901b6b82dd33e6f09912a0de6f8854933878ec5/.github/workflows/elixir.yml#L37-L68

Where Next?

Popular in Announcing Top

Crowdhailer
The latest release of Ace (0.10.0) includes serving content over HTTP/2. I have started writing a webserver to teach my self more about...
New
dbern
I’m excited to announce that TaxJar has developed and open-sourced DateTimeParser. We developed it because we found a need to parse user ...
New
msaraiva
Surface is an experimental library built on top of Phoenix LiveView and its new LiveComponent API that aims to provide a more declarative...
564 43806 214
New
grych
Hi folks, Few months ago I have announced the proof-of-concept of the library to manipulate the browsers DOM objects directly from Elixi...
639 52774 488
New
Qqwy
Hello everyone, I wrote a small library today called MapDiff. It returns a map listing the (smallest amount of) changes to get from map...
New
KronicDeth
Elixir plugin for JetBrain’s IntelliJ Platform (including Rubymine) This is a plugin that adds support for Elixir to JetBrains IntelliJ...
289 36432 110
New
archan937
It is a well-know topic within the Elixir community: “To mock or not to mock? :)” Every alchemist probably has his / her own opinion con...
New
woylie
I released Doggo, a collection of unstyled Phoenix components. https://github.com/woylie/doggo Features Unstyled Phoenix components....
New
mplatts
With HEEX released we decided to start a components library using Tailwind CSS - check it out here: Petal Components. We also have a boi...
New
trisolaran
Hi! :waving_hand: I would like to present LiveSelect, a little library that I wrote to easily add a dynamic selection input to your LV f...
198 10978 107
New

Other popular topics Top

malloryerik
Hi, this is for people who, like me, have had some friction using .html.heex templates in VSCode. The solution seems to be, in a hyphena...
New
TunkShif
This post is an instruction guide to help you setup your Neovim for Elixir development from scratch. It includes general information on h...
274 42158 114
New
9mm
I am constructing a JSON object (map) and I need to conditionally set a field. I’m trying to write proper elixir-way code… and I’m at a l...
New
AstonJ
Posting this to see if we can make things easier for people to get into Neovim. If you use Neovim and have a favourite distro please let ...
New
baxterw3b
Hi guys, i’m new in the Elixir world, and i have to say, that i love it! i’m having some problem to understand anonymous functions with ...
New
skosch
To my knowledge, put_in, Map.update etc. all have the one limitation of not automatically creating intermediate keys when needed (for exa...
New
jay1
Why is it that the mnesia database isn’t the most preferred database for use in Elixir/Phoenix?
New
alice
Hey, Just curious what are the main benefits of Elixir compared to Clojure? When is Elixir more useful than Clojure and vice versa? Th...
New
SoCreat
i’m a new one to elixir which editor can i use vs code? or atom? Thanks! :smiley:
New
ashish173
I am using Ecto timestamps with postgres, I can see the timestamps() use the :naive_dateime but for my use case I wanted to store the ti...
New

We're in Beta

About us Mission Statement