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

Make the formatter sort imports by default. #6855

Merged
merged 1 commit into from
Dec 24, 2024

Conversation

gilbens-starkware
Copy link
Contributor

@gilbens-starkware gilbens-starkware commented Dec 10, 2024

No description provided.

@reviewable-StarkWare
Copy link

This change is Reviewable

Copy link
Member

@mkaput mkaput left a comment

Choose a reason for hiding this comment

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

Reviewable status: 0 of 9 files reviewed, 1 unresolved discussion (waiting on @dean-starkware, @gilbens-starkware, and @orizi)


a discussion (no related file):
This is kind of a breaking change, isn't it? Upgrading Cairo will make CIs fail suddenly. In Rust this would mandate edition change.

Copy link
Collaborator

@orizi orizi left a comment

Choose a reason for hiding this comment

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

Reviewed 9 of 9 files at r1, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @dean-starkware and @mkaput)


a discussion (no related file):

Previously, mkaput (Marek Kaput) wrote…

This is kind of a breaking change, isn't it? Upgrading Cairo will make CIs fail suddenly. In Rust this would mandate edition change.

i think this is ok in this case - as the update itself is still version by version, and part of the "update PR" will be the fixed formatting.

otherwise any formatting update is considered a breaking change.

@mkaput mkaput requested review from mkaput and removed request for mkaput December 10, 2024 09:54
Copy link
Member

@mkaput mkaput left a comment

Choose a reason for hiding this comment

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

Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @dean-starkware and @orizi)


a discussion (no related file):

Previously, orizi wrote…

i think this is ok in this case - as the update itself is still version by version, and part of the "update PR" will be the fixed formatting.

otherwise any formatting update is considered a breaking change.

on the other hand: if you make this on-by-default then why give users an option to disable it after all?

Copy link
Member

@mkaput mkaput left a comment

Choose a reason for hiding this comment

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

Reviewed 9 of 9 files at r1, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @dean-starkware and @orizi)

Copy link
Collaborator

@orizi orizi left a comment

Choose a reason for hiding this comment

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

Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @dean-starkware and @mkaput)


a discussion (no related file):

Previously, mkaput (Marek Kaput) wrote…

on the other hand: if you make this on-by-default then why give users an option to disable it after all?

for backwards compatibility in more specific cases.

Copy link
Member

@mkaput mkaput left a comment

Choose a reason for hiding this comment

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

Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @dean-starkware and @orizi)


a discussion (no related file):

Previously, orizi wrote…

for backwards compatibility in more specific cases.

unblocking, I don't have a strong opinion on this

Copy link
Collaborator

@dean-starkware dean-starkware left a comment

Choose a reason for hiding this comment

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

:lgtm:

Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @orizi)

Copy link
Collaborator

@orizi orizi left a comment

Choose a reason for hiding this comment

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

Reviewed 7 of 7 files at r2, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @gilbens-starkware)


a discussion (no related file):
make the fmt binary affect this in a previous PR first.

Copy link
Contributor Author

@gilbens-starkware gilbens-starkware left a comment

Choose a reason for hiding this comment

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

Reviewable status: 11 of 121 files reviewed, 1 unresolved discussion (waiting on @mkaput and @orizi)


a discussion (no related file):

Previously, orizi wrote…

make the fmt binary affect this in a previous PR first.

Done.

Copy link
Collaborator

@orizi orizi left a comment

Choose a reason for hiding this comment

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

Reviewed all commit messages.
Reviewable status: 11 of 128 files reviewed, 2 unresolved discussions (waiting on @gilbens-starkware and @mkaput)


corelib/src/array.cairo line 66 at r5 (raw file):

#[feature("deprecated-index-traits")]
use crate::traits::IndexView;
use crate::{RangeCheck, box::BoxTrait, iter::Iterator, metaprogramming::TypeEqual, serde::Serde};

should probably additionally improve this before.

Code quote:

use crate::{RangeCheck, box::BoxTrait, iter::Iterator, metaprogramming::TypeEqual, serde::Serde};

Copy link
Contributor Author

@gilbens-starkware gilbens-starkware left a comment

Choose a reason for hiding this comment

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

Reviewable status: 11 of 128 files reviewed, 2 unresolved discussions (waiting on @mkaput and @orizi)


corelib/src/array.cairo line 66 at r5 (raw file):

Previously, orizi wrote…

should probably additionally improve this before.

You mean special handling of crate?

Copy link
Collaborator

@orizi orizi left a comment

Choose a reason for hiding this comment

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

Reviewable status: 11 of 128 files reviewed, 1 unresolved discussion (waiting on @gilbens-starkware and @mkaput)


