Giter Club home page Giter Club logo

cli's Introduction

Docs | Get Started | Discuss

The Code Health Platform


CLI

Command line interface to DeepSource

Installation

macOS

DeepSource CLI is available on macOS via Homebrew:

brew install deepsourcelabs/cli/deepsource

Binary Installation

curl https://cli.deepsource.com/install | sh

This script will detect the operating system and architecture and puts deepsource binary in ./bin/deepsource.

Configuring DSN

In order to report test-coverage to DeepSource using the report command, an environment variable named as DEEPSOURCE_DSN has to be set. It's value will be available under 'Settings' tab of the repository page.

Usage

The CLI provides access to a wide range of commands. Here is a list of the commands along with their brief description.

Usage:
    deepsource <command> [<arguments>]

Available commands are:
    report      Report an artifact to an analyzer
    config      Generate and Validate DeepSource config
    help        Help about any command
    issues      Show the list of issues in a file in a repository
    repo        Operations related to the project repository
    report      Report artifacts to DeepSource
    version     Get the version of the DeepSource CLI

Help:
    Use 'deepsource <command> --help/-h' for more information about the command.

Documentation

For complete documentation, refer to the CLI Documentation

Feedback/Support

Want to share any feedback or need any help regarding the CLI? Feel free to open a discussion in the community forum

License

Licensed under the BSD 2-Clause "Simplified" License.

cli's People

Contributors

aseem-deepsource avatar burntcarrot avatar deepsource-autofix[bot] avatar dhruvmanila avatar jai-deepsource avatar k8skween avatar karansthr avatar mohi7solanki avatar prajwal-deepsource avatar rahul-deepsource avatar sauravsrijan avatar shruddha-deepsource avatar siddhant-deepsource avatar sourya-deepsource avatar srijan-deepsource avatar subham-deepsource avatar tushar-deepsource avatar vishesh-deepsource avatar vishnu-deepsource 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

cli's Issues

Separate builds for CI binaries using build tags

Since we are adding new commands to CLI, the size of the binary is constantly increasing. This reflects in the case when the users pull the CLI binary in their CI systems as the time to pull the binary increases. Thus, creating a separate binary on every release that will be served if the environment is a CI system is the need.

Handle merge commit - Github Action

Like Travis CI, Github action, by default makes a merge commit and work on top of it.
When the cli sends the test coverage analysis result, it sends a base OID. Here, it is of this merge commit, of which no run is created on DS and the reporting fails.

Automate CLI release

The CLI is currently released manually. It would be better to release it automatically whenever a tag is pushed, probably using Cloud Build.

Deepsource reports incorrect results about loop variable

This is a bug about the deepsource core system (not the CLI). I couldn't find the correct repository so I've created the issue here. Please move the issue to the correct repository or point me to the correct repository.

We have deepsource enabled on https://github.com/dgraph-io/badger/ and deepsource is running on our CI. Deepsource complains that the loop variable j never changes but that's not the case. Here's the line deepsource complains about https://github.com/dgraph-io/badger/blob/be0fe0acd493f0542c90070a5b8ec1ab734d1b44/db_test.go#L2053-L2053

Here's a screenshot of the error
deepsource

Add `deepsource status` command

deepsource status command can be used to check the status of any VCS branch of a repository if it has any active issues or not. Adding to issues, other data like metrics can be fetched as well.

Add command for listing metrics

DeepSource also reports certain metrics like documentation coverage, number of direct/indirect dependencies etc. Listing them alongwith issues might also help.

CLI doesn't support darwin/arm64 (M1 mac) architecture

Using curl,

$ curl https://deepsource.io/cli | sh

deepsourcelabs/cli crit platform darwin/arm64 is not supported.  Make sure this script is up-to-date and file a request at https://github.com/deepsourcelabs/cli/issues/new

No relevant binaries are present in the Releases, either.

Fix redundant error reporting while using spinners

Description:

On using spinner.StopSpinnerWithError() along with a return err statement, error reporting happens twice:

 $ /tmp/deepsource analyzer dry-run --image burntcarrot/doesnotexist
