Skip to content

Commit

Permalink
Add editorconfig, fix some formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
filiptibell committed Feb 24, 2023
1 parent c2dc8e2 commit e340321
Show file tree
Hide file tree
Showing 8 changed files with 296 additions and 295 deletions.
17 changes: 17 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
root = true

[*]
charset = utf-8
end_of_line = lf
trim_trailing_whitespace = true
insert_final_newline = true
indent_style = tab
indent_size = 4

[*.{json,jsonc,json5]
indent_style = space
indent_size = 4

[*.{yml,yaml]
indent_style = space
indent_size = 2
2 changes: 1 addition & 1 deletion .lune/data/test.csv
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Header1,Header2,Header3
Hello,World,!
1,2,3
Foo,Bar,Baz
Foo,Bar,Baz
462 changes: 231 additions & 231 deletions CHANGELOG.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion LICENSE.txt
Original file line number Diff line number Diff line change
Expand Up @@ -370,4 +370,4 @@ Exhibit B - "Incompatible With Secondary Licenses" Notice
---------------------------------------------------------

This Source Code Form is "Incompatible With Secondary Licenses", as
defined by the Mozilla Public License, v. 2.0.
defined by the Mozilla Public License, v. 2.0.
38 changes: 19 additions & 19 deletions docs/pages/Getting Started - 2 Writing Scripts.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ if #process.args > 0 then
error("Too many arguments!")
end
else
print("Got no arguments ☹️")
print("Got no arguments ☹️")
end


Expand Down Expand Up @@ -75,14 +75,14 @@ end
Writing a module
Modularizing and splitting up your code is Lune is very straight-forward,
in contrast to other scripting languages and shells such as bash
Modularizing and splitting up your code is Lune is very straight-forward,
in contrast to other scripting languages and shells such as bash
]]

local module = {}

function module.sayHello()
print("Hello, Lune! 🌙")
print("Hello, Lune! 🌙")
end

return module
Expand All @@ -94,7 +94,7 @@ return module
Using a function from another module / script
Lune has path-relative imports, similar to other popular languages such as JavaScript
Lune has path-relative imports, similar to other popular languages such as JavaScript
]]

local module = require("../modules/module")
Expand All @@ -107,7 +107,7 @@ module.sayHello()
Spawning concurrent tasks
These tasks will run at the same time as other Lua code which lets you do primitive multitasking
These tasks will run at the same time as other Lua code which lets you do primitive multitasking
]]

task.spawn(function()
Expand Down Expand Up @@ -173,7 +173,7 @@ end
Call out to another program / executable
You can also get creative and combine this with example #6 to spawn several programs at the same time!
You can also get creative and combine this with example #6 to spawn several programs at the same time!
]]

print("Sending 4 pings to google 🌏")
Expand All @@ -190,7 +190,7 @@ local result = process.spawn("ping", {
Using the result of a spawned process, exiting the process
This looks scary with lots of weird symbols, but, it's just some Lua-style pattern matching
to parse the lines of "min/avg/max/stddev = W/X/Y/Z ms" that the ping program outputs to us
to parse the lines of "min/avg/max/stddev = W/X/Y/Z ms" that the ping program outputs to us
]]

if result.ok then
Expand Down Expand Up @@ -302,12 +302,12 @@ VALID=true
COUNT=1
while [ $VALID ]
do
echo $COUNT
if [ $COUNT -eq 5 ];
then
break
fi
((COUNT++))
echo $COUNT
if [ $COUNT -eq 5 ];
then
break
fi
((COUNT++))
done
```

Expand All @@ -317,10 +317,10 @@ done
local valid = true
local count = 1
while valid do
print(count)
if count == 5 then
break
end
count += 1
print(count)
if count == 5 then
break
end
count += 1
end
```
30 changes: 15 additions & 15 deletions docs/pages/Getting Started - 4 Editor Setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,24 +10,24 @@ These steps assume you have already installed Lune and that it is available to r
2. Run `lune --generate-docs-file` to generate a Luau LSP documentation file (`luneDocs.json`) in the current directory
3. Modify your VSCode settings, either by using the settings menu or in `settings.json`:

```json
{
"luau-lsp.require.mode": "relativeToFile", // Set the require mode to work with Lune
"luau-lsp.types.definitionFiles": ["luneTypes.d.luau"], // Add type definitions for Lune globals
"luau-lsp.types.documentationFiles": ["luneDocs.json"] // Add documentation for Lune globals
}
```
```json
{
"luau-lsp.require.mode": "relativeToFile", // Set the require mode to work with Lune
"luau-lsp.types.definitionFiles": ["luneTypes.d.luau"], // Add type definitions for Lune globals
"luau-lsp.types.documentationFiles": ["luneDocs.json"] // Add documentation for Lune globals
}
```

