-
Notifications
You must be signed in to change notification settings - Fork 740
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
Add README.md As Primary Documentation File #42689
Add README.md As Primary Documentation File #42689
Conversation
compiler/ballerina-lang/src/main/java/io/ballerina/projects/BalaWriter.java
Outdated
Show resolved
Hide resolved
6728e23
to
998b97c
Compare
// Checks if Package.md is present and issues a warning | ||
Path packageMd = project.sourceRoot().resolve(ProjectConstants.PACKAGE_MD_FILE_NAME); | ||
if (packageMd.toFile().exists()) { | ||
String warning = """ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's use the below API to create the diagnostic
Line 41 in adec063
public static Diagnostic createDiagnostic(DiagnosticInfo diagnosticInfo, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's introduce DEPRECATED_DOC_FILE("BCE5601", "deprecated.doc.file")
code for this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So far, we haven't added any diagnostics in the Command classes. If it's an error we either throw a ProjectException
. If it's a warning we just print them.
I think printing the warning is fine. Otherwise we'll have to introduce diagnostics to PackCommand
, move all the current error/warning printing to diagnostics instead.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Discussed this offline with @azinneera and decided to add the warning in the format of a diagnostic.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@khadijahazward Let's remove the space before and after the warning message. It can be a simple string declaration.
i.e String warning = "The use of Package.md and Module.md is deprecated. Update the package to add a README.md file."
cli/ballerina-cli/src/main/java/io/ballerina/cli/cmd/PackCommand.java
Outdated
Show resolved
Hide resolved
2077c72
to
751fffe
Compare
cli/ballerina-cli/src/main/java/io/ballerina/cli/cmd/CommandUtil.java
Outdated
Show resolved
Hide resolved
751fffe
to
4380c82
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #42689 +/- ##
============================================
+ Coverage 76.80% 77.19% +0.39%
+ Complexity 53972 51288 -2684
============================================
Files 2924 2929 +5
Lines 203952 204429 +477
Branches 26597 26669 +72
============================================
+ Hits 156638 157812 +1174
+ Misses 38777 38054 -723
- Partials 8537 8563 +26 ☔ View full report in Codecov by Sentry. |
4380c82
to
62b003b
Compare
62b003b
to
322d2cf
Compare
Purpose
Partially Fixes #42981
Approach
Samples
Remarks
Check List