Skip to content

Commit

Permalink
Add pre-commit config for a few formatting things
Browse files Browse the repository at this point in the history
  • Loading branch information
kleinesfilmroellchen committed Jul 15, 2023
1 parent 632f2c1 commit 52778ca
Show file tree
Hide file tree
Showing 68 changed files with 1,383 additions and 480 deletions.
2 changes: 1 addition & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
*.spcasm linguist-language=Assembly
*.spcasmtest linguist-language=Assembly
*.spcasmtest.noerror linguist-language=Assembly
*.spcasmtest.noerror linguist-language=Assembly
2 changes: 1 addition & 1 deletion .github/workflows/miri.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Check and test spcasm

on:
schedule:
- cron: '0 0 * * 0' # every sunday at midnight
- cron: "0 0 * * 0" # every sunday at midnight

env:
CARGO_TERM_COLOR: always
Expand Down
16 changes: 16 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
repos:
- repo: https://github.com/doublify/pre-commit-rust
rev: v1.0
hooks:
- id: fmt
entry: cargo +nightly fmt
types: [rust]
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.1.0
hooks:
- id: check-toml
- id: end-of-file-fixer
- repo: https://github.com/pre-commit/mirrors-prettier
rev: v3.0.0
hooks:
- id: prettier
118 changes: 52 additions & 66 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -1,67 +1,53 @@
{
"version": "0.2.0",
"configurations": [
{
"type": "lldb",
"request": "launch",
"name": "Debug spcasm",
"cargo": {
"args": [
"build",
"--bin=spcasm",
],
"filter": {
"name": "spcasm",
"kind": "bin"
}
},
"args": [
"tests/opcodes.s",
"-f",
"hex-dump",
"-"
],
"cwd": "${workspaceFolder}"
},
{
"type": "lldb",
"request": "launch",
"name": "Debug spcasm tests",
"cargo": {
"args": [
"test",
"--no-run",
"--lib"
],
"filter": {
"name": "spcasm",
"kind": "lib"
}
},
"cwd": "${workspaceFolder}"
},
{
"name": "Test sals in extension host",
"type": "extensionHost",
"request": "launch",
"runtimeExecutable": "${execPath}",
"args": [
"--extensionDevelopmentPath=${workspaceRoot}/sals",
"${workspaceRoot}/tests/opcodes.s"
],
"outFiles": [
"${workspaceRoot}/sals/vscode/dist/**/*.js"
],
"env": {
"SERVER_PATH": "${workspaceRoot}/target/debug/sals"
}
},
{
"name": "Attach to sals server",
"request": "attach",
"type": "lldb",
"program": "${workspaceRoot}/target/debug/sals",
"pid": "${command:pickMyProcess}"
}
]
}
"version": "0.2.0",
"configurations": [
{
"type": "lldb",
"request": "launch",
"name": "Debug spcasm",
"cargo": {
"args": ["build", "--bin=spcasm"],
"filter": {
"name": "spcasm",
"kind": "bin"
}
},
"args": ["tests/opcodes.s", "-f", "hex-dump", "-"],
"cwd": "${workspaceFolder}"
},
{
"type": "lldb",
"request": "launch",
"name": "Debug spcasm tests",
"cargo": {
"args": ["test", "--no-run", "--lib"],
"filter": {
"name": "spcasm",
"kind": "lib"
}
},
"cwd": "${workspaceFolder}"
},
{
"name": "Test sals in extension host",
"type": "extensionHost",
"request": "launch",
"runtimeExecutable": "${execPath}",
"args": [
"--extensionDevelopmentPath=${workspaceRoot}/sals",
"${workspaceRoot}/tests/opcodes.s"
],
"outFiles": ["${workspaceRoot}/sals/vscode/dist/**/*.js"],
"env": {
"SERVER_PATH": "${workspaceRoot}/target/debug/sals"
}
},
{
"name": "Attach to sals server",
"request": "attach",
"type": "lldb",
"program": "${workspaceRoot}/target/debug/sals",
"pid": "${command:pickMyProcess}"
}
]
}
158 changes: 79 additions & 79 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,80 +1,80 @@
{
"cSpell.words": [
"ADDW",
"ajsdkfl",
"ALLOC",
"asciiz",
"autotrim",
"brrtools",
"CBNE",
"CLRC",
"CLRP",
"CLRV",
"CMPW",
"DBNZ",
"DECW",
"endasm",
"Endianness",
"endmacro",
"FFBF",
"FFDE",
"fillbyte",
"filldword",
"filllong",
"fillword",
"Gau's",
"incbin",
"incsrc",
"INCW",
"jumptable",
"lalrpop",
"LALRPOP",
"mdbook",
"misassembled",
"MOVW",
"MSRV",
"msvc",
"noalign",
"nocash",
"nodirectory",
"noerror",
"NOTC",
"notrycmd",
"NVHZ",
"NVHZC",
"NVPBHIZC",
"oldstyle",
"padbyte",
"paddword",
"padlong",
"padword",
"PCALL",
"PROGBITS",
"pseudoinstruction",
"pullpc",
"pushpc",
"readelf",
"rustc",
"rustflags",
"Rustup",
"sampletable",
"SETC",
"SETP",
"shstrtab",
"spcasmtest",
"startpos",
"STRTAB",
"SUBW",
"TCALL",
"TCLR",
"trycmd",
"TSET",
"unoptimized",
"vasm",
"Virt",
"wrongoption",
"xffbinary",
"xkas",
"yoshi"
]
}
"cSpell.words": [
"ADDW",
"ajsdkfl",
"ALLOC",
"asciiz",
"autotrim",
"brrtools",
"CBNE",
"CLRC",
"CLRP",
"CLRV",
"CMPW",
"DBNZ",
"DECW",
"endasm",
"Endianness",
"endmacro",
"FFBF",
"FFDE",
"fillbyte",
"filldword",
"filllong",
"fillword",
"Gau's",
"incbin",
"incsrc",
"INCW",
"jumptable",
"lalrpop",
"LALRPOP",
"mdbook",
"misassembled",
"MOVW",
"MSRV",
"msvc",
"noalign",
"nocash",
"nodirectory",
"noerror",
"NOTC",
"notrycmd",
"NVHZ",
"NVHZC",
"NVPBHIZC",
"oldstyle",
"padbyte",
"paddword",
"padlong",
"padword",
"PCALL",
"PROGBITS",
"pseudoinstruction",
"pullpc",
"pushpc",
"readelf",
"rustc",
"rustflags",
"Rustup",
"sampletable",
"SETC",
"SETP",
"shstrtab",
"spcasmtest",
"startpos",
"STRTAB",
"SUBW",
"TCALL",
"TCLR",
"trycmd",
"TSET",
"unoptimized",
"vasm",
"Virt",
"wrongoption",
"xffbinary",
"xkas",
"yoshi"
]
}
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,25 +43,25 @@ Options:
-l, --reference-pass-limit <REFERENCE_PASS_LIMIT>
Limit for the number of reference resolution passes spcasm will perform.
Usually 2-3 passes are enough and very high pass numbers often indicate infinite loops. If
this number of passes is exceeded during reference resolution, spcasm will report
unresolved references as normal.
[default: 10]
-r, --macro-recursion-limit <MACRO_RECURSION_LIMIT>
Limit for the number of recursive macro calls allowed by spcasm.
Increase this limit carefully; very high recursion amounts are usually caused by
infinitely recursive macros. Any recursion exceeding this value will cause a specific
error.
[default: 1000]
-f, --output-format <OUTPUT_FORMAT>
Format to output to
[default: elf]
Possible values:
Expand All @@ -75,7 +75,7 @@ Options:
-a, --dump-ast
Dump the program's abstract syntax tree. This is a debugging feature and most likely not
useful to the end user.
WARNING: This option will, in specific circumstances, loop forever trying to print
recursive data structures. This can happen on well-formed programs.
Expand Down
10 changes: 5 additions & 5 deletions doc/src/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
[spcasm Manual](../../README.md)

