Page MenuHomePhabricator

Add linting and unit testing support for Elixir
Needs ReviewPublic

Authored by tolbrino on Nov 7 2015, 9:17 AM.
Referenced Files
F14052113: D14430.diff
Fri, Nov 15, 6:37 AM
F14039382: D14430.diff
Mon, Nov 11, 5:20 AM
F14029655: D14430.id35031.diff
Fri, Nov 8, 8:52 PM
F14029653: D14430.id35012.diff
Fri, Nov 8, 8:52 PM
F14029652: D14430.id35011.diff
Fri, Nov 8, 8:52 PM
F14029651: D14430.id34869.diff
Fri, Nov 8, 8:52 PM
F14029650: D14430.id34866.diff
Fri, Nov 8, 8:52 PM
F14029649: D14430.id.diff
Fri, Nov 8, 8:52 PM
Subscribers

Details

Summary

The unit engine requires the use of the junit_formatter to be configured properly.

The linter depends on the development version of dogma

Test Plan
  1. Configure "unit.engine": "ExunitTestEngine" in .arcconfig
  2. Configure "type": "elixirdogma" as a linter in .arclint
  3. Configure ExUnit to use the JUnitFormatter as documented at https://github.com/victorolinasc/junit-formatter

Diff Detail

Repository
rARC Arcanist
Branch
tb/elixir-lint-unit
Lint
Lint Passed
Unit
Tests Passed
Build Status
Buildable 8822
Build 10293: arc lint + arc unit

Event Timeline

tolbrino retitled this revision from to Add linting and unit testing support for Elixir.
tolbrino updated this object.
tolbrino edited the test plan for this revision. (Show Details)
tolbrino edited edge metadata.

Fixed local lessc unit test issue

I should note that I'm not used to working with PHP, so feel free to criticize. I tried to stay close to the other unit and lint classes.

  • Allow linting from a parent directory
  • Allow linting from a parent directory
  • Fix linting error
  • Make ExUnitTestEngine handle Mix projects in subdirectories

As per https://secure.phabricator.com/book/phabcontrib/article/contributing_code/, you should file a task for this change before you can get any attention.


The linter depends on the development version of dogma

Does this mean it is likely to break in a month?

  1. Configure ExUnit to use the JUnitFormatter as documented at https://github.com/victorolinasc/junit-formatter

Can you put this into the test runner code, so that configuration is easier for users?

As per https://secure.phabricator.com/book/phabcontrib/article/contributing_code/, you should file a task for this change before you can get any attention.

Thanks for the pointer, I created the appropriate tasks: T9796 and T9797

Does this mean it is likely to break in a month?

Well, it means a developer must use the HEAD of the git repository instead of the latest tagged version.

Can you put this into the test runner code, so that configuration is easier for users?

It is already in the file's documentation, what else are you referring to?

Does this mean it is likely to break in a month?

Well, it means a developer must use the HEAD of the git repository instead of the latest tagged version.

As in, the installation instructions are "clone HEAD of some repo"?
This might sound strange, but these instructions are more than I'd expect users to handle (Users are repeatedly baffled by "run 'npm install jshint'". I wish I was exaggerating).

Also, if there's no official version that supports this code, they can decide to change their api, making stop working.

Can you put this into the test runner code, so that configuration is easier for users?

It is already in the file's documentation, what else are you referring to?

I mean, code the engine/linter in such a way that the users don't need to read documentation. Adding flags, for example.


I think you'll need to wait for the Elixir/dogma code to stabilize before getting any serious consideration for this feature.

Does this mean it is likely to break in a month?

Well, it means a developer must use the HEAD of the git repository instead of the latest tagged version.

As in, the installation instructions are "clone HEAD of some repo"?
This might sound strange, but these instructions are more than I'd expect users to handle (Users are repeatedly baffled by "run 'npm install jshint'". I wish I was exaggerating).

Also, if there's no official version that supports this code, they can decide to change their api, making stop working.

Interesting. I will add some additional info regarding this issue to the instructions.

Can you put this into the test runner code, so that configuration is easier for users?

It is already in the file's documentation, what else are you referring to?

I mean, code the engine/linter in such a way that the users don't need to read documentation. Adding flags, for example.

This wouldn't be feasable since using the junit formatter requires multiple changes in a project's source code, which if being done magically by the unit engine would need to be kept in sync with whatever changes in the formatter itself.


I think you'll need to wait for the Elixir/dogma code to stabilize before getting any serious consideration for this feature.

Fine by me. I work off a working fork in the meantime. Elixir is stable, so I only see dogma as the moving target.