Giter Site home page Giter Site logo

hlint-test's Introduction

hlint-test

Build Status Hackage Hackage Dependencies Stackage LTS Stackage Nightly BSD3 License

This package aims to make easy to automatically run hlint as part of unit tests. That means hlint will be run when you execute cabal test or stack test.

How to make it work

Hlint-test package contains GHC preprocessor which will generate the code containing hlint runner. To invoke the preprocessor, create new test and put following line into it:

{-# OPTIONS_GHC -F -pgmF hlint-test #-}

Don't forget to add the test into cabal file (or package.yaml respectively) as separated test runner ;).

Now you can run the test simply by stack test or cabal test.

Hlint options

If you need to you can use the preprocessor macro to pass some additional arguments to the hlint. As it's shown on following line:

{-# OPTIONS_GHC -F -pgmF hlint-test -optF src -optF -r #-}

This will tell hlint to look for source codes only in src directory and to generate html report if some suggestions are found.

Also you can use hlint configuration file too ;).

Example

Simple example of the use can be seen in https://github.com/Siprj/hlint-test-example

hlint-test's People

Contributors

siprj avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.