Code Monkey home page Code Monkey logo

clojure-lint-action's Introduction

Clojure Lint Action (using clj-kondo)

Run clj-kondo and annotate source code changes with results.

Usage

    steps:
    - uses: actions/checkout@v1
    - uses: DeLaGuardo/clojure-lint-action@master
      with:
        clj-kondo-args: --lint src
        # check-name is optional
        check-name: This is a report name
        # secrets.GITHUB_TOKEN is needed here
        # to publish annotations back to github
        # this action is not storing or sending it anywhere
        github_token: ${{ secrets.GITHUB_TOKEN }}

Annotation example

Check Run example

License

The scripts and documentation in this project are released under the MIT License

clojure-lint-action's People

Contributors

delaguardo avatar laurio avatar maxweber avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

clojure-lint-action's Issues

Bad credentials

Using the following yaml:

steps:
    - uses: actions/checkout@v1
    - uses: DeLaGuardo/clojure-lint-action@v1
      with:
        clj-kondo-args: --lint src

Fails with:

/usr/bin/docker run --name e87b52800af7d2186d48a18d08b69dd6efd1d6_8b8cd5 --label e87b52 --workdir /github/workspace --rm -e INPUT_CLJ-KONDO-ARGS -e INPUT_GITHUB_TOKEN -e HOME -e GITHUB_REF -e GITHUB_SHA -e GITHUB_REPOSITORY -e GITHUB_RUN_ID -e GITHUB_RUN_NUMBER -e GITHUB_ACTOR -e GITHUB_WORKFLOW -e GITHUB_HEAD_REF -e GITHUB_BASE_REF -e GITHUB_EVENT_NAME -e GITHUB_WORKSPACE -e GITHUB_ACTION -e GITHUB_EVENT_PATH -e RUNNER_OS -e RUNNER_TOOL_CACHE -e RUNNER_TEMP -e RUNNER_WORKSPACE -e ACTIONS_RUNTIME_URL -e ACTIONS_RUNTIME_TOKEN -e ACTIONS_CACHE_URL -e GITHUB_ACTIONS=true -v "/var/run/docker.sock":"/var/run/docker.sock" -v "/home/runner/work/_temp/_github_home":"/github/home" -v "/home/runner/work/_temp/_github_workflow":"/github/workflow" -v "/home/runner/work/works-hub/works-hub":"/github/workspace" e87b52:800af7d2186d48a18d08b69dd6efd1d6  "--lint src"
Error Error: Received status code 401
    at IncomingMessage.res.on (/action/lib/request.js:13:39)
    at IncomingMessage.emit (events.js:203:15)
    at endReadableNT (_stream_readable.js:1145:12)
    at process._tickCallback (internal/process/next_tick.js:63:19)
{"message":"Bad credentials","documentation_url":"https://developer.github.com/v3"}

I tried adding Github Token (Personal access token?) and it complained that it needed to be authed using GitHub App.

"check-name" is an invalid argument

I've configured the action in a workflow like so:

  - name: Lint
    uses: DeLaGuardo/clojure-lint-action@v1
    with:
      clj-kondo-args: --lint src test --cache false
      check-name: clj-kondo liniting report
      github_token: ${{ secrets.GITHUB_TOKEN }}

When the workflow is run I get this warning: Unexpected input(s) 'check-name', valid inputs are ['entryPoint', 'args', 'clj-kondo-args', 'github_token']
And indeed the action reports cli-kondo's report with the default name "clj-kondo check" instead of the check name I configured.

Allow pinning of clj-kondo version

It would be great to be able to specify a clj-kondo version when running this action. The benefits would be that changes in clj-kondo can't break anyone's build and also people might upgrade more consciously, learning about new features in clj-kondo etc.

If you have ideas for how this might be implemented I might take a stab at it :)

Consider passing the check name as a configurable parameter

I have a project that is split in multiple modules with source in separate folders. To lint it, I need to run clj-kondo multiple times with those separate folders.

Unfortunately, the action check name is fixed, so the results are getting overwritten. Can you please consider making it configurable? Alternatively - allowing multiple runs with different arguments within the same action would be great.

TIA

Support importing configs from libraries before running

Kondo supports importing configs published by libraries you're using with the command

clj-kondo --copy-configs --dependencies --lint "$(clojure -Spath)"

It copies the config files into .clj-kondo in your project directory.

I would like to run this command as part of the lint action in CI so I can avoid checking in external config files into my project repository.

I could not figure out a way to do this with clojure-lint-action, but maybe I just wasn't using my imagination enough. Is this something you can already do. If not, would it be easy to add support for this?

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.