Skip to content

Conversation

@xiemaisi
Copy link

@xiemaisi xiemaisi commented Mar 4, 2019

Redo of #998, which unintentionally missed the RC branch.

Max Schaefer added 2 commits February 27, 2019 11:54
Every once in a while we encounter projects using some custom file extension for files that we could in principle extract, but since the extractor doesn't know about the extension the files are skipped.

To handle this, the legacy extractor has a `--file-type` option that one can use to specify a file type to use for all files in that particular extraction. So far, `AutoBuild` has nothing of the sort.

This PR proposes to introduce an environment variable `LGTM_INDEX_FILETYPES` to allow a similar customisation. In the fullness of time, this variable would be set through `lgtm.yml` in the usual way, but for now it is undocumented and for internal use only.

Specifically, `LGTM_INDEX_FILETYPES` is a newline-separated list of ".extension:filetype" pairs, specifying that files with the given `.extension` should be extracted as type `filetype`, where
`filetype` is one of `js`, `html`, `json`, `typescript` or `yaml`.

For example, `.jsm:js` causes all `.jsm` files to be extracted as JavaScript.

This can also be used to override default file types: for example, by specifying `.js:typescript` all JavaScript files will be extracted as TypeScript.
@xiemaisi xiemaisi added the JS label Mar 4, 2019
@xiemaisi xiemaisi added this to the 1.20 milestone Mar 4, 2019
@xiemaisi xiemaisi requested a review from a team as a code owner March 4, 2019 10:54
@xiemaisi xiemaisi added the WIP This is a work-in-progress, do not merge yet! label Mar 4, 2019
@xiemaisi
Copy link
Author

xiemaisi commented Mar 4, 2019

Shouldn't be needed if #1032 works out.

@xiemaisi xiemaisi merged commit 9d77619 into github:rc/1.20 Mar 4, 2019
@xiemaisi xiemaisi deleted the js/autobuild-file-types branch March 13, 2019 15:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

JS WIP This is a work-in-progress, do not merge yet!

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants