Browse Source

feat(tool,ci): Add script for detecting dart:io usage

Signed-off-by: jld3103 <jld3103yt@gmail.com>
pull/1039/head
jld3103 1 year ago
parent
commit
46aff2715b
No known key found for this signature in database
GPG Key ID: 9062417B9E8EB7B3
  1. 10
      .github/workflows/neon.yml
  2. 10
      tool/find-dart-io-usage.sh

10
.github/workflows/neon.yml

@ -19,3 +19,13 @@ jobs:
- name: Find untested Neon APIs - name: Find untested Neon APIs
run: ./tool/find-untested-neon-apis.sh run: ./tool/find-untested-neon-apis.sh
dart-io-usage:
name: dart:io usage
runs-on: ubuntu-22.04
steps:
- name: Checkout repository
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
- name: Find dart:io usage
run: ./tool/find-dart-io-usage.sh

10
tool/find-dart-io-usage.sh

@ -0,0 +1,10 @@
#!/bin/bash
set -euxo pipefail
cd "$(dirname "$0")/.."
dart_io_usage=("$(grep -r packages --include "*\.dart" -e "dart:io" -l | grep -v "/\.dart_tool/" | grep -v "/bin/" | grep -v "/test_driver/" || true)")
if [[ -n "${dart_io_usage[*]}" ]]; then
printf "%s\n" "${dart_io_usage[@]}"
exit 1
fi
Loading…
Cancel
Save