Skip to content

Commit 08258dd

Browse files
author
Pedro Ribeiro
authored
Merge pull request #8 from rapid7/master
hhhh
2 parents dfb0c8e + 83528b8 commit 08258dd

File tree

656 files changed

+146143
-2472
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

656 files changed

+146143
-2472
lines changed

.rubocop.yml

Lines changed: 51 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
# inherit_from: .rubocop_todo.yml
1010

1111
AllCops:
12-
TargetRubyVersion: 2.2
12+
TargetRubyVersion: 2.4
1313

1414
Metrics/ClassLength:
1515
Description: 'Most Metasploit modules are quite large. This is ok.'
@@ -45,6 +45,10 @@ Style/RedundantReturn:
4545
Description: 'This often looks weird when mixed with actual returns, and hurts nothing'
4646
Enabled: false
4747

48+
Naming/VariableNumber:
49+
Description: 'To make it easier to use reference code, disable this cop'
50+
Enabled: false
51+
4852
Style/NumericPredicate:
4953
Description: 'This adds no efficiency nor space saving'
5054
Enabled: false
@@ -55,14 +59,18 @@ Style/Documentation:
5559
Exclude:
5660
- 'modules/**/*'
5761

58-
Layout/IndentHeredoc:
62+
Layout/SpaceInsideArrayLiteralBrackets:
5963
Enabled: false
60-
Description: 'We need to leave this disabled for Ruby 2.2 compat, remove in 2018'
64+
Description: 'Almost all module metadata have space in brackets'
6165

6266
Style/GuardClause:
6367
Enabled: false
6468
Description: 'This often introduces bugs in tested code'
6569

70+
Style/EmptyLiteral:
71+
Enabled: false
72+
Description: 'This looks awkward when you mix empty and non-empty literals'
73+
6674
Style/NegatedIf:
6775
Enabled: false
6876
Description: 'This often introduces bugs in tested code'
@@ -72,9 +80,16 @@ Style/ConditionalAssignment:
7280
Description: 'This is confusing for folks coming from other languages'
7381

7482
Style/Encoding:
75-
Enabled: true
7683
Description: 'We prefer binary to UTF-8.'
77-
EnforcedStyle: 'when_needed'
84+
Enabled: false
85+
86+
Style/ParenthesesAroundCondition:
87+
Enabled: false
88+
Description: 'This is used in too many places to discount, especially in ported code. Has little effect'
89+
90+
Style/TrailingCommaInArrayLiteral:
91+
Enabled: false
92+
Description: 'This is often a useful pattern, and is actually required by other languages. It does not hurt.'
7893

7994
Metrics/LineLength:
8095
Description: >-
@@ -83,17 +98,24 @@ Metrics/LineLength:
8398
Enabled: true
8499
Max: 180
85100

101+
Metrics/BlockLength:
102+
Enabled: true
103+
Description: >-
104+
While the style guide suggests 10 lines, exploit definitions
105+
often exceed 200 lines.
106+
Max: 300
107+
86108
Metrics/MethodLength:
87109
Enabled: true
88110
Description: >-
89111
While the style guide suggests 10 lines, exploit definitions
90112
often exceed 200 lines.
91113
Max: 300
92114

93-
# Basically everything in metasploit needs binary encoding, not UTF-8.
94-
# Disable this here and enforce it through msftidy
95-
Style/Encoding:
96-
Enabled: false
115+
Naming/UncommunicativeMethodParamName:
116+
Enabled: true
117+
Description: 'Whoever made this requirement never looked at crypto methods, IV'
118+
MinNameLength: 2
97119

98120
# %q() is super useful for long strings split over multiple lines and
99121
# is very common in module constructors for things like descriptions
@@ -104,11 +126,31 @@ Style/NumericLiterals:
104126
Enabled: false
105127
Description: 'This often hurts readability for exploit-ish code.'
106128

129+
Layout/AlignHash:
130+
Enabled: false
131+
Description: 'aligning info hashes to match these rules is almost impossible to get right'
132+
133+
Layout/EmptyLines:
134+
Enabled: false
135+
Description: 'these are used to increase readability'
136+
137+
Layout/EmptyLinesAroundClassBody:
138+
Enabled: false
139+
Description: 'these are used to increase readability'
140+
141+
Layout/EmptyLinesAroundMethodBody:
142+
Enabled: false
143+
Description: 'these are used to increase readability'
144+
107145
Layout/AlignParameters:
108146
Enabled: true
109147
EnforcedStyle: 'with_fixed_indentation'
110148
Description: 'initialize method of every module has fixed indentation for Name, Description, etc'
111149

