From 8d7943c3f504f39aa55be05668de62f027a2ee53 Mon Sep 17 00:00:00 2001 From: Davide Pesavento Date: Tue, 27 Feb 2024 19:00:22 -0500 Subject: [PATCH] Add .editorconfig --- .editorconfig | 20 ++++++++++++++++++++ docs/debugging.md | 2 +- docs/index.md | 2 +- docs/packets.md | 2 +- docs/routing.md | 2 +- docs/sync.md | 2 +- snippets/communication/consumer.cpp | 2 +- snippets/communication/consumer.py | 2 +- snippets/communication/consumer.ts | 2 +- snippets/communication/producer.cpp | 2 +- snippets/communication/producer.py | 2 +- snippets/packets/packets.cpp | 2 +- snippets/packets/packets.ts | 2 +- snippets/security/key-gen.ts | 2 +- visuals/packets.html | 2 +- 15 files changed, 34 insertions(+), 14 deletions(-) create mode 100644 .editorconfig diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..59aa2cc --- /dev/null +++ b/.editorconfig @@ -0,0 +1,20 @@ +root = true + +[*] +charset = utf-8 +end_of_line = lf +insert_final_newline = true + +[*.{cpp,py,ts}] +indent_style = space +indent_size = 4 +trim_trailing_whitespace = true + +[*.md] +indent_style = space +indent_size = 4 +trim_trailing_whitespace = false + +[*.{yaml,yml}] +indent_style = space +indent_size = 2 diff --git a/docs/debugging.md b/docs/debugging.md index 6218045..6428d93 100644 --- a/docs/debugging.md +++ b/docs/debugging.md @@ -1,3 +1,3 @@ # Debugging -!!! warning "This page is under construction." \ No newline at end of file +!!! warning "This page is under construction." diff --git a/docs/index.md b/docs/index.md index 269478e..476e835 100644 --- a/docs/index.md +++ b/docs/index.md @@ -20,4 +20,4 @@ The design of NDN naturally leads to several advantages over IP and IP-based pro - **Multicast and Caching**: The stateful forwarding plane allows for aggregation of requests and responses, which enables efficient multicast of all Data packets. Since NDN packets are individually secured and do not rely on channel security, data is also securely cached at every forwarder in the network, creating a massive distributed cache. -The NDN project also maintains a large open source code base, with NDN forwarders, debugging tools and libraries available in multiple languages including C++, Python, Go, TypeScript etc. Most of this code is available at the [GitHub](https://github.com/named-data). \ No newline at end of file +The NDN project also maintains a large open source code base, with NDN forwarders, debugging tools and libraries available in multiple languages including C++, Python, Go, TypeScript etc. Most of this code is available at the [GitHub](https://github.com/named-data). diff --git a/docs/packets.md b/docs/packets.md index 8f1bc13..ff98d2d 100644 --- a/docs/packets.md +++ b/docs/packets.md @@ -67,4 +67,4 @@ The next page will describe how to use the libraries to send and receive the pac ``` typescript --8<-- "snippets/packets/packets.ts" - ``` \ No newline at end of file + ``` diff --git a/docs/routing.md b/docs/routing.md index b4926b4..71c2dac 100644 --- a/docs/routing.md +++ b/docs/routing.md @@ -1,3 +1,3 @@ # Routing -!!! warning "This page is under construction." \ No newline at end of file +!!! warning "This page is under construction." diff --git a/docs/sync.md b/docs/sync.md index a681362..4fa1521 100644 --- a/docs/sync.md +++ b/docs/sync.md @@ -1,3 +1,3 @@ # Sync Transport -!!! warning "This page is under construction." \ No newline at end of file +!!! warning "This page is under construction." diff --git a/snippets/communication/consumer.cpp b/snippets/communication/consumer.cpp index 696c4b0..ac603b9 100644 --- a/snippets/communication/consumer.cpp +++ b/snippets/communication/consumer.cpp @@ -26,4 +26,4 @@ int main(int argc, char** argv) // Start face processing loop face.processEvents(); -} \ No newline at end of file +} diff --git a/snippets/communication/consumer.py b/snippets/communication/consumer.py index 066c629..b8c8fd8 100644 --- a/snippets/communication/consumer.py +++ b/snippets/communication/consumer.py @@ -31,4 +31,4 @@ async def main(): app.shutdown() if __name__ == '__main__': - app.run_forever(after_start=main()) \ No newline at end of file + app.run_forever(after_start=main()) diff --git a/snippets/communication/consumer.ts b/snippets/communication/consumer.ts index ef78185..e7cf620 100644 --- a/snippets/communication/consumer.ts +++ b/snippets/communication/consumer.ts @@ -23,4 +23,4 @@ try { } // Disconnect from the remote NFD instance -uplink.close(); \ No newline at end of file +uplink.close(); diff --git a/snippets/communication/producer.cpp b/snippets/communication/producer.cpp index fb316aa..9f0ac73 100644 --- a/snippets/communication/producer.cpp +++ b/snippets/communication/producer.cpp @@ -39,4 +39,4 @@ int main(int argc, char** argv) // Start face processing loop face.processEvents(); -} \ No newline at end of file +} diff --git a/snippets/communication/producer.py b/snippets/communication/producer.py index a1f3236..05f2e89 100644 --- a/snippets/communication/producer.py +++ b/snippets/communication/producer.py @@ -17,4 +17,4 @@ def on_interest(name: FormalName, param: InterestParam, _app_param: Optional[Bin app.put_data(name, content=content, freshness_period=10000) if __name__ == '__main__': - app.run_forever() \ No newline at end of file + app.run_forever() diff --git a/snippets/packets/packets.cpp b/snippets/packets/packets.cpp index e595304..f9e81ae 100644 --- a/snippets/packets/packets.cpp +++ b/snippets/packets/packets.cpp @@ -16,4 +16,4 @@ int main(int argc, char** argv) // Set the Data packet's content to "Hello, NDN!" data.setContent(ndn::make_span(reinterpret_cast("Hello, NDN!"), 11)); -} \ No newline at end of file +} diff --git a/snippets/packets/packets.ts b/snippets/packets/packets.ts index 3ba44b2..e298e3f 100644 --- a/snippets/packets/packets.ts +++ b/snippets/packets/packets.ts @@ -14,4 +14,4 @@ interest.lifetime = 5000; const data = new Data(name); // Set the Data packet's content to "Hello, NDN!" -data.content = toUtf8('Hello, NDN!'); \ No newline at end of file +data.content = toUtf8('Hello, NDN!'); diff --git a/snippets/security/key-gen.ts b/snippets/security/key-gen.ts index ddfc131..fa81c06 100644 --- a/snippets/security/key-gen.ts +++ b/snippets/security/key-gen.ts @@ -19,7 +19,7 @@ console.log('Data:', toHex(wire)); // Export public keys const publicKeyBits = verifier.spki!; console.log('Public Key bits:', toHex(publicKeyBits)); -// Importing a public key in NDNts is very complicated +// Importing a public key in NDNts is very complicated // so I recommend to use a certificate instead. // I will show you how to do it later. diff --git a/visuals/packets.html b/visuals/packets.html index dcd63a6..1e72ddb 100644 --- a/visuals/packets.html +++ b/visuals/packets.html @@ -7,4 +7,4 @@ src="https://play.ndn.today/?visualize=06A2071B0803656475080475636C6108026373080331313808056E6F746573150B48656C6C6F2C204E444E21162C1B01031C2707250803656475080475636C610802637308056C6978696108034B455938080005FA3ADE0C75D817483046022100E773B365BE4FCED756073E9183A46258206F1624BC04B55ABE41CA4E259FBCF3022100D8F5CDCF0C946D71142708AABDC18819B4E9C6990DEC90AE0306E1A7E7D663C6" crossorigin="anonymous" data-message-fun="handleVisMessage" style="border: none; width: 100%"> - \ No newline at end of file +