Coder Social home page Coder Social logo

template.py's People

Contributors

tlgs avatar

Stargazers

 avatar

Watchers

 avatar  avatar

template.py's Issues

The `bare` project type doesn't respect set Ruff rules in `pyproject.toml`

Since Ruff rules are specified in pyproject.toml and this file is removed for the bare project type, Ruff hooks will revert to using the default configuration.

This is bad because all project types should ideally be linted the same way.

Possible solutions:

  1. add a pyproject.toml for the bare project type - not ideal because the point behind this project type is for the repo to resemble a collection of independent Python scripts and not a cohesive Python project.
  2. add arguments to the Ruff hooks in .pre-commit-config.yaml for the bare project type - not ideal because the arguments would likely become unwieldy. They would need to be duplicated for the ruff and ruff-format hooks and they would need to be synced with the configuration in pyproject.toml.
  3. add a ruff.toml configuration file for the bare project type - not ideal because the file would need to be synced with the configuration in pyproject.toml. Plus it's another file to manage.
  4. move the Ruff configuration to ruff.toml for all project types - not ideal because I'd prefer if file configuration was always set in the pyproject.toml. Plus it's another file to manage.
  5. remove custom Ruff configuration - not ideal because I feel like Ruff's default configuration is a little bit tame. I like the idea of removing code from the project, though.
  6. remove the bare project type - maybe a bit extreme or maybe not such a bad idea. I mostly had repositories like Advent of Code in mind when I thought about this option. Perhaps adding this was a bit of feature creep and it's not that useful?

I think the best way to go about this is a variation of option (3): create a ruff.toml file in which to keep the Ruff configuration and use Cookiecutter's machinery to move this configuration to pyproject.toml on the other project types. Or maybe keep the pyproject.toml configuration as is and extract the tool.ruff table into a ruff.toml file for the bare project type. This solves the keep-sync problem at the cost of more code.

Ah, that option has the benefit on deleting the wonky if in the .pre-commit-config.yaml template: the bare project will have a TOML file to deal with now!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.