Closed zqzhang closed 8 years ago
Checking all JS files in this repository, there are several styles:
FileNamesLikeThis.js
, see ./lib/file-names-like-this.js
, see ./grunt-build/. This is also the C code file naming used in this repository.filenameslikethis.js
, see ./grunt-build/tasks/file.names.like.this.js
, see ./js/If possible, use one style in this repository except files from 3rd party. What do you think?
@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.
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.
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.
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.