Skip to content

Commit 5e38a56

Browse files
authored
Merge pull request #8 from PlagueHO/dev
Release to Master - Updated Code of Conduct
2 parents 776616f + dafaa38 commit 5e38a56

11 files changed

+329
-190
lines changed

.MetaTestOptIn.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,9 @@
22
"Common Tests - Validate Markdown Files",
33
"Common Tests - Validate Example Files",
44
"Common Tests - Validate Module Files",
5-
"Common Tests - Validate Script Files"
5+
"Common Tests - Validate Script Files",
6+
"Common Tests - Required Script Analyzer Rules",
7+
"Common Tests - Flagged Script Analyzer Rules",
8+
"Common Tests - New Error-Level Script Analyzer Rules",
9+
"Common Tests - Custom Script Analyzer Rules"
610
]

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22

33
## Unreleased
44

5+
- Enabled PSSA rule violations to fail build - Fixes [Issue #6](https://github.com/PlagueHO/FileContentDsc/issues/6).
6+
- Updated tests to meet Pester v4 standard.
7+
58
## 1.0.0.0
69

710
- DSR_ReplaceText:

CODEOFCONDUCT.md

Lines changed: 133 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,133 @@
1+
# Open Source Code of Conduct
2+
3+
This code of conduct outlines our expectations for participants within this
4+
DSC Resource Module community, as well as steps to reporting unacceptable behavior.
5+
We are committed to providing a welcoming and inspiring community for all and expect
6+
our code of conduct to be honored. Anyone who violates this code of conduct may be
7+
banned from the community.
8+
9+
Our open source communities strive to:
10+
11+
- **Be friendly and patient.**
12+
- **Be welcoming:** We strive to be a community that welcomes and supports people
13+
of all backgrounds and identities. This includes, but is not limited to members
14+
of any race, ethnicity, culture, national origin, colour, immigration status,
15+
social and economic class, educational level, sex, sexual orientation, gender
16+
identity and expression, age, size, family status, political belief, religion,
17+
and mental and physical ability.
18+
- **Be considerate:** Your work will be used by other people, and you in turn
19+
will depend on the work of others. Any decision you take will affect users and
20+
colleagues, and you should take those consequences into account when making
21+
decisions. Remember that we're a world-wide community, so you might not be
22+
communicating in someone else's primary language.
23+
- **Be respectful:** Not all of us will agree all the time, but disagreement is
24+
no excuse for poor behavior and poor manners. We might all experience some
25+
frustration now and then, but we cannot allow that frustration to turn into a
26+
personal attack. It's important to remember that a community where people feel
27+
uncomfortable or threatened is not a productive one.
28+
- **Be careful in the words that we choose:** we are a community of professionals,
29+
and we conduct ourselves professionally. Be kind to others. Do not insult or
30+
put down other participants. Harassment and other exclusionary behavior aren't
31+
acceptable.
32+
- **Try to understand why we disagree:** Disagreements, both social and technical,
33+
happen all the time. It is important that we resolve disagreements and differing
34+
views constructively. Remember that we're different. The strength of our community
35+
comes from its diversity, people from a wide range of backgrounds. Different people
36+
have different perspectives on issues. Being unable to understand why someone holds
37+
a viewpoint doesn't mean that they're wrong. Don't forget that it is human to err
38+
and blaming each other doesn't get us anywhere. Instead, focus on helping to resolve
39+
issues and learning from mistakes.
40+
41+
## Definitions
42+
43+
Harassment includes, but is not limited to:
44+
45+
- Offensive comments related to gender, gender identity and expression, sexual
46+
orientation, disability, mental illness, neuro(a)typicality, physical appearance,
47+
body size, race, age, regional discrimination, political or religious affiliation
48+
- Unwelcome comments regarding a person's lifestyle choices and practices,
49+
including those related to food, health, parenting, drugs, and employment
50+
- Deliberate misgendering. This includes deadnaming or persistently using a
51+
pronoun that does not correctly reflect a person's gender identity. You must
52+
address people by the name they give you when not addressing them by their username
53+
or handle
54+
- Physical contact and simulated physical contact (eg, textual descriptions like
55+
"hug" or "backrub") without consent or after a request to stop
56+
- Threats of violence, both physical and psychological
57+
- Incitement of violence towards any individual, including encouraging a person
58+
to commit suicide or to engage in self-harm
59+
- Deliberate intimidation
60+
- Stalking or following
61+
- Harassing photography or recording, including logging online activity for
62+
harassment purposes
63+
- Sustained disruption of discussion
64+
- Unwelcome sexual attention, including gratuitous or off-topic sexual images or
65+
behaviour
66+
- Pattern of inappropriate social contact, such as requesting/assuming inappropriate
67+
levels of intimacy with others
68+
- Continued one-on-one communication after requests to cease
69+
- Deliberate "outing" of any aspect of a person's identity without their consent
70+
except as necessary to protect others from intentional abuse
71+
- Publication of non-harassing private communication
72+
73+
Our open source community prioritizes marginalized people's safety over privileged
74+
people's comfort. We will not act on complaints regarding:
75+
76+
- 'Reverse' -isms, including 'reverse racism,' 'reverse sexism,' and 'cisphobia'
77+
- Reasonable communication of boundaries, such as "leave me alone," "go away," or
78+
"I'm not discussing this with you"
79+
- Refusal to explain or debate social justice concepts
80+
- Communicating in a 'tone' you don't find congenial
81+
- Criticizing racist, sexist, cissexist, or otherwise oppressive behavior or assumptions
82+
83+
## Diversity Statement
84+
85+
We encourage everyone to participate and are committed to building a community
86+
for all. Although we will fail at times, we seek to treat everyone both as fairly
87+
and equally as possible. Whenever a participant has made a mistake, we expect them
88+
to take responsibility for it. If someone has been harmed or offended, it is our
89+
responsibility to listen carefully and respectfully, and do our best to right the
90+
wrong.
91+
92+
Although this list cannot be exhaustive, we explicitly honor diversity in age,
93+
gender, gender identity or expression, culture, ethnicity, language, national
94+
origin, political beliefs, profession, race, religion, sexual orientation, socioeconomic
95+
status, and technical ability. We will not tolerate discrimination based on any
96+
of the protected characteristics above, including participants with disabilities.
97+
98+
## Reporting Code of Conduct Issues
99+
100+
If you experience or witness unacceptable behavior—or have any other concerns,
101+
please report it by contacting us via [dscottraynsford@outlook.com](mailto:dscottraynsford@outlook.com).
102+
All reports will be handled with discretion.
103+
104+
In your report please include:
105+
106+
- Your contact information.
107+
- Names (real, usernames or pseudonyms) of any individuals involved. If there
108+
are additional witnesses, please include them as well.
109+
- Your account of what occurred, and if you believe the incident is ongoing.
110+
- If there is a publicly available record (e.g. a mailing list archive or a
111+
public chat log), please include a link or attachment.
112+
- Any additional information that may be helpful.
113+
114+
After filing a report, a representative will contact you personally, review the
115+
incident, follow up with any additional questions, and make a decision as to how
116+
to respond. If the person who is harassing you is part of the response team, they
117+
will recuse themselves from handling your incident. If the complaint originates
118+
from a member of the response team, it will be handled by a different member of
119+
the response team. We will respect confidentiality requests for the purpose of
120+
protecting victims of abuse.
121+
122+
## Attribution & Acknowledgements
123+
124+
We all stand on the shoulders of giants across many open source communities.
125+
We’d like to thank the communities and projects that established code of conducts
126+
and diversity statements as our inspiration:
127+
128+
- [Django](https://www.djangoproject.com/conduct/reporting/)
129+
- [Python](https://www.python.org/community/diversity/)
130+
- [Ubuntu](http://www.ubuntu.com/about/about-ubuntu/conduct)
131+
- [Contributor Covenant](http://contributor-covenant.org/)
132+
- [Geek Feminism](http://geekfeminism.org/about/code-of-conduct/)
133+
- [Citizen Code of Conduct](http://citizencodeofconduct.org/)

README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,7 @@ The **FileContent** module contains the following resources:
1212

1313
**This project is not maintained or supported by Microsoft.**
1414

15-
It has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/).
16-
For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/).
15+
This project has adopted this [Open Source Code of Conduct](CODEOFCONDUCT.md).
1716

1817
This module should meet the [PowerShell DSC Resource Kit High Quality Resource
1918
Module Guidelines](https://github.com/PowerShell/DscResources/blob/master/HighQualityModuleGuidelines.md).

Tests/Integration/DSR_IniSettingsFile.Integration.Tests.ps1

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
[Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSAvoidUsingConvertToSecureStringWithPlainText", "")]
1+
[Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSAvoidUsingConvertToSecureStringWithPlainText", "")]
22
param ()
33

44
Import-Module -Name (Join-Path -Path (Join-Path -Path (Split-Path $PSScriptRoot -Parent) -ChildPath 'TestHelpers') -ChildPath 'CommonTestHelper.psm1')
@@ -85,26 +85,26 @@ SettingThree=Value3
8585
-ConfigurationData $configData
8686

8787
Start-DscConfiguration -Path $TestDrive -ErrorAction 'Stop' -Wait -Force -Verbose
88-
} | Should Not Throw
88+
} | Should -Not -Throw
8989
}
9090

9191
It 'Should be able to call Get-DscConfiguration without throwing' {
92-
{ $script:currentDscConfig = Get-DscConfiguration -Verbose -ErrorAction Stop } | Should Not throw
92+
{ $script:currentDscConfig = Get-DscConfiguration -Verbose -ErrorAction Stop } | Should -Not -throw
9393
}
9494

9595
It 'Should have set the resource and all the parameters should match' {
9696
$script:current = $script:currentDscConfig | Where-Object {
9797
$_.ConfigurationName -eq $script:configurationName
9898
}
99-
$current.Path | Should Be $script:testTextFile
100-
$current.Section | Should Be $script:testSection
101-
$current.Key | Should Be $script:testKey
102-
$current.Type | Should Be 'Text'
103-
$current.Text | Should Be $script:testText
99+
$current.Path | Should -Be $script:testTextFile
100+
$current.Section | Should -Be $script:testSection
101+
$current.Key | Should -Be $script:testKey
102+
$current.Type | Should -Be 'Text'
103+
$current.Text | Should -Be $script:testText
104104
}
105105

106106
It 'Should be convert the file content to match expected content' {
107-
Get-Content -Path $script:testTextFile -Raw | Should Be $script:testFileExpectedTextContent
107+
Get-Content -Path $script:testTextFile -Raw | Should -Be $script:testFileExpectedTextContent
108108
}
109109

110110
AfterAll {
@@ -147,26 +147,26 @@ SettingThree=Value3
147147
-ConfigurationData $configData
148148

149149
Start-DscConfiguration -Path $TestDrive -ErrorAction 'Stop' -Wait -Force -Verbose
150-
} | Should Not Throw
150+
} | Should -Not -Throw
151151
}
152152

153153
It 'Should be able to call Get-DscConfiguration without throwing' {
154-
{ $script:currentDscConfig = Get-DscConfiguration -Verbose -ErrorAction Stop } | Should Not throw
154+
{ $script:currentDscConfig = Get-DscConfiguration -Verbose -ErrorAction Stop } | Should -Not -throw
155155
}
156156

157157
It 'Should have set the resource and all the parameters should match' {
158158
$script:current = $script:currentDscConfig | Where-Object {
159159
$_.ConfigurationName -eq $script:configurationName
160160
}
161-
$current.Path | Should Be $script:testTextFile
162-
$current.Section | Should Be $script:testSection
163-
$current.Key | Should Be $script:testKey
164-
$current.Type | Should Be 'Text'
165-
$current.Text | Should Be $script:testSecret
161+
$current.Path | Should -Be $script:testTextFile
162+
$current.Section | Should -Be $script:testSection
163+
$current.Key | Should -Be $script:testKey
164+
$current.Type | Should -Be 'Text'
165+
$current.Text | Should -Be $script:testSecret
166166
}
167167

168168
It 'Should be convert the file content to match expected content' {
169-
Get-Content -Path $script:testTextFile -Raw | Should Be $script:testFileExpectedSecretContent
169+
Get-Content -Path $script:testTextFile -Raw | Should -Be $script:testFileExpectedSecretContent
170170
}
171171

172172
AfterAll {

Tests/Integration/DSR_KeyValuePairFile.Integration.Tests.ps1

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
[Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSAvoidUsingConvertToSecureStringWithPlainText", "")]
1+
[Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSAvoidUsingConvertToSecureStringWithPlainText", "")]
22
param ()
33

44
Import-Module -Name (Join-Path -Path (Join-Path -Path (Split-Path $PSScriptRoot -Parent) -ChildPath 'TestHelpers') -ChildPath 'CommonTestHelper.psm1')
@@ -87,26 +87,26 @@ Setting3.Test=Value4
8787
-ConfigurationData $configData
8888

8989
Start-DscConfiguration -Path $TestDrive -ErrorAction 'Stop' -Wait -Force -Verbose
90-
} | Should Not Throw
90+
} | Should -Not -Throw
9191
}
9292

9393
It 'Should be able to call Get-DscConfiguration without throwing' {
94-
{ $script:currentDscConfig = Get-DscConfiguration -Verbose -ErrorAction Stop } | Should Not throw
94+
{ $script:currentDscConfig = Get-DscConfiguration -Verbose -ErrorAction Stop } | Should -Not -throw
9595
}
9696

9797
It 'Should have set the resource and all the parameters should match' {
9898
$script:current = $script:currentDscConfig | Where-Object {
9999
$_.ConfigurationName -eq $script:configurationName
100100
}
101-
$current.Path | Should Be $script:testTextFile
102-
$current.Name | Should Be $script:testName
103-
$current.Ensure | Should Be 'Present'
104-
$current.Type | Should Be 'Text'
105-
$current.Text | Should Be "$($script:testText),$($script:testText),$($script:testText)"
101+
$current.Path | Should -Be $script:testTextFile
102+
$current.Name | Should -Be $script:testName
103+
$current.Ensure | Should -Be 'Present'
104+
$current.Type | Should -Be 'Text'
105+
$current.Text | Should -Be "$($script:testText),$($script:testText),$($script:testText)"
106106
}
107107

108108
It 'Should be convert the file content to match expected content' {
109-
Get-Content -Path $script:testTextFile -Raw | Should Be $script:testFileExpectedTextContent
109+
Get-Content -Path $script:testTextFile -Raw | Should -Be $script:testFileExpectedTextContent
110110
}
111111

112112
AfterAll {
@@ -149,26 +149,26 @@ Setting3.Test=Value4
149149
-ConfigurationData $configData
150150

151151
Start-DscConfiguration -Path $TestDrive -ErrorAction 'Stop' -Wait -Force -Verbose
152-
} | Should Not Throw
152+
} | Should -Not -Throw
153153
}
154154

155155
It 'Should be able to call Get-DscConfiguration without throwing' {
156-
{ $script:currentDscConfig = Get-DscConfiguration -Verbose -ErrorAction Stop } | Should Not throw
156+
{ $script:currentDscConfig = Get-DscConfiguration -Verbose -ErrorAction Stop } | Should -Not -throw
157157
}
158158

159159
It 'Should have set the resource and all the parameters should match' {
160160
$script:current = $script:currentDscConfig | Where-Object {
161161
$_.ConfigurationName -eq $script:configurationName
162162
}
163-
$current.Path | Should Be $script:testTextFile
164-
$current.Name | Should Be $script:testName
165-
$current.Ensure | Should Be 'Present'
166-
$current.Type | Should Be 'Text'
167-
$current.Text | Should Be "$($script:testSecret),$($script:testSecret),$($script:testSecret)"
163+
$current.Path | Should -Be $script:testTextFile
164+
$current.Name | Should -Be $script:testName
165+
$current.Ensure | Should -Be 'Present'
166+
$current.Type | Should -Be 'Text'
167+
$current.Text | Should -Be "$($script:testSecret),$($script:testSecret),$($script:testSecret)"
168168
}
169169

170170
It 'Should be convert the file content to match expected content' {
171-
Get-Content -Path $script:testTextFile -Raw | Should Be $script:testFileExpectedSecretContent
171+
Get-Content -Path $script:testTextFile -Raw | Should -Be $script:testFileExpectedSecretContent
172172
}
173173

174174
AfterAll {
@@ -208,26 +208,26 @@ Setting3.Test=Value4
208208
-ConfigurationData $configData
209209

210210
Start-DscConfiguration -Path $TestDrive -ErrorAction 'Stop' -Wait -Force -Verbose
211-
} | Should Not Throw
211+
} | Should -Not -Throw
212212
}
213213

