Illustrate usage as a pre-commit hook additional dependency
Mantenedores costumam responder em até 1 dia
Avaliação
- Dificuldade
- 1/5
- Tempo estimado
- Menos de uma hora
- Facilidade para iniciantes
- 50/100
- Tipo de issue
- Documentação
- Clareza
- Claramente especificada
- Status de atividade
- Estagnada
- Stack de tecnologia
- python
- Domínio
- documentation
Direção de pesquisa
Open README.md and find the Other Use Cases section. Review the pre-commit additional_dependencies and Python hook behavior described in the issue, then add the provided usage example if it fits the project documentation. Done means the README clearly explains this pre-commit configuration without any source-code changes.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
Summary (documentation)
This is an extremely helpful tool that can be used in loads of contexts!
One context that I've been using it in is as an additional dependency for pre-commit hooks where the hook(s) require environment variables to be defined.
Since pre-commit is a popular tool and setting environment variables for it isn't super obvious (hence lots of the feature requests, such as pre-commit#758), python-dotenv can help with a lot of the headache for Python-based hooks.
I don't expect this to be implemented since it still leaves a fair bit for the user to figure out (and it might be an inappropriate coupling), but on the off chance that this might be useful for other people, I'll add additional details below.
Details
Assuming that this is an appropriate way to use pre-commit and python-dotenv together, it would be awesome to see this documented in the Other Use Cases section of the README.md.
Note that this would not require any source code changes: python-dotenv would just be a dependency for other, already established hooks.
A minimal template for using python-dotenv in this way is:
# .pre-commit-config.yaml
---
repos:
- repo: ...
rev: ...
hooks:
- id: ...
entry: dotenv run -- ...
additional_dependencies: ["python-dotenv[cli]"]
This expects that:
- The hook action that the user wants to expose environment variables to is configured with
language: python - The user configuring their pre-commit file has replaced the ellipses
...with actual values (which assumes they know how to override theentryproperty)
- Linguagem predominante
- Python
- Estrelas
- 8.9k
- Forks
- 600
- Merge médio
- 4d 23h
- PRs com merge (30d)
- 4
Preparar o ambiente
- Sem Dockerfile nem arquivo Docker Compose
- Sem modelo de pull request
- Ler o guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de theskumar/python-dotenv
-
An empty value ignores ${name:-default}Talvez já em andamento @SashaMIT assumiu há 9 dias. Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 75/100
theskumar/python-dotenv#715 ·
Mantenedores costumam responder em até 1 dia
-
set_key and unset_key don't fsync before replacing the .env fileTalvez já em andamento @Imkkey assumiu há 9 dias. Abertaenhancement
Dificuldade 3/5 1-2 dias Facilidade para iniciantes 72/100
theskumar/python-dotenv#713 ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 5/5 Mais de uma semana Facilidade para iniciantes 28/100
theskumar/python-dotenv#693 · 1 comentário ·
Mantenedores costumam responder em até 1 dia
-
python-dotenv installation without cli masks python-dotenv cliTalvez já em andamento @gyanu2507 assumiu há 48 dias. Aberta
Dificuldade 3/5 1-2 dias Facilidade para iniciantes 55/100
theskumar/python-dotenv#683 · 4 comentários ·
Mantenedores costumam responder em até 1 dia
-
Feature Request: Automatically copy `default.env` to `.env`Talvez já em andamento @dradetsky assumiu há 158 dias. Aberta
Dificuldade 3/5 1-2 dias Facilidade para iniciantes 55/100
theskumar/python-dotenv#644 · 2 comentários ·
Mantenedores costumam responder em até 1 dia
Todas as issues de theskumar/python-dotenv
Issues semelhantes
-
enhancement good first issue
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
-
python-version
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 88/100
-
bug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 62/100
Mantenedores costumam responder em até 1 dia
-
bug javascript P2-medium python release:v3.1
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 68/100
adrirubio/claude-deck#546 ·
Mantenedores costumam responder em até 1 dia
-
area: desktop area: website priority: P2 type: feature
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 62/100
appandflow/stim#3411 · 1 comentário ·
Mantenedores costumam responder em até 1 dia