Skip to content

Use ruff format instead of black pre-commit hook? #15757

Closed

Description

@MridulS

Blocked by

Modification to https://github.com/astropy/astropy-APEs/blob/main/APE20.rst

What is the problem this feature will solve?

The ruff formatter is in "production-ready beta" now, and it's supposed to be a 99.9% drop in replacement for black. Astropy currently uses ruff for linting and black for formatting with pre-commit hooks, moving to ruff should help removing one hook and also making the codestyle tox step run quickly. I ran the ruff formatter on astropy and it made minimal changes (~35 places).

Describe the desired outcome

Remove black from pre-commit-hooks and add ruff format.

Additional context

No response

Activity

  1. github-actions commented on Dec 17, 2023

    @github-actions
    Contributor

    Welcome to Astropy 👋 and thank you for your first issue!

    A project member will respond to you as soon as possible; in the meantime, please double-check the guidelines for submitting issues and make sure you've provided the requested details.

    GitHub issues in the Astropy repository are used to track bug reports and feature requests; If your issue poses a question about how to use Astropy, please instead raise your question in the Astropy Discourse user forum and close this issue.

    If you feel that this issue has not been responded to in a timely manner, please send a message directly to the development mailing list. If the issue is urgent or sensitive in nature (e.g., a security vulnerability) please send an e-mail directly to the private e-mail [email protected].

  2. neutrinoceros commented on Dec 18, 2023

    @neutrinoceros
    Contributor
  3. taldcroft commented on Dec 19, 2023

    @taldcroft
    Member

    For the record I am very much in favor of migrating to ruff to replace black.

    As noted, APE-20 will need modifications. It is too bad we didn't appreciate at the time that APE-20 was about "black formatting" (i.e. a style of formatting) instead of an implementation of black formatting using the black package.

  4. neutrinoceros commented on Dec 19, 2023

    @neutrinoceros
    Contributor

    @pllim why did you apply the "upstream fix required" label ?

  5. pllim commented on Dec 19, 2023

    @pllim
    Member

    Because in #15757 (comment) "As noted, APE-20 will need modifications."

  6. neutrinoceros commented on Dec 19, 2023

    @neutrinoceros
    Contributor

    Oh I see, I didn't get that APEs were "upstream", but that makes sense !

  7. pllim commented on Dec 19, 2023

    @pllim
    Member

    Upstream in a sense that the changes to APE has to be proposed, debated, accepted, and merged first before we can proceed here. 😅

  8. taldcroft commented on Dec 19, 2023

    @taldcroft
    Member
  9. pllim commented on Feb 26, 2024

    @pllim
    Member

    Weird that #16029 didn't auto close this.

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions