New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support "filenames" key, mk. 2 #115

Merged
merged 5 commits into from Jun 5, 2017

Conversation

2 participants
@kazimuth
Contributor

kazimuth commented Apr 8, 2017

Reopening #109 with comments addressed. (It took a while to get back to it, I've been swamped with work.)

We now support:

  • Makefiles
  • Rakefiles
  • Dockerfiles
  • CMakeLists.txt
  • SCons
}
}
let extension = fs::get_extension(&entry)

This comment has been minimized.

@Aaronepower

Aaronepower Apr 10, 2017

Owner

I think that extension matching should be first. Just so it's a clear set of precedences in determining the language.

(extension) > (filename) > (shebang)
@Aaronepower

Aaronepower Apr 10, 2017

Owner

I think that extension matching should be first. Just so it's a clear set of precedences in determining the language.

(extension) > (filename) > (shebang)

This comment has been minimized.

@kazimuth

kazimuth Apr 24, 2017

Contributor

That will unfortunately prevent CMake from working. If you think it's the right thing I can implement it, though.

@kazimuth

kazimuth Apr 24, 2017

Contributor

That will unfortunately prevent CMake from working. If you think it's the right thing I can implement it, though.

This comment has been minimized.

@Aaronepower

Aaronepower Apr 24, 2017

Owner

Why is that?

@Aaronepower

Aaronepower Apr 24, 2017

Owner

Why is that?

This comment has been minimized.

@kazimuth

kazimuth Apr 26, 2017

Contributor

The canonical CMake filename is CMakeLists.txt, for whatever reason. Maybe to make them easier for Windows users to edit?

If we detect by extension first, that will always be detected as plaintext, despite being a very different language from plaintext.

Similar cases are Cargo.toml and package.json, although those are more straightforwardly TOML and JSON files, so I understand why you don't want to count them separately.

Note that the filename key matches the entire filename, not just the extension-stripped stem. So in this scheme, Makefile.bananas won't be detected as anything, since there's nothing with the Makefile.bananas filename, and nothing with the bananas extension.

@kazimuth

kazimuth Apr 26, 2017

Contributor

The canonical CMake filename is CMakeLists.txt, for whatever reason. Maybe to make them easier for Windows users to edit?

If we detect by extension first, that will always be detected as plaintext, despite being a very different language from plaintext.

Similar cases are Cargo.toml and package.json, although those are more straightforwardly TOML and JSON files, so I understand why you don't want to count them separately.

Note that the filename key matches the entire filename, not just the extension-stripped stem. So in this scheme, Makefile.bananas won't be detected as anything, since there's nothing with the Makefile.bananas filename, and nothing with the bananas extension.

This comment has been minimized.

@Aaronepower

Aaronepower Apr 26, 2017

Owner

Why did you choose the entire filename over the stem?

@Aaronepower

Aaronepower Apr 26, 2017

Owner

Why did you choose the entire filename over the stem?

This comment has been minimized.

@kazimuth

kazimuth May 9, 2017

Contributor

In order to support CMakeLists.txt, mainly.

@kazimuth

kazimuth May 9, 2017

Contributor

In order to support CMakeLists.txt, mainly.

This comment has been minimized.

@Aaronepower

Aaronepower May 9, 2017

Owner

Alright, seems fine with me, if you could rebase it onto the latest I'll be happy to merge it in.

@Aaronepower

Aaronepower May 9, 2017

Owner

Alright, seems fine with me, if you could rebase it onto the latest I'll be happy to merge it in.

@kazimuth

This comment has been minimized.

Show comment
Hide comment
@kazimuth

kazimuth Jun 5, 2017

Contributor

Rebased!

Contributor

kazimuth commented Jun 5, 2017

Rebased!

@Aaronepower Aaronepower merged commit 7849edf into Aaronepower:master Jun 5, 2017

2 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment