Commit graph

9 commits

Author SHA1 Message Date
GitLab Bot
3f9e1b2611 Add latest changes from gitlab-org/gitlab@master 2020-01-23 15:08:46 +00:00
gfyoung
d598e4fd93 Enable more frozen string in lib/**/*.rb
Enables frozen for the following:

* lib/*.rb
* lib/banzai/**/*.rb
* lib/bitbucket/**/*.rb
* lib/constraints/**/*.rb
* lib/container_registry/**/*.rb
* lib/declarative_policy/**/*.rb

Partially addresses #47424.
2018-10-06 17:02:50 -07:00
Lin Jen-Shin
3bfe306624 Resolve Naming/UncommunicativeMethod 2018-07-09 21:13:08 +08:00
🙈 jacopo beschi 🙉
c6b1043e9d Resolve "Make a Rubocop that forbids returning from a block" 2018-04-18 09:19:40 +00:00
Jacopo
181cd299f9 Adds Rubocop rule for line break after guard clause
Adds a rubocop rule (with autocorrect) to ensure line break after guard clauses.
2017-11-16 17:58:29 +01:00
Sean McGivern
d771719278 Speed up DeclarativePolicy::Runner#steps_by_score
There were a couple of things here:

1. If the state was already enabled, we don't need to check all the remaining
   steps - only those that can prevent the state. (An enable followed by an
   enable is a no-op.) This logic is in `#run`, but we still did the work of
   scoring and sorting the steps.
2. The sorting is known to be inefficient, but we can make it slightly more
   efficient by stopping once we have a step with zero score, as that means it's
   free.

Neither of these make this _fast_, especially when called lots of times - as we
do when there is lots of activity on an issue - but they do help some.
2017-10-04 13:50:05 +01:00
http://jneen.net/
15bb6e1ed7 more eagerly bail when the state is prevented 2017-08-07 12:48:22 -07:00
http://jneen.net/
8a167554a9 reduce iterations by keeping a count of remaining enablers
rather than iterating the whole remaining step set with
.all?(&:prevent?)
2017-08-07 12:36:13 -07:00
http://jneen.net/
80d6e5bbd4 add a new DeclarativePolicy framework 2017-06-27 12:41:54 -07:00