corelib/src/array.cairo line 66 at r5 (raw file):

Previously, gilbens-starkware (Gil Ben-Shachar) wrote…

You mean special handling of crate?

yes.

probably super as well.

@gilbens-starkware gilbens-starkware changed the base branch from spr/main/8d2ad88e to main December 22, 2024 10:08
@gilbens-starkware gilbens-starkware changed the base branch from main to spr/main/8d2ad88e December 22, 2024 10:08
Copy link
Collaborator

@orizi orizi left a comment

Choose a reason for hiding this comment

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

Reviewed 1 of 8 files at r5, 8 of 55 files at r6, all commit messages.
Reviewable status: 12 of 129 files reviewed, 1 unresolved discussion (waiting on @gilbens-starkware and @mkaput)


corelib/src/bytes_31.cairo line 37 at r6 (raw file):

extern fn bytes31_to_felt252(value: bytes31) -> felt252 nopanic;

/// A trait for accessing a specific byte of ampl CollectionsBreakingBeha `bytes31` type.

revert

Copy link
Collaborator

@orizi orizi left a comment

Choose a reason for hiding this comment

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

Reviewed 17 of 110 files at r3, 15 of 55 files at r6.
Reviewable status: 44 of 129 files reviewed, 2 unresolved discussions (waiting on @gilbens-starkware and @mkaput)


corelib/src/starknet.cairo line 74 at r6 (raw file):

pub use info::v2::{
    ExecutionInfo as ExecutionInfo, ResourceBounds as ResourcesBounds, TxInfo as TxInfo,
};

Suggestion:

pub use info::v2::{
    ExecutionInfo, ResourceBounds, TxInfo,
};

@gilbens-starkware gilbens-starkware changed the base branch from spr/main/8d2ad88e to main December 23, 2024 08:25
Copy link
Contributor Author

@gilbens-starkware gilbens-starkware left a comment

Choose a reason for hiding this comment

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

Reviewable status: 43 of 129 files reviewed, 2 unresolved discussions (waiting on @mkaput and @orizi)


corelib/src/bytes_31.cairo line 37 at r6 (raw file):

Previously, orizi wrote…

revert

Done.


corelib/src/starknet.cairo line 74 at r6 (raw file):

pub use info::v2::{
    ExecutionInfo as ExecutionInfo, ResourceBounds as ResourcesBounds, TxInfo as TxInfo,
};

Done.
Notice that for ResourceBounds it's singular and plural, so I kept it as is.

Copy link
Collaborator

@orizi orizi left a comment

Choose a reason for hiding this comment

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

Reviewed all commit messages.
Reviewable status: 41 of 132 files reviewed, 3 unresolved discussions (waiting on @gilbens-starkware and @mkaput)


corelib/src/array.cairo line 148 at r8 (raw file):

    /// ```
    fn append_span<+Clone<T>, +Drop<T>>(ref self: Array<T>, mut span: Span<T>) {
        // let x = Some(5);

.

Code quote:

use crate::traits::IndexView;
use Option::{None, Some};
/// A collection of elements of the same type continuous in memory.
#[derive(Drop)]
pub extern type Array<T>;
    /// assert!(arr == array![1, 2, 3]);
    /// ```
    fn append_span<+Clone<T>, +Drop<T>>(ref self: Array<T>, mut span: Span<T>) {
        // let x = Some(5);

Copy link
Collaborator

@orizi orizi left a comment

Choose a reason for hiding this comment

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

Reviewed 2 of 110 files at r3, 1 of 55 files at r6, 1 of 1 files at r7, 1 of 5 files at r8, 1 of 4 files at r9, all commit messages.
Reviewable status: 47 of 132 files reviewed, all discussions resolved (waiting on @mkaput)

Copy link
Contributor Author

@gilbens-starkware gilbens-starkware left a comment

Choose a reason for hiding this comment

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

Reviewable status: 47 of 132 files reviewed, all discussions resolved (waiting on @mkaput and @orizi)


corelib/src/array.cairo line 148 at r8 (raw file):

Previously, orizi wrote…

.

Done.

Copy link
Collaborator

@orizi orizi left a comment

Choose a reason for hiding this comment

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

:lgtm:

Reviewed 28 of 110 files at r3, 1 of 1 files at r4, 9 of 55 files at r6, 1 of 4 files at r9, 80 of 80 files at r10, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @gilbens-starkware)

@gilbens-starkware gilbens-starkware added this pull request to the merge queue Dec 24, 2024
Merged via the queue into main with commit 9bc36f9 Dec 24, 2024
94 checks passed
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.

5 participants