When to (enforce) linting in a software project

I’m heading a new team of developers working on a software project that makes use of continuous integration (circleci) w/ a pretty fleshed out suite of busterjs unit/integration/acceptance tests. Our project is primarily written w/ coffeescript, and I try to make use of coffeescript-linter to ensure everyone working our code base keeps code consistent and as organized as possible.

My question is, does anyone have any thoughts on when/if/how to enforce linting? Should I integrate linting into my tests that are executed by circleci before deployment?

Another thought I had was writing a simple shell script that combines git-push and the linting utility into one step and then including it in the project & having everyone use it.

I’m pretty new to managing teams of programmers so anyone else’s feedback is much appreciated.

EDIT:
In the last 3 seconds it just occurred to me that git-hooks is probably perfect for this. Specifically a git-hook on commit.

2

When you a) have a coding standard and b) have configured the linter to be consistent with the coding standard, that’s when you start enforcing linting.

Put the linter on the CI server.

1

The question is, how important is it to you that issues found by coffeescript-linter are addressed immediately.

If it is unacceptable to have code in the repository that gets flagged by the linter, then you should have the linter run as a commit hook so it can block the commit if there are issues.

If it is undesirable but not unacceptable, then I would run the linter as part of the test suite (and it it complains, regard that as a test failure)

If it is not practical to run the linter as a test case, then I would run it on the CI server on a separate schedule (for example, once a day or once a week) and encourage developers to use the linter when they have a particularly large commit.

2

The team I work with is very strict with linting – the helpfulness of that is something I can’t understate.

Unfortunately, git has no way to enforce linting. Even if it did, enforcing the correct version of the linting tool, enforcing the same configuration etc would still be a problem.

So this was our solution:

  1. Our lint configurations are committed – and changes heavily scrutinised in code review. This keeps them in sync.
  2. The lint runs on the CI server. This CI plan should never fail – and when it does, the culprit’s name (ie, the last to commit) comes up in big red letters in our group chat.
  3. In light of the above, it is in the interest of our programmers to prevent it from happening by making sure their git hooks are working correctly.

It works very well for us, Once programmers get into the habit even the linters don’t really hold them up, as they’ll just eventually write in the enforced style. Until then, expect them to be cursing at the computer and whining about how long it takes them to do things. It doesn’t actually affect them that much, but it can feel like it when running down a long list of things that are “wrong”.

As you commented already on your own, I think it is most important that the team carries the decision that successful linting should be required.

I’m a big fan of static code analysis. I once managed to enforce a similar thing in the backend (“Treat Warnings As Errors” in C#) in an organization across several teams. At least some aspects of this were questioned over and over again (mostly because of technical shortcomings).

If some team members are really uncomfortable with the overhead incurred by continuous linting, the better solution can be to deactivate (parts of) it. Sometimes having all team members on the same page is more important than a cleaner code base.

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật