-
Notifications
You must be signed in to change notification settings - Fork 9
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
Examples formatting Standards #9
Comments
I believe these can be easily configured on the editor.
I think I normally use 2 spaces. However, it's ok to set it to 4. I can adapt.
Unlike other items, which are meant to make reading easier, this can have the opposite effect. Hence, I'm ok with changing it if you wish. For C and shell scripts, I think we can add some linter to CI. For VHDL, we need to handle it in a best effort basis. |
I quite like the idea of leaving the tab space as 2. I prefer tabs over spaces, but we'd just like each file to be consistent, so I won't ask you to change to tabs!
I am feeling a small wish to have the
Should I restrict the standards to vhdl files only then? |
I believe that I have set VSCode so it detects what's used. That's why I'm good as long as it is consistent per file 🤣 . However, when I write new files I always use 2, and I find it hard to refrain myself from removing half the indentation when I find 4...
Let's make them explicit. However, how explicit? For example, I think that entities and architectures support
I'm not aware of any tools that can help us enforce the style rules that you listed for bash. The same applies to the file naming convention. Hence, for now, I think we need to keep all of what's already defined. Regarding C, I'd really like to use some heavily opinionated linter/formatter, such as black for Python or golang's build-int gofmt. I believe that the best solution to spend little time discussing styling issues is to have a tool decide them for you. We should prioritize consistency, not preferences. Unfortunately, I have absolutely no idea about similar tools for C. BTW, we might want to guess how to use Sphinx to document C sources (similar to doxygen). That would be specially interesting to show the header for the C interface as an API. |
👍 I have researched Sphinx auto documenting C sources before. I can only imagine it coming in to play for the ghdl.h at the moment though. So I wouldn't say that it is pressing. Let's try find a C formatter 👍 |
Agree. Once we have it ready for
This is work in progress: GHDL (language-server), rust_hdl and PyVHDLParser. See jeremiah-c-leary/vhdl-style-guide#312 for a detailed discussion. AFAIK, there is no other open source VHDL parsing/analysis project which is expected to support VHDL 2008 and semantic analysis. There are lots of attempts, but the scope of most of them is limited to earlier versions of the standard. Others try to use parser generators such as ANTLR, but I believe that's a dead-end. Regarding customisation, I don't mind it at all. I prefer consistency over customisation. I'm now proposing specific style guidelines because we need to have some so that new users (which are the target of these examples/docs) do not get distracted by format differences. Nevertheless, I'm open to drop all of them as soon as any tool decides for us.
I was having a quick look yesterday. It seems that |
Just to get a final word on the format standards of the examples.
/cc @umarcor
attribute foreign of getLogicVecBSize : function is "VHPIDIRECT getLogicVecBSize";
.end;
(at leastend process/function;
).main.c
must contain amain()
caux.c
main.c
andcaux.c
, provide appropriatecaux.h
(Add header files to examples and rename main.c #5)pkg
inpkg.vhd
ent
inent.vhd
tb
intb.vhd
run.sh
The text was updated successfully, but these errors were encountered: