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

Add missing environment variable for config file #188

Merged
merged 3 commits into from
Apr 16, 2022
Merged

Add missing environment variable for config file #188

merged 3 commits into from
Apr 16, 2022

Conversation

Notgnoshi
Copy link
Contributor

Most of the gitlint command-line options have corresponding environment
variables following the format GITLINT_<commandline_option>, added in
69aa5ff.


The only remaining command-line option that's missing a corresponding environment variable is the -c option for overriding individual configuration options.

Additionally, I made the assumption in the documentation that this change would get released in 1.16.0.

I investigated adding tests, but I chose not to for a few, opinionated, reasons

  • This is a quite small change, that follows an existing pattern
  • The most similar environment variable, GITLINT_EXTRA_PATH, does not have a test
  • I did not find a clean way to add a meaningful test, but I'm not very experienced with Python testing methods that interact with the system environment.

@jorisroovers jorisroovers added the status: needs-tests PRs that require tests before they will be accepted label Oct 11, 2021
@jorisroovers
Copy link
Owner

Thanks for this PR. I do think this needs tests.

If I recall correctly, I hadn't added this env var before exactly because the test would require a bit of a different pattern and I didn't want to do that work at the time.

Appreciate the contribution. I'll get this merged at some point, once I find some time.

Most of the gitlint command-line options have corresponding environment
variables following the format GITLINT_<commandline_option>, added in
69aa5ff.
@Notgnoshi
Copy link
Contributor Author

Sorry for taking so long to get back to you. I've added tests for both the GITLINT_CONFIG environment variable, as well as the GITLINT_EXTRA_PATH.

I'd just like to say that I've enjoyed hacking on gitlint -- it was a pleasure to dig into!

Notgnoshi and others added 2 commits March 28, 2022 10:23
Work on adding the GITLINT_CONFIG environment variable brought to
attention that the most similar environment variable,
GITLINT_EXTRA_PATH, was also missing a test.
Fixed a typo and modified paths to match other example paths in the
docs.
@jorisroovers jorisroovers merged commit 25ac68e into jorisroovers:main Apr 16, 2022
@jorisroovers
Copy link
Owner

Made a few minor doc tweaks and merged! Thanks for submitting the PR!

Not sure when I'll push out the next release, likely to be weeks, maybe few months...

jorisroovers pushed a commit that referenced this pull request Apr 16, 2022
Add missing environment variable for config file

Most of the gitlint command-line options have corresponding environment
variables following the format GITLINT_<commandline_option>.
GITLINT_CONFIG was notably missing.

Co-authored-by: Joris Roovers
@Notgnoshi Notgnoshi deleted the ag/config-env branch April 16, 2022 13:21
jorisroovers added a commit that referenced this pull request Nov 16, 2022
- Python 3.11 support
- Last release to support Python 3.6
- Behavior Change: In a future release, gitlint will be switching to use
  `re.search` instead of `re.match` semantics for all rules. (#254)
- gitlint no longer uses the `sh` library by default in an attempt to reduce
  external dependencies.
- `--commits` now also accepts a comma-separated list of commit hashes,
  making it possible to lint a list of non-contiguous commits without invoking
  gitlint multiple times (#283)
- Improved handling of branches that have no commits (#188)
- Support for `GITLINT_CONFIG` env variable (#189)
- Added a new `gitlint-ci` pre-commit hook, making it easier to run gitlint
  through pre-commit in CI (#191)
- Contrib Rules:
  - New `contrib-disallow-cleanup-commits` rule (#312)
  - New `contrib-allowed-authors` rule (#358)
- User Defined rules:
  - Gitlint now recognizes `fixup=amend` commits, available as
    `commit.is_fixup_amend_commit=True`
  - Gitlint now parses diff **stat** information, available in
    `commit.changed_files_stats` (#314)
- Bugfixes:
  - Use correct encoding when using `--msg-filename` parameter (#310)
  - Various documentation fixes (#244) (#263) (#266) (#294) (#295) (#347) (#364)
- Under-the-hood:
  - Dependencies updated
  - Moved to blacked for formatting
  - Fixed nasty CI issue (#298)
  - Unit tests fix (#256)
  - Vagrant box removed in favor of github dev containers (#348)
  - Removed a few lingering references to the `master` branch in favor of `main`
  - Moved roadmap and project planning to github projects

Full Release details in CHANGELOG.md.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: needs-tests PRs that require tests before they will be accepted
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants