3.57.0 • Published 3 years ago

dx-scanner v3.57.0

Weekly downloads
73
License
MIT
Repository
github
Last release
3 years ago

Tweet

Slack Pipeliner Roadmap

Version Travis (.org) codecov last commit GitHub commit activity Downloads/week GitHub contributors All Contributors NPM TypeScript


What is DX Scanner?

DX Scanner is an open source CLI tool that allows you to “measure” Developer Experience directly based on your source code. DX Scanner recommends practices that can help you with improving your product development. You can fix some problems automatically with just one command.

What language is supported?

LanguageSupported
JavaScript/TypeScript
Java/Kotlin
Python
Go
PHP
Ruby
Rust
C++🚧
C#🚧
Android🚧
Swift🚧

Table of Contents

Which version control system can you use?

Sure you can use GitHub. You can also use GitLab and Bitbucket no matter if it is public or private repo!

examples:

dx-scanner run https://github.com/DXHeroes/dx-scanner

dx-scanner run https://gitlab.com/ubon-refer/smart-refer-api

dx-scanner run https://bitbucket.org/maras333/node-api-with-ts

Getting Started 🏁

Dependencies

Installation

  • with NPM

    npm install -g dx-scanner

  • with Yarn

    yarn global add dx-scanner

Usage

  dx-scanner run [path] [options]

Example:

  dx-scanner run https://github.com/DXHeroes/dx-scanner

Commands

Usage: dx-scanner [command] [options]

Options:
  -V, --version         output the version number
  -l --log              Write a debug and dxs output log to ./dxscanner.log
  -h, --help            display help for command

Commands:
  run [options] [path]  Scan your project for possible DX recommendations
  init                  Initialize DX Scanner configuration
  practices [options]   List all practices id with name and impact
  help [command]        display help for command

Aliases:
  dxs
  dxscanner

Options for dx-scanner run

Usage: dx-scanner run [path] [options]

Scan your project for possible DX recommendations

