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

Cache Cargo registry on GitHub Actions #3

Merged
merged 1 commit into from
Aug 10, 2022
Merged

Conversation

charliermarsh
Copy link
Member

No description provided.

@charliermarsh charliermarsh force-pushed the charlie/cache branch 3 times, most recently from 602236f to 3642a02 Compare August 10, 2022 20:36
@charliermarsh charliermarsh merged commit 201ccc8 into main Aug 10, 2022
@charliermarsh charliermarsh deleted the charlie/cache branch August 10, 2022 20:41
not-my-profile added a commit to not-my-profile/ruff that referenced this pull request Jan 19, 2023
…n ruff

This commit series removes the following associated
function from the Violation trait:

    fn placeholder() -> Self;

ruff previously used this placeholder approach for the messages it
listed in the README and displayed when invoked with --explain <code>.

This approach is suboptimal for three reasons:

1. The placeholder implementations are completely boring code since they
   just initialize the struct with some dummy values.

2. Displaying concrete error messages with arbitrary interpolated values
   can be confusing for the user since they might not recognize that the
   values are interpolated.

3. Some violations have varying format strings depending on the
   violation which could not be documented with the previous approach
   (while we could have changed the signature to return Vec<Self> this
   would still very much suffer from astral-sh#2 and astral-sh#3).

We therefore drop Violation::placeholder in favor of a new macro-based
approach, explaind in commit 4/5.

Violation::placeholder is only invoked via Rule::kind, so we firstly
have to get rid of all Rule::kind invocations ... this commit starts
removing the trivial cases.
not-my-profile added a commit to not-my-profile/ruff that referenced this pull request Jan 19, 2023
…n ruff

This commit series removes the following associated
function from the Violation trait:

    fn placeholder() -> Self;

ruff previously used this placeholder approach for the messages it
listed in the README and displayed when invoked with --explain <code>.

This approach is suboptimal for three reasons:

1. The placeholder implementations are completely boring code since they
   just initialize the struct with some dummy values.

2. Displaying concrete error messages with arbitrary interpolated values
   can be confusing for the user since they might not recognize that the
   values are interpolated.

3. Some violations have varying format strings depending on the
   violation which could not be documented with the previous approach
   (while we could have changed the signature to return Vec<Self> this
   would still very much suffer from astral-sh#2 and astral-sh#3).

We therefore drop Violation::placeholder in favor of a new macro-based
approach, explaind in commit 4/5.

Violation::placeholder is only invoked via Rule::kind, so we firstly
have to get rid of all Rule::kind invocations ... this commit starts
removing the trivial cases.
not-my-profile added a commit to not-my-profile/ruff that referenced this pull request Jan 19, 2023
This commit series removes the following associated
function from the Violation trait:

    fn placeholder() -> Self;

ruff previously used this placeholder approach for the messages it
listed in the README and displayed when invoked with --explain <code>.

This approach is suboptimal for three reasons:

1. The placeholder implementations are completely boring code since they
   just initialize the struct with some dummy values.

2. Displaying concrete error messages with arbitrary interpolated values
   can be confusing for the user since they might not recognize that the
   values are interpolated.

3. Some violations have varying format strings depending on the
   violation which could not be documented with the previous approach
   (while we could have changed the signature to return Vec<Self> this
   would still very much suffer from astral-sh#2 and astral-sh#3).

We therefore drop Violation::placeholder in favor of a new macro-based
approach, explaind in commit 4/5.

Violation::placeholder is only invoked via Rule::kind, so we firstly
have to get rid of all Rule::kind invocations ... this commit starts
removing the trivial cases.
charliermarsh pushed a commit that referenced this pull request Feb 14, 2023
This PR makes the formatter code more idiomatic by:

* Unifying sequential `write!` calls into a single `write`
* Replace `format_args![item]` with `item` (`format_args` is to format multiple arguments). You can think of `format_args` as a `Format` implementation for tuples of arbitrary size
* Return an object that implements `Format` for `join_names` so that it can be used as part of the DSL `write!(f, [space, join_names(names)])`
* Use `space` instead of `text(" ")`
charliermarsh pushed a commit that referenced this pull request Feb 14, 2023
This PR makes the formatter code more idiomatic by:

* Unifying sequential `write!` calls into a single `write`
* Replace `format_args![item]` with `item` (`format_args` is to format multiple arguments). You can think of `format_args` as a `Format` implementation for tuples of arbitrary size
* Return an object that implements `Format` for `join_names` so that it can be used as part of the DSL `write!(f, [space, join_names(names)])`
* Use `space` instead of `text(" ")`
charliermarsh pushed a commit that referenced this pull request Feb 14, 2023
This PR makes the formatter code more idiomatic by:

* Unifying sequential `write!` calls into a single `write`
* Replace `format_args![item]` with `item` (`format_args` is to format multiple arguments). You can think of `format_args` as a `Format` implementation for tuples of arbitrary size
* Return an object that implements `Format` for `join_names` so that it can be used as part of the DSL `write!(f, [space, join_names(names)])`
* Use `space` instead of `text(" ")`
charliermarsh pushed a commit that referenced this pull request Feb 14, 2023
This PR makes the formatter code more idiomatic by:

* Unifying sequential `write!` calls into a single `write`
* Replace `format_args![item]` with `item` (`format_args` is to format multiple arguments). You can think of `format_args` as a `Format` implementation for tuples of arbitrary size
* Return an object that implements `Format` for `join_names` so that it can be used as part of the DSL `write!(f, [space, join_names(names)])`
* Use `space` instead of `text(" ")`
charliermarsh pushed a commit that referenced this pull request Feb 14, 2023
This PR makes the formatter code more idiomatic by:

* Unifying sequential `write!` calls into a single `write`
* Replace `format_args![item]` with `item` (`format_args` is to format multiple arguments). You can think of `format_args` as a `Format` implementation for tuples of arbitrary size
* Return an object that implements `Format` for `join_names` so that it can be used as part of the DSL `write!(f, [space, join_names(names)])`
* Use `space` instead of `text(" ")`
charliermarsh pushed a commit that referenced this pull request Feb 15, 2023
This PR makes the formatter code more idiomatic by:

* Unifying sequential `write!` calls into a single `write`
* Replace `format_args![item]` with `item` (`format_args` is to format multiple arguments). You can think of `format_args` as a `Format` implementation for tuples of arbitrary size
* Return an object that implements `Format` for `join_names` so that it can be used as part of the DSL `write!(f, [space, join_names(names)])`
* Use `space` instead of `text(" ")`
charliermarsh pushed a commit that referenced this pull request Feb 15, 2023
This PR makes the formatter code more idiomatic by:

* Unifying sequential `write!` calls into a single `write`
* Replace `format_args![item]` with `item` (`format_args` is to format multiple arguments). You can think of `format_args` as a `Format` implementation for tuples of arbitrary size
* Return an object that implements `Format` for `join_names` so that it can be used as part of the DSL `write!(f, [space, join_names(names)])`
* Use `space` instead of `text(" ")`
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.

None yet

1 participant