Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding support for Elixir pre-commits #292

Merged
merged 7 commits into from
Jun 29, 2023

Conversation

atavistock
Copy link
Contributor

@atavistock atavistock commented Apr 27, 2023

Adds support for common Elixir precommit hooks

  • Built-in syntax formatter
  • Built-in test runner
  • Static code analysis via Credo
  • Static code analysis via Dialyzer

Two of these are built-in to Elixir itself but two are added via a mix file. I've added both credo and dialyzer by hand to my environment using Elixir mix, and I'm not sure if theres a reasonable way to check for them.

modules/hooks.nix Outdated Show resolved Hide resolved
@domenkozar
Copy link
Member

@atavistock do you want to fix this PR?

@atavistock
Copy link
Contributor Author

atavistock commented Jun 6, 2023 via email

@atavistock
Copy link
Contributor Author

@domenkozar Fixed the typos and updated to match current master branch

@atavistock
Copy link
Contributor Author

Looks like a close bracket was lost, now fixed.

@atavistock
Copy link
Contributor Author

atavistock commented Jun 20, 2023

Okay, only on the OS/X tests its getting:

  Could not set environment: 150: Operation not permitted while System Integrity Protection is engaged
  Error: Process completed with exit code 150.

This far beyond my OS/X and Nix knowledge. Is this something anyone else has seen before? I will try to dig into this but I'm not sure I will be able to in a reasonable time.

@domenkozar
Copy link
Member

You'll need to rebase on top of master.

@domenkozar
Copy link
Member

Ping :)

@domenkozar domenkozar merged commit 5843cf0 into cachix:master Jun 29, 2023
@nifoc
Copy link

nifoc commented Jul 17, 2023

As far as I can tell, pre-commit doesn't understand elixir as a type tag. I get the following error:

Type tag 'elixir' is not recognized.  Try upgrading identify and pre-commit?

Checking the identify repository, it indeed looks like elixir is not supported at the moment.

How is this supposed to work? Can you somehow configure type tags manually? (Couldn't find anything obvious on pre-commit.com)

@nifoc
Copy link

nifoc commented Jul 23, 2023

Submitted a PR to identify and the above error is now gone.

However, nix flake check does not work, because:

  • Dependencies are not copied into the drv (because they're part of the .gitignore)
       > Shall I install Hex? (if running non-interactively, use "mix local.hex --force") [Yn] ** (Mix) Could not find an SCM for dependency :ecto from Pan.MixProject
       > Could not find Hex, which is needed to build dependency :ecto

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants