-
Notifications
You must be signed in to change notification settings - Fork 441
Code Style
We are using Rubocop to check the code style. We are following the Rubocop defaults, with the exceptions in .rubocop.yml. We are not following any other style conventions.
The decision of adding a new style rule (Rubocop cop) is made when updating Rubocop. Normally, every Rubocop update introduces plenty of new cops. In the PR for updating it, which is normally opened by Depfu, you can raise your concerns if you don't agree with the default Rubocop configuration. This means that PRs to update Rubocop needs to be carefully reviewed: @openSUSE/open-build-service should be mentioned in the PR and it shouldn't be immediately merged to ensure that all developers have plenty of time/chances to discuss the style rule changes, however silence means agreement.
If there is a disagreement about a rule that can not be resolved, the rule will get disabled in .rubocop.yml.
When changing the default configuration, by adding custom configuration to .rubocop.yml, add a comment that explains why the rule was disabled.
If you don't agree with an already agreed style rule, please open an issue to reach a new agreement with the development team.
Note that the offenses in .rubocop_todo.yml, are rules we have already agreed on but that we didn't solve yet (most likely because we didn't have time). That means that those offenses can be solved without a previous discussion.
In case that you don't agree with an already introduced style rule, you can open an issue to discuss about it. It is better to create an issue than complaining in the PR to solve the offenses.
How you can update the Rubocop configuration is documented in our Documentation of test tasks in OBS guide.
- Development Environment Overview
- Development Environment Tips & Tricks
- Spec-Tips
- Code Style
- Rubocop
- Testing with VCR
- Authentication
- Authorization
- Autocomplete
- BS Requests
- Events
- ProjectLog
- Notifications
- Feature Toggles
- Build Results
- Attrib classes
- Flags
- The BackendPackage Cache
- Maintenance classes
- Cloud uploader
- Delayed Jobs
- Staging Workflow
- StatusHistory
- OBS API
- Owner Search
- Search
- Links
- Distributions
- Repository
- Data Migrations
- next_rails
- Ruby Update
- Rails Profiling
- Installing a local LDAP-server
- Remote Pairing Setup Guide
- Factory Dashboard
- osc
- Setup an OBS Development Environment on macOS
- Run OpenQA smoketest locally
- Responsive Guidelines
- Importing database dumps
- Problem Statement & Solution
- Kickoff New Stuff
- New Swagger API doc
- Documentation and Communication
- GitHub Actions
- How to Introduce Software Design Patterns
- Query Objects
- Services
- View Components
- RFC: Core Components
- RFC: Decorator Pattern
- RFC: Backend models