150+
Style/For:
151+
Enabled: false
152+
Description: 'if a module is written with a for loop, it cannot always be logically replaced with each'
153+
112154
Style/StringLiterals:
113155
Enabled: false
114156
Description: 'Single vs double quote fights are largely unproductive.'

.ruby-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2.6.1
1+
2.6.2

.travis.yml

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,8 @@ addons:
1111
- graphviz
1212
language: ruby
1313
rvm:
14-
- '2.3.8'
15-
- '2.4.5'
16-
- '2.5.3'
17-
- '2.6.1'
14+
- '2.5.5'
15+
- '2.6.2'
1816

1917
env:
2018
- CMD='bundle exec rake rspec-rerun:spec SPEC_OPTS="--tag content"'
@@ -25,11 +23,6 @@ env:
2523

2624
matrix:
2725
fast_finish: true
28-
exclude:
29-
- rvm: '2.3.8'
30-
env: CMD='bundle exec rake rspec-rerun:spec SPEC_OPTS="--tag content" REMOTE_DB=1'
31-
- rvm: '2.4.5'
32-
env: CMD='bundle exec rake rspec-rerun:spec SPEC_OPTS="--tag content" REMOTE_DB=1'
3326

3427
jobs:
3528
# build docker image

CONTRIBUTING.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,15 @@ it into Metasploit's master branch. If you do not care to follow these rules, y
2020
* **Do** stick to the [Ruby style guide] and use [Rubocop] to find common style issues.
2121
* **Do** follow the [50/72 rule] for Git commit messages.
2222
* **Do** license your code as BSD 3-clause, BSD 2-clause, or MIT.
23-
* **Do** create a [topic branch] to work on instead of working directly on `master` to preserve the
24-
history of your pull request. See [PR#8000] for an example of losing commit history as soon as
25-
you update your own master branch.
23+
* **Do** create a [topic branch] to work on instead of working directly on `master`.
24+
This helps protect the process, ensures users are aware of commits on the branch being considered for merge,
25+
allows for a location for more commits to be offered without mingling with other contributor changes,
26+
and allows contributors to make progress while a PR is still being reviewed.
27+
2628

2729
### Pull Requests
2830

31+
* **Do** write "WIP" on your PR and/or open a [draft PR] if submitting **working** yet unfinished code.
2932
* **Do** target your pull request to the **master branch**.
3033
* **Do** specify a descriptive title to make searching for your pull request easier.
3134
* **Do** include [console output], especially for witnessable effects in `msfconsole`.
@@ -84,7 +87,7 @@ curve, so keep it up!
8487
[Rubocop]:https://rubygems.org/search?query=rubocop
8588
[50/72 rule]:http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html
8689
[topic branch]:http://git-scm.com/book/en/Git-Branching-Branching-Workflows#Topic-Branches
87-
[PR#8000]:https://github.com/rapid7/metasploit-framework/pull/8000
90+
[draft PR]:https://help.github.com/en/articles/about-pull-requests#draft-pull-requests
8891
[console output]:https://help.github.com/articles/github-flavored-markdown#fenced-code-blocks
8992
[verification steps]:https://help.github.com/articles/writing-on-github#task-lists
9093
[reference associated issues]:https://github.com/blog/1506-closing-issues-via-pull-requests

Dockerfile

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM ruby:2.6.1-alpine3.9 AS builder
1+
FROM ruby:2.6.2-alpine3.9 AS builder
22
LABEL maintainer="Rapid7"
33

44
ARG BUNDLER_ARGS="--jobs=8 --without development test coverage"
@@ -29,15 +29,14 @@ RUN apk add --no-cache \
2929
git \
3030
&& echo "gem: --no-ri --no-rdoc" > /etc/gemrc \
3131
&& gem update --system \
32-
&& gem install bundler \
3332
&& bundle install --clean --no-cache --system $BUNDLER_ARGS \
3433
# temp fix for https://github.com/bundler/bundler/issues/6680
3534
&& rm -rf /usr/local/bundle/cache \
3635
# needed so non root users can read content of the bundle
3736
&& chmod -R a+r /usr/local/bundle
3837

3938

40-
FROM ruby:2.6.1-alpine3.9
39+
FROM ruby:2.6.2-alpine3.9
4140
LABEL maintainer="Rapid7"
4241

4342
ENV APP_HOME=/usr/src/metasploit-framework

0 commit comments

Comments
 (0)