## Selene

1. Run `lune --generate-selene-types` to generate a Selene type definitions file (`lune.yml`) in the current directory
2. Modify your Selene settings in `selene.toml`:

```yaml
# Use this if Lune is the only thing you use Luau files with:
std = "luau+lune"
# OR use this if your project also contains Roblox-specific Luau code:
std = "roblox+lune"
# If you are also using the Luau type definitions file, it may cause issues, and can be safely ignored:
exclude = ["luneTypes.d.luau"]
```
```yaml
# Use this if Lune is the only thing you use Luau files with:
std = "luau+lune"
# OR use this if your project also contains Roblox-specific Luau code:
std = "roblox+lune"
# If you are also using the Luau type definitions file, it may cause issues, and can be safely ignored:
exclude = ["luneTypes.d.luau"]
```
18 changes: 1 addition & 17 deletions docs/pages/Home.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,4 @@ Here you can find tutorials as well as a full API reference for all of Lune's bu

If you are just getting started, head over to the [installation](https://github.com/filiptibell/lune/wiki/Getting-Started---1-Installation) page!

## Page Reference

- Getting Started

- [1. Installation](https://github.com/filiptibell/lune/wiki/Getting-Started---1-Installation)
- [2. Writing Scripts](https://github.com/filiptibell/lune/wiki/Getting-Started---2-Writing-Scripts)
- [3. Running Scripts](https://github.com/filiptibell/lune/wiki/Getting-Started---3-Running-Scripts)
- [4. Editor Setup](https://github.com/filiptibell/lune/wiki/Getting-Started---4-Editor-Setup)

- API Reference

- [FS](https://github.com/filiptibell/lune/wiki/API-Reference---FS)
- [Net](https://github.com/filiptibell/lune/wiki/API-Reference---Net)
- [Process](https://github.com/filiptibell/lune/wiki/API-Reference---Process)
- [Stdio](https://github.com/filiptibell/lune/wiki/API-Reference---Stdio)
- [Task](https://github.com/filiptibell/lune/wiki/API-Reference---Task)
- [Uncategorized](https://github.com/filiptibell/lune/wiki/API-Reference---Uncategorized)
Anything else can be found in the navigation sidebar.
22 changes: 11 additions & 11 deletions docs/pages/_Sidebar.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@

# Home

- [Getting Started](https://github.com/filiptibell/lune/wiki)
- [1. Installation](https://github.com/filiptibell/lune/wiki/Getting-Started---1-Installation)
- [2. Writing Scripts](https://github.com/filiptibell/lune/wiki/Getting-Started---2-Writing-Scripts)
- [3. Running Scripts](https://github.com/filiptibell/lune/wiki/Getting-Started---3-Running-Scripts)
- [4. Editor Setup](https://github.com/filiptibell/lune/wiki/Getting-Started---4-Editor-Setup)
- [Getting Started](https://github.com/filiptibell/lune/wiki)
- [1. Installation](https://github.com/filiptibell/lune/wiki/Getting-Started---1-Installation)
- [2. Writing Scripts](https://github.com/filiptibell/lune/wiki/Getting-Started---2-Writing-Scripts)
- [3. Running Scripts](https://github.com/filiptibell/lune/wiki/Getting-Started---3-Running-Scripts)
- [4. Editor Setup](https://github.com/filiptibell/lune/wiki/Getting-Started---4-Editor-Setup)

# API Reference

- [FS](https://github.com/filiptibell/lune/wiki/API-Reference---FS)
- [Net](https://github.com/filiptibell/lune/wiki/API-Reference---Net)
- [Process](https://github.com/filiptibell/lune/wiki/API-Reference---Process)
- [Stdio](https://github.com/filiptibell/lune/wiki/API-Reference---Stdio)
- [Task](https://github.com/filiptibell/lune/wiki/API-Reference---Task)
- [Uncategorized](https://github.com/filiptibell/lune/wiki/API-Reference---Uncategorized)
- [FS](https://github.com/filiptibell/lune/wiki/API-Reference---FS)
- [Net](https://github.com/filiptibell/lune/wiki/API-Reference---Net)
- [Process](https://github.com/filiptibell/lune/wiki/API-Reference---Process)
- [Stdio](https://github.com/filiptibell/lune/wiki/API-Reference---Stdio)
- [Task](https://github.com/filiptibell/lune/wiki/API-Reference---Task)
- [Uncategorized](https://github.com/filiptibell/lune/wiki/API-Reference---Uncategorized)

0 comments on commit e340321

Please sign in to comment.