Skip to content

Commit

Permalink
Merge pull request #989 from UC-Davis-molecular-computing/419-migrate…
Browse files Browse the repository at this point in the history
…-to-dart-null-safety-mode

419 migrate to dart null safety mode
  • Loading branch information
dave-doty authored Sep 13, 2024
2 parents f6fe65e + 8f28436 commit 38240c1
Show file tree
Hide file tree
Showing 233 changed files with 6,989 additions and 6,519 deletions.
42 changes: 21 additions & 21 deletions .github/workflows/dart.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
name: Dart CI

on:
on:
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
types: [ opened, synchronize, reopened, ready_for_review ]

jobs:
run_unit_tests:
Expand All @@ -11,27 +11,27 @@ jobs:
runs-on: ubuntu-22.04

steps:
- name: Setup Dart SDK Step 1
run: sudo apt-get update
- name: Setup Dart SDK Step 2
run: sudo apt-get install apt-transport-https
- name: Setup Dart SDK Step 3
run: sudo sh -c 'wget -qO- https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add -'
- name: Setup Dart SDK Step 4
run: sudo sh -c 'wget -qO- https://storage.googleapis.com/download.dartlang.org/linux/debian/dart_stable.list > /etc/apt/sources.list.d/dart_stable.list'
- name: Setup Dart SDK Step 5
run: wget -O /tmp/dart_2.13.4-1_amd64.deb https://storage.googleapis.com/dart-archive/channels/stable/release/2.13.4/linux_packages/dart_2.13.4-1_amd64.deb
- name: Setup Dart SDK Step 6
run: sudo apt install /tmp/dart_2.13.4-1_amd64.deb
- uses: actions/checkout@v3
- name: Install dependencies
run: PATH="$PATH:/usr/lib/dart/bin" pub get
- name: Run tests
run: PATH="$PATH:/usr/lib/dart/bin" pub run build_runner test
- name: Setup Dart SDK Step 1
run: sudo apt-get update
- name: Setup Dart SDK Step 2
run: sudo apt-get install apt-transport-https
- name: Setup Dart SDK Step 3
run: sudo sh -c 'wget -qO- https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add -'
- name: Setup Dart SDK Step 4
run: sudo sh -c 'wget -qO- https://storage.googleapis.com/download.dartlang.org/linux/debian/dart_stable.list > /etc/apt/sources.list.d/dart_stable.list'
- name: Setup Dart SDK Step 5
run: wget -O /tmp/dart_2.19.6-1_amd64.deb https://storage.googleapis.com/dart-archive/channels/stable/release/2.19.6/linux_packages/dart_2.19.6-1_amd64.deb
- name: Setup Dart SDK Step 6
run: sudo apt install /tmp/dart_2.19.6-1_amd64.deb
- uses: actions/checkout@v3
- name: Install dependencies
run: PATH="$PATH:/usr/lib/dart/bin" dart pub get
- name: Run tests
run: PATH="$PATH:/usr/lib/dart/bin" dart run build_runner test

fail_if_pull_request_is_draft:
if: github.event.pull_request.draft == true
runs-on: ubuntu-18.04
steps:
- name: Fails in order to indicate that pull request needs to be marked as ready to review and unit tests workflow needs to pass.
run: exit 1
- name: Fails in order to indicate that pull request needs to be marked as ready to review and unit tests workflow needs to pass.
run: exit 1
44 changes: 22 additions & 22 deletions .github/workflows/dart_formatting.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
name: Dart Formatting

on:
on:
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
types: [ opened, synchronize, reopened, ready_for_review ]

jobs:
check_formatting:
Expand All @@ -11,27 +11,27 @@ jobs:
runs-on: ubuntu-22.04

