atsign-foundation / at_client_sdk

The Dart implementation of atSDK used for implementing Atsign's technology into other software
https://pub.dev/publishers/atsign.org/packages
BSD 3-Clause "New" or "Revised" License
1.46k stars 31 forks source link

add a check in github build pipeline for pull requests that contain unformatted code #880

Closed murali-shris closed 1 year ago

murali-shris commented 1 year ago

Is your feature request related to a problem? Please describe.

Describe the solution you'd like

Describe alternatives you've considered

Additional context

No response

murali-shris commented 1 year ago

@cpswan I will create a example for unformatted code and attach further details here

murali-shris commented 1 year ago

https://github.com/atsign-foundation/at_client_sdk/tree/unformatted_code_sample commit for unformatted code: https://github.com/atsign-foundation/at_client_sdk/commit/85ca7f5d837331d898aa064218259ccc3faf715a murali@murali-Latitude-3460:~/git/at_protocol/at_client_sdk/packages/at_client$ dart format . Formatted lib/src/client/at_client_impl.dart Formatted 146 files (1 changed) in 1.79 seconds.

murali-shris commented 1 year ago

check pub score through pana. This one is nice to have but not a pressing requirement. Compare actual pub score with latest version of published package vs final output of below command. murali@murali-Latitude-3460:~/tmp/at_client$ dart pub global run pana . INFO Running /usr/lib/dart/bin/dart --no-analytics --version... INFO Running flutter --suppress-analytics --no-version-check --version --machine... WARNING pana might update or modify files in .. Analysis will begin in 15 seconds, hit CTRL+C to abort it. To remove this message, use --no-warning. INFO Running git rev-parse --show-toplevel... INFO Running /usr/lib/dart/bin/dart --no-analytics pub get --no-example... INFO Running /usr/lib/dart/bin/dart --no-analytics pub outdated --json --up-to-date --no-dev-dependencies --no-dependency-overrides... INFO Analyzing package... INFO Running /usr/lib/dart/bin/dart --no-analytics analyze --format machine lib... INFO Running git init... INFO Running git remote add origin https://github.com/atsign-foundation/at_client_sdk... INFO Running git remote show origin... INFO Running git fetch --depth 1 --no-recurse-submodules origin trunk... INFO Running git ls-tree -r --name-only --full-tree origin/trunk... INFO Running git show origin/trunk:packages/at_client/example/pubspec.yaml... INFO Running git show origin/trunk:packages/at_client/pubspec.yaml... INFO Running git show origin/trunk:packages/at_client_mobile/example/pubspec.yaml... INFO Running git show origin/trunk:packages/at_client_mobile/pubspec.yaml... INFO Running git show origin/trunk:tests/at_end2end_test/pubspec.yaml... INFO Running git show origin/trunk:tests/at_functional_test/pubspec.yaml... INFO Running /usr/lib/dart/bin/dart --no-analytics format --output=none --set-exit-if-changed /tmp/pana_MSLWBW/./lib...

✓ Follow Dart file conventions (30 / 30)

[*] 10/10 points: Provide a valid pubspec.yaml

[*] 5/5 points: Provide a valid README.md

[*] 5/5 points: Provide a valid CHANGELOG.md

[*] 10/10 points: Use an OSI-approved license

Detected license: BSD-3-Clause.

✓ Provide documentation (10 / 10)

[*] 10/10 points: Package has an example

✓ Platform support (20 / 20)

[*] 20/20 points: Supports 5 of 6 possible platforms (iOS, Android, Web, Windows, MacOS, Linux)

These platforms are not supported:

Package not compatible with platform Web Because: * `package:at_client/at_client.dart` that imports: * `package:at_client/src/listener/sync_progress_listener.dart` that imports: * `package:at_client/src/service/sync/sync_status.dart` that imports: * `package:at_client/src/service/sync_service_impl.dart` that imports: * `package:at_utils/at_utils.dart` that imports: * `package:at_utils/at_logger.dart` that imports: * `package:at_utils/src/logging/atsignlogger.dart` that imports: * `package:at_utils/src/logging/handlers.dart` that imports: * `dart:io`

✗ Pass static analysis (20 / 30)

[~] 20/30 points: code has no errors, warnings, lints, or formatting issues

/tmp/pana_MSLWBW/lib/src/client/at_client_impl.dart doesn't match the Dart formatter. To format your files run: `dart format .`

✓ Support up-to-date dependencies (20 / 20)

[*] 10/10 points: All of the package dependencies are supported in the latest version