Options:
  -a --authorization <authorization>  credentials to the repository (in format "token" or "username:token"; can be set as ENV variable DXSCANNER_GIT_SERVICE_TOKEN)
  -t --apiToken <apiToken>            credentials to DX Scanner, can be set as ENV variable DXSCANNER_API_TOKEN
  --apiUrl <apiUrl>                   URL of DX Scanner API, can be set as ENV variable DXSCANNER_API_URL (default: https://provider.dxscanner.io/api/v1)
  --ci                                CI mode (default: false)
  -d --details                        print details in reports
  --fail <impact>                     exits process with code 1 for any non-practicing condition of given level (high|medium|small|hint|off|all) (default: "off")
  --fix                               tries to fix problems automatically (default: false)
  --fixPattern <pattern>              fix only rules with IDs matching the regex
  -j --json                           print report in JSON (default: false)
  --html [path]                       save report in HTML file (default: false, default path: ./report.html)
  -r --recursive                      scan all components recursively in all sub folders (default: false)
  --no-recursive                      disable recursive scan in CI mode
  -h, --help                          output usage information

Examples:
  dx-scanner run
  dx-scanner run ./ --fail=high
  dx-scanner run github.com/DXHeroes/dx-scanner

Auto-fixer

Fix problems detected by DX Scanner automatically.

dx-scanner run [PATH] --fix

This will try to fix all fixable practices which are not being practices yet. If you want to omit a practice from automatic fixing, you can do it in the configuration file (see below).

You can also specify fixPattern flag to fix only a subset of fixable practices.

dx-scanner run [PATH] --fix --fixPattern=lint

Please note, that fixPattern flag overrides fix settings from configuration file. Therefore practices omitted from fixing by configuration file, but included through fixPattern will be fixed.

Configuration ⚙️

Add dxscannerrc.* config file to change default configuration settings. It can be a .json, .yml, or even a dotfile!

You can also run dx-scanner init to initialize config automatically.

Practices

You can switch off practices that you do not want to scan, change their impact level, and even override their default values. To do so, refer to the id of the practice and specify your configuration.

PracticeImpactLanguage IndependentJavaScript/TypeScriptJava/KotlinPythonPHP
Create a Readme Filehigh
Create a Changelog Filehigh
Create a License Filemedium
Create a Lockfilehigh
Create a .gitignorehigh
Write in Typescriptmedium
Set .gitignore Correctlyhigh
Set Readme File Correctlyhigh
Use Continuous Integrationhigh
Use Dockersmall
Use .editorconfigsmall
Format your code automaticallysmall
Use a Lintermedium
ESLint Without Errorsmedium
Use a different lintermedium
Use JS Frontend Testing Frameworkmedium
Use JS Frontend Build Toolsmedium
Use JS Backend Testing Frameworkshigh
Use a JS Logging Librarysmall
Use Package Managementhigh
Configure Scripts in package.jsonmedium
Update Dependencies of Major Levelsmall
Update Dependencies of Minor and Patch Levelhigh
Do PullRequestsmedium
Break down large pull requests into smaller onesmedium
Solve Pull Requests Continuouslymedium
Solve Issues Continuouslymedium
Write Commit Messages by Conventionsmall
Use Mocking Frameworks for Testssmall
Use Testing Frameworkshigh
Use a Java Logging Dependencysmall
Use Java Class Naming Conventionsmall
Specify Versions of Dependencieshigh
Store Environment Variables Using .properties Filesmedium
Use Java Code Stylessmall
Use Java Logger Configuration Filessmall
Security vulnerabilities detectedhigh

Possible impact:

high

medium

small

hint

off

Example dxscannerrc.json:

{
    "practices": {
        "JavaScript.GitignoreCorrectlySet": "medium",
        "JavaScript.LoggerUsed": "off",
        "LanguageIndependent.DoesPullRequests": {
          "impact": "small"
        },
        "JavaScript.ESLintWithoutErrorsPractice": {
          "fix": true,
          "override": {
            "lintFilesPatterns": [".internal/**/*.js", "*.js"],
            "ignorePatterns": []
          }
        },
        "LanguageIndependent.ThinPullRequestsPractice": {
          "impact": "high",
          "override": {
            "measurePullRequestCount": 500
          }
        }
    }
}

In order to override the default values of certain practices, specify override and nest the correct overridable variables.

Example dxscannerrc.yaml:

---
practices:
  JavaScript.GitignoreCorrectlySet: medium
  JavaScript.LoggerUsed: 'off'
  LanguageIndependent.DoesPullRequests:
    impact: small
  JavaScript.ESLintWithoutErrorsPractice:
    fix: true
    override:
      lintFilesPatterns: ['.internal/**/*.js', '*.js']
      ignorePatterns: []
  LanguageIndependent.ThinPullRequestsPractice:
    impact: high
    override:
      measurePullRequestCount: 500

CI Mode

When running DX Scanner with --ci flag, it runs in CI Mode. In CI Mode, DX SCanner uses CIReporter for its output and runs recursively by default (i.e. the --recursive flag is turned on).

If you want to disable recursive scan in CI mode, use the --no-recursive flag.

Github CI Action

Basic example: run DX Scanner on each push to the repo

Create .github/workflows/main.yml.

name: DX Scanner
on: push
jobs:
  dx-scanner:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v1
      - name: Runs DX Scanner on the code
        uses: DXHeroes/dx-scanner@master
        with:
          github_token: ${{ secrets.GITHUB_TOKEN }}

Generate your Github personal token and set it as an encrypted secret named GITHUB_TOKEN.

Score Computation 💯

The impact of each practice is represented by a specific value. DX Scanner uses these values to calculate the overall DX Score.

high = 100 points

medium = 75 points

small = 50 points

hint = 25 points

The practices you have switched off are not included in the calculation (0 points).

Support 🦸‍♀️ 🦸‍♂️

Didn't you find what you expected? Contact us via our public Slack!

Contributing 👩‍💻 👨‍💻

Feel free to contribute to our DX Scanner. Please follow the Contribution Guide.

Roadmap

See our public roadmap.

License 📝

The DX Scanner open source project is licensed under the MIT.

Contributors ✨

Many thanks to these wonderful people (emoji key):

This project follows the all-contributors specification. Any kind of contributions are welcome!

3.56.0

3 years ago

3.57.0

3 years ago

3.55.0

3 years ago

3.54.2

3 years ago

3.54.1

3 years ago

3.54.0

3 years ago

3.53.0

3 years ago

3.52.0

3 years ago

3.51.1

3 years ago

3.51.0

3 years ago

3.50.3

3 years ago

3.50.2

3 years ago

3.50.1

3 years ago

3.50.0

3 years ago

3.49.3

3 years ago

3.49.2

3 years ago

3.49.1

3 years ago

3.49.0

3 years ago

3.48.8

3 years ago

3.48.7

3 years ago

3.48.4

3 years ago

3.48.5

3 years ago

3.48.6

3 years ago

3.48.3

3 years ago

3.48.2

3 years ago

3.48.1

3 years ago

3.48.0

3 years ago

3.47.1

3 years ago

3.47.0

3 years ago

3.46.3

3 years ago

3.46.2

3 years ago

3.46.1

3 years ago

3.46.0

3 years ago

3.45.1

3 years ago

3.45.0

4 years ago

3.44.0

4 years ago

3.43.0

4 years ago

3.42.1

4 years ago

3.42.0

4 years ago

3.41.3

4 years ago

3.41.2

4 years ago

3.41.1

4 years ago

3.41.0

4 years ago

3.40.1

4 years ago

3.40.0

4 years ago

3.39.3

4 years ago

3.39.2

4 years ago

3.39.1

4 years ago

3.39.0

4 years ago

3.38.2

4 years ago

3.38.1

4 years ago

3.38.0

4 years ago

3.37.2

4 years ago

3.37.1

4 years ago

3.37.0

4 years ago

3.36.1

4 years ago

3.36.0

4 years ago

3.35.0

4 years ago

3.34.0

4 years ago

3.33.1

4 years ago

3.33.0

4 years ago

3.32.2

4 years ago

3.32.0

4 years ago

3.32.1

4 years ago

3.31.0

4 years ago

3.30.1

4 years ago

3.30.2

4 years ago

3.30.0

4 years ago

3.29.0

4 years ago

3.28.2

4 years ago

3.28.1

4 years ago

3.28.0

4 years ago

3.27.0

4 years ago

3.26.8

4 years ago

3.26.7

4 years ago

3.26.6

4 years ago

3.26.4

4 years ago

3.26.3

4 years ago

3.26.5

4 years ago

3.26.2

4 years ago

3.26.1

4 years ago

3.26.0

4 years ago

3.25.0

4 years ago

3.24.1

4 years ago

3.24.0

4 years ago

3.23.5

4 years ago

3.23.4

4 years ago

3.23.3

4 years ago

3.23.2

4 years ago

3.23.1

4 years ago

3.23.0

4 years ago

3.22.2

4 years ago

3.22.1

4 years ago

3.22.0

4 years ago

3.21.3

4 years ago

3.21.2

4 years ago

3.21.1

4 years ago

3.21.0

4 years ago

3.20.5

4 years ago

3.20.4

4 years ago

3.20.3

4 years ago

3.20.2

4 years ago

3.20.1

4 years ago

3.20.0

4 years ago

3.18.1

4 years ago

3.19.0

4 years ago

3.18.0

4 years ago

3.17.3

4 years ago

3.17.2

4 years ago

3.17.1

4 years ago

3.17.0

4 years ago

3.16.0

4 years ago

3.15.0

4 years ago

3.13.2

4 years ago

3.14.0

4 years ago

3.13.1

4 years ago

3.13.0

4 years ago

3.12.1

4 years ago

3.12.0

4 years ago

3.11.0

4 years ago

3.10.0

4 years ago

3.9.0

4 years ago

3.8.2

4 years ago

3.8.0

4 years ago

3.8.1

4 years ago

3.7.0

4 years ago

3.6.2

4 years ago

3.6.1

4 years ago

3.6.0

4 years ago

3.5.3

4 years ago

3.5.2

4 years ago

3.5.1

4 years ago

3.5.0

4 years ago

3.4.0

4 years ago

3.2.0

4 years ago

3.1.2

4 years ago

3.3.0

4 years ago

3.1.1

4 years ago

3.1.0

4 years ago

3.0.5

4 years ago

3.0.4

4 years ago

3.0.3

4 years ago

3.0.2

4 years ago

3.0.1

4 years ago

3.0.0

4 years ago

2.10.1

4 years ago

2.10.0

4 years ago

2.9.0

4 years ago

2.8.1

4 years ago

2.8.0

4 years ago

2.7.0

4 years ago

2.6.0

4 years ago

2.5.0

4 years ago

2.4.0

4 years ago

2.3.3

4 years ago

2.3.2

4 years ago

2.3.1

4 years ago

2.3.0

4 years ago

2.2.0

4 years ago

2.1.2

4 years ago

2.1.1

4 years ago

2.1.0

4 years ago

2.0.5

4 years ago

2.0.4

4 years ago

2.0.4-beta.1

4 years ago

2.0.3

4 years ago

2.0.3-beta.1

4 years ago

2.0.2

4 years ago

2.0.1

4 years ago

2.0.0-pre-lp.1

4 years ago

2.0.0

4 years ago

1.38.0

4 years ago

1.37.1

4 years ago

1.37.0

4 years ago

1.36.0

4 years ago

1.35.3

4 years ago

1.35.2

4 years ago

1.35.1

4 years ago

1.35.0

4 years ago

1.34.0

4 years ago

1.33.1

4 years ago

1.32.1

4 years ago

1.33.0

4 years ago

1.32.0

4 years ago

1.30.0

4 years ago

1.31.0

4 years ago

1.29.2

4 years ago

1.29.1

4 years ago

1.29.0

4 years ago

1.28.2

4 years ago

1.28.1

4 years ago

1.28.0

4 years ago

1.27.0

4 years ago

1.26.4

4 years ago

1.26.3

4 years ago

1.26.2

4 years ago

1.26.1

4 years ago

1.25.0

4 years ago

1.26.0

4 years ago

1.24.0

4 years ago

1.23.2

4 years ago

1.23.1

4 years ago

1.23.0

4 years ago

1.22.1

4 years ago

1.22.0

4 years ago

1.21.1

4 years ago

1.21.0

4 years ago

1.20.0

4 years ago

1.19.0

4 years ago

1.18.2

4 years ago

1.18.1

4 years ago

1.18.0

4 years ago

1.17.10

4 years ago

1.17.9

4 years ago

1.17.8

4 years ago

1.17.7

4 years ago

1.17.6

4 years ago

1.17.5

4 years ago

1.17.4

4 years ago

1.17.3

4 years ago

1.17.2

4 years ago

1.17.1

4 years ago

1.17.0

4 years ago

1.16.0

4 years ago

1.15.2

4 years ago

1.15.1

4 years ago

1.15.0

4 years ago

1.14.3

4 years ago

1.14.2

4 years ago

1.14.1

4 years ago

1.14.0

4 years ago

1.13.5

4 years ago

1.13.4

4 years ago

1.13.3

4 years ago

1.13.2

4 years ago

1.13.1

5 years ago

1.13.0

5 years ago

1.12.0

5 years ago

1.11.0

5 years ago

1.10.0

5 years ago

1.9.0

5 years ago

1.8.0

5 years ago

1.7.0

5 years ago

1.6.1

5 years ago

1.6.0

5 years ago

1.5.0

5 years ago

1.4.2

5 years ago

1.4.1

5 years ago

1.4.0

5 years ago

1.3.0

5 years ago

1.2.0

5 years ago

1.1.4

5 years ago

1.1.3

5 years ago

1.1.1-alpha1

5 years ago

1.1.2

5 years ago

1.1.1

5 years ago

1.1.0

5 years ago

1.0.0

5 years ago