All Projects → nishanths → predeclared

nishanths / predeclared

Licence: BSD-3-Clause license
Find definitions and declarations in Go source code that shadow predeclared identifiers

Programming Languages

go
31211 projects - #10 most used programming language

Labels

Projects that are alternatives of or similar to predeclared

Solhint
Solhint is an open source project created by https://protofire.io. Its goal is to provide a linting utility for Solidity code.
Stars: ✭ 363 (+1296.15%)
Mutual labels:  linter, ast
dedupimport
Deduplicate named/unnamed imports that have the same import path in Go files
Stars: ✭ 20 (-23.08%)
Mutual labels:  linter, ast
Graphql Go Tools
Tools to write high performance GraphQL applications using Go/Golang.
Stars: ✭ 96 (+269.23%)
Mutual labels:  linter, ast
unimport
A linter, formatter for finding and removing unused import statements.
Stars: ✭ 119 (+357.69%)
Mutual labels:  linter, ast
Elm Analyse
A tool that allows you to analyse your Elm code, identify deficiencies and apply best practices.
Stars: ✭ 418 (+1507.69%)
Mutual labels:  linter, ast
Unimport
A linter, formatter for finding and removing unused import statements.
Stars: ✭ 96 (+269.23%)
Mutual labels:  linter, ast
Bellybutton
Custom Python linting through AST expressions
Stars: ✭ 196 (+653.85%)
Mutual labels:  linter, ast
rubocop-graphql
Rubocop extension for enforcing graphql-ruby best practices
Stars: ✭ 143 (+450%)
Mutual labels:  linter
asmdot
[Unstable] Fast, zero-copy and lightweight (Arm | Mips | x86) assembler in (C | C++ | C# | Go | Haskell | Javascript | Nim | OCaml | Python | Rust).
Stars: ✭ 23 (-11.54%)
Mutual labels:  ast
asterisklint
Asterisk PBX configuration syntax checker
Stars: ✭ 45 (+73.08%)
Mutual labels:  linter
Golite
Add essential language support for the Go language to Sublime Text 3.
Stars: ✭ 14 (-46.15%)
Mutual labels:  linter
standard-www
👆 Website for JavaScript Standard Style (@standard)
Stars: ✭ 28 (+7.69%)
Mutual labels:  linter
linter-alex
📝Sensitive, considerate writing before you merge your Pull Requests
Stars: ✭ 67 (+157.69%)
Mutual labels:  linter
Python3Generator
A toolkit to generate Python 3 source code from Pharo.
Stars: ✭ 25 (-3.85%)
Mutual labels:  ast
check-geojson
a checker for the geojson format. goes beyond a schema, checking semantics and producing character-level warnings.
Stars: ✭ 36 (+38.46%)
Mutual labels:  linter
reuse-action
A Github action to check repositories for REUSE compliance
Stars: ✭ 31 (+19.23%)
Mutual labels:  linter
code summarization public
source code for 'Improving automatic source code summarization via deep reinforcement learning'
Stars: ✭ 71 (+173.08%)
Mutual labels:  ast
vscode-write-good
Write Good Linter for Visual Studio Code
Stars: ✭ 58 (+123.08%)
Mutual labels:  linter
li18nt
🌎 Lint your i18n translation files. Detect conflicting properties, duplicates and make it more readable and easier to maintain by formatting it!
Stars: ✭ 29 (+11.54%)
Mutual labels:  linter
eslintcc
Complexity of Code - JavaScript/TypeScript
Stars: ✭ 15 (-42.31%)
Mutual labels:  linter

predeclared Build Status Godoc

Find code that overrides one of Go's predeclared identifiers (new, make, append uint, etc.).

The list of predeclared identifiers can be found in the spec.

go get github.com/nishanths/predeclared

See godoc or run predeclared without arguments to print usage.

Test

cd passes/predeclared && go test

Examples

Given a package with the file:

package pkg // import "example.org/foo/pkg"

func copy()  {}
func print() {}

func foo() string {
	string := "x"
	return string
}

type int struct{}

running:

predeclared example.org/foo/pkg

prints:

example.go:3:6: function "copy" has same name as predeclared identifier
example.go:4:6: function "print" has same name as predeclared identifier
example.go:7:2: variable "string" has same name as predeclared identifier
example.go:11:6: type "int" has same name as predeclared identifier

Running the program on the standard library's text package and subpackages produces:

$ predeclared text/...
/usr/local/go/src/text/template/parse/node.go:554:33: param "true" has same name as predeclared identifier
/usr/local/go/src/text/template/parse/node.go:599:3: variable "rune" has same name as predeclared identifier
/usr/local/go/src/text/template/funcs.go:164:36: param "cap" has same name as predeclared identifier
/usr/local/go/src/text/template/funcs.go:233:3: variable "cap" has same name as predeclared identifier
/usr/local/go/src/text/template/template.go:218:30: param "new" has same name as predeclared identifier
/usr/local/go/src/text/template/exec_test.go:232:21: param "error" has same name as predeclared identifier
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].