steps:
- name: Setup Dart SDK Step 1
run: sudo apt-get update
- name: Setup Dart SDK Step 2
run: sudo apt-get install apt-transport-https
- name: Setup Dart SDK Step 3
run: sudo sh -c 'wget -qO- https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add -'
- name: Setup Dart SDK Step 4
run: sudo sh -c 'wget -qO- https://storage.googleapis.com/download.dartlang.org/linux/debian/dart_stable.list > /etc/apt/sources.list.d/dart_stable.list'
- name: Setup Dart SDK Step 5
run: wget -O /tmp/dart_2.13.4-1_amd64.deb https://storage.googleapis.com/dart-archive/channels/stable/release/2.13.4/linux_packages/dart_2.13.4-1_amd64.deb
- name: Setup Dart SDK Step 6
run: sudo apt install /tmp/dart_2.13.4-1_amd64.deb
- uses: actions/checkout@v3
- name: Install dependencies
run: PATH="$PATH:/usr/lib/dart/bin" pub get
- name: Verify formatting
run: dart format -l 110 --output=none --set-exit-if-changed .
- name: Setup Dart SDK Step 1
run: sudo apt-get update
- name: Setup Dart SDK Step 2
run: sudo apt-get install apt-transport-https
- name: Setup Dart SDK Step 3
run: sudo sh -c 'wget -qO- https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add -'
- name: Setup Dart SDK Step 4
run: sudo sh -c 'wget -qO- https://storage.googleapis.com/download.dartlang.org/linux/debian/dart_stable.list > /etc/apt/sources.list.d/dart_stable.list'
- name: Setup Dart SDK Step 5
run: wget -O /tmp/dart_2.19.6-1_amd64.deb https://storage.googleapis.com/dart-archive/channels/stable/release/2.19.6/linux_packages/dart_2.19.6-1_amd64.deb
- name: Setup Dart SDK Step 6
run: sudo apt install /tmp/dart_2.19.6-1_amd64.deb
- uses: actions/checkout@v3
- name: Install dependencies
run: PATH="$PATH:/usr/lib/dart/bin" dart pub get
- name: Verify formatting
run: dart format -l 110 --output=none --set-exit-if-changed .

fail_if_pull_request_is_draft:
if: github.event.pull_request.draft == true
runs-on: ubuntu-18.04
steps:
- name: Fails in order to indicate that pull request needs to be marked as ready to review and formatting workflow needs to pass.
run: exit 1
- name: Fails in order to indicate that pull request needs to be marked as ready to review and formatting workflow needs to pass.
run: exit 1
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
# Remove the following pattern if you wish to check in your lock file
# pubspec.lock

# I used this to add `// @dart=2.9` to the top of all dart files
add-line.py

# Conventional directory for build outputs
build/

Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@ server](https://dart.dev/tools/webdev#serve).

Sometimes it may be necessary to clean out the generated files and cache if this has an error. See the file `clean.sh`, which has this line: `dart run build_runner clean`. Also see `remove_g.sh`, which removes all `.g.dart` files from the project, which can also help to fix compilation errors.

If that does not work, try `dart run build_runner clean --delete-conflicting-outputs`.
If that does not work, try `dart run build_runner build --delete-conflicting-outputs`, and then run `webdev serve`.

Running `webdev serve --release` will compile the project in production mode (instead of development mode), which is claimed to be faster in principle if you are not doing development and just want to run scadnano offline.
However, in scadnano, it doesn't appear to make a big difference whether development or production mode is used.
Expand Down
15 changes: 14 additions & 1 deletion analysis_options.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,23 @@ analyzer:
uri_has_not_been_generated: ignore
hash_and_equals: ignore
unused_import: ignore
plugins:
- over_react
# exclude:
# - path/to/excluded/files/**

# rules: https://workiva.github.io/over_react/analyzer_plugin/lints/
over_react:
errors:
over_react_required_props: error
# I'd like the next but it mistakenly says I can do this when I can't, e.g., when using
# the spread operator, a for loop, or a conditional expression
over_react_variadic_children: ignore
# over_react_boilerplate_error: error
# over_react_incorrect_doc_comment_location: warning
# over_react_unnecessary_key: info
# over_react_pseudo_static_lifecycle: ignore

# Lint rules and documentation, see http://dart-lang.github.io/linter/lints
linter:
rules:
Expand All @@ -20,4 +34,3 @@ linter:
- test_types_in_equals
- unrelated_type_equality_checks
- valid_regexps

4 changes: 4 additions & 0 deletions clean.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
dart run build_runner clean
dart run build_runner build --delete-conflicting-outputs


5 changes: 0 additions & 5 deletions clean.sh

This file was deleted.

Loading

0 comments on commit 38240c1

Please sign in to comment.