Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom config not loaded properly #1531

Closed
jakubvano opened this issue May 19, 2017 · 2 comments
Closed

Custom config not loaded properly #1531

jakubvano opened this issue May 19, 2017 · 2 comments
Labels
bug Unexpected and reproducible misbehavior.

Comments

@jakubvano
Copy link

jakubvano commented May 19, 2017

When linting with custom config file while .swiftlint.yml exists in current directory, disabled_rules are loaded from .swiftlint.yml instead of passed config file.

How to reproduce (0.18.1):

In folder containing

# .swiftlint.yml
# empty
# .swiftlint-ci.yml
disabled_rules:
  - todo
// Foo.swift
// TODO

Run swiftlint lint --config .swiftlint-ci.yml:

Loading configuration from '.swiftlint-ci.yml'
Linting Swift files in current working directory
Linting 'Foo.swift' (1/1)
Foo.swift:1:4: warning: Todo Violation: TODOs should be avoided. (todo)
Done linting! Found 1 violation, 0 serious in 1 file.

@marcelofabri marcelofabri added the bug Unexpected and reproducible misbehavior. label Jun 2, 2017
@marcelofabri
Copy link
Collaborator

I was able to reproduce it with 0.19.0.

@jpsim
Copy link
Collaborator

jpsim commented Jun 3, 2017

I have a fix incoming.

alvarhansen added a commit to alvarhansen/SwiftLint that referenced this issue May 7, 2019
Removes configuration “working directory” check as the configuration
itself can reside in different directory. This check was introduced
with PR realm#1604 for issue realm#1531. At the time it was necessary as
SwiftLint did not support Configuration merging and this stopped
overwriting the configuration.

At the moment, if you load configuration from different path than root
path **and** you also have configuration file in root path then it is
skipped. Now that configuration merging is supported, it is more
correct to merge them.

Example where `Level3/.swiftlint.yml` is skipped:
`swiftlint lint --config ../.swiftlint.yml --path Level3`

```
Level2
│   .swiftlint.yml
│
└───Level3
│   │   .swiftlint.yml
│   │   Level3.swift
```

Adds test for making sure that configuration that is out of working
directory is merged with configuration from working directory.

Adds test for realm#1531 to make sure regression won’t happen in the future.
alvarhansen added a commit to alvarhansen/SwiftLint that referenced this issue May 7, 2019
Removes configuration “working directory” check as the configuration
itself can reside in different directory. This check was introduced
with PR realm#1604 for issue realm#1531. At the time it was necessary as
SwiftLint did not support Configuration merging and this stopped
overwriting the configuration.

At the moment, if you load configuration from different path than root
path **and** you also have configuration file in root path then it is
skipped. Now that configuration merging is supported, it is more
correct to merge them.

Example where `Level3/.swiftlint.yml` is skipped:
`swiftlint lint --config ../.swiftlint.yml --path Level3`

```
Level2
│   .swiftlint.yml
│
└───Level3
│   │   .swiftlint.yml
│   │   Level3.swift
```

Adds test for making sure that configuration that is out of working
directory is merged with configuration from working directory.

Adds test for realm#1531 to make sure regression won’t happen in the future.
alvarhansen added a commit to alvarhansen/SwiftLint that referenced this issue May 7, 2019
Removes configuration “working directory” check as the configuration
itself can reside in different directory. This check was introduced
with PR realm#1604 for issue realm#1531. At the time it was necessary as
SwiftLint did not support Configuration merging and this stopped
overwriting the configuration. Replaced it with configuration file
path check.

At the moment, if you load configuration from different path than root
path **and** you also have configuration file in root path then it is
skipped. Now that configuration merging is supported, it is more
correct to merge them.

Example where `Level3/.swiftlint.yml` is skipped:
`swiftlint lint --config ../.swiftlint.yml --path Level3`

```
Level2
│   .swiftlint.yml
│
└───Level3
│   │   .swiftlint.yml
│   │   Level3.swift
```

Adds test for making sure that configuration that is out of working
directory is merged with configuration from working directory.

Adds test for realm#1531 to make sure regression won’t happen in the future.
alvarhansen added a commit to alvarhansen/SwiftLint that referenced this issue May 7, 2019
Removes configuration “working directory” check as the configuration
itself can reside in different directory. This check was introduced
with PR realm#1604 for issue realm#1531. At the time it was necessary as
SwiftLint did not support Configuration merging and this stopped
overwriting the configuration. Replaced it with configuration file
path check.

At the moment, if you load configuration from different path than root
path **and** you also have configuration file in root path then it is
skipped. Now that configuration merging is supported, it is more
correct to merge them.

Example where `Level3/.swiftlint.yml` is skipped:
`swiftlint lint --config ../.swiftlint.yml --path Level3`

```
Level2
│   .swiftlint.yml
│
└───Level3
│   │   .swiftlint.yml
│   │   Level3.swift
```

Adds test for making sure that configuration that is out of working
directory is merged with configuration from working directory.