Package Constraint Compatible Latest
archive ^3.3.5 3.3.5 3.3.5
async ^2.9.0 2.10.0 2.10.0
at_base2e15 ^1.0.0 1.0.0 1.0.0
at_chops ^1.0.0 1.0.0 1.0.0
at_commons ^3.0.34 3.0.34 3.0.34
at_lookup ^3.0.35 3.0.35 3.0.35
at_persistence_secondary_server ^3.0.44 3.0.44 3.0.44
at_persistence_spec ^2.0.10 2.0.10 2.0.10
at_utf7 ^1.0.0 1.0.0 1.0.0
at_utils ^3.0.11 3.0.11 3.0.11
collection ^1.16.0 1.17.0 1.17.0
convert ^3.0.2 3.1.1 3.1.1
cron ^0.5.1 0.5.1 0.5.1
crypto ^3.0.1 3.0.2 3.0.2
crypton ^2.1.0 2.1.0 2.1.0
encrypt ^5.0.1 5.0.1 5.0.1
hive ^2.2.3 2.2.3 2.2.3
http ^0.13.5 0.13.5 0.13.5
internet_connection_checker ^1.0.0+1 1.0.0+1 1.0.0+1
meta ^1.8.0 1.8.0 1.8.0
path ^1.8.2 1.8.3 1.8.3
uuid ^3.0.7 3.0.7 3.0.7
Transitive dependencies |Package|Constraint|Compatible|Latest| |:-|:-|:-|:-| |[`_fe_analyzer_shared`]|-|52.0.0|52.0.0| |[`analyzer`]|-|5.4.0|5.4.0| |[`args`]|-|2.3.1|2.3.1| |[`asn1lib`]|-|1.4.0|1.4.0| |[`boolean_selector`]|-|2.1.1|2.1.1| |[`clock`]|-|1.1.1|1.1.1| |[`coverage`]|-|1.6.1|1.6.1| |[`file`]|-|6.1.4|6.1.4| |[`frontend_server_client`]|-|3.2.0|3.2.0| |[`glob`]|-|2.1.1|2.1.1| |[`http_multi_server`]|-|3.2.1|3.2.1| |[`http_parser`]|-|4.0.2|4.0.2| |[`io`]|-|1.0.3|1.0.3| |[`js`]|-|0.6.5|0.6.6| |[`logging`]|-|1.1.0|1.1.0| |[`matcher`]|-|0.12.14|0.12.14| |[`mime`]|-|1.0.4|1.0.4| |[`mocktail`]|-|0.3.0|0.3.0| |[`mutex`]|-|3.0.1|3.0.1| |[`node_preamble`]|-|2.0.1|2.0.1| |[`package_config`]|-|2.1.0|2.1.0| |[`pointycastle`]|-|3.6.2|3.6.2| |[`pool`]|-|1.5.1|1.5.1| |[`pub_semver`]|-|2.1.3|2.1.3| |[`shelf`]|-|1.4.0|1.4.0| |[`shelf_packages_handler`]|-|3.0.1|3.0.1| |[`shelf_static`]|-|1.1.1|1.1.1| |[`shelf_web_socket`]|-|1.0.3|1.0.3| |[`source_map_stack_trace`]|-|2.1.1|2.1.1| |[`source_maps`]|-|0.10.11|0.10.11| |[`source_span`]|-|1.9.1|1.9.1| |[`stack_trace`]|-|1.11.0|1.11.0| |[`stream_channel`]|-|2.1.1|2.1.1| |[`string_scanner`]|-|1.2.0|1.2.0| |[`term_glyph`]|-|1.2.1|1.2.1| |[`test`]|-|1.22.2|1.22.2| |[`test_api`]|-|0.4.18|0.4.18| |[`test_core`]|-|0.4.22|0.4.22| |[`typed_data`]|-|1.3.1|1.3.1| |[`vm_service`]|-|9.4.0|10.0.0| |[`watcher`]|-|1.0.2|1.0.2| |[`web_socket_channel`]|-|2.3.0|2.3.0| |[`webkit_inspection_protocol`]|-|1.2.0|1.2.0| |[`yaml`]|-|3.1.1|3.1.1|

To reproduce run dart pub outdated --no-dev-dependencies --up-to-date --no-dependency-overrides.

[*] 10/10 points: Package supports latest stable Dart and Flutter SDKs

✓ Support sound null safety (20 / 20)

[*] 20/20 points: Package and dependencies are fully migrated to null safety!

Points: 120/130.

cpswan commented 1 year ago

945 fixes this, and is presently in review. Adjusted to 1 SP.