Conventions / Recommendations for Better Integration
Try to follow the Existing coding standards :
Source Directory package (use lowercase and add '-' and version to filename) :
prefered :
tar cfvz package-name_1.2.0.tar.gz package-name-1.2.0/
zip package_name-1_2_0.zip package_name-1.2.0/
Avoid :
PackageName or package_name for dir and archives
makefile hints :
${PACKAGE}-$(VERS).tar.gz: @ls $(SRC) | sed s:^:${PACKAGE}-$(VERS)/: >MANIFEST @(cd ..; ln -s ${PACKAGE} ${PACKAGE}-$(VERS)) (cd ..; tar -czvf ${PACKAGE}/${PACKAGE}-$(VERS).tar.gz `cat ${PACKAGE}/MANIFEST`) @(cd ..; rm ${PACKAGE}-$(VERS))
Please provide those additional files :
(no <TAB>, as this is interpreted very differently between editors)
this is also easy to achieve with “indent” without any parameters (GNU style), exceptions (not mandatory):
Preferred :
Follow sun conventions
Usefull decoration (note the 80 cols delimitor and RCS keywords )
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */ /* #ident "$Id: myfile.h,v 1.1 YYY/MM/DD HH:MM:SS ${USER} Exp $" /* Author: ${LOGNAME} <${EMAIL}>, (C) YYYY - $Author:$ /* Copyright: See README file that comes with this distribution /****************************************************************************/ #ifndef MyFile_h_ #define MyFile_h_
#endif /* vi: set ts=4 sw=4 expandtab: */ /* #eof "$Id: myfile.h,v 1.1 YYY/MM/DD HH:MM:SS ${USER} Exp $" */
see C
//* -*- mode: C++; c-basic-offset: 2; indent-tabs-mode: nil -*- //* vim: ft=cpp:expandtab:ts=2:sw=4:softtabstop=4: //* #ident "$Id: file.h,v 1.1 YYY/MM/DD HH:MM:SS ${USER} Exp $" //* SPDX-Licence-Identifier: GPL3+ //* Author: ${LOGNAME} <${EMAIL}>, (C) YYYY - $Author:$ //* Copyright: See README file that comes with this distribution //****************************************************************************/ #ifndef ClassName_h_ #define ClassName_h_ class ClassName { public: void functionName();
void functionContents() { //<= jump to funct if ( true ) { // comment int a=42; } //<= aligned with if statetement }
protected: char* p_name_; }; #endif /* #eof "$Id: file.h,v 1.1 YYY/MM/DD HH:MM:SS ${USER} Exp $" */
file.h # namespace "foo" { #include "foo.hpp" } file.hxx # templates + .cxx for implem
Try to reuse previous conventions without overloading default ones
static char THIS_FILE[[]] = **FILE**; // [[WinCE]]
# ex: set tabstop=4 noexpandtab:
Python :
# -*- mode: python; python-indent-offset: 4; indent-tabs-mode: nil -*-
@TaG: Programming MetH Commit GiT