214214
It 'Should be able to call Get-DscConfiguration without throwing' {
215-
{ $script:currentDscConfig = Get-DscConfiguration -Verbose -ErrorAction Stop } | Should Not throw
215+
{ $script:currentDscConfig = Get-DscConfiguration -Verbose -ErrorAction Stop } | Should -Not -throw
216216
}
217217

218218
It 'Should have set the resource and all the parameters should match' {
219219
$script:current = $script:currentDscConfig | Where-Object {
220220
$_.ConfigurationName -eq $script:configurationName
221221
}
222-
$current.Path | Should Be $script:testTextFile
223-
$current.Name | Should Be $script:testName
224-
$current.Ensure | Should Be 'Absent'
225-
$current.Type | Should Be 'Text'
226-
$current.Text | Should BeNullOrEmpty
222+
$current.Path | Should -Be $script:testTextFile
223+
$current.Name | Should -Be $script:testName
224+
$current.Ensure | Should -Be 'Absent'
225+
$current.Type | Should -Be 'Text'
226+
$current.Text | Should -BeNullOrEmpty
227227
}
228228

229229
It 'Should be convert the file content to match expected content' {
230-
Get-Content -Path $script:testTextFile -Raw | Should Be $script:testFileExpectedAbsentContent
230+
Get-Content -Path $script:testTextFile -Raw | Should -Be $script:testFileExpectedAbsentContent
231231
}
232232

233233
AfterAll {

0 commit comments

Comments
 (0)