Skip to content
This repository has been archived by the owner on Jun 13, 2019. It is now read-only.

Test file and directory names have spaces #37

Closed
zqzhang opened this issue Jan 13, 2016 · 4 comments
Closed

Test file and directory names have spaces #37

zqzhang opened this issue Jan 13, 2016 · 4 comments

Comments

@zqzhang
Copy link
Contributor

zqzhang commented Jan 13, 2016

The test file and directory under tests/tests have spaces. This makes parsing testing results hard, and JavaScript file naming convention inconsistent.

Actually there are no common file/directory naming convention guide in jquery [1], node [2] community. Only find Google JavaScript guide [3] that suggests filenameslikethis.js. I wonder whether it is possible to use this naming rule for naming test files and directories.


  1. http://contribute.jquery.org/style-guide/js/#naming-conventions
  2. https://github.com/felixge/node-style-guide
  3. https://google.github.io/styleguide/javascriptguide.xml#Naming
@zqzhang
Copy link
Contributor Author

zqzhang commented Jan 13, 2016

Checking all JS files in this repository, there are several styles:

  1. FileNamesLikeThis.js, see ./lib/
  2. file-names-like-this.js, see ./grunt-build/. This is also the C code file naming used in this repository.
  3. filenameslikethis.js, see ./grunt-build/tasks/
  4. file.names.like.this.js, see ./js/

If possible, use one style in this repository except files from 3rd party. What do you think?

@zqzhang
Copy link
Contributor Author

zqzhang commented Jan 13, 2016

@wanghongjuan for your info. This repository prefers grunt format, jQuery code style; while https://github.com/otcshare/dollhouse/pull/2#discussion_r45883722 prefers 'Closure Linter', mainly Google style. And the https://github.com/01org/iot-rest-api-server style looks more like dollhouse's.

This is not a problem, but please take care if we want to make code contribution.

@gabrielschulhof
Copy link

There's no recommented style for the file names, only for their contents.

In the case of the tests, I chose to store the name of the test in the filename, because the test has to run in a separate process, so I have no easy way of conveying information about the test back to the console.

In the case of grunt tasks, the filename coincides with the name of the grunt task, so the less verbose, the better.

In case of the files under grunt-build, those are just lists of files.

@zqzhang
Copy link
Contributor Author

zqzhang commented Jan 15, 2016

I have no easy way of conveying information about the test back to the console.

Hmm, seems so; but file-names-like-this sounds not bad as test name info. This naming is consistent with your C file names too.

I will take a deep look at the grunt and grunt tasks, and come back with comments if have new findings.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants