Skip to content

Commit

Permalink
upgrade linter and fix linter issues
Browse files Browse the repository at this point in the history
  • Loading branch information
cornelk committed Mar 20, 2024
1 parent 2d1edd4 commit 39e32ad
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 5 deletions.
1 change: 1 addition & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ linters:
- govet # reports suspicious constructs, such as Printf calls with wrong arguments
- grouper # An analyzer to analyze expression groups
- ineffassign # Detects when assignments to existing variables are not used
- intrange # is a linter to find places where for loops could make use of an integer range
- maintidx # measures the maintainability index of each function
- makezero # Finds slice declarations with non-zero initial length
- mirror # reports wrong mirror patterns of bytes/strings usage
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
GOLANGCI_VERSION = v1.55.2
GOLANGCI_VERSION = v1.57.0

help: ## show help, shown by default if no target is specified
@grep -E '^[0-9a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
Expand Down
2 changes: 1 addition & 1 deletion internal/assembler/nesasm/bank.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ func setPrgBankSelector(prg []program.Offset, index int, bankAddress, bankNumber
offsetInfo.Comment, offsetInfo.Code)
data := offsetInfo.OpcodeBytes

for i := 0; i < len(data); i++ {
for i := range len(data) {
offsetInfo = &prg[instructionStartIndex+i]
offsetInfo.OpcodeBytes = data[i : i+1]
offsetInfo.ClearType(program.CodeOffset)
Expand Down
2 changes: 1 addition & 1 deletion internal/disasm.go
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ func (dis *Disasm) convertToProgram() (*program.Program, error) {
for _, bnk := range dis.banks {
prgBank := program.NewPRGBank(len(bnk.offsets))

for i := 0; i < len(bnk.offsets); i++ {
for i := range len(bnk.offsets) {
offsetInfo := bnk.offsets[i]
programOffsetInfo, err := getProgramOffset(dis.codeBaseAddress+uint16(i), offsetInfo, dis.options)
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion internal/parser.go
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ func (dis *Disasm) handleInstructionIRQOverlap(address uint16, offsetInfo *offse
keepLength := int(irqStartAddress - address)
offsetInfo.OpcodeBytes = offsetInfo.OpcodeBytes[:keepLength]

for i := 0; i < keepLength; i++ {
for i := range keepLength {
offsetInfo = dis.mapper.offsetInfo(address + uint16(i))
offsetInfo.ClearType(program.CodeOffset)
offsetInfo.SetType(program.CodeAsData | program.DataOffset)
Expand Down
2 changes: 1 addition & 1 deletion internal/writer/writer.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ func (w Writer) BundleDataWrites(data []byte, lineWriter lineWriterFunc) error {
return fmt.Errorf("writing data prefix: %w", err)
}

for j := 0; j < toWrite; j++ {
for j := range toWrite {
if _, err := fmt.Fprintf(buf, "$%02x, ", data[i+j]); err != nil {
return fmt.Errorf("writing data byte: %w", err)
}
Expand Down

0 comments on commit 39e32ad

Please sign in to comment.