Skip to content

[native_assets_cli] Fix syntax required fields #2116

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 20, 2025
Merged

Conversation

dcharkes
Copy link
Collaborator

Closes #2039

Makes fields required in the syntax instead of semantic errors. The code for the semantic errors is simply deleted now.

Copy link

PR Health

Breaking changes ✔️
Package Change Current Version New Version Needed Version Looking good?
Changelog Entry ✔️
Package Changed Files

Changes to files need to be accounted for in their respective changelogs.

API leaks ✔️

The following packages contain symbols visible in the public API, but not exported by the library. Export these symbols or remove them from your publicly visible API.

Package Leaked API symbols
License Headers ✔️
// Copyright (c) 2025, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
Files
no missing headers

All source files should start with a license header.

Unrelated files missing license headers
Files
pkgs/jni/lib/src/third_party/generated_bindings.dart
pkgs/objective_c/lib/src/ns_input_stream.dart

@dcharkes dcharkes force-pushed the syntax-required-fields branch 2 times, most recently from 30849cb to d725cbb Compare March 20, 2025 11:58
@@ -87,7 +87,7 @@ final class CodeAsset {
required LinkMode linkMode,
required OS os,
Uri? file,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a style question, and not something for the current PR, but I personally like setting nullable parameter as required to make people think about if they want to leave out the argument.

Copy link
Collaborator Author

@dcharkes dcharkes Mar 20, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do like that idea in this context. It means that the semantic layer around it explicitly has to pass null. And most likely if we're adding a new optional field, we should not be forgetting to pass it from the semantic API to the syntax.

Edit: err, this is the semantic API used by users. It would make file: null for all code assets with the link mode not requiring a file. I think that might be overly verbose.

Base automatically changed from syntax-validation to main March 20, 2025 13:29
@dcharkes dcharkes force-pushed the syntax-required-fields branch from d725cbb to a56ca2a Compare March 20, 2025 13:30
@dcharkes dcharkes merged commit 6297739 into main Mar 20, 2025
45 checks passed
@dcharkes dcharkes deleted the syntax-required-fields branch March 20, 2025 13:37
@coveralls
Copy link

Coverage Status

coverage: 80.542% (-5.4%) from 85.933%
when pulling a56ca2a on syntax-required-fields
into 4e534d3 on main.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[native_assets_cli] input.config.code.android.target_ndk_api should be required in JSON
4 participants