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

Consider .toml configuration? #15

Open
jenstroeger opened this issue Jul 26, 2021 · 2 comments
Open

Consider .toml configuration? #15

jenstroeger opened this issue Jul 26, 2021 · 2 comments

Comments

@jenstroeger
Copy link

jenstroeger commented Jul 26, 2021

I understand that the Action is written in Node/JavaScript and as such it’s convenient to default to JS/JSON for configuration, e.g. a commitlint.rules.js file.

However, when used in a Python repository this is not really desirable because there the convention is to configure such projects using a pyproject.toml file.

There’s a node package which offers some toml support and I think it would be very useful to add toml configuration support to this Action: by default, read config and rules from JS/JSON files, or an Action yaml option to read config and rules from a toml file, e.g.

    steps:
      - uses: actions/checkout@v2
      - uses: CondeNast/conventional-pull-request-action@main
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
        with:
          commitlintRulesPath: "./pyproject.toml"
          commitlintRulesFormat: "toml"
          commitTitleMatch: "true"
@ferdnyc
Copy link

ferdnyc commented Oct 16, 2021

(I'll butt in, because sure why not?)

I've thought about this some, and I have to say I don't think I agree.

However, when used in a Python repository this is not really desirable because there the convention is to configure such projects using a pyproject.toml file.

But you're not configuring the project here, you're configuring the repository. Specifically, the CI job that runs on that repository, only in a GitHub environment, only when Actions is available and enabled.

Your workflow file (the only place this is used from) is already written in YAML. It's not like you haven't already departed the Python ecosystem. Which is OK, because nothing about what's happening here has the slightest bit to do with Python. It's a GitHub Actions workflow configuration.

Defining the configuration in Python would only make it less accessible to the workflow, while adding nothing to the Python project because it's a configuration that is only active when a JavaScript Action running in a YAML-configured CI container is configured on a (specifically) GitHub code repo.

(And that repo can contain anything, in any language, because git commits are completely content-agnostic. The process is the same whether you're checking in Node modules, website SVG images, Python packages, Ruby gems, or Befunge... whatever collective units you use to describe Befunge programs, I don't know. Befungi?)

...That's my take, anyway.

@jenstroeger
Copy link
Author

Thank you @ferdnyc! I see your point, and it makes sense.

I opened this issue because my Python package cookiecutter repo became a little too crowded with various configuration files, and this one felt like the most alien of the bunch…

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

No branches or pull requests

2 participants