- [Using spcasm](usage.md)
- [Terminology](terminology.md)
- [Error Reference](errors.md)
- [Troubleshooting](troubleshooting.md)
- [Terminology](terminology.md)
- [Error Reference](errors.md)
- [Troubleshooting](troubleshooting.md)
- [Assembler Reference](reference/README.md)
- [Instructions](reference/instructions.md)
- [Directives](reference/directives.md)
- [Instructions](reference/instructions.md)
- [Directives](reference/directives.md)
- [Development](dev/README.md)
4 changes: 2 additions & 2 deletions doc/src/reference/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Assembler reference

* auto-gen TOC;
{:toc}
- auto-gen TOC;
{:toc}

This section strives to be a developer reference for the SPC700 instruction set. It is based on a couple of other documents: mainly a [very comprehensive SNES APU manual](https://web.archive.org/web/20060208001231/http://www.alpha-ii.com/snesmusic/files/spc700_apu_manual.txt), [Gau's higher-level overview](http://emureview.ztnet.com/developerscorner/SoundCPU/spc.htm), the [nocash SNES hardware specification](https://problemkaputt.de/fullsnes.htm#snesapudspbrrsamples), and the [Asar manual](https://rpghacker.github.io/asar/manual/). Note that because spcasm mostly concerns itself with SPC700 programming, I/O aspects are barely documented here; the nocash specification and the APU manual have very detailed information on how the DSP works and how it can be utilized.

Expand Down
2 changes: 1 addition & 1 deletion doc/src/reference/complex_segments.s
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,4 @@ pullpc

some_other_subroutine:
nop
; [...]
; [...]
4 changes: 2 additions & 2 deletions doc/src/reference/instructions.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Instructions

* auto-gen TOC;
{:toc}
- auto-gen TOC;
{:toc}

All SPC700 instructions have the form `MNEMONIC TARGET,SOURCE`. The addressable memory range and flags set depend on the exact opcode. When flags are not given, the instruction does not set any flags but might inspect them.

Expand Down
Loading

0 comments on commit 52778ca

Please sign in to comment.