Coder Social home page Coder Social logo

datapack-linter's Introduction

Datapack Linter

stars activity workflow Gitmoji

この GitHub Action は変更が行われた datapack ドキュメントの静的解析を行います。

This GitHub Action performs a static analysis of the datapack document in which the changes were made.

使い方 / Usage

  1. GitHub の自身のリポジトリで Actions タブへ行き New workflow をクリック

    Go to your own repository on GitHub, go to the Actions tab and click on New workflow.

  2. 下の方にある Manual workflow を選択し下記の設定ファイルをコピー & ペースト

    Select the Manual workflow at the bottom and copy and paste the following configuration file

  3. 右上の Start commit -> Commit new file を押す

    Press Start commit -> Commit new file in the upper right corner.

    name: lint-datapack
    on:
      push:
      pull_request:
      workflow_dispatch:
    jobs:
      lint:
        name: lint
        runs-on: ubuntu-latest
        steps:
          - name: checkout repository
            uses: actions/checkout@v3
            with:
              fetch-depth: 0
    
          - name: lint
            uses: ChenCMD/datapack-linter@v2
            with:
              GITHUB_TOKEN: ${{ github.token }}

校閲ルールについて / Lint Rules

Datapack Linter は Datapack Helper Plus に使用されている言語サーバーを使用しており、リポジトリルートに配置された .vscode/setting.json を自動的に読み込み校閲ルールに適用します。
このファイルは VSCode でワークスペースの設定を変更すると生成されます。
また、後述の入力から configPath を指定することで、任意のコンフィグファイルを読み込むことが可能です。

The Datapack Linter uses the same language server used by Datapack Helper Plus, and automatically reads .vscode/setting.json placed in the repository root and applies it to the review rules.
This file is generated when you change the workspace settings in VSCode.
It is also possible to load an arbitrary config file by specifying configPath from the inputs described below.

入力 / Inputs

名前 Name 想定する値 / Expect value 必須 / Require デフォルト / Default 概要 / About
GITHUB_TOKEN GitHub token x N/A GitHub のトークン。このトークンは pull_request イベントで linter を使用する際に設定することを推奨します。
A GitHub token. It is recommended that this token be set when using linter in pull_request events.
lintDirectory path x "." チェックを行うディレクトリ
Directory to lint
configPath path x ".vscode/settings.json" 校閲ルールを記載したコンフィグファイルのパス
Path to the config file containing the lint rules
forcePass true x false チェックに失敗した Datapack ドキュメントが存在するときに step そのものを失敗させるか否か
Whether or not to fail the step itself when there is a Datapack document that fails the lint
muteSuccessResult true x false チェックに成功した Datapack ドキュメントのログを無効化するか否か
Whether to disable logging of Datapack documents that have been successfully linted
ignoreLintPathPattern Namespaced ID Pattern x "" チェックを行わない Datapack ドキュメントのリソースパスの名前空間 ID パターン
Namespaced ID Pattern of the resource path of the Datapack document whose lints are to be ignored
alwaysCheckAllFile true x false 常にすべての Datapack ドキュメントをチェックするか否か
Whether to always lint all Datapack documents

注: ignoreLintPathPattern は複数の文字列を入れることが可能です。方法は下記のサンプルを参照してください。

note: ignoreLintPathPattern can contain multiple character strings. Please refer to the sample below for the method.

         - name: lint
           uses: ChenCMD/datapack-linter@v2
           with:
             ignoreLintPathPattern: |
               ignore:**
               example:ignore/**
               example:data/ignore/**

キャッシュについて / Cache

Datapack Linter はキャッシュを利用して、動作速度を高速にしています。
しかし、さまざまな要因で稀にキャッシュが破損する可能性があります。
その場合、コミットメッセージに [regenerate cache] という文字列を含めることでキャッシュを再生成することが可能です。

The Datapack Linter uses a cache to speed up its operation.
However, there is a rare possibility that the cache gets corrupted due to various reasons.
In that case, you can regenerate the cache by including the string [regenerate cache] in the commit message.

コントリビュートについて / Contribution

CONTRIBUTING.md を確認してください

Please check CONTRIBUTING.md.

datapack-linter's People

Contributors

chencmd avatar dependabot[bot] avatar

Stargazers

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

Watchers

 avatar

datapack-linter's Issues

新しく作成したブランチで実行時に JavaScriptException が発生する

scala.scalajs.js.JavaScriptException: TypeError: Cannot read properties of null (reading 'toString')
  at j(/home/runner/work/_actions/ChenCMD/datapack-linter/v2/index.js:2:1966)
  at jm.vA(/home/runner/work/_actions/ChenCMD/datapack-linter/v2/index.js:2:188744)
  at {anonymous}()(/home/runner/work/_actions/ChenCMD/datapack-linter/v2/index.js:2:146495)
  at {anonymous}()(/home/runner/work/_actions/ChenCMD/datapack-linter/v2/index.js:2:148055)
  at Lv.d(/home/runner/work/_actions/ChenCMD/datapack-linter/v2/index.js:2:[26](https://github.com/ProjectTSB/TheSkyBlessing/actions/runs/5846599093/job/15851959790#step:3:27)6623)
  at {anonymous}()(/home/runner/work/_actions/ChenCMD/datapack-linter/v2/index.js:2:[27](https://github.com/ProjectTSB/TheSkyBlessing/actions/runs/5846599093/job/15851959790#step:3:28)0468)
  at Lv.d(/home/runner/work/_actions/ChenCMD/datapack-linter/v2/index.js:2:266623)
  at cE(/home/runner/work/_actions/ChenCMD/datapack-linter/v2/index.js:2:409589)
  at aE(/home/runner/work/_actions/ChenCMD/datapack-linter/v2/index.js:2:400883)
  at _E.Gg(/home/runner/work/_actions/ChenCMD/datapack-linter/v2/index.js:2:424608)

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.