Commit Graph

48 Commits

Author SHA1 Message Date
Owen Mansel-Chan
d0c9aacd54 Distinguish variadic and non-variadic signature types in extractor 2021-12-01 09:33:44 -05:00
Owen Mansel-Chan
d35a46e2f3 Always extract an empty interface type 2021-11-26 15:04:05 -05:00
Owen Mansel-Chan
245d85ae97 Update dbscheme to add table for variadic signature types 2021-11-01 16:00:49 +00:00
Chris Smowton
c13229d581 Revert "Merge pull request #554 from xhd2015/accelerate_go_list"
This reverts commit e5a2b6081d, reversing
changes made to ee893b252c.
2021-09-16 17:16:59 +01:00
Sauyon Lee
f9ce06b4c0 Check for nil when getting package info 2021-09-02 11:25:58 -07:00
Sauyon Lee
6ed6193973 Remove redundant map assignments and fix some typos 2021-09-02 11:25:57 -07:00
xhd2015
8532605be7 Accelerating go-extractor by using 'go list -deps' instead of just 'go list'
Change-Id: Icc77214809a0bb8536d751f21194690d58663dc5
2021-09-02 11:25:57 -07:00
Tom Hvitved
a9a0cffb01 Drop redundant columns from files and folders relations 2021-08-26 13:41:44 +02:00
Sauyon Lee
f20922dcc7 Handle - positions in errors 2021-08-19 14:02:29 -07:00
Sauyon Lee
bfe6e7510d Evaluate symlinks for the dummy file 2021-04-27 08:32:21 -07:00
Sauyon Lee
fa5cb652d8 Fix lines of code counting 2021-04-27 01:18:20 -07:00
Sauyon Lee
f15b65d07e Extract dummy files for errors with no location 2021-04-21 21:14:40 -07:00
Sauyon Lee
488f7f5b9b Use pre-transformed path for extractor fileinfo 2021-04-21 21:14:40 -07:00
Chris Smowton
90c4b5d63f Switch to using HTML entities for escaping 2021-04-21 21:14:39 -07:00
Chris Smowton
06c958e61f Extractor: tolerate curly braces in struct field tags, directory names
These previously produced malformed TRAP. I have checked the other uses of GlobalID and don't see any others that should require escaping.
2021-04-21 21:14:39 -07:00
Sauyon Lee
4451920ada fixup windows 2021-03-31 08:56:34 -07:00
Sauyon Lee
cd6fb7d699 Extract files for error locations
Co-authored-by: Chris Smowton <smowton@github.com>
2021-03-31 03:37:55 -07:00
Chris Smowton
c2c88b0835 Unify two implementations of GetExtractorPath
This retains both their features:
* The new util.go one cached its result.
* The old go-autobuilder.go one worked under ODASA, where CODEQL_GO_EXTRACTOR_ROOT is unset but os.Executable is a useful substitute.
2021-03-25 11:24:39 +00:00
Sauyon Lee
104b9cffbd Extract extractor diagnostic information 2021-03-19 04:34:15 -07:00
Chris Smowton
2b07e6a0f4 Merge pull request #324 from sauyon/tracing
Build tracing
2020-10-15 11:27:34 +01:00
Sauyon Lee
3242df4177 Use package root directory to find go.mod files 2020-10-14 09:13:57 -07:00
Sauyon Lee
16796529fc Add package directory as a wanted root 2020-10-08 23:31:05 -07:00
Sauyon Lee
7ea3b34e4b extractor: Reorganize code to be in a slightly more sensible order 2020-09-25 04:23:35 -07:00
Sauyon Lee
e158b39287 Improve extractor logging
Co-authored-by: Max Schaefer <54907921+max-schaefer@users.noreply.github.com>
2020-09-25 04:23:31 -07:00
Max Schaefer
52a659183d Merge pull request #314 from smowton/smowton/admin/bump-golang-tools
Bump to latest version of golang.org/x/tools
2020-09-07 16:02:55 +01:00
Chris Smowton
e386346a25 Extractor: tolerate ast.File structures without a package declaration
In earlier versions of golang/x/tools these would be omitted entirely; now they can result in ast.File structures whose ast.Package field is zero (NoPos), and in my experience these contain no information in their other fields either.
2020-09-03 14:32:23 +01:00
Max Schaefer
bdfd1d131f Teach extractor to record the presence of an ellipsis in a call expression. 2020-08-10 07:30:23 +01:00
Max Schaefer
1a8688a8f4 Extract enough information to distinguish type definitions from alias declarations. 2020-07-10 14:12:51 +01:00
Chris Smowton
6bf3802b3f Make CommentGroups AST-children of Files
Previously they were roots, with children hanging off them. Now they are children of Files, and both CommentGroups and Comments can be discovered using AstNode.getAChild.

The PrintAst pass is also adapted to account for their new position.
2020-07-08 17:49:47 +01:00
Sauyon Lee
380060c7e4 extractor: Refactor regexp compilation for the relative directory check 2020-06-24 23:29:55 -07:00
Sauyon Lee
fa391b1516 extractor: Factor out common bits for running go list 2020-06-24 23:29:54 -07:00
Sauyon Lee
ebdd724b75 Simplify logic for deciding whether to extract a package 2020-06-24 23:29:53 -07:00
Sauyon Lee
9bd1f87d66 Address review comments 2020-06-24 23:29:51 -07:00
Sauyon Lee
7863bb656e Use the -mod argument from the build when calling go list 2020-06-24 23:29:49 -07:00
Sauyon Lee
f197975c6e Extract packages more intelligently
We now extract packages that have the same module root as the specified packages, as determined by
the `go list` command.
2020-06-24 23:29:47 -07:00
Max Schaefer
97b1d3a57c Fix extraction of error positions for paths containing colon. 2020-04-20 08:04:16 +01:00
Max Schaefer
a837d5f4ce Add support for extracting Go frontend errors. 2020-04-09 16:39:47 +01:00
Max Schaefer
510b6070c9 Introduce official environment variable for goroutine limiting.
We've had to tell people how to do this, so we should have a name for it that doesn't refer to a defunct company.
2020-04-02 10:45:52 +01:00
Max Schaefer
d7d5447689 Merge pull request #46 from sauyon/force-extract-methods
Extract methods when they don't exist
2020-03-12 08:16:44 +00:00
Sauyon Lee
ecd4c42428 extractor: Factor out method extraction
This fixes a subtle bug where the underlying interface type was used
as the receiver when constructing method labels, causing some database
inconsistencies.
2020-03-10 22:01:16 -07:00
Sauyon Lee
0daf8c1fa3 extractor: Extract methods when their labels don't exist 2020-03-10 20:36:49 -07:00
Sauyon Lee
ccae530508 extractor: minor refactoring to use variables 2020-03-10 20:36:13 -07:00
Sauyon Lee
dd3f98c549 extractor: Don't log directory being walked for go.mod files 2020-03-06 06:51:21 -08:00
Sauyon Lee
f2358a0a86 Find all go.mod files before extraction 2020-03-04 16:08:55 -08:00
Sauyon Lee
db4efd6124 Add support for extracting go.mod files 2020-03-04 06:26:42 -08:00
Max Schaefer
2eba7dee6f Add new table methodhosts associating interface methods with named types.
In particular, methods from embedded interfaces will be associated with the same named type as those from the outer interface, even though their receiver types may be different.
2020-02-28 10:24:04 +00:00
Sauyon Lee
5417102c37 Rename the go module to github.com/github/codeql-go 2020-02-10 11:00:00 -08:00
Max Schaefer
d14eb855fc Go analysis support for CodeQL. 2019-11-08 12:16:26 +00:00