Commit graph

12 commits

Author SHA1 Message Date
Gabriel Mazetto
5c7a738105 [CE] Add Naming/FileName rule checking expected class/module per filename 2018-03-08 12:56:54 +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
e9476eb97a Speed up cached_pass? for composite rules
Both `Or` and `And` would evaluate whether each rule passed, then calculate a
value based on the results of all of those. We can actually return early in many
cases, without running the rule at all.
2017-10-05 10:12:58 +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
Rémy Coutable
fcce6c3168 Merge branch 'rs-more-public-send-whitelists' into 'master'
Whitelist or fix additional `Gitlab/PublicSend` cop violations

See merge request !13467
2017-08-16 11:25:26 +00:00
Robert Speicher
4edfad9678 Enable Layout/TrailingWhitespace cop and auto-correct offenses 2017-08-15 13:44:37 -04:00
Robert Speicher
260c8da060 Whitelist or fix additional Gitlab/PublicSend cop violations
An upcoming update to rubocop-gitlab-security added additional
violations.
2017-08-14 12:14:11 -04: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/
fcd3e5d477 cache the cache key... 2017-07-17 14:38:48 -07:00
http://jneen.net/
45e9d28791 avoid #respond_to? in Cache.id_for 2017-07-17 14:38:48 -07:00
http://jneen.net/
80d6e5bbd4 add a new DeclarativePolicy framework 2017-06-27 12:41:54 -07:00