include-what-you-use
pre-commit
include-what-you-use | pre-commit | |
---|---|---|
40 | 201 | |
4,193 | 13,226 | |
1.3% | 1.6% | |
8.7 | 8.0 | |
19 days ago | 15 days ago | |
C++ | Python | |
GNU General Public License v3.0 or later | MIT License |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
include-what-you-use
-
Open Source C++ Stack
Linters keep the code base consistent and help to catch a lot of issues and even bugs way before the compiler is ran. Clang-Tidy is the one I am relying on. IWYU is really helpful in keeping the includes clean, reducing number of dependencies and reducing the build times.
- IWYU: A tool for use with Clang to analyze includes in C and C++ source files
-
Script to find missing std includes in C++ headers
Interesting...how does it compare to https://github.com/include-what-you-use/include-what-you-use ?
-
Speed Up C++ Compilation
Build Insights in Visual Studio, include-what-you-use).
Looks like https://include-what-you-use.org/ might do that.
-
Is it good or bad practice to include headers that are indirectly included from other headers?
If you are worried about includes, use https://github.com/include-what-you-use/include-what-you-use and stop thinking about it.
-
how do you guys manage a include file mess ?
Getting rid of that is not straightforard, though some tools can help with that
-
Is it appropiate to comment what a header is needed for?
You can use the tool https://github.com/include-what-you-use/include-what-you-use to do this for for. It tracks included files and can give comment for what is used from each file. It also warns you when you include files that you donβt use
-
Hey Rustaceans! Got a question? Ask here (16/2023)!
Invisible imports (e.g. traits). In Python, everything is fully namespaced (unless you from import * in which case all bets are off). It's always explicit where a name is coming from. C is the opposite: #include lets you refer to anything defined in the headers with no namespacing. That's why a common strategy (include what you use) has an associated code style: after every non-std #include you have a comment saying which of its definitions you are using. Of course, Rust is much less implicit, but I still sometimes struggle with traits. For example, you can use tokio::net::TcpStream, but you need to also use tokio::io::AsyncReadExt for the .read trait to be defined on TcpStream. This makes it hard (for me) to answer questions like "what traits are currently available in this scope?" and "why is this module being imported?"
- I implemented a NASA image compression algorithm
-
IncludeGuardian - improve build times by removing expensive includes
Aside from being closed source and not available on all architectures, how does it compare to iwyu(https://include-what-you-use.org/) or clang's relatively recent include-fixer which is also accessible via clangd?
pre-commit
-
Terraform Cookbook: Development Environment Recipe
Pre-commit: git hook manager
-
Crafting a Custom SAM Template for Your AWS Lambda Function, Resource, and Operations
Just give you an idea of how to implement a template for serverless in your organization; you can create multiple cases and embed the practice of your organization to the template like pre-commit, cicd, lambda-layer-secret, lambda-layer-powertools and more
-
Speed up CI with uv β‘
When using pre-commit for linting:
-
12 Steps to Organize and Maintain Your Python Codebase for Beginners
Instead of running these tools manually every time you make changes, you can automate the process with pre-commit hooks. Pre-commit hooks run automatically before each commit, blocking the commit if any tool fails.
-
How I use git
Our team is small and we use:
git hooks from https://pre-commit.com
-
How to Estimate Cloud Costs with Terraform and InfraCost
You can also add InfraCost as part of the pre-commit. With pre-commit, you can define some hooks that you can easily run before you push your code. There are multiple ways to install pre-commit, and you can find examples here.
-
How Should You Use an Auto-Formatter?
In the case of pre-commit hooks, the runtime either has to be installed manually by every user (in the case of Husky) or is handled in Python (in the case of pre-commit). Running Node.js through Python/pyenv introduces an additional layer of complexity, which can lead to issues like OpenSSL library incompatibilities.
-
Using TruffleHog and pre-commit hook to prevent secret exposure
I'm using pre-commit, follow the link to get installation instructions.
-
How to review as a Pro
Not only can you check how well your code follows certain rules but also add auto-formatting options. This way, most inconsistencies are fixed automatically, saving time. Linters start up can be automated, for example, with pre-commit tool for python and this logic can be integrated into GitHub PR or new commits workflow. So before a new Pull Request is reviewed, it's the author who resolves any code style issues.
-
How to setup Black and pre-commit in python for auto text-formatting on commit
Today we are going to look at how to setup Black (a python code formatter) and pre-commit (a package for handling git hooks in python) to automatically format you code on commit.
What are some alternatives?
clangd - clangd language server
husky - Git hooks made easy πΆ woof!
cpplint - Static code checker for C++
ruff - An extremely fast Python linter and code formatter, written in Rust.
cppinclude - Tool for analyzing includes in C++
semgrep - Lightweight static analysis for many languages. Find bug variants with patterns that look like source code.
coc-clangd - clangd extension for coc.nvim
gitleaks - Find secrets with Gitleaks π
cmake-lint - Fork of https://github.com/richq/cmake-lint to continue maintenance
lint-staged - π«π© β Run linters on git staged files
pre-commit-hooks - C/C++ hooks to integrate with pre-commit
pre-commit-golang - Pre-commit hooks for Golang with support for monorepos, the ability to pass arguments and environment variables to all hooks, and the ability to invoke custom go tools.