Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

CLI tool that allows you to measure quality of a team work and an app based on your source code.

License

NotificationsYou must be signed in to change notification settings

DXHeroes/dx-scanner

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Tweet

SlackPipeliner Roadmap

VersionTravis (.org)codecovlast commitGitHub commit activityDownloads/weekGitHub contributorsAll ContributorsNPMTypeScript


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 useGitHub. You can also useGitLab andBitbucket no matter if it is public or private repo!

examples:

dx-scanner run https://github.com/DXHeroes/dx-scannerdx-scanner run https://gitlab.com/ubon-refer/smart-refer-apidx-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 commandCommands:  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 commandAliases:  dxs  dxscanner

Options fordx-scanner run

Usage: dx-scanner run [path] [options]Scan your project for possible DX recommendationsOptions:  -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 informationExamples:  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 allfixable 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 specifyfixPattern flag to fix only a subset offixable practices.

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

Please note, thatfixPattern flag overridesfix settings from configuration file. Therefore practices omitted from fixing by configuration file, but included throughfixPattern will be fixed.

Configuration ⚙️

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

You can also rundx-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.

List of All Practices 🔍
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:

highmediumsmallhintoff

Exampledxscannerrc.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, specifyoverride and nest the correct overridable variables.

Exampledxscannerrc.yaml:

---practices:JavaScript.GitignoreCorrectlySet:mediumJavaScript.LoggerUsed:'off'LanguageIndependent.DoesPullRequests:impact:smallJavaScript.ESLintWithoutErrorsPractice:fix:trueoverride:lintFilesPatterns:['.internal/**/*.js', '*.js']ignorePatterns:[]LanguageIndependent.ThinPullRequestsPractice:impact:highoverride:measurePullRequestCount:500

CI Mode

When running DX Scanner with--ci flag, it runs in CI Mode. In CI Mode, DX SCanner usesCIReporter 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 Scanneron:pushjobs:dx-scanner:runs-on:ubuntu-lateststeps:      -uses:actions/checkout@v1      -name:Runs DX Scanner on the codeuses:DXHeroes/dx-scanner@masterwith:github_token:${{ secrets.GITHUB_TOKEN }}

Generate your Github personal token andset it as an encrypted secret namedGITHUB_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 pointsmedium = 75 pointssmall = 50 pointshint = 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 publicSlack!

Contributing 👩‍💻 👨‍💻

Feel free to contribute to our DX Scanner. Please follow theContribution Guide.

Roadmap

See ourpublic roadmap.

License 📝

The DX Scanner open source project is licensed under theMIT.

Contributors ✨

Many thanks to these wonderful people (emoji key):


Prokop Simek

💻🚧

adelkah

💻🚧

Radek Holý

💻

Vratislav Kalenda

💻🤔

Petr Vnenk

💻

Cuong Nguyen

💻

vlasy

💻

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


[8]ページ先頭

©2009-2025 Movatter.jp