Adds test for realm#1531 to make sure regression won’t happen in the future.
alvarhansen added a commit to alvarhansen/SwiftLint that referenced this issue May 7, 2019
Removes configuration “working directory” check as the configuration
itself can reside in different directory. This check was introduced
with PR realm#1604 for issue realm#1531. At the time it was necessary as
SwiftLint did not support Configuration merging and this stopped
overwriting the configuration. Replaced it with configuration file
path check.

At the moment, if you load configuration from different path than root
path **and** you also have configuration file in root path then it is
skipped. Now that configuration merging is supported, it is more
correct to merge them.

Example where `Level3/.swiftlint.yml` is skipped:
`swiftlint lint --config ../.swiftlint.yml --path Level3`

```
Level2
│   .swiftlint.yml
│
└───Level3
│   │   .swiftlint.yml
│   │   Level3.swift
```

Adds test for making sure that configuration that is out of working
directory is merged with configuration from working directory.

Adds test for realm#1531 to make sure regression won’t happen in the future.
alvarhansen added a commit to alvarhansen/SwiftLint that referenced this issue Sep 19, 2019
Removes configuration “working directory” check as the configuration
itself can reside in different directory. This check was introduced
with PR realm#1604 for issue realm#1531. At the time it was necessary as
SwiftLint did not support Configuration merging and this stopped
overwriting the configuration. Replaced it with configuration file
path check.

At the moment, if you load configuration from different path than root
path **and** you also have configuration file in root path then it is
skipped. Now that configuration merging is supported, it is more
correct to merge them.

Example where `Level3/.swiftlint.yml` is skipped:
`swiftlint lint --config ../.swiftlint.yml --path Level3`

```
Level2
│   .swiftlint.yml
│
└───Level3
│   │   .swiftlint.yml
│   │   Level3.swift
```

Adds test for making sure that configuration that is out of working
directory is merged with configuration from working directory.

Adds test for realm#1531 to make sure regression won’t happen in the future.
alvarhansen added a commit to alvarhansen/SwiftLint that referenced this issue Sep 20, 2019
Removes configuration “working directory” check as the configuration
itself can reside in different directory. This check was introduced
with PR realm#1604 for issue realm#1531. At the time it was necessary as
SwiftLint did not support Configuration merging and this stopped
overwriting the configuration. Replaced it with configuration file
path check.

At the moment, if you load configuration from different path than root
path **and** you also have configuration file in root path then it is
skipped. Now that configuration merging is supported, it is more
correct to merge them.

Example where `Level3/.swiftlint.yml` is skipped:
`swiftlint lint --config ../.swiftlint.yml --path Level3`

```
Level2
│   .swiftlint.yml
│
└───Level3
│   │   .swiftlint.yml
│   │   Level3.swift
```

Adds test for making sure that configuration that is out of working
directory is merged with configuration from working directory.

Adds test for realm#1531 to make sure regression won’t happen in the future.
alvarhansen added a commit to alvarhansen/SwiftLint that referenced this issue Sep 20, 2019
Removes configuration “working directory” check as the configuration
itself can reside in different directory. This check was introduced
with PR realm#1604 for issue realm#1531. At the time it was necessary as
SwiftLint did not support Configuration merging and this stopped
overwriting the configuration. Replaced it with configuration file
path check.

At the moment, if you load configuration from different path than root
path **and** you also have configuration file in root path then it is
skipped. Now that configuration merging is supported, it is more
correct to merge them.

Example where `Level3/.swiftlint.yml` is skipped:
`swiftlint lint --config ../.swiftlint.yml --path Level3`

```
Level2
│   .swiftlint.yml
│
└───Level3
│   │   .swiftlint.yml
│   │   Level3.swift
```

Adds test for making sure that configuration that is out of working
directory is merged with configuration from working directory.

Adds test for realm#1531 to make sure regression won’t happen in the future.
alvarhansen added a commit to alvarhansen/SwiftLint that referenced this issue Sep 20, 2019
Removes configuration “working directory” check as the configuration
itself can reside in different directory. This check was introduced
with PR realm#1604 for issue realm#1531. At the time it was necessary as
SwiftLint did not support Configuration merging and this stopped
overwriting the configuration. Replaced it with configuration file
path check.

At the moment, if you load configuration from different path than root
path **and** you also have configuration file in root path then it is
skipped. Now that configuration merging is supported, it is more
correct to merge them.

Example where `Level3/.swiftlint.yml` is skipped:
`swiftlint lint --config ../.swiftlint.yml --path Level3`

```
Level2
│   .swiftlint.yml
│
└───Level3
│   │   .swiftlint.yml
│   │   Level3.swift
```

Adds test for making sure that configuration that is out of working
directory is merged with configuration from working directory.

Adds test for realm#1531 to make sure regression won’t happen in the future.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Unexpected and reproducible misbehavior.
Projects
None yet
Development

No branches or pull requests

3 participants