[✗] Failed to pull the Analyzer image. Error: Error response from daemon: pull access denied for burntcarrot/doesnotexist, repository does not exist or may require 'docker login': denied: requested access to the resource is denied
  ERROR   Failed to run the Analyzer. Error: Error response from daemon: pull access denied for burntcarrot/doesnotexist, repository does not exist or may require 'docker login': denied: requested access to the resource is denied

How to reproduce?

This issue can be reproduced by doing a dry run on an image that doesn't exist, just like:

deepsource analyzer dry-run --image burntcarrot/doesnotexist

Remove .deepsource.toml check

Before sending artifact, we check for the existence of .deepsource.toml in the root of the repository, but the config might be present in the base branch of the pull request.

changing default installation location from $HOME/bin

Is your feature request related to a problem? Please describe.
So the script at https://deepsource.io/cli is not really opensourced, that's why reporting this here:

the default location space for linux systems is generally $HOME/.local/bin/
this has an advantage to make the command deepsource beng invoked from anywhere in the system since the bin location is included in $PATH by default.

Describe the solution you'd like
Either we export the $HOME/bin to users $PATH env or change the default installation location

Dependabot can't resolve your Go dependency files

Dependabot can't resolve your Go dependency files.

As a result, Dependabot couldn't update your dependencies.

The error Dependabot encountered was:

github.com/go-errors/[email protected]: reading github.com/go-errors/errors/go.mod at revision v1.0.1: unknown revision v1.0.1

If you think the above is an error on Dependabot's side please don't hesitate to get in touch - we'll do whatever we can to fix it.

View the update logs.

Replace `viper` with alternative in `configvalidator` package

We are using viper in configvalidator package for the deepsource config validate command to read the .deepsource.toml config which is to be validated.

Viper can be replaced here with other libraries which have a lower size footprint and are focused only on reading TOML files.

Files where viper is used:

Implement login workflow

We will need a user level auth which returns a token that can be used for future API calls to our services. This token can be stored in a file locally ex: ~/.deepsource/cli_token.

I like how stripe does this.

$ stripe login
Your pairing code is: eager-foo-amply-bar
This pairing code verifies your authentication with Stripe.
Press Enter to open the browser (^C to quit)

Screenshot 2020-02-18 at 11 08 05 PM

@mohi7solanki Need an endpoint and query structure for the same.

[bug] exclude_patterns shouldn't be empty and repeated

? Would you like to add any exclude patterns? Yes
? Select exclude pattern
? Add more exclude patterns? Yes
? Select exclude pattern
? Add more exclude patterns? Yes
? Select exclude pattern
? Add more exclude patterns? No

Result:

exclude_patterns = ["", "", ""]

Expected:

? Would you like to add any exclude patterns? Yes
? Select exclude pattern
? exclude pattern shouldn't be empty string
? Select exclude pattern a
? Add more exclude patterns? Yes
? Select exclude pattern a
? exclude pattern shouldn't be repeated

Flag to authenticate by passing token from standard input

In order to make sure that the CLI authentication works in CI systems where device auth flow can't be used since no browser can be opened, we can add a flag --token or --with-token through which the user can pass the value of the generated PAT. The CLI authenticates the user through the passed PAT value.

[bug] Can we don't select any formatter?

? Which languages/tools does your project use? Docker
? Custom Dockerfile paths
X Sorry, your reply was invalid: Value is required
? Would you like to activate any Transformers for any languages?  [Use arrows to move, space to select, <right> to all, <left> to none, type to filter, ? for more help]
  [ ]  RuboCop
  [ ]  dotnet-format
  [ ]  Prettier
> [ ]  Google Java Format
  [ ]  Black
  [ ]  Go fmt
  [ ]  Gofumpt

Press <CR> will get X Sorry, your reply was invalid: Value is required

Parallel goreleaser builds

As of now, goreleaser builds happen sequentially. Running them in parallel would reduce the release time.

DeepSource | Error | .deepsource.toml not found.

I've set up DeepSource on a private repo on Github. The .deepsource.toml has been configured and added at the root of the repo. DeepSource reports a few issues on the dashboard. All good.

However, when I try and add code coverage, following the steps to create and pass the cover.out report with output from my tests, and having double-checked the syntax and file locations, I still get the above error DeepSource | Error | .deepsource.toml not found.

The CI/CD is via Github actions. I'm using Go version 1.13.

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.