Skip to content
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

Change forc doc --manifest-path to forc doc --path #6109

Closed
wants to merge 17 commits into from

Conversation

alexanderblv
Copy link

Description

Closes #5789

Checklist

  • I have linked to any relevant issues.
  • I have commented my code, particularly in hard-to-understand areas.
  • I have updated the documentation where relevant (API docs, the reference, and the Sway book).
  • I have added tests that prove my fix is effective or that my feature works.
  • I have added (or requested a maintainer to add) the necessary Breaking* or New Feature labels where relevant.
  • I have done my best to ensure that my PR adheres to the Fuel Labs Code Review Standards.
  • I have requested a review from the relevant team or maintainers.

@alexanderblv alexanderblv requested review from a team as code owners June 11, 2024 15:41
@CLAassistant
Copy link

CLAassistant commented Jun 11, 2024

CLA assistant check
All committers have signed the CLA.

Copy link
Member

@kayagokalp kayagokalp left a comment

Choose a reason for hiding this comment

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

Hello, thanks for the PR. It seems like you just updated docs and readme, not the command itself.

pub manifest_path: Option<String>,

@alexanderblv
Copy link
Author

Hello, thanks for the PR. It seems like you just updated docs and readme, not the command itself.

pub manifest_path: Option<String>,

I understand correctly that I have to update manifest_path in all sway files?

IGI-111
IGI-111 previously approved these changes Jun 13, 2024
Copy link
Member

@sdankel sdankel left a comment

Choose a reason for hiding this comment

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

I would prefer to make --path a shorthand for --manifest-path (keeping both as valid CLI flags) so as not to break any existing users.

@alexanderblv
Copy link
Author

I would prefer to make --path a shorthand for --manifest-path (keeping both as valid CLI flags) so as not to break any existing users.

So you want to keep both run as valid?
run: forc doc --manifest-path ./sway-lib-std
run: forc doc --path ./sway-lib-std

I'm not sure if the duplicates will lead to good code performance, but if you think so, then I'll do it.

Copy link
Member

@sdankel sdankel left a comment

Choose a reason for hiding this comment

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

I would prefer to make --path a shorthand for --manifest-path (keeping both as valid CLI flags) so as not to break any existing users.

So you want to keep both run as valid? run: forc doc --manifest-path ./sway-lib-std run: forc doc --path ./sway-lib-std

I'm not sure if the duplicates will lead to good code performance, but if you think so, then I'll do it.

It shouldn't affect the code performance at all. You can use clap's alias:

    #[clap(long, alias="manifest-path")]
    pub path: Option<String>,

Please fix the compilation errors. You need to update manifest_path in the other places it is used.

Copy link
Member

@kayagokalp kayagokalp left a comment

Choose a reason for hiding this comment

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

Current ci.yml file is invalid, I suggested the correct version of it. But also I think we should not test whole sdk-harness twice just to see that a flag is working with different alias to preserve some valuable CI time. Let's keep the addition to the code to support it for users but remove it from ci. I think @sdankel originally wanted you to add the support to the code not to CI but pinging her in any case.

.github/workflows/ci.yml Outdated Show resolved Hide resolved
.github/workflows/gh-pages.yml Outdated Show resolved Hide resolved
alexanderblv and others added 2 commits June 24, 2024 18:49
Comment on lines 25 to +27
#[clap(long)]
pub manifest_path: Option<String>,
pub path: Option<String>,
Copy link
Member

@kayagokalp kayagokalp Jun 24, 2024

Choose a reason for hiding this comment

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

We can probably use @sdankel's suggestion here:

Suggested change
#[clap(long)]
pub manifest_path: Option<String>,
pub path: Option<String>,
#[clap(long, alias="manifest-path")]
pub path: Option<String>,

@sdankel
Copy link
Member

sdankel commented Jun 24, 2024

I absolutely agree with @kayagokalp , we should not run forc-doc twice in CI. This code still doesn't compile, so I'm going to close this PR. This isn't really close to what we're looking for and I want to leave the opportunity for another contributor to pick up this task.

@sdankel sdankel closed this Jun 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Change forc doc --manifest-path to forc doc --path
6 participants