Skip to content
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

Add functions to support C/C++ Linters #18

Open
phillipjohnston opened this issue Oct 19, 2017 · 0 comments
Open

Add functions to support C/C++ Linters #18

phillipjohnston opened this issue Oct 19, 2017 · 0 comments

Comments

@phillipjohnston
Copy link
Member

  1. Use a Linter
    So many problems can be solved by using a code linter. For anyone who’s unfamiliar with linters, a code linter reads your code and outputs errors and warnings if your code is not compliant with the specifications and standards of a language. These warnings may seem insignificant at the time, but, like the lint in your house, they add up over time. To get the most out of using a linter, I would suggest the following tricks:

Enforce the Language or Framework Standard
I highly recommend running a linter on your code to enforce the most widely accepted set of standards for the language or framework you’re working in. For example, if you’re writing Python, I would suggest you use the pylint package, which enforces rules defined in PEP-8. If you’re writing an Angular app, I would suggest using a linter configuration that follows the Angular style guide.

Integrate Your Linter With CI
A linter really isn’t going to help you at all unless you’re using it regularly, and from my experience, developers don’t typically do this unless they’re forced to. It only takes minutes to learn how to use a linter properly, so why do so many developers neglect to do so? I think it’s because we as developers are often overconfident in our code and we hate adding additional steps to our development process.

For this reason, I suggest you set up a continuous integration build pipeline with a service like Atlassian’s Bamboo, Jenkins, or Travis CI. In your build pipeline, you should make linting the first step. That way, if your code doesn’t pass the lint test, it doesn’t get built, tested, or published.

Using a linter is all about making it as hard as possible for you to write crappy code.

https://github.com/embeddedartistry/jenkins-pipeline-lib/issues/new

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

No branches or pull requests

1 participant