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

(fix): Use venv created by pre-commit for validate config #3166

Merged
merged 3 commits into from Sep 23, 2022

Conversation

enochtangg
Copy link
Member

@enochtangg enochtangg commented Sep 21, 2022

The validate-configs-syntax pre-commit hook should be using the venv created by pre-commit by default when specifying language: python. Calling python3 ./snuba/validate_configs.py does not import the current directory by default. This can be achieved by running the library module as a script. Thanks @asottile-sentry for the reference.

@codecov-commenter
Copy link

codecov-commenter commented Sep 21, 2022

Codecov Report

Base: 93.04% // Head: 92.82% // Decreases project coverage by -0.21% ⚠️

Coverage data is based on head (6035d1f) compared to base (246571b).
Patch has no changes to coverable lines.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3166      +/-   ##
==========================================
- Coverage   93.04%   92.82%   -0.22%     
==========================================
  Files         678      688      +10     
  Lines       31010    31078      +68     
==========================================
- Hits        28852    28847       -5     
- Misses       2158     2231      +73     
Impacted Files Coverage Δ
snuba/consumers/consumer_builder.py 41.59% <0.00%> (-49.56%) ⬇️
snuba/cli/consumer.py 68.62% <0.00%> (-27.46%) ⬇️
snuba/environment.py 83.33% <0.00%> (-16.67%) ⬇️
snuba/utils/streams/metrics_adapter.py 66.66% <0.00%> (-8.34%) ⬇️
tests/utils/test_package_no_import/__init__.py 100.00% <0.00%> (ø)
tests/utils/test_package_auto_import/__init__.py 100.00% <0.00%> (ø)
tests/utils/test_package_auto_import/c.py 100.00% <0.00%> (ø)
tests/clickhouse/translators/test_auto_import.py 100.00% <0.00%> (ø)
tests/utils/test_package_no_import/a.py 100.00% <0.00%> (ø)
tests/utils/test_package_auto_import/b.py 100.00% <0.00%> (ø)
... and 7 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@enochtangg enochtangg marked this pull request as ready for review September 21, 2022 14:56
@enochtangg enochtangg requested a review from a team as a code owner September 21, 2022 14:56
@enochtangg enochtangg changed the title Use venv created by pre-commit for validate config (fix): Use venv created by pre-commit for validate config Sep 21, 2022
Copy link
Member

@asottile-sentry asottile-sentry left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good enough improvement for now 👍

@enochtangg enochtangg merged commit d698196 into master Sep 23, 2022
@enochtangg enochtangg deleted the fix-validate-config-precommit branch September 23, 2022 17:58
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

Successfully merging this pull request may close these issues.

None yet

5 participants