question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Make CleverCSV a pre-commit hook

See original GitHub issue

Would you consider making CleverCSV a pre-commit hook, by adding a .pre-commit-hooks.yaml file to your repository? This would allow people to have csv files in their repositories to automatically check them whenever they want to commit them.

The only thing missing to make it work is, as I understand:

  • An option to overwrite the input file instead of printing to STDOUT (I think this could be a flag, like --in-place)
  • The possibility of clevercsv to accept a list of file arguments to process.
  • (Probably implemented already) A different exit status whether the input file was altered (!=0) or not (=0).

I can file a PR for the .pre-commit-hooks.yaml, if you agree (after the above points are implemented).

Thanks for your consideration!

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:25

github_iconTop GitHub Comments

1reaction
lcnittlcommented, Nov 6, 2020

The dummy package has a test suite to verify the hook works, but I’d appreciate it if you could double check 😃

Can confirm that it works for me without problems.

Thanks a lot for all your effort!

(Not closing as merging of #30 will do so)

1reaction
GjjvdBurgcommented, Nov 5, 2020

Cool, I can confirm that your repo works!

I’m trying to think about how to set this up so it isn’t a lot of effort to maintain going forward. I think the setup.py of the mirror repo can be simplified to pull the version info from the .version file (similar to what we do in this repo), and then I can add a bash script or so to update that .version file and do the git tag whenever I do a new release of CleverCSV.

I’ll pick this back up tomorrow, thanks for your help!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Supported hooks - pre-commit
reorder-python-imports - This hook reorders imports in python files. ... go-build - Makes sure Go code can build; go-build-plugin - Makes sure Go...
Read more >
Quick Start — CleverCSV documentation - Read the Docs
CleverCSV provides a drop-in replacement for the Python csv package with improved ... CSV file to your repository, you can install a pre-commit...
Read more >
CleverCSV - Read the Docs
If you'd like to make sure that you never commit a messy (non-standard) CSV file to your repository, you can install a pre-commit...
Read more >
Skip Git commit hooks - Stack Overflow
commit : skip discarding the index if there is no pre-commit hook ... So using this "invoked_hook" pattern doesn't make sense in those...
Read more >
How to Set up Pre-Commit Hooks in Python
They let you execute code right before the commit. Interestingly, a Python package is also called pre-commit, which allows you to create and...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found