abartov / bybeconv

Project Ben-Yehuda's content management system.
https://benyehuda.org/
Other
10 stars 5 forks source link

This codebase runs https://benyehuda.org -- the Project Ben-Yehuda digital library of works in Hebrew.

I make little effort to make the code general, but if you're looking to do something similar (e.g. a digital library in Yiddish), maybe you can adapt some of my code.

External (i.e. hosting system) dependencies:

Linters

Since 2024 we've included some linters in project, namely:

Some quick rubocop tips

Most simple command:

rubocop

Will check whole project. In most cases it is not required. Also it will produce tons of warnings, as many parts of codebase does not follow style guidelines.

In most cases you may want to check single file:

rubocop <Path to file>

Another useful feature is rubocop's autocorrection. In some cases rubocop can try to fix style violations on its own.

There is "safe" autocorrection which should be OK in most cases:

rubocop -a <Path to file>

And more risky version of it, which can fix more issues, but known to produce errors more often:

rubocop -A <Path to file>

In any case you should be careful with autocorrection and always check result of autocorrection before commiting it to git.

Pronto

To run linters only on those parts of projects, affected by your PR you can use pronto tool. For example following command:

pronto run -c origin/master

will run linters only on lines of code which were changed compared to origin/master branch. Our CI pipeline uses this approach for all PRs.

License

The code is available for re-use under the GNU Affero General Public License http://www.gnu.org/licenses/agpl-3.0.html