diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 0000000..cc812ea --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,36 @@ +name: Lint + +# Run only one workflow at a time on a pr +# https://docs.github.com/en/actions/using-jobs/using-concurrency#example-using-a-fallback-value +concurrency: + group: ${{ github.head_ref || github.run_id }} + cancel-in-progress: true + +on: + pull_request: + branches: [ main ] + paths: + - 'bin/**' + - 'lib/**' + - 'tests/**.dart' + workflow_dispatch: + +jobs: + lint: + runs-on: ubuntu-latest + timeout-minutes: 15 + + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: '0' + + - uses: dart-lang/setup-dart@v1.3 + with: + sdk: stable + + - name: Install dependencies + run: dart pub get + + - name: Run linter + run: dart analyze --fatal-infos diff --git a/bin/alfa.dart b/bin/alfa.dart index 3b2611c..d0d4152 100644 --- a/bin/alfa.dart +++ b/bin/alfa.dart @@ -213,7 +213,7 @@ void main(List args) async { // executes shell command var streams = await Process.start(executable, arguments, runInShell: true) - .then((Process process) { + .then((process) { var outStream = stdout.addStream(process.stdout); var errStream = stderr.addStream(process.stderr); diff --git a/lib/src/schema.dart b/lib/src/schema.dart index 3c7f618..94cfdde 100644 --- a/lib/src/schema.dart +++ b/lib/src/schema.dart @@ -1,23 +1,23 @@ final configSchema = { - "type": "object", - "patternProperties": { - ".*": { - "type": "object", - "properties": { - "tags": { - "type": "array", - "items": {"type": "string"} + 'type': 'object', + 'patternProperties': { + '.*': { + 'type': 'object', + 'properties': { + 'tags': { + 'type': 'array', + 'items': {'type': 'string'} }, - "os": { - "type": "array", - "items": { - "type": "string", - "enum": ["macos", "linux"] + 'os': { + 'type': 'array', + 'items': { + 'type': 'string', + 'enum': ['macos', 'linux'] } }, - "options": { - "type": "array", - "items": {"type": "string"} + 'options': { + 'type': 'array', + 'items': {'type': 'string'} } } }