Feed aggregator
The Rust Foundation's 2nd bad draft trademark policy
Article URL: https://diziet.dreamwidth.org/19151.html
Comments URL: https://news.ycombinator.com/item?id=42211552
Points: 2
# Comments: 0
Understanding CSRF in Depth
Article URL: https://blog.logto.io/csrf
Comments URL: https://news.ycombinator.com/item?id=42211547
Points: 1
# Comments: 0
0x90n/InfoSec-Black-Friday: All the deals for InfoSec related software/tools
Article URL: https://github.com/0x90n/InfoSec-Black-Friday
Comments URL: https://news.ycombinator.com/item?id=42211533
Points: 1
# Comments: 0
UFOs and Defense: What Should We Prepare For? [pdf]
Article URL: https://www.narcap.de/dokumente/COMETA-Report-englisch.pdf
Comments URL: https://news.ycombinator.com/item?id=42211529
Points: 1
# Comments: 0
Apple will now be treated like a bank
Article URL: https://9to5mac.com/2024/11/21/apple-will-now-be-treated-like-a-bank-says-us-consumer-financial-protection-bureau/
Comments URL: https://news.ycombinator.com/item?id=42211525
Points: 6
# Comments: 0
Show HN: C, C++, and Java formatter based on Clang for Node.js
Hello,
I’m excited to share the release of a new C, C++, and Java formatter based on Clang for the Node.js environment. This project is a fresh take inspired by Angular’s deprecated `clang-format` package.
I previously introduced this project a month or two ago, but I’m sharing it again as it has become even more stable and new features have been added. Thanks to the interest and support from the community, and the adoption by legacy users, the package recently hit over 10,000 weekly downloads. I am deeply grateful for this support.
This package now has full test coverage and a PR is in progress to replace the old Angular `clang-format` in the Node.js core with this updated package. While it’s thoroughly tested, there could still be edge cases I might have missed, so any feedback is welcome!
---
The package leverages Clang’s `clang-format`, known for its widespread use in formatting C, C++, and Java code. Think of it as similar to Prettier, but specifically for languages like C, C++, and Java, which Prettier does not support.
This formatter is especially useful in the Node.js environment when you’re working on projects that mix JavaScript with C/C++ code, such as core Node.js development. The package eliminates the need to install additional dependencies for using `clang-format`. While the previous `clang-format` package was challenging to integrate into Node.js and npm workflows, this new package streamlines the process. You can easily set it up in CI by simply downloading it via npm and configuring your scripts, which makes it much easier to use in automated environments.
---
With the recent update to version 1.2.0, we’ve added several new features, notably the `git-clang-format` package.
Let’s consider a scenario where you want to introduce code formatting for a C/C++ project. In smaller projects, you can reformat all the code at once without causing too much disruption. However, in larger projects, reformatting the entire codebase at once can make commit history harder to track.
Now, let’s imagine a developer modifies 100 lines within a 1,000-line codebase. Instead of reformatting the entire file, it would be better to check and format only the modified lines. This keeps the commit history clean and consistent. Additionally, as the project evolves, formatting becomes more uniform over time. `git-clang-format` helps achieve this by allowing formatting to be applied only to modified lines, similar to how `lint-staged` checks only staged files to optimize CI speed.
I’ve also wrapped `git-clang-format` as a standalone package, leveraging LLVM’s native support for this feature. The detailed instructions are available in the official documentation, though currently only in English.
Thank you for reading, and please feel free to leave any questions or feedback!
Official Documentation: [https://clang-format-node.lumir.page](https://clang-format-n... Repository: [https://github.com/lumirlumir/npm-clang-format-node](https:/...
Comments URL: https://news.ycombinator.com/item?id=42211507
Points: 1
# Comments: 0
Aralkum Desert
Article URL: https://en.wikipedia.org/wiki/Aralkum_Desert
Comments URL: https://news.ycombinator.com/item?id=42211502
Points: 2
# Comments: 1
Companies are spritzing smells in office to make return-to-office more pleasant
Article URL: https://www.wsj.com/lifestyle/workplace/workers-return-office-mood-fragrance-1751be44
Comments URL: https://news.ycombinator.com/item?id=42211501
Points: 1
# Comments: 0
CFPB expands oversight of services like Apple Pay, Cash App, PayPal and Zelle
Article URL: https://www.cnbc.com/2024/11/21/cfpb-expands-oversight-of-apple-pay-other-digital-payments-services.html
Comments URL: https://news.ycombinator.com/item?id=42211467
Points: 3
# Comments: 0
Tracing Linux kernel with eBPF-based retsnoop (2022)
Article URL: https://nakryiko.com/posts/retsnoop-intro/
Comments URL: https://news.ycombinator.com/item?id=42211447
Points: 1
# Comments: 0
IT and business leaders face big gap in understanding of data priorities
Input Validation Vulnerabilities Dominate MITRE's 2024 CWE Top List
Article URL: https://socket.dev/blog/input-validation-vulnerabilities-dominate-mitre-s-2024-cwe-top-25-list
Comments URL: https://news.ycombinator.com/item?id=42211424
Points: 1
# Comments: 0
Nous World Client
Article URL: https://worldsim.nousresearch.com/browser
Comments URL: https://news.ycombinator.com/item?id=42211411
Points: 1
# Comments: 0
Catalysts show potential for breaking down microplastics to create usable fuel
Article URL: https://phys.org/news/2024-11-catalysts-potential-microplastics-usable-fuel.html
Comments URL: https://news.ycombinator.com/item?id=42211407
Points: 1
# Comments: 0
Show HN: I develop software that can help you generate directory annotation tree
Article URL: https://github.com/itchaox/annotree
Comments URL: https://news.ycombinator.com/item?id=42211394
Points: 1
# Comments: 0
Top senator calls Salt Typhoon 'worst telecom hack in our nation's history'
Article URL: https://www.washingtonpost.com/national-security/2024/11/21/salt-typhoon-china-hack-telecom/
Comments URL: https://news.ycombinator.com/item?id=42211387
Points: 1
# Comments: 0
LiveStore: SQLite-based data layer for local-first apps
Article URL: https://expo.dev/blog/local-first-application-development-with-livestore
Comments URL: https://news.ycombinator.com/item?id=42211380
Points: 1
# Comments: 0
$ ssh sshtron.zachlatta.com | Play multiplayer Tron
Article URL: http://sshtron.zachlatta.com
Comments URL: https://news.ycombinator.com/item?id=42211376
Points: 1
# Comments: 0
Unreal Mysteries 5: Behind the Scenes / Making of (AI Video)
Article URL: https://old.reddit.com/r/aivideo/comments/1gwh80l/unreal_mysteries_5_behind_the_scenes_making_of/
Comments URL: https://news.ycombinator.com/item?id=42211368
Points: 1
# Comments: 0
Oppose the Patent-Troll-Friendly Prevail Act
Article URL: https://www.eff.org/deeplinks/2024/11/prevail-act-would-wreck-us-patent-review-system
Comments URL: https://news.ycombinator.com/item?id=42211367
Points: 1